@nestjs/platform-fastify 11.0.0-next.4 → 11.0.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-2025 Kamil Mysliwiec <https://kamilmysliwiec.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -1,6 +1,6 @@
1
+ import { FastifyCorsOptions } from '@fastify/cors';
1
2
  import { Logger, RequestMethod, VersioningOptions } from '@nestjs/common';
2
3
  import { VersionValue } from '@nestjs/common/interfaces';
3
- import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface';
4
4
  import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
5
5
  import { FastifyBaseLogger, FastifyBodyParser, FastifyInstance, FastifyPluginAsync, FastifyPluginCallback, FastifyRegister, FastifyReply, FastifyRequest, FastifyServerOptions, RawReplyDefaultExpression, RawRequestDefaultExpression, RawServerBase, RawServerDefault, RequestGenericInterface, RouteGenericInterface } from 'fastify';
6
6
  import * as http from 'http';
@@ -82,7 +82,7 @@ export declare class FastifyAdapter<TServer extends RawServerBase = RawServerDef
82
82
  setNotFoundHandler(handler: Function): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
83
83
  getHttpServer<T = TServer>(): T;
84
84
  getInstance<T = TInstance>(): T;
85
- register<TRegister extends Parameters<FastifyRegister<TInstance>>>(plugin: TRegister['0'], opts?: TRegister['1']): any;
85
+ register<TRegister extends Parameters<FastifyRegister<FastifyInstance<TServer, TRawRequest, TRawResponse>>>>(plugin: TRegister['0'], opts?: TRegister['1']): any;
86
86
  inject(): LightMyRequestChain;
87
87
  inject(opts: InjectOptions | string): Promise<LightMyRequestResponse>;
88
88
  close(): Promise<undefined>;
@@ -97,7 +97,7 @@ export declare class FastifyAdapter<TServer extends RawServerBase = RawServerDef
97
97
  getRequestMethod(request: TRequest): string;
98
98
  getRequestUrl(request: TRequest): string;
99
99
  getRequestUrl(request: TRawRequest): string;
100
- enableCors(options: CorsOptions | CorsOptionsDelegate<TRequest>): void;
100
+ enableCors(options?: FastifyCorsOptions): void;
101
101
  registerParserMiddleware(prefix?: string, rawBody?: boolean): void;
102
102
  useBodyParser(type: string | string[] | RegExp, rawBody: boolean, options?: NestFastifyBodyParserOptions, parser?: FastifyBodyParser<Buffer, TServer>): void;
103
103
  createMiddlewareFactory(requestMethod: RequestMethod): Promise<(path: string, callback: Function) => any>;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FastifyAdapter = void 0;
4
- /* eslint-disable @typescript-eslint/no-floating-promises */
5
4
  const common_1 = require("@nestjs/common");
6
5
  const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
7
6
  const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Nest @platform-fastify
4
- * Copyright(c) 2017 - 2023 Kamil Mysliwiec
4
+ * Copyright(c) 2017 - 2025 Kamil Mysliwiec
5
5
  * https://nestjs.com
6
6
  * MIT Licensed
7
7
  */
@@ -1,3 +1,4 @@
1
+ import { FastifyCorsOptions } from '@fastify/cors';
1
2
  import { HttpServer, INestApplication } from '@nestjs/common';
2
3
  import { FastifyBodyParser, FastifyInstance, FastifyListenOptions, FastifyPluginAsync, FastifyPluginCallback, FastifyPluginOptions, FastifyRegisterOptions, FastifyReply, FastifyRequest, RawServerBase, RawServerDefault } from 'fastify';
3
4
  import { InjectOptions, Chain as LightMyRequestChain, Response as LightMyRequestResponse } from 'light-my-request';
@@ -45,6 +46,12 @@ export interface NestFastifyApplication<TServer extends RawServerBase = RawServe
45
46
  * @returns {this}
46
47
  */
47
48
  useStaticAssets(options: FastifyStaticOptions): this;
49
+ /**
50
+ * Enables CORS (Cross-Origin Resource Sharing)
51
+ *
52
+ * @returns {void}
53
+ */
54
+ enableCors(options?: FastifyCorsOptions): void;
48
55
  /**
49
56
  * Sets a view engine for templates (views), for example: `pug`, `handlebars`, or `ejs`.
50
57
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "11.0.0-next.4",
3
+ "version": "11.0.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -18,17 +18,17 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@fastify/cors": "10.0.1",
22
- "@fastify/formbody": "8.0.1",
23
- "@fastify/middie": "9.0.2",
24
- "fastify": "5.1.0",
25
- "light-my-request": "6.3.0",
21
+ "@fastify/cors": "10.0.2",
22
+ "@fastify/formbody": "8.0.2",
23
+ "@fastify/middie": "9.0.3",
24
+ "fastify": "5.2.1",
25
+ "light-my-request": "6.5.1",
26
26
  "path-to-regexp": "8.2.0",
27
- "tslib": "2.7.0"
27
+ "tslib": "2.8.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@fastify/static": "^6.0.0 || ^7.0.0 || ^8.0.0",
31
- "@fastify/view": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
30
+ "@fastify/static": "^8.0.0",
31
+ "@fastify/view": "^10.0.0",
32
32
  "@nestjs/common": "^10.0.0",
33
33
  "@nestjs/core": "^10.0.0"
34
34
  },