@nestjs/core 11.1.16 → 11.1.17
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 +1 -1
- package/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts +3 -0
- package/hooks/utils/get-instances-grouped-by-hierarchy-level.js +27 -0
- package/hooks/utils/get-sorted-hierarchy-levels.d.ts +1 -0
- package/hooks/utils/get-sorted-hierarchy-levels.js +7 -0
- package/interfaces/index.d.ts +2 -0
- package/interfaces/index.js +2 -0
- package/internal.d.ts +38 -0
- package/internal.js +46 -0
- package/middleware/middleware-module.js +4 -1
- package/package.json +3 -3
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 and
|
|
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.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a>, and <a href="https://github.com/vuejs/vue" 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
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InjectionToken } from '@nestjs/common';
|
|
2
|
+
import { InstanceWrapper } from '../../injector/instance-wrapper.js';
|
|
3
|
+
export declare function getInstancesGroupedByHierarchyLevel(...collections: Array<Map<InjectionToken, InstanceWrapper> | Array<[InjectionToken, InstanceWrapper]>>): Map<number, unknown[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function getInstancesGroupedByHierarchyLevel(...collections) {
|
|
2
|
+
const groupedByHierarchyLevel = new Map();
|
|
3
|
+
for (const collection of collections) {
|
|
4
|
+
for (const [_, wrapper] of collection) {
|
|
5
|
+
if (!wrapper.isDependencyTreeStatic()) {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
const level = wrapper.hierarchyLevel;
|
|
9
|
+
if (!groupedByHierarchyLevel.has(level)) {
|
|
10
|
+
groupedByHierarchyLevel.set(level, []);
|
|
11
|
+
}
|
|
12
|
+
const byHierarchyLevelGroup = groupedByHierarchyLevel.get(level);
|
|
13
|
+
if (wrapper.isTransient) {
|
|
14
|
+
const staticTransientInstances = wrapper
|
|
15
|
+
.getStaticTransientInstances()
|
|
16
|
+
.filter(i => !!i)
|
|
17
|
+
.map(i => i.instance);
|
|
18
|
+
byHierarchyLevelGroup.push(...staticTransientInstances);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (wrapper.instance) {
|
|
22
|
+
byHierarchyLevelGroup.push(wrapper.instance);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return groupedByHierarchyLevel;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSortedHierarchyLevels(groups: Map<number, unknown[]>, order?: 'ASC' | 'DESC'): number[];
|
package/internal.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal module - not part of the public API.
|
|
3
|
+
* These exports are used by sibling @nestjs packages.
|
|
4
|
+
* Do not depend on these in your application code.
|
|
5
|
+
* @internal
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
export { RuntimeException } from './errors/exceptions/runtime.exception.js';
|
|
9
|
+
export { InvalidExceptionFilterException } from './errors/exceptions/invalid-exception-filter.exception.js';
|
|
10
|
+
export { MESSAGES } from './constants.js';
|
|
11
|
+
export { DependenciesScanner } from './scanner.js';
|
|
12
|
+
export { Injector, InjectorDependencyContext } from './injector/injector.js';
|
|
13
|
+
export { InstanceLoader } from './injector/instance-loader.js';
|
|
14
|
+
export { InstanceWrapper } from './injector/instance-wrapper.js';
|
|
15
|
+
export { Module } from './injector/module.js';
|
|
16
|
+
export { STATIC_CONTEXT } from './injector/constants.js';
|
|
17
|
+
export { ExecutionContextHost } from './helpers/execution-context-host.js';
|
|
18
|
+
export { ContextUtils, ParamProperties } from './helpers/context-utils.js';
|
|
19
|
+
export { HandlerMetadataStorage } from './helpers/handler-metadata-storage.js';
|
|
20
|
+
export { RouterMethodFactory } from './helpers/router-method-factory.js';
|
|
21
|
+
export { loadAdapter } from './helpers/load-adapter.js';
|
|
22
|
+
export { optionalRequire } from './helpers/optional-require.js';
|
|
23
|
+
export { ParamsMetadata } from './helpers/interfaces/index.js';
|
|
24
|
+
export { GuardsConsumer } from './guards/guards-consumer.js';
|
|
25
|
+
export { GuardsContextCreator } from './guards/guards-context-creator.js';
|
|
26
|
+
export { FORBIDDEN_MESSAGE } from './guards/constants.js';
|
|
27
|
+
export { PipesConsumer } from './pipes/pipes-consumer.js';
|
|
28
|
+
export { PipesContextCreator } from './pipes/pipes-context-creator.js';
|
|
29
|
+
export { ParamsTokenFactory } from './pipes/params-token-factory.js';
|
|
30
|
+
export { InterceptorsConsumer } from './interceptors/interceptors-consumer.js';
|
|
31
|
+
export { InterceptorsContextCreator } from './interceptors/interceptors-context-creator.js';
|
|
32
|
+
export { BaseExceptionFilterContext } from './exceptions/base-exception-filter-context.js';
|
|
33
|
+
export { LegacyRouteConverter } from './router/legacy-route-converter.js';
|
|
34
|
+
export { REQUEST_CONTEXT_ID } from './router/request/request-constants.js';
|
|
35
|
+
export { NoopGraphInspector } from './inspector/noop-graph-inspector.js';
|
|
36
|
+
export { UuidFactory, UuidFactoryMode } from './inspector/uuid-factory.js';
|
|
37
|
+
export { ModuleDefinition } from './interfaces/module-definition.interface.js';
|
|
38
|
+
export { ModuleOverride } from './interfaces/module-override.interface.js';
|
package/internal.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal module - not part of the public API.
|
|
3
|
+
* These exports are used by sibling @nestjs packages.
|
|
4
|
+
* Do not depend on these in your application code.
|
|
5
|
+
* @internal
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
// Errors
|
|
9
|
+
export { RuntimeException } from './errors/exceptions/runtime.exception.js';
|
|
10
|
+
export { InvalidExceptionFilterException } from './errors/exceptions/invalid-exception-filter.exception.js';
|
|
11
|
+
// Constants
|
|
12
|
+
export { MESSAGES } from './constants.js';
|
|
13
|
+
// Scanner
|
|
14
|
+
export { DependenciesScanner } from './scanner.js';
|
|
15
|
+
// Injector
|
|
16
|
+
export { Injector } from './injector/injector.js';
|
|
17
|
+
export { InstanceLoader } from './injector/instance-loader.js';
|
|
18
|
+
export { InstanceWrapper } from './injector/instance-wrapper.js';
|
|
19
|
+
export { Module } from './injector/module.js';
|
|
20
|
+
export { STATIC_CONTEXT } from './injector/constants.js';
|
|
21
|
+
// Helpers
|
|
22
|
+
export { ExecutionContextHost } from './helpers/execution-context-host.js';
|
|
23
|
+
export { ContextUtils } from './helpers/context-utils.js';
|
|
24
|
+
export { HandlerMetadataStorage } from './helpers/handler-metadata-storage.js';
|
|
25
|
+
export { RouterMethodFactory } from './helpers/router-method-factory.js';
|
|
26
|
+
export { loadAdapter } from './helpers/load-adapter.js';
|
|
27
|
+
export { optionalRequire } from './helpers/optional-require.js';
|
|
28
|
+
// Guards
|
|
29
|
+
export { GuardsConsumer } from './guards/guards-consumer.js';
|
|
30
|
+
export { GuardsContextCreator } from './guards/guards-context-creator.js';
|
|
31
|
+
export { FORBIDDEN_MESSAGE } from './guards/constants.js';
|
|
32
|
+
// Pipes
|
|
33
|
+
export { PipesConsumer } from './pipes/pipes-consumer.js';
|
|
34
|
+
export { PipesContextCreator } from './pipes/pipes-context-creator.js';
|
|
35
|
+
export { ParamsTokenFactory } from './pipes/params-token-factory.js';
|
|
36
|
+
// Interceptors
|
|
37
|
+
export { InterceptorsConsumer } from './interceptors/interceptors-consumer.js';
|
|
38
|
+
export { InterceptorsContextCreator } from './interceptors/interceptors-context-creator.js';
|
|
39
|
+
// Exceptions
|
|
40
|
+
export { BaseExceptionFilterContext } from './exceptions/base-exception-filter-context.js';
|
|
41
|
+
// Router
|
|
42
|
+
export { LegacyRouteConverter } from './router/legacy-route-converter.js';
|
|
43
|
+
export { REQUEST_CONTEXT_ID } from './router/request/request-constants.js';
|
|
44
|
+
// Inspector
|
|
45
|
+
export { NoopGraphInspector } from './inspector/noop-graph-inspector.js';
|
|
46
|
+
export { UuidFactory, UuidFactoryMode } from './inspector/uuid-factory.js';
|
|
@@ -174,7 +174,10 @@ class MiddlewareModule {
|
|
|
174
174
|
const middlewareFunction = isMethodAll
|
|
175
175
|
? proxy
|
|
176
176
|
: (req, res, next) => {
|
|
177
|
-
|
|
177
|
+
const actualRequestMethod = applicationRef.getRequestMethod?.(req);
|
|
178
|
+
if (actualRequestMethod === requestMethod ||
|
|
179
|
+
(actualRequestMethod === request_method_enum_1.RequestMethod[request_method_enum_1.RequestMethod.HEAD] &&
|
|
180
|
+
requestMethod === request_method_enum_1.RequestMethod[request_method_enum_1.RequestMethod.GET])) {
|
|
178
181
|
return proxy(req, res, next);
|
|
179
182
|
}
|
|
180
183
|
return next();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.17",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"uid": "2.0.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@nestjs/common": "11.1.
|
|
42
|
+
"@nestjs/common": "11.1.17"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nestjs/common": "^11.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"optional": true
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "447a373ebebd2c58b5b3c8d718f25922a025f2fe"
|
|
64
64
|
}
|