11import { DsnLike } from './dsn' ;
2+ import { Envelope } from './envelope' ;
23import { Event } from './event' ;
4+ import { EventStatus } from './eventstatus' ;
35import { SentryRequestType } from './request' ;
46import { Response } from './response' ;
57import { SdkMetadata } from './sdkmetadata' ;
@@ -13,6 +15,46 @@ export type Outcome =
1315 | 'ratelimit_backoff'
1416 | 'sample_rate' ;
1517
18+ export type TransportCategory = 'error' | 'transaction' | 'attachment' | 'session' ;
19+
20+ export type TransportRequest = {
21+ body : string ;
22+ category : TransportCategory ;
23+ } ;
24+
25+ export type TransportMakeRequestResponse = {
26+ body ?: string ;
27+ headers ?: {
28+ [ key : string ] : string | null ;
29+ 'x-sentry-rate-limits' : string | null ;
30+ 'retry-after' : string | null ;
31+ } ;
32+ reason ?: string ;
33+ statusCode : number ;
34+ } ;
35+
36+ export type TransportResponse = {
37+ status : EventStatus ;
38+ reason ?: string ;
39+ } ;
40+
41+ export interface InternalBaseTransportOptions {
42+ bufferSize ?: number ;
43+ }
44+ export interface BaseTransportOptions extends InternalBaseTransportOptions {
45+ // url to send the event
46+ // transport does not care about dsn specific - client should take care of
47+ // parsing and figuring that out
48+ url : string ;
49+ }
50+
51+ export interface NewTransport {
52+ send ( request : Envelope ) : PromiseLike < TransportResponse > ;
53+ flush ( timeout ?: number ) : PromiseLike < boolean > ;
54+ }
55+
56+ export type TransportRequestExecutor = ( request : TransportRequest ) => PromiseLike < TransportMakeRequestResponse > ;
57+
1658/** Transport used sending data to Sentry */
1759export interface Transport {
1860 /**
0 commit comments