1
1
import type { AttachmentType } from './attachment' ;
2
2
import type { SerializedCheckIn } from './checkin' ;
3
3
import type { ClientReport } from './clientreport' ;
4
+ import type { LegacyCSPReport } from './csp' ;
4
5
import type { DsnComponents } from './dsn' ;
5
6
import type { Event } from './event' ;
6
7
import type { FeedbackEvent , UserFeedback } from './feedback' ;
@@ -41,7 +42,8 @@ export type EnvelopeItemType =
41
42
| 'replay_recording'
42
43
| 'check_in'
43
44
| 'statsd'
44
- | 'span' ;
45
+ | 'span'
46
+ | 'raw_security' ;
45
47
46
48
export type BaseEnvelopeHeaders = {
47
49
[ key : string ] : unknown ;
@@ -84,6 +86,7 @@ type ProfileItemHeaders = { type: 'profile' };
84
86
type ProfileChunkItemHeaders = { type : 'profile_chunk' } ;
85
87
type StatsdItemHeaders = { type : 'statsd' ; length : number } ;
86
88
type SpanItemHeaders = { type : 'span' } ;
89
+ type RawSecurityHeaders = { type : 'raw_security' ; sentry_release ?: string ; sentry_environment ?: string } ;
87
90
88
91
export type EventItem = BaseEnvelopeItem < EventItemHeaders , Event > ;
89
92
export type AttachmentItem = BaseEnvelopeItem < AttachmentItemHeaders , string | Uint8Array > ;
@@ -100,6 +103,7 @@ export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
100
103
export type ProfileItem = BaseEnvelopeItem < ProfileItemHeaders , Profile > ;
101
104
export type ProfileChunkItem = BaseEnvelopeItem < ProfileChunkItemHeaders , ProfileChunk > ;
102
105
export type SpanItem = BaseEnvelopeItem < SpanItemHeaders , Partial < SpanJSON > > ;
106
+ export type RawSecurityItem = BaseEnvelopeItem < RawSecurityHeaders , LegacyCSPReport > ;
103
107
104
108
export type EventEnvelopeHeaders = { event_id : string ; sent_at : string ; trace ?: Partial < DynamicSamplingContext > } ;
105
109
type SessionEnvelopeHeaders = { sent_at : string } ;
@@ -120,6 +124,7 @@ export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
120
124
export type StatsdEnvelope = BaseEnvelope < StatsdEnvelopeHeaders , StatsdItem > ;
121
125
export type SpanEnvelope = BaseEnvelope < SpanEnvelopeHeaders , SpanItem > ;
122
126
export type ProfileChunkEnvelope = BaseEnvelope < BaseEnvelopeHeaders , ProfileChunkItem > ;
127
+ export type RawSecurityEnvelope = BaseEnvelope < BaseEnvelopeHeaders , RawSecurityItem > ;
123
128
124
129
export type Envelope =
125
130
| EventEnvelope
@@ -129,6 +134,7 @@ export type Envelope =
129
134
| ReplayEnvelope
130
135
| CheckInEnvelope
131
136
| StatsdEnvelope
132
- | SpanEnvelope ;
137
+ | SpanEnvelope
138
+ | RawSecurityEnvelope ;
133
139
134
140
export type EnvelopeItem = Envelope [ 1 ] [ number ] ;
0 commit comments