Skip to content

Commit f1f94c6

Browse files
committed
make options optional
1 parent 770683e commit f1f94c6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/node/src/integrations/requestdata.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type RequestDataIntegrationOptions = {
1010
/**
1111
* Controls what data is pulled from the request and added to the event
1212
*/
13-
include: {
13+
include?: {
1414
cookies?: boolean;
1515
data?: boolean;
1616
headers?: boolean;
@@ -27,15 +27,15 @@ type RequestDataIntegrationOptions = {
2727
};
2828

2929
/** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */
30-
transactionNamingScheme: TransactionNamingScheme;
30+
transactionNamingScheme?: TransactionNamingScheme;
3131

3232
/**
3333
* Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
3434
* left injectable so this integration can be moved to `@sentry/core` and used in browser-based SDKs in the future.
3535
*
3636
* @hidden
3737
*/
38-
addRequestData: typeof addRequestDataToEvent;
38+
addRequestData?: typeof addRequestDataToEvent;
3939
};
4040

4141
const DEFAULT_OPTIONS = {
@@ -65,12 +65,12 @@ export class RequestData implements Integration {
6565
*/
6666
public name: string = RequestData.id;
6767

68-
private _options: RequestDataIntegrationOptions;
68+
private _options: Required<RequestDataIntegrationOptions>;
6969

7070
/**
7171
* @inheritDoc
7272
*/
73-
public constructor(options: Partial<RequestDataIntegrationOptions> = {}) {
73+
public constructor(options: RequestDataIntegrationOptions = {}) {
7474
this._options = {
7575
...DEFAULT_OPTIONS,
7676
...options,
@@ -142,7 +142,7 @@ export class RequestData implements Integration {
142142
/** Convert this integration's options to match what `addRequestDataToEvent` expects */
143143
/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */
144144
function convertReqDataIntegrationOptsToAddReqDataOpts(
145-
integrationOptions: RequestDataIntegrationOptions,
145+
integrationOptions: Required<RequestDataIntegrationOptions>,
146146
): AddRequestDataToEventOptions {
147147
const { transactionNamingScheme } = integrationOptions;
148148
const { ip, user, ...requestOptions } = integrationOptions.include;

0 commit comments

Comments
 (0)