Skip to content

Commit dfd2b9d

Browse files
committed
get rid of request interface export
1 parent 5922598 commit dfd2b9d

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

packages/nestjs/src/setup.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,26 @@ import {
2020
logger,
2121
spanToJSON,
2222
} from '@sentry/core';
23-
import type { ExpressRequest, FastifyRequest } from '@sentry/node';
2423
import type { Observable } from 'rxjs';
2524
import { isExpectedError } from './helpers';
2625

26+
// Partial extract of FastifyRequest interface
27+
// https://github.com/fastify/fastify/blob/87f9f20687c938828f1138f91682d568d2a31e53/types/request.d.ts#L41
28+
interface FastifyRequest {
29+
routeOptions?: {
30+
method?: string;
31+
url?: string;
32+
};
33+
}
34+
35+
// Partial extract of ExpressRequest interface
36+
interface ExpressRequest {
37+
route?: {
38+
path?: string;
39+
};
40+
method?: string;
41+
}
42+
2743
/**
2844
* Note: We cannot use @ syntax to add the decorators, so we add them directly below the classes as function wrappers.
2945
*/

packages/node/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,3 @@ export type {
166166
User,
167167
Span,
168168
} from '@sentry/core';
169-
170-
export type { FastifyRequest, ExpressRequest } from './integrations/tracing/nest/types';

packages/node/src/integrations/tracing/nest/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
// Partial extract of FastifyRequest interface
44
// https://github.com/fastify/fastify/blob/87f9f20687c938828f1138f91682d568d2a31e53/types/request.d.ts#L41
5-
export interface FastifyRequest {
5+
interface FastifyRequest {
66
routeOptions?: {
77
method?: string;
88
url?: string;
99
};
1010
}
1111

1212
// Partial extract of ExpressRequest interface
13-
export interface ExpressRequest {
13+
interface ExpressRequest {
1414
route?: {
1515
path?: string;
1616
};

0 commit comments

Comments
 (0)