@nestjs/core 11.1.15 → 12.0.0-alpha.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/adapters/http-adapter.d.ts +5 -3
- package/adapters/http-adapter.js +8 -5
- package/adapters/index.d.ts +1 -1
- package/adapters/index.js +1 -4
- package/application-config.d.ts +7 -4
- package/application-config.js +20 -15
- 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 +15 -19
- 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 +8 -8
- package/errors/exceptions/index.js +8 -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/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 +2 -2
- package/errors/messages.js +19 -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 +33 -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 +4 -7
- 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 +20 -24
- package/hooks/before-app-shutdown.hook.d.ts +3 -3
- package/hooks/before-app-shutdown.hook.js +15 -22
- 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 +15 -22
- package/hooks/on-module-destroy.hook.d.ts +3 -3
- package/hooks/on-module-destroy.hook.js +15 -22
- 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/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 -6
- package/injector/injector.js +78 -78
- 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 +11 -11
- package/injector/instance-wrapper.d.ts +8 -5
- package/injector/instance-wrapper.js +93 -74
- 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 +10 -9
- package/injector/module-ref.d.ts +7 -7
- package/injector/module-ref.js +19 -20
- package/injector/module.d.ts +5 -5
- package/injector/module.js +93 -79
- 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 +13 -17
- 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 +38 -0
- package/internal.js +46 -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 +78 -76
- 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 +47 -44
- 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 +10 -9
- package/nest-application-context.js +50 -47
- package/nest-application.d.ts +18 -10
- package/nest-application.js +87 -55
- package/nest-factory.d.ts +4 -5
- package/nest-factory.js +61 -68
- package/package.json +32 -3
- 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 +1 -1
- package/router/interfaces/index.js +1 -4
- package/router/interfaces/resolver.interface.js +1 -2
- 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/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-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/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 +57 -49
- package/router/router-explorer.d.ts +14 -16
- package/router/router-explorer.js +55 -54
- 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 +20 -23
- package/router/routes-resolver.d.ts +8 -9
- package/router/routes-resolver.js +36 -51
- package/router/sse-stream.d.ts +1 -1
- package/router/sse-stream.js +5 -9
- 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 +64 -65
- 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,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: 'get',
|
|
10
|
-
signature: '(token: InjectionToken) => any',
|
|
11
|
-
description: 'Retrieves an instance of either injectable or controller, otherwise, throws exception.',
|
|
12
|
-
aliases: ['$'],
|
|
13
|
-
};
|
|
14
|
-
}
|
|
1
|
+
import { ReplFunction } from '../repl-function.js';
|
|
2
|
+
export class GetReplFn extends ReplFunction {
|
|
3
|
+
fnDefinition = {
|
|
4
|
+
name: 'get',
|
|
5
|
+
signature: '(token: InjectionToken) => any',
|
|
6
|
+
description: 'Retrieves an instance of either injectable or controller, otherwise, throws exception.',
|
|
7
|
+
aliases: ['$'],
|
|
8
|
+
};
|
|
15
9
|
action(token) {
|
|
16
10
|
return this.ctx.app.get(token);
|
|
17
11
|
}
|
|
18
12
|
}
|
|
19
|
-
exports.GetReplFn = GetReplFn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReplFunction } from '../repl-function';
|
|
2
|
-
import type { ReplFnDefinition } from '../repl.interfaces';
|
|
1
|
+
import { ReplFunction } from '../repl-function.js';
|
|
2
|
+
import type { ReplFnDefinition } from '../repl.interfaces.js';
|
|
3
3
|
export declare class HelpReplFn extends ReplFunction {
|
|
4
4
|
fnDefinition: ReplFnDefinition;
|
|
5
5
|
static buildHelpMessage: ({ name, description }: ReplFnDefinition) => string;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
signature: '() => void',
|
|
13
|
-
description: 'Display all available REPL native functions.',
|
|
14
|
-
};
|
|
15
|
-
}
|
|
1
|
+
import { iterate } from 'iterare';
|
|
2
|
+
import { ReplFunction } from '../repl-function.js';
|
|
3
|
+
import { clc } from '@nestjs/common/internal';
|
|
4
|
+
export class HelpReplFn extends ReplFunction {
|
|
5
|
+
fnDefinition = {
|
|
6
|
+
name: 'help',
|
|
7
|
+
signature: '() => void',
|
|
8
|
+
description: 'Display all available REPL native functions.',
|
|
9
|
+
};
|
|
10
|
+
static buildHelpMessage = ({ name, description }) => clc.cyanBright(name) +
|
|
11
|
+
(description ? ` ${clc.bold('-')} ${description}` : '');
|
|
16
12
|
action() {
|
|
17
|
-
const sortedNativeFunctions =
|
|
13
|
+
const sortedNativeFunctions = iterate(this.ctx.nativeFunctions)
|
|
18
14
|
.map(([, nativeFunction]) => nativeFunction.fnDefinition)
|
|
19
15
|
.toArray()
|
|
20
16
|
.sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
21
|
-
this.ctx.writeToStdout(`You can call ${
|
|
17
|
+
this.ctx.writeToStdout(`You can call ${clc.bold('.help')} on any function listed below (e.g.: ${clc.bold('help.help')}):\n\n` +
|
|
22
18
|
sortedNativeFunctions.map(HelpReplFn.buildHelpMessage).join('\n') +
|
|
23
19
|
// Without the following LF the last item won't be displayed
|
|
24
20
|
'\n');
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
|
-
exports.HelpReplFn = HelpReplFn;
|
|
28
|
-
HelpReplFn.buildHelpMessage = ({ name, description }) => cli_colors_util_1.clc.cyanBright(name) +
|
|
29
|
-
(description ? ` ${cli_colors_util_1.clc.bold('-')} ${description}` : '');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './help-repl-fn';
|
|
2
|
-
export * from './get-repl-fn';
|
|
3
|
-
export * from './resolve-repl-fn';
|
|
4
|
-
export * from './select-relp-fn';
|
|
5
|
-
export * from './debug-repl-fn';
|
|
6
|
-
export * from './methods-repl-fn';
|
|
1
|
+
export * from './help-repl-fn.js';
|
|
2
|
+
export * from './get-repl-fn.js';
|
|
3
|
+
export * from './resolve-repl-fn.js';
|
|
4
|
+
export * from './select-relp-fn.js';
|
|
5
|
+
export * from './debug-repl-fn.js';
|
|
6
|
+
export * from './methods-repl-fn.js';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
tslib_1.__exportStar(require("./select-relp-fn"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./debug-repl-fn"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./methods-repl-fn"), exports);
|
|
1
|
+
export * from './help-repl-fn.js';
|
|
2
|
+
export * from './get-repl-fn.js';
|
|
3
|
+
export * from './resolve-repl-fn.js';
|
|
4
|
+
export * from './select-relp-fn.js';
|
|
5
|
+
export * from './debug-repl-fn.js';
|
|
6
|
+
export * from './methods-repl-fn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Type } from '@nestjs/common';
|
|
2
|
-
import { ReplFunction } from '../repl-function';
|
|
3
|
-
import type { ReplFnDefinition } from '../repl.interfaces';
|
|
2
|
+
import { ReplFunction } from '../repl-function.js';
|
|
3
|
+
import type { ReplFnDefinition } from '../repl.interfaces.js';
|
|
4
4
|
export declare class MethodsReplFn extends ReplFunction {
|
|
5
5
|
fnDefinition: ReplFnDefinition;
|
|
6
6
|
private readonly metadataScanner;
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: 'methods',
|
|
12
|
-
description: 'Display all public methods available on a given provider or controller.',
|
|
13
|
-
signature: '(token: ClassRef | string) => void',
|
|
14
|
-
};
|
|
15
|
-
this.metadataScanner = new metadata_scanner_1.MetadataScanner();
|
|
16
|
-
}
|
|
1
|
+
import { MetadataScanner } from '../../metadata-scanner.js';
|
|
2
|
+
import { ReplFunction } from '../repl-function.js';
|
|
3
|
+
import { clc } from '@nestjs/common/internal';
|
|
4
|
+
export class MethodsReplFn extends ReplFunction {
|
|
5
|
+
fnDefinition = {
|
|
6
|
+
name: 'methods',
|
|
7
|
+
description: 'Display all public methods available on a given provider or controller.',
|
|
8
|
+
signature: '(token: ClassRef | string) => void',
|
|
9
|
+
};
|
|
10
|
+
metadataScanner = new MetadataScanner();
|
|
17
11
|
action(token) {
|
|
18
12
|
const proto = typeof token !== 'function'
|
|
19
13
|
? Object.getPrototypeOf(this.ctx.app.get(token))
|
|
20
14
|
: token?.prototype;
|
|
21
15
|
const methods = this.metadataScanner.getAllMethodNames(proto);
|
|
22
16
|
this.ctx.writeToStdout('\n');
|
|
23
|
-
this.ctx.writeToStdout(`${
|
|
24
|
-
methods.forEach(methodName => this.ctx.writeToStdout(` ${
|
|
17
|
+
this.ctx.writeToStdout(`${clc.green('Methods')}:\n`);
|
|
18
|
+
methods.forEach(methodName => this.ctx.writeToStdout(` ${clc.yellow('◻')} ${methodName}\n`));
|
|
25
19
|
this.ctx.writeToStdout('\n');
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
|
-
exports.MethodsReplFn = MethodsReplFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Type } from '@nestjs/common';
|
|
2
|
-
import { ReplFunction } from '../repl-function';
|
|
3
|
-
import type { ReplFnDefinition } from '../repl.interfaces';
|
|
2
|
+
import { ReplFunction } from '../repl-function.js';
|
|
3
|
+
import type { ReplFnDefinition } from '../repl.interfaces.js';
|
|
4
4
|
export declare class ResolveReplFn extends ReplFunction {
|
|
5
5
|
fnDefinition: ReplFnDefinition;
|
|
6
6
|
action(token: string | symbol | Function | Type<any>, contextId: any): Promise<any>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.fnDefinition = {
|
|
9
|
-
name: 'resolve',
|
|
10
|
-
description: 'Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception.',
|
|
11
|
-
signature: '(token: InjectionToken, contextId: any) => Promise<any>',
|
|
12
|
-
};
|
|
13
|
-
}
|
|
1
|
+
import { ReplFunction } from '../repl-function.js';
|
|
2
|
+
export class ResolveReplFn extends ReplFunction {
|
|
3
|
+
fnDefinition = {
|
|
4
|
+
name: 'resolve',
|
|
5
|
+
description: 'Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception.',
|
|
6
|
+
signature: '(token: InjectionToken, contextId: any) => Promise<any>',
|
|
7
|
+
};
|
|
14
8
|
action(token, contextId) {
|
|
15
9
|
return this.ctx.app.resolve(token, contextId);
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
|
-
exports.ResolveReplFn = ResolveReplFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicModule, INestApplicationContext, Type } from '@nestjs/common';
|
|
2
|
-
import { ReplFunction } from '../repl-function';
|
|
3
|
-
import type { ReplFnDefinition } from '../repl.interfaces';
|
|
2
|
+
import { ReplFunction } from '../repl-function.js';
|
|
3
|
+
import type { ReplFnDefinition } from '../repl.interfaces.js';
|
|
4
4
|
export declare class SelectReplFn extends ReplFunction {
|
|
5
5
|
fnDefinition: ReplFnDefinition;
|
|
6
6
|
action(token: DynamicModule | Type<unknown>): INestApplicationContext;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.fnDefinition = {
|
|
9
|
-
name: 'select',
|
|
10
|
-
description: 'Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module.',
|
|
11
|
-
signature: '(token: DynamicModule | ClassRef) => INestApplicationContext',
|
|
12
|
-
};
|
|
13
|
-
}
|
|
1
|
+
import { ReplFunction } from '../repl-function.js';
|
|
2
|
+
export class SelectReplFn extends ReplFunction {
|
|
3
|
+
fnDefinition = {
|
|
4
|
+
name: 'select',
|
|
5
|
+
description: 'Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module.',
|
|
6
|
+
signature: '(token: DynamicModule | ClassRef) => INestApplicationContext',
|
|
7
|
+
};
|
|
14
8
|
action(token) {
|
|
15
9
|
return this.ctx.app.select(token);
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
|
-
exports.SelectReplFn = SelectReplFn;
|
package/repl/repl-context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { INestApplicationContext, InjectionToken, Logger } from '@nestjs/common';
|
|
2
|
-
import { ReplFunction } from './repl-function';
|
|
3
|
-
import type { ReplFunctionClass } from './repl.interfaces';
|
|
1
|
+
import { type INestApplicationContext, type InjectionToken, Logger } from '@nestjs/common';
|
|
2
|
+
import { ReplFunction } from './repl-function.js';
|
|
3
|
+
import type { ReplFunctionClass } from './repl.interfaces.js';
|
|
4
4
|
type ModuleKey = string;
|
|
5
5
|
export type ModuleDebugEntry = {
|
|
6
6
|
controllers: Record<string, InjectionToken>;
|
package/repl/repl-context.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Logger, } from '@nestjs/common';
|
|
2
|
+
import { ApplicationConfig } from '../application-config.js';
|
|
3
|
+
import { ModuleRef } from '../injector/index.js';
|
|
4
|
+
import { InternalCoreModule } from '../injector/internal-core-module/internal-core-module.js';
|
|
5
|
+
import { DebugReplFn, GetReplFn, HelpReplFn, MethodsReplFn, ResolveReplFn, SelectReplFn, } from './native-functions/index.js';
|
|
6
|
+
export class ReplContext {
|
|
7
|
+
app;
|
|
8
|
+
logger = new Logger(ReplContext.name);
|
|
9
|
+
debugRegistry = {};
|
|
10
|
+
globalScope = Object.create(null);
|
|
11
|
+
nativeFunctions = new Map();
|
|
12
|
+
container;
|
|
10
13
|
constructor(app, nativeFunctionsClassRefs) {
|
|
11
14
|
this.app = app;
|
|
12
|
-
this.logger = new common_1.Logger(ReplContext.name);
|
|
13
|
-
this.debugRegistry = {};
|
|
14
|
-
this.globalScope = Object.create(null);
|
|
15
|
-
this.nativeFunctions = new Map();
|
|
16
15
|
this.container = app.container; // Using `any` because `app.container` is not public.
|
|
17
16
|
this.initializeContext();
|
|
18
17
|
this.initializeNativeFunctions(nativeFunctionsClassRefs || []);
|
|
@@ -24,7 +23,7 @@ class ReplContext {
|
|
|
24
23
|
const modules = this.container.getModules();
|
|
25
24
|
modules.forEach(moduleRef => {
|
|
26
25
|
let moduleName = moduleRef.metatype.name;
|
|
27
|
-
if (moduleName ===
|
|
26
|
+
if (moduleName === InternalCoreModule.name) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
29
|
if (this.globalScope[moduleName]) {
|
|
@@ -44,7 +43,7 @@ class ReplContext {
|
|
|
44
43
|
const moduleDebugEntry = {};
|
|
45
44
|
moduleRef[collection].forEach(({ token }) => {
|
|
46
45
|
const stringifiedToken = this.stringifyToken(token);
|
|
47
|
-
if (stringifiedToken ===
|
|
46
|
+
if (stringifiedToken === ApplicationConfig.name ||
|
|
48
47
|
stringifiedToken === moduleRef.metatype.name) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -56,7 +55,7 @@ class ReplContext {
|
|
|
56
55
|
enumerable: true,
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
|
-
if (stringifiedToken ===
|
|
58
|
+
if (stringifiedToken === ModuleRef.name) {
|
|
60
59
|
return;
|
|
61
60
|
}
|
|
62
61
|
moduleDebugEntry[stringifiedToken] = token;
|
|
@@ -106,12 +105,12 @@ class ReplContext {
|
|
|
106
105
|
}
|
|
107
106
|
initializeNativeFunctions(nativeFunctionsClassRefs) {
|
|
108
107
|
const builtInFunctionsClassRefs = [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
HelpReplFn,
|
|
109
|
+
GetReplFn,
|
|
110
|
+
ResolveReplFn,
|
|
111
|
+
SelectReplFn,
|
|
112
|
+
DebugReplFn,
|
|
113
|
+
MethodsReplFn,
|
|
115
114
|
];
|
|
116
115
|
builtInFunctionsClassRefs
|
|
117
116
|
.concat(nativeFunctionsClassRefs)
|
|
@@ -123,4 +122,3 @@ class ReplContext {
|
|
|
123
122
|
});
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
|
-
exports.ReplContext = ReplContext;
|
package/repl/repl-function.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Logger } from '@nestjs/common';
|
|
2
|
-
import { ReplContext } from './repl-context';
|
|
3
|
-
import type { ReplFnDefinition } from './repl.interfaces';
|
|
1
|
+
import type { Logger } from '@nestjs/common';
|
|
2
|
+
import { ReplContext } from './repl-context.js';
|
|
3
|
+
import type { ReplFnDefinition } from './repl.interfaces.js';
|
|
4
4
|
export declare abstract class ReplFunction<ActionParams extends Array<unknown> = Array<unknown>, ActionReturn = any> {
|
|
5
5
|
protected readonly ctx: ReplContext;
|
|
6
6
|
/** Metadata that describes the built-in function itself. */
|
package/repl/repl-function.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class ReplFunction {
|
|
1
|
+
import { clc } from '@nestjs/common/internal';
|
|
2
|
+
export class ReplFunction {
|
|
3
|
+
ctx;
|
|
4
|
+
logger;
|
|
6
5
|
constructor(ctx) {
|
|
7
6
|
this.ctx = ctx;
|
|
8
7
|
this.logger = ctx.logger;
|
|
@@ -13,7 +12,6 @@ class ReplFunction {
|
|
|
13
12
|
makeHelpMessage() {
|
|
14
13
|
const { description, name, signature } = this.fnDefinition;
|
|
15
14
|
const fnSignatureWithName = `${name}${signature}`;
|
|
16
|
-
return `${
|
|
15
|
+
return `${clc.yellow(description)}\n${clc.magentaBright('Interface:')} ${clc.bold(fnSignatureWithName)}\n`;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
exports.ReplFunction = ReplFunction;
|
package/repl/repl-logger.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ConsoleLogger } from '@nestjs/common';
|
|
2
|
+
import { NestApplication } from '../nest-application.js';
|
|
3
|
+
import { RouterExplorer } from '../router/router-explorer.js';
|
|
4
|
+
import { RoutesResolver } from '../router/routes-resolver.js';
|
|
5
|
+
export class ReplLogger extends ConsoleLogger {
|
|
6
|
+
static ignoredContexts = [
|
|
7
|
+
RoutesResolver.name,
|
|
8
|
+
RouterExplorer.name,
|
|
9
|
+
NestApplication.name,
|
|
10
|
+
];
|
|
9
11
|
log(_message, context) {
|
|
10
12
|
if (ReplLogger.ignoredContexts.includes(context)) {
|
|
11
13
|
return;
|
|
@@ -14,9 +16,3 @@ class ReplLogger extends common_1.ConsoleLogger {
|
|
|
14
16
|
return super.log.apply(this, Array.from(arguments));
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
exports.ReplLogger = ReplLogger;
|
|
18
|
-
ReplLogger.ignoredContexts = [
|
|
19
|
-
routes_resolver_1.RoutesResolver.name,
|
|
20
|
-
router_explorer_1.RouterExplorer.name,
|
|
21
|
-
nest_application_1.NestApplication.name,
|
|
22
|
-
];
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineDefaultCommandsOnRepl = defineDefaultCommandsOnRepl;
|
|
4
1
|
/**
|
|
5
2
|
* Displays a list of available commands in the REPL alongside with their
|
|
6
3
|
* descriptions.
|
|
@@ -17,7 +14,7 @@ function listAllCommands(replServer) {
|
|
|
17
14
|
}
|
|
18
15
|
});
|
|
19
16
|
}
|
|
20
|
-
function defineDefaultCommandsOnRepl(replServer) {
|
|
17
|
+
export function defineDefaultCommandsOnRepl(replServer) {
|
|
21
18
|
replServer.defineCommand('help', {
|
|
22
19
|
help: 'Show REPL options',
|
|
23
20
|
action(name) {
|
package/repl/repl.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DynamicModule, Type } from '@nestjs/common';
|
|
1
|
+
import { type DynamicModule, type Type } from '@nestjs/common';
|
|
2
2
|
import type { ReplOptions } from 'repl';
|
|
3
3
|
export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise<import("node:repl").REPLServer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReplContext } from './repl-context';
|
|
2
|
-
import type { ReplFunction } from './repl-function';
|
|
1
|
+
import type { ReplContext } from './repl-context.js';
|
|
2
|
+
import type { ReplFunction } from './repl-function.js';
|
|
3
3
|
export type ReplFnDefinition = {
|
|
4
4
|
/** Function's name. Note that this should be a valid JavaScript function name. */
|
|
5
5
|
name: string;
|
package/repl/repl.interfaces.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/repl/repl.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const repl_native_commands_1 = require("./repl-native-commands");
|
|
12
|
-
async function repl(module, replOptions = {}) {
|
|
13
|
-
const app = await nest_factory_1.NestFactory.createApplicationContext(module, {
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { NestFactory } from '../nest-factory.js';
|
|
3
|
+
import { assignToObject } from './assign-to-object.util.js';
|
|
4
|
+
import { REPL_INITIALIZED_MESSAGE } from './constants.js';
|
|
5
|
+
import { ReplContext } from './repl-context.js';
|
|
6
|
+
import { ReplLogger } from './repl-logger.js';
|
|
7
|
+
import { defineDefaultCommandsOnRepl } from './repl-native-commands.js';
|
|
8
|
+
import { clc } from '@nestjs/common/internal';
|
|
9
|
+
export async function repl(module, replOptions = {}) {
|
|
10
|
+
const app = await NestFactory.createApplicationContext(module, {
|
|
14
11
|
abortOnError: false,
|
|
15
|
-
logger: new
|
|
12
|
+
logger: new ReplLogger(),
|
|
16
13
|
});
|
|
17
14
|
await app.init();
|
|
18
|
-
const replContext = new
|
|
19
|
-
|
|
20
|
-
const _repl = await
|
|
15
|
+
const replContext = new ReplContext(app);
|
|
16
|
+
Logger.log(REPL_INITIALIZED_MESSAGE);
|
|
17
|
+
const _repl = await import('repl');
|
|
21
18
|
const replServer = _repl.start({
|
|
22
|
-
prompt:
|
|
19
|
+
prompt: clc.green('> '),
|
|
23
20
|
ignoreUndefined: true,
|
|
24
21
|
...replOptions,
|
|
25
22
|
});
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
assignToObject(replServer.context, replContext.globalScope);
|
|
24
|
+
defineDefaultCommandsOnRepl(replServer);
|
|
28
25
|
replServer.on('exit', async () => {
|
|
29
26
|
await app.close();
|
|
30
27
|
});
|
package/router/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './interfaces';
|
|
2
|
-
export * from './request';
|
|
3
|
-
export { RouterModule } from './router-module';
|
|
1
|
+
export * from './interfaces/index.js';
|
|
2
|
+
export * from './request/index.js';
|
|
3
|
+
export { RouterModule } from './router-module.js';
|
package/router/index.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("./interfaces"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./request"), exports);
|
|
7
|
-
var router_module_1 = require("./router-module");
|
|
8
|
-
Object.defineProperty(exports, "RouterModule", { enumerable: true, get: function () { return router_module_1.RouterModule; } });
|
|
1
|
+
export * from './interfaces/index.js';
|
|
2
|
+
export * from './request/index.js';
|
|
3
|
+
export { RouterModule } from './router-module.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ExceptionsHandler } from '../../exceptions/exceptions-handler.js';
|
|
2
|
+
import { ContextId } from '../../injector/instance-wrapper.js';
|
|
3
|
+
import type { Controller } from '@nestjs/common/internal';
|
|
4
4
|
export interface ExceptionsFilter {
|
|
5
5
|
create(instance: Controller, callback: Function, module: string, contextId?: ContextId, inquirerId?: string): ExceptionsHandler;
|
|
6
6
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './routes.interface';
|
|
1
|
+
export * from './routes.interface.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RouteParamtypes } from '@nestjs/common/
|
|
1
|
+
import type { RouteParamtypes } from '@nestjs/common/internal';
|
|
2
2
|
export interface IRouteParamsFactory {
|
|
3
3
|
exchangeKeyForValue<TRequest extends Record<string, any> = any, TResponse = any, TResult = any>(key: RouteParamtypes | string, data: any, { req, res, next }: {
|
|
4
4
|
req: TRequest;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VersioningOptions } from '@nestjs/common';
|
|
2
|
-
import { VersionValue } from '@nestjs/common/
|
|
1
|
+
import type { VersioningOptions } from '@nestjs/common';
|
|
2
|
+
import type { VersionValue } from '@nestjs/common/internal';
|
|
3
3
|
export interface RoutePathMetadata {
|
|
4
4
|
/**
|
|
5
5
|
* Controller-level path (e.g., @Controller('resource') = "resource").
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LegacyRouteConverter = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
5
2
|
const UNSUPPORTED_PATH_MESSAGE = (text, route) => `Unsupported route path: "${route}". In previous versions, the symbols ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. For more details, refer to the migration guide.`;
|
|
6
|
-
class LegacyRouteConverter {
|
|
3
|
+
export class LegacyRouteConverter {
|
|
4
|
+
static logger = new Logger(LegacyRouteConverter.name);
|
|
7
5
|
/**
|
|
8
6
|
* Convert legacy routes to the new format (syntax).
|
|
9
7
|
* path-to-regexp used by Express>=v5 and @fastify/middie>=v9 no longer support unnamed wildcards.
|
|
@@ -57,5 +55,3 @@ class LegacyRouteConverter {
|
|
|
57
55
|
this.logger.warn(UNSUPPORTED_PATH_MESSAGE `${route}` + ' Attempting to auto-convert...');
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
exports.LegacyRouteConverter = LegacyRouteConverter;
|
|
61
|
-
LegacyRouteConverter.logger = new common_1.Logger(LegacyRouteConverter.name);
|