@tsed/di 8.0.0-alpha.1 → 8.0.0-alpha.11
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/lib/browser/di.umd.min.js +1 -1
- package/lib/browser/di.umd.min.js.map +1 -1
- package/lib/esm/common/decorators/autoInjectable.js.map +1 -1
- package/lib/esm/common/decorators/configuration.js.map +1 -1
- package/lib/esm/common/decorators/constant.js.map +1 -1
- package/lib/esm/common/decorators/controller.js.map +1 -1
- package/lib/esm/common/decorators/inject.js +1 -1
- package/lib/esm/common/decorators/inject.js.map +1 -1
- package/lib/esm/common/decorators/intercept.js.map +1 -1
- package/lib/esm/common/decorators/lazyInject.js.map +1 -1
- package/lib/esm/common/decorators/module.js +1 -1
- package/lib/esm/common/decorators/module.js.map +1 -1
- package/lib/esm/common/decorators/opts.js.map +1 -1
- package/lib/esm/common/decorators/overrideProvider.js.map +1 -1
- package/lib/esm/common/decorators/scope.js.map +1 -1
- package/lib/esm/common/decorators/useOpts.js +1 -1
- package/lib/esm/common/decorators/useOpts.js.map +1 -1
- package/lib/esm/common/decorators/value.js.map +1 -1
- package/lib/esm/common/domain/Container.js.map +1 -1
- package/lib/esm/common/domain/LocalsContainer.js.map +1 -1
- package/lib/esm/common/domain/Provider.js.map +1 -1
- package/lib/esm/common/errors/InjectionError.js.map +1 -1
- package/lib/esm/common/registries/GlobalProviders.js +1 -5
- package/lib/esm/common/registries/GlobalProviders.js.map +1 -1
- package/lib/esm/common/registries/ProviderRegistry.js.map +1 -1
- package/lib/esm/common/services/DIConfiguration.js.map +1 -1
- package/lib/esm/common/services/InjectorService.js.map +1 -1
- package/lib/esm/common/utils/createContainer.js.map +1 -1
- package/lib/esm/common/utils/resolveControllers.js +1 -1
- package/lib/esm/common/utils/resolveControllers.js.map +1 -1
- package/lib/esm/node/decorators/injectContext.js +2 -2
- package/lib/esm/node/decorators/injectContext.js.map +1 -1
- package/lib/esm/node/domain/ContextLogger.js +2 -2
- package/lib/esm/node/domain/ContextLogger.js.map +1 -1
- package/lib/esm/node/domain/DIContext.js.map +1 -1
- package/lib/esm/node/services/DILogger.js.map +1 -1
- package/lib/esm/node/services/DITest.js +1 -1
- package/lib/esm/node/services/DITest.js.map +1 -1
- package/lib/esm/node/utils/asyncHookContext.js +3 -2
- package/lib/esm/node/utils/asyncHookContext.js.map +1 -1
- package/lib/esm/node/utils/setLoggerFormat.js.map +1 -1
- package/lib/esm/node/utils/setLoggerLevel.js.map +1 -1
- package/lib/types/common/decorators/module.d.ts +1 -1
- package/lib/types/common/domain/Container.d.ts +1 -1
- package/lib/types/common/domain/Provider.d.ts +1 -1
- package/lib/types/common/interfaces/ProviderOpts.d.ts +1 -1
- package/lib/types/common/interfaces/TokenProvider.d.ts +1 -1
- package/lib/types/node/decorators/injectContext.d.ts +2 -1
- package/lib/types/node/domain/ContextLogger.d.ts +3 -3
- package/lib/types/node/domain/DIContext.d.ts +1 -1
- package/lib/types/node/utils/asyncHookContext.d.ts +4 -3
- package/package.json +17 -18
- package/vitest.config.mts +4 -4
- package/lib/cjs/common/constants/constants.js +0 -9
- package/lib/cjs/common/constants/constants.js.map +0 -1
- package/lib/cjs/common/decorators/autoInjectable.js +0 -38
- package/lib/cjs/common/decorators/autoInjectable.js.map +0 -1
- package/lib/cjs/common/decorators/configuration.js +0 -24
- package/lib/cjs/common/decorators/configuration.js.map +0 -1
- package/lib/cjs/common/decorators/constant.js +0 -74
- package/lib/cjs/common/decorators/constant.js.map +0 -1
- package/lib/cjs/common/decorators/controller.js +0 -53
- package/lib/cjs/common/decorators/controller.js.map +0 -1
- package/lib/cjs/common/decorators/inject.js +0 -84
- package/lib/cjs/common/decorators/inject.js.map +0 -1
- package/lib/cjs/common/decorators/injectable.js +0 -32
- package/lib/cjs/common/decorators/injectable.js.map +0 -1
- package/lib/cjs/common/decorators/intercept.js +0 -65
- package/lib/cjs/common/decorators/intercept.js.map +0 -1
- package/lib/cjs/common/decorators/interceptor.js +0 -21
- package/lib/cjs/common/decorators/interceptor.js.map +0 -1
- package/lib/cjs/common/decorators/lazyInject.js +0 -71
- package/lib/cjs/common/decorators/lazyInject.js.map +0 -1
- package/lib/cjs/common/decorators/module.js +0 -32
- package/lib/cjs/common/decorators/module.js.map +0 -1
- package/lib/cjs/common/decorators/opts.js +0 -54
- package/lib/cjs/common/decorators/opts.js.map +0 -1
- package/lib/cjs/common/decorators/overrideProvider.js +0 -17
- package/lib/cjs/common/decorators/overrideProvider.js.map +0 -1
- package/lib/cjs/common/decorators/scope.js +0 -16
- package/lib/cjs/common/decorators/scope.js.map +0 -1
- package/lib/cjs/common/decorators/service.js +0 -18
- package/lib/cjs/common/decorators/service.js.map +0 -1
- package/lib/cjs/common/decorators/useOpts.js +0 -61
- package/lib/cjs/common/decorators/useOpts.js.map +0 -1
- package/lib/cjs/common/decorators/value.js +0 -62
- package/lib/cjs/common/decorators/value.js.map +0 -1
- package/lib/cjs/common/domain/Container.js +0 -72
- package/lib/cjs/common/domain/Container.js.map +0 -1
- package/lib/cjs/common/domain/ControllerProvider.js +0 -36
- package/lib/cjs/common/domain/ControllerProvider.js.map +0 -1
- package/lib/cjs/common/domain/InjectablePropertyType.js +0 -12
- package/lib/cjs/common/domain/InjectablePropertyType.js.map +0 -1
- package/lib/cjs/common/domain/LocalsContainer.js +0 -15
- package/lib/cjs/common/domain/LocalsContainer.js.map +0 -1
- package/lib/cjs/common/domain/Provider.js +0 -134
- package/lib/cjs/common/domain/Provider.js.map +0 -1
- package/lib/cjs/common/domain/ProviderScope.js +0 -10
- package/lib/cjs/common/domain/ProviderScope.js.map +0 -1
- package/lib/cjs/common/domain/ProviderType.js +0 -15
- package/lib/cjs/common/domain/ProviderType.js.map +0 -1
- package/lib/cjs/common/errors/InjectionError.js +0 -58
- package/lib/cjs/common/errors/InjectionError.js.map +0 -1
- package/lib/cjs/common/errors/InvalidPropertyTokenError.js +0 -12
- package/lib/cjs/common/errors/InvalidPropertyTokenError.js.map +0 -1
- package/lib/cjs/common/index.js +0 -58
- package/lib/cjs/common/index.js.map +0 -1
- package/lib/cjs/common/interfaces/DIConfigurationOptions.js +0 -3
- package/lib/cjs/common/interfaces/DIConfigurationOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/DILogger.js +0 -3
- package/lib/cjs/common/interfaces/DILogger.js.map +0 -1
- package/lib/cjs/common/interfaces/DILoggerOptions.js +0 -3
- package/lib/cjs/common/interfaces/DILoggerOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/DIResolver.js +0 -3
- package/lib/cjs/common/interfaces/DIResolver.js.map +0 -1
- package/lib/cjs/common/interfaces/ImportTokenProviderOpts.js +0 -3
- package/lib/cjs/common/interfaces/ImportTokenProviderOpts.js.map +0 -1
- package/lib/cjs/common/interfaces/InterceptorContext.js +0 -3
- package/lib/cjs/common/interfaces/InterceptorContext.js.map +0 -1
- package/lib/cjs/common/interfaces/InterceptorMethods.js +0 -3
- package/lib/cjs/common/interfaces/InterceptorMethods.js.map +0 -1
- package/lib/cjs/common/interfaces/InvokeOptions.js +0 -3
- package/lib/cjs/common/interfaces/InvokeOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/OnDestroy.js +0 -3
- package/lib/cjs/common/interfaces/OnDestroy.js.map +0 -1
- package/lib/cjs/common/interfaces/OnInit.js +0 -3
- package/lib/cjs/common/interfaces/OnInit.js.map +0 -1
- package/lib/cjs/common/interfaces/ProviderOpts.js +0 -3
- package/lib/cjs/common/interfaces/ProviderOpts.js.map +0 -1
- package/lib/cjs/common/interfaces/RegistrySettings.js +0 -3
- package/lib/cjs/common/interfaces/RegistrySettings.js.map +0 -1
- package/lib/cjs/common/interfaces/ResolvedInvokeOptions.js +0 -3
- package/lib/cjs/common/interfaces/ResolvedInvokeOptions.js.map +0 -1
- package/lib/cjs/common/interfaces/TokenProvider.js +0 -3
- package/lib/cjs/common/interfaces/TokenProvider.js.map +0 -1
- package/lib/cjs/common/interfaces/TokenRoute.js +0 -3
- package/lib/cjs/common/interfaces/TokenRoute.js.map +0 -1
- package/lib/cjs/common/registries/GlobalProviders.js +0 -121
- package/lib/cjs/common/registries/GlobalProviders.js.map +0 -1
- package/lib/cjs/common/registries/ProviderRegistry.js +0 -86
- package/lib/cjs/common/registries/ProviderRegistry.js.map +0 -1
- package/lib/cjs/common/services/DIConfiguration.js +0 -142
- package/lib/cjs/common/services/DIConfiguration.js.map +0 -1
- package/lib/cjs/common/services/DILogger.js +0 -14
- package/lib/cjs/common/services/DILogger.js.map +0 -1
- package/lib/cjs/common/services/InjectorService.js +0 -536
- package/lib/cjs/common/services/InjectorService.js.map +0 -1
- package/lib/cjs/common/utils/colors.js +0 -10
- package/lib/cjs/common/utils/colors.js.map +0 -1
- package/lib/cjs/common/utils/createContainer.js +0 -14
- package/lib/cjs/common/utils/createContainer.js.map +0 -1
- package/lib/cjs/common/utils/getConfiguration.js +0 -23
- package/lib/cjs/common/utils/getConfiguration.js.map +0 -1
- package/lib/cjs/common/utils/getConstructorDependencies.js +0 -13
- package/lib/cjs/common/utils/getConstructorDependencies.js.map +0 -1
- package/lib/cjs/common/utils/resolveControllers.js +0 -47
- package/lib/cjs/common/utils/resolveControllers.js.map +0 -1
- package/lib/cjs/index.js +0 -6
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/node/decorators/injectContext.js +0 -39
- package/lib/cjs/node/decorators/injectContext.js.map +0 -1
- package/lib/cjs/node/domain/ContextLogger.js +0 -99
- package/lib/cjs/node/domain/ContextLogger.js.map +0 -1
- package/lib/cjs/node/domain/DIContext.js +0 -102
- package/lib/cjs/node/domain/DIContext.js.map +0 -1
- package/lib/cjs/node/index.js +0 -18
- package/lib/cjs/node/index.js.map +0 -1
- package/lib/cjs/node/interfaces/AlterRunInContext.js +0 -3
- package/lib/cjs/node/interfaces/AlterRunInContext.js.map +0 -1
- package/lib/cjs/node/services/DILogger.js +0 -12
- package/lib/cjs/node/services/DILogger.js.map +0 -1
- package/lib/cjs/node/services/DITest.js +0 -126
- package/lib/cjs/node/services/DITest.js.map +0 -1
- package/lib/cjs/node/utils/asyncHookContext.js +0 -42
- package/lib/cjs/node/utils/asyncHookContext.js.map +0 -1
- package/lib/cjs/node/utils/attachLogger.js +0 -10
- package/lib/cjs/node/utils/attachLogger.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerConfiguration.js +0 -11
- package/lib/cjs/node/utils/setLoggerConfiguration.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerFormat.js +0 -33
- package/lib/cjs/node/utils/setLoggerFormat.js.map +0 -1
- package/lib/cjs/node/utils/setLoggerLevel.js +0 -15
- package/lib/cjs/node/utils/setLoggerLevel.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/common/constants/constants.d.ts +0 -5
- package/lib/types-esm/common/decorators/autoInjectable.d.ts +0 -1
- package/lib/types-esm/common/decorators/configuration.d.ts +0 -8
- package/lib/types-esm/common/decorators/constant.d.ts +0 -39
- package/lib/types-esm/common/decorators/controller.d.ts +0 -42
- package/lib/types-esm/common/decorators/inject.d.ts +0 -35
- package/lib/types-esm/common/decorators/injectable.d.ts +0 -20
- package/lib/types-esm/common/decorators/intercept.d.ts +0 -13
- package/lib/types-esm/common/decorators/interceptor.d.ts +0 -10
- package/lib/types-esm/common/decorators/lazyInject.d.ts +0 -43
- package/lib/types-esm/common/decorators/module.d.ts +0 -37
- package/lib/types-esm/common/decorators/opts.d.ts +0 -41
- package/lib/types-esm/common/decorators/overrideProvider.d.ts +0 -8
- package/lib/types-esm/common/decorators/scope.d.ts +0 -8
- package/lib/types-esm/common/decorators/service.d.ts +0 -10
- package/lib/types-esm/common/decorators/useOpts.d.ts +0 -42
- package/lib/types-esm/common/decorators/value.d.ts +0 -37
- package/lib/types-esm/common/domain/Container.d.ts +0 -43
- package/lib/types-esm/common/domain/ControllerProvider.d.ts +0 -17
- package/lib/types-esm/common/domain/InjectablePropertyType.d.ts +0 -7
- package/lib/types-esm/common/domain/LocalsContainer.d.ts +0 -6
- package/lib/types-esm/common/domain/Provider.d.ts +0 -71
- package/lib/types-esm/common/domain/ProviderScope.d.ts +0 -5
- package/lib/types-esm/common/domain/ProviderType.d.ts +0 -10
- package/lib/types-esm/common/errors/InjectionError.d.ts +0 -8
- package/lib/types-esm/common/errors/InvalidPropertyTokenError.d.ts +0 -4
- package/lib/types-esm/common/index.d.ts +0 -54
- package/lib/types-esm/common/interfaces/DIConfigurationOptions.d.ts +0 -29
- package/lib/types-esm/common/interfaces/DILogger.d.ts +0 -8
- package/lib/types-esm/common/interfaces/DILoggerOptions.d.ts +0 -53
- package/lib/types-esm/common/interfaces/DIResolver.d.ts +0 -5
- package/lib/types-esm/common/interfaces/ImportTokenProviderOpts.d.ts +0 -19
- package/lib/types-esm/common/interfaces/InterceptorContext.d.ts +0 -11
- package/lib/types-esm/common/interfaces/InterceptorMethods.d.ts +0 -4
- package/lib/types-esm/common/interfaces/InvokeOptions.d.ts +0 -30
- package/lib/types-esm/common/interfaces/OnDestroy.d.ts +0 -3
- package/lib/types-esm/common/interfaces/OnInit.d.ts +0 -3
- package/lib/types-esm/common/interfaces/ProviderOpts.d.ts +0 -59
- package/lib/types-esm/common/interfaces/RegistrySettings.d.ts +0 -21
- package/lib/types-esm/common/interfaces/ResolvedInvokeOptions.d.ts +0 -12
- package/lib/types-esm/common/interfaces/TokenProvider.d.ts +0 -2
- package/lib/types-esm/common/interfaces/TokenRoute.d.ts +0 -5
- package/lib/types-esm/common/registries/GlobalProviders.d.ts +0 -58
- package/lib/types-esm/common/registries/ProviderRegistry.d.ts +0 -58
- package/lib/types-esm/common/services/DIConfiguration.d.ts +0 -57
- package/lib/types-esm/common/services/DILogger.d.ts +0 -3
- package/lib/types-esm/common/services/InjectorService.d.ts +0 -203
- package/lib/types-esm/common/utils/colors.d.ts +0 -5
- package/lib/types-esm/common/utils/createContainer.d.ts +0 -3
- package/lib/types-esm/common/utils/getConfiguration.d.ts +0 -3
- package/lib/types-esm/common/utils/getConstructorDependencies.d.ts +0 -2
- package/lib/types-esm/common/utils/resolveControllers.d.ts +0 -12
- package/lib/types-esm/index.d.ts +0 -2
- package/lib/types-esm/node/decorators/injectContext.d.ts +0 -15
- package/lib/types-esm/node/domain/ContextLogger.d.ts +0 -37
- package/lib/types-esm/node/domain/DIContext.d.ts +0 -61
- package/lib/types-esm/node/index.d.ts +0 -14
- package/lib/types-esm/node/interfaces/AlterRunInContext.d.ts +0 -3
- package/lib/types-esm/node/services/DILogger.d.ts +0 -1
- package/lib/types-esm/node/services/DITest.d.ts +0 -37
- package/lib/types-esm/node/utils/asyncHookContext.d.ts +0 -14
- package/lib/types-esm/node/utils/attachLogger.d.ts +0 -2
- package/lib/types-esm/node/utils/setLoggerConfiguration.d.ts +0 -2
- package/lib/types-esm/node/utils/setLoggerFormat.d.ts +0 -6
- package/lib/types-esm/node/utils/setLoggerLevel.d.ts +0 -6
- /package/{webpack.config.js → webpack.config.cjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/common/domain/Provider.ts"],"names":[],"mappings":";;;AAAA,qCAAiH;AAGjH,yDAAiD;AACjD,uDAA+C;AAI/C,MAAa,QAAQ;IAmBnB,YAAY,KAAuB,EAAE,UAA6B,EAAE;QAlBpE;;WAEG;QACI,SAAI,GAAiC,8BAAY,CAAC,QAAQ,CAAC;QAgBhE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,KAAgB,CAAC;QAEjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,KAAoB;QAC9B,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,QAAQ,GAAG,IAAA,uBAAgB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AI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ;QACN,OAAO;YACL,OAAO;YACP,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,QAAQ,IAAI,IAAA,aAAM,EAAC,IAAI,CAAC,QAAQ,CAAC;YACtC,IAAI,CAAC,UAAU,IAAI,SAAS;YAC5B,IAAI,CAAC,QAAQ,IAAI,OAAO;YACxB,IAAI,CAAC,eAAe,IAAI,cAAc;SACvC;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF;AAnKD,4BAmKC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProviderScope = void 0;
|
|
4
|
-
var ProviderScope;
|
|
5
|
-
(function (ProviderScope) {
|
|
6
|
-
ProviderScope["SINGLETON"] = "singleton";
|
|
7
|
-
ProviderScope["REQUEST"] = "request";
|
|
8
|
-
ProviderScope["INSTANCE"] = "instance";
|
|
9
|
-
})(ProviderScope = exports.ProviderScope || (exports.ProviderScope = {}));
|
|
10
|
-
//# sourceMappingURL=ProviderScope.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderScope.js","sourceRoot":"","sources":["../../../../src/common/domain/ProviderScope.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;AACvB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProviderType = void 0;
|
|
4
|
-
var ProviderType;
|
|
5
|
-
(function (ProviderType) {
|
|
6
|
-
ProviderType["VALUE"] = "value";
|
|
7
|
-
ProviderType["FACTORY"] = "factory";
|
|
8
|
-
ProviderType["SERVICE"] = "service";
|
|
9
|
-
ProviderType["PROVIDER"] = "provider";
|
|
10
|
-
ProviderType["MODULE"] = "module";
|
|
11
|
-
ProviderType["CONTROLLER"] = "controller";
|
|
12
|
-
ProviderType["INTERCEPTOR"] = "interceptor";
|
|
13
|
-
ProviderType["MIDDLEWARE"] = "middleware";
|
|
14
|
-
})(ProviderType = exports.ProviderType || (exports.ProviderType = {}));
|
|
15
|
-
//# sourceMappingURL=ProviderType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderType.js","sourceRoot":"","sources":["../../../../src/common/domain/ProviderType.ts"],"names":[],"mappings":";;;AAAA,IAAY,YASX;AATD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;IACzB,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;AAC3B,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InjectionError = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const colors_js_1 = require("../utils/colors.js");
|
|
6
|
-
class InjectionError extends Error {
|
|
7
|
-
constructor(token, origin) {
|
|
8
|
-
super((0, core_1.isString)(origin) ? origin : "");
|
|
9
|
-
this.name = "INJECTION_ERROR";
|
|
10
|
-
this.tokens = [];
|
|
11
|
-
this.tokens = [token];
|
|
12
|
-
if (origin) {
|
|
13
|
-
if ((0, core_1.isString)(origin)) {
|
|
14
|
-
this.origin = {
|
|
15
|
-
message: origin,
|
|
16
|
-
stack: this.stack
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
if (origin.tokens) {
|
|
21
|
-
this.tokens = this.tokens.concat(origin.tokens);
|
|
22
|
-
this.origin = origin.origin;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
this.origin = origin;
|
|
26
|
-
this.stack = origin.stack;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const originMessage = this.origin ? "\nOrigin: " + this.origin.message : "";
|
|
31
|
-
const tokensMessage = this.tokens.map((token) => (0, core_1.nameOf)(token)).join(" > ");
|
|
32
|
-
this.message = `Injection failed on ${tokensMessage}${originMessage}`;
|
|
33
|
-
}
|
|
34
|
-
static throwInjectorError(token, currentDependency, error) {
|
|
35
|
-
if (currentDependency && (0, core_1.isClass)(token)) {
|
|
36
|
-
error.message = printDependencyInjectionError(token, { ...currentDependency, message: error.message });
|
|
37
|
-
}
|
|
38
|
-
throw new InjectionError(token, error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.InjectionError = InjectionError;
|
|
42
|
-
function printDependencyInjectionError(token, options) {
|
|
43
|
-
let erroredArg = "";
|
|
44
|
-
const args = (0, core_1.getConstructorArgNames)(token)
|
|
45
|
-
.map((arg, index) => {
|
|
46
|
-
if (options.index === index) {
|
|
47
|
-
erroredArg = arg;
|
|
48
|
-
arg = colors_js_1.colors.red(arg);
|
|
49
|
-
}
|
|
50
|
-
return `${arg}: ${(0, core_1.nameOf)(options.deps[index])}`;
|
|
51
|
-
})
|
|
52
|
-
.join(", ");
|
|
53
|
-
const signature = (0, core_1.nameOf)(token) + "->constructor(" + args + ")";
|
|
54
|
-
const indexOf = signature.indexOf(erroredArg) - 5;
|
|
55
|
-
const drawline = (indexOf) => " ".repeat(indexOf) + colors_js_1.colors.red("^" + "‾".repeat(erroredArg.length - 1));
|
|
56
|
-
return "Unable to inject dependency. " + options.message + "\n\n" + signature + "\n" + (indexOf > -1 ? drawline(indexOf) : "");
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=InjectionError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InjectionError.js","sourceRoot":"","sources":["../../../../src/common/errors/InjectionError.ts"],"names":[],"mappings":";;;AAAA,qCAA6E;AAE7E,kDAA0C;AAE1C,MAAa,cAAe,SAAQ,KAAK;IAMvC,YAAY,KAAoB,EAAE,MAAY;QAC5C,KAAK,CAAC,IAAA,eAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QANxC,SAAI,GAAG,iBAAiB,CAAC;QAElB,WAAM,GAAoB,EAAE,CAAC;QAMlC,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,MAAM,EAAE;YACV,IAAI,IAAA,eAAQ,EAAC,MAAM,CAAC,EAAE;gBACpB,IAAI,CAAC,MAAM,GAAG;oBACZ,OAAO,EAAE,MAAM;oBACf,KAAK,EAAE,IAAI,CAAC,KAAK;iBAClB,CAAC;aACH;iBAAM;gBACL,IAAI,MAAM,CAAC,MAAM,EAAE;oBACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;iBAC7B;qBAAM;oBACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;oBACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;iBAC3B;aACF;SACF;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,aAAM,EAAC,KAAK,CAAC,C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,CAAC,GAAG,kBAAM,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAEhH,OAAO,+BAA+B,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjI,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidPropertyTokenError = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
class InvalidPropertyTokenError extends Error {
|
|
6
|
-
constructor(target, propertyKey) {
|
|
7
|
-
super(`Object isn't a valid token. Please check the token set on ${(0, core_1.nameOf)((0, core_1.classOf)(target))}.${propertyKey}.\n- Check that it is not a circular reference.\n- Check that the token (class or symbol) exists`);
|
|
8
|
-
this.name = "INVALID_TOKEN_ERROR";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.InvalidPropertyTokenError = InvalidPropertyTokenError;
|
|
12
|
-
//# sourceMappingURL=InvalidPropertyTokenError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidPropertyTokenError.js","sourceRoot":"","sources":["../../../../src/common/errors/InvalidPropertyTokenError.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAE3C,MAAa,yBAA0B,SAAQ,KAAK;IAGlD,YAAY,MAAW,EAAE,WAAmB;QAC1C,KAAK,CACH,6DAA6D,IAAA,aAAM,EACjE,IAAA,cAAO,EAAC,MAAM,CAAC,CAChB,IAAI,WAAW,kGAAkG,CACnH,CAAC;QAPJ,SAAI,GAAG,qBAAqB,CAAC;IAQ7B,CAAC;CACF;AAVD,8DAUC"}
|
package/lib/cjs/common/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./constants/constants.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./decorators/autoInjectable.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./decorators/configuration.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./decorators/constant.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./decorators/controller.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./decorators/inject.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./decorators/injectable.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./decorators/intercept.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./decorators/interceptor.js"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./decorators/lazyInject.js"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./decorators/module.js"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./decorators/opts.js"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./decorators/overrideProvider.js"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./decorators/scope.js"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./decorators/service.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./decorators/useOpts.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./decorators/value.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./domain/Container.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./domain/ControllerProvider.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./domain/InjectablePropertyType.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./domain/LocalsContainer.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./domain/Provider.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./domain/ProviderScope.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./domain/ProviderType.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./errors/InjectionError.js"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./errors/InvalidPropertyTokenError.js"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./interfaces/DIConfigurationOptions.js"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./interfaces/DILogger.js"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./interfaces/DILoggerOptions.js"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./interfaces/DIResolver.js"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./interfaces/ImportTokenProviderOpts.js"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./interfaces/InterceptorContext.js"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./interfaces/InterceptorMethods.js"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./interfaces/InvokeOptions.js"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./interfaces/OnDestroy.js"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./interfaces/OnInit.js"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./interfaces/ProviderOpts.js"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./interfaces/RegistrySettings.js"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./interfaces/ResolvedInvokeOptions.js"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./interfaces/TokenProvider.js"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./interfaces/TokenRoute.js"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./registries/GlobalProviders.js"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./registries/ProviderRegistry.js"), exports);
|
|
50
|
-
tslib_1.__exportStar(require("./services/DIConfiguration.js"), exports);
|
|
51
|
-
tslib_1.__exportStar(require("./services/DILogger.js"), exports);
|
|
52
|
-
tslib_1.__exportStar(require("./services/InjectorService.js"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./utils/colors.js"), exports);
|
|
54
|
-
tslib_1.__exportStar(require("./utils/createContainer.js"), exports);
|
|
55
|
-
tslib_1.__exportStar(require("./utils/getConfiguration.js"), exports);
|
|
56
|
-
tslib_1.__exportStar(require("./utils/getConstructorDependencies.js"), exports);
|
|
57
|
-
tslib_1.__exportStar(require("./utils/resolveControllers.js"), exports);
|
|
58
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAyC;AACzC,yEAA+C;AAC/C,wEAA8C;AAC9C,mEAAyC;AACzC,qEAA2C;AAC3C,iEAAuC;AACvC,qEAA2C;AAC3C,oEAA0C;AAC1C,sEAA4C;AAC5C,qEAA2C;AAC3C,iEAAuC;AACvC,+DAAqC;AACrC,2EAAiD;AACjD,gEAAsC;AACtC,kEAAwC;AACxC,kEAAwC;AACxC,gEAAsC;AACtC,gEAAsC;AACtC,yEAA+C;AAC/C,6EAAmD;AACnD,sEAA4C;AAC5C,+DAAqC;AACrC,oEAA0C;AAC1C,mEAAyC;AACzC,qEAA2C;AAC3C,gFAAsD;AACtD,iFAAuD;AACvD,mEAAyC;AACzC,0EAAgD;AAChD,qEAA2C;AAC3C,kFAAwD;AACxD,6EAAmD;AACnD,6EAAmD;AACnD,wEAA8C;AAC9C,oEAA0C;AAC1C,iEAAuC;AACvC,uEAA6C;AAC7C,2EAAiD;AACjD,gFAAsD;AACtD,wEAA8C;AAC9C,qEAA2C;AAC3C,0EAAgD;AAChD,2EAAiD;AACjD,wEAA8C;AAC9C,iEAAuC;AACvC,wEAA8C;AAC9C,4DAAkC;AAClC,qEAA2C;AAC3C,sEAA4C;AAC5C,gFAAsD;AACtD,wEAA8C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DIConfigurationOptions.js","sourceRoot":"","sources":["../../../../src/common/interfaces/DIConfigurationOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DILogger.js","sourceRoot":"","sources":["../../../../src/common/interfaces/DILogger.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DILoggerOptions.js","sourceRoot":"","sources":["../../../../src/common/interfaces/DILoggerOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DIResolver.js","sourceRoot":"","sources":["../../../../src/common/interfaces/DIResolver.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImportTokenProviderOpts.js","sourceRoot":"","sources":["../../../../src/common/interfaces/ImportTokenProviderOpts.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InterceptorContext.js","sourceRoot":"","sources":["../../../../src/common/interfaces/InterceptorContext.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InterceptorMethods.js","sourceRoot":"","sources":["../../../../src/common/interfaces/InterceptorMethods.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InvokeOptions.js","sourceRoot":"","sources":["../../../../src/common/interfaces/InvokeOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnDestroy.js","sourceRoot":"","sources":["../../../../src/common/interfaces/OnDestroy.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnInit.js","sourceRoot":"","sources":["../../../../src/common/interfaces/OnInit.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderOpts.js","sourceRoot":"","sources":["../../../../src/common/interfaces/ProviderOpts.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegistrySettings.js","sourceRoot":"","sources":["../../../../src/common/interfaces/RegistrySettings.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResolvedInvokeOptions.js","sourceRoot":"","sources":["../../../../src/common/interfaces/ResolvedInvokeOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TokenProvider.js","sourceRoot":"","sources":["../../../../src/common/interfaces/TokenProvider.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TokenRoute.js","sourceRoot":"","sources":["../../../../src/common/interfaces/TokenRoute.ts"],"names":[],"mappings":""}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalProviders = exports.GlobalProviderRegistry = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const Provider_js_1 = require("../domain/Provider.js");
|
|
6
|
-
const ProviderType_js_1 = require("../domain/ProviderType.js");
|
|
7
|
-
class GlobalProviderRegistry extends Map {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.#settings = new Map();
|
|
11
|
-
}
|
|
12
|
-
#settings;
|
|
13
|
-
/**
|
|
14
|
-
* The get() method returns a specified element from a Map object.
|
|
15
|
-
* @param key Required. The key of the element to return from the Map object.
|
|
16
|
-
* @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
|
|
17
|
-
*/
|
|
18
|
-
get(key) {
|
|
19
|
-
return super.get((0, core_1.getClassOrSymbol)(key));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The has() method returns a boolean indicating whether an element with the specified key exists or not.
|
|
23
|
-
* @param key
|
|
24
|
-
* @returns {boolean}
|
|
25
|
-
*/
|
|
26
|
-
has(key) {
|
|
27
|
-
return super.has((0, core_1.getClassOrSymbol)(key));
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The set() method adds or updates an element with a specified key and value to a Map object.
|
|
31
|
-
* @param key Required. The key of the element to add to the Map object.
|
|
32
|
-
* @param metadata Required. The value of the element to add to the Map object.
|
|
33
|
-
*/
|
|
34
|
-
set(key, metadata) {
|
|
35
|
-
super.set((0, core_1.getClassOrSymbol)(key), metadata);
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param target
|
|
41
|
-
* @param options
|
|
42
|
-
*/
|
|
43
|
-
merge(target, options) {
|
|
44
|
-
const meta = this.createIfNotExists(target, options);
|
|
45
|
-
Object.keys(options).forEach((key) => {
|
|
46
|
-
let value = options[key];
|
|
47
|
-
// if (key === "type") {
|
|
48
|
-
// value = String(value);
|
|
49
|
-
// }
|
|
50
|
-
meta[key] = value;
|
|
51
|
-
});
|
|
52
|
-
this.set(target, meta);
|
|
53
|
-
return meta;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* The delete() method removes the specified element from a Map object.
|
|
57
|
-
* @param key Required. The key of the element to remove from the Map object.
|
|
58
|
-
* @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
|
|
59
|
-
*/
|
|
60
|
-
delete(key) {
|
|
61
|
-
return super.delete((0, core_1.getClassOrSymbol)(key));
|
|
62
|
-
}
|
|
63
|
-
createRegistry(type, model, options = {}) {
|
|
64
|
-
const defaultOptions = this.getRegistrySettings(type);
|
|
65
|
-
options = Object.assign(defaultOptions, {
|
|
66
|
-
...options,
|
|
67
|
-
model
|
|
68
|
-
});
|
|
69
|
-
this.#settings.set(type, options);
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
onInvoke(provider, locals, options) {
|
|
73
|
-
const settings = this.#settings.get(provider.type);
|
|
74
|
-
if (settings?.onInvoke) {
|
|
75
|
-
settings.onInvoke(provider, locals, options);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
getRegistrySettings(target) {
|
|
79
|
-
let type = ProviderType_js_1.ProviderType.PROVIDER;
|
|
80
|
-
if (typeof target === "string") {
|
|
81
|
-
type = target;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
const provider = this.get(target);
|
|
85
|
-
if (provider) {
|
|
86
|
-
type = provider.type;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return (this.#settings.get(type) || {
|
|
90
|
-
model: Provider_js_1.Provider
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
createRegisterFn(type) {
|
|
94
|
-
return (provider, instance) => {
|
|
95
|
-
provider = Object.assign({ instance }, provider, { type });
|
|
96
|
-
this.merge(provider.provide, provider);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
* @param key
|
|
102
|
-
* @param options
|
|
103
|
-
*/
|
|
104
|
-
createIfNotExists(key, options) {
|
|
105
|
-
const type = options.type || ProviderType_js_1.ProviderType.PROVIDER;
|
|
106
|
-
if (!this.has(key)) {
|
|
107
|
-
const { model = Provider_js_1.Provider } = this.#settings.get(type) || {};
|
|
108
|
-
const item = new model(key, options);
|
|
109
|
-
this.set(key, item);
|
|
110
|
-
}
|
|
111
|
-
return this.get(key);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
exports.GlobalProviderRegistry = GlobalProviderRegistry;
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
* @type {GlobalProviders}
|
|
118
|
-
*/
|
|
119
|
-
// tslint:disable-next-line: variable-name
|
|
120
|
-
exports.GlobalProviders = new GlobalProviderRegistry();
|
|
121
|
-
//# sourceMappingURL=GlobalProviders.js.map
|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AAE;YAC5D,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAC,QAAQ,EAAC,EAAE,QAAQ,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACO,iBAAiB,CAAC,GAAkB,EAAE,OAA8B;QAC5E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,8BAAY,CAAC,QAAQ,CAAC;QAEnD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAClB,MAAM,EAAC,KAAK,GAAG,sBAAQ,EAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAE1D,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAErC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;IACxB,CAAC;CACF;AAhID,wDAgIC;AAED;;;GAGG;AACH,0CAA0C;AAC7B,QAAA,eAAe,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerController = exports.registerValue = exports.registerProvider = void 0;
|
|
4
|
-
const Provider_js_1 = require("../domain/Provider.js");
|
|
5
|
-
const ProviderScope_js_1 = require("../domain/ProviderScope.js");
|
|
6
|
-
const ProviderType_js_1 = require("../domain/ProviderType.js");
|
|
7
|
-
const GlobalProviders_js_1 = require("./GlobalProviders.js");
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
GlobalProviders_js_1.GlobalProviders.createRegistry(ProviderType_js_1.ProviderType.CONTROLLER, Provider_js_1.Provider);
|
|
12
|
-
/**
|
|
13
|
-
* Register a provider configuration.
|
|
14
|
-
* @param {ProviderOpts<any>} provider
|
|
15
|
-
*/
|
|
16
|
-
function registerProvider(provider) {
|
|
17
|
-
if (!provider.provide) {
|
|
18
|
-
throw new Error("Provider.provide is required");
|
|
19
|
-
}
|
|
20
|
-
return GlobalProviders_js_1.GlobalProviders.merge(provider.provide, provider);
|
|
21
|
-
}
|
|
22
|
-
exports.registerProvider = registerProvider;
|
|
23
|
-
/**
|
|
24
|
-
* Add a new value in the `ProviderRegistry`.
|
|
25
|
-
*
|
|
26
|
-
* #### Example with symbol definition
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ```typescript
|
|
30
|
-
* import {registerValue, InjectorService} from "@tsed/di";
|
|
31
|
-
*
|
|
32
|
-
* const MyValue = Symbol.from("MyValue")
|
|
33
|
-
*
|
|
34
|
-
* registerValue({token: MyValue, useValue: "myValue"});
|
|
35
|
-
*
|
|
36
|
-
* @Service()
|
|
37
|
-
* export class OtherService {
|
|
38
|
-
* constructor(@Inject(MyValue) myValue: string){
|
|
39
|
-
* console.log(myValue); /// "myValue"
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
const registerValue = (provider, value) => {
|
|
45
|
-
if (!provider.provide) {
|
|
46
|
-
provider = {
|
|
47
|
-
provide: provider
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
provider = Object.assign({
|
|
51
|
-
scope: ProviderScope_js_1.ProviderScope.SINGLETON,
|
|
52
|
-
useValue: value
|
|
53
|
-
}, provider, { type: ProviderType_js_1.ProviderType.VALUE });
|
|
54
|
-
GlobalProviders_js_1.GlobalProviders.merge(provider.provide, provider);
|
|
55
|
-
};
|
|
56
|
-
exports.registerValue = registerValue;
|
|
57
|
-
/**
|
|
58
|
-
* Add a new controller in the `ProviderRegistry`. This controller will be built when `InjectorService` will be loaded.
|
|
59
|
-
*
|
|
60
|
-
* #### Example
|
|
61
|
-
*
|
|
62
|
-
* ```typescript
|
|
63
|
-
* import {registerController, InjectorService} from "@tsed/di";
|
|
64
|
-
*
|
|
65
|
-
* export default class MyController {
|
|
66
|
-
* constructor(){}
|
|
67
|
-
* transform() {
|
|
68
|
-
* return "test";
|
|
69
|
-
* }
|
|
70
|
-
* }
|
|
71
|
-
*
|
|
72
|
-
* registerController({provide: MyController});
|
|
73
|
-
* // or
|
|
74
|
-
* registerController(MyController);
|
|
75
|
-
*
|
|
76
|
-
* const injector = new InjectorService();
|
|
77
|
-
* injector.load();
|
|
78
|
-
*
|
|
79
|
-
* const myController = injector.get<MyController>(MyController);
|
|
80
|
-
* myController.getFoo(); // test
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @param provider Provider configuration.
|
|
84
|
-
*/
|
|
85
|
-
exports.registerController = GlobalProviders_js_1.GlobalProviders.createRegisterFn(ProviderType_js_1.ProviderType.CONTROLLER);
|
|
86
|
-
//# sourceMappingURL=ProviderRegistry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderRegistry.js","sourceRoot":"","sources":["../../../../src/common/registries/ProviderRegistry.ts"],"names":[],"mappings":";;;AAAA,uDAA+C;AAC/C,iEAAyD;AACzD,+DAAuD;AAEvD,6DAAqD;AAErD;;GAEG;AACH,oCAAe,CAAC,cAAc,CAAC,8BAAY,CAAC,UAAU,EAAE,sBAAQ,CAAC,CAAC;AAElE;;;GAGG;AACH,SAAgB,gBAAgB,CAAa,QAAqC;IAChF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACjD;IAED,OAAO,oCAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC;AAND,4CAMC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,aAAa,GAAG,CAAC,QAAiC,EAAE,KAAW,EAAQ,EAAE;IACpF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QACrB,QAAQ,GAAG;YACT,OAAO,EAAE,QAAQ;SAClB,CAAC;KACH;IAED,QAAQ,GAAG,MAAM,CAAC,MAAM,CACtB;QACE,KAAK,EAAE,gCAAa,CAAC,SAAS;QAC9B,QAAQ,EAAE,KAAK;KAChB,EACD,QAAQ,EACR,EAAC,IAAI,EAAE,8BAAY,CAAC,KAAK,EAAC,CAC3B,CAAC;IACF,oCAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,kBAAkB,GAAG,oCAAe,CAAC,gBAAgB,CAAC,8BAAY,CAAC,UAAU,CAAC,CAAC"}
|