@nestjs/common 10.2.10 → 10.3.1

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-2023 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-2024 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
package/Readme.md CHANGED
@@ -83,7 +83,10 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
83
83
  <a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td>
84
84
  <td>
85
85
  <a href="https://ridicorp.com/career/" target="_blank"><img src="https://nestjs.com/img/ridi-logo.svg" width="105" valign="middle" /></a></td><td>
86
- <a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td></</tr></table>
86
+ <a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td>
87
+ </tr><tr><td>
88
+ <a href="https://skunk.team" target="_blank"><img src="https://nestjs.com/img/skunk-logo.png" height="60" valign="middle" /></a></td>
89
+ </tr></table>
87
90
 
88
91
  #### Silver Sponsors
89
92
 
@@ -35,6 +35,11 @@ const shared_utils_1 = require("../../utils/shared.utils");
35
35
  function Inject(token) {
36
36
  return (target, key, index) => {
37
37
  const type = token || Reflect.getMetadata('design:type', target, key);
38
+ if (!type) {
39
+ throw new Error(`Token is undefined at index: ${index}. This often occurs due to circular dependencies.
40
+ Ensure there are no circular dependencies in your files or barrel files.
41
+ For more details, refer to https://trilon.io/blog/avoiding-circular-dependencies-in-nestjs.`);
42
+ }
38
43
  if (!(0, shared_utils_1.isUndefined)(index)) {
39
44
  let dependencies = Reflect.getMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, target) || [];
40
45
  dependencies = [...dependencies, { index, param: type }];
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * For example:
5
5
  * `@Header('Cache-Control', 'none')`
6
+ * `@Header('Cache-Control', () => 'none')`
6
7
  *
7
8
  * @param name string to be used for header name
8
9
  * @param value string to be used for header value
@@ -11,4 +12,4 @@
11
12
  *
12
13
  * @publicApi
13
14
  */
14
- export declare function Header(name: string, value: string): MethodDecorator;
15
+ export declare function Header(name: string, value: string | (() => string)): MethodDecorator;
@@ -8,6 +8,7 @@ const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
8
8
  *
9
9
  * For example:
10
10
  * `@Header('Cache-Control', 'none')`
11
+ * `@Header('Cache-Control', () => 'none')`
11
12
  *
12
13
  * @param name string to be used for header name
13
14
  * @param value string to be used for header value
@@ -50,7 +50,7 @@ export interface CorsOptions {
50
50
  optionsSuccessStatus?: number;
51
51
  }
52
52
  export interface CorsOptionsCallback {
53
- (error: Error, options: CorsOptions): void;
53
+ (error: Error | null, options: CorsOptions): void;
54
54
  }
55
55
  export interface CorsOptionsDelegate<T> {
56
56
  (req: T, cb: CorsOptionsCallback): void;
@@ -96,4 +96,10 @@ export interface HttpsOptions {
96
96
  * the default callback with high-level API will be used.
97
97
  */
98
98
  SNICallback?: (servername: string, cb: (err: Error, ctx: any) => any) => any;
99
+ /**
100
+ * Optionally affect the OpenSSL protocol behavior, which is not usually necessary.
101
+ * This should be used carefully if at all! Value is a numeric bitmask of the SSL_OP_* options
102
+ * from OpenSSL Options.
103
+ */
104
+ secureOptions?: number;
99
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "10.2.10",
3
+ "version": "10.3.1",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",