1 | import { API } from '@sentry/core';
|
2 | import { Event, Response as SentryResponse, SentryRequestType, Transport, TransportOptions } from '@sentry/types';
|
3 | import { PromiseBuffer } from '@sentry/utils';
|
4 |
|
5 | export declare abstract class BaseTransport implements Transport {
|
6 | options: TransportOptions;
|
7 | |
8 |
|
9 |
|
10 | url: string;
|
11 |
|
12 | protected readonly _api: API;
|
13 |
|
14 | protected readonly _buffer: PromiseBuffer<SentryResponse>;
|
15 |
|
16 | protected readonly _rateLimits: Record<string, Date>;
|
17 | constructor(options: TransportOptions);
|
18 | /**
|
19 | * @inheritDoc
|
20 | */
|
21 | sendEvent(_: Event): PromiseLike<SentryResponse>;
|
22 | /**
|
23 | * @inheritDoc
|
24 | */
|
25 | close(timeout?: number): PromiseLike<boolean>;
|
26 | /**
|
27 | * Handle Sentry repsonse for promise-based transports.
|
28 | */
|
29 | protected _handleResponse({ requestType, response, headers, resolve, reject, }: {
|
30 | requestType: SentryRequestType;
|
31 | response: Response | XMLHttpRequest;
|
32 | headers: Record<string, string | null>;
|
33 | resolve: (value?: SentryResponse | PromiseLike<SentryResponse> | null | undefined) => void;
|
34 | reject: (reason?: unknown) => void;
|
35 | }): void;
|
36 | /**
|
37 | * Gets the time that given category is disabled until for rate limiting
|
38 | */
|
39 | protected _disabledUntil(requestType: SentryRequestType): Date;
|
40 | /**
|
41 | * Checks if a category is rate limited
|
42 | */
|
43 | protected _isRateLimited(requestType: SentryRequestType): boolean;
|
44 | /**
|
45 | * Sets internal _rateLimits from incoming headers. Returns true if headers contains a non-empty rate limiting header.
|
46 | */
|
47 | protected _handleRateLimit(headers: Record<string, string | null>): boolean;
|
48 | }
|
49 | //# sourceMappingURL=base.d.ts.map |
\ | No newline at end of file |