import type { EventEnvelopeHeaders, Measurements, SerializedLog } from "@sentry/core"; export type RawEventContext = { /** * The content-type header of the event */ contentType: string; /** * The raw data in string form of the request. * Use this function to parse and process the raw data it to whatever data structure * you expect for the given `contentType`. * * Return the processed object or undefined if the event should be ignored. */ data: string | Uint8Array; }; export type TraceId = string; export type SpanId = string; export type FrameVars = { [key: string]: string; }; export type EventFrame = { filename?: string; abs_path?: string; function?: string; module?: string; lineno?: number; colno?: number; pre_context?: string[]; post_context?: string[]; context_line?: string; vars?: FrameVars; instruction_addr?: string; in_app?: boolean; }; export type EventStacktrace = { frames: EventFrame[]; }; export type EventExceptionValue = { type: string; value: string; stacktrace?: EventStacktrace; }; export type EventException = { values: EventExceptionValue[]; value: undefined; } | { values: undefined; value: EventExceptionValue; }; export type Breadcrumb = { data?: Record; message?: string; category: string; timestamp: string; type: string | "default"; }; export type Context = Record; export type Sdk = { name: string; version: string; lastSeen: number; }; type CommonEventAttrs = { event_id: string; timestamp: number; message?: SentryFormattedMessage; breadcrumbs?: Breadcrumb[] | { values: Breadcrumb[]; }; transaction?: string; environment?: string; platform?: string; server_name?: string; release?: string; start_timestamp?: number; contexts?: Contexts; tags?: Tags; extra?: Context; request?: Record | string>; modules?: Record; sdk?: Sdk; measurements?: Measurements; }; export type TraceContext = EventEnvelopeHeaders["trace"] & { span_id?: string; status?: "ok" | string; description?: string; parent_span_id?: string; data?: Record; op?: string; }; export type Contexts = { trace?: TraceContext; } & { [key: string]: Context; }; export type Tags = { [key: string]: string; }; export type SentryFormattedMessage = string | { formatted: string; params?: []; }; export type SentryErrorEvent = CommonEventAttrs & { type?: "error" | "event" | "message" | "default"; exception?: EventException; }; export type Span = { trace_id?: TraceId; span_id: SpanId; parent_span_id?: string | null; op?: string | null; description?: string | null; start_timestamp: number; tags?: Tags | null; timestamp: number; status?: "ok" | string; transaction?: SentryTransactionEvent; children?: Span[]; data?: Record; }; export type SentryTransactionEvent = CommonEventAttrs & { type: "transaction"; spans?: Span[]; start_timestamp: string; contexts: Contexts & { trace: TraceContext; }; }; export type ProfileSample = { elapsed_since_start_ns: string; stack_id: number; thread_id: string; }; export type ProcessedProfileSample = { start_timestamp: number; stack_id: number; thread_id: string; }; export type SentryProfile = { samples: ProfileSample[]; stacks: number[][]; frames: EventFrame[]; platform?: string; thread_metadata?: Record; }; export type SentryProcessedProfile = SentryProfile & { samples: ProcessedProfileSample[]; }; export type AggregateCallData = { name: string; totalTime: number; samples: number; traceIds: Set; }; export type SentryDeviceInfo = { architecture: string; is_emulator?: boolean; locale?: string; manufacturer?: string; model?: string; }; export type SentryOSInfo = { name: string; version: string; build_number?: string; }; export type SentryProfileTransactionInfo = { name: string; id: string; trace_id: string; active_thread_id: string; relative_start_ns?: string; relative_end_ns?: string; }; export type SentryProfileV1Event = CommonEventAttrs & { type: "profile"; device: SentryDeviceInfo; os: SentryOSInfo; transactions?: Array; transaction?: SentryProfileTransactionInfo; version: "1"; profile: SentryProfile; }; export type SentryLogEventItem = SerializedLog & { id: string; severity_number: number; sdk: string | undefined; }; export type SentryLogEvent = CommonEventAttrs & { type: "log"; items: Array; }; export type SentryEvent = SentryErrorEvent | SentryTransactionEvent | SentryProfileV1Event | SentryLogEvent; export {};