@@ -5,7 +5,7 @@ import type {
5
5
Envelope ,
6
6
EnvelopeItem ,
7
7
EnvelopeItemType ,
8
- Event ,
8
+ Event as SentryEvent ,
9
9
EventEnvelope ,
10
10
EventEnvelopeHeaders ,
11
11
SessionContext ,
@@ -29,7 +29,7 @@ export const envelopeParser = (request: Request | null): unknown[] => {
29
29
} ) ;
30
30
} ;
31
31
32
- export const envelopeRequestParser = < T = Event > ( request : Request | null , envelopeIndex = 2 ) : T => {
32
+ export const envelopeRequestParser = < T = SentryEvent > ( request : Request | null , envelopeIndex = 2 ) : T => {
33
33
return envelopeParser ( request ) [ envelopeIndex ] as T ;
34
34
} ;
35
35
@@ -50,7 +50,7 @@ export const properEnvelopeParser = (request: Request | null): EnvelopeItem[] =>
50
50
return items ;
51
51
} ;
52
52
53
- export type EventAndTraceHeader = [ Event , EventEnvelopeHeaders [ 'trace' ] ] ;
53
+ export type EventAndTraceHeader = [ SentryEvent , EventEnvelopeHeaders [ 'trace' ] ] ;
54
54
55
55
/**
56
56
* Returns the first event item and `trace` envelope header from an envelope.
@@ -69,7 +69,7 @@ const properFullEnvelopeParser = <T extends Envelope>(request: Request | null):
69
69
} ;
70
70
71
71
function getEventAndTraceHeader ( envelope : EventEnvelope ) : EventAndTraceHeader {
72
- const event = envelope [ 1 ] [ 0 ] ?. [ 1 ] as Event | undefined ;
72
+ const event = envelope [ 1 ] [ 0 ] ?. [ 1 ] as SentryEvent | undefined ;
73
73
const trace = envelope [ 0 ] ?. trace ;
74
74
75
75
if ( ! event || ! trace ) {
@@ -79,7 +79,7 @@ function getEventAndTraceHeader(envelope: EventEnvelope): EventAndTraceHeader {
79
79
return [ event , trace ] ;
80
80
}
81
81
82
- export const properEnvelopeRequestParser = < T = Event > ( request : Request | null , envelopeIndex = 1 ) : T => {
82
+ export const properEnvelopeRequestParser = < T = SentryEvent > ( request : Request | null , envelopeIndex = 1 ) : T => {
83
83
return properEnvelopeParser ( request ) [ 0 ] ?. [ envelopeIndex ] as T ;
84
84
} ;
85
85
@@ -182,13 +182,13 @@ export async function runScriptInSandbox(
182
182
*
183
183
* @param {Page } page
184
184
* @param {string } [url]
185
- * @return {* } {Promise<Array<Event >>}
185
+ * @return {* } {Promise<Array<SentryEvent >>}
186
186
*/
187
- export async function getSentryEvents ( page : Page , url ?: string ) : Promise < Array < Event > > {
187
+ export async function getSentryEvents ( page : Page , url ?: string ) : Promise < Array < SentryEvent > > {
188
188
if ( url ) {
189
189
await page . goto ( url ) ;
190
190
}
191
- const eventsHandle = await page . evaluateHandle < Array < Event > > ( 'window.events' ) ;
191
+ const eventsHandle = await page . evaluateHandle < Array < SentryEvent > > ( 'window.events' ) ;
192
192
193
193
return eventsHandle . jsonValue ( ) ;
194
194
}
@@ -203,7 +203,7 @@ export async function waitForTransactionRequestOnUrl(page: Page, url: string): P
203
203
return req ;
204
204
}
205
205
206
- export function waitForErrorRequest ( page : Page , callback ?: ( event : Event ) => boolean ) : Promise < Request > {
206
+ export function waitForErrorRequest ( page : Page , callback ?: ( event : SentryEvent ) => boolean ) : Promise < Request > {
207
207
return page . waitForRequest ( req => {
208
208
const postData = req . postData ( ) ;
209
209
if ( ! postData ) {
0 commit comments