1
1
import { ClientReport } from './clientreport' ;
2
2
import { DsnComponents } from './dsn' ;
3
3
import { Event } from './event' ;
4
+ import { ReplayEvent , ReplayRecordingData } from './replay' ;
4
5
import { SdkInfo } from './sdkinfo' ;
5
6
import { Session , SessionAggregates } from './session' ;
6
7
import { Transaction } from './transaction' ;
@@ -27,7 +28,9 @@ export type EnvelopeItemType =
27
28
| 'transaction'
28
29
| 'attachment'
29
30
| 'event'
30
- | 'profile' ;
31
+ | 'profile'
32
+ | 'replay_event'
33
+ | 'replay_recording' ;
31
34
32
35
export type BaseEnvelopeHeaders = {
33
36
[ key : string ] : unknown ;
@@ -62,6 +65,8 @@ type UserFeedbackItemHeaders = { type: 'user_report' };
62
65
type SessionItemHeaders = { type : 'session' } ;
63
66
type SessionAggregatesItemHeaders = { type : 'sessions' } ;
64
67
type ClientReportItemHeaders = { type : 'client_report' } ;
68
+ type ReplayEventItemHeaders = { type : 'replay_event' } ;
69
+ type ReplayRecordingItemHeaders = { type : 'replay_recording' ; length : number } ;
65
70
66
71
export type EventItem = BaseEnvelopeItem < EventItemHeaders , Event > ;
67
72
export type AttachmentItem = BaseEnvelopeItem < AttachmentItemHeaders , string | Uint8Array > ;
@@ -70,14 +75,18 @@ export type SessionItem =
70
75
| BaseEnvelopeItem < SessionItemHeaders , Session >
71
76
| BaseEnvelopeItem < SessionAggregatesItemHeaders , SessionAggregates > ;
72
77
export type ClientReportItem = BaseEnvelopeItem < ClientReportItemHeaders , ClientReport > ;
78
+ type ReplayEventItem = BaseEnvelopeItem < ReplayEventItemHeaders , ReplayEvent > ;
79
+ type ReplayRecordingItem = BaseEnvelopeItem < ReplayRecordingItemHeaders , ReplayRecordingData > ;
73
80
74
81
export type EventEnvelopeHeaders = { event_id : string ; sent_at : string ; trace ?: DynamicSamplingContext } ;
75
82
type SessionEnvelopeHeaders = { sent_at : string } ;
76
83
type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders ;
84
+ type ReplayEnvelopeHeaders = BaseEnvelopeHeaders ;
77
85
78
86
export type EventEnvelope = BaseEnvelope < EventEnvelopeHeaders , EventItem | AttachmentItem | UserFeedbackItem > ;
79
87
export type SessionEnvelope = BaseEnvelope < SessionEnvelopeHeaders , SessionItem > ;
80
88
export type ClientReportEnvelope = BaseEnvelope < ClientReportEnvelopeHeaders , ClientReportItem > ;
89
+ export type ReplayEnvelope = [ ReplayEnvelopeHeaders , [ ReplayEventItem , ReplayRecordingItem ] ] ;
81
90
82
- export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope ;
91
+ export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope ;
83
92
export type EnvelopeItem = Envelope [ 1 ] [ number ] ;
0 commit comments