123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- import type {DebugImage} from 'sentry/components/events/interfaces/debugMeta/types';
- import type {TraceContextType} from 'sentry/components/events/interfaces/spans/types';
- import type {SymbolicatorStatus} from 'sentry/components/events/interfaces/types';
- import type {PlatformKey} from 'sentry/data/platformCategories';
- import type {RawCrumb} from './breadcrumbs';
- import type {IssueAttachment} from './group';
- import type {Release} from './release';
- import type {RawStacktrace, StackTraceMechanism, StacktraceType} from './stacktrace';
- // TODO(epurkhiser): objc and cocoa should almost definitely be moved into PlatformKey
- export type PlatformType = PlatformKey | 'objc' | 'cocoa';
- export type Level = 'error' | 'fatal' | 'info' | 'warning' | 'sample';
- /**
- * Grouping Configuration.
- */
- export type EventGroupComponent = {
- contributes: boolean;
- hint: string | null;
- id: string;
- name: string | null;
- values: EventGroupComponent[] | string[];
- };
- export type EventGroupingConfig = {
- base: string | null;
- changelog: string;
- delegates: string[];
- hidden: boolean;
- id: string;
- latest: boolean;
- risk: number;
- strategies: string[];
- };
- type EventGroupVariantKey = 'custom-fingerprint' | 'app' | 'default' | 'system';
- export enum EventGroupVariantType {
- CUSTOM_FINGERPRINT = 'custom-fingerprint',
- COMPONENT = 'component',
- SALTED_COMPONENT = 'salted-component',
- }
- export type EventGroupVariant = {
- description: string | null;
- hash: string | null;
- hashMismatch: boolean;
- key: EventGroupVariantKey;
- type: EventGroupVariantType;
- client_values?: Array<string>;
- component?: EventGroupComponent;
- config?: EventGroupingConfig;
- matched_rule?: string;
- values?: Array<string>;
- };
- export type EventGroupInfo = Record<EventGroupVariantKey, EventGroupVariant>;
- /**
- * SDK Update metadata
- */
- type EnableIntegrationSuggestion = {
- enables: Array<SDKUpdatesSuggestion>;
- integrationName: string;
- type: 'enableIntegration';
- integrationUrl?: string | null;
- };
- export type UpdateSdkSuggestion = {
- enables: Array<SDKUpdatesSuggestion>;
- newSdkVersion: string;
- sdkName: string;
- type: 'updateSdk';
- sdkUrl?: string | null;
- };
- type ChangeSdkSuggestion = {
- enables: Array<SDKUpdatesSuggestion>;
- newSdkName: string;
- type: 'changeSdk';
- sdkUrl?: string | null;
- };
- export type SDKUpdatesSuggestion =
- | EnableIntegrationSuggestion
- | UpdateSdkSuggestion
- | ChangeSdkSuggestion;
- /**
- * Frames, Threads and Event interfaces.
- */
- export interface Thread {
- crashed: boolean;
- current: boolean;
- id: number;
- rawStacktrace: RawStacktrace;
- stacktrace: StacktraceType | null;
- name?: string | null;
- }
- export type Frame = {
- absPath: string | null;
- colNo: number | null;
- context: Array<[number, string]>;
- errors: Array<any> | null;
- filename: string | null;
- function: string | null;
- inApp: boolean;
- instructionAddr: string | null;
- lineNo: number | null;
- module: string | null;
- package: string | null;
- platform: PlatformType | null;
- rawFunction: string | null;
- symbol: string | null;
- symbolAddr: string | null;
- trust: any | null;
- vars: Record<string, any> | null;
- addrMode?: string;
- isPrefix?: boolean;
- isSentinel?: boolean;
- map?: string | null;
- mapUrl?: string | null;
- minGroupingLevel?: number;
- origAbsPath?: string | null;
- symbolicatorStatus?: SymbolicatorStatus;
- };
- export enum FrameBadge {
- SENTINEL = 'sentinel',
- PREFIX = 'prefix',
- GROUPING = 'grouping',
- }
- export type ExceptionValue = {
- mechanism: StackTraceMechanism | null;
- module: string | null;
- rawStacktrace: RawStacktrace;
- stacktrace: StacktraceType | null;
- threadId: number | null;
- type: string;
- value: string;
- frames?: Frame[] | null;
- };
- export type ExceptionType = {
- excOmitted: any | null;
- hasSystemFrames: boolean;
- values?: Array<ExceptionValue>;
- };
- export type TreeLabelPart =
- | string
- | {
- classbase?: string;
- datapath?: (string | number)[];
- filebase?: string;
- function?: string;
- is_prefix?: boolean;
- // is_sentinel is no longer being used,
- // but we will still assess whether we will use this property in the near future.
- is_sentinel?: boolean;
- package?: string;
- type?: string;
- };
- // This type is incomplete
- export type EventMetadata = {
- current_level?: number;
- current_tree_label?: TreeLabelPart[];
- directive?: string;
- display_title_with_tree_label?: boolean;
- filename?: string;
- finest_tree_label?: TreeLabelPart[];
- function?: string;
- message?: string;
- origin?: string;
- stripped_crash?: boolean;
- title?: string;
- type?: string;
- uri?: string;
- value?: string;
- };
- export enum EventOrGroupType {
- ERROR = 'error',
- CSP = 'csp',
- HPKP = 'hpkp',
- EXPECTCT = 'expectct',
- EXPECTSTAPLE = 'expectstaple',
- DEFAULT = 'default',
- TRANSACTION = 'transaction',
- }
- /**
- * Event interface types.
- */
- export enum EntryType {
- EXCEPTION = 'exception',
- MESSAGE = 'message',
- REQUEST = 'request',
- STACKTRACE = 'stacktrace',
- TEMPLATE = 'template',
- CSP = 'csp',
- EXPECTCT = 'expectct',
- EXPECTSTAPLE = 'expectstaple',
- HPKP = 'hpkp',
- BREADCRUMBS = 'breadcrumbs',
- THREADS = 'threads',
- DEBUGMETA = 'debugmeta',
- SPANS = 'spans',
- SPANTREE = 'spantree',
- }
- type EntryDebugMeta = {
- data: {
- images: Array<DebugImage>;
- };
- type: EntryType.DEBUGMETA;
- };
- type EntryBreadcrumbs = {
- data: {
- values: Array<RawCrumb>;
- };
- type: EntryType.BREADCRUMBS;
- };
- export type EntryThreads = {
- data: {
- values?: Array<Thread>;
- };
- type: EntryType.THREADS;
- };
- export type EntryException = {
- data: ExceptionType;
- type: EntryType.EXCEPTION;
- };
- type EntryStacktrace = {
- data: StacktraceType;
- type: EntryType.STACKTRACE;
- };
- type EntrySpans = {
- data: any;
- type: EntryType.SPANS; // data is not used
- };
- type EntrySpanTree = {
- data: any;
- focusedSpanIds: string[];
- type: EntryType.SPANTREE;
- };
- type EntryMessage = {
- data: {
- formatted: string;
- params?: Record<string, any> | any[];
- };
- type: EntryType.MESSAGE;
- };
- export type EntryRequest = {
- data: {
- method: string;
- url: string;
- cookies?: [key: string, value: string][];
- data?: string | null | Record<string, any> | [key: string, value: any][];
- env?: Record<string, string>;
- fragment?: string;
- headers?: [key: string, value: string][];
- inferredContentType?:
- | null
- | 'application/json'
- | 'application/x-www-form-urlencoded'
- | 'multipart/form-data';
- query?: [key: string, value: string][];
- };
- type: EntryType.REQUEST;
- };
- type EntryTemplate = {
- data: Frame;
- type: EntryType.TEMPLATE;
- };
- type EntryCsp = {
- data: Record<string, any>;
- type: EntryType.CSP;
- };
- type EntryGeneric = {
- data: Record<string, any>;
- type: EntryType.EXPECTCT | EntryType.EXPECTSTAPLE | EntryType.HPKP;
- };
- export type Entry =
- | EntryDebugMeta
- | EntryBreadcrumbs
- | EntryThreads
- | EntryException
- | EntryStacktrace
- | EntrySpans
- | EntrySpanTree
- | EntryMessage
- | EntryRequest
- | EntryTemplate
- | EntryCsp
- | EntryGeneric;
- // Contexts
- type RuntimeContext = {
- type: 'runtime';
- build?: string;
- name?: string;
- raw_description?: string;
- version?: number;
- };
- type DeviceContext = {
- arch: string;
- family: string;
- model: string;
- type: string;
- };
- type OSContext = {
- build: string;
- kernel_version: string;
- name: string;
- type: string;
- version: string;
- };
- type EventContexts = {
- client_os?: OSContext;
- device?: DeviceContext;
- os?: OSContext;
- runtime?: RuntimeContext;
- trace?: TraceContextType;
- };
- export type Measurement = {value: number; unit?: string};
- export type EventTag = {key: string; value: string};
- export type EventUser = {
- data?: string | null;
- email?: string;
- id?: string;
- ip_address?: string;
- name?: string | null;
- username?: string | null;
- };
- type EventBase = {
- contexts: EventContexts;
- crashFile: IssueAttachment | null;
- culprit: string;
- dateReceived: string;
- dist: string | null;
- entries: Entry[];
- errors: any[];
- eventID: string;
- fingerprints: string[];
- groupingConfig: {
- enhancements: string;
- id: string;
- };
- id: string;
- location: string | null;
- message: string;
- metadata: EventMetadata;
- projectID: string;
- size: number;
- tags: EventTag[];
- title: string;
- type:
- | EventOrGroupType.CSP
- | EventOrGroupType.DEFAULT
- | EventOrGroupType.EXPECTCT
- | EventOrGroupType.EXPECTSTAPLE
- | EventOrGroupType.HPKP;
- user: EventUser | null;
- _meta?: Record<string, any>;
- context?: Record<string, any>;
- dateCreated?: string;
- device?: Record<string, any>;
- endTimestamp?: number;
- groupID?: string;
- latestEventID?: string | null;
- measurements?: Record<string, Measurement>;
- nextEventID?: string | null;
- oldestEventID?: string | null;
- packages?: Record<string, string>;
- platform?: PlatformType;
- previousEventID?: string | null;
- projectSlug?: string;
- release?: Release | null;
- sdk?: {
- name: string;
- version: string;
- } | null;
- sdkUpdates?: Array<SDKUpdatesSuggestion>;
- userReport?: any;
- };
- export type EventTransaction = Omit<EventBase, 'entries' | 'type'> & {
- endTimestamp: number;
- entries: (EntrySpans | EntryRequest)[];
- startTimestamp: number;
- type: EventOrGroupType.TRANSACTION;
- contexts?: {
- trace?: TraceContextType;
- };
- title?: string;
- };
- export type EventError = Omit<EventBase, 'entries' | 'type'> & {
- entries: (
- | EntryException
- | EntryStacktrace
- | EntryRequest
- | EntryThreads
- | EntryDebugMeta
- )[];
- type: EventOrGroupType.ERROR;
- };
- export type Event = EventError | EventTransaction | EventBase;
- // Response from EventIdLookupEndpoint
- // /organizations/${orgSlug}/eventids/${eventId}/
- export type EventIdResponse = {
- event: Event;
- eventId: string;
- groupId: string;
- organizationSlug: string;
- projectSlug: string;
- };
|