@nestjs/common 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
@@ -302,6 +302,26 @@ export declare function Body(property: string, ...pipes: (Type<PipeTransform> |
302
302
  * @publicApi
303
303
  */
304
304
  export declare function RawBody(): ParameterDecorator;
305
+ /**
306
+ * Route handler parameter decorator. Extracts the `rawBody` Buffer
307
+ * property from the `req` object and populates the decorated parameter with that value.
308
+ * Also applies pipes to the bound rawBody parameter.
309
+ *
310
+ * For example:
311
+ * ```typescript
312
+ * async create(@RawBody(new ValidationPipe()) rawBody: Buffer)
313
+ * ```
314
+ *
315
+ * @param pipes one or more pipes - either instances or classes - to apply to
316
+ * the bound body parameter.
317
+ *
318
+ * @see [Request object](https://docs.nestjs.com/controllers#request-object)
319
+ * @see [Raw body](https://docs.nestjs.com/faq/raw-body)
320
+ * @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
321
+ *
322
+ * @publicApi
323
+ */
324
+ export declare function RawBody(...pipes: (Type<PipeTransform<Buffer | undefined>> | PipeTransform<Buffer | undefined>)[]): ParameterDecorator;
305
325
  /**
306
326
  * Route handler parameter decorator. Extracts the `params`
307
327
  * property from the `req` object and populates the decorated
package/index.js CHANGED
@@ -4,7 +4,7 @@ exports.VERSION_NEUTRAL = exports.Scope = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /*
6
6
  * Nest @common
7
- * Copyright(c) 2017 - 2023 Kamil Mysliwiec
7
+ * Copyright(c) 2017 - 2025 Kamil Mysliwiec
8
8
  * https://nestjs.com
9
9
  * MIT Licensed
10
10
  */
@@ -1,7 +1,6 @@
1
1
  import { RequestMethod } from '../../enums';
2
- import { CorsOptions, CorsOptionsDelegate } from '../../interfaces/external/cors-options.interface';
3
2
  import { NestApplicationOptions } from '../../interfaces/nest-application-options.interface';
4
- import { VersioningOptions, VersionValue } from '../version-options.interface';
3
+ import { VersionValue, VersioningOptions } from '../version-options.interface';
5
4
  export type ErrorHandler<TRequest = any, TResponse = any> = (error: any, req: TRequest, res: TResponse, next?: Function) => any;
6
5
  export type RequestHandler<TRequest = any, TResponse = any> = (req: TRequest, res: TResponse, next?: Function) => any;
7
6
  export interface HttpServer<TRequest = any, TResponse = any, ServerInstance = any> {
@@ -60,7 +59,7 @@ export interface HttpServer<TRequest = any, TResponse = any, ServerInstance = an
60
59
  getRequestUrl?(request: TRequest): string;
61
60
  getInstance(): ServerInstance;
62
61
  registerParserMiddleware(...args: any[]): any;
63
- enableCors(options: CorsOptions | CorsOptionsDelegate<TRequest>): any;
62
+ enableCors(options: any): any;
64
63
  getHttpServer(): any;
65
64
  initHttpServer(options: NestApplicationOptions): void;
66
65
  close(): any;
@@ -1,4 +1,3 @@
1
- import { CorsOptions, CorsOptionsDelegate } from './external/cors-options.interface';
2
1
  import { CanActivate } from './features/can-activate.interface';
3
2
  import { NestInterceptor } from './features/nest-interceptor.interface';
4
3
  import { GlobalPrefixOptions } from './global-prefix-options.interface';
@@ -25,7 +24,7 @@ export interface INestApplication<TServer = any> extends INestApplicationContext
25
24
  *
26
25
  * @returns {void}
27
26
  */
28
- enableCors(options?: CorsOptions | CorsOptionsDelegate<any>): void;
27
+ enableCors(options?: any): void;
29
28
  /**
30
29
  * Enables Versioning for the application.
31
30
  * By default, URI-based versioning is used.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "11.0.0-next.4",
3
+ "version": "11.0.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
21
  "iterare": "1.2.1",
22
- "tslib": "2.7.0",
22
+ "tslib": "2.8.1",
23
23
  "uid": "2.0.2"
24
24
  },
25
25
  "peerDependencies": {
@@ -137,6 +137,9 @@ let ValidationPipe = class ValidationPipe {
137
137
  }
138
138
  return +value;
139
139
  }
140
+ if (metatype === String && !(0, shared_utils_1.isUndefined)(value)) {
141
+ return String(value);
142
+ }
140
143
  return value;
141
144
  }
142
145
  toEmptyIfNil(value, metatype) {