1
- import { Envelope , EventStatus } from '@sentry/types' ;
1
+ import {
2
+ Envelope ,
3
+ InternalBaseTransportOptions ,
4
+ NewTransport ,
5
+ TransportCategory ,
6
+ TransportRequest ,
7
+ TransportRequestExecutor ,
8
+ TransportResponse ,
9
+ } from '@sentry/types' ;
2
10
import {
3
11
disabledUntil ,
4
12
eventStatusFromHttpCode ,
@@ -21,52 +29,6 @@ export const ATTACHMENT_TRANSPORT_CATEGORY = 'attachment';
21
29
22
30
export const SESSION_TRANSPORT_CATEGORY = 'session' ;
23
31
24
- type TransportCategory =
25
- | typeof ERROR_TRANSPORT_CATEGORY
26
- | typeof TRANSACTION_TRANSPORT_CATEGORY
27
- | typeof ATTACHMENT_TRANSPORT_CATEGORY
28
- | typeof SESSION_TRANSPORT_CATEGORY ;
29
-
30
- export type TransportRequest = {
31
- body : string ;
32
- category : TransportCategory ;
33
- } ;
34
-
35
- export type TransportMakeRequestResponse = {
36
- body ?: string ;
37
- headers ?: {
38
- [ key : string ] : string | null ;
39
- 'x-sentry-rate-limits' : string | null ;
40
- 'retry-after' : string | null ;
41
- } ;
42
- reason ?: string ;
43
- statusCode : number ;
44
- } ;
45
-
46
- export type TransportResponse = {
47
- status : EventStatus ;
48
- reason ?: string ;
49
- } ;
50
-
51
- interface InternalBaseTransportOptions {
52
- bufferSize ?: number ;
53
- }
54
- export interface BaseTransportOptions extends InternalBaseTransportOptions {
55
- // url to send the event
56
- // transport does not care about dsn specific - client should take care of
57
- // parsing and figuring that out
58
- url : string ;
59
- }
60
-
61
- export interface NewTransport {
62
- send ( request : Envelope ) : PromiseLike < TransportResponse > ;
63
- flush ( timeout ?: number ) : PromiseLike < boolean > ;
64
- }
65
-
66
- export type TransportRequestExecutor = ( request : TransportRequest ) => PromiseLike < TransportMakeRequestResponse > ;
67
-
68
- export const DEFAULT_TRANSPORT_BUFFER_SIZE = 30 ;
69
-
70
32
/**
71
33
* Creates a `NewTransport`
72
34
*
0 commit comments