@depup/nestjs__core 11.2.3-depup.0 → 12.0.2-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/adapters/http-adapter.d.ts +372 -3
- package/adapters/http-adapter.js +135 -5
- package/adapters/index.d.ts +1 -1
- package/adapters/index.js +1 -4
- package/application-config.d.ts +13 -4
- package/application-config.js +34 -15
- package/changes.json +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +10 -13
- package/discovery/discoverable-meta-host-collection.d.ts +3 -3
- package/discovery/discoverable-meta-host-collection.js +25 -20
- package/discovery/discovery-module.js +9 -12
- package/discovery/discovery-service.d.ts +4 -4
- package/discovery/discovery-service.js +17 -19
- package/discovery/index.d.ts +2 -2
- package/discovery/index.js +2 -5
- package/errors/exception-handler.js +3 -7
- package/errors/exceptions/circular-dependency.exception.d.ts +1 -1
- package/errors/exceptions/circular-dependency.exception.js +2 -6
- package/errors/exceptions/index.d.ts +9 -8
- package/errors/exceptions/index.js +9 -11
- package/errors/exceptions/invalid-class-module.exception.d.ts +1 -1
- package/errors/exceptions/invalid-class-module.exception.js +4 -8
- package/errors/exceptions/invalid-class-scope.exception.d.ts +2 -2
- package/errors/exceptions/invalid-class-scope.exception.js +6 -10
- package/errors/exceptions/invalid-class.exception.d.ts +1 -1
- package/errors/exceptions/invalid-class.exception.js +4 -8
- package/errors/exceptions/invalid-exception-filter.exception.d.ts +1 -1
- package/errors/exceptions/invalid-exception-filter.exception.js +4 -8
- package/errors/exceptions/invalid-middleware-configuration.exception.d.ts +1 -1
- package/errors/exceptions/invalid-middleware-configuration.exception.js +4 -8
- package/errors/exceptions/invalid-middleware.exception.d.ts +1 -1
- package/errors/exceptions/invalid-middleware.exception.js +4 -8
- package/errors/exceptions/invalid-module.exception.d.ts +1 -1
- package/errors/exceptions/invalid-module.exception.js +4 -8
- package/errors/exceptions/route-conflict.exception.d.ts +4 -0
- package/errors/exceptions/route-conflict.exception.js +7 -0
- package/errors/exceptions/runtime.exception.js +1 -5
- package/errors/exceptions/undefined-dependency.exception.d.ts +3 -3
- package/errors/exceptions/undefined-dependency.exception.js +4 -8
- package/errors/exceptions/undefined-forwardref.exception.d.ts +2 -2
- package/errors/exceptions/undefined-forwardref.exception.js +4 -8
- package/errors/exceptions/undefined-module.exception.d.ts +1 -1
- package/errors/exceptions/undefined-module.exception.js +4 -8
- package/errors/exceptions/unknown-dependencies.exception.d.ts +3 -3
- package/errors/exceptions/unknown-dependencies.exception.js +8 -8
- package/errors/exceptions/unknown-element.exception.d.ts +1 -1
- package/errors/exceptions/unknown-element.exception.js +2 -6
- package/errors/exceptions/unknown-export.exception.d.ts +1 -1
- package/errors/exceptions/unknown-export.exception.js +4 -8
- package/errors/exceptions/unknown-module.exception.d.ts +1 -1
- package/errors/exceptions/unknown-module.exception.js +2 -6
- package/errors/exceptions/unknown-request-mapping.exception.d.ts +1 -1
- package/errors/exceptions/unknown-request-mapping.exception.js +4 -8
- package/errors/exceptions-zone.js +6 -10
- package/errors/messages.d.ts +5 -2
- package/errors/messages.js +26 -32
- package/exceptions/base-exception-filter-context.d.ts +6 -7
- package/exceptions/base-exception-filter-context.js +13 -16
- package/exceptions/base-exception-filter.d.ts +4 -4
- package/exceptions/base-exception-filter.js +46 -23
- package/exceptions/exceptions-handler.d.ts +4 -4
- package/exceptions/exceptions-handler.js +8 -16
- package/exceptions/external-exception-filter-context.d.ts +8 -8
- package/exceptions/external-exception-filter-context.js +14 -18
- package/exceptions/external-exception-filter.d.ts +1 -1
- package/exceptions/external-exception-filter.js +4 -8
- package/exceptions/external-exceptions-handler.d.ts +3 -3
- package/exceptions/external-exceptions-handler.js +8 -16
- package/exceptions/index.d.ts +1 -1
- package/exceptions/index.js +1 -4
- package/guards/constants.js +1 -4
- package/guards/guards-consumer.d.ts +4 -3
- package/guards/guards-consumer.js +8 -12
- package/guards/guards-context-creator.d.ts +11 -10
- package/guards/guards-context-creator.js +18 -20
- package/guards/index.d.ts +3 -3
- package/guards/index.js +3 -6
- package/helpers/barrier.js +5 -5
- package/helpers/context-creator.d.ts +2 -2
- package/helpers/context-creator.js +3 -7
- package/helpers/context-id-factory.d.ts +1 -1
- package/helpers/context-id-factory.js +10 -14
- package/helpers/context-utils.d.ts +6 -3
- package/helpers/context-utils.js +7 -12
- package/helpers/execution-context-host.d.ts +3 -3
- package/helpers/execution-context-host.js +5 -6
- package/helpers/external-context-creator.d.ts +15 -18
- package/helpers/external-context-creator.js +54 -43
- package/helpers/external-proxy.d.ts +2 -2
- package/helpers/external-proxy.js +3 -7
- package/helpers/get-class-scope.d.ts +2 -2
- package/helpers/get-class-scope.js +3 -6
- package/helpers/handler-metadata-storage.d.ts +4 -4
- package/helpers/handler-metadata-storage.js +7 -15
- package/helpers/http-adapter-host.d.ts +1 -1
- package/helpers/http-adapter-host.js +6 -11
- package/helpers/index.d.ts +3 -3
- package/helpers/index.js +3 -6
- package/helpers/interfaces/external-handler-metadata.interface.d.ts +2 -2
- package/helpers/interfaces/external-handler-metadata.interface.js +1 -2
- package/helpers/interfaces/index.d.ts +2 -2
- package/helpers/interfaces/index.js +2 -5
- package/helpers/interfaces/params-metadata.interface.d.ts +1 -1
- package/helpers/interfaces/params-metadata.interface.js +1 -2
- package/helpers/is-durable.d.ts +1 -1
- package/helpers/is-durable.js +3 -6
- package/helpers/load-adapter.d.ts +1 -1
- package/helpers/load-adapter.js +5 -8
- package/helpers/messages.d.ts +1 -1
- package/helpers/messages.js +10 -20
- package/helpers/optional-require.d.ts +1 -1
- package/helpers/optional-require.js +2 -5
- package/helpers/rethrow.js +1 -5
- package/helpers/router-method-factory.d.ts +2 -2
- package/helpers/router-method-factory.js +21 -25
- package/helpers/safe-instance-decorator.js +3 -6
- package/hooks/before-app-shutdown.hook.d.ts +3 -3
- package/hooks/before-app-shutdown.hook.js +25 -23
- package/hooks/index.d.ts +5 -5
- package/hooks/index.js +5 -8
- package/hooks/on-app-bootstrap.hook.d.ts +3 -3
- package/hooks/on-app-bootstrap.hook.js +15 -22
- package/hooks/on-app-shutdown.hook.d.ts +3 -3
- package/hooks/on-app-shutdown.hook.js +25 -23
- package/hooks/on-module-destroy.hook.d.ts +3 -3
- package/hooks/on-module-destroy.hook.js +25 -23
- package/hooks/on-module-init.hook.d.ts +3 -3
- package/hooks/on-module-init.hook.js +15 -22
- 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/index.d.ts +16 -16
- package/index.js +17 -26
- package/injector/abstract-instance-resolver.d.ts +6 -6
- package/injector/abstract-instance-resolver.js +7 -11
- package/injector/compiler.d.ts +2 -2
- package/injector/compiler.js +2 -5
- package/injector/constants.d.ts +1 -1
- package/injector/constants.js +2 -5
- package/injector/container.d.ts +13 -14
- package/injector/container.js +40 -40
- package/injector/helpers/is-debug-mode.util.d.ts +1 -0
- package/injector/helpers/is-debug-mode.util.js +3 -0
- package/injector/helpers/provider-classifier.d.ts +1 -1
- package/injector/helpers/provider-classifier.js +5 -10
- package/injector/helpers/silent-logger.js +9 -16
- package/injector/index.d.ts +6 -6
- package/injector/index.js +5 -8
- package/injector/injector.d.ts +7 -7
- package/injector/injector.js +104 -93
- package/injector/inquirer/index.d.ts +1 -1
- package/injector/inquirer/index.js +1 -4
- package/injector/inquirer/inquirer-constants.js +1 -4
- package/injector/inquirer/inquirer-providers.d.ts +1 -1
- package/injector/inquirer/inquirer-providers.js +5 -8
- package/injector/instance-links-host.d.ts +3 -3
- package/injector/instance-links-host.js +8 -11
- package/injector/instance-loader.d.ts +5 -5
- package/injector/instance-loader.js +17 -11
- package/injector/instance-wrapper.d.ts +8 -6
- package/injector/instance-wrapper.js +98 -81
- package/injector/internal-core-module/index.d.ts +1 -1
- package/injector/internal-core-module/index.js +1 -4
- package/injector/internal-core-module/internal-core-module-factory.d.ts +6 -6
- package/injector/internal-core-module/internal-core-module-factory.js +23 -27
- package/injector/internal-core-module/internal-core-module.d.ts +2 -2
- package/injector/internal-core-module/internal-core-module.js +17 -20
- package/injector/internal-providers-storage.d.ts +2 -2
- package/injector/internal-providers-storage.js +4 -9
- package/injector/lazy-module-loader/lazy-module-loader-options.interface.js +1 -2
- package/injector/lazy-module-loader/lazy-module-loader.d.ts +8 -8
- package/injector/lazy-module-loader/lazy-module-loader.js +36 -27
- package/injector/module-ref.d.ts +7 -7
- package/injector/module-ref.js +30 -35
- package/injector/module.d.ts +5 -5
- package/injector/module.js +97 -83
- package/injector/modules-container.d.ts +1 -1
- package/injector/modules-container.js +5 -12
- package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts +2 -4
- package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js +6 -9
- package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts +2 -3
- package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js +17 -22
- package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts +1 -3
- package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js +1 -2
- package/injector/settlement-signal.js +5 -7
- package/injector/topology-tree/topology-tree.d.ts +1 -1
- package/injector/topology-tree/topology-tree.js +6 -9
- package/injector/topology-tree/tree-node.js +4 -6
- package/inspector/deterministic-uuid-registry.js +2 -6
- package/inspector/graph-inspector.d.ts +7 -7
- package/inspector/graph-inspector.js +10 -12
- package/inspector/index.d.ts +4 -4
- package/inspector/index.js +4 -7
- package/inspector/initialize-on-preview.allowlist.d.ts +1 -1
- package/inspector/initialize-on-preview.allowlist.js +2 -6
- package/inspector/interfaces/edge.interface.d.ts +1 -1
- package/inspector/interfaces/edge.interface.js +1 -2
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts +3 -3
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.js +1 -2
- package/inspector/interfaces/entrypoint.interface.d.ts +2 -2
- package/inspector/interfaces/entrypoint.interface.js +1 -2
- package/inspector/interfaces/extras.interface.d.ts +1 -1
- package/inspector/interfaces/extras.interface.js +1 -2
- package/inspector/interfaces/node.interface.d.ts +2 -2
- package/inspector/interfaces/node.interface.js +1 -2
- package/inspector/interfaces/serialized-graph-json.interface.d.ts +6 -6
- package/inspector/interfaces/serialized-graph-json.interface.js +1 -2
- package/inspector/interfaces/serialized-graph-metadata.interface.d.ts +1 -1
- package/inspector/interfaces/serialized-graph-metadata.interface.js +1 -2
- package/inspector/noop-graph-inspector.d.ts +1 -1
- package/inspector/noop-graph-inspector.js +2 -5
- package/inspector/partial-graph.host.d.ts +2 -2
- package/inspector/partial-graph.host.js +2 -5
- package/inspector/serialized-graph.d.ts +7 -7
- package/inspector/serialized-graph.js +35 -40
- package/inspector/uuid-factory.js +8 -12
- package/interceptors/index.d.ts +2 -2
- package/interceptors/index.js +2 -5
- package/interceptors/interceptors-consumer.d.ts +4 -3
- package/interceptors/interceptors-consumer.js +14 -18
- package/interceptors/interceptors-context-creator.d.ts +10 -9
- package/interceptors/interceptors-context-creator.js +18 -20
- package/interfaces/index.d.ts +2 -0
- package/interfaces/index.js +2 -0
- package/interfaces/module-definition.interface.d.ts +2 -2
- package/interfaces/module-definition.interface.js +1 -2
- package/interfaces/module-override.interface.d.ts +1 -1
- package/interfaces/module-override.interface.js +1 -2
- package/internal.d.ts +42 -0
- package/internal.js +50 -0
- package/metadata-scanner.d.ts +1 -1
- package/metadata-scanner.js +8 -14
- package/middleware/builder.d.ts +4 -4
- package/middleware/builder.js +82 -80
- package/middleware/container.d.ts +4 -4
- package/middleware/container.js +10 -13
- package/middleware/index.d.ts +1 -1
- package/middleware/index.js +1 -4
- package/middleware/middleware-module.d.ts +8 -9
- package/middleware/middleware-module.js +49 -46
- package/middleware/resolver.d.ts +3 -3
- package/middleware/resolver.js +3 -5
- package/middleware/route-info-path-extractor.d.ts +2 -2
- package/middleware/route-info-path-extractor.js +26 -25
- package/middleware/routes-mapper.d.ts +4 -3
- package/middleware/routes-mapper.js +22 -24
- package/middleware/utils.d.ts +3 -2
- package/middleware/utils.js +34 -45
- package/nest-application-context.d.ts +26 -11
- package/nest-application-context.js +79 -67
- package/nest-application.d.ts +19 -11
- package/nest-application.js +168 -65
- package/nest-factory.d.ts +4 -5
- package/nest-factory.js +61 -68
- package/package.json +17 -9
- package/pipes/index.d.ts +3 -3
- package/pipes/index.js +3 -6
- package/pipes/params-token-factory.d.ts +2 -2
- package/pipes/params-token-factory.js +5 -9
- package/pipes/pipes-consumer.d.ts +3 -7
- package/pipes/pipes-consumer.js +17 -18
- package/pipes/pipes-context-creator.d.ts +10 -9
- package/pipes/pipes-context-creator.js +18 -20
- package/repl/assign-to-object.util.js +1 -4
- package/repl/constants.js +1 -4
- package/repl/index.d.ts +1 -1
- package/repl/index.js +1 -4
- package/repl/native-functions/debug-repl-fn.d.ts +2 -2
- package/repl/native-functions/debug-repl-fn.js +14 -21
- package/repl/native-functions/get-repl-fn.d.ts +2 -2
- package/repl/native-functions/get-repl-fn.js +8 -15
- package/repl/native-functions/help-repl-fn.d.ts +2 -2
- package/repl/native-functions/help-repl-fn.js +13 -20
- package/repl/native-functions/index.d.ts +6 -6
- package/repl/native-functions/index.js +6 -9
- package/repl/native-functions/methods-repl-fn.d.ts +2 -2
- package/repl/native-functions/methods-repl-fn.js +12 -19
- package/repl/native-functions/resolve-repl-fn.d.ts +2 -2
- package/repl/native-functions/resolve-repl-fn.js +7 -14
- package/repl/native-functions/select-relp-fn.d.ts +2 -2
- package/repl/native-functions/select-relp-fn.js +7 -14
- package/repl/repl-context.d.ts +3 -3
- package/repl/repl-context.js +21 -23
- package/repl/repl-function.d.ts +3 -3
- package/repl/repl-function.js +5 -7
- package/repl/repl-logger.js +10 -14
- package/repl/repl-native-commands.js +1 -4
- package/repl/repl.d.ts +1 -1
- package/repl/repl.interfaces.d.ts +2 -2
- package/repl/repl.interfaces.js +1 -2
- package/repl/repl.js +17 -20
- package/router/index.d.ts +3 -3
- package/router/index.js +3 -8
- package/router/interfaces/exceptions-filter.interface.d.ts +3 -3
- package/router/interfaces/exceptions-filter.interface.js +1 -2
- package/router/interfaces/exclude-route-metadata.interface.d.ts +1 -1
- package/router/interfaces/exclude-route-metadata.interface.js +1 -2
- package/router/interfaces/index.d.ts +4 -1
- package/router/interfaces/index.js +4 -4
- package/router/interfaces/resolved-route.interface.d.ts +32 -0
- package/router/interfaces/resolved-route.interface.js +1 -0
- package/router/interfaces/resolver.interface.d.ts +5 -1
- package/router/interfaces/resolver.interface.js +1 -2
- package/router/interfaces/route-conflict.interface.d.ts +14 -0
- package/router/interfaces/route-conflict.interface.js +1 -0
- package/router/interfaces/route-params-factory.interface.d.ts +1 -1
- package/router/interfaces/route-params-factory.interface.js +1 -2
- package/router/interfaces/route-path-metadata.interface.d.ts +2 -2
- package/router/interfaces/route-path-metadata.interface.js +1 -2
- package/router/interfaces/route-resolution-options.interface.d.ts +24 -0
- package/router/interfaces/route-resolution-options.interface.js +1 -0
- package/router/interfaces/routes.interface.d.ts +1 -1
- package/router/interfaces/routes.interface.js +1 -2
- package/router/legacy-route-converter.js +3 -7
- package/router/paths-explorer.d.ts +4 -5
- package/router/paths-explorer.js +11 -15
- package/router/request/index.d.ts +1 -1
- package/router/request/index.js +1 -5
- package/router/request/request-constants.js +2 -5
- package/router/request/request-providers.d.ts +1 -1
- package/router/request/request-providers.js +5 -8
- package/router/route-conflict-detector.d.ts +71 -0
- package/router/route-conflict-detector.js +276 -0
- package/router/route-params-factory.d.ts +2 -2
- package/router/route-params-factory.js +15 -19
- package/router/route-path-factory.d.ts +4 -4
- package/router/route-path-factory.js +19 -22
- package/router/route-specificity-sorter.d.ts +23 -0
- package/router/route-specificity-sorter.js +59 -0
- package/router/router-exception-filters.d.ts +9 -9
- package/router/router-exception-filters.js +15 -18
- package/router/router-execution-context.d.ts +17 -20
- package/router/router-execution-context.js +62 -55
- package/router/router-explorer.d.ts +25 -18
- package/router/router-explorer.js +116 -73
- package/router/router-module.d.ts +4 -4
- package/router/router-module.js +21 -23
- package/router/router-proxy.d.ts +1 -1
- package/router/router-proxy.js +4 -8
- package/router/router-response-controller.d.ts +2 -2
- package/router/router-response-controller.js +23 -27
- package/router/routes-resolver.d.ts +13 -11
- package/router/routes-resolver.js +42 -55
- package/router/sse-stream.d.ts +2 -1
- package/router/sse-stream.js +29 -24
- package/router/utils/exclude-route.util.d.ts +1 -1
- package/router/utils/exclude-route.util.js +7 -12
- package/router/utils/flatten-route-paths.util.d.ts +2 -2
- package/router/utils/flatten-route-paths.util.js +4 -7
- package/router/utils/index.d.ts +2 -2
- package/router/utils/index.js +2 -5
- package/scanner.d.ts +11 -11
- package/scanner.js +66 -67
- package/services/index.d.ts +1 -1
- package/services/index.js +1 -4
- package/services/reflector.service.d.ts +1 -1
- package/services/reflector.service.js +9 -13
- package/tsconfig.build.json +1 -9
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.makeSafeInstanceDecorator = makeSafeInstanceDecorator;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const logger = new common_1.Logger('InstrumentLogger');
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
const logger = new Logger('InstrumentLogger');
|
|
6
3
|
/**
|
|
7
4
|
* Wraps an `instrument.instanceDecorator` so that a decorator throwing on a
|
|
8
5
|
* given instance (e.g. when inspecting a Proxy whose traps throw outside of
|
|
@@ -10,7 +7,7 @@ const logger = new common_1.Logger('InstrumentLogger');
|
|
|
10
7
|
* crash the application bootstrap. The original, undecorated instance is
|
|
11
8
|
* used instead and a warning is logged.
|
|
12
9
|
*/
|
|
13
|
-
function makeSafeInstanceDecorator(decorator) {
|
|
10
|
+
export function makeSafeInstanceDecorator(decorator) {
|
|
14
11
|
return (target) => {
|
|
15
12
|
try {
|
|
16
13
|
return decorator(target);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Module } from '../injector/module';
|
|
1
|
+
import { Module } from '../injector/module.js';
|
|
2
2
|
/**
|
|
3
3
|
* Calls the `beforeApplicationShutdown` function on the module and its children
|
|
4
4
|
* (providers / controllers).
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param moduleRef The module which will be initialized
|
|
7
7
|
* @param signal The signal which caused the shutdown
|
|
8
8
|
*/
|
|
9
|
-
export declare function callBeforeAppShutdownHook(
|
|
9
|
+
export declare function callBeforeAppShutdownHook(moduleRef: Module, signal?: string): Promise<void>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { isFunction, isNil } from '@nestjs/common/internal';
|
|
3
|
+
import { iterate } from 'iterare';
|
|
4
|
+
import { getInstancesGroupedByHierarchyLevel } from './utils/get-instances-grouped-by-hierarchy-level.js';
|
|
5
|
+
import { getSortedHierarchyLevels } from './utils/get-sorted-hierarchy-levels.js';
|
|
7
6
|
/**
|
|
8
7
|
* Checks if the given instance has the `beforeApplicationShutdown` function
|
|
9
8
|
*
|
|
10
9
|
* @param instance The instance which should be checked
|
|
11
10
|
*/
|
|
12
11
|
function hasBeforeApplicationShutdownHook(instance) {
|
|
13
|
-
return
|
|
12
|
+
return isFunction(instance.beforeApplicationShutdown);
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* Calls the given instances
|
|
17
16
|
*/
|
|
18
17
|
function callOperator(instances, signal) {
|
|
19
|
-
return
|
|
20
|
-
.filter(instance => !
|
|
18
|
+
return iterate(instances)
|
|
19
|
+
.filter(instance => !isNil(instance))
|
|
21
20
|
.filter(hasBeforeApplicationShutdownHook)
|
|
22
21
|
.map(async (instance) => instance.beforeApplicationShutdown(signal))
|
|
23
22
|
.toArray();
|
|
@@ -26,26 +25,29 @@ function callOperator(instances, signal) {
|
|
|
26
25
|
* Calls the `beforeApplicationShutdown` function on the module and its children
|
|
27
26
|
* (providers / controllers).
|
|
28
27
|
*
|
|
29
|
-
* @param
|
|
28
|
+
* @param moduleRef The module which will be initialized
|
|
30
29
|
* @param signal The signal which caused the shutdown
|
|
31
30
|
*/
|
|
32
|
-
async function callBeforeAppShutdownHook(
|
|
33
|
-
const providers =
|
|
31
|
+
export async function callBeforeAppShutdownHook(moduleRef, signal) {
|
|
32
|
+
const providers = moduleRef.getNonAliasProviders();
|
|
34
33
|
const [_, moduleClassHost] = providers.shift();
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
|
44
|
-
await Promise.all(callOperator(transientInstances, signal));
|
|
34
|
+
const groupedInstances = getInstancesGroupedByHierarchyLevel(moduleRef.controllers, moduleRef.injectables, moduleRef.middlewares, providers);
|
|
35
|
+
const levels = getSortedHierarchyLevels(groupedInstances, 'DESC');
|
|
36
|
+
for (const level of levels) {
|
|
37
|
+
const results = await Promise.allSettled(callOperator(groupedInstances.get(level), signal));
|
|
38
|
+
results
|
|
39
|
+
.filter((result) => result.status === 'rejected')
|
|
40
|
+
.forEach(result => Logger.error(result.reason, result.reason?.stack));
|
|
41
|
+
}
|
|
45
42
|
const moduleClassInstance = moduleClassHost.instance;
|
|
46
43
|
if (moduleClassInstance &&
|
|
47
44
|
hasBeforeApplicationShutdownHook(moduleClassInstance) &&
|
|
48
45
|
moduleClassHost.isDependencyTreeStatic()) {
|
|
49
|
-
|
|
46
|
+
try {
|
|
47
|
+
await moduleClassInstance.beforeApplicationShutdown(signal);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
Logger.error(err, err?.stack);
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
}
|
package/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './on-app-bootstrap.hook';
|
|
2
|
-
export * from './on-app-shutdown.hook';
|
|
3
|
-
export * from './on-module-destroy.hook';
|
|
4
|
-
export * from './on-module-init.hook';
|
|
5
|
-
export * from './before-app-shutdown.hook';
|
|
1
|
+
export * from './on-app-bootstrap.hook.js';
|
|
2
|
+
export * from './on-app-shutdown.hook.js';
|
|
3
|
+
export * from './on-module-destroy.hook.js';
|
|
4
|
+
export * from './on-module-init.hook.js';
|
|
5
|
+
export * from './before-app-shutdown.hook.js';
|
package/hooks/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tslib_1.__exportStar(require("./on-module-destroy.hook"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./on-module-init.hook"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./before-app-shutdown.hook"), exports);
|
|
1
|
+
export * from './on-app-bootstrap.hook.js';
|
|
2
|
+
export * from './on-app-shutdown.hook.js';
|
|
3
|
+
export * from './on-module-destroy.hook.js';
|
|
4
|
+
export * from './on-module-init.hook.js';
|
|
5
|
+
export * from './before-app-shutdown.hook.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Module } from '../injector/module';
|
|
1
|
+
import { Module } from '../injector/module.js';
|
|
2
2
|
/**
|
|
3
3
|
* Calls the `onApplicationBootstrap` function on the module and its children
|
|
4
4
|
* (providers / controllers).
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param moduleRef The module which will be initialized
|
|
7
7
|
*/
|
|
8
|
-
export declare function callModuleBootstrapHook(
|
|
8
|
+
export declare function callModuleBootstrapHook(moduleRef: Module): Promise<any>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const iterare_1 = require("iterare");
|
|
6
|
-
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
|
1
|
+
import { isFunction, isNil } from '@nestjs/common/internal';
|
|
2
|
+
import { iterate } from 'iterare';
|
|
3
|
+
import { getInstancesGroupedByHierarchyLevel } from './utils/get-instances-grouped-by-hierarchy-level.js';
|
|
4
|
+
import { getSortedHierarchyLevels } from './utils/get-sorted-hierarchy-levels.js';
|
|
7
5
|
/**
|
|
8
6
|
* Checks if the given instance has the `onApplicationBootstrap` function
|
|
9
7
|
*
|
|
10
8
|
* @param instance The instance which should be checked
|
|
11
9
|
*/
|
|
12
10
|
function hasOnAppBootstrapHook(instance) {
|
|
13
|
-
return
|
|
11
|
+
return isFunction(instance.onApplicationBootstrap);
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* Calls the given instances
|
|
17
15
|
*/
|
|
18
16
|
function callOperator(instances) {
|
|
19
|
-
return
|
|
20
|
-
.filter(instance => !
|
|
17
|
+
return iterate(instances)
|
|
18
|
+
.filter(instance => !isNil(instance))
|
|
21
19
|
.filter(hasOnAppBootstrapHook)
|
|
22
20
|
.map(async (instance) => instance.onApplicationBootstrap())
|
|
23
21
|
.toArray();
|
|
@@ -26,23 +24,18 @@ function callOperator(instances) {
|
|
|
26
24
|
* Calls the `onApplicationBootstrap` function on the module and its children
|
|
27
25
|
* (providers / controllers).
|
|
28
26
|
*
|
|
29
|
-
* @param
|
|
27
|
+
* @param moduleRef The module which will be initialized
|
|
30
28
|
*/
|
|
31
|
-
async function callModuleBootstrapHook(
|
|
32
|
-
const providers =
|
|
29
|
+
export async function callModuleBootstrapHook(moduleRef) {
|
|
30
|
+
const providers = moduleRef.getNonAliasProviders();
|
|
33
31
|
// Module (class) instance is the first element of the providers array
|
|
34
32
|
// Lifecycle hook has to be called once all classes are properly initialized
|
|
35
33
|
const [_, moduleClassHost] = providers.shift();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
];
|
|
42
|
-
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
|
43
|
-
await Promise.all(callOperator(nonTransientInstances));
|
|
44
|
-
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
|
45
|
-
await Promise.all(callOperator(transientInstances));
|
|
34
|
+
const groupedInstances = getInstancesGroupedByHierarchyLevel(moduleRef.controllers, moduleRef.injectables, moduleRef.middlewares, providers);
|
|
35
|
+
const levels = getSortedHierarchyLevels(groupedInstances);
|
|
36
|
+
for (const level of levels) {
|
|
37
|
+
await Promise.all(callOperator(groupedInstances.get(level)));
|
|
38
|
+
}
|
|
46
39
|
// Call the instance itself
|
|
47
40
|
const moduleClassInstance = moduleClassHost.instance;
|
|
48
41
|
if (moduleClassInstance &&
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Module } from '../injector/module';
|
|
1
|
+
import { Module } from '../injector/module.js';
|
|
2
2
|
/**
|
|
3
3
|
* Calls the `onApplicationShutdown` function on the module and its children
|
|
4
4
|
* (providers / controllers).
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param moduleRef The module which will be initialized
|
|
7
7
|
* @param signal
|
|
8
8
|
*/
|
|
9
|
-
export declare function callAppShutdownHook(
|
|
9
|
+
export declare function callAppShutdownHook(moduleRef: Module, signal?: string): Promise<any>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { isFunction, isNil } from '@nestjs/common/internal';
|
|
3
|
+
import { iterate } from 'iterare';
|
|
4
|
+
import { getInstancesGroupedByHierarchyLevel } from './utils/get-instances-grouped-by-hierarchy-level.js';
|
|
5
|
+
import { getSortedHierarchyLevels } from './utils/get-sorted-hierarchy-levels.js';
|
|
7
6
|
/**
|
|
8
7
|
* Checks if the given instance has the `onApplicationShutdown` function
|
|
9
8
|
*
|
|
10
9
|
* @param instance The instance which should be checked
|
|
11
10
|
*/
|
|
12
11
|
function hasOnAppShutdownHook(instance) {
|
|
13
|
-
return
|
|
12
|
+
return isFunction(instance.onApplicationShutdown);
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* Calls the given instances
|
|
17
16
|
*/
|
|
18
17
|
function callOperator(instances, signal) {
|
|
19
|
-
return
|
|
20
|
-
.filter(instance => !
|
|
18
|
+
return iterate(instances)
|
|
19
|
+
.filter(instance => !isNil(instance))
|
|
21
20
|
.filter(hasOnAppShutdownHook)
|
|
22
21
|
.map(async (instance) => instance.onApplicationShutdown(signal))
|
|
23
22
|
.toArray();
|
|
@@ -26,29 +25,32 @@ function callOperator(instances, signal) {
|
|
|
26
25
|
* Calls the `onApplicationShutdown` function on the module and its children
|
|
27
26
|
* (providers / controllers).
|
|
28
27
|
*
|
|
29
|
-
* @param
|
|
28
|
+
* @param moduleRef The module which will be initialized
|
|
30
29
|
* @param signal
|
|
31
30
|
*/
|
|
32
|
-
async function callAppShutdownHook(
|
|
33
|
-
const providers =
|
|
31
|
+
export async function callAppShutdownHook(moduleRef, signal) {
|
|
32
|
+
const providers = moduleRef.getNonAliasProviders();
|
|
34
33
|
// Module (class) instance is the first element of the providers array
|
|
35
34
|
// Lifecycle hook has to be called once all classes are properly initialized
|
|
36
35
|
const [_, moduleClassHost] = providers.shift();
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
|
46
|
-
await Promise.all(callOperator(transientInstances, signal));
|
|
36
|
+
const groupedInstances = getInstancesGroupedByHierarchyLevel(moduleRef.controllers, moduleRef.injectables, moduleRef.middlewares, providers);
|
|
37
|
+
const levels = getSortedHierarchyLevels(groupedInstances, 'DESC');
|
|
38
|
+
for (const level of levels) {
|
|
39
|
+
const results = await Promise.allSettled(callOperator(groupedInstances.get(level), signal));
|
|
40
|
+
results
|
|
41
|
+
.filter((result) => result.status === 'rejected')
|
|
42
|
+
.forEach(result => Logger.error(result.reason, result.reason?.stack));
|
|
43
|
+
}
|
|
47
44
|
// Call the instance itself
|
|
48
45
|
const moduleClassInstance = moduleClassHost.instance;
|
|
49
46
|
if (moduleClassInstance &&
|
|
50
47
|
hasOnAppShutdownHook(moduleClassInstance) &&
|
|
51
48
|
moduleClassHost.isDependencyTreeStatic()) {
|
|
52
|
-
|
|
49
|
+
try {
|
|
50
|
+
await moduleClassInstance.onApplicationShutdown(signal);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
Logger.error(err, err?.stack);
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Module } from '../injector/module';
|
|
1
|
+
import { Module } from '../injector/module.js';
|
|
2
2
|
/**
|
|
3
3
|
* Calls the `onModuleDestroy` function on the module and its children
|
|
4
4
|
* (providers / controllers).
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param moduleRef The module which will be initialized
|
|
7
7
|
*/
|
|
8
|
-
export declare function callModuleDestroyHook(
|
|
8
|
+
export declare function callModuleDestroyHook(moduleRef: Module): Promise<any>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { isFunction, isNil } from '@nestjs/common/internal';
|
|
3
|
+
import { iterate } from 'iterare';
|
|
4
|
+
import { getInstancesGroupedByHierarchyLevel } from './utils/get-instances-grouped-by-hierarchy-level.js';
|
|
5
|
+
import { getSortedHierarchyLevels } from './utils/get-sorted-hierarchy-levels.js';
|
|
7
6
|
/**
|
|
8
7
|
* Returns true or false if the given instance has a `onModuleDestroy` function
|
|
9
8
|
*
|
|
10
9
|
* @param instance The instance which should be checked
|
|
11
10
|
*/
|
|
12
11
|
function hasOnModuleDestroyHook(instance) {
|
|
13
|
-
return
|
|
12
|
+
return isFunction(instance.onModuleDestroy);
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* Calls the given instances onModuleDestroy hook
|
|
17
16
|
*/
|
|
18
17
|
function callOperator(instances) {
|
|
19
|
-
return
|
|
20
|
-
.filter(instance => !
|
|
18
|
+
return iterate(instances)
|
|
19
|
+
.filter(instance => !isNil(instance))
|
|
21
20
|
.filter(hasOnModuleDestroyHook)
|
|
22
21
|
.map(async (instance) => instance.onModuleDestroy())
|
|
23
22
|
.toArray();
|
|
@@ -26,28 +25,31 @@ function callOperator(instances) {
|
|
|
26
25
|
* Calls the `onModuleDestroy` function on the module and its children
|
|
27
26
|
* (providers / controllers).
|
|
28
27
|
*
|
|
29
|
-
* @param
|
|
28
|
+
* @param moduleRef The module which will be initialized
|
|
30
29
|
*/
|
|
31
|
-
async function callModuleDestroyHook(
|
|
32
|
-
const providers =
|
|
30
|
+
export async function callModuleDestroyHook(moduleRef) {
|
|
31
|
+
const providers = moduleRef.getNonAliasProviders();
|
|
33
32
|
// Module (class) instance is the first element of the providers array
|
|
34
33
|
// Lifecycle hook has to be called once all classes are properly destroyed
|
|
35
34
|
const [_, moduleClassHost] = providers.shift();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
|
45
|
-
await Promise.all(callOperator(transientInstances));
|
|
35
|
+
const groupedInstances = getInstancesGroupedByHierarchyLevel(moduleRef.controllers, moduleRef.injectables, moduleRef.middlewares, providers);
|
|
36
|
+
const levels = getSortedHierarchyLevels(groupedInstances, 'DESC');
|
|
37
|
+
for (const level of levels) {
|
|
38
|
+
const results = await Promise.allSettled(callOperator(groupedInstances.get(level)));
|
|
39
|
+
results
|
|
40
|
+
.filter((result) => result.status === 'rejected')
|
|
41
|
+
.forEach(result => Logger.error(result.reason, result.reason?.stack));
|
|
42
|
+
}
|
|
46
43
|
// Call the module instance itself
|
|
47
44
|
const moduleClassInstance = moduleClassHost.instance;
|
|
48
45
|
if (moduleClassInstance &&
|
|
49
46
|
hasOnModuleDestroyHook(moduleClassInstance) &&
|
|
50
47
|
moduleClassHost.isDependencyTreeStatic()) {
|
|
51
|
-
|
|
48
|
+
try {
|
|
49
|
+
await moduleClassInstance.onModuleDestroy();
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
Logger.error(err, err?.stack);
|
|
53
|
+
}
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Module } from '../injector/module';
|
|
1
|
+
import { Module } from '../injector/module.js';
|
|
2
2
|
/**
|
|
3
3
|
* Calls the `onModuleInit` function on the module and its children
|
|
4
4
|
* (providers / controllers).
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param moduleRef The module which will be initialized
|
|
7
7
|
*/
|
|
8
|
-
export declare function callModuleInitHook(
|
|
8
|
+
export declare function callModuleInitHook(moduleRef: Module): Promise<void>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const iterare_1 = require("iterare");
|
|
6
|
-
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
|
1
|
+
import { isFunction, isNil } from '@nestjs/common/internal';
|
|
2
|
+
import { iterate } from 'iterare';
|
|
3
|
+
import { getInstancesGroupedByHierarchyLevel } from './utils/get-instances-grouped-by-hierarchy-level.js';
|
|
4
|
+
import { getSortedHierarchyLevels } from './utils/get-sorted-hierarchy-levels.js';
|
|
7
5
|
/**
|
|
8
6
|
* Returns true or false if the given instance has a `onModuleInit` function
|
|
9
7
|
*
|
|
10
8
|
* @param instance The instance which should be checked
|
|
11
9
|
*/
|
|
12
10
|
function hasOnModuleInitHook(instance) {
|
|
13
|
-
return
|
|
11
|
+
return isFunction(instance.onModuleInit);
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* Calls the given instances
|
|
17
15
|
*/
|
|
18
16
|
function callOperator(instances) {
|
|
19
|
-
return
|
|
20
|
-
.filter(instance => !
|
|
17
|
+
return iterate(instances)
|
|
18
|
+
.filter(instance => !isNil(instance))
|
|
21
19
|
.filter(hasOnModuleInitHook)
|
|
22
20
|
.map(async (instance) => instance.onModuleInit())
|
|
23
21
|
.toArray();
|
|
@@ -26,23 +24,18 @@ function callOperator(instances) {
|
|
|
26
24
|
* Calls the `onModuleInit` function on the module and its children
|
|
27
25
|
* (providers / controllers).
|
|
28
26
|
*
|
|
29
|
-
* @param
|
|
27
|
+
* @param moduleRef The module which will be initialized
|
|
30
28
|
*/
|
|
31
|
-
async function callModuleInitHook(
|
|
32
|
-
const providers =
|
|
29
|
+
export async function callModuleInitHook(moduleRef) {
|
|
30
|
+
const providers = moduleRef.getNonAliasProviders();
|
|
33
31
|
// Module (class) instance is the first element of the providers array
|
|
34
32
|
// Lifecycle hook has to be called once all classes are properly initialized
|
|
35
33
|
const [_, moduleClassHost] = providers.shift();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
];
|
|
42
|
-
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
|
43
|
-
await Promise.all(callOperator(nonTransientInstances));
|
|
44
|
-
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
|
45
|
-
await Promise.all(callOperator(transientInstances));
|
|
34
|
+
const groupedInstances = getInstancesGroupedByHierarchyLevel(moduleRef.controllers, moduleRef.injectables, moduleRef.middlewares, providers);
|
|
35
|
+
const levels = getSortedHierarchyLevels(groupedInstances);
|
|
36
|
+
for (const level of levels) {
|
|
37
|
+
await Promise.all(callOperator(groupedInstances.get(level)));
|
|
38
|
+
}
|
|
46
39
|
// Call the instance itself
|
|
47
40
|
const moduleClassInstance = moduleClassHost.instance;
|
|
48
41
|
if (moduleClassInstance &&
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
export * from './adapters';
|
|
3
|
-
export * from './application-config';
|
|
4
|
-
export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE } from './constants';
|
|
5
|
-
export * from './discovery';
|
|
6
|
-
export * from './exceptions';
|
|
7
|
-
export * from './helpers';
|
|
8
|
-
export * from './injector';
|
|
9
|
-
export * from './inspector';
|
|
10
|
-
export * from './metadata-scanner';
|
|
11
|
-
export * from './middleware';
|
|
12
|
-
export * from './nest-application';
|
|
13
|
-
export * from './nest-application-context';
|
|
14
|
-
export { IEntryNestModule, NestFactory } from './nest-factory';
|
|
15
|
-
export * from './repl';
|
|
16
|
-
export * from './router';
|
|
17
|
-
export * from './services';
|
|
2
|
+
export * from './adapters/index.js';
|
|
3
|
+
export * from './application-config.js';
|
|
4
|
+
export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE, } from './constants.js';
|
|
5
|
+
export * from './discovery/index.js';
|
|
6
|
+
export * from './exceptions/index.js';
|
|
7
|
+
export * from './helpers/index.js';
|
|
8
|
+
export * from './injector/index.js';
|
|
9
|
+
export * from './inspector/index.js';
|
|
10
|
+
export * from './metadata-scanner.js';
|
|
11
|
+
export * from './middleware/index.js';
|
|
12
|
+
export * from './nest-application.js';
|
|
13
|
+
export * from './nest-application-context.js';
|
|
14
|
+
export { IEntryNestModule, NestFactory } from './nest-factory.js';
|
|
15
|
+
export * from './repl/index.js';
|
|
16
|
+
export * from './router/index.js';
|
|
17
|
+
export * from './services/index.js';
|
package/index.js
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NestFactory = exports.APP_PIPE = exports.APP_INTERCEPTOR = exports.APP_GUARD = exports.APP_FILTER = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
1
|
/*
|
|
6
2
|
* Nest @core
|
|
7
3
|
* Copyright(c) 2017 - 2025 Kamil Mysliwiec
|
|
8
4
|
* https://nestjs.com
|
|
9
5
|
* MIT Licensed
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var nest_factory_1 = require("./nest-factory");
|
|
29
|
-
Object.defineProperty(exports, "NestFactory", { enumerable: true, get: function () { return nest_factory_1.NestFactory; } });
|
|
30
|
-
tslib_1.__exportStar(require("./repl"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./router"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./services"), exports);
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
export * from './adapters/index.js';
|
|
9
|
+
export * from './application-config.js';
|
|
10
|
+
export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE, } from './constants.js';
|
|
11
|
+
export * from './discovery/index.js';
|
|
12
|
+
export * from './exceptions/index.js';
|
|
13
|
+
export * from './helpers/index.js';
|
|
14
|
+
export * from './injector/index.js';
|
|
15
|
+
export * from './inspector/index.js';
|
|
16
|
+
export * from './metadata-scanner.js';
|
|
17
|
+
export * from './middleware/index.js';
|
|
18
|
+
export * from './nest-application.js';
|
|
19
|
+
export * from './nest-application-context.js';
|
|
20
|
+
export { NestFactory } from './nest-factory.js';
|
|
21
|
+
export * from './repl/index.js';
|
|
22
|
+
export * from './router/index.js';
|
|
23
|
+
export * from './services/index.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Abstract, Type } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { type Abstract, type Type } from '@nestjs/common';
|
|
2
|
+
import { Injector } from './injector.js';
|
|
3
|
+
import { InstanceLinksHost } from './instance-links-host.js';
|
|
4
|
+
import { ContextId } from './instance-wrapper.js';
|
|
5
|
+
import { Module } from './module.js';
|
|
6
|
+
import type { GetOrResolveOptions } from '@nestjs/common/internal';
|
|
7
7
|
export declare abstract class AbstractInstanceResolver {
|
|
8
8
|
protected abstract instanceLinksHost: InstanceLinksHost;
|
|
9
9
|
protected abstract injector: Injector;
|