fastify 4.5.2 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/Guides/Ecosystem.md +27 -12
- package/docs/Guides/Migration-Guide-V4.md +97 -48
- package/docs/Guides/Write-Plugin.md +1 -1
- package/docs/Reference/Logging.md +16 -13
- package/docs/Reference/Server.md +24 -2
- package/docs/Reference/Type-Providers.md +2 -16
- package/docs/Reference/TypeScript.md +7 -14
- package/examples/typescript-server.ts +1 -1
- package/fastify.d.ts +2 -2
- package/fastify.js +4 -1
- package/lib/decorate.js +2 -2
- package/lib/error-serializer.js +13 -40
- package/lib/route.js +9 -0
- package/lib/schemas.js +1 -0
- package/lib/server.js +6 -1
- package/package.json +3 -3
- package/test/404s.test.js +1 -1
- package/test/async-await.test.js +22 -0
- package/test/decorator.test.js +1 -1
- package/test/has-route.test.js +77 -0
- package/test/internals/decorator.test.js +2 -2
- package/test/listen.deprecated.test.js +33 -0
- package/test/schema-special-usage.test.js +29 -0
- package/test/types/fastify.test-d.ts +9 -0
- package/test/types/route.test-d.ts +11 -0
- package/test/unsupported-httpversion.test.js +0 -26
- package/types/hooks.d.ts +25 -25
- package/types/instance.d.ts +28 -22
- package/types/logger.d.ts +1 -1
- package/types/plugin.d.ts +3 -3
- package/types/reply.d.ts +2 -2
- package/types/request.d.ts +2 -2
- package/types/route.d.ts +12 -12
package/types/hooks.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { RawServerBase, RawServerDefault, RawRequestDefaultExpression, RawReplyD
|
|
|
5
5
|
import { FastifyRequest } from './request'
|
|
6
6
|
import { FastifyReply } from './reply'
|
|
7
7
|
import { FastifyError } from '@fastify/error'
|
|
8
|
-
import {
|
|
8
|
+
import { FastifyBaseLogger } from './logger'
|
|
9
9
|
import {
|
|
10
10
|
FastifyTypeProvider,
|
|
11
11
|
FastifyTypeProviderDefault
|
|
@@ -34,7 +34,7 @@ export interface onRequestHookHandler<
|
|
|
34
34
|
ContextConfig = ContextConfigDefault,
|
|
35
35
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
36
36
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
37
|
-
Logger extends
|
|
37
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
38
38
|
> {
|
|
39
39
|
(
|
|
40
40
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -52,7 +52,7 @@ export interface onRequestAsyncHookHandler<
|
|
|
52
52
|
ContextConfig = ContextConfigDefault,
|
|
53
53
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
54
54
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
55
|
-
Logger extends
|
|
55
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
56
56
|
> {
|
|
57
57
|
(
|
|
58
58
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -73,7 +73,7 @@ export interface preParsingHookHandler<
|
|
|
73
73
|
ContextConfig = ContextConfigDefault,
|
|
74
74
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
75
75
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
76
|
-
Logger extends
|
|
76
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
77
77
|
> {
|
|
78
78
|
(
|
|
79
79
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -92,7 +92,7 @@ export interface preParsingAsyncHookHandler<
|
|
|
92
92
|
ContextConfig = ContextConfigDefault,
|
|
93
93
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
94
94
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
95
|
-
Logger extends
|
|
95
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
96
96
|
> {
|
|
97
97
|
(
|
|
98
98
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -113,7 +113,7 @@ export interface preValidationHookHandler<
|
|
|
113
113
|
ContextConfig = ContextConfigDefault,
|
|
114
114
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
115
115
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
116
|
-
Logger extends
|
|
116
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
117
117
|
> {
|
|
118
118
|
(
|
|
119
119
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -131,7 +131,7 @@ export interface preValidationAsyncHookHandler<
|
|
|
131
131
|
ContextConfig = ContextConfigDefault,
|
|
132
132
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
133
133
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
134
|
-
Logger extends
|
|
134
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
135
135
|
> {
|
|
136
136
|
(
|
|
137
137
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -151,7 +151,7 @@ export interface preHandlerHookHandler<
|
|
|
151
151
|
ContextConfig = ContextConfigDefault,
|
|
152
152
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
153
153
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
154
|
-
Logger extends
|
|
154
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
155
155
|
> {
|
|
156
156
|
(
|
|
157
157
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -169,7 +169,7 @@ export interface preHandlerAsyncHookHandler<
|
|
|
169
169
|
ContextConfig = ContextConfigDefault,
|
|
170
170
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
171
171
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
172
|
-
Logger extends
|
|
172
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
173
173
|
> {
|
|
174
174
|
(
|
|
175
175
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -198,7 +198,7 @@ export interface preSerializationHookHandler<
|
|
|
198
198
|
ContextConfig = ContextConfigDefault,
|
|
199
199
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
200
200
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
201
|
-
Logger extends
|
|
201
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
202
202
|
> {
|
|
203
203
|
(
|
|
204
204
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -218,7 +218,7 @@ export interface preSerializationAsyncHookHandler<
|
|
|
218
218
|
ContextConfig = ContextConfigDefault,
|
|
219
219
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
220
220
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
221
|
-
Logger extends
|
|
221
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
222
222
|
> {
|
|
223
223
|
(
|
|
224
224
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -241,7 +241,7 @@ export interface onSendHookHandler<
|
|
|
241
241
|
ContextConfig = ContextConfigDefault,
|
|
242
242
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
243
243
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
244
|
-
Logger extends
|
|
244
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
245
245
|
> {
|
|
246
246
|
(
|
|
247
247
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -261,7 +261,7 @@ export interface onSendAsyncHookHandler<
|
|
|
261
261
|
ContextConfig = ContextConfigDefault,
|
|
262
262
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
263
263
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
264
|
-
Logger extends
|
|
264
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
265
265
|
> {
|
|
266
266
|
(
|
|
267
267
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -283,7 +283,7 @@ export interface onResponseHookHandler<
|
|
|
283
283
|
ContextConfig = ContextConfigDefault,
|
|
284
284
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
285
285
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
286
|
-
Logger extends
|
|
286
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
287
287
|
> {
|
|
288
288
|
(
|
|
289
289
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -301,7 +301,7 @@ export interface onResponseAsyncHookHandler<
|
|
|
301
301
|
ContextConfig = ContextConfigDefault,
|
|
302
302
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
303
303
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
304
|
-
Logger extends
|
|
304
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
305
305
|
> {
|
|
306
306
|
(
|
|
307
307
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -322,7 +322,7 @@ export interface onTimeoutHookHandler<
|
|
|
322
322
|
ContextConfig = ContextConfigDefault,
|
|
323
323
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
324
324
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
325
|
-
Logger extends
|
|
325
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
326
326
|
> {
|
|
327
327
|
(
|
|
328
328
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -340,7 +340,7 @@ export interface onTimeoutAsyncHookHandler<
|
|
|
340
340
|
ContextConfig = ContextConfigDefault,
|
|
341
341
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
342
342
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
343
|
-
Logger extends
|
|
343
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
344
344
|
> {
|
|
345
345
|
(
|
|
346
346
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -364,7 +364,7 @@ export interface onErrorHookHandler<
|
|
|
364
364
|
TError extends Error = FastifyError,
|
|
365
365
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
366
366
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
367
|
-
Logger extends
|
|
367
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
368
368
|
> {
|
|
369
369
|
(
|
|
370
370
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -384,7 +384,7 @@ export interface onErrorAsyncHookHandler<
|
|
|
384
384
|
TError extends Error = FastifyError,
|
|
385
385
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
386
386
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
387
|
-
Logger extends
|
|
387
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
388
388
|
> {
|
|
389
389
|
(
|
|
390
390
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -407,7 +407,7 @@ export interface onRouteHookHandler<
|
|
|
407
407
|
ContextConfig = ContextConfigDefault,
|
|
408
408
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
409
409
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
410
|
-
Logger extends
|
|
410
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
411
411
|
> {
|
|
412
412
|
(
|
|
413
413
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
@@ -424,7 +424,7 @@ export interface onRegisterHookHandler<
|
|
|
424
424
|
RawServer extends RawServerBase = RawServerDefault,
|
|
425
425
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
426
426
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
427
|
-
Logger extends
|
|
427
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
428
428
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
429
429
|
Options extends FastifyPluginOptions = FastifyPluginOptions
|
|
430
430
|
> {
|
|
@@ -442,7 +442,7 @@ export interface onReadyHookHandler<
|
|
|
442
442
|
RawServer extends RawServerBase = RawServerDefault,
|
|
443
443
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
444
444
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
445
|
-
Logger extends
|
|
445
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
446
446
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
447
447
|
> {
|
|
448
448
|
(
|
|
@@ -455,7 +455,7 @@ export interface onReadyAsyncHookHandler<
|
|
|
455
455
|
RawServer extends RawServerBase = RawServerDefault,
|
|
456
456
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
457
457
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
458
|
-
Logger extends
|
|
458
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
459
459
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
460
460
|
> {
|
|
461
461
|
(
|
|
@@ -469,7 +469,7 @@ export interface onCloseHookHandler<
|
|
|
469
469
|
RawServer extends RawServerBase = RawServerDefault,
|
|
470
470
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
471
471
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
472
|
-
Logger extends
|
|
472
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
473
473
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
474
474
|
> {
|
|
475
475
|
(
|
|
@@ -482,7 +482,7 @@ export interface onCloseAsyncHookHandler<
|
|
|
482
482
|
RawServer extends RawServerBase = RawServerDefault,
|
|
483
483
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
484
484
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
485
|
-
Logger extends
|
|
485
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
486
486
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault
|
|
487
487
|
> {
|
|
488
488
|
(
|
package/types/instance.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as http from 'http'
|
|
|
4
4
|
import { CallbackFunc as LightMyRequestCallback, Chain as LightMyRequestChain, InjectOptions, Response as LightMyRequestResponse } from 'light-my-request'
|
|
5
5
|
import { AddContentTypeParser, ConstructorAction, FastifyBodyParser, getDefaultJsonParser, hasContentTypeParser, ProtoAction, removeAllContentTypeParsers, removeContentTypeParser } from './content-type-parser'
|
|
6
6
|
import { onCloseAsyncHookHandler, onCloseHookHandler, onErrorAsyncHookHandler, onErrorHookHandler, onReadyAsyncHookHandler, onReadyHookHandler, onRegisterHookHandler, onRequestAsyncHookHandler, onRequestHookHandler, onResponseAsyncHookHandler, onResponseHookHandler, onRouteHookHandler, onSendAsyncHookHandler, onSendHookHandler, onTimeoutAsyncHookHandler, onTimeoutHookHandler, preHandlerAsyncHookHandler, preHandlerHookHandler, preParsingAsyncHookHandler, preParsingHookHandler, preSerializationAsyncHookHandler, preSerializationHookHandler, preValidationAsyncHookHandler, preValidationHookHandler } from './hooks'
|
|
7
|
-
import {
|
|
7
|
+
import { FastifyBaseLogger } from './logger'
|
|
8
8
|
import { FastifyRegister } from './register'
|
|
9
9
|
import { FastifyReply } from './reply'
|
|
10
10
|
import { FastifyRequest } from './request'
|
|
@@ -84,7 +84,7 @@ export interface FastifyInstance<
|
|
|
84
84
|
RawServer extends RawServerBase = RawServerDefault,
|
|
85
85
|
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
|
86
86
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
87
|
-
Logger extends
|
|
87
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
88
88
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
89
89
|
> {
|
|
90
90
|
server: RawServer;
|
|
@@ -174,7 +174,7 @@ export interface FastifyInstance<
|
|
|
174
174
|
route<
|
|
175
175
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
176
176
|
ContextConfig = ContextConfigDefault,
|
|
177
|
-
SchemaCompiler = FastifySchema,
|
|
177
|
+
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
178
178
|
>(opts: RouteOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>): FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>;
|
|
179
179
|
|
|
180
180
|
get: RouteShorthandMethod<RawServer, RawRequest, RawReply, TypeProvider>;
|
|
@@ -186,6 +186,12 @@ export interface FastifyInstance<
|
|
|
186
186
|
patch: RouteShorthandMethod<RawServer, RawRequest, RawReply, TypeProvider>;
|
|
187
187
|
all: RouteShorthandMethod<RawServer, RawRequest, RawReply, TypeProvider>;
|
|
188
188
|
|
|
189
|
+
hasRoute<
|
|
190
|
+
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
191
|
+
ContextConfig = ContextConfigDefault,
|
|
192
|
+
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
193
|
+
>(opts: Pick<RouteOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>, 'method' | 'url' | 'constraints'>): boolean;
|
|
194
|
+
|
|
189
195
|
// addHook: overloads
|
|
190
196
|
|
|
191
197
|
// Lifecycle addHooks
|
|
@@ -198,7 +204,7 @@ export interface FastifyInstance<
|
|
|
198
204
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
199
205
|
ContextConfig = ContextConfigDefault,
|
|
200
206
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
201
|
-
Logger extends
|
|
207
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
202
208
|
>(
|
|
203
209
|
name: 'onRequest',
|
|
204
210
|
hook: onRequestHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -208,7 +214,7 @@ export interface FastifyInstance<
|
|
|
208
214
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
209
215
|
ContextConfig = ContextConfigDefault,
|
|
210
216
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
211
|
-
Logger extends
|
|
217
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
212
218
|
>(
|
|
213
219
|
name: 'onRequest',
|
|
214
220
|
hook: onRequestAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -222,7 +228,7 @@ export interface FastifyInstance<
|
|
|
222
228
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
223
229
|
ContextConfig = ContextConfigDefault,
|
|
224
230
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
225
|
-
Logger extends
|
|
231
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
226
232
|
>(
|
|
227
233
|
name: 'preParsing',
|
|
228
234
|
hook: preParsingHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -232,7 +238,7 @@ export interface FastifyInstance<
|
|
|
232
238
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
233
239
|
ContextConfig = ContextConfigDefault,
|
|
234
240
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
235
|
-
Logger extends
|
|
241
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
236
242
|
>(
|
|
237
243
|
name: 'preParsing',
|
|
238
244
|
hook: preParsingAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -245,7 +251,7 @@ export interface FastifyInstance<
|
|
|
245
251
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
246
252
|
ContextConfig = ContextConfigDefault,
|
|
247
253
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
248
|
-
Logger extends
|
|
254
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
249
255
|
>(
|
|
250
256
|
name: 'preValidation',
|
|
251
257
|
hook: preValidationHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -255,7 +261,7 @@ export interface FastifyInstance<
|
|
|
255
261
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
256
262
|
ContextConfig = ContextConfigDefault,
|
|
257
263
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
258
|
-
Logger extends
|
|
264
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
259
265
|
>(
|
|
260
266
|
name: 'preValidation',
|
|
261
267
|
hook: preValidationAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -268,7 +274,7 @@ export interface FastifyInstance<
|
|
|
268
274
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
269
275
|
ContextConfig = ContextConfigDefault,
|
|
270
276
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
271
|
-
Logger extends
|
|
277
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
272
278
|
>(
|
|
273
279
|
name: 'preHandler',
|
|
274
280
|
hook: preHandlerHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -278,7 +284,7 @@ export interface FastifyInstance<
|
|
|
278
284
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
279
285
|
ContextConfig = ContextConfigDefault,
|
|
280
286
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
281
|
-
Logger extends
|
|
287
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
282
288
|
>(
|
|
283
289
|
name: 'preHandler',
|
|
284
290
|
hook: preHandlerAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -293,7 +299,7 @@ export interface FastifyInstance<
|
|
|
293
299
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
294
300
|
ContextConfig = ContextConfigDefault,
|
|
295
301
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
296
|
-
Logger extends
|
|
302
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
297
303
|
>(
|
|
298
304
|
name: 'preSerialization',
|
|
299
305
|
hook: preSerializationHookHandler<PreSerializationPayload, RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -304,7 +310,7 @@ export interface FastifyInstance<
|
|
|
304
310
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
305
311
|
ContextConfig = ContextConfigDefault,
|
|
306
312
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
307
|
-
Logger extends
|
|
313
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
308
314
|
>(
|
|
309
315
|
name: 'preSerialization',
|
|
310
316
|
hook: preSerializationAsyncHookHandler<PreSerializationPayload, RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -319,7 +325,7 @@ export interface FastifyInstance<
|
|
|
319
325
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
320
326
|
ContextConfig = ContextConfigDefault,
|
|
321
327
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
322
|
-
Logger extends
|
|
328
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
323
329
|
>(
|
|
324
330
|
name: 'onSend',
|
|
325
331
|
hook: onSendHookHandler<OnSendPayload, RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -330,7 +336,7 @@ export interface FastifyInstance<
|
|
|
330
336
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
331
337
|
ContextConfig = ContextConfigDefault,
|
|
332
338
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
333
|
-
Logger extends
|
|
339
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
334
340
|
>(
|
|
335
341
|
name: 'onSend',
|
|
336
342
|
hook: onSendAsyncHookHandler<OnSendPayload, RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -344,7 +350,7 @@ export interface FastifyInstance<
|
|
|
344
350
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
345
351
|
ContextConfig = ContextConfigDefault,
|
|
346
352
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
347
|
-
Logger extends
|
|
353
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
348
354
|
>(
|
|
349
355
|
name: 'onResponse',
|
|
350
356
|
hook: onResponseHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -354,7 +360,7 @@ export interface FastifyInstance<
|
|
|
354
360
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
355
361
|
ContextConfig = ContextConfigDefault,
|
|
356
362
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
357
|
-
Logger extends
|
|
363
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
358
364
|
>(
|
|
359
365
|
name: 'onResponse',
|
|
360
366
|
hook: onResponseAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -368,7 +374,7 @@ export interface FastifyInstance<
|
|
|
368
374
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
369
375
|
ContextConfig = ContextConfigDefault,
|
|
370
376
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
371
|
-
Logger extends
|
|
377
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
372
378
|
>(
|
|
373
379
|
name: 'onTimeout',
|
|
374
380
|
hook: onTimeoutHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -378,7 +384,7 @@ export interface FastifyInstance<
|
|
|
378
384
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
379
385
|
ContextConfig = ContextConfigDefault,
|
|
380
386
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
381
|
-
Logger extends
|
|
387
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
382
388
|
>(
|
|
383
389
|
name: 'onTimeout',
|
|
384
390
|
hook: onTimeoutAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -394,7 +400,7 @@ export interface FastifyInstance<
|
|
|
394
400
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
395
401
|
ContextConfig = ContextConfigDefault,
|
|
396
402
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
397
|
-
Logger extends
|
|
403
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
398
404
|
>(
|
|
399
405
|
name: 'onError',
|
|
400
406
|
hook: onErrorHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, FastifyError, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -404,7 +410,7 @@ export interface FastifyInstance<
|
|
|
404
410
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
405
411
|
ContextConfig = ContextConfigDefault,
|
|
406
412
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
407
|
-
Logger extends
|
|
413
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
408
414
|
>(
|
|
409
415
|
name: 'onError',
|
|
410
416
|
hook: onErrorAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, FastifyError, SchemaCompiler, TypeProvider, Logger>
|
|
@@ -419,7 +425,7 @@ export interface FastifyInstance<
|
|
|
419
425
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
420
426
|
ContextConfig = ContextConfigDefault,
|
|
421
427
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
422
|
-
Logger extends
|
|
428
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
423
429
|
>(
|
|
424
430
|
name: 'onRoute',
|
|
425
431
|
hook: onRouteHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
package/types/logger.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type FastifyBaseLogger = pino.BaseLogger & {
|
|
|
23
23
|
child(bindings: Bindings, options?: ChildLoggerOptions): FastifyBaseLogger
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// TODO delete
|
|
26
|
+
// TODO delete FastifyBaseLogger in the next major release. It seems that it is enough to have only FastifyBaseLogger.
|
|
27
27
|
/**
|
|
28
28
|
* @deprecated Use FastifyBaseLogger instead
|
|
29
29
|
*/
|
package/types/plugin.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FastifyInstance } from './instance'
|
|
2
2
|
import { RawServerBase, RawRequestDefaultExpression, RawReplyDefaultExpression, RawServerDefault } from './utils'
|
|
3
3
|
import { FastifyTypeProvider, FastifyTypeProviderDefault } from './type-provider'
|
|
4
|
-
import {
|
|
4
|
+
import { FastifyBaseLogger } from './logger'
|
|
5
5
|
|
|
6
6
|
export type FastifyPluginOptions = Record<string, any>
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ export type FastifyPluginOptions = Record<string, any>
|
|
|
11
11
|
* Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server decorator or whatever. To activate plugins, use the `fastify.register()` method.
|
|
12
12
|
*/
|
|
13
13
|
export type FastifyPluginCallback<Options extends FastifyPluginOptions = Record<never, never>, Server extends RawServerBase = RawServerDefault, TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault> = (
|
|
14
|
-
instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>,
|
|
14
|
+
instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>, FastifyBaseLogger, TypeProvider>,
|
|
15
15
|
opts: Options,
|
|
16
16
|
done: (err?: Error) => void
|
|
17
17
|
) => void
|
|
@@ -26,7 +26,7 @@ export type FastifyPluginAsync<
|
|
|
26
26
|
Server extends RawServerBase = RawServerDefault,
|
|
27
27
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
28
28
|
> = (
|
|
29
|
-
instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>,
|
|
29
|
+
instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>, FastifyBaseLogger, TypeProvider>,
|
|
30
30
|
opts: Options
|
|
31
31
|
) => Promise<void>;
|
|
32
32
|
|
package/types/reply.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RawReplyDefaultExpression, RawServerBase, RawServerDefault, ContextConfigDefault, RawRequestDefaultExpression, ReplyDefault } from './utils'
|
|
2
2
|
import { FastifyReplyType, ResolveFastifyReplyType, FastifyTypeProvider, FastifyTypeProviderDefault } from './type-provider'
|
|
3
3
|
import { FastifyContext } from './context'
|
|
4
|
-
import {
|
|
4
|
+
import { FastifyBaseLogger } from './logger'
|
|
5
5
|
import { FastifyRequest } from './request'
|
|
6
6
|
import { RouteGenericInterface } from './route'
|
|
7
7
|
import { FastifyInstance } from './instance'
|
|
@@ -28,7 +28,7 @@ export interface FastifyReply<
|
|
|
28
28
|
> {
|
|
29
29
|
raw: RawReply;
|
|
30
30
|
context: FastifyContext<ContextConfig>;
|
|
31
|
-
log:
|
|
31
|
+
log: FastifyBaseLogger;
|
|
32
32
|
request: FastifyRequest<RouteGeneric, RawServer, RawRequest, SchemaCompiler, TypeProvider>;
|
|
33
33
|
server: FastifyInstance;
|
|
34
34
|
code(statusCode: number): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
|
package/types/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FastifyBaseLogger } from './logger'
|
|
2
2
|
import { ContextConfigDefault, RawServerBase, RawServerDefault, RawRequestDefaultExpression, RequestBodyDefault, RequestQuerystringDefault, RequestParamsDefault, RequestHeadersDefault } from './utils'
|
|
3
3
|
import { RouteGenericInterface } from './route'
|
|
4
4
|
import { FastifyInstance } from './instance'
|
|
@@ -24,7 +24,7 @@ export interface FastifyRequest<RouteGeneric extends RouteGenericInterface = Rou
|
|
|
24
24
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
25
25
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
26
26
|
ContextConfig = ContextConfigDefault,
|
|
27
|
-
Logger extends
|
|
27
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger,
|
|
28
28
|
RequestType extends FastifyRequestType = ResolveFastifyRequestType<TypeProvider, SchemaCompiler, RouteGeneric>
|
|
29
29
|
// ^ Temporary Note: RequestType has been re-ordered to be the last argument in
|
|
30
30
|
// generic list. This generic argument is now considered optional as it can be
|
package/types/route.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
FastifyTypeProviderDefault,
|
|
12
12
|
ResolveFastifyReplyReturnType
|
|
13
13
|
} from './type-provider'
|
|
14
|
-
import {
|
|
14
|
+
import { FastifyBaseLogger, LogLevel } from './logger'
|
|
15
15
|
|
|
16
16
|
export interface RouteGenericInterface extends RequestGenericInterface, ReplyGenericInterface {}
|
|
17
17
|
|
|
@@ -24,9 +24,9 @@ export interface RouteShorthandOptions<
|
|
|
24
24
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
25
25
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
26
26
|
ContextConfig = ContextConfigDefault,
|
|
27
|
-
SchemaCompiler = FastifySchema,
|
|
27
|
+
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
28
28
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
29
|
-
Logger extends
|
|
29
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
30
30
|
> {
|
|
31
31
|
schema?: SchemaCompiler, // originally FastifySchema
|
|
32
32
|
attachValidation?: boolean;
|
|
@@ -67,7 +67,7 @@ export type RouteHandlerMethod<
|
|
|
67
67
|
ContextConfig = ContextConfigDefault,
|
|
68
68
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
69
69
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
70
|
-
Logger extends
|
|
70
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
71
71
|
> = (
|
|
72
72
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
73
73
|
request: FastifyRequest<RouteGeneric, RawServer, RawRequest, SchemaCompiler, TypeProvider, ContextConfig, Logger>,
|
|
@@ -84,9 +84,9 @@ export interface RouteShorthandOptionsWithHandler<
|
|
|
84
84
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
85
85
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
86
86
|
ContextConfig = ContextConfigDefault,
|
|
87
|
-
SchemaCompiler = FastifySchema,
|
|
87
|
+
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
88
88
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
89
|
-
Logger extends
|
|
89
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
90
90
|
> extends RouteShorthandOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger> {
|
|
91
91
|
handler: RouteHandlerMethod<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>;
|
|
92
92
|
}
|
|
@@ -100,16 +100,16 @@ export interface RouteShorthandMethod<
|
|
|
100
100
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
101
101
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
102
102
|
> {
|
|
103
|
-
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler = FastifySchema, Logger extends
|
|
103
|
+
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler extends FastifySchema = FastifySchema, Logger extends FastifyBaseLogger = FastifyBaseLogger>(
|
|
104
104
|
path: string,
|
|
105
105
|
opts: RouteShorthandOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>,
|
|
106
106
|
handler: RouteHandlerMethod<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
107
107
|
): FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>;
|
|
108
|
-
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler = FastifySchema, Logger extends
|
|
108
|
+
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler extends FastifySchema = FastifySchema, Logger extends FastifyBaseLogger = FastifyBaseLogger>(
|
|
109
109
|
path: string,
|
|
110
110
|
handler: RouteHandlerMethod<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
111
111
|
): FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>;
|
|
112
|
-
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler = FastifySchema, Logger extends
|
|
112
|
+
<RouteGeneric extends RouteGenericInterface = RouteGenericInterface, ContextConfig = ContextConfigDefault, SchemaCompiler extends FastifySchema = FastifySchema, Logger extends FastifyBaseLogger = FastifyBaseLogger>(
|
|
113
113
|
path: string,
|
|
114
114
|
opts: RouteShorthandOptionsWithHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>
|
|
115
115
|
): FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>;
|
|
@@ -124,9 +124,9 @@ export interface RouteOptions<
|
|
|
124
124
|
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>,
|
|
125
125
|
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
|
|
126
126
|
ContextConfig = ContextConfigDefault,
|
|
127
|
-
SchemaCompiler = FastifySchema,
|
|
127
|
+
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
128
128
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
129
|
-
Logger extends
|
|
129
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
130
130
|
> extends RouteShorthandOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger> {
|
|
131
131
|
method: HTTPMethods | HTTPMethods[];
|
|
132
132
|
url: string;
|
|
@@ -141,7 +141,7 @@ export type RouteHandler<
|
|
|
141
141
|
ContextConfig = ContextConfigDefault,
|
|
142
142
|
SchemaCompiler extends FastifySchema = FastifySchema,
|
|
143
143
|
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
|
|
144
|
-
Logger extends
|
|
144
|
+
Logger extends FastifyBaseLogger = FastifyBaseLogger
|
|
145
145
|
> = (
|
|
146
146
|
this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>,
|
|
147
147
|
request: FastifyRequest<RouteGeneric, RawServer, RawRequest, SchemaCompiler, TypeProvider, ContextConfig, Logger>,
|