@nestjs/platform-fastify 11.1.29 → 11.2.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.
@@ -68,6 +68,7 @@ export declare class FastifyAdapter<TServer extends RawServerBase = RawServerDef
68
68
  patch(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
69
69
  options(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
70
70
  search(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
71
+ query(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
71
72
  propfind(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
72
73
  proppatch(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
73
74
  mkcol(...args: any[]): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
@@ -186,6 +186,9 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
186
186
  search(...args) {
187
187
  return this.injectRouteOptions('SEARCH', ...args);
188
188
  }
189
+ query(...args) {
190
+ return this.injectRouteOptions('QUERY', ...args);
191
+ }
189
192
  propfind(...args) {
190
193
  return this.injectRouteOptions('PROPFIND', ...args);
191
194
  }
@@ -381,7 +384,9 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
381
384
  // Fallback to "*path" to support plugins like GraphQL
382
385
  normalizedPath = normalizedPath === '/*path' ? '*path' : normalizedPath;
383
386
  // Normalize the path to support the prefix if it set in application
384
- if (this._pathPrefix && !normalizedPath.startsWith(this._pathPrefix)) {
387
+ if (this._pathPrefix &&
388
+ !normalizedPath.startsWith(this._pathPrefix) &&
389
+ (normalizedPath === '/' || normalizedPath === '')) {
385
390
  normalizedPath = `${this._pathPrefix}${normalizedPath}`;
386
391
  if (normalizedPath.endsWith('/')) {
387
392
  normalizedPath = `${normalizedPath}{*path}`;
@@ -234,8 +234,10 @@ function fastifyMiddie(fastify, options, next) {
234
234
  instance[kMiddieHasMiddlewares] = false;
235
235
  instance.decorate('use', use);
236
236
  for (const middleware of middlewares) {
237
- instance.use(...middleware);
237
+ instance[kMiddlewares].push(middleware);
238
+ instance[kMiddie].use(...middleware);
238
239
  }
240
+ instance[kMiddieHasMiddlewares] = middlewares.length > 0;
239
241
  }
240
242
  next();
241
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "11.1.29",
3
+ "version": "11.2.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "@fastify/cors": "11.3.0",
22
22
  "@fastify/formbody": "8.0.2",
23
23
  "fast-querystring": "1.1.2",
24
- "fastify": "5.11.0",
24
+ "fastify": "5.11.3",
25
25
  "fastify-plugin": "6.0.0",
26
26
  "find-my-way": "9.7.0",
27
27
  "light-my-request": "6.6.0",
@@ -43,5 +43,5 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "gitHead": "03587a112ebbbb53a6bc3875afb5a9205aa5a5f1"
46
+ "gitHead": "f2a7e4b1f57193cbbfe34e988276fc0eaf0b6eb5"
47
47
  }