@tsed/di 8.3.5 → 8.4.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.umd.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,iBACvD,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,aAAc,cAAe,gBAAiBJ,GAC5B,iBAAZC,QACdA,QAAQ,YAAcD,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,iBAErFJ,EAAK,YAAcC,EAAQD,EAAK,cAAeA,EAAK,eAAgBA,EAAK,gBAC1E,CATD,CASGO,MAAM,CAACC,EAAkCC,EAAkCC,I,kCCT9EP,EAAOD,QAAUM,C,UCAjBL,EAAOD,QAAUO,C,UCAjBN,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAI,CAACf,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAK5B,IACH,oBAAX6B,QAA0BA,OAAOC,aAC1CX,OAAOC,e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AND,CAMGA,KAA2BA,GAAyB,CAAC,IeLjD,MAAMkD,GAAS5V,OAAO8I,IAAI,UCD1B,SAAS+M,GAAWC,EAAK,CAAC,EAAGC,EAAK,CAAC,GACtC,OAAOzW,OAAOiJ,QAAQwN,GAAIxU,QAAO,CAACyU,GAAQ5W,EAAK6W,MACpC,IACAD,EACH,CAAC5W,IAAO4W,EAAM5W,IAAQ,IAAI2G,OAAOkQ,MAEtCH,EACP,CACO,SAASI,GAAiB9X,EAAQ+E,EAAgB,CAAC,GACtD,MAAMN,EAAQ,EAAAR,MAAMC,KAAKlE,GAAQqB,IAAI,kBAAoB,CAAC,EAC1D,MAAO,IACAoD,KACAM,EACH6S,MAAOH,GAAWhT,EAAMmT,MAAO7S,EAAc6S,OAErD,C,ODbA3G,EAAWuG,IAAQ1X,SAAQ,IAAM8P,IAAW5E,S","sources":["webpack://@tsed/di/webpack/universalModuleDefinition","webpack://@tsed/di/external umd \"@tsed/core\"","webpack://@tsed/di/external umd \"@tsed/hooks\"","webpack://@tsed/di/external umd \"@tsed/schema\"","webpack://@tsed/di/webpack/bootstrap","webpack://@tsed/di/webpack/runtime/define property getters","webpack://@tsed/di/webpack/runtime/hasOwnProperty shorthand","webpack://@tsed/di/webpack/runtime/make namespace object","webpack://@tsed/di/./src/common/constants/constants.ts","webpack://@tsed/di/./src/common/domain/ProviderScope.ts","webpack://@tsed/di/./src/common/domain/ProviderType.ts","webpack://@tsed/di/./src/common/domain/LocalsContainer.ts","webpack://@tsed/di/./src/common/utils/discoverHooks.ts","webpack://@tsed/di/./src/common/domain/Provider.ts","webpack://@tsed/di/./src/common/registries/GlobalProviders.ts","webpack://@tsed/di/./src/common/domain/Container.ts","webpack://@tsed/di/./src/common/utils/colors.ts","webpack://@tsed/di/./src/common/errors/InjectionError.ts","webpack://@tsed/di/./src/common/utils/createContainer.ts","webpack://@tsed/di/./src/common/utils/getConstructorDependencies.ts","webpack://@tsed/di/./src/common/services/DIConfiguration.ts","webpack://@tsed/di/./src/common/services/InjectorService.ts","webpack://@tsed/di/./src/common/fn/injector.ts","webpack://@tsed/di/./src/common/decorators/autoInjectable.ts","webpack://@tsed/di/./src/common/fn/configuration.ts","webpack://@tsed/di/./src/common/domain/ControllerProvider.ts","webpack://@tsed/di/./src/common/registries/ProviderRegistry.ts","webpack://@tsed/di/./src/common/utils/providerBuilder.ts","webpack://@tsed/di/./src/common/fn/injectable.ts","webpack://@tsed/di/./src/common/errors/InvalidPropertyTokenError.ts","webpack://@tsed/di/./src/common/fn/localsContainer.ts","webpack://@tsed/di/./src/common/fn/inject.ts","webpack://@tsed/di/./src/common/fn/injectMany.ts","webpack://@tsed/di/./src/common/decorators/inject.ts","webpack://@tsed/di/./src/common/decorators/configuration.ts","webpack://@tsed/di/./src/common/fn/constant.ts","webpack://@tsed/di/./src/common/decorators/constant.ts","webpack://@tsed/di/./src/common/domain/InjectablePropertyType.ts","webpack://@tsed/di/./src/common/decorators/controller.ts","webpack://@tsed/di/./src/common/decorators/injectable.ts","webpack://@tsed/di/./src/common/decorators/intercept.ts","webpack://@tsed/di/./src/common/decorators/interceptor.ts","webpack://@tsed/di/./src/common/fn/lazyInject.ts","webpack://@tsed/di/./src/common/decorators/lazyInject.ts","webpack://@tsed/di/./src/common/decorators/module.ts","webpack://@tsed/di/./src/common/decorators/scope.ts","webpack://@tsed/di/./src/common/decorators/opts.ts","webpack://@tsed/di/./src/common/decorators/overrideProvider.ts","webpack://@tsed/di/./src/common/decorators/service.ts","webpack://@tsed/di/./src/common/decorators/useOpts.ts","webpack://@tsed/di/./src/common/decorators/value.ts","webpack://@tsed/di/./src/common/fn/refValue.ts","webpack://@tsed/di/./src/common/services/DILogger.ts","webpack://@tsed/di/./src/common/utils/getConfiguration.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@tsed/core\"), require(\"@tsed/hooks\"), require(\"@tsed/schema\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@tsed/core\", \"@tsed/hooks\", \"@tsed/schema\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@tsed/di\"] = factory(require(\"@tsed/core\"), require(\"@tsed/hooks\"), require(\"@tsed/schema\"));\n\telse\n\t\troot[\"@tsed/di\"] = factory(root[\"@tsed/core\"], root[\"@tsed/hooks\"], root[\"@tsed/schema\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__414__, __WEBPACK_EXTERNAL_MODULE__171__, __WEBPACK_EXTERNAL_MODULE__538__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__414__;","module.exports = __WEBPACK_EXTERNAL_MODULE__171__;","module.exports = __WEBPACK_EXTERNAL_MODULE__538__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export const DI_INVOKE_OPTIONS = Symbol(\"DI_INVOKE_OPTIONS\");\nexport const DI_INJECTABLE_PROPS = Symbol(\"DI_INJECTABLE_PROPS\");\nexport const DI_USE_OPTIONS = \"DI_USE_OPTIONS\";\nexport const DI_USE_PARAM_OPTIONS = \"DI_USE_PARAM_OPTIONS\";\nexport const DI_INTERCEPTOR_OPTIONS = \"DI_INTERCEPTOR_OPTIONS\";\n","export var ProviderScope;\n(function (ProviderScope) {\n ProviderScope[\"SINGLETON\"] = \"singleton\";\n ProviderScope[\"REQUEST\"] = \"request\";\n ProviderScope[\"INSTANCE\"] = \"instance\";\n})(ProviderScope || (ProviderScope = {}));\n","export var ProviderType;\n(function (ProviderType) {\n ProviderType[\"VALUE\"] = \"value\";\n ProviderType[\"PROVIDER\"] = \"provider\";\n ProviderType[\"MODULE\"] = \"module\";\n ProviderType[\"CONTROLLER\"] = \"controller\";\n ProviderType[\"INTERCEPTOR\"] = \"interceptor\";\n ProviderType[\"MIDDLEWARE\"] = \"middleware\";\n})(ProviderType || (ProviderType = {}));\n","import { Hooks } from \"@tsed/hooks\";\nexport class LocalsContainer extends Map {\n constructor() {\n super(...arguments);\n this.hooks = new Hooks();\n }\n async destroy() {\n await this.hooks.asyncEmit(\"$onDestroy\");\n }\n}\n","import { methodsOf } from \"@tsed/core\";\nexport function discoverHooks(token) {\n return methodsOf(token).reduce((hooks, { propertyKey }) => {\n if (String(propertyKey).startsWith(\"$\")) {\n const listener = (instance, ...args) => instance?.[propertyKey](...args);\n return {\n ...hooks,\n [propertyKey]: listener\n };\n }\n return hooks;\n }, {});\n}\n","import { classOf, getClassOrSymbol, isClass, nameOf, Store } from \"@tsed/core\";\nimport { DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { discoverHooks } from \"../utils/discoverHooks.js\";\nimport { ProviderScope } from \"./ProviderScope.js\";\nimport { ProviderType } from \"./ProviderType.js\";\nexport class Provider {\n #useClass;\n #token;\n #store;\n #tokenStore;\n constructor(token, options = {}) {\n /**\n * Token group provider to retrieve all provider from the same type\n */\n this.type = ProviderType.PROVIDER;\n this.hooks = {};\n this.token = token;\n this.useClass = token;\n Object.assign(this, options);\n if (options instanceof Provider) {\n this.#useClass = options.#useClass;\n this.#store = options.#store;\n this.#tokenStore = options.#tokenStore;\n }\n }\n get token() {\n return this.#token;\n }\n set token(value) {\n if (value) {\n this.#token = getClassOrSymbol(value);\n this.#tokenStore = this.#store = Store.from(value);\n }\n }\n /**\n * @deprecated\n */\n get provide() {\n return this.token;\n }\n /**\n * @deprecated\n * @param value\n */\n set provide(value) {\n this.token = value;\n }\n get useClass() {\n return this.#useClass;\n }\n /**\n * Create a new store if the given value is a class. Otherwise, the value is ignored.\n * @param value\n */\n set useClass(value) {\n if (isClass(value)) {\n this.#useClass = classOf(value);\n this.#store = Store.from(value);\n this.hooks = discoverHooks(this.#useClass);\n }\n }\n get className() {\n return this.name;\n }\n get name() {\n return nameOf(this.token);\n }\n get store() {\n return this.#store;\n }\n get path() {\n return this.store.get(\"path\", \"/\");\n }\n set path(path) {\n this.store.set(\"path\", path);\n }\n /**\n * Get the scope of the provider.\n *\n * ::: tip Note\n * Async provider is always a SINGLETON\n * :::\n *\n * @returns {boolean}\n */\n get scope() {\n if (this.isAsync()) {\n return ProviderScope.SINGLETON;\n }\n return this.get(\"scope\", ProviderScope.SINGLETON);\n }\n /**\n * Change the scope value of the provider.\n * @param scope\n */\n set scope(scope) {\n this.store.set(\"scope\", scope);\n }\n get configuration() {\n return this.get(\"configuration\");\n }\n set configuration(configuration) {\n this.store.set(\"configuration\", configuration);\n }\n get children() {\n return this.store.get(\"childrenControllers\", []);\n }\n set children(children) {\n this.store.set(\"childrenControllers\", children);\n }\n getArgOpts(index) {\n return this.store.get(`${DI_USE_PARAM_OPTIONS}:${index}`);\n }\n get(key, defaultValue) {\n return this.store.get(key) || this.#tokenStore.get(key) || defaultValue;\n }\n isAsync() {\n return !!this.useAsyncFactory;\n }\n clone() {\n return new (classOf(this))(this.token, this);\n }\n /**\n *\n * @returns {boolean}\n */\n hasChildren() {\n return !!this.children.length;\n }\n /**\n *\n * @returns {boolean}\n */\n hasParent() {\n return !!this.store.get(\"parentController\");\n }\n toString() {\n return [\n \"Token\",\n this.name,\n this.useClass && nameOf(this.useClass),\n this.useFactory && \"Factory\",\n this.useValue && \"Value\",\n this.useAsyncFactory && \"AsyncFactory\"\n ]\n .filter(Boolean)\n .join(\":\");\n }\n}\n","import { getClassOrSymbol } from \"@tsed/core\";\nimport { Provider } from \"../domain/Provider.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nexport class GlobalProviderRegistry extends Map {\n #settings = new Map();\n /**\n * The get() method returns a specified element from a Map object.\n * @param key Required. The key of the element to return from the Map object.\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n */\n get(key) {\n return super.get(getClassOrSymbol(key));\n }\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n * @param key\n * @returns {boolean}\n */\n has(key) {\n return super.has(getClassOrSymbol(key));\n }\n /**\n * The set() method adds or updates an element with a specified key and value to a Map object.\n * @param key Required. The key of the element to add to the Map object.\n * @param metadata Required. The value of the element to add to the Map object.\n */\n set(key, metadata) {\n super.set(getClassOrSymbol(key), metadata);\n return this;\n }\n /**\n *\n * @param target\n * @param options\n */\n merge(target, options) {\n if (options.global === false) {\n return GlobalProviders.createProvider(target, options);\n }\n const meta = this.createIfNotExists(target, options);\n Object.keys(options).forEach((key) => {\n meta[key] = options[key];\n });\n this.set(target, meta);\n return meta;\n }\n /**\n * The delete() method removes the specified element from a Map object.\n * @param key Required. The key of the element to remove from the Map object.\n * @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.\n */\n delete(key) {\n return super.delete(getClassOrSymbol(key));\n }\n createRegistry(type, model, options = {}) {\n const defaultOptions = this.getRegistrySettings(type);\n options = Object.assign(defaultOptions, {\n ...options,\n model\n });\n this.#settings.set(type, options);\n return this;\n }\n getRegistrySettings(target) {\n let type = ProviderType.PROVIDER;\n if (typeof target === \"string\") {\n type = target;\n }\n else {\n const provider = this.get(target);\n if (provider) {\n type = provider.type;\n }\n }\n return (this.#settings.get(type) || {\n model: Provider\n });\n }\n createProvider(key, options) {\n const type = options.type || ProviderType.PROVIDER;\n const { model = Provider } = this.#settings.get(type) || {};\n return new model(key, options);\n }\n /**\n *\n * @param key\n * @param options\n */\n createIfNotExists(key, options) {\n if (!this.has(key)) {\n const item = this.createProvider(key, options);\n this.set(key, item);\n }\n return this.get(key);\n }\n}\n/**\n *\n * @type {GlobalProviders}\n */\n// tslint:disable-next-line: variable-name\nexport const GlobalProviders = new GlobalProviderRegistry();\n","import { GlobalProviders } from \"../registries/GlobalProviders.js\";\nimport { Provider } from \"./Provider.js\";\nexport class Container extends Map {\n /**\n *\n * @param token\n * @param settings\n */\n add(token, settings = {}) {\n const provider = GlobalProviders.get(token)?.clone() || new Provider(token);\n Object.assign(provider, settings);\n return super.set(token, provider);\n }\n /**\n * Add a provider to the\n * @param token\n * @param settings\n */\n addProvider(token, settings = {}) {\n return this.add(token, settings);\n }\n /**\n *\n * @param token\n */\n hasProvider(token) {\n return super.has(token);\n }\n /**\n * Add a provider to the\n * @param token\n * @param provider\n */\n setProvider(token, provider) {\n return super.set(token, provider);\n }\n /**\n * The getProvider() method returns a specified element from a Map object.\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n * @param token\n */\n getProvider(token) {\n return super.get(token);\n }\n /**\n * Get all providers registered in the injector container.\n *\n * @param type Filter the list by the given ProviderType.\n * @returns {[TokenProvider , Provider<any>][]}\n */\n getProviders(type) {\n const types = [].concat(type).map(String);\n return [...this].reduce((providers, [_, provider]) => {\n if (types.includes(String(provider.type)) || !type) {\n return [...providers, provider];\n }\n return providers;\n }, []);\n }\n addProviders(container) {\n container.forEach((provider) => {\n if (!this.hasProvider(provider.token)) {\n this.setProvider(provider.token, provider.clone());\n }\n });\n }\n}\n","// istanbul ignore next\nconst colorIfAllowed = (colorFn) => (text) => !process.env.NO_COLOR && process.env.NODE_ENV !== \"production\" ? colorFn(text) : text;\nconst red = colorIfAllowed((text) => `\\x1B[31m${text}\\x1B[39m`);\nconst yellow = colorIfAllowed((text) => `\\x1B[33m${text}\\x1B[39m`);\nconst green = colorIfAllowed((text) => `\\x1B[32m${text}\\x1B[39m`);\nexport const colors = { red, yellow, green };\n","import { getConstructorArgNames, isClass, isString, nameOf } from \"@tsed/core\";\nimport { colors } from \"../utils/colors.js\";\nexport class InjectionError extends Error {\n constructor(token, origin) {\n super(isString(origin) ? origin : \"\");\n this.name = \"INJECTION_ERROR\";\n this.tokens = [];\n this.tokens = [token];\n if (origin) {\n if (isString(origin)) {\n this.origin = {\n message: origin,\n stack: this.stack\n };\n }\n else {\n if (origin.tokens) {\n this.tokens = this.tokens.concat(origin.tokens);\n this.origin = origin.origin;\n }\n else {\n this.origin = origin;\n this.stack = origin.stack;\n }\n }\n }\n const originMessage = this.origin ? \"\\nOrigin: \" + this.origin.message : \"\";\n const tokensMessage = this.tokens.map((token) => nameOf(token)).join(\" > \");\n this.message = `Injection failed on ${tokensMessage}${originMessage}`;\n }\n static throwInjectorError(token, currentDependency, error) {\n if (currentDependency && isClass(token)) {\n error.message = printDependencyInjectionError(token, { ...currentDependency, message: error.message });\n }\n throw new InjectionError(token, error);\n }\n}\nfunction printDependencyInjectionError(token, options) {\n let erroredArg = \"\";\n const args = getConstructorArgNames(token)\n .map((arg, index) => {\n if (options.index === index) {\n erroredArg = arg;\n arg = colors.red(arg);\n }\n return `${arg}: ${nameOf(options.deps[index])}`;\n })\n .join(\", \");\n const signature = nameOf(token) + \"->constructor(\" + args + \")\";\n const indexOf = signature.indexOf(erroredArg) - 5;\n const drawline = (indexOf) => \" \".repeat(indexOf) + colors.red(\"^\" + \"‾\".repeat(erroredArg.length - 1));\n return \"Unable to inject dependency. \" + options.message + \"\\n\\n\" + signature + \"\\n\" + (indexOf > -1 ? drawline(indexOf) : \"\");\n}\n","import { Container } from \"../domain/Container.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nexport function createContainer(rootModule) {\n const container = new Container(GlobalProviders.entries());\n if (rootModule) {\n container.delete(rootModule);\n }\n return container;\n}\n","import { Metadata } from \"@tsed/core\";\nexport function getConstructorDependencies(target, propertyKey) {\n return Metadata.getOwn(\"override:ctor:design:paramtypes\", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)] || [];\n}\nexport function setConstructorDependencies(target, deps) {\n Metadata.set(\"override:ctor:design:paramtypes\", deps, target);\n}\n","import { getValue, setValue } from \"@tsed/core\";\nexport const CONFIGURATION = Symbol.for(\"CONFIGURATION\");\nexport class DIConfiguration {\n constructor(initialProps = {}) {\n this.default = new Map();\n this.map = new Map();\n Object.entries({\n imports: [],\n routes: [],\n logger: {},\n ...initialProps\n }).forEach(([key, value]) => {\n this.default.set(key, value);\n });\n }\n get version() {\n return this.get(\"version\");\n }\n set version(v) {\n this.map.set(\"version\", v);\n }\n get rootDir() {\n return this.get(\"rootDir\");\n }\n set rootDir(value) {\n this.map.set(\"rootDir\", value);\n }\n get env() {\n return this.map.get(\"env\");\n }\n set env(value) {\n this.map.set(\"env\", value);\n }\n get imports() {\n return this.get(\"imports\");\n }\n set imports(imports) {\n this.map.set(\"imports\", imports);\n }\n get routes() {\n return this.get(\"routes\");\n }\n set routes(routes) {\n this.map.set(\"routes\", routes);\n }\n get logger() {\n return this.get(\"logger\");\n }\n set logger(value) {\n const logger = { ...this.logger, ...value };\n this.map.set(\"logger\", logger);\n }\n get debug() {\n return this.logger.level === \"debug\";\n }\n set debug(debug) {\n this.logger = { ...this.logger, level: debug ? \"debug\" : \"info\" };\n }\n /**\n *\n * @param callbackfn\n * @param thisArg\n */\n forEach(callbackfn, thisArg) {\n return new Set([...Array.from(this.default.keys()), ...Array.from(this.map.keys())]).forEach((key) => {\n callbackfn(this.getRaw(key), key, this.map);\n }, thisArg);\n }\n /**\n *\n * @param propertyKey\n * @param value\n */\n set(propertyKey, value) {\n if (typeof propertyKey === \"string\") {\n if (Reflect.has(this, propertyKey)) {\n // @ts-ignore\n this[propertyKey] = value;\n }\n else {\n this.setRaw(propertyKey, value);\n }\n }\n else {\n Object.entries(propertyKey).forEach(([key, value]) => {\n this.set(key, value);\n });\n }\n return this;\n }\n setRaw(propertyKey, value) {\n setValue(this.map, propertyKey, value);\n return this;\n }\n /**\n *\n * @param propertyKey\n * @param defaultValue\n * @returns {undefined|any}\n */\n get(propertyKey, defaultValue) {\n return this.getRaw(propertyKey, defaultValue);\n }\n getRaw(propertyKey, defaultValue) {\n const value = getValue(this.map, propertyKey);\n if (value !== undefined) {\n return value;\n }\n return getValue(this.default, propertyKey, defaultValue);\n }\n}\n","import { classOf, deepClone, deepMerge, isArray, isClass, isFunction, isInheritedFrom, isObject, isPromise, nameOf } from \"@tsed/core\";\nimport { $alter, $asyncAlter, $asyncEmit, $emit, $off, $on } from \"@tsed/hooks\";\nimport { DI_INVOKE_OPTIONS, DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { Container } from \"../domain/Container.js\";\nimport { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { Provider } from \"../domain/Provider.js\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { InjectionError } from \"../errors/InjectionError.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nimport { createContainer } from \"../utils/createContainer.js\";\nimport { getConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nimport { DIConfiguration } from \"./DIConfiguration.js\";\nconst EXCLUDED_CONFIGURATION_KEYS = [\"mount\", \"imports\"];\n/**\n * This service contain all services collected by `@Service` or services declared manually with `InjectorService.factory()` or `InjectorService.service()`.\n *\n * ### Example:\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n *\n * // Import the services (all services are decorated with @Service()\";\n * import MyService1 from \"./services/service1.js\";\n * import MyService2 from \"./services/service2.js\";\n * import MyService3 from \"./services/service3.js\";\n *\n * // When all services are imported, you can load InjectorService.\n *\n * await injector().load();\n *\n * const myService1 = injector.get<MyService1>(MyService1);\n * ```\n */\nexport class InjectorService extends Container {\n #cache;\n #loaded;\n constructor() {\n super();\n this.logger = console;\n this.resolvedConfiguration = false;\n this.#cache = new LocalsContainer();\n this.#loaded = false;\n this.#cache.set(InjectorService, this);\n this.#cache.set(DIConfiguration, new DIConfiguration());\n }\n get settings() {\n return this.#cache.get(DIConfiguration);\n }\n set settings(settings) {\n this.#cache.set(DIConfiguration, settings);\n }\n isLoaded() {\n return this.#loaded;\n }\n /**\n * Return a list of instance build by the injector.\n */\n toArray() {\n return [...this.#cache.values()];\n }\n /**\n * Get a service or factory already constructed from his symbol or class.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.get<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The class or symbol registered in InjectorService.\n * @param options\n */\n get(token, options) {\n if (!this.has(token)) {\n return this.resolve(token, options);\n }\n return this.#cache.get(token);\n }\n /**\n * Return all instance of the same provider type\n */\n getMany(type, options) {\n return this.getProviders(type).map((provider) => {\n return this.resolve(provider.token, options);\n });\n }\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n */\n has(token) {\n return this.#cache.get(token) !== undefined;\n }\n /**\n * Declare an alias for a given token.\n */\n alias(token, alias) {\n this.#cache.set(alias, this.#cache.get(token));\n return this;\n }\n /**\n * Resolve the token depending on his provider configuration.\n *\n * If the token isn't cached, the injector will invoke the provider and cache the result.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.invoke<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The injectable class to invoke. Class parameters are injected according constructor signature.\n * @param options {InvokeOptions} Optional options to invoke the class.\n * @returns {Type} The class constructed.\n */\n resolve(token, options = {}) {\n let instance = options.locals ? options.locals.get(token) : undefined;\n if (instance !== undefined) {\n return instance;\n }\n if (token === DI_USE_PARAM_OPTIONS) {\n return options.useOpts;\n }\n instance = !options.rebuild ? this.#cache.get(token) : undefined;\n if (instance != undefined) {\n return instance;\n }\n const provider = this.ensureProvider(token);\n // maybe not necessary\n if (!provider || options.rebuild) {\n instance = this.invokeToken(token, options);\n if (provider) {\n return this.setToCache(provider, instance);\n }\n return instance;\n }\n instance = this.invokeToken(token, options);\n switch (provider.scope) {\n case ProviderScope.SINGLETON:\n if (!options.rebuild) {\n this.registerHooks(provider, options);\n }\n return this.setToCache(provider, instance);\n case ProviderScope.REQUEST:\n if (options.locals) {\n options.locals.set(provider.token, instance);\n this.registerHooks(provider, options);\n }\n return instance;\n }\n return instance;\n }\n /**\n * Resolve the token depending on his provider configuration.\n *\n * If the token isn't cached, the injector will invoke the provider and cache the result.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.invoke<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The injectable class to invoke. Class parameters are injected according constructor signature.\n * @param options {InvokeOptions} Optional options to invoke the class.\n * @returns {Type} The class constructed.\n * @alias InjectorService.resolve\n */\n invoke(token, options = {}) {\n return this.resolve(token, options);\n }\n /**\n * Build only providers which are asynchronous.\n */\n async loadAsync() {\n for (const [, provider] of this) {\n if (!this.has(provider.token) && provider.isAsync()) {\n await this.resolve(provider.token);\n }\n }\n }\n /**\n * Build only providers which are synchronous.\n */\n loadSync() {\n for (const [, provider] of this) {\n // TODO try to lazy provider instead initiate all providers (&& provider.hasRegisteredHooks())\n if (!this.has(provider.token) && provider.scope === ProviderScope.SINGLETON) {\n this.resolve(provider.token);\n }\n }\n }\n /**\n * Build all providers from given container (or GlobalProviders) and emit `$onInit` event.\n *\n * @param container\n */\n async load(container = createContainer()) {\n // avoid provider registration in the GlobalContainer during the loading phase\n // using injectable() or providerBuilder()\n this.#loaded = true;\n await $asyncEmit(\"$beforeInit\");\n this.bootstrap(container);\n // build async and sync provider\n await this.loadAsync();\n // load sync provider\n this.loadSync();\n await $asyncEmit(\"$onInit\");\n }\n /**\n * Load all configurations registered on providers via @Configuration decorator.\n * It inspects for each provider some fields like imports, mount, etc. to resolve the configuration.\n */\n resolveConfiguration() {\n if (this.resolvedConfiguration) {\n return;\n }\n const mergedConfiguration = new Map();\n super.forEach((provider) => {\n if (provider.configuration && provider.type !== \"server:module\") {\n Object.entries(provider.configuration).forEach(([key, value]) => {\n if (!EXCLUDED_CONFIGURATION_KEYS.includes(key)) {\n value = mergedConfiguration.has(key) ? deepMerge(mergedConfiguration.get(key), value) : deepClone(value);\n mergedConfiguration.set(key, value);\n }\n });\n }\n });\n mergedConfiguration.forEach((value, key) => {\n this.settings.set(key, deepMerge(value, this.settings.get(key)));\n });\n this.resolvedConfiguration = true;\n }\n /**\n * Emit an event to all service. See service [lifecycle hooks](/docs/services.md#lifecycle-hooks).\n * @param eventName The event name to emit at all services.\n * @param args List of the parameters to give to each service.\n * @returns A list of promises.\n * @deprecated use $asyncEmit instead\n */\n emit(eventName, ...args) {\n return $asyncEmit(eventName, args);\n }\n /**\n * Alter value attached to an event.\n * @param eventName\n * @param value\n * @param args\n * @deprecated use $alter instead\n */\n alter(eventName, value, ...args) {\n return $alter(eventName, value, args);\n }\n /**\n * Alter value attached to an event asynchronously.\n * @param eventName\n * @param value\n * @param args\n * @deprecated use $asyncAlter instead\n */\n alterAsync(eventName, value, ...args) {\n return $asyncAlter(eventName, value, args);\n }\n /**\n * Destroy the injector and all services.\n */\n async destroy() {\n await $asyncEmit(\"$onDestroy\");\n this.#cache.forEach((_, token) => {\n $off(token);\n });\n }\n /**\n * Bootstrap injector from container, resolve configuration and providers.\n *\n * @param container\n */\n bootstrap(container = createContainer()) {\n // Clone all providers in the container\n this.addProviders(container);\n // Resolve all configuration\n this.resolveConfiguration();\n // allow mocking or changing provider instance before loading injector\n this.resolveImportsProviders();\n return this;\n }\n ensureProvider(token, force = false) {\n if (!this.hasProvider(token) && (GlobalProviders.has(token) || force)) {\n this.addProvider(token);\n }\n return this.getProvider(token);\n }\n /**\n * Invoke a class method and inject service.\n *\n * #### IInjectableMethod options\n *\n * * **target**: Optional. The class instance.\n * * **methodName**: `string` Optional. The method name.\n * * **designParamTypes**: `any[]` Optional. List of injectable types.\n * * **locals**: `Map<Function, any>` Optional. If preset then any argument Class are read from this object first, before the `InjectorService` is consulted.\n *\n * #### Example\n *\n * @param target\n * @param options\n * @private\n */\n invokeToken(target, options = {}) {\n const resolvedOpts = this.mapInvokeOptions(target, options);\n if (!resolvedOpts) {\n return undefined;\n }\n const { token, deps, construct, imports, provider } = resolvedOpts;\n $emit(\"$beforeInvoke\", token, [resolvedOpts]);\n $emit(`$beforeInvoke:${String(provider.type)}`, [resolvedOpts]);\n let instance;\n let currentDependency = false;\n try {\n const invokeDependency = (parent) => (token, index) => {\n currentDependency = { token, index, deps };\n if (isArray(token)) {\n return this.getMany(token[0], options);\n }\n return isInheritedFrom(token, Provider, 1)\n ? provider\n : this.resolve(token, {\n parent,\n locals: options.locals,\n useOpts: provider?.getArgOpts(index) || options.useOpts\n });\n };\n // Invoke manually imported providers\n imports.forEach(invokeDependency());\n // Inject dependencies\n const services = deps.map(invokeDependency(token));\n currentDependency = false;\n instance = construct(services);\n }\n catch (error) {\n InjectionError.throwInjectorError(token, currentDependency, error);\n }\n if (instance === undefined) {\n throw new InjectionError(token, `Unable to create new instance from undefined value. Check your provider declaration for ${nameOf(token)}`);\n }\n if (instance && isClass(classOf(instance))) {\n Reflect.defineProperty(instance, DI_INVOKE_OPTIONS, {\n get: () => ({ rebuild: options.rebuild, locals: options.locals })\n });\n }\n $emit(\"$afterInvoke\", token, [instance, resolvedOpts]);\n return instance;\n }\n resolveImportsProviders() {\n this.settings.imports = this.settings.imports\n ?.filter((meta) => isObject(meta) && \"token\" in meta && meta.token !== InjectorService)\n .map((meta) => {\n if (isObject(meta) && \"token\" in meta) {\n const { token, ...props } = meta;\n const provider = this.ensureProvider(token, true);\n if (provider) {\n provider.useValue = undefined;\n provider.useAsyncFactory = undefined;\n provider.useFactory = undefined;\n if (\"useClass\" in props) {\n provider.useClass = props.useClass;\n return;\n }\n if (\"useFactory\" in props) {\n provider.useFactory = props.useFactory;\n return;\n }\n if (\"useAsyncFactory\" in props) {\n provider.useAsyncFactory = props.useAsyncFactory;\n return;\n }\n if (\"use\" in props) {\n provider.useValue = props.use;\n return;\n }\n }\n }\n return meta;\n })\n .filter(Boolean);\n }\n /**\n * Create options to invoke a provider or class.\n * @param token\n * @param options\n */\n mapInvokeOptions(token, options) {\n const locals = options.locals || new LocalsContainer();\n options.locals = locals;\n let imports = options.imports;\n let deps = options.deps;\n let construct;\n if (!token || token === Object) {\n throw new Error(\"Given token is undefined. Could mean a circular dependency problem. Try to use @Inject(() => Token) to solve it.\");\n }\n let provider;\n if (!this.hasProvider(token)) {\n provider = new Provider(token);\n }\n else {\n provider = this.getProvider(token);\n }\n deps = deps || provider.deps;\n imports = imports || provider.imports;\n if (provider.useValue !== undefined) {\n construct = () => (isFunction(provider.useValue) ? provider.useValue() : provider.useValue);\n }\n else if (provider.useFactory) {\n construct = (deps) => provider.useFactory(...deps);\n }\n else if (provider.useAsyncFactory) {\n construct = async (deps) => {\n deps = await Promise.all(deps);\n return provider.useAsyncFactory(...deps);\n };\n }\n else if (provider.useClass) {\n // useClass\n deps = deps || getConstructorDependencies(provider.useClass);\n construct = (deps) => new provider.useClass(...deps);\n }\n else {\n return false;\n }\n return {\n token,\n deps: deps || [],\n imports: imports || [],\n construct,\n provider,\n locals\n };\n }\n registerHooks(provider, options) {\n if (provider.hooks) {\n if (provider.scope === ProviderScope.REQUEST) {\n if (options.locals && provider.hooks?.$onDestroy) {\n const { locals } = options;\n options.locals.hooks.on(\"$onDestroy\", (...args) => {\n return provider.hooks?.$onDestroy?.(locals.get(provider.token), ...args);\n });\n }\n return;\n }\n Object.entries(provider.hooks).forEach(([event, cb]) => {\n const callback = (...args) => {\n return cb(this.#cache.get(provider.token), ...args);\n };\n $on(event, provider.token, callback);\n });\n }\n }\n setToCache(provider, instance) {\n const set = (instance) => {\n this.#cache.set(provider.token, instance);\n provider?.alias && this.alias(provider.token, provider.alias);\n };\n if (\"isAsync\" in provider && !provider.isAsync() && !isPromise(instance)) {\n set(instance);\n return instance;\n }\n // store promise to lock token in cache\n set(instance);\n instance = instance.then((instance) => {\n set(instance);\n return instance;\n });\n return instance;\n }\n}\n","import { InjectorService } from \"../services/InjectorService.js\";\nlet globalInjector = new InjectorService();\n/**\n * Return the existing injector service.\n *\n * Example:\n *\n * ```typescript\n * import {injector, Injectable} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyService {\n * injector = injector();\n * }\n * ```\n */\nexport function injector() {\n return globalInjector;\n}\nexport async function destroyInjector() {\n await globalInjector.destroy();\n globalInjector = new InjectorService();\n}\n","import { isArray } from \"@tsed/core\";\nimport { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { getConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nfunction resolveAutoInjectableArgs(token, args) {\n const inj = injector();\n const locals = new LocalsContainer();\n const deps = getConstructorDependencies(token);\n const list = [];\n const length = Math.max(deps.length, args.length);\n for (let i = 0; i < length; i++) {\n if (args[i] !== undefined) {\n list.push(args[i]);\n }\n else {\n const value = deps[i];\n const instance = isArray(value) ? inj.getMany(value[0], { locals, parent: token }) : inj.invoke(value, { locals, parent: token });\n list.push(instance);\n }\n }\n return list;\n}\n/**\n * AutoInjectable decorator is used to automatically inject dependencies in the constructor.\n *\n * @example\n * ```typescript\n * @AutoInjectable()\n * class UserService {\n * constructor(\n * private database: Database, // automatically injected\n * customConfig?: Config // can be passed manually\n * ) {}\n * }\n * ```\n *\n * @description\n * When applied to a class, this decorator:\n * - Automatically resolves and injects dependencies based on constructor parameter types\n * - Preserves the ability to manually pass arguments which override automatic injection\n *\n * @decorator\n * @returns {ClassDecorator} A class decorator that enables automatic dependency injection\n */\nexport function AutoInjectable() {\n return (constr) => {\n return class AutoInjectable extends constr {\n constructor(...args) {\n super(...resolveAutoInjectableArgs(constr, args));\n }\n };\n };\n}\n","import { Store } from \"@tsed/core\";\nimport { injector } from \"./injector.js\";\nexport function configuration(token, configuration) {\n if (token) {\n const store = Store.from(token);\n if (configuration) {\n store.set(\"configuration\", configuration);\n }\n return store.get(\"configuration\", configuration);\n }\n return injector().settings;\n}\n","import { Provider } from \"./Provider.js\";\nimport { ProviderType } from \"./ProviderType.js\";\nexport class ControllerProvider extends Provider {\n constructor(token, options = {}) {\n super(token, options);\n this.type = ProviderType.CONTROLLER;\n }\n /**\n *\n * @returns {any[]}\n */\n get middlewares() {\n return Object.assign({\n use: [],\n useAfter: [],\n useBefore: []\n }, this.store.get(\"middlewares\", {}));\n }\n /**\n *\n * @param middlewares\n */\n set middlewares(middlewares) {\n const mdlwrs = this.middlewares;\n const concat = (key, a, b) => (a[key] = a[key].concat(b[key]));\n Object.keys(middlewares).forEach((key) => {\n concat(key, mdlwrs, middlewares);\n });\n this.store.set(\"middlewares\", mdlwrs);\n }\n}\n","import { ControllerProvider } from \"../domain/ControllerProvider.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { injectable } from \"../fn/injectable.js\";\nimport { GlobalProviders } from \"./GlobalProviders.js\";\nGlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider);\n/**\n * Register a provider configuration.\n * @deprecated Since v8. Use injectable() function instead.\n */\nexport function registerProvider({ token, provide, ...opts }) {\n return injectable(token || provide, {\n ...opts,\n token: token || provide\n }).inspect();\n}\n","import \"../registries/ProviderRegistry.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nexport function providerBuilder(props, baseOpts = {}) {\n return (token, options = {}) => {\n const merged = {\n global: !injector().isLoaded(),\n ...options,\n ...baseOpts,\n token\n };\n const provider = GlobalProviders.merge(token, merged);\n if (!merged.global) {\n injector().setProvider(token, provider);\n }\n return props.reduce((acc, prop) => {\n return {\n ...acc,\n [prop]: function (value) {\n provider[prop] = value;\n return this;\n }\n };\n }, {\n factory(factory) {\n provider.useFactory = factory;\n return this;\n },\n asyncFactory(asyncFactory) {\n provider.useAsyncFactory = asyncFactory;\n return this;\n },\n value(value) {\n provider.useValue = value;\n provider.type = ProviderType.VALUE;\n return this;\n },\n class(k) {\n provider.useClass = k;\n return this;\n },\n store() {\n return provider.store;\n },\n inspect() {\n return provider;\n },\n token() {\n return provider.token;\n }\n });\n };\n}\n","import { ProviderType } from \"../domain/ProviderType.js\";\nimport { providerBuilder } from \"../utils/providerBuilder.js\";\nconst Props = [\"type\", \"scope\", \"path\", \"alias\", \"hooks\", \"deps\", \"imports\", \"configuration\", \"priority\"];\nexport const injectable = providerBuilder(Props);\nexport const interceptor = providerBuilder(Props, {\n type: ProviderType.INTERCEPTOR\n});\nexport const controller = providerBuilder([...Props, \"middlewares\"], {\n type: ProviderType.CONTROLLER\n});\n","import { classOf, nameOf } from \"@tsed/core\";\nexport class InvalidPropertyTokenError extends Error {\n constructor(target, propertyKey) {\n super(`Object isn't a valid token. Please check the token set on ${nameOf(classOf(target))}.${propertyKey}.\\n- Check that it is not a circular reference.\\n- Check that the token (class or symbol) exists`);\n this.name = \"INVALID_TOKEN_ERROR\";\n }\n}\n","import { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { InjectorService } from \"../services/InjectorService.js\";\nimport { injector } from \"./injector.js\";\nlet globalLocals;\nlet globalInvOpts = {};\nconst stagedLocals = [];\n/**\n * Get the locals container initiated by DITest or .bootstrap() method.\n */\nexport function localsContainer({ providers, rebuild } = {}) {\n if (!globalLocals || providers) {\n globalLocals = new LocalsContainer();\n if (providers) {\n providers.forEach((p) => {\n globalLocals.set(p.token, p.use);\n });\n globalLocals.set(InjectorService, injector());\n }\n if (rebuild) {\n globalInvOpts.rebuild = rebuild;\n }\n }\n return globalLocals;\n}\nexport function invokeOptions() {\n return { ...globalInvOpts };\n}\n/**\n * Reset the locals container.\n */\nexport function detachLocalsContainer() {\n globalLocals && stagedLocals.push(globalLocals);\n globalLocals = undefined;\n globalInvOpts = {};\n}\nexport function cleanAllLocalsContainer() {\n detachLocalsContainer();\n stagedLocals.map((item) => item.clear());\n}\n","import { injector } from \"./injector.js\";\nimport { invokeOptions, localsContainer } from \"./localsContainer.js\";\n/**\n * Inject a provider to another provider.\n *\n * Use this function to inject a custom provider on constructor parameter or property.\n *\n * ```typescript\n * @Injectable()\n * export class MyService {\n * connection = inject(CONNECTION);\n * }\n * ```\n *\n * @param token A token provider or token provider group\n * @param opts\n * @returns {Function}\n * @decorator\n */\nexport function inject(token, opts) {\n return injector().resolve(token, {\n ...opts,\n ...invokeOptions(),\n locals: opts?.locals || localsContainer()\n });\n}\n","import { injector } from \"./injector.js\";\nimport { localsContainer } from \"./localsContainer.js\";\n/**\n * Injects multiple instances of a given token using the injector service.\n * @param token - The injection token to resolve\n * @param opts - Optional configuration for the injection\n * @param opts.useOpts - Options for instance creation\n * @param opts.rebuild - Whether to rebuild the instance\n * @param opts.locals - Local container overrides\n * @returns Array of resolved instances\n */\nexport function injectMany(token, opts) {\n return injector().getMany(token, { ...opts, locals: opts?.locals || localsContainer() });\n}\n","import { catchError, decoratorTypeOf, DecoratorTypes, isPromise, Metadata, Store } from \"@tsed/core\";\nimport { DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS, DI_USE_OPTIONS } from \"../constants/constants.js\";\nimport { InvalidPropertyTokenError } from \"../errors/InvalidPropertyTokenError.js\";\nimport { inject } from \"../fn/inject.js\";\nimport { injectMany } from \"../fn/injectMany.js\";\nimport { getConstructorDependencies, setConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nfunction setToken(token, { target, propertyKey, parameterIndex }) {\n const paramTypes = getConstructorDependencies(target, propertyKey);\n const type = paramTypes[parameterIndex];\n paramTypes[parameterIndex] = type === Array ? [token] : token;\n Metadata.setParamTypes(target, propertyKey, paramTypes);\n setConstructorDependencies(target, paramTypes);\n}\nfunction getTokenType(token, target, propertyKey) {\n const useType = token || Metadata.getType(target, propertyKey);\n if (useType === Object) {\n throw new InvalidPropertyTokenError(target, String(propertyKey));\n }\n return useType;\n}\nfunction bindInjectableProperty(target, propertyKey, { token, transform = (o) => o, useOpts }) {\n const symbol = Symbol();\n if (!target[DI_INJECTABLE_PROPS]) {\n Reflect.defineProperty(target, DI_INJECTABLE_PROPS, {\n value: new Set(),\n enumerable: false,\n configurable: false\n });\n }\n target[DI_INJECTABLE_PROPS].add(propertyKey);\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n get() {\n const useType = getTokenType(token, target, propertyKey);\n const originalType = Metadata.getType(target, propertyKey);\n const invokeOpts = {\n rebuild: !!this[DI_INVOKE_OPTIONS]?.rebuild,\n locals: this[DI_INVOKE_OPTIONS]?.locals,\n useOpts: useOpts || Store.from(target, propertyKey).get(DI_USE_OPTIONS)\n };\n if (this[symbol] === undefined) {\n this[symbol] = originalType === Array ? injectMany(token, invokeOpts) : inject(useType, invokeOpts);\n }\n [].concat(this[symbol]).forEach((instance, index) => {\n if (isPromise(this[symbol])) {\n instance.then((result) => {\n this[symbol][index] = result;\n if (originalType !== Array) {\n this[symbol] = result;\n }\n });\n }\n });\n return transform(this[symbol], { self: this, target, propertyKey });\n }\n });\n}\nexport function Inject(token, opts = {}) {\n opts = typeof opts === \"function\" ? { transform: opts } : opts;\n return (target, propertyKey, index) => {\n const bindingType = decoratorTypeOf([target, propertyKey, index]);\n switch (bindingType) {\n case DecoratorTypes.PARAM_CTOR:\n if (token) {\n setToken(token, { target, propertyKey, parameterIndex: index });\n }\n break;\n case DecoratorTypes.PROP:\n bindInjectableProperty(target, propertyKey, { ...opts, token });\n }\n };\n}\n","import { decoratorTypeOf, DecoratorTypes } from \"@tsed/core\";\nimport { configuration } from \"../fn/configuration.js\";\nimport { injectable } from \"../fn/injectable.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { DIConfiguration } from \"../services/DIConfiguration.js\";\nimport { Inject } from \"./inject.js\";\nexport function Configuration(settings = {}) {\n return (...args) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.CLASS:\n configuration(args[0], settings);\n break;\n default:\n case DecoratorTypes.PARAM_CTOR:\n return Inject(DIConfiguration)(args[0], args[1], args[2]);\n }\n };\n}\n// To maintain compatibility with the previous implementation, we need to declare Configuration as\n// injectable token.\ninjectable(Configuration).factory(() => injector().settings);\n","import { injector } from \"./injector.js\";\nexport function constant(expression, defaultValue) {\n return injector().settings.get(expression, defaultValue);\n}\n","import { catchError, deepClone } from \"@tsed/core\";\nimport { constant } from \"../fn/constant.js\";\nexport function bindConstant(target, propertyKey, expression, defaultValue) {\n const symbol = Symbol();\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n get() {\n if (this[symbol] !== undefined) {\n return this[symbol];\n }\n const value = constant(expression, defaultValue);\n this[symbol] = Object.freeze(deepClone(value));\n return this[symbol];\n },\n set(value) {\n const bean = constant(expression, defaultValue) || this[symbol];\n if (bean === undefined && value !== undefined) {\n this[symbol] = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n}\n/**\n * Return value from Configuration.\n *\n * ## Example\n *\n * ```typescript\n * import {Env} from \"@tsed/core\";\n * import {Constant, Value} from \"@tsed/di\";\n *\n * export class MyClass {\n *\n * @Constant(\"env\")\n * env: Env;\n *\n * @Value(\"swagger.path\")\n * swaggerPath: string;\n *\n * @Value(\"swagger.path\", \"defaultValue\")\n * swaggerPath: string;\n *\n * constructor() {\n * console.log(this.swaggerPath) // undefined. Not available on constructor\n * }\n *\n * $onInit() {\n * console.log(this.swaggerPath) // something\n * }\n * }\n * ```\n *\n * @param {string} expression\n * @param defaultValue\n * @returns {(targetClass: any, attributeName: string) => any}\n * @decorator\n */\nexport function Constant(expression, defaultValue) {\n return (target, propertyKey) => {\n return bindConstant(target, propertyKey, expression, defaultValue);\n };\n}\n","export var InjectablePropertyType;\n(function (InjectablePropertyType) {\n InjectablePropertyType[\"METHOD\"] = \"method\";\n InjectablePropertyType[\"PROPERTY\"] = \"property\";\n InjectablePropertyType[\"CONSTANT\"] = \"constant\";\n InjectablePropertyType[\"VALUE\"] = \"value\";\n InjectablePropertyType[\"INTERCEPTOR\"] = \"interceptor\";\n})(InjectablePropertyType || (InjectablePropertyType = {}));\n","import { isArrayOrArrayClass, useDecorators } from \"@tsed/core\";\nimport { Children, Path } from \"@tsed/schema\";\nimport { controller } from \"../fn/injectable.js\";\nfunction mapOptions(options) {\n if (typeof options === \"string\" || options instanceof RegExp || isArrayOrArrayClass(options)) {\n return {\n path: options\n };\n }\n return options;\n}\n/**\n * Declare a new controller with his Rest path. His methods annotated will be collected to build the routing list.\n * This routing listing will be built with the `express.Router` object.\n *\n * ::: tip\n * See [Controllers](/docs/controllers.md) section for more details\n * :::\n *\n * ```typescript\n * @Controller(\"/calendars\")\n * export class CalendarCtrl {\n *\n * @Get(\"/:id\")\n * public get(\n * @Req() request: Req,\n * @Res() response: Res,\n * @Next() next: Next\n * ): void {\n *\n * }\n * }\n * ```\n *\n * @param options\n * @controller\n * @decorator\n * @classDecorator\n */\nexport function Controller(options) {\n const { children = [], path, ...opts } = mapOptions(options);\n return useDecorators((target) => {\n controller(target, opts);\n }, path && Path(path), Children(...children));\n}\n","import { injectable } from \"../fn/injectable.js\";\n/**\n * The decorators `@Injectable()` declare a new service can be injected in other service, controller, interceptor, etc.. on there `constructor`.\n * All classes annotated with `@Injectable()` are built one time, excepted if you change the default provider configuration.\n *\n * ::: tip\n * `@Injectable()` use the `reflect-metadata` to collect and inject the built provided to other services.\n * :::\n *\n * ### Options\n *\n * - type (@@ProviderType@@ or `string`): Kind of provider. (Default: `ProviderType.PROVIDER`)\n * - scope (@@ProviderScope@@): Kind of provider. (Default: `ProviderScope.SINGLETON`)\n * - token (@@TokenProvider@@): An injection token (Note: This option override default metadata generated by Typescript).\n * - deps (`Type<any>`): List of class or provider which will be injected to the constructor (Note: This options override default metadata generated by Typescript).\n *\n * @returns {Function}\n * @decorator\n */\nexport function Injectable(options = {}) {\n return (target) => {\n const opts = {\n ...options,\n ...(options.token ? { useClass: target } : { token: target })\n };\n injectable(opts.token, opts);\n };\n}\n","import { classOf, decorateMethodsOf, decoratorTypeOf, DecoratorTypes, Store } from \"@tsed/core\";\nimport { DI_INTERCEPTOR_OPTIONS, DI_INVOKE_OPTIONS } from \"../constants/constants.js\";\nimport { inject } from \"../fn/inject.js\";\nexport function getInterceptorOptions(target, propertyKey) {\n return Store.fromMethod(target, propertyKey).get(DI_INTERCEPTOR_OPTIONS);\n}\nexport function bindIntercept(target, propertyKey, token, options) {\n const klass = classOf(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(klass.prototype, propertyKey);\n const originalMethod = descriptor.value;\n const symbol = Symbol();\n Store.fromMethod(klass, propertyKey).set(DI_INTERCEPTOR_OPTIONS, options);\n function newMethod(...args) {\n const next = (err) => {\n if (!err) {\n return originalMethod.apply(this, args);\n }\n throw err;\n };\n const context = {\n target: klass,\n propertyKey,\n args,\n options,\n next\n };\n const invokeOpts = {\n rebuild: !!this[DI_INVOKE_OPTIONS]?.rebuild,\n locals: this[DI_INVOKE_OPTIONS]?.locals\n };\n this[symbol] = this[symbol] || inject(token, invokeOpts);\n return this[symbol].intercept({\n ...context,\n options\n }, next);\n }\n descriptor.value = newMethod;\n Reflect.deleteProperty(klass.prototype, propertyKey);\n Reflect.defineProperty(klass.prototype, propertyKey, descriptor);\n return descriptor;\n}\n/**\n * Attaches interceptor to method call and executes the before and after methods\n *\n * @param interceptor\n * @param options\n * @decorator\n */\nexport function Intercept(interceptor, options) {\n return (...args) => {\n const [target, propertyKey] = args;\n const type = decoratorTypeOf(args);\n switch (type) {\n case DecoratorTypes.CLASS:\n decorateMethodsOf(target, Intercept(interceptor, options));\n break;\n case DecoratorTypes.METHOD:\n return bindIntercept(target, propertyKey, interceptor, options);\n }\n };\n}\n","import { ProviderType } from \"../domain/ProviderType.js\";\nimport { Injectable } from \"./injectable.js\";\n/**\n * The decorators `@Interceptor()` declare a new service can be injected in other service or controller on there `constructor`.\n * All services annotated with `@Interceptor()` are constructed one time.\n *\n * > `@Service()` use the `reflect-metadata` to collect and inject service on controllers or other services.\n *\n * @returns {Function}\n * @decorator\n */\nexport function Interceptor() {\n return Injectable({\n type: ProviderType.INTERCEPTOR\n });\n}\n","import { isFunction } from \"@tsed/core\";\nimport { inject } from \"./inject.js\";\nimport { injector } from \"./injector.js\";\n/**\n * Lazy load a provider from his package and invoke only when the provider is used.\n */\nexport async function lazyInject(factory) {\n const { default: token } = await factory();\n if (!injector().has(token)) {\n const instance = await inject(token);\n const instanceWithHook = instance;\n if (\"$onInit\" in instanceWithHook && isFunction(instanceWithHook.$onInit)) {\n await instanceWithHook.$onInit();\n }\n }\n return injector().get(token);\n}\nexport async function optionalLazyInject(factory) {\n try {\n return await lazyInject(factory);\n }\n catch (er) {\n return undefined;\n }\n}\n","import { catchError, isFunction } from \"@tsed/core\";\nimport { lazyInject, optionalLazyInject } from \"../fn/lazyInject.js\";\nfunction mapOptions(args, optional = false) {\n function wrap(key, resolver) {\n return async () => {\n try {\n const { [key]: token } = await resolver();\n return { default: token };\n }\n catch (er) {\n if (!optional) {\n throw er;\n }\n return;\n }\n };\n }\n if (isFunction(args[0])) {\n return wrap(\"default\", args[0]);\n }\n return wrap(args[0], args[1]);\n}\nexport function LazyInject(...args) {\n let resolver = mapOptions(args);\n return (target, propertyKey) => {\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n async get() {\n return lazyInject(resolver);\n }\n });\n };\n}\nexport function OptionalLazyInject(...args) {\n const resolver = mapOptions(args, true);\n return (target, propertyKey) => {\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n async get() {\n return optionalLazyInject(resolver);\n }\n });\n };\n}\n","import { useDecorators } from \"@tsed/core\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { Configuration } from \"./configuration.js\";\nimport { Injectable } from \"./injectable.js\";\n/**\n * Declare a new Ts.ED module\n *\n * ## Options\n * - imports: List of Provider which must be built by injector before invoking the module\n * - deps: List of provider must be injected to the module constructor (explicit declaration)\n *\n * @param options\n * @decorator\n */\nexport function Module(options = {}) {\n const { scopes, imports, deps, scope, ...configuration } = options;\n return useDecorators(Configuration(configuration), Injectable({\n type: ProviderType.MODULE,\n scope: ProviderScope.SINGLETON,\n imports,\n deps,\n injectable: false\n }));\n}\n","import { StoreSet } from \"@tsed/core\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\n/**\n *\n * @param {\"request\" | \"singleton\" | ProviderScope} scope\n * @returns {Function}\n * @constructor\n */\nexport function Scope(scope = ProviderScope.REQUEST) {\n return StoreSet(\"scope\", scope);\n}\n","import { classOf } from \"@tsed/core\";\nimport { DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { Inject } from \"./inject.js\";\nimport { Scope } from \"./scope.js\";\n/**\n * Get instance options. This options depending on his invocation context.\n *\n * ```typescript\n * import {Injectable, Opts, UseOpts} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyConfigurableService {\n * source: string;\n * constructor(@Opts options: any = {}) {\n * console.log(\"Hello \", options.source); // log: Hello Service1 then Hello Service2\n *\n * this.source = options.source;\n * }\n * }\n *\n * @Injectable()\n * class MyService1 {\n * constructor(@UseOpts({source: 'Service1'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service1\n * }\n * }\n *\n * @Injectable()\n * class MyService2 {\n * constructor(@UseOpts({source: 'Service2'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service2\n * }\n * }\n * ```\n *\n * ::: warning\n * Using @@Opts@@ decorator on a constructor parameter change the Scope of the provider to `ProviderScope.INSTANCE`.\n * :::\n *\n * @param target\n * @param propertyKey\n * @param index\n * @decorator\n */\nexport function Opts(target, propertyKey, index) {\n Scope(ProviderScope.INSTANCE)(classOf(target));\n Inject(DI_USE_PARAM_OPTIONS)(target, propertyKey, index);\n}\n","import { GlobalProviders } from \"../registries/GlobalProviders.js\";\n/**\n * Override a provider which is already registered in ProviderRegistry.\n * @returns {Function}\n * @decorators\n * @param originalProvider\n */\nexport function OverrideProvider(originalProvider) {\n return (target) => {\n GlobalProviders.get(originalProvider).useClass = target;\n };\n}\n","import { Injectable } from \"./injectable.js\";\n/**\n * The decorators `@Service()` declare a new service can be injected in other service or controller on there `constructor`.\n * All services annotated with `@Service()` are constructed one time.\n *\n * > `@Service()` use the `reflect-metadata` to collect and inject service on controllers or other services.\n *\n * @returns {Function}\n * @decorator\n */\nexport function Service() {\n return Injectable();\n}\n","import { decoratorTypeOf, DecoratorTypes, Store, UnsupportedDecoratorType } from \"@tsed/core\";\nimport { DI_USE_OPTIONS, DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\n/**\n * Add options to invoke the Service.\n *\n * ```typescript\n * import {Injectable, Opts, UseOpts} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyConfigurableService {\n * source: string;\n * constructor(@Opts options: any = {}) {\n * console.log(\"Hello \", options.source); // log: Hello Service1 then Hello Service2\n *\n * this.source = options.source;\n * }\n * }\n *\n * @Injectable()\n * class MyService1 {\n * constructor(@UseOpts({source: 'Service1'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service1\n * }\n * }\n *\n * @Injectable()\n * class MyService2 {\n * constructor(@UseOpts({source: 'Service2'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service2\n * }\n * }\n * ```\n *\n * ::: warning\n * Using @@Opts@@ decorator on a constructor parameter change the Scope of the provider to `ProviderScope.INSTANCE`.\n * :::\n *\n * @returns {Function}\n * @decorator\n * @param options\n */\nexport function UseOpts(options) {\n return (target, propertyKey, index) => {\n const bindingType = decoratorTypeOf([target, propertyKey, index]);\n switch (bindingType) {\n case DecoratorTypes.PARAM_CTOR:\n Store.from(target).merge(`${DI_USE_PARAM_OPTIONS}:${index}`, options);\n break;\n case DecoratorTypes.PROP:\n Store.from(target, propertyKey).set(DI_USE_OPTIONS, options);\n break;\n default:\n throw new UnsupportedDecoratorType(UseOpts, [target, propertyKey, index]);\n }\n };\n}\n","import { catchError } from \"@tsed/core\";\nimport { injector } from \"../fn/injector.js\";\nexport function bindValue(target, propertyKey, expression, defaultValue) {\n const descriptor = {\n get() {\n return injector().settings.get(expression, defaultValue);\n },\n set(value) {\n injector().settings.set(expression, value);\n },\n enumerable: true,\n configurable: true\n };\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n catchError(() => Reflect.defineProperty(target, propertyKey, descriptor));\n}\n/**\n * Return value from Configuration.\n *\n * ## Example\n *\n * ```typescript\n * import {Env} from \"@tsed/core\";\n * import {Constant, Value} from \"@tsed/di\";\n *\n * export class MyClass {\n *\n * @Constant(\"env\")\n * env: Env;\n *\n * @Value(\"swagger.path\")\n * swaggerPath: string;\n *\n * @Value(\"swagger.path\", \"defaultValue\")\n * swaggerPath: string;\n *\n * constructor() {\n * console.log(this.swaggerPath) // undefined. Not available on constructor\n * }\n *\n * $onInit() {\n * console.log(this.swaggerPath) // something\n * }\n * }\n * ```\n *\n * @param expression\n * @param defaultValue\n * @returns {(targetClass: any, attributeName: string) => any}\n * @decorator\n */\nexport function Value(expression, defaultValue) {\n return (target, propertyKey) => {\n return bindValue(target, propertyKey, expression, defaultValue);\n };\n}\n","import { injector } from \"./injector.js\";\nexport function refValue(expression, defaultValue) {\n return Object.freeze({\n get value() {\n return injector().settings.get(expression, defaultValue);\n },\n set value(value) {\n injector().settings.set(expression, value);\n }\n });\n}\n","import { injectable } from \"../fn/injectable.js\";\nimport { injector } from \"../fn/injector.js\";\nexport const LOGGER = Symbol.for(\"LOGGER\");\ninjectable(LOGGER).factory(() => injector().logger);\n","import { Store } from \"@tsed/core\";\nexport function mergeMount(m1 = {}, m2 = {}) {\n return Object.entries(m2).reduce((mount, [key, controllers]) => {\n return {\n ...mount,\n [key]: (mount[key] || []).concat(controllers)\n };\n }, m1);\n}\nexport function getConfiguration(module, configuration = {}) {\n const store = Store.from(module).get(\"configuration\") || {};\n return {\n ...store,\n ...configuration,\n mount: mergeMount(store.mount, configuration.mount)\n };\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__414__","__WEBPACK_EXTERNAL_MODULE__171__","__WEBPACK_EXTERNAL_MODULE__538__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","DI_INVOKE_OPTIONS","DI_INJECTABLE_PROPS","DI_USE_OPTIONS","DI_USE_PARAM_OPTIONS","DI_INTERCEPTOR_OPTIONS","ProviderScope","ProviderType","LocalsContainer","Map","constructor","super","arguments","this","hooks","Hooks","destroy","asyncEmit","discoverHooks","token","methodsOf","reduce","propertyKey","String","startsWith","listener","instance","args","Provider","options","type","PROVIDER","useClass","assign","getClassOrSymbol","Store","from","provide","isClass","classOf","className","name","nameOf","store","path","set","scope","isAsync","SINGLETON","configuration","children","getArgOpts","index","defaultValue","useAsyncFactory","clone","hasChildren","length","hasParent","toString","useFactory","useValue","filter","Boolean","join","GlobalProviderRegistry","has","metadata","merge","target","global","GlobalProviders","createProvider","meta","createIfNotExists","keys","forEach","delete","createRegistry","model","defaultOptions","getRegistrySettings","provider","item","Container","add","settings","addProvider","hasProvider","setProvider","getProvider","getProviders","types","concat","map","providers","_","includes","addProviders","container","colorIfAllowed","colorFn","text","process","env","NO_COLOR","colors","red","yellow","green","InjectionError","Error","origin","isString","tokens","message","stack","originMessage","tokensMessage","throwInjectorError","currentDependency","error","erroredArg","getConstructorArgNames","arg","deps","signature","indexOf","repeat","drawline","printDependencyInjectionError","createContainer","rootModule","entries","getConstructorDependencies","Metadata","getOwn","getParamTypes","setConstructorDependencies","CONFIGURATION","for","DIConfiguration","initialProps","default","imports","routes","logger","version","v","rootDir","debug","level","callbackfn","thisArg","Set","Array","getRaw","Reflect","setRaw","setValue","getValue","EXCLUDED_CONFIGURATION_KEYS","InjectorService","console","resolvedConfiguration","isLoaded","toArray","values","resolve","getMany","alias","locals","useOpts","rebuild","ensureProvider","invokeToken","setToCache","registerHooks","REQUEST","invoke","loadAsync","loadSync","load","$asyncEmit","bootstrap","resolveConfiguration","mergedConfiguration","deepMerge","deepClone","emit","eventName","alter","$alter","alterAsync","$asyncAlter","$off","resolveImportsProviders","force","resolvedOpts","mapInvokeOptions","construct","$emit","invokeDependency","parent","isArray","isInheritedFrom","services","isObject","props","use","isFunction","async","Promise","all","$onDestroy","on","event","cb","$on","isPromise","then","globalInjector","injector","destroyInjector","AutoInjectable","constr","inj","list","Math","max","i","push","resolveAutoInjectableArgs","ControllerProvider","CONTROLLER","middlewares","useAfter","useBefore","mdlwrs","a","b","registerProvider","opts","injectable","inspect","providerBuilder","baseOpts","merged","acc","asyncFactory","VALUE","k","Props","interceptor","INTERCEPTOR","controller","InvalidPropertyTokenError","globalLocals","globalInvOpts","stagedLocals","localsContainer","p","invokeOptions","detachLocalsContainer","cleanAllLocalsContainer","clear","inject","injectMany","Inject","transform","decoratorTypeOf","DecoratorTypes","PARAM_CTOR","parameterIndex","paramTypes","setParamTypes","setToken","PROP","symbol","configurable","catchError","deleteProperty","useType","getType","getTokenType","originalType","invokeOpts","result","bindInjectableProperty","Configuration","CLASS","constant","expression","bindConstant","freeze","Constant","InjectablePropertyType","Controller","RegExp","isArrayOrArrayClass","mapOptions","useDecorators","Path","Children","Injectable","getInterceptorOptions","fromMethod","bindIntercept","klass","descriptor","getOwnPropertyDescriptor","originalMethod","next","err","apply","context","intercept","Intercept","decorateMethodsOf","METHOD","Interceptor","lazyInject","instanceWithHook","$onInit","optionalLazyInject","er","optional","wrap","resolver","LazyInject","OptionalLazyInject","Module","scopes","MODULE","Scope","StoreSet","Opts","INSTANCE","OverrideProvider","originalProvider","Service","UseOpts","UnsupportedDecoratorType","bindValue","Value","refValue","LOGGER","mergeMount","m1","m2","mount","controllers","getConfiguration"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"di.umd.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,iBACvD,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,aAAc,cAAe,gBAAiBJ,GAC5B,iBAAZC,QACdA,QAAQ,YAAcD,EAAQG,QAAQ,cAAeA,QAAQ,eAAgBA,QAAQ,iBAErFJ,EAAK,YAAcC,EAAQD,EAAK,cAAeA,EAAK,eAAgBA,EAAK,gBAC1E,CATD,CASGO,MAAM,CAACC,EAAkCC,EAAkCC,I,kCCT9EP,EAAOD,QAAUM,C,UCAjBL,EAAOD,QAAUO,C,UCAjBN,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAI,CAACf,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAK5B,IACH,oBAAX6B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AAI,QAClCA,EAAoC,YAAI,aAC3C,CAND,CAMGA,KAA2BA,GAAyB,CAAC,IeLjD,MAAMkD,GAAS5V,OAAO8I,IAAI,UCD1B,SAAS+M,GAAWC,EAAK,CAAC,EAAGC,EAAK,CAAC,GACtC,OAAOzW,OAAOiJ,QAAQwN,GAAIxU,QAAO,CAACyU,GAAQ5W,EAAK6W,MACpC,IACAD,EACH,CAAC5W,IAAO4W,EAAM5W,IAAQ,IAAI2G,OAAOkQ,MAEtCH,EACP,CACO,SAASI,GAAiB9X,EAAQ+E,EAAgB,CAAC,GACtD,MAAMN,EAAQ,EAAAR,MAAMC,KAAKlE,GAAQqB,IAAI,kBAAoB,CAAC,EAC1D,MAAO,IACAoD,KACAM,EACH6S,MAAOH,GAAWhT,EAAMmT,MAAO7S,EAAc6S,OAErD,C,ODbA3G,EAAWuG,IAAQ1X,SAAQ,IAAM8P,IAAW5E,S","sources":["webpack://@tsed/di/webpack/universalModuleDefinition","webpack://@tsed/di/external umd \"@tsed/core\"","webpack://@tsed/di/external umd \"@tsed/hooks\"","webpack://@tsed/di/external umd \"@tsed/schema\"","webpack://@tsed/di/webpack/bootstrap","webpack://@tsed/di/webpack/runtime/define property getters","webpack://@tsed/di/webpack/runtime/hasOwnProperty shorthand","webpack://@tsed/di/webpack/runtime/make namespace object","webpack://@tsed/di/./src/common/constants/constants.ts","webpack://@tsed/di/./src/common/domain/ProviderScope.ts","webpack://@tsed/di/./src/common/domain/ProviderType.ts","webpack://@tsed/di/./src/common/domain/LocalsContainer.ts","webpack://@tsed/di/./src/common/utils/discoverHooks.ts","webpack://@tsed/di/./src/common/domain/Provider.ts","webpack://@tsed/di/./src/common/registries/GlobalProviders.ts","webpack://@tsed/di/./src/common/domain/Container.ts","webpack://@tsed/di/./src/common/utils/colors.ts","webpack://@tsed/di/./src/common/errors/InjectionError.ts","webpack://@tsed/di/./src/common/utils/createContainer.ts","webpack://@tsed/di/./src/common/utils/getConstructorDependencies.ts","webpack://@tsed/di/./src/common/services/DIConfiguration.ts","webpack://@tsed/di/./src/common/services/InjectorService.ts","webpack://@tsed/di/./src/common/fn/injector.ts","webpack://@tsed/di/./src/common/decorators/autoInjectable.ts","webpack://@tsed/di/./src/common/fn/configuration.ts","webpack://@tsed/di/./src/common/domain/ControllerProvider.ts","webpack://@tsed/di/./src/common/registries/ProviderRegistry.ts","webpack://@tsed/di/./src/common/utils/providerBuilder.ts","webpack://@tsed/di/./src/common/fn/injectable.ts","webpack://@tsed/di/./src/common/errors/InvalidPropertyTokenError.ts","webpack://@tsed/di/./src/common/fn/localsContainer.ts","webpack://@tsed/di/./src/common/fn/inject.ts","webpack://@tsed/di/./src/common/fn/injectMany.ts","webpack://@tsed/di/./src/common/decorators/inject.ts","webpack://@tsed/di/./src/common/decorators/configuration.ts","webpack://@tsed/di/./src/common/fn/constant.ts","webpack://@tsed/di/./src/common/decorators/constant.ts","webpack://@tsed/di/./src/common/domain/InjectablePropertyType.ts","webpack://@tsed/di/./src/common/decorators/controller.ts","webpack://@tsed/di/./src/common/decorators/injectable.ts","webpack://@tsed/di/./src/common/decorators/intercept.ts","webpack://@tsed/di/./src/common/decorators/interceptor.ts","webpack://@tsed/di/./src/common/fn/lazyInject.ts","webpack://@tsed/di/./src/common/decorators/lazyInject.ts","webpack://@tsed/di/./src/common/decorators/module.ts","webpack://@tsed/di/./src/common/decorators/scope.ts","webpack://@tsed/di/./src/common/decorators/opts.ts","webpack://@tsed/di/./src/common/decorators/overrideProvider.ts","webpack://@tsed/di/./src/common/decorators/service.ts","webpack://@tsed/di/./src/common/decorators/useOpts.ts","webpack://@tsed/di/./src/common/decorators/value.ts","webpack://@tsed/di/./src/common/fn/refValue.ts","webpack://@tsed/di/./src/common/services/DILogger.ts","webpack://@tsed/di/./src/common/utils/getConfiguration.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@tsed/core\"), require(\"@tsed/hooks\"), require(\"@tsed/schema\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@tsed/core\", \"@tsed/hooks\", \"@tsed/schema\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@tsed/di\"] = factory(require(\"@tsed/core\"), require(\"@tsed/hooks\"), require(\"@tsed/schema\"));\n\telse\n\t\troot[\"@tsed/di\"] = factory(root[\"@tsed/core\"], root[\"@tsed/hooks\"], root[\"@tsed/schema\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__414__, __WEBPACK_EXTERNAL_MODULE__171__, __WEBPACK_EXTERNAL_MODULE__538__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__414__;","module.exports = __WEBPACK_EXTERNAL_MODULE__171__;","module.exports = __WEBPACK_EXTERNAL_MODULE__538__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export const DI_INVOKE_OPTIONS = Symbol(\"DI_INVOKE_OPTIONS\");\nexport const DI_INJECTABLE_PROPS = Symbol(\"DI_INJECTABLE_PROPS\");\nexport const DI_USE_OPTIONS = \"DI_USE_OPTIONS\";\nexport const DI_USE_PARAM_OPTIONS = \"DI_USE_PARAM_OPTIONS\";\nexport const DI_INTERCEPTOR_OPTIONS = \"DI_INTERCEPTOR_OPTIONS\";\n","export var ProviderScope;\n(function (ProviderScope) {\n ProviderScope[\"SINGLETON\"] = \"singleton\";\n ProviderScope[\"REQUEST\"] = \"request\";\n ProviderScope[\"INSTANCE\"] = \"instance\";\n})(ProviderScope || (ProviderScope = {}));\n","export var ProviderType;\n(function (ProviderType) {\n ProviderType[\"VALUE\"] = \"value\";\n ProviderType[\"PROVIDER\"] = \"provider\";\n ProviderType[\"MODULE\"] = \"module\";\n ProviderType[\"CONTROLLER\"] = \"controller\";\n ProviderType[\"INTERCEPTOR\"] = \"interceptor\";\n ProviderType[\"MIDDLEWARE\"] = \"middleware\";\n})(ProviderType || (ProviderType = {}));\n","import { Hooks } from \"@tsed/hooks\";\nexport class LocalsContainer extends Map {\n constructor() {\n super(...arguments);\n this.hooks = new Hooks();\n }\n async destroy() {\n await this.hooks.asyncEmit(\"$onDestroy\");\n }\n}\n","import { methodsOf } from \"@tsed/core\";\nexport function discoverHooks(token) {\n return methodsOf(token).reduce((hooks, { propertyKey }) => {\n if (String(propertyKey).startsWith(\"$\")) {\n const listener = (instance, ...args) => instance?.[propertyKey](...args);\n return {\n ...hooks,\n [propertyKey]: listener\n };\n }\n return hooks;\n }, {});\n}\n","import { classOf, getClassOrSymbol, isClass, nameOf, Store } from \"@tsed/core\";\nimport { DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { discoverHooks } from \"../utils/discoverHooks.js\";\nimport { ProviderScope } from \"./ProviderScope.js\";\nimport { ProviderType } from \"./ProviderType.js\";\nexport class Provider {\n #useClass;\n #token;\n #store;\n #tokenStore;\n constructor(token, options = {}) {\n /**\n * Token group provider to retrieve all provider from the same type\n */\n this.type = ProviderType.PROVIDER;\n this.hooks = {};\n this.token = token;\n this.useClass = token;\n Object.assign(this, options);\n if (options instanceof Provider) {\n this.#useClass = options.#useClass;\n this.#store = options.#store;\n this.#tokenStore = options.#tokenStore;\n }\n }\n get token() {\n return this.#token;\n }\n set token(value) {\n if (value) {\n this.#token = getClassOrSymbol(value);\n this.#tokenStore = this.#store = Store.from(value);\n }\n }\n /**\n * @deprecated\n */\n get provide() {\n return this.token;\n }\n /**\n * @deprecated\n * @param value\n */\n set provide(value) {\n this.token = value;\n }\n get useClass() {\n return this.#useClass;\n }\n /**\n * Create a new store if the given value is a class. Otherwise, the value is ignored.\n * @param value\n */\n set useClass(value) {\n if (isClass(value)) {\n this.#useClass = classOf(value);\n this.#store = Store.from(value);\n this.hooks = discoverHooks(this.#useClass);\n }\n }\n get className() {\n return this.name;\n }\n get name() {\n return nameOf(this.token);\n }\n get store() {\n return this.#store;\n }\n get path() {\n return this.store.get(\"path\", \"/\");\n }\n set path(path) {\n this.store.set(\"path\", path);\n }\n /**\n * Get the scope of the provider.\n *\n * ::: tip Note\n * Async provider is always a SINGLETON\n * :::\n *\n * @returns {boolean}\n */\n get scope() {\n if (this.isAsync()) {\n return ProviderScope.SINGLETON;\n }\n return this.get(\"scope\", ProviderScope.SINGLETON);\n }\n /**\n * Change the scope value of the provider.\n * @param scope\n */\n set scope(scope) {\n this.store.set(\"scope\", scope);\n }\n get configuration() {\n return this.get(\"configuration\");\n }\n set configuration(configuration) {\n this.store.set(\"configuration\", configuration);\n }\n get children() {\n return this.store.get(\"childrenControllers\", []);\n }\n set children(children) {\n this.store.set(\"childrenControllers\", children);\n }\n getArgOpts(index) {\n return this.store.get(`${DI_USE_PARAM_OPTIONS}:${index}`);\n }\n get(key, defaultValue) {\n return this.store.get(key) || this.#tokenStore.get(key) || defaultValue;\n }\n isAsync() {\n return !!this.useAsyncFactory;\n }\n clone() {\n return new (classOf(this))(this.token, this);\n }\n /**\n *\n * @returns {boolean}\n */\n hasChildren() {\n return !!this.children.length;\n }\n /**\n *\n * @returns {boolean}\n */\n hasParent() {\n return !!this.store.get(\"parentController\");\n }\n toString() {\n return [\n \"Token\",\n this.name,\n this.useClass && nameOf(this.useClass),\n this.useFactory && \"Factory\",\n this.useValue && \"Value\",\n this.useAsyncFactory && \"AsyncFactory\"\n ]\n .filter(Boolean)\n .join(\":\");\n }\n}\n","import { getClassOrSymbol } from \"@tsed/core\";\nimport { Provider } from \"../domain/Provider.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nexport class GlobalProviderRegistry extends Map {\n #settings = new Map();\n /**\n * The get() method returns a specified element from a Map object.\n * @param key Required. The key of the element to return from the Map object.\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n */\n get(key) {\n return super.get(getClassOrSymbol(key));\n }\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n * @param key\n * @returns {boolean}\n */\n has(key) {\n return super.has(getClassOrSymbol(key));\n }\n /**\n * The set() method adds or updates an element with a specified key and value to a Map object.\n * @param key Required. The key of the element to add to the Map object.\n * @param metadata Required. The value of the element to add to the Map object.\n */\n set(key, metadata) {\n super.set(getClassOrSymbol(key), metadata);\n return this;\n }\n /**\n *\n * @param target\n * @param options\n */\n merge(target, options) {\n if (options.global === false) {\n return GlobalProviders.createProvider(target, options);\n }\n const meta = this.createIfNotExists(target, options);\n Object.keys(options).forEach((key) => {\n meta[key] = options[key];\n });\n this.set(target, meta);\n return meta;\n }\n /**\n * The delete() method removes the specified element from a Map object.\n * @param key Required. The key of the element to remove from the Map object.\n * @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.\n */\n delete(key) {\n return super.delete(getClassOrSymbol(key));\n }\n createRegistry(type, model, options = {}) {\n const defaultOptions = this.getRegistrySettings(type);\n options = Object.assign(defaultOptions, {\n ...options,\n model\n });\n this.#settings.set(type, options);\n return this;\n }\n getRegistrySettings(target) {\n let type = ProviderType.PROVIDER;\n if (typeof target === \"string\") {\n type = target;\n }\n else {\n const provider = this.get(target);\n if (provider) {\n type = provider.type;\n }\n }\n return (this.#settings.get(type) || {\n model: Provider\n });\n }\n createProvider(key, options) {\n const type = options.type || ProviderType.PROVIDER;\n const { model = Provider } = this.#settings.get(type) || {};\n return new model(key, options);\n }\n /**\n *\n * @param key\n * @param options\n */\n createIfNotExists(key, options) {\n if (!this.has(key)) {\n const item = this.createProvider(key, options);\n this.set(key, item);\n }\n return this.get(key);\n }\n}\n/**\n *\n * @type {GlobalProviders}\n */\n// tslint:disable-next-line: variable-name\nexport const GlobalProviders = new GlobalProviderRegistry();\n","import { GlobalProviders } from \"../registries/GlobalProviders.js\";\nimport { Provider } from \"./Provider.js\";\nexport class Container extends Map {\n /**\n *\n * @param token\n * @param settings\n */\n add(token, settings = {}) {\n const provider = GlobalProviders.get(token)?.clone() || new Provider(token);\n Object.assign(provider, settings);\n return super.set(token, provider);\n }\n /**\n * Add a provider to the\n * @param token\n * @param settings\n */\n addProvider(token, settings = {}) {\n return this.add(token, settings);\n }\n /**\n *\n * @param token\n */\n hasProvider(token) {\n return super.has(token);\n }\n /**\n * Add a provider to the\n * @param token\n * @param provider\n */\n setProvider(token, provider) {\n return super.set(token, provider);\n }\n /**\n * The getProvider() method returns a specified element from a Map object.\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n * @param token\n */\n getProvider(token) {\n return super.get(token);\n }\n /**\n * Get all providers registered in the injector container.\n *\n * @param type Filter the list by the given ProviderType.\n * @returns {[TokenProvider , Provider<any>][]}\n */\n getProviders(type) {\n const types = [].concat(type).map(String);\n return [...this].reduce((providers, [_, provider]) => {\n if (types.includes(String(provider.type)) || !type) {\n return [...providers, provider];\n }\n return providers;\n }, []);\n }\n addProviders(container) {\n container.forEach((provider) => {\n if (!this.hasProvider(provider.token)) {\n this.setProvider(provider.token, provider.clone());\n }\n });\n }\n}\n","// istanbul ignore next\nconst colorIfAllowed = (colorFn) => (text) => !process.env.NO_COLOR && process.env.NODE_ENV !== \"production\" ? colorFn(text) : text;\nconst red = colorIfAllowed((text) => `\\x1B[31m${text}\\x1B[39m`);\nconst yellow = colorIfAllowed((text) => `\\x1B[33m${text}\\x1B[39m`);\nconst green = colorIfAllowed((text) => `\\x1B[32m${text}\\x1B[39m`);\nexport const colors = { red, yellow, green };\n","import { getConstructorArgNames, isClass, isString, nameOf } from \"@tsed/core\";\nimport { colors } from \"../utils/colors.js\";\nexport class InjectionError extends Error {\n constructor(token, origin) {\n super(isString(origin) ? origin : \"\");\n this.name = \"INJECTION_ERROR\";\n this.tokens = [];\n this.tokens = [token];\n if (origin) {\n if (isString(origin)) {\n this.origin = {\n message: origin,\n stack: this.stack\n };\n }\n else {\n if (origin.tokens) {\n this.tokens = this.tokens.concat(origin.tokens);\n this.origin = origin.origin;\n }\n else {\n this.origin = origin;\n this.stack = origin.stack;\n }\n }\n }\n const originMessage = this.origin ? \"\\nOrigin: \" + this.origin.message : \"\";\n const tokensMessage = this.tokens.map((token) => nameOf(token)).join(\" > \");\n this.message = `Injection failed on ${tokensMessage}${originMessage}`;\n }\n static throwInjectorError(token, currentDependency, error) {\n if (currentDependency && isClass(token)) {\n error.message = printDependencyInjectionError(token, { ...currentDependency, message: error.message });\n }\n throw new InjectionError(token, error);\n }\n}\nfunction printDependencyInjectionError(token, options) {\n let erroredArg = \"\";\n const args = getConstructorArgNames(token)\n .map((arg, index) => {\n if (options.index === index) {\n erroredArg = arg;\n arg = colors.red(arg);\n }\n return `${arg}: ${nameOf(options.deps[index])}`;\n })\n .join(\", \");\n const signature = nameOf(token) + \"->constructor(\" + args + \")\";\n const indexOf = signature.indexOf(erroredArg) - 5;\n const drawline = (indexOf) => \" \".repeat(indexOf) + colors.red(\"^\" + \"‾\".repeat(erroredArg.length - 1));\n return \"Unable to inject dependency. \" + options.message + \"\\n\\n\" + signature + \"\\n\" + (indexOf > -1 ? drawline(indexOf) : \"\");\n}\n","import { Container } from \"../domain/Container.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nexport function createContainer(rootModule) {\n const container = new Container(GlobalProviders.entries());\n if (rootModule) {\n container.delete(rootModule);\n }\n return container;\n}\n","import { Metadata } from \"@tsed/core\";\nexport function getConstructorDependencies(target, propertyKey) {\n return Metadata.getOwn(\"override:ctor:design:paramtypes\", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)] || [];\n}\nexport function setConstructorDependencies(target, deps) {\n Metadata.set(\"override:ctor:design:paramtypes\", deps, target);\n}\n","import { getValue, setValue } from \"@tsed/core\";\nexport const CONFIGURATION = Symbol.for(\"CONFIGURATION\");\nexport class DIConfiguration {\n constructor(initialProps = {}) {\n this.default = new Map();\n this.map = new Map();\n Object.entries({\n imports: [],\n routes: [],\n logger: {},\n ...initialProps\n }).forEach(([key, value]) => {\n this.default.set(key, value);\n });\n }\n get version() {\n return this.get(\"version\");\n }\n set version(v) {\n this.map.set(\"version\", v);\n }\n get rootDir() {\n return this.get(\"rootDir\");\n }\n set rootDir(value) {\n this.map.set(\"rootDir\", value);\n }\n get env() {\n return this.map.get(\"env\");\n }\n set env(value) {\n this.map.set(\"env\", value);\n }\n get imports() {\n return this.get(\"imports\");\n }\n set imports(imports) {\n this.map.set(\"imports\", imports);\n }\n get routes() {\n return this.get(\"routes\");\n }\n set routes(routes) {\n this.map.set(\"routes\", routes);\n }\n get logger() {\n return this.get(\"logger\");\n }\n set logger(value) {\n const logger = { ...this.logger, ...value };\n this.map.set(\"logger\", logger);\n }\n get debug() {\n return this.logger.level === \"debug\";\n }\n set debug(debug) {\n this.logger = { ...this.logger, level: debug ? \"debug\" : \"info\" };\n }\n /**\n *\n * @param callbackfn\n * @param thisArg\n */\n forEach(callbackfn, thisArg) {\n return new Set([...Array.from(this.default.keys()), ...Array.from(this.map.keys())]).forEach((key) => {\n callbackfn(this.getRaw(key), key, this.map);\n }, thisArg);\n }\n /**\n *\n * @param propertyKey\n * @param value\n */\n set(propertyKey, value) {\n if (typeof propertyKey === \"string\") {\n if (Reflect.has(this, propertyKey)) {\n // @ts-ignore\n this[propertyKey] = value;\n }\n else {\n this.setRaw(propertyKey, value);\n }\n }\n else {\n Object.entries(propertyKey).forEach(([key, value]) => {\n this.set(key, value);\n });\n }\n return this;\n }\n setRaw(propertyKey, value) {\n setValue(this.map, propertyKey, value);\n return this;\n }\n /**\n *\n * @param propertyKey\n * @param defaultValue\n * @returns {undefined|any}\n */\n get(propertyKey, defaultValue) {\n return this.getRaw(propertyKey, defaultValue);\n }\n getRaw(propertyKey, defaultValue) {\n const value = getValue(this.map, propertyKey);\n if (value !== undefined) {\n return value;\n }\n return getValue(this.default, propertyKey, defaultValue);\n }\n}\n","import { classOf, deepClone, deepMerge, isArray, isClass, isFunction, isInheritedFrom, isObject, isPromise, nameOf } from \"@tsed/core\";\nimport { $alter, $asyncAlter, $asyncEmit, $emit, $off, $on } from \"@tsed/hooks\";\nimport { DI_INVOKE_OPTIONS, DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { Container } from \"../domain/Container.js\";\nimport { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { Provider } from \"../domain/Provider.js\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { InjectionError } from \"../errors/InjectionError.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nimport { createContainer } from \"../utils/createContainer.js\";\nimport { getConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nimport { DIConfiguration } from \"./DIConfiguration.js\";\nconst EXCLUDED_CONFIGURATION_KEYS = [\"mount\", \"imports\"];\n/**\n * This service contain all services collected by `@Service` or services declared manually with `InjectorService.factory()` or `InjectorService.service()`.\n *\n * ### Example:\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n *\n * // Import the services (all services are decorated with @Service()\";\n * import MyService1 from \"./services/service1.js\";\n * import MyService2 from \"./services/service2.js\";\n * import MyService3 from \"./services/service3.js\";\n *\n * // When all services are imported, you can load InjectorService.\n *\n * await injector().load();\n *\n * const myService1 = injector.get<MyService1>(MyService1);\n * ```\n */\nexport class InjectorService extends Container {\n #cache;\n #loaded;\n constructor() {\n super();\n this.logger = console;\n this.resolvedConfiguration = false;\n this.#cache = new LocalsContainer();\n this.#loaded = false;\n this.#cache.set(InjectorService, this);\n this.#cache.set(DIConfiguration, new DIConfiguration());\n }\n get settings() {\n return this.#cache.get(DIConfiguration);\n }\n set settings(settings) {\n this.#cache.set(DIConfiguration, settings);\n }\n isLoaded() {\n return this.#loaded;\n }\n /**\n * Return a list of instance build by the injector.\n */\n toArray() {\n return [...this.#cache.values()];\n }\n /**\n * Get a service or factory already constructed from his symbol or class.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.get<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The class or symbol registered in InjectorService.\n * @param options\n */\n get(token, options) {\n if (!this.has(token)) {\n return this.resolve(token, options);\n }\n return this.#cache.get(token);\n }\n /**\n * Return all instance of the same provider type\n */\n getMany(type, options) {\n return this.getProviders(type).map((provider) => {\n return this.resolve(provider.token, options);\n });\n }\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n */\n has(token) {\n return this.#cache.get(token) !== undefined;\n }\n /**\n * Declare an alias for a given token.\n */\n alias(token, alias) {\n this.#cache.set(alias, this.#cache.get(token));\n return this;\n }\n /**\n * Resolve the token depending on his provider configuration.\n *\n * If the token isn't cached, the injector will invoke the provider and cache the result.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.invoke<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The injectable class to invoke. Class parameters are injected according constructor signature.\n * @param options {InvokeOptions} Optional options to invoke the class.\n * @returns {Type} The class constructed.\n */\n resolve(token, options = {}) {\n let instance = options.locals ? options.locals.get(token) : undefined;\n if (instance !== undefined) {\n return instance;\n }\n if (token === DI_USE_PARAM_OPTIONS) {\n return options.useOpts;\n }\n instance = !options.rebuild ? this.#cache.get(token) : undefined;\n if (instance != undefined) {\n return instance;\n }\n const provider = this.ensureProvider(token);\n // maybe not necessary\n if (!provider || options.rebuild) {\n instance = this.invokeToken(token, options);\n if (provider) {\n return this.setToCache(provider, instance);\n }\n return instance;\n }\n instance = this.invokeToken(token, options);\n switch (provider.scope) {\n case ProviderScope.SINGLETON:\n if (!options.rebuild) {\n this.registerHooks(provider, options);\n }\n return this.setToCache(provider, instance);\n case ProviderScope.REQUEST:\n if (options.locals) {\n options.locals.set(provider.token, instance);\n this.registerHooks(provider, options);\n }\n return instance;\n }\n return instance;\n }\n /**\n * Resolve the token depending on his provider configuration.\n *\n * If the token isn't cached, the injector will invoke the provider and cache the result.\n *\n * #### Example\n *\n * ```typescript\n * import {InjectorService} from \"@tsed/di\";\n * import MyService from \"./services.js\";\n *\n * class OtherService {\n * constructor(injectorService: InjectorService) {\n * const myService = injectorService.invoke<MyService>(MyService);\n * }\n * }\n * ```\n *\n * @param token The injectable class to invoke. Class parameters are injected according constructor signature.\n * @param options {InvokeOptions} Optional options to invoke the class.\n * @returns {Type} The class constructed.\n * @alias InjectorService.resolve\n */\n invoke(token, options = {}) {\n return this.resolve(token, options);\n }\n /**\n * Build only providers which are asynchronous.\n */\n async loadAsync() {\n for (const [, provider] of this) {\n if (!this.has(provider.token) && provider.isAsync()) {\n await this.resolve(provider.token);\n }\n }\n }\n /**\n * Build only providers which are synchronous.\n */\n loadSync() {\n for (const [, provider] of this) {\n // TODO try to lazy provider instead initiate all providers (&& provider.hasRegisteredHooks())\n if (!this.has(provider.token) && provider.scope === ProviderScope.SINGLETON) {\n this.resolve(provider.token);\n }\n }\n }\n /**\n * Build all providers from given container (or GlobalProviders) and emit `$onInit` event.\n *\n * @param container\n */\n async load(container = createContainer()) {\n // avoid provider registration in the GlobalContainer during the loading phase\n // using injectable() or providerBuilder()\n this.#loaded = true;\n await $asyncEmit(\"$beforeInit\");\n this.bootstrap(container);\n // build async and sync provider\n await this.loadAsync();\n // load sync provider\n this.loadSync();\n await $asyncEmit(\"$onInit\");\n }\n /**\n * Load all configurations registered on providers via @Configuration decorator.\n * It inspects for each provider some fields like imports, mount, etc. to resolve the configuration.\n */\n resolveConfiguration() {\n if (this.resolvedConfiguration) {\n return;\n }\n const mergedConfiguration = new Map();\n super.forEach((provider) => {\n if (provider.configuration && provider.type !== \"server:module\") {\n Object.entries(provider.configuration).forEach(([key, value]) => {\n if (!EXCLUDED_CONFIGURATION_KEYS.includes(key)) {\n value = mergedConfiguration.has(key) ? deepMerge(mergedConfiguration.get(key), value) : deepClone(value);\n mergedConfiguration.set(key, value);\n }\n });\n }\n });\n mergedConfiguration.forEach((value, key) => {\n this.settings.set(key, deepMerge(value, this.settings.get(key)));\n });\n this.resolvedConfiguration = true;\n }\n /**\n * Emit an event to all service. See service [lifecycle hooks](/docs/hooks.md#lifecycle-hooks).\n * @param eventName The event name to emit at all services.\n * @param args List of the parameters to give to each service.\n * @returns A list of promises.\n * @deprecated use $asyncEmit instead\n */\n emit(eventName, ...args) {\n return $asyncEmit(eventName, args);\n }\n /**\n * Alter value attached to an event.\n * @param eventName\n * @param value\n * @param args\n * @deprecated use $alter instead\n */\n alter(eventName, value, ...args) {\n return $alter(eventName, value, args);\n }\n /**\n * Alter value attached to an event asynchronously.\n * @param eventName\n * @param value\n * @param args\n * @deprecated use $asyncAlter instead\n */\n alterAsync(eventName, value, ...args) {\n return $asyncAlter(eventName, value, args);\n }\n /**\n * Destroy the injector and all services.\n */\n async destroy() {\n await $asyncEmit(\"$onDestroy\");\n this.#cache.forEach((_, token) => {\n $off(token);\n });\n }\n /**\n * Bootstrap injector from container, resolve configuration and providers.\n *\n * @param container\n */\n bootstrap(container = createContainer()) {\n // Clone all providers in the container\n this.addProviders(container);\n // Resolve all configuration\n this.resolveConfiguration();\n // allow mocking or changing provider instance before loading injector\n this.resolveImportsProviders();\n return this;\n }\n ensureProvider(token, force = false) {\n if (!this.hasProvider(token) && (GlobalProviders.has(token) || force)) {\n this.addProvider(token);\n }\n return this.getProvider(token);\n }\n /**\n * Invoke a class method and inject service.\n *\n * #### IInjectableMethod options\n *\n * * **target**: Optional. The class instance.\n * * **methodName**: `string` Optional. The method name.\n * * **designParamTypes**: `any[]` Optional. List of injectable types.\n * * **locals**: `Map<Function, any>` Optional. If preset then any argument Class are read from this object first, before the `InjectorService` is consulted.\n *\n * #### Example\n *\n * @param target\n * @param options\n * @private\n */\n invokeToken(target, options = {}) {\n const resolvedOpts = this.mapInvokeOptions(target, options);\n if (!resolvedOpts) {\n return undefined;\n }\n const { token, deps, construct, imports, provider } = resolvedOpts;\n $emit(\"$beforeInvoke\", token, [resolvedOpts]);\n $emit(`$beforeInvoke:${String(provider.type)}`, [resolvedOpts]);\n let instance;\n let currentDependency = false;\n try {\n const invokeDependency = (parent) => (token, index) => {\n currentDependency = { token, index, deps };\n if (isArray(token)) {\n return this.getMany(token[0], options);\n }\n return isInheritedFrom(token, Provider, 1)\n ? provider\n : this.resolve(token, {\n parent,\n locals: options.locals,\n useOpts: provider?.getArgOpts(index) || options.useOpts\n });\n };\n // Invoke manually imported providers\n imports.forEach(invokeDependency());\n // Inject dependencies\n const services = deps.map(invokeDependency(token));\n currentDependency = false;\n instance = construct(services);\n }\n catch (error) {\n InjectionError.throwInjectorError(token, currentDependency, error);\n }\n if (instance === undefined) {\n throw new InjectionError(token, `Unable to create new instance from undefined value. Check your provider declaration for ${nameOf(token)}`);\n }\n if (instance && isClass(classOf(instance))) {\n Reflect.defineProperty(instance, DI_INVOKE_OPTIONS, {\n get: () => ({ rebuild: options.rebuild, locals: options.locals })\n });\n }\n $emit(\"$afterInvoke\", token, [instance, resolvedOpts]);\n return instance;\n }\n resolveImportsProviders() {\n this.settings.imports = this.settings.imports\n ?.filter((meta) => isObject(meta) && \"token\" in meta && meta.token !== InjectorService)\n .map((meta) => {\n if (isObject(meta) && \"token\" in meta) {\n const { token, ...props } = meta;\n const provider = this.ensureProvider(token, true);\n if (provider) {\n provider.useValue = undefined;\n provider.useAsyncFactory = undefined;\n provider.useFactory = undefined;\n if (\"useClass\" in props) {\n provider.useClass = props.useClass;\n return;\n }\n if (\"useFactory\" in props) {\n provider.useFactory = props.useFactory;\n return;\n }\n if (\"useAsyncFactory\" in props) {\n provider.useAsyncFactory = props.useAsyncFactory;\n return;\n }\n if (\"use\" in props) {\n provider.useValue = props.use;\n return;\n }\n }\n }\n return meta;\n })\n .filter(Boolean);\n }\n /**\n * Create options to invoke a provider or class.\n * @param token\n * @param options\n */\n mapInvokeOptions(token, options) {\n const locals = options.locals || new LocalsContainer();\n options.locals = locals;\n let imports = options.imports;\n let deps = options.deps;\n let construct;\n if (!token || token === Object) {\n throw new Error(\"Given token is undefined. Could mean a circular dependency problem. Try to use @Inject(() => Token) to solve it.\");\n }\n let provider;\n if (!this.hasProvider(token)) {\n provider = new Provider(token);\n }\n else {\n provider = this.getProvider(token);\n }\n deps = deps || provider.deps;\n imports = imports || provider.imports;\n if (provider.useValue !== undefined) {\n construct = () => (isFunction(provider.useValue) ? provider.useValue() : provider.useValue);\n }\n else if (provider.useFactory) {\n construct = (deps) => provider.useFactory(...deps);\n }\n else if (provider.useAsyncFactory) {\n construct = async (deps) => {\n deps = await Promise.all(deps);\n return provider.useAsyncFactory(...deps);\n };\n }\n else if (provider.useClass) {\n // useClass\n deps = deps || getConstructorDependencies(provider.useClass);\n construct = (deps) => new provider.useClass(...deps);\n }\n else {\n return false;\n }\n return {\n token,\n deps: deps || [],\n imports: imports || [],\n construct,\n provider,\n locals\n };\n }\n registerHooks(provider, options) {\n if (provider.hooks) {\n if (provider.scope === ProviderScope.REQUEST) {\n if (options.locals && provider.hooks?.$onDestroy) {\n const { locals } = options;\n options.locals.hooks.on(\"$onDestroy\", (...args) => {\n return provider.hooks?.$onDestroy?.(locals.get(provider.token), ...args);\n });\n }\n return;\n }\n Object.entries(provider.hooks).forEach(([event, cb]) => {\n const callback = (...args) => {\n return cb(this.#cache.get(provider.token), ...args);\n };\n $on(event, provider.token, callback);\n });\n }\n }\n setToCache(provider, instance) {\n const set = (instance) => {\n this.#cache.set(provider.token, instance);\n provider?.alias && this.alias(provider.token, provider.alias);\n };\n if (\"isAsync\" in provider && !provider.isAsync() && !isPromise(instance)) {\n set(instance);\n return instance;\n }\n // store promise to lock token in cache\n set(instance);\n instance = instance.then((instance) => {\n set(instance);\n return instance;\n });\n return instance;\n }\n}\n","import { InjectorService } from \"../services/InjectorService.js\";\nlet globalInjector = new InjectorService();\n/**\n * Return the existing injector service.\n *\n * Example:\n *\n * ```typescript\n * import {injector, Injectable} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyService {\n * injector = injector();\n * }\n * ```\n */\nexport function injector() {\n return globalInjector;\n}\nexport async function destroyInjector() {\n await globalInjector.destroy();\n globalInjector = new InjectorService();\n}\n","import { isArray } from \"@tsed/core\";\nimport { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { getConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nfunction resolveAutoInjectableArgs(token, args) {\n const inj = injector();\n const locals = new LocalsContainer();\n const deps = getConstructorDependencies(token);\n const list = [];\n const length = Math.max(deps.length, args.length);\n for (let i = 0; i < length; i++) {\n if (args[i] !== undefined) {\n list.push(args[i]);\n }\n else {\n const value = deps[i];\n const instance = isArray(value) ? inj.getMany(value[0], { locals, parent: token }) : inj.invoke(value, { locals, parent: token });\n list.push(instance);\n }\n }\n return list;\n}\n/**\n * AutoInjectable decorator is used to automatically inject dependencies in the constructor.\n *\n * @example\n * ```typescript\n * @AutoInjectable()\n * class UserService {\n * constructor(\n * private database: Database, // automatically injected\n * customConfig?: Config // can be passed manually\n * ) {}\n * }\n * ```\n *\n * @description\n * When applied to a class, this decorator:\n * - Automatically resolves and injects dependencies based on constructor parameter types\n * - Preserves the ability to manually pass arguments which override automatic injection\n *\n * @decorator\n * @returns {ClassDecorator} A class decorator that enables automatic dependency injection\n */\nexport function AutoInjectable() {\n return (constr) => {\n return class AutoInjectable extends constr {\n constructor(...args) {\n super(...resolveAutoInjectableArgs(constr, args));\n }\n };\n };\n}\n","import { Store } from \"@tsed/core\";\nimport { injector } from \"./injector.js\";\nexport function configuration(token, configuration) {\n if (token) {\n const store = Store.from(token);\n if (configuration) {\n store.set(\"configuration\", configuration);\n }\n return store.get(\"configuration\", configuration);\n }\n return injector().settings;\n}\n","import { Provider } from \"./Provider.js\";\nimport { ProviderType } from \"./ProviderType.js\";\nexport class ControllerProvider extends Provider {\n constructor(token, options = {}) {\n super(token, options);\n this.type = ProviderType.CONTROLLER;\n }\n /**\n *\n * @returns {any[]}\n */\n get middlewares() {\n return Object.assign({\n use: [],\n useAfter: [],\n useBefore: []\n }, this.store.get(\"middlewares\", {}));\n }\n /**\n *\n * @param middlewares\n */\n set middlewares(middlewares) {\n const mdlwrs = this.middlewares;\n const concat = (key, a, b) => (a[key] = a[key].concat(b[key]));\n Object.keys(middlewares).forEach((key) => {\n concat(key, mdlwrs, middlewares);\n });\n this.store.set(\"middlewares\", mdlwrs);\n }\n}\n","import { ControllerProvider } from \"../domain/ControllerProvider.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { injectable } from \"../fn/injectable.js\";\nimport { GlobalProviders } from \"./GlobalProviders.js\";\nGlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider);\n/**\n * Register a provider configuration.\n * @deprecated Since v8. Use injectable() function instead.\n */\nexport function registerProvider({ token, provide, ...opts }) {\n return injectable(token || provide, {\n ...opts,\n token: token || provide\n }).inspect();\n}\n","import \"../registries/ProviderRegistry.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { GlobalProviders } from \"../registries/GlobalProviders.js\";\nexport function providerBuilder(props, baseOpts = {}) {\n return (token, options = {}) => {\n const merged = {\n global: !injector().isLoaded(),\n ...options,\n ...baseOpts,\n token\n };\n const provider = GlobalProviders.merge(token, merged);\n if (!merged.global) {\n injector().setProvider(token, provider);\n }\n return props.reduce((acc, prop) => {\n return {\n ...acc,\n [prop]: function (value) {\n provider[prop] = value;\n return this;\n }\n };\n }, {\n factory(factory) {\n provider.useFactory = factory;\n return this;\n },\n asyncFactory(asyncFactory) {\n provider.useAsyncFactory = asyncFactory;\n return this;\n },\n value(value) {\n provider.useValue = value;\n provider.type = ProviderType.VALUE;\n return this;\n },\n class(k) {\n provider.useClass = k;\n return this;\n },\n store() {\n return provider.store;\n },\n inspect() {\n return provider;\n },\n token() {\n return provider.token;\n }\n });\n };\n}\n","import { ProviderType } from \"../domain/ProviderType.js\";\nimport { providerBuilder } from \"../utils/providerBuilder.js\";\nconst Props = [\"type\", \"scope\", \"path\", \"alias\", \"hooks\", \"deps\", \"imports\", \"configuration\", \"priority\"];\nexport const injectable = providerBuilder(Props);\nexport const interceptor = providerBuilder(Props, {\n type: ProviderType.INTERCEPTOR\n});\nexport const controller = providerBuilder([...Props, \"middlewares\"], {\n type: ProviderType.CONTROLLER\n});\n","import { classOf, nameOf } from \"@tsed/core\";\nexport class InvalidPropertyTokenError extends Error {\n constructor(target, propertyKey) {\n super(`Object isn't a valid token. Please check the token set on ${nameOf(classOf(target))}.${propertyKey}.\\n- Check that it is not a circular reference.\\n- Check that the token (class or symbol) exists`);\n this.name = \"INVALID_TOKEN_ERROR\";\n }\n}\n","import { LocalsContainer } from \"../domain/LocalsContainer.js\";\nimport { InjectorService } from \"../services/InjectorService.js\";\nimport { injector } from \"./injector.js\";\nlet globalLocals;\nlet globalInvOpts = {};\nconst stagedLocals = [];\n/**\n * Get the locals container initiated by DITest or .bootstrap() method.\n */\nexport function localsContainer({ providers, rebuild } = {}) {\n if (!globalLocals || providers) {\n globalLocals = new LocalsContainer();\n if (providers) {\n providers.forEach((p) => {\n globalLocals.set(p.token, p.use);\n });\n globalLocals.set(InjectorService, injector());\n }\n if (rebuild) {\n globalInvOpts.rebuild = rebuild;\n }\n }\n return globalLocals;\n}\nexport function invokeOptions() {\n return { ...globalInvOpts };\n}\n/**\n * Reset the locals container.\n */\nexport function detachLocalsContainer() {\n globalLocals && stagedLocals.push(globalLocals);\n globalLocals = undefined;\n globalInvOpts = {};\n}\nexport function cleanAllLocalsContainer() {\n detachLocalsContainer();\n stagedLocals.map((item) => item.clear());\n}\n","import { injector } from \"./injector.js\";\nimport { invokeOptions, localsContainer } from \"./localsContainer.js\";\n/**\n * Inject a provider to another provider.\n *\n * Use this function to inject a custom provider on constructor parameter or property.\n *\n * ```typescript\n * @Injectable()\n * export class MyService {\n * connection = inject(CONNECTION);\n * }\n * ```\n *\n * @param token A token provider or token provider group\n * @param opts\n * @returns {Function}\n * @decorator\n */\nexport function inject(token, opts) {\n return injector().resolve(token, {\n ...opts,\n ...invokeOptions(),\n locals: opts?.locals || localsContainer()\n });\n}\n","import { injector } from \"./injector.js\";\nimport { localsContainer } from \"./localsContainer.js\";\n/**\n * Injects multiple instances of a given token using the injector service.\n * @param token - The injection token to resolve\n * @param opts - Optional configuration for the injection\n * @param opts.useOpts - Options for instance creation\n * @param opts.rebuild - Whether to rebuild the instance\n * @param opts.locals - Local container overrides\n * @returns Array of resolved instances\n */\nexport function injectMany(token, opts) {\n return injector().getMany(token, { ...opts, locals: opts?.locals || localsContainer() });\n}\n","import { catchError, decoratorTypeOf, DecoratorTypes, isPromise, Metadata, Store } from \"@tsed/core\";\nimport { DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS, DI_USE_OPTIONS } from \"../constants/constants.js\";\nimport { InvalidPropertyTokenError } from \"../errors/InvalidPropertyTokenError.js\";\nimport { inject } from \"../fn/inject.js\";\nimport { injectMany } from \"../fn/injectMany.js\";\nimport { getConstructorDependencies, setConstructorDependencies } from \"../utils/getConstructorDependencies.js\";\nfunction setToken(token, { target, propertyKey, parameterIndex }) {\n const paramTypes = getConstructorDependencies(target, propertyKey);\n const type = paramTypes[parameterIndex];\n paramTypes[parameterIndex] = type === Array ? [token] : token;\n Metadata.setParamTypes(target, propertyKey, paramTypes);\n setConstructorDependencies(target, paramTypes);\n}\nfunction getTokenType(token, target, propertyKey) {\n const useType = token || Metadata.getType(target, propertyKey);\n if (useType === Object) {\n throw new InvalidPropertyTokenError(target, String(propertyKey));\n }\n return useType;\n}\nfunction bindInjectableProperty(target, propertyKey, { token, transform = (o) => o, useOpts }) {\n const symbol = Symbol();\n if (!target[DI_INJECTABLE_PROPS]) {\n Reflect.defineProperty(target, DI_INJECTABLE_PROPS, {\n value: new Set(),\n enumerable: false,\n configurable: false\n });\n }\n target[DI_INJECTABLE_PROPS].add(propertyKey);\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n get() {\n const useType = getTokenType(token, target, propertyKey);\n const originalType = Metadata.getType(target, propertyKey);\n const invokeOpts = {\n rebuild: !!this[DI_INVOKE_OPTIONS]?.rebuild,\n locals: this[DI_INVOKE_OPTIONS]?.locals,\n useOpts: useOpts || Store.from(target, propertyKey).get(DI_USE_OPTIONS)\n };\n if (this[symbol] === undefined) {\n this[symbol] = originalType === Array ? injectMany(token, invokeOpts) : inject(useType, invokeOpts);\n }\n [].concat(this[symbol]).forEach((instance, index) => {\n if (isPromise(this[symbol])) {\n instance.then((result) => {\n this[symbol][index] = result;\n if (originalType !== Array) {\n this[symbol] = result;\n }\n });\n }\n });\n return transform(this[symbol], { self: this, target, propertyKey });\n }\n });\n}\nexport function Inject(token, opts = {}) {\n opts = typeof opts === \"function\" ? { transform: opts } : opts;\n return (target, propertyKey, index) => {\n const bindingType = decoratorTypeOf([target, propertyKey, index]);\n switch (bindingType) {\n case DecoratorTypes.PARAM_CTOR:\n if (token) {\n setToken(token, { target, propertyKey, parameterIndex: index });\n }\n break;\n case DecoratorTypes.PROP:\n bindInjectableProperty(target, propertyKey, { ...opts, token });\n }\n };\n}\n","import { decoratorTypeOf, DecoratorTypes } from \"@tsed/core\";\nimport { configuration } from \"../fn/configuration.js\";\nimport { injectable } from \"../fn/injectable.js\";\nimport { injector } from \"../fn/injector.js\";\nimport { DIConfiguration } from \"../services/DIConfiguration.js\";\nimport { Inject } from \"./inject.js\";\nexport function Configuration(settings = {}) {\n return (...args) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.CLASS:\n configuration(args[0], settings);\n break;\n default:\n case DecoratorTypes.PARAM_CTOR:\n return Inject(DIConfiguration)(args[0], args[1], args[2]);\n }\n };\n}\n// To maintain compatibility with the previous implementation, we need to declare Configuration as\n// injectable token.\ninjectable(Configuration).factory(() => injector().settings);\n","import { injector } from \"./injector.js\";\nexport function constant(expression, defaultValue) {\n return injector().settings.get(expression, defaultValue);\n}\n","import { catchError, deepClone } from \"@tsed/core\";\nimport { constant } from \"../fn/constant.js\";\nexport function bindConstant(target, propertyKey, expression, defaultValue) {\n const symbol = Symbol();\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n get() {\n if (this[symbol] !== undefined) {\n return this[symbol];\n }\n const value = constant(expression, defaultValue);\n this[symbol] = Object.freeze(deepClone(value));\n return this[symbol];\n },\n set(value) {\n const bean = constant(expression, defaultValue) || this[symbol];\n if (bean === undefined && value !== undefined) {\n this[symbol] = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n}\n/**\n * Return value from Configuration.\n *\n * ## Example\n *\n * ```typescript\n * import {Env} from \"@tsed/core\";\n * import {Constant, Value} from \"@tsed/di\";\n *\n * export class MyClass {\n *\n * @Constant(\"env\")\n * env: Env;\n *\n * @Value(\"swagger.path\")\n * swaggerPath: string;\n *\n * @Value(\"swagger.path\", \"defaultValue\")\n * swaggerPath: string;\n *\n * constructor() {\n * console.log(this.swaggerPath) // undefined. Not available on constructor\n * }\n *\n * $onInit() {\n * console.log(this.swaggerPath) // something\n * }\n * }\n * ```\n *\n * @param {string} expression\n * @param defaultValue\n * @returns {(targetClass: any, attributeName: string) => any}\n * @decorator\n */\nexport function Constant(expression, defaultValue) {\n return (target, propertyKey) => {\n return bindConstant(target, propertyKey, expression, defaultValue);\n };\n}\n","export var InjectablePropertyType;\n(function (InjectablePropertyType) {\n InjectablePropertyType[\"METHOD\"] = \"method\";\n InjectablePropertyType[\"PROPERTY\"] = \"property\";\n InjectablePropertyType[\"CONSTANT\"] = \"constant\";\n InjectablePropertyType[\"VALUE\"] = \"value\";\n InjectablePropertyType[\"INTERCEPTOR\"] = \"interceptor\";\n})(InjectablePropertyType || (InjectablePropertyType = {}));\n","import { isArrayOrArrayClass, useDecorators } from \"@tsed/core\";\nimport { Children, Path } from \"@tsed/schema\";\nimport { controller } from \"../fn/injectable.js\";\nfunction mapOptions(options) {\n if (typeof options === \"string\" || options instanceof RegExp || isArrayOrArrayClass(options)) {\n return {\n path: options\n };\n }\n return options;\n}\n/**\n * Declare a new controller with his Rest path. His methods annotated will be collected to build the routing list.\n * This routing listing will be built with the `express.Router` object.\n *\n * ::: tip\n * See [Controllers](/docs/controllers.md) section for more details\n * :::\n *\n * ```typescript\n * @Controller(\"/calendars\")\n * export class CalendarCtrl {\n *\n * @Get(\"/:id\")\n * public get(\n * @Req() request: Req,\n * @Res() response: Res,\n * @Next() next: Next\n * ): void {\n *\n * }\n * }\n * ```\n *\n * @param options\n * @controller\n * @decorator\n * @classDecorator\n */\nexport function Controller(options) {\n const { children = [], path, ...opts } = mapOptions(options);\n return useDecorators((target) => {\n controller(target, opts);\n }, path && Path(path), Children(...children));\n}\n","import { injectable } from \"../fn/injectable.js\";\n/**\n * The decorators `@Injectable()` declare a new service can be injected in other service, controller, interceptor, etc.. on there `constructor`.\n * All classes annotated with `@Injectable()` are built one time, excepted if you change the default provider configuration.\n *\n * ::: tip\n * `@Injectable()` use the `reflect-metadata` to collect and inject the built provided to other services.\n * :::\n *\n * ### Options\n *\n * - type (@@ProviderType@@ or `string`): Kind of provider. (Default: `ProviderType.PROVIDER`)\n * - scope (@@ProviderScope@@): Kind of provider. (Default: `ProviderScope.SINGLETON`)\n * - token (@@TokenProvider@@): An injection token (Note: This option override default metadata generated by Typescript).\n * - deps (`Type<any>`): List of class or provider which will be injected to the constructor (Note: This options override default metadata generated by Typescript).\n *\n * @returns {Function}\n * @decorator\n */\nexport function Injectable(options = {}) {\n return (target) => {\n const opts = {\n ...options,\n ...(options.token ? { useClass: target } : { token: target })\n };\n injectable(opts.token, opts);\n };\n}\n","import { classOf, decorateMethodsOf, decoratorTypeOf, DecoratorTypes, Store } from \"@tsed/core\";\nimport { DI_INTERCEPTOR_OPTIONS, DI_INVOKE_OPTIONS } from \"../constants/constants.js\";\nimport { inject } from \"../fn/inject.js\";\nexport function getInterceptorOptions(target, propertyKey) {\n return Store.fromMethod(target, propertyKey).get(DI_INTERCEPTOR_OPTIONS);\n}\nexport function bindIntercept(target, propertyKey, token, options) {\n const klass = classOf(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(klass.prototype, propertyKey);\n const originalMethod = descriptor.value;\n const symbol = Symbol();\n Store.fromMethod(klass, propertyKey).set(DI_INTERCEPTOR_OPTIONS, options);\n function newMethod(...args) {\n const next = (err) => {\n if (!err) {\n return originalMethod.apply(this, args);\n }\n throw err;\n };\n const context = {\n target: klass,\n propertyKey,\n args,\n options,\n next\n };\n const invokeOpts = {\n rebuild: !!this[DI_INVOKE_OPTIONS]?.rebuild,\n locals: this[DI_INVOKE_OPTIONS]?.locals\n };\n this[symbol] = this[symbol] || inject(token, invokeOpts);\n return this[symbol].intercept({\n ...context,\n options\n }, next);\n }\n descriptor.value = newMethod;\n Reflect.deleteProperty(klass.prototype, propertyKey);\n Reflect.defineProperty(klass.prototype, propertyKey, descriptor);\n return descriptor;\n}\n/**\n * Attaches interceptor to method call and executes the before and after methods\n *\n * @param interceptor\n * @param options\n * @decorator\n */\nexport function Intercept(interceptor, options) {\n return (...args) => {\n const [target, propertyKey] = args;\n const type = decoratorTypeOf(args);\n switch (type) {\n case DecoratorTypes.CLASS:\n decorateMethodsOf(target, Intercept(interceptor, options));\n break;\n case DecoratorTypes.METHOD:\n return bindIntercept(target, propertyKey, interceptor, options);\n }\n };\n}\n","import { ProviderType } from \"../domain/ProviderType.js\";\nimport { Injectable } from \"./injectable.js\";\n/**\n * The decorators `@Interceptor()` declare a new service can be injected in other service or controller on there `constructor`.\n * All services annotated with `@Interceptor()` are constructed one time.\n *\n * > `@Service()` use the `reflect-metadata` to collect and inject service on controllers or other services.\n *\n * @returns {Function}\n * @decorator\n */\nexport function Interceptor() {\n return Injectable({\n type: ProviderType.INTERCEPTOR\n });\n}\n","import { isFunction } from \"@tsed/core\";\nimport { inject } from \"./inject.js\";\nimport { injector } from \"./injector.js\";\n/**\n * Lazy load a provider from his package and invoke only when the provider is used.\n */\nexport async function lazyInject(factory) {\n const { default: token } = await factory();\n if (!injector().has(token)) {\n const instance = await inject(token);\n const instanceWithHook = instance;\n if (\"$onInit\" in instanceWithHook && isFunction(instanceWithHook.$onInit)) {\n await instanceWithHook.$onInit();\n }\n }\n return injector().get(token);\n}\nexport async function optionalLazyInject(factory) {\n try {\n return await lazyInject(factory);\n }\n catch (er) {\n return undefined;\n }\n}\n","import { catchError, isFunction } from \"@tsed/core\";\nimport { lazyInject, optionalLazyInject } from \"../fn/lazyInject.js\";\nfunction mapOptions(args, optional = false) {\n function wrap(key, resolver) {\n return async () => {\n try {\n const { [key]: token } = await resolver();\n return { default: token };\n }\n catch (er) {\n if (!optional) {\n throw er;\n }\n return;\n }\n };\n }\n if (isFunction(args[0])) {\n return wrap(\"default\", args[0]);\n }\n return wrap(args[0], args[1]);\n}\nexport function LazyInject(...args) {\n let resolver = mapOptions(args);\n return (target, propertyKey) => {\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n async get() {\n return lazyInject(resolver);\n }\n });\n };\n}\nexport function OptionalLazyInject(...args) {\n const resolver = mapOptions(args, true);\n return (target, propertyKey) => {\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n Reflect.defineProperty(target, propertyKey, {\n async get() {\n return optionalLazyInject(resolver);\n }\n });\n };\n}\n","import { useDecorators } from \"@tsed/core\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { ProviderType } from \"../domain/ProviderType.js\";\nimport { Configuration } from \"./configuration.js\";\nimport { Injectable } from \"./injectable.js\";\n/**\n * Declare a new Ts.ED module\n *\n * ## Options\n * - imports: List of Provider which must be built by injector before invoking the module\n * - deps: List of provider must be injected to the module constructor (explicit declaration)\n *\n * @param options\n * @decorator\n */\nexport function Module(options = {}) {\n const { scopes, imports, deps, scope, ...configuration } = options;\n return useDecorators(Configuration(configuration), Injectable({\n type: ProviderType.MODULE,\n scope: ProviderScope.SINGLETON,\n imports,\n deps,\n injectable: false\n }));\n}\n","import { StoreSet } from \"@tsed/core\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\n/**\n *\n * @param {\"request\" | \"singleton\" | ProviderScope} scope\n * @returns {Function}\n * @constructor\n */\nexport function Scope(scope = ProviderScope.REQUEST) {\n return StoreSet(\"scope\", scope);\n}\n","import { classOf } from \"@tsed/core\";\nimport { DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\nimport { ProviderScope } from \"../domain/ProviderScope.js\";\nimport { Inject } from \"./inject.js\";\nimport { Scope } from \"./scope.js\";\n/**\n * Get instance options. This options depending on his invocation context.\n *\n * ```typescript\n * import {Injectable, Opts, UseOpts} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyConfigurableService {\n * source: string;\n * constructor(@Opts options: any = {}) {\n * console.log(\"Hello \", options.source); // log: Hello Service1 then Hello Service2\n *\n * this.source = options.source;\n * }\n * }\n *\n * @Injectable()\n * class MyService1 {\n * constructor(@UseOpts({source: 'Service1'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service1\n * }\n * }\n *\n * @Injectable()\n * class MyService2 {\n * constructor(@UseOpts({source: 'Service2'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service2\n * }\n * }\n * ```\n *\n * ::: warning\n * Using @@Opts@@ decorator on a constructor parameter change the Scope of the provider to `ProviderScope.INSTANCE`.\n * :::\n *\n * @param target\n * @param propertyKey\n * @param index\n * @decorator\n */\nexport function Opts(target, propertyKey, index) {\n Scope(ProviderScope.INSTANCE)(classOf(target));\n Inject(DI_USE_PARAM_OPTIONS)(target, propertyKey, index);\n}\n","import { GlobalProviders } from \"../registries/GlobalProviders.js\";\n/**\n * Override a provider which is already registered in ProviderRegistry.\n * @returns {Function}\n * @decorators\n * @param originalProvider\n */\nexport function OverrideProvider(originalProvider) {\n return (target) => {\n GlobalProviders.get(originalProvider).useClass = target;\n };\n}\n","import { Injectable } from \"./injectable.js\";\n/**\n * The decorators `@Service()` declare a new service can be injected in other service or controller on there `constructor`.\n * All services annotated with `@Service()` are constructed one time.\n *\n * > `@Service()` use the `reflect-metadata` to collect and inject service on controllers or other services.\n *\n * @returns {Function}\n * @decorator\n */\nexport function Service() {\n return Injectable();\n}\n","import { decoratorTypeOf, DecoratorTypes, Store, UnsupportedDecoratorType } from \"@tsed/core\";\nimport { DI_USE_OPTIONS, DI_USE_PARAM_OPTIONS } from \"../constants/constants.js\";\n/**\n * Add options to invoke the Service.\n *\n * ```typescript\n * import {Injectable, Opts, UseOpts} from \"@tsed/di\";\n *\n * @Injectable()\n * class MyConfigurableService {\n * source: string;\n * constructor(@Opts options: any = {}) {\n * console.log(\"Hello \", options.source); // log: Hello Service1 then Hello Service2\n *\n * this.source = options.source;\n * }\n * }\n *\n * @Injectable()\n * class MyService1 {\n * constructor(@UseOpts({source: 'Service1'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service1\n * }\n * }\n *\n * @Injectable()\n * class MyService2 {\n * constructor(@UseOpts({source: 'Service2'}) service: MyConfigurableService) {\n * console.log(service.source) // log: Service2\n * }\n * }\n * ```\n *\n * ::: warning\n * Using @@Opts@@ decorator on a constructor parameter change the Scope of the provider to `ProviderScope.INSTANCE`.\n * :::\n *\n * @returns {Function}\n * @decorator\n * @param options\n */\nexport function UseOpts(options) {\n return (target, propertyKey, index) => {\n const bindingType = decoratorTypeOf([target, propertyKey, index]);\n switch (bindingType) {\n case DecoratorTypes.PARAM_CTOR:\n Store.from(target).merge(`${DI_USE_PARAM_OPTIONS}:${index}`, options);\n break;\n case DecoratorTypes.PROP:\n Store.from(target, propertyKey).set(DI_USE_OPTIONS, options);\n break;\n default:\n throw new UnsupportedDecoratorType(UseOpts, [target, propertyKey, index]);\n }\n };\n}\n","import { catchError } from \"@tsed/core\";\nimport { injector } from \"../fn/injector.js\";\nexport function bindValue(target, propertyKey, expression, defaultValue) {\n const descriptor = {\n get() {\n return injector().settings.get(expression, defaultValue);\n },\n set(value) {\n injector().settings.set(expression, value);\n },\n enumerable: true,\n configurable: true\n };\n catchError(() => Reflect.deleteProperty(target, propertyKey));\n catchError(() => Reflect.defineProperty(target, propertyKey, descriptor));\n}\n/**\n * Return value from Configuration.\n *\n * ## Example\n *\n * ```typescript\n * import {Env} from \"@tsed/core\";\n * import {Constant, Value} from \"@tsed/di\";\n *\n * export class MyClass {\n *\n * @Constant(\"env\")\n * env: Env;\n *\n * @Value(\"swagger.path\")\n * swaggerPath: string;\n *\n * @Value(\"swagger.path\", \"defaultValue\")\n * swaggerPath: string;\n *\n * constructor() {\n * console.log(this.swaggerPath) // undefined. Not available on constructor\n * }\n *\n * $onInit() {\n * console.log(this.swaggerPath) // something\n * }\n * }\n * ```\n *\n * @param expression\n * @param defaultValue\n * @returns {(targetClass: any, attributeName: string) => any}\n * @decorator\n */\nexport function Value(expression, defaultValue) {\n return (target, propertyKey) => {\n return bindValue(target, propertyKey, expression, defaultValue);\n };\n}\n","import { injector } from \"./injector.js\";\nexport function refValue(expression, defaultValue) {\n return Object.freeze({\n get value() {\n return injector().settings.get(expression, defaultValue);\n },\n set value(value) {\n injector().settings.set(expression, value);\n }\n });\n}\n","import { injectable } from \"../fn/injectable.js\";\nimport { injector } from \"../fn/injector.js\";\nexport const LOGGER = Symbol.for(\"LOGGER\");\ninjectable(LOGGER).factory(() => injector().logger);\n","import { Store } from \"@tsed/core\";\nexport function mergeMount(m1 = {}, m2 = {}) {\n return Object.entries(m2).reduce((mount, [key, controllers]) => {\n return {\n ...mount,\n [key]: (mount[key] || []).concat(controllers)\n };\n }, m1);\n}\nexport function getConfiguration(module, configuration = {}) {\n const store = Store.from(module).get(\"configuration\") || {};\n return {\n ...store,\n ...configuration,\n mount: mergeMount(store.mount, configuration.mount)\n };\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__414__","__WEBPACK_EXTERNAL_MODULE__171__","__WEBPACK_EXTERNAL_MODULE__538__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","DI_INVOKE_OPTIONS","DI_INJECTABLE_PROPS","DI_USE_OPTIONS","DI_USE_PARAM_OPTIONS","DI_INTERCEPTOR_OPTIONS","ProviderScope","ProviderType","LocalsContainer","Map","constructor","super","arguments","this","hooks","Hooks","destroy","asyncEmit","discoverHooks","token","methodsOf","reduce","propertyKey","String","startsWith","listener","instance","args","Provider","options","type","PROVIDER","useClass","assign","getClassOrSymbol","Store","from","provide","isClass","classOf","className","name","nameOf","store","path","set","scope","isAsync","SINGLETON","configuration","children","getArgOpts","index","defaultValue","useAsyncFactory","clone","hasChildren","length","hasParent","toString","useFactory","useValue","filter","Boolean","join","GlobalProviderRegistry","has","metadata","merge","target","global","GlobalProviders","createProvider","meta","createIfNotExists","keys","forEach","delete","createRegistry","model","defaultOptions","getRegistrySettings","provider","item","Container","add","settings","addProvider","hasProvider","setProvider","getProvider","getProviders","types","concat","map","providers","_","includes","addProviders","container","colorIfAllowed","colorFn","text","process","env","NO_COLOR","colors","red","yellow","green","InjectionError","Error","origin","isString","tokens","message","stack","originMessage","tokensMessage","throwInjectorError","currentDependency","error","erroredArg","getConstructorArgNames","arg","deps","signature","indexOf","repeat","drawline","printDependencyInjectionError","createContainer","rootModule","entries","getConstructorDependencies","Metadata","getOwn","getParamTypes","setConstructorDependencies","CONFIGURATION","for","DIConfiguration","initialProps","default","imports","routes","logger","version","v","rootDir","debug","level","callbackfn","thisArg","Set","Array","getRaw","Reflect","setRaw","setValue","getValue","EXCLUDED_CONFIGURATION_KEYS","InjectorService","console","resolvedConfiguration","isLoaded","toArray","values","resolve","getMany","alias","locals","useOpts","rebuild","ensureProvider","invokeToken","setToCache","registerHooks","REQUEST","invoke","loadAsync","loadSync","load","$asyncEmit","bootstrap","resolveConfiguration","mergedConfiguration","deepMerge","deepClone","emit","eventName","alter","$alter","alterAsync","$asyncAlter","$off","resolveImportsProviders","force","resolvedOpts","mapInvokeOptions","construct","$emit","invokeDependency","parent","isArray","isInheritedFrom","services","isObject","props","use","isFunction","async","Promise","all","$onDestroy","on","event","cb","$on","isPromise","then","globalInjector","injector","destroyInjector","AutoInjectable","constr","inj","list","Math","max","i","push","resolveAutoInjectableArgs","ControllerProvider","CONTROLLER","middlewares","useAfter","useBefore","mdlwrs","a","b","registerProvider","opts","injectable","inspect","providerBuilder","baseOpts","merged","acc","asyncFactory","VALUE","k","Props","interceptor","INTERCEPTOR","controller","InvalidPropertyTokenError","globalLocals","globalInvOpts","stagedLocals","localsContainer","p","invokeOptions","detachLocalsContainer","cleanAllLocalsContainer","clear","inject","injectMany","Inject","transform","decoratorTypeOf","DecoratorTypes","PARAM_CTOR","parameterIndex","paramTypes","setParamTypes","setToken","PROP","symbol","configurable","catchError","deleteProperty","useType","getType","getTokenType","originalType","invokeOpts","result","bindInjectableProperty","Configuration","CLASS","constant","expression","bindConstant","freeze","Constant","InjectablePropertyType","Controller","RegExp","isArrayOrArrayClass","mapOptions","useDecorators","Path","Children","Injectable","getInterceptorOptions","fromMethod","bindIntercept","klass","descriptor","getOwnPropertyDescriptor","originalMethod","next","err","apply","context","intercept","Intercept","decorateMethodsOf","METHOD","Interceptor","lazyInject","instanceWithHook","$onInit","optionalLazyInject","er","optional","wrap","resolver","LazyInject","OptionalLazyInject","Module","scopes","MODULE","Scope","StoreSet","Opts","INSTANCE","OverrideProvider","originalProvider","Service","UseOpts","UnsupportedDecoratorType","bindValue","Value","refValue","LOGGER","mergeMount","m1","m2","mount","controllers","getConfiguration"],"sourceRoot":""}
|
|
@@ -252,7 +252,7 @@ export class InjectorService extends Container {
|
|
|
252
252
|
this.resolvedConfiguration = true;
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
|
-
* Emit an event to all service. See service [lifecycle hooks](/docs/
|
|
255
|
+
* Emit an event to all service. See service [lifecycle hooks](/docs/hooks.md#lifecycle-hooks).
|
|
256
256
|
* @param eventName The event name to emit at all services.
|
|
257
257
|
* @param args List of the parameters to give to each service.
|
|
258
258
|
* @returns A list of promises.
|
|
@@ -135,7 +135,7 @@ export declare class InjectorService extends Container {
|
|
|
135
135
|
*/
|
|
136
136
|
resolveConfiguration(): void;
|
|
137
137
|
/**
|
|
138
|
-
* Emit an event to all service. See service [lifecycle hooks](/docs/
|
|
138
|
+
* Emit an event to all service. See service [lifecycle hooks](/docs/hooks.md#lifecycle-hooks).
|
|
139
139
|
* @param eventName The event name to emit at all services.
|
|
140
140
|
* @param args List of the parameters to give to each service.
|
|
141
141
|
* @returns A list of promises.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/di",
|
|
3
3
|
"description": "DI module for Ts.ED Framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.4.0",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"uuid": "^10.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tsed/barrels": "8.
|
|
34
|
-
"@tsed/core": "8.
|
|
35
|
-
"@tsed/hooks": "8.
|
|
33
|
+
"@tsed/barrels": "8.4.0",
|
|
34
|
+
"@tsed/core": "8.4.0",
|
|
35
|
+
"@tsed/hooks": "8.4.0",
|
|
36
36
|
"@tsed/logger": "^7.0.1",
|
|
37
|
-
"@tsed/schema": "8.
|
|
38
|
-
"@tsed/typescript": "8.
|
|
37
|
+
"@tsed/schema": "8.4.0",
|
|
38
|
+
"@tsed/typescript": "8.4.0",
|
|
39
39
|
"cross-env": "7.0.3",
|
|
40
40
|
"eslint": "9.12.0",
|
|
41
41
|
"typescript": "5.4.5",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"webpack": "^5.75.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@tsed/core": "8.
|
|
47
|
-
"@tsed/hooks": "8.
|
|
46
|
+
"@tsed/core": "8.4.0",
|
|
47
|
+
"@tsed/hooks": "8.4.0",
|
|
48
48
|
"@tsed/logger": ">=7.0.1",
|
|
49
|
-
"@tsed/schema": "8.
|
|
49
|
+
"@tsed/schema": "8.4.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@tsed/core": {
|
|
@@ -298,7 +298,7 @@ export class InjectorService extends Container {
|
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
|
-
* Emit an event to all service. See service [lifecycle hooks](/docs/
|
|
301
|
+
* Emit an event to all service. See service [lifecycle hooks](/docs/hooks.md#lifecycle-hooks).
|
|
302
302
|
* @param eventName The event name to emit at all services.
|
|
303
303
|
* @param args List of the parameters to give to each service.
|
|
304
304
|
* @returns A list of promises.
|