12
12
/* eslint-disable max-lines */
13
13
/* eslint-disable @typescript-eslint/no-explicit-any */
14
14
15
- import { Event , ExtractedNodeRequestData , Transaction , TransactionSource } from '@sentry/types' ;
15
+ import { CrossPlatformRequest , Event , ExtractedNodeRequestData , Transaction , TransactionSource } from '@sentry/types' ;
16
16
17
17
import { isPlainObject , isString } from './is' ;
18
18
import { normalize } from './normalize' ;
@@ -27,71 +27,6 @@ const DEFAULT_INCLUDES = {
27
27
const DEFAULT_REQUEST_INCLUDES = [ 'cookies' , 'data' , 'headers' , 'method' , 'query_string' , 'url' ] ;
28
28
const DEFAULT_USER_INCLUDES = [ 'id' , 'username' , 'email' ] ;
29
29
30
- type BaseRequest = {
31
- method ?: string ;
32
- url ?: string ;
33
- } ;
34
-
35
- type BrowserRequest = BaseRequest ;
36
-
37
- type NodeRequest = BaseRequest & {
38
- headers ?: {
39
- [ key : string ] : string | string [ ] | undefined ;
40
- } ;
41
- protocol ?: string ;
42
- socket ?: {
43
- encrypted ?: boolean ;
44
- remoteAddress ?: string ;
45
- } ;
46
- } ;
47
-
48
- type KoaRequest = NodeRequest & {
49
- host ?: string ;
50
- hostname ?: string ;
51
- ip ?: string ;
52
- originalUrl ?: string ;
53
- } ;
54
-
55
- type NextjsRequest = NodeRequest & {
56
- cookies ?: {
57
- [ key : string ] : string ;
58
- } ;
59
- query ?: {
60
- [ key : string ] : any ;
61
- } ;
62
- } ;
63
-
64
- type ExpressRequest = NodeRequest & {
65
- baseUrl ?: string ;
66
- body ?: string | { [ key : string ] : any } ;
67
- host ?: string ;
68
- hostname ?: string ;
69
- ip ?: string ;
70
- originalUrl ?: string ;
71
- route ?: {
72
- path : string ;
73
- stack : [
74
- {
75
- name : string ;
76
- } ,
77
- ] ;
78
- } ;
79
- query ?: {
80
- [ key : string ] : any ;
81
- } ;
82
- user ?: {
83
- [ key : string ] : any ;
84
- } ;
85
- } ;
86
-
87
- /** A `Request` type compatible with Node, Express, browser, etc., because everything is optional */
88
- export type CrossPlatformRequest = BaseRequest &
89
- BrowserRequest &
90
- NodeRequest &
91
- ExpressRequest &
92
- KoaRequest &
93
- NextjsRequest ;
94
-
95
30
type InjectedNodeDeps = {
96
31
cookie : {
97
32
parse : ( cookieStr : string ) => Record < string , string > ;
0 commit comments