@nestjs/common 10.3.0 → 10.3.2
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 +1 -1
- package/decorators/core/inject.decorator.js +5 -0
- package/decorators/http/header.decorator.d.ts +2 -1
- package/decorators/http/header.decorator.js +1 -0
- package/interfaces/external/https-options.interface.d.ts +6 -0
- package/interfaces/http/http-server.interface.d.ts +2 -0
- package/module-utils/configurable-module.builder.js +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
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
|
|
@@ -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
|
|
@@ -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
|
}
|
|
@@ -24,6 +24,8 @@ export interface HttpServer<TRequest = any, TResponse = any, ServerInstance = an
|
|
|
24
24
|
all(handler: RequestHandler<TRequest, TResponse>): any;
|
|
25
25
|
options(handler: RequestHandler<TRequest, TResponse>): any;
|
|
26
26
|
options(path: string, handler: RequestHandler<TRequest, TResponse>): any;
|
|
27
|
+
search?(handler: RequestHandler<TRequest, TResponse>): any;
|
|
28
|
+
search?(path: string, handler: RequestHandler<TRequest, TResponse>): any;
|
|
27
29
|
listen(port: number | string, callback?: () => void): any;
|
|
28
30
|
listen(port: number | string, hostname: string, callback?: () => void): any;
|
|
29
31
|
reply(response: any, body: any, statusCode?: number): any;
|
|
@@ -112,7 +112,7 @@ class ConfigurableModuleBuilder {
|
|
|
112
112
|
const providers = [
|
|
113
113
|
{
|
|
114
114
|
provide: self.options.optionsInjectionToken,
|
|
115
|
-
|
|
115
|
+
useValue: this.omitExtras(options, self.extras),
|
|
116
116
|
},
|
|
117
117
|
];
|
|
118
118
|
if (self.options.alwaysTransient) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/common",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.2",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"class-transformer": "*",
|
|
27
27
|
"class-validator": "*",
|
|
28
|
-
"reflect-metadata": "^0.1.12",
|
|
28
|
+
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
29
29
|
"rxjs": "^7.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|