Skip to content

Commit e9eaf9e

Browse files
committed
Revert FastifyAdapter signature patch
Upstreamed in the upgraded Nest module
1 parent 73a7c3b commit e9eaf9e

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

src/core/http/http.adapter.ts

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ import {
1212
FastifyAdapter,
1313
NestFastifyApplication,
1414
} from '@nestjs/platform-fastify';
15-
import type {
16-
FastifyInstance,
17-
FastifyReply,
18-
FastifyRequest,
19-
HTTPMethods,
20-
RawReplyDefaultExpression,
21-
RawRequestDefaultExpression,
22-
RawServerBase,
23-
RawServerDefault,
24-
RequestGenericInterface,
25-
RouteOptions,
26-
} from 'fastify';
15+
import type { FastifyInstance, HTTPMethods, RouteOptions } from 'fastify';
2716
import rawBody from 'fastify-raw-body';
2817
import * as zlib from 'node:zlib';
2918
import { uniqueDiscoveredMethods } from '~/common/discovery-unique-methods';
@@ -45,41 +34,8 @@ export type NestHttpApplication = NestFastifyApplication & {
4534

4635
export class HttpAdapterHost extends HttpAdapterHostImpl<HttpAdapter> {}
4736

48-
type FastifyRawRequest<TServer extends RawServerBase> =
49-
RawRequestDefaultExpression<TServer> & {
50-
originalUrl?: string;
51-
};
52-
5337
// @ts-expect-error Convert private methods to protected
54-
class PatchedFastifyAdapter<
55-
TServer extends RawServerBase = RawServerDefault,
56-
TRawRequest extends FastifyRawRequest<TServer> = FastifyRawRequest<TServer>,
57-
TRawResponse extends RawReplyDefaultExpression<TServer> = RawReplyDefaultExpression<TServer>,
58-
TRequest extends FastifyRequest<
59-
RequestGenericInterface,
60-
TServer,
61-
TRawRequest
62-
> = FastifyRequest<RequestGenericInterface, TServer, TRawRequest>,
63-
TReply extends FastifyReply<
64-
RequestGenericInterface,
65-
TServer,
66-
TRawRequest,
67-
TRawResponse
68-
> = FastifyReply<RequestGenericInterface, TServer, TRawRequest, TRawResponse>,
69-
TInstance extends FastifyInstance<
70-
TServer,
71-
TRawRequest,
72-
TRawResponse
73-
> = FastifyInstance<TServer, TRawRequest, TRawResponse>,
74-
> extends FastifyAdapter<
75-
TServer,
76-
TRawRequest,
77-
TRawResponse,
78-
TRequest,
79-
// @ts-expect-error they haven't upgraded to v5 signature yet.
80-
TReply,
81-
TInstance
82-
> {
38+
class PatchedFastifyAdapter extends FastifyAdapter {
8339
protected injectRouteOptions(
8440
routerMethodKey: Uppercase<HTTPMethods>,
8541
...args: any[]

0 commit comments

Comments
 (0)