fastify 4.5.3 → 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/lib/server.js CHANGED
@@ -319,7 +319,7 @@ function normalizeListenArgs (args) {
319
319
  options.backlog = argsLength > 1 ? lastArg : undefined
320
320
  } else {
321
321
  /* Deal with listen ([port[, host[, backlog]]]) */
322
- options.port = argsLength >= 1 && Number.isInteger(firstArg) ? firstArg : 0
322
+ options.port = argsLength >= 1 && Number.isInteger(firstArg) ? firstArg : normalizePort(firstArg)
323
323
  // This will listen to what localhost is.
324
324
  // It can be 127.0.0.1 or ::1, depending on the operating system.
325
325
  // Fixes https://github.com/fastify/fastify/issues/1022.
@@ -330,6 +330,11 @@ function normalizeListenArgs (args) {
330
330
  return options
331
331
  }
332
332
 
333
+ function normalizePort (firstArg) {
334
+ const port = parseInt(firstArg, 10)
335
+ return port >= 0 && !Number.isNaN(port) ? port : 0
336
+ }
337
+
333
338
  function logServerAddress (server) {
334
339
  let address = server.address()
335
340
  const isUnixSocket = typeof address === 'string'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify",
3
- "version": "4.5.3",
3
+ "version": "4.6.0",
4
4
  "description": "Fast and low overhead web framework, for Node.js",
5
5
  "main": "fastify.js",
6
6
  "type": "commonjs",
@@ -164,7 +164,7 @@
164
164
  "split2": "^4.1.0",
165
165
  "standard": "^17.0.0-2",
166
166
  "tap": "^16.2.0",
167
- "tsd": "^0.22.0",
167
+ "tsd": "^0.23.0",
168
168
  "typescript": "^4.7.2",
169
169
  "undici": "^5.4.0",
170
170
  "vary": "^1.1.2",
@@ -0,0 +1,77 @@
1
+ 'use strict'
2
+
3
+ const t = require('tap')
4
+ const test = t.test
5
+ const Fastify = require('../fastify')
6
+
7
+ test('hasRoute', t => {
8
+ t.plan(4)
9
+ const test = t.test
10
+ const fastify = Fastify()
11
+
12
+ test('hasRoute - invalid options', t => {
13
+ t.plan(3)
14
+
15
+ t.equal(fastify.hasRoute({ }), false)
16
+
17
+ t.equal(fastify.hasRoute({ method: 'GET' }), false)
18
+
19
+ t.equal(fastify.hasRoute({ constraints: [] }), false)
20
+ })
21
+
22
+ test('hasRoute - primitive method', t => {
23
+ t.plan(2)
24
+ fastify.route({
25
+ method: 'GET',
26
+ url: '/',
27
+ handler: function (req, reply) {
28
+ reply.send({ hello: 'world' })
29
+ }
30
+ })
31
+
32
+ t.equal(fastify.hasRoute({
33
+ method: 'GET',
34
+ url: '/'
35
+ }), true)
36
+
37
+ t.equal(fastify.hasRoute({
38
+ method: 'POST',
39
+ url: '/'
40
+ }), false)
41
+ })
42
+
43
+ test('hasRoute - with constraints', t => {
44
+ t.plan(2)
45
+ fastify.route({
46
+ method: 'GET',
47
+ url: '/',
48
+ constraints: { version: '1.2.0' },
49
+ handler: (req, reply) => {
50
+ reply.send({ hello: 'world' })
51
+ }
52
+ })
53
+
54
+ t.equal(fastify.hasRoute({
55
+ method: 'GET',
56
+ url: '/',
57
+ constraints: { version: '1.2.0' }
58
+ }), true)
59
+
60
+ t.equal(fastify.hasRoute({
61
+ method: 'GET',
62
+ url: '/',
63
+ constraints: { version: '1.3.0' }
64
+ }), false)
65
+ })
66
+
67
+ test('hasRoute - parametric route regexp with constraints', t => {
68
+ t.plan(1)
69
+ // parametric with regexp
70
+ fastify.get('/example/:file(^\\d+).png', function (request, reply) { })
71
+
72
+ t.equal(fastify.hasRoute({
73
+ method: 'GET',
74
+ url: '/example/12345.png'
75
+ }), true)
76
+ })
77
+ })
@@ -200,3 +200,36 @@ test('listen when firstArg is { path: string(pipe) } and with backlog and callba
200
200
  t.equal(address, '\\\\.\\pipe\\testPipe3')
201
201
  })
202
202
  })
203
+
204
+ test('listen accepts a port as string, and callback', t => {
205
+ t.plan(2)
206
+ const fastify = Fastify()
207
+ t.teardown(fastify.close.bind(fastify))
208
+ const port = 3000
209
+ fastify.listen(port.toString(), localhost, (err) => {
210
+ t.equal(fastify.server.address().port, port)
211
+ t.error(err)
212
+ })
213
+ })
214
+
215
+ test('listen accepts a port as string, address and callback', t => {
216
+ t.plan(3)
217
+ const fastify = Fastify()
218
+ t.teardown(fastify.close.bind(fastify))
219
+ const port = 3000
220
+ fastify.listen(port.toString(), localhost, (err) => {
221
+ t.equal(fastify.server.address().port, port)
222
+ t.equal(fastify.server.address().address, localhost)
223
+ t.error(err)
224
+ })
225
+ })
226
+
227
+ test('listen with invalid port string without callback with (address)', t => {
228
+ t.plan(1)
229
+ const fastify = Fastify()
230
+ t.teardown(fastify.close.bind(fastify))
231
+ fastify.listen('-1')
232
+ .then(address => {
233
+ t.equal(address, `http://${localhostForURL}:${fastify.server.address().port}`)
234
+ })
235
+ })
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { test } = require('tap')
4
4
  const Joi = require('joi')
5
+ const yup = require('yup')
5
6
  const AJV = require('ajv')
6
7
  const S = require('fluent-json-schema')
7
8
  const Fastify = require('..')
@@ -673,3 +674,31 @@ test('JOI validation overwrite request headers', t => {
673
674
  })
674
675
  })
675
676
  })
677
+
678
+ test('Custom schema object should not trigger FST_ERR_SCH_DUPLICATE', async t => {
679
+ const fastify = Fastify()
680
+ const handler = () => { }
681
+
682
+ fastify.get('/the/url', {
683
+ schema: {
684
+ query: yup.object({
685
+ foo: yup.string()
686
+ })
687
+ },
688
+ validatorCompiler: ({ schema, method, url, httpPart }) => {
689
+ return function (data) {
690
+ // with option strict = false, yup `validateSync` function returns the coerced value if validation was successful, or throws if validation failed
691
+ try {
692
+ const result = schema.validateSync(data, {})
693
+ return { value: result }
694
+ } catch (e) {
695
+ return { error: e }
696
+ }
697
+ }
698
+ },
699
+ handler
700
+ })
701
+
702
+ await fastify.ready()
703
+ t.pass('fastify is ready')
704
+ })
@@ -8,6 +8,7 @@ import fastify, {
8
8
  LightMyRequestResponse,
9
9
  LightMyRequestCallback,
10
10
  InjectOptions, FastifyBaseLogger,
11
+ RouteGenericInterface,
11
12
  ValidationResult
12
13
  } from '../../fastify'
13
14
  import { ErrorObject as AjvErrorObject } from 'ajv'
@@ -24,6 +25,7 @@ expectType<FastifyInstance<http.Server, http.IncomingMessage, http.ServerRespons
24
25
  expectType<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> & PromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>>(fastify({}))
25
26
  // https server
26
27
  expectType<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse> & PromiseLike<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse>>>(fastify({ https: {} }))
28
+ expectType<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse> & PromiseLike<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse>>>(fastify({ https: null }))
27
29
  // http2 server
28
30
  expectType<FastifyInstance<http2.Http2Server, http2.Http2ServerRequest, http2.Http2ServerResponse> & PromiseLike<FastifyInstance<http2.Http2Server, http2.Http2ServerRequest, http2.Http2ServerResponse>>>(fastify({ http2: true, http2SessionTimeout: 1000 }))
29
31
  expectType<FastifyInstance<http2.Http2SecureServer, http2.Http2ServerRequest, http2.Http2ServerResponse> & PromiseLike<FastifyInstance<http2.Http2SecureServer, http2.Http2ServerRequest, http2.Http2ServerResponse>>>(fastify({ http2: true, https: {}, http2SessionTimeout: 1000 }))
@@ -231,3 +233,10 @@ const ajvErrorObject: AjvErrorObject = {
231
233
  message: ''
232
234
  }
233
235
  expectAssignable<ValidationResult>(ajvErrorObject)
236
+
237
+ const routeGeneric: RouteGenericInterface = {}
238
+ expectType<unknown>(routeGeneric.Body)
239
+ expectType<unknown>(routeGeneric.Headers)
240
+ expectType<unknown>(routeGeneric.Params)
241
+ expectType<unknown>(routeGeneric.Querystring)
242
+ expectType<unknown>(routeGeneric.Reply)
@@ -230,3 +230,14 @@ expectType<FastifyInstance>(fastify().route({
230
230
  method: 'GET',
231
231
  handler: routeHandlerWithReturnValue
232
232
  }))
233
+
234
+ expectType<boolean>(fastify().hasRoute({
235
+ url: '/',
236
+ method: 'GET'
237
+ }))
238
+
239
+ expectType<boolean>(fastify().hasRoute({
240
+ url: '/',
241
+ method: 'GET',
242
+ constraints: { version: '1.2.0' }
243
+ }))
@@ -4,32 +4,6 @@ const net = require('net')
4
4
  const t = require('tap')
5
5
  const Fastify = require('../fastify')
6
6
 
7
- t.test('Will return 505 HTTP error if HTTP version (default) is not supported', t => {
8
- const fastify = Fastify()
9
-
10
- t.teardown(fastify.close.bind(fastify))
11
-
12
- fastify.get('/', (req, reply) => {
13
- reply.send({ hello: 'world' })
14
- })
15
-
16
- fastify.listen({ port: 0 }, err => {
17
- t.error(err)
18
-
19
- const port = fastify.server.address().port
20
- const client = net.createConnection({ port }, () => {
21
- client.write('GET / HTTP/5.1\r\n\r\n')
22
-
23
- client.once('data', data => {
24
- t.match(data.toString(), /505 HTTP Version Not Supported/i)
25
- client.end(() => {
26
- t.end()
27
- })
28
- })
29
- })
30
- })
31
- })
32
-
33
7
  t.test('Will return 505 HTTP error if HTTP version (2.0 when server is 1.1) is not supported', t => {
34
8
  const fastify = Fastify()
35
9
 
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 { FastifyLoggerInstance } from './logger'
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance
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 FastifyLoggerInstance = FastifyLoggerInstance,
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 FastifyLoggerInstance = FastifyLoggerInstance,
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 FastifyLoggerInstance = FastifyLoggerInstance,
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 FastifyLoggerInstance = FastifyLoggerInstance,
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 FastifyLoggerInstance = FastifyLoggerInstance,
485
+ Logger extends FastifyBaseLogger = FastifyBaseLogger,
486
486
  TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault
487
487
  > {
488
488
  (