|
1 | | -import type { |
2 | | - Client, |
3 | | - Event, |
4 | | - EventHint, |
5 | | - Integration, |
6 | | - IntegrationClass, |
7 | | - IntegrationFn, |
8 | | - Transaction, |
9 | | -} from '@sentry/types'; |
| 1 | +import type { Client, IntegrationFn, Transaction } from '@sentry/types'; |
10 | 2 | import type { AddRequestDataToEventOptions, TransactionNamingScheme } from '@sentry/utils'; |
11 | 3 | import { addRequestDataToEvent, extractPathForTransaction } from '@sentry/utils'; |
12 | | -import { convertIntegrationFnToClass, defineIntegration } from '../integration'; |
| 4 | +import { defineIntegration } from '../integration'; |
13 | 5 | import { spanToJSON } from '../utils/spanUtils'; |
14 | 6 |
|
15 | 7 | export type RequestDataIntegrationOptions = { |
@@ -127,41 +119,11 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) = |
127 | 119 | }; |
128 | 120 | }) satisfies IntegrationFn; |
129 | 121 |
|
130 | | -export const requestDataIntegration = defineIntegration(_requestDataIntegration); |
131 | | - |
132 | 122 | /** |
133 | 123 | * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/core` |
134 | 124 | * so it can be used in cross-platform SDKs like `@sentry/nextjs`. |
135 | | - * @deprecated Use `requestDataIntegration()` instead. |
136 | 125 | */ |
137 | | -// eslint-disable-next-line deprecation/deprecation |
138 | | -export const RequestData = convertIntegrationFnToClass(INTEGRATION_NAME, requestDataIntegration) as IntegrationClass< |
139 | | - Integration & { processEvent: (event: Event, hint: EventHint, client: Client) => Event } |
140 | | -> & { |
141 | | - new (options?: { |
142 | | - /** |
143 | | - * Controls what data is pulled from the request and added to the event |
144 | | - */ |
145 | | - include?: { |
146 | | - cookies?: boolean; |
147 | | - data?: boolean; |
148 | | - headers?: boolean; |
149 | | - ip?: boolean; |
150 | | - query_string?: boolean; |
151 | | - url?: boolean; |
152 | | - user?: |
153 | | - | boolean |
154 | | - | { |
155 | | - id?: boolean; |
156 | | - username?: boolean; |
157 | | - email?: boolean; |
158 | | - }; |
159 | | - }; |
160 | | - |
161 | | - /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */ |
162 | | - transactionNamingScheme?: TransactionNamingScheme; |
163 | | - }): Integration; |
164 | | -}; |
| 126 | +export const requestDataIntegration = defineIntegration(_requestDataIntegration); |
165 | 127 |
|
166 | 128 | /** Convert this integration's options to match what `addRequestDataToEvent` expects */ |
167 | 129 | /** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */ |
|
0 commit comments