1 | import { Scope, Session } from '@sentry/hub';
|
2 | import { Client, Event, EventHint, Integration, IntegrationClass, Options, Severity } from '@sentry/types';
|
3 | import { Dsn } from '@sentry/utils';
|
4 | import { Backend, BackendClass } from './basebackend';
|
5 | import { IntegrationIndex } from './integration';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare abstract class BaseClient<B extends Backend, O extends Options> implements Client<O> {
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | protected readonly _backend: B;
|
45 |
|
46 | protected readonly _options: O;
|
47 |
|
48 | protected readonly _dsn?: Dsn;
|
49 |
|
50 | protected _integrations: IntegrationIndex;
|
51 |
|
52 | protected _processing: number;
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | protected constructor(backendClass: BackendClass<B, O>, options: O);
|
60 | /**
|
61 | * @inheritDoc
|
62 | */
|
63 | captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
|
64 | /**
|
65 | * @inheritDoc
|
66 | */
|
67 | captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined;
|
68 | /**
|
69 | * @inheritDoc
|
70 | */
|
71 | captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
|
72 | /**
|
73 | * @inheritDoc
|
74 | */
|
75 | captureSession(session: Session): void;
|
76 | /**
|
77 | * @inheritDoc
|
78 | */
|
79 | getDsn(): Dsn | undefined;
|
80 | /**
|
81 | * @inheritDoc
|
82 | */
|
83 | getOptions(): O;
|
84 | /**
|
85 | * @inheritDoc
|
86 | */
|
87 | flush(timeout?: number): PromiseLike<boolean>;
|
88 | /**
|
89 | * @inheritDoc
|
90 | */
|
91 | close(timeout?: number): PromiseLike<boolean>;
|
92 | /**
|
93 | * Sets up the integrations
|
94 | */
|
95 | setupIntegrations(): void;
|
96 | /**
|
97 | * @inheritDoc
|
98 | */
|
99 | getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
|
100 | /** Updates existing session based on the provided event */
|
101 | protected _updateSessionFromEvent(session: Session, event: Event): void;
|
102 | /** Deliver captured session to Sentry */
|
103 | protected _sendSession(session: Session): void;
|
104 | /** Waits for the client to be done with processing. */
|
105 | protected _isClientProcessing(timeout?: number): PromiseLike<boolean>;
|
106 | /** Returns the current backend. */
|
107 | protected _getBackend(): B;
|
108 | /** Determines whether this SDK is enabled and a valid Dsn is present. */
|
109 | protected _isEnabled(): boolean;
|
110 | /**
|
111 | * Adds common information to events.
|
112 | *
|
113 | * The information includes release and environment from `options`,
|
114 | * breadcrumbs and context (extra, tags and user) from the scope.
|
115 | *
|
116 | * Information that is already present in the event is never overwritten. For
|
117 | * nested objects, such as the context, keys are merged.
|
118 | *
|
119 | * @param event The original event.
|
120 | * @param hint May contain additional information about the original exception.
|
121 | * @param scope A scope containing event metadata.
|
122 | * @returns A new event with more information.
|
123 | */
|
124 | protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null>;
|
125 | /**
|
126 | * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
|
127 | * Normalized keys:
|
128 | * - `breadcrumbs.data`
|
129 | * - `user`
|
130 | * - `contexts`
|
131 | * - `extra`
|
132 | * @param event Event
|
133 | * @returns Normalized event
|
134 | */
|
135 | protected _normalizeEvent(event: Event | null, depth: number): Event | null;
|
136 | /**
|
137 | * Enhances event using the client configuration.
|
138 | * It takes care of all "static" values like environment, release and `dist`,
|
139 | * as well as truncating overly long values.
|
140 | * @param event event instance to be enhanced
|
141 | */
|
142 | protected _applyClientOptions(event: Event): void;
|
143 | /**
|
144 | * This function adds all used integrations to the SDK info in the event.
|
145 | * @param event The event that will be filled with all integrations.
|
146 | */
|
147 | protected _applyIntegrationsMetadata(event: Event): void;
|
148 | /**
|
149 | * Tells the backend to send this event
|
150 | * @param event The Sentry event to send
|
151 | */
|
152 | protected _sendEvent(event: Event): void;
|
153 | /**
|
154 | * Processes the event and logs an error in case of rejection
|
155 | * @param event
|
156 | * @param hint
|
157 | * @param scope
|
158 | */
|
159 | protected _captureEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<string | undefined>;
|
160 | /**
|
161 | * Processes an event (either error or message) and sends it to Sentry.
|
162 | *
|
163 | * This also adds breadcrumbs and context information to the event. However,
|
164 | * platform specific meta data (such as the User's IP address) must be added
|
165 | * by the SDK implementor.
|
166 | *
|
167 | *
|
168 | * @param event The event to send to Sentry.
|
169 | * @param hint May contain additional information about the original exception.
|
170 | * @param scope A scope containing event metadata.
|
171 | * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
|
172 | */
|
173 | protected _processEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<Event>;
|
174 | /**
|
175 | * Occupies the client with processing and event
|
176 | */
|
177 | protected _process<T>(promise: PromiseLike<T>): void;
|
178 | }
|
179 | //# sourceMappingURL=baseclient.d.ts.map |
\ | No newline at end of file |