@nestjs/core 8.4.4 → 8.4.5
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/Readme.md
CHANGED
|
@@ -72,11 +72,12 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
72
72
|
|
|
73
73
|
<table style="text-align:center;"><tr><td>
|
|
74
74
|
<a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
|
|
75
|
-
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="
|
|
75
|
+
<a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
|
|
76
76
|
<td>
|
|
77
77
|
<a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
|
|
78
78
|
<td>
|
|
79
|
-
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td
|
|
79
|
+
<a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
|
|
80
|
+
<a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
|
|
80
81
|
|
|
81
82
|
#### Silver Sponsors
|
|
82
83
|
|
package/injector/container.js
CHANGED
|
@@ -103,13 +103,13 @@ class NestContainer {
|
|
|
103
103
|
moduleRef.addRelatedModule(related);
|
|
104
104
|
}
|
|
105
105
|
addProvider(provider, token) {
|
|
106
|
+
const moduleRef = this.modules.get(token);
|
|
106
107
|
if (!provider) {
|
|
107
|
-
throw new circular_dependency_exception_1.CircularDependencyException();
|
|
108
|
+
throw new circular_dependency_exception_1.CircularDependencyException(moduleRef === null || moduleRef === void 0 ? void 0 : moduleRef.metatype.name);
|
|
108
109
|
}
|
|
109
|
-
if (!
|
|
110
|
+
if (!moduleRef) {
|
|
110
111
|
throw new unknown_module_exception_1.UnknownModuleException();
|
|
111
112
|
}
|
|
112
|
-
const moduleRef = this.modules.get(token);
|
|
113
113
|
return moduleRef.addProvider(provider);
|
|
114
114
|
}
|
|
115
115
|
addInjectable(injectable, token, host) {
|
package/injector/injector.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare type InjectorDependency = InjectionToken;
|
|
|
12
12
|
* The property-based dependency
|
|
13
13
|
*/
|
|
14
14
|
export interface PropertyDependency {
|
|
15
|
-
key: string;
|
|
15
|
+
key: symbol | string;
|
|
16
16
|
name: InjectorDependency;
|
|
17
17
|
isOptional?: boolean;
|
|
18
18
|
instance?: any;
|
|
@@ -55,13 +55,13 @@ export declare class Injector {
|
|
|
55
55
|
reflectConstructorParams<T>(type: Type<T>): any[];
|
|
56
56
|
reflectOptionalParams<T>(type: Type<T>): any[];
|
|
57
57
|
reflectSelfParams<T>(type: Type<T>): any[];
|
|
58
|
-
resolveSingleParam<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | any, dependencyContext: InjectorDependencyContext, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: string | number): Promise<InstanceWrapper<any>>;
|
|
58
|
+
resolveSingleParam<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | any, dependencyContext: InjectorDependencyContext, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<any>>;
|
|
59
59
|
resolveParamToken<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | any): any;
|
|
60
|
-
resolveComponentInstance<T>(moduleRef: Module, token: InstanceToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: string | number): Promise<InstanceWrapper>;
|
|
60
|
+
resolveComponentInstance<T>(moduleRef: Module, token: InstanceToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper>;
|
|
61
61
|
resolveComponentHost<T>(moduleRef: Module, instanceWrapper: InstanceWrapper<T | Promise<T>>, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<InstanceWrapper>;
|
|
62
|
-
lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: string | number): Promise<InstanceWrapper<T>>;
|
|
63
|
-
lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: string | number): Promise<any>;
|
|
64
|
-
lookupComponentInImports(moduleRef: Module, name: InstanceToken, wrapper: InstanceWrapper, moduleRegistry?: any[], contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: string | number, isTraversing?: boolean): Promise<any>;
|
|
62
|
+
lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<T>>;
|
|
63
|
+
lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<any>;
|
|
64
|
+
lookupComponentInImports(moduleRef: Module, name: InstanceToken, wrapper: InstanceWrapper, moduleRegistry?: any[], contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise<any>;
|
|
65
65
|
resolveProperties<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject?: InjectorDependency[], contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
|
|
66
66
|
reflectProperties<T>(type: Type<T>): PropertyDependency[];
|
|
67
67
|
applyProperties<T = any>(instance: T, properties: PropertyDependency[]): void;
|
|
@@ -74,7 +74,7 @@ export declare class Injector {
|
|
|
74
74
|
private resolveScopedComponentHost;
|
|
75
75
|
private isInquirerRequest;
|
|
76
76
|
private isInquirer;
|
|
77
|
-
protected addDependencyMetadata(keyOrIndex:
|
|
77
|
+
protected addDependencyMetadata(keyOrIndex: symbol | string | number, hostWrapper: InstanceWrapper, instanceWrapper: InstanceWrapper): void;
|
|
78
78
|
private getTokenName;
|
|
79
79
|
private printResolvingDependenciesLog;
|
|
80
80
|
private printLookingForProviderLog;
|
package/injector/injector.js
CHANGED
|
@@ -386,9 +386,12 @@ class Injector {
|
|
|
386
386
|
return param === inquirer_1.INQUIRER && parentInquirer;
|
|
387
387
|
}
|
|
388
388
|
addDependencyMetadata(keyOrIndex, hostWrapper, instanceWrapper) {
|
|
389
|
-
(0, shared_utils_1.isString)(keyOrIndex)
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
if ((0, shared_utils_1.isSymbol)(keyOrIndex) || (0, shared_utils_1.isString)(keyOrIndex)) {
|
|
390
|
+
hostWrapper.addPropertiesMetadata(keyOrIndex, instanceWrapper);
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
hostWrapper.addCtorMetadata(keyOrIndex, instanceWrapper);
|
|
394
|
+
}
|
|
392
395
|
}
|
|
393
396
|
getTokenName(token) {
|
|
394
397
|
return (0, shared_utils_1.isFunction)(token) ? token.name : token.toString();
|
|
@@ -13,7 +13,7 @@ export interface InstancePerContext<T> {
|
|
|
13
13
|
donePromise?: Promise<void>;
|
|
14
14
|
}
|
|
15
15
|
export interface PropertyMetadata {
|
|
16
|
-
key: string;
|
|
16
|
+
key: symbol | string;
|
|
17
17
|
wrapper: InstanceWrapper;
|
|
18
18
|
}
|
|
19
19
|
export declare class InstanceWrapper<T = any> {
|
|
@@ -43,7 +43,7 @@ export declare class InstanceWrapper<T = any> {
|
|
|
43
43
|
setInstanceByInquirerId(contextId: ContextId, inquirerId: string, value: InstancePerContext<T>): void;
|
|
44
44
|
addCtorMetadata(index: number, wrapper: InstanceWrapper): void;
|
|
45
45
|
getCtorMetadata(): InstanceWrapper[];
|
|
46
|
-
addPropertiesMetadata(key: string, wrapper: InstanceWrapper): void;
|
|
46
|
+
addPropertiesMetadata(key: symbol | string, wrapper: InstanceWrapper): void;
|
|
47
47
|
getPropertiesMetadata(): PropertyMetadata[];
|
|
48
48
|
addEnhancerMetadata(wrapper: InstanceWrapper): void;
|
|
49
49
|
getEnhancersMetadata(): InstanceWrapper[];
|
|
@@ -237,7 +237,7 @@ class NestApplicationContext {
|
|
|
237
237
|
return this.get(typeOrToken, options);
|
|
238
238
|
}
|
|
239
239
|
const ctorHost = wrapperRef.instance || { constructor: typeOrToken };
|
|
240
|
-
const instance = await this.injector.loadPerContext(ctorHost, wrapperRef.host, collection, contextId);
|
|
240
|
+
const instance = await this.injector.loadPerContext(ctorHost, wrapperRef.host, collection, contextId, wrapperRef);
|
|
241
241
|
if (!instance) {
|
|
242
242
|
throw new unknown_element_exception_1.UnknownElementException();
|
|
243
243
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.5",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"iterare": "1.2.1",
|
|
33
33
|
"object-hash": "3.0.0",
|
|
34
34
|
"path-to-regexp": "3.2.0",
|
|
35
|
-
"tslib": "2.
|
|
35
|
+
"tslib": "2.4.0",
|
|
36
36
|
"uuid": "8.3.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@nestjs/common": "8.4.
|
|
39
|
+
"@nestjs/common": "8.4.5"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@nestjs/common": "^8.0.0",
|