@depup/nestjs__core 11.1.18-depup.0 → 11.2.0-depup.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/README.md +2 -2
- package/Readme.md +26 -45
- package/adapters/http-adapter.d.ts +2 -0
- package/adapters/http-adapter.js +3 -0
- package/changes.json +1 -1
- package/errors/exceptions/invalid-class-module.exception.d.ts +1 -1
- package/errors/exceptions/invalid-class-module.exception.js +2 -2
- package/errors/exceptions/invalid-module.exception.d.ts +1 -1
- package/errors/exceptions/invalid-module.exception.js +2 -2
- package/errors/exceptions/route-conflict.exception.d.ts +4 -0
- package/errors/exceptions/route-conflict.exception.js +7 -0
- package/errors/messages.d.ts +2 -2
- package/errors/messages.js +30 -4
- package/helpers/barrier.js +4 -1
- package/helpers/handler-metadata-storage.d.ts +1 -0
- package/helpers/router-method-factory.d.ts +1 -0
- package/helpers/router-method-factory.js +1 -0
- package/injector/container.js +2 -2
- package/injector/injector.d.ts +32 -14
- package/injector/injector.js +165 -79
- package/injector/instance-wrapper.d.ts +2 -0
- package/injector/instance-wrapper.js +25 -0
- package/injector/internal-core-module/internal-core-module-factory.js +1 -1
- package/injector/module-ref.js +22 -13
- package/injector/module.d.ts +6 -0
- package/injector/module.js +8 -0
- package/interceptors/interceptors-consumer.js +29 -4
- package/middleware/builder.js +5 -1
- package/nest-application-context.js +4 -11
- package/nest-application.d.ts +2 -0
- package/nest-application.js +20 -1
- package/nest-factory.js +1 -0
- package/package.json +5 -14
- package/router/interfaces/resolved-route.interface.d.ts +32 -0
- package/router/interfaces/resolved-route.interface.js +1 -0
- package/router/interfaces/route-conflict.interface.d.ts +14 -0
- package/router/interfaces/route-conflict.interface.js +1 -0
- package/router/interfaces/route-resolution-options.interface.d.ts +24 -0
- package/router/interfaces/route-resolution-options.interface.js +1 -0
- package/router/legacy-route-converter.d.ts +1 -1
- package/router/legacy-route-converter.js +24 -13
- package/router/route-conflict-detector.d.ts +71 -0
- package/router/route-conflict-detector.js +276 -0
- package/router/route-specificity-sorter.d.ts +23 -0
- package/router/route-specificity-sorter.js +59 -0
- package/router/router-execution-context.d.ts +1 -0
- package/router/router-execution-context.js +32 -3
- package/router/router-response-controller.d.ts +3 -1
- package/router/router-response-controller.js +138 -31
- package/router/sse-stream.d.ts +13 -0
- package/router/sse-stream.js +55 -15
- package/scanner.js +13 -6
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/nestjs__core
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@nestjs/core](https://www.npmjs.com/package/@nestjs/core) @ 11.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [@nestjs/core](https://www.npmjs.com/package/@nestjs/core) @ 11.2.0 |
|
|
17
|
+
| Processed | 2026-08-14 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/Readme.md
CHANGED
|
@@ -29,7 +29,7 @@ Nest is a framework for building efficient, scalable <a href="https://nodejs.org
|
|
|
29
29
|
|
|
30
30
|
## Philosophy
|
|
31
31
|
|
|
32
|
-
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.
|
|
32
|
+
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.dev/" target="_blank">Angular</a>, <a href="https://react.dev/" target="_blank">React</a>, and <a href="https://vuejs.org/" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
|
|
33
33
|
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
|
|
34
34
|
|
|
35
35
|
## Getting started
|
|
@@ -59,11 +59,11 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
59
59
|
|
|
60
60
|
<table style="text-align:center;">
|
|
61
61
|
<tr>
|
|
62
|
-
<td><a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="200" valign="middle" /></a></td>
|
|
63
|
-
<td><a href="https://microsoft.com/" target="_blank"><img src="https://nestjs.com/img/
|
|
64
|
-
<td><a href="https://mojam.co" target="_blank"><img src="https://
|
|
62
|
+
<td><a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/github/trilon-logo.svg" width="200" valign="middle" /></a></td>
|
|
63
|
+
<td><a href="https://microsoft.com/" target="_blank"><img src="https://nestjs.com/img/github/microsoft-logo.png" width="180" valign="middle" /></a></td>
|
|
64
|
+
<td><a href="https://mojam.co" target="_blank"><img src="https://images.opencollective.com/mojamco/981e9de/logo/256.png?height=256" width="80" valign="middle" /></a></td>
|
|
65
65
|
<td><a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
|
|
66
|
-
<td><a href="https://serpapi.com/" target="_blank"><img src="https://nestjs.com/img/
|
|
66
|
+
<td><a href="https://serpapi.com/" target="_blank"><img src="https://nestjs.com/img/github/serpapi-logo.png" width="150" valign="middle" /></a></td>
|
|
67
67
|
</tr>
|
|
68
68
|
</table>
|
|
69
69
|
|
|
@@ -71,15 +71,15 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
71
71
|
|
|
72
72
|
<table style="text-align:center;">
|
|
73
73
|
<tr>
|
|
74
|
-
<td><a href="https://www.redhat.com" target="_blank"><img src="https://nestjs.com/img/
|
|
75
|
-
<td><a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="
|
|
76
|
-
<td><a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/
|
|
77
|
-
<td><a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/
|
|
78
|
-
<td><a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/
|
|
74
|
+
<td><a href="https://www.redhat.com" target="_blank"><img src="https://nestjs.com/img/github/red-hat-logo.svg" width="150" valign="middle" /></a></td>
|
|
75
|
+
<td><a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="120" valign="middle" /></a></td>
|
|
76
|
+
<td><a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/github/nx-logo.png" height="45" valign="middle" /></a></td>
|
|
77
|
+
<td><a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/github/intrinisic-logo.png" width="150" valign="middle" /></a></td>
|
|
78
|
+
<td><a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/github/jetbrains-logo.svg" width="70" valign="middle" /></a></td>
|
|
79
79
|
</tr>
|
|
80
80
|
<tr>
|
|
81
|
-
<td><a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/
|
|
82
|
-
<td><a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://
|
|
81
|
+
<td><a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/github/snyk-logo-black.png" width="125" valign="middle" /></a></td>
|
|
82
|
+
<td align="center"><a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://images.opencollective.com/movavi/1fb15e5/avatar/256.png?height=256" width="60" valign="middle" /></a></td>
|
|
83
83
|
</tr>
|
|
84
84
|
</table>
|
|
85
85
|
|
|
@@ -87,14 +87,15 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
87
87
|
|
|
88
88
|
<table style="text-align:center;">
|
|
89
89
|
<tr>
|
|
90
|
-
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/
|
|
91
|
-
<td><a href="https://
|
|
92
|
-
<td><a href="https://
|
|
93
|
-
<td align="center" valign="middle"><a href="https://
|
|
94
|
-
<td align="center" valign="middle"><a href="https://
|
|
95
|
-
<td align="center" valign="middle"><a href="https://crawljobs.com" target="_blank"><img src="https://nestjs.com/img/logos/crawljobs-logo.svg" width="130" valign="middle" /></a></td>
|
|
90
|
+
<td><a href="https://www.mercedes-benz.com/" target="_blank"><img src="https://nestjs.com/img/github/mercedes-logo.png" width="100" valign="middle" /></a></td>
|
|
91
|
+
<td><a href="https://handsontable.com/docs/react-data-grid/?utm_source=NestJS_GH&utm_medium=sponsorship&utm_campaign=library_sponsorship_2024" target="_blank"><img src="https://nestjs.com/img/github/handsontable-dark-logo.svg#2" width="150" valign="middle" /></a></td>
|
|
92
|
+
<td align="center" valign="middle"><a href="https://www.itflashcards.com/" target="_blank"><img src="https://nestjs.com/img/github/it_flashcards-logo.png" width="170" valign="middle" /></a></td>
|
|
93
|
+
<td align="center" valign="middle"><a href="https://arcjet.com/?ref=nestjs" target="_blank"><img src="https://nestjs.com/img/github/arcjet-logo.svg" width="170" valign="middle" /></a></td>
|
|
94
|
+
<td align="center" valign="middle"><a href="https://pandektes.com" target="_blank"><img src="https://nestjs.com/img/github/pandektes-logo.png" width="65" valign="middle" /></a></td>
|
|
96
95
|
</tr><tr>
|
|
97
|
-
<td align="center" valign="middle"><a href="https://
|
|
96
|
+
<td align="center" valign="middle"><a href="https://www.fintechcrafts.com/" target="_blank"><img src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/935813df-48a9-4b41-b923-7d70b5621c6b/2026-05-06%2010%2021%2033.png" width="65" valign="middle" /></a></td>
|
|
97
|
+
<td align="center" valign="middle"><a href="https://talordata.com/?campaignid=Ya5Xpw2gmhyee6Tg&utm_source=nestjs&utm_term=nestjs" target="_blank"><img src="https://images.opencollective.com/elowen/9ccac7f/avatar/512.png" width="65" valign="middle" /></a></td>
|
|
98
|
+
<td align="center" valign="middle"><a href="https://memory2.co/" target="_blank"><img src="https://images.opencollective.com/memory-squared/bbe37f5/avatar/256.png?height=50" width="65" valign="middle" /></a></td>
|
|
98
99
|
</tr>
|
|
99
100
|
</table>
|
|
100
101
|
|
|
@@ -102,32 +103,12 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
102
103
|
|
|
103
104
|
<table>
|
|
104
105
|
<tr>
|
|
105
|
-
<td align="center" valign="middle"><a href="https://
|
|
106
|
-
<td align="center" valign="middle"><a href="https://
|
|
107
|
-
<td align="center" valign="middle"><a href="https://
|
|
108
|
-
<td align="center" valign="middle"><a href="https://
|
|
109
|
-
<td align="center" valign="middle"><a href="https://
|
|
110
|
-
<td align="center" valign="middle"><a href="https://
|
|
111
|
-
</tr>
|
|
112
|
-
<tr>
|
|
113
|
-
<td align="center" valign="middle"><a href="https://vpn-review.com/vpn-for-torrenting" target="_blank"><img src="https://nestjs.com/img/logos/vpn-review-logo.png" width="85" valign="middle" /></a></td>
|
|
114
|
-
<td align="center" valign="middle"><a href="https://lambda-it.ch/" target="_blank"><img src="https://nestjs.com/img/logos/lambda-it-logo.svg" width="115" valign="middle" /></a></td>
|
|
115
|
-
<td align="center" valign="middle"><a href="https://rocketech.it/cases/?utm_source=google&utm_medium=badge&utm_campaign=nestjs" target="_blank"><img src="https://nestjs.com/img/logos/rocketech-logo.svg" width="110" valign="middle" /></a></td>
|
|
116
|
-
<td align="center" valign="middle"><a href="https://www.anonymistic.com/" target="_blank"><img src="https://nestjs.com/img/logos/anonymistic-logo.png" width="125" valign="middle" /></a></td>
|
|
117
|
-
<td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/logos/naologic-logo.svg" width="125" valign="middle" /></a></td>
|
|
118
|
-
<td align="center" valign="middle"><a href="https://triplecore.io" target="_blank"><img src="https://nestjs.com/img/logos/triplecore-logo.svg" width="50" valign="middle" /></a></td>
|
|
119
|
-
</tr>
|
|
120
|
-
<tr>
|
|
121
|
-
<td align="center" valign="middle"><a href="https://polygon-software.ch/" target="_blank"><img src="https://nestjs.com/img/logos/polygon-logo.svg" width="120" valign="middle" /></a></td>
|
|
122
|
-
<td align="center" valign="middle"><a href="https://boringowl.io/" target="_blank"><img src="https://nestjs.com/img/logos/boringowl-logo.svg" width="120" valign="middle" /></a></td>
|
|
123
|
-
<td align="center" valign="middle"><a href="https://nordbot.app/" target="_blank"><img src="https://nestjs.com/img/logos/nordbot-logo.png" width="120" valign="middle" /></a></td>
|
|
124
|
-
<td align="center" valign="middle"><a href="https://doppio.sh/" target="_blank"><img src="https://nestjs.com/img/logos/dopiosh-logo.png" width="50" valign="middle" /></a></td>
|
|
125
|
-
<td align="center" valign="middle"><a href="https://www.hingehealth.com/" target="_blank"><img src="https://nestjs.com/img/logos/hinge-health-logo.svg" width="100" valign="middle" /></a></td>
|
|
126
|
-
<td align="center" valign="middle"><a href="https://www.tripoffice.com/" target="_blank"><img src="https://nestjs.com/img/logos/tripoffice-logo.png" width="140" valign="middle" /></a></td>
|
|
127
|
-
</tr>
|
|
128
|
-
<tr>
|
|
129
|
-
<td align="center" valign="middle"><a href="https://solcellsforetag.se/" target="_blank"><img src="https://nestjs.com/img/logos/solcellsforetag-logo.svg" width="140" valign="middle" /></a></td>
|
|
130
|
-
<td align="center" valign="middle"><a href="https://www.route4me.com/" target="_blank"><img src="https://nestjs.com/img/logos/route4me-logo.svg" width="100" valign="middle" /></a></td>
|
|
106
|
+
<td align="center" valign="middle"><a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/github/mantro-logo.svg" width="95" valign="middle" /></a></td>
|
|
107
|
+
<td align="center" valign="middle"><a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/github/triplebyte-logo.png" width="107" valign="middle" /></a></td>
|
|
108
|
+
<td align="center" valign="middle"><a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/github/nearpod-logo.svg" width="100" valign="middle" /></a></td>
|
|
109
|
+
<td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/github/naologic-logo.svg" width="125" valign="middle" /></a></td>
|
|
110
|
+
<td align="center" valign="middle"><a href="https://triplecore.io" target="_blank"><img src="https://nestjs.com/img/github/triplecore-logo.svg" width="50" valign="middle" /></a>
|
|
111
|
+
<td align="center" valign="middle"><a href="https://www.hingehealth.com/" target="_blank"><img src="https://nestjs.com/img/github/hinge-health-logo.svg" width="100" valign="middle" /></a></td>
|
|
131
112
|
</tr>
|
|
132
113
|
</table>
|
|
133
114
|
|
|
@@ -41,6 +41,8 @@ export declare abstract class AbstractHttpAdapter<TServer = any, TRequest = any,
|
|
|
41
41
|
all(path: any, handler: RequestHandler): any;
|
|
42
42
|
search(handler: RequestHandler): any;
|
|
43
43
|
search(path: any, handler: RequestHandler): any;
|
|
44
|
+
query(handler: RequestHandler): any;
|
|
45
|
+
query(path: any, handler: RequestHandler): any;
|
|
44
46
|
options(handler: RequestHandler): any;
|
|
45
47
|
options(path: any, handler: RequestHandler): any;
|
|
46
48
|
listen(port: string | number, callback?: () => void): any;
|
package/adapters/http-adapter.js
CHANGED
package/changes.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RuntimeException } from './runtime.exception';
|
|
2
2
|
export declare class InvalidClassModuleException extends RuntimeException {
|
|
3
|
-
constructor(metatypeUsedAsAModule: any, scope: any[]);
|
|
3
|
+
constructor(metatypeUsedAsAModule: any, scope: any[], classKind: 'provider' | 'controller' | 'filter');
|
|
4
4
|
}
|
|
@@ -4,8 +4,8 @@ exports.InvalidClassModuleException = void 0;
|
|
|
4
4
|
const messages_1 = require("../messages");
|
|
5
5
|
const runtime_exception_1 = require("./runtime.exception");
|
|
6
6
|
class InvalidClassModuleException extends runtime_exception_1.RuntimeException {
|
|
7
|
-
constructor(metatypeUsedAsAModule, scope) {
|
|
8
|
-
super((0, messages_1.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE)(metatypeUsedAsAModule, scope));
|
|
7
|
+
constructor(metatypeUsedAsAModule, scope, classKind) {
|
|
8
|
+
super((0, messages_1.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE)(metatypeUsedAsAModule, scope, classKind));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.InvalidClassModuleException = InvalidClassModuleException;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RuntimeException } from './runtime.exception';
|
|
2
2
|
export declare class InvalidModuleException extends RuntimeException {
|
|
3
|
-
constructor(parentModule: any, index: number, scope: any[]);
|
|
3
|
+
constructor(parentModule: any, index: number, scope: any[], receivedValue: unknown);
|
|
4
4
|
}
|
|
@@ -4,8 +4,8 @@ exports.InvalidModuleException = void 0;
|
|
|
4
4
|
const messages_1 = require("../messages");
|
|
5
5
|
const runtime_exception_1 = require("./runtime.exception");
|
|
6
6
|
class InvalidModuleException extends runtime_exception_1.RuntimeException {
|
|
7
|
-
constructor(parentModule, index, scope) {
|
|
8
|
-
super((0, messages_1.INVALID_MODULE_MESSAGE)(parentModule, index, scope));
|
|
7
|
+
constructor(parentModule, index, scope, receivedValue) {
|
|
8
|
+
super((0, messages_1.INVALID_MODULE_MESSAGE)(parentModule, index, scope, receivedValue));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.InvalidModuleException = InvalidModuleException;
|
package/errors/messages.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { Module } from '../injector/module';
|
|
|
4
4
|
export declare const UNKNOWN_DEPENDENCIES_MESSAGE: (type: string | symbol, unknownDependencyContext: InjectorDependencyContext, moduleRef: Module | undefined) => string;
|
|
5
5
|
export declare const INVALID_MIDDLEWARE_MESSAGE: (text: TemplateStringsArray, name: string) => string;
|
|
6
6
|
export declare const UNDEFINED_FORWARDREF_MESSAGE: (scope: Type<any>[]) => string;
|
|
7
|
-
export declare const INVALID_MODULE_MESSAGE: (parentModule: any, index: number, scope: any[]) => string;
|
|
8
|
-
export declare const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE: (metatypeUsedAsAModule: Type | ForwardReference, scope: any[]) => string;
|
|
7
|
+
export declare const INVALID_MODULE_MESSAGE: (parentModule: any, index: number, scope: any[], receivedValue: unknown) => string;
|
|
8
|
+
export declare const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE: (metatypeUsedAsAModule: Type | ForwardReference, scope: any[], classKind: "provider" | "controller" | "filter") => string;
|
|
9
9
|
export declare const UNDEFINED_MODULE_MESSAGE: (parentModule: any, index: number, scope: any[]) => string;
|
|
10
10
|
export declare const UNKNOWN_EXPORT_MESSAGE: (token: string | symbol | undefined, module: string) => string;
|
|
11
11
|
export declare const INVALID_CLASS_MESSAGE: (text: TemplateStringsArray, value: any) => string;
|
package/errors/messages.js
CHANGED
|
@@ -117,18 +117,44 @@ const UNDEFINED_FORWARDREF_MESSAGE = (scope) => `Nest cannot create the module i
|
|
|
117
117
|
Scope [${stringifyScope(scope)}]
|
|
118
118
|
`;
|
|
119
119
|
exports.UNDEFINED_FORWARDREF_MESSAGE = UNDEFINED_FORWARDREF_MESSAGE;
|
|
120
|
-
const INVALID_MODULE_MESSAGE = (parentModule, index, scope) => {
|
|
120
|
+
const INVALID_MODULE_MESSAGE = (parentModule, index, scope, receivedValue) => {
|
|
121
121
|
const parentModuleName = parentModule?.name || 'module';
|
|
122
|
+
let formattedValue;
|
|
123
|
+
let receivedType;
|
|
124
|
+
if (receivedValue === null) {
|
|
125
|
+
formattedValue = 'null';
|
|
126
|
+
receivedType = 'null';
|
|
127
|
+
}
|
|
128
|
+
else if (typeof receivedValue === 'string') {
|
|
129
|
+
formattedValue = `"${receivedValue}"`;
|
|
130
|
+
receivedType = 'string';
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
formattedValue = String(receivedValue);
|
|
134
|
+
receivedType = typeof receivedValue;
|
|
135
|
+
}
|
|
122
136
|
return `Nest cannot create the ${parentModuleName} instance.
|
|
123
137
|
Received an unexpected value at index [${index}] of the ${parentModuleName} "imports" array.
|
|
138
|
+
The received value \`${formattedValue}\` is of type "${receivedType}".
|
|
124
139
|
|
|
125
140
|
Scope [${stringifyScope(scope)}]`;
|
|
126
141
|
};
|
|
127
142
|
exports.INVALID_MODULE_MESSAGE = INVALID_MODULE_MESSAGE;
|
|
128
|
-
const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope) => {
|
|
143
|
+
const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope, classKind) => {
|
|
129
144
|
const metatypeNameQuote = `"${getInstanceName(metatypeUsedAsAModule)}"`;
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
let hint;
|
|
146
|
+
switch (classKind) {
|
|
147
|
+
case 'controller':
|
|
148
|
+
hint = `${metatypeNameQuote} is decorated with @Controller() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "controllers" array of the importing module instead.`;
|
|
149
|
+
break;
|
|
150
|
+
case 'provider':
|
|
151
|
+
hint = `${metatypeNameQuote} is decorated with @Injectable() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "providers" array of the importing module instead.`;
|
|
152
|
+
break;
|
|
153
|
+
case 'filter':
|
|
154
|
+
hint = `${metatypeNameQuote} is decorated with @Catch() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "providers" array (using the APP_FILTER token to apply it globally) or apply it via @UseFilters() instead.`;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
return `${hint}
|
|
132
158
|
|
|
133
159
|
Scope [${stringifyScope(scope)}]
|
|
134
160
|
`;
|
package/helpers/barrier.js
CHANGED
|
@@ -11,6 +11,9 @@ class Barrier {
|
|
|
11
11
|
this.promise = new Promise(resolve => {
|
|
12
12
|
this.resolve = resolve;
|
|
13
13
|
});
|
|
14
|
+
if (targetCount === 0) {
|
|
15
|
+
this.resolve();
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Signal that a participant has reached the barrier.
|
|
@@ -19,7 +22,7 @@ class Barrier {
|
|
|
19
22
|
*/
|
|
20
23
|
signal() {
|
|
21
24
|
this.currentCount += 1;
|
|
22
|
-
if (this.currentCount
|
|
25
|
+
if (this.currentCount >= this.targetCount) {
|
|
23
26
|
this.resolve();
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -10,6 +10,7 @@ export type HandlerResponseBasicFn = <TResult, TResponse>(result: TResult, res:
|
|
|
10
10
|
export type HandleSseResponseFn = <TResult extends Observable<unknown> = any, TResponse extends HeaderStream = any, TRequest extends IncomingMessage = any>(result: TResult, res: TResponse, req: TRequest) => any;
|
|
11
11
|
export interface HandlerMetadata {
|
|
12
12
|
argsLength: number;
|
|
13
|
+
isSseHandler: boolean;
|
|
13
14
|
paramtypes: any[];
|
|
14
15
|
httpStatusCode: number;
|
|
15
16
|
responseHeaders: any[];
|
|
@@ -19,6 +19,7 @@ exports.REQUEST_METHOD_MAP = {
|
|
|
19
19
|
[request_method_enum_1.RequestMethod.MOVE]: 'move',
|
|
20
20
|
[request_method_enum_1.RequestMethod.LOCK]: 'lock',
|
|
21
21
|
[request_method_enum_1.RequestMethod.UNLOCK]: 'unlock',
|
|
22
|
+
[request_method_enum_1.RequestMethod.QUERY]: 'query',
|
|
22
23
|
};
|
|
23
24
|
class RouterMethodFactory {
|
|
24
25
|
get(target, requestMethod) {
|
package/injector/container.js
CHANGED
|
@@ -65,7 +65,7 @@ class NestContainer {
|
|
|
65
65
|
if (this.modules.has(token)) {
|
|
66
66
|
return {
|
|
67
67
|
moduleRef: this.modules.get(token),
|
|
68
|
-
inserted:
|
|
68
|
+
inserted: false,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
return {
|
|
@@ -91,7 +91,7 @@ class NestContainer {
|
|
|
91
91
|
type,
|
|
92
92
|
dynamicMetadata,
|
|
93
93
|
}, scope),
|
|
94
|
-
inserted:
|
|
94
|
+
inserted: true,
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
async setModule({ token, dynamicMetadata, type }, scope) {
|
package/injector/injector.d.ts
CHANGED
|
@@ -39,6 +39,11 @@ export interface InjectorDependencyContext {
|
|
|
39
39
|
*/
|
|
40
40
|
dependencies?: InjectorDependency[];
|
|
41
41
|
}
|
|
42
|
+
interface ResolutionContext {
|
|
43
|
+
contextId: ContextId;
|
|
44
|
+
inquirer?: InstanceWrapper;
|
|
45
|
+
effectiveInquirerId?: string;
|
|
46
|
+
}
|
|
42
47
|
export declare class Injector {
|
|
43
48
|
private readonly options?;
|
|
44
49
|
private logger;
|
|
@@ -48,40 +53,48 @@ export declare class Injector {
|
|
|
48
53
|
* Whether to enable preview mode.
|
|
49
54
|
*/
|
|
50
55
|
preview: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to enable deterministic graph snapshot generation.
|
|
58
|
+
*/
|
|
59
|
+
snapshot?: boolean;
|
|
51
60
|
/**
|
|
52
61
|
* Function to decorate a freshly created instance.
|
|
53
62
|
*/
|
|
54
63
|
instanceDecorator?: (target: unknown) => unknown;
|
|
55
64
|
} | undefined);
|
|
56
65
|
loadPrototype<T>({ token }: InstanceWrapper<T>, collection: Map<InjectionToken, InstanceWrapper<T>>, contextId?: ContextId): void;
|
|
57
|
-
loadInstance<T>(wrapper: InstanceWrapper<T>, collection: Map<InjectionToken, InstanceWrapper>, moduleRef: Module,
|
|
66
|
+
loadInstance<T>(wrapper: InstanceWrapper<T>, collection: Map<InjectionToken, InstanceWrapper>, moduleRef: Module, resolutionContext?: ResolutionContext): Promise<void>;
|
|
58
67
|
loadMiddleware(wrapper: InstanceWrapper, collection: Map<InjectionToken, InstanceWrapper>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
|
59
68
|
loadController(wrapper: InstanceWrapper<Controller>, moduleRef: Module, contextId?: ContextId): Promise<void>;
|
|
60
69
|
loadInjectable<T = any>(wrapper: InstanceWrapper<T>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
|
61
|
-
loadProvider(wrapper: InstanceWrapper<Injectable>, moduleRef: Module,
|
|
70
|
+
loadProvider(wrapper: InstanceWrapper<Injectable>, moduleRef: Module, resolutionContext?: ResolutionContext): Promise<void>;
|
|
62
71
|
applySettlementSignal<T>(instancePerContext: InstancePerContext<T>, host: InstanceWrapper<T>): SettlementSignal;
|
|
63
|
-
resolveConstructorParams<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject: InjectorDependency[] | undefined, callback: (args: unknown[]) => void | Promise<void>,
|
|
72
|
+
resolveConstructorParams<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject: InjectorDependency[] | undefined, callback: (args: unknown[]) => void | Promise<void>, resolutionContext?: ResolutionContext, parentInquirer?: InstanceWrapper): Promise<void>;
|
|
64
73
|
getClassDependencies<T>(wrapper: InstanceWrapper<T>): [InjectorDependency[], number[]];
|
|
65
74
|
getFactoryProviderDependencies<T>(wrapper: InstanceWrapper<T>): [InjectorDependency[], number[]];
|
|
66
|
-
reflectConstructorParams
|
|
67
|
-
reflectOptionalParams
|
|
68
|
-
reflectSelfParams
|
|
69
|
-
resolveSingleParam<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol, dependencyContext: InjectorDependencyContext, moduleRef: Module,
|
|
75
|
+
reflectConstructorParams(type: Type<unknown> | Function): any[];
|
|
76
|
+
reflectOptionalParams(type: Type<unknown> | Function): any[];
|
|
77
|
+
reflectSelfParams(type: Type<unknown> | Function): any[];
|
|
78
|
+
resolveSingleParam<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol, dependencyContext: InjectorDependencyContext, moduleRef: Module, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<any>>;
|
|
70
79
|
resolveParamToken<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | ForwardReference): any;
|
|
71
|
-
resolveComponentWrapper<T>(moduleRef: Module, token: InjectionToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>,
|
|
72
|
-
resolveComponentHost<T>(moduleRef: Module, instanceWrapper: InstanceWrapper<T | Promise<T>>,
|
|
73
|
-
lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>,
|
|
74
|
-
lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>,
|
|
75
|
-
lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: Set<string>,
|
|
76
|
-
resolveProperties<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject?: InjectorDependency[],
|
|
80
|
+
resolveComponentWrapper<T>(moduleRef: Module, token: InjectionToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper>;
|
|
81
|
+
resolveComponentHost<T>(moduleRef: Module, instanceWrapper: InstanceWrapper<T | Promise<T>>, resolutionContext?: ResolutionContext): Promise<InstanceWrapper>;
|
|
82
|
+
lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<T>>;
|
|
83
|
+
lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise<any>;
|
|
84
|
+
lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: Set<string>, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise<any>;
|
|
85
|
+
resolveProperties<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject?: InjectorDependency[], resolutionContext?: ResolutionContext, parentInquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
|
|
77
86
|
reflectProperties<T>(type: Type<T>): PropertyDependency[];
|
|
78
87
|
applyProperties<T = any>(instance: T, properties: PropertyDependency[]): void;
|
|
79
|
-
instantiateClass<T = any>(instances: any[], wrapper: InstanceWrapper, targetMetatype: InstanceWrapper,
|
|
88
|
+
instantiateClass<T = any>(instances: any[], wrapper: InstanceWrapper, targetMetatype: InstanceWrapper, resolutionContext?: ResolutionContext): Promise<T>;
|
|
80
89
|
loadPerContext<T = any>(instance: T, moduleRef: Module, collection: Map<InjectionToken, InstanceWrapper>, ctx: ContextId, wrapper?: InstanceWrapper): Promise<T>;
|
|
81
90
|
loadEnhancersPerContext(wrapper: InstanceWrapper, ctx: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
|
82
91
|
loadCtorMetadata(metadata: InstanceWrapper<any>[], contextId: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<any[]>;
|
|
83
92
|
loadPropertiesMetadata(metadata: PropertyMetadata[], contextId: ContextId, inquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
|
|
84
93
|
private getInquirerId;
|
|
94
|
+
private createResolutionContext;
|
|
95
|
+
private getContextInquirerId;
|
|
96
|
+
private isInContext;
|
|
97
|
+
private shouldSkipProviderLoading;
|
|
85
98
|
/**
|
|
86
99
|
* For nested TRANSIENT dependencies (TRANSIENT -> TRANSIENT) in non-static contexts,
|
|
87
100
|
* returns parentInquirer to ensure each parent TRANSIENT gets its own instance.
|
|
@@ -90,6 +103,10 @@ export declare class Injector {
|
|
|
90
103
|
* For non-TRANSIENT -> TRANSIENT, returns inquirer (current wrapper being created).
|
|
91
104
|
*/
|
|
92
105
|
private getEffectiveInquirer;
|
|
106
|
+
private getEffectiveInquirerId;
|
|
107
|
+
private getStaticTransientResolutionContext;
|
|
108
|
+
private getEffectiveResolutionContext;
|
|
109
|
+
private hasDenseCtorMetadata;
|
|
93
110
|
private resolveScopedComponentHost;
|
|
94
111
|
private isInquirerRequest;
|
|
95
112
|
private isInquirer;
|
|
@@ -102,3 +119,4 @@ export declare class Injector {
|
|
|
102
119
|
private getContextId;
|
|
103
120
|
private getNowTimestamp;
|
|
104
121
|
}
|
|
122
|
+
export {};
|