UNPKG

2.6 kBTypeScriptView Raw
1import type { Attachment } from './attachment';
2import type { Breadcrumb } from './breadcrumb';
3import type { Contexts } from './context';
4import type { DebugMeta } from './debugMeta';
5import type { Exception } from './exception';
6import type { Extras } from './extra';
7import type { Measurements } from './measurement';
8import type { Mechanism } from './mechanism';
9import type { Primitive } from './misc';
10import type { Request } from './request';
11import type { CaptureContext } from './scope';
12import type { SdkInfo } from './sdkinfo';
13import type { SeverityLevel } from './severity';
14import type { MetricSummary, SpanJSON } from './span';
15import type { Thread } from './thread';
16import type { TransactionSource } from './transaction';
17import type { User } from './user';
18/** An event to be sent to Sentry. */
19export interface Event {
20 event_id?: string;
21 message?: string;
22 logentry?: {
23 message?: string;
24 params?: string[];
25 };
26 timestamp?: number;
27 start_timestamp?: number;
28 level?: SeverityLevel;
29 platform?: string;
30 logger?: string;
31 server_name?: string;
32 release?: string;
33 dist?: string;
34 environment?: string;
35 sdk?: SdkInfo;
36 request?: Request;
37 transaction?: string;
38 modules?: {
39 [key: string]: string;
40 };
41 fingerprint?: string[];
42 exception?: {
43 values?: Exception[];
44 };
45 breadcrumbs?: Breadcrumb[];
46 contexts?: Contexts;
47 tags?: {
48 [key: string]: Primitive;
49 };
50 extra?: Extras;
51 user?: User;
52 type?: EventType;
53 spans?: SpanJSON[];
54 measurements?: Measurements;
55 debug_meta?: DebugMeta;
56 sdkProcessingMetadata?: {
57 [key: string]: any;
58 };
59 transaction_info?: {
60 source: TransactionSource;
61 };
62 threads?: {
63 values: Thread[];
64 };
65}
66/**
67 * The type of an `Event`.
68 * Note that `ErrorEvent`s do not have a type (hence its undefined),
69 * while all other events are required to have one.
70 */
71export type EventType = 'transaction' | 'profile' | 'replay_event' | 'feedback' | undefined;
72export interface ErrorEvent extends Event {
73 type: undefined;
74}
75export interface TransactionEvent extends Event {
76 type: 'transaction';
77 _metrics_summary?: Record<string, Array<MetricSummary>>;
78}
79/** JSDoc */
80export interface EventHint {
81 event_id?: string;
82 captureContext?: CaptureContext;
83 mechanism?: Partial<Mechanism>;
84 syntheticException?: Error | null;
85 originalException?: unknown;
86 attachments?: Attachment[];
87 data?: any;
88 integrations?: string[];
89}
90//# sourceMappingURL=event.d.ts.map
\No newline at end of file