@zudojs/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/application/application.d.ts +25 -0
- package/dist/application/application.d.ts.map +1 -0
- package/dist/application/application.js +86 -0
- package/dist/application/application.js.map +1 -0
- package/dist/application/applicationContext.context.d.ts +40 -0
- package/dist/application/applicationContext.context.d.ts.map +1 -0
- package/dist/application/applicationContext.context.js +43 -0
- package/dist/application/applicationContext.context.js.map +1 -0
- package/dist/application/applicationState.state.d.ts +5 -0
- package/dist/application/applicationState.state.d.ts.map +1 -0
- package/dist/application/applicationState.state.js +2 -0
- package/dist/application/applicationState.state.js.map +1 -0
- package/dist/application/index.d.ts +10 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +10 -0
- package/dist/application/index.js.map +1 -0
- package/dist/configuration/configurationManager.manager.d.ts +68 -0
- package/dist/configuration/configurationManager.manager.d.ts.map +1 -0
- package/dist/configuration/configurationManager.manager.js +157 -0
- package/dist/configuration/configurationManager.manager.js.map +1 -0
- package/dist/configuration/core/configuration.d.ts +53 -0
- package/dist/configuration/core/configuration.d.ts.map +1 -0
- package/dist/configuration/core/configuration.js +206 -0
- package/dist/configuration/core/configuration.js.map +1 -0
- package/dist/configuration/core/configurationKey.key.d.ts +43 -0
- package/dist/configuration/core/configurationKey.key.d.ts.map +1 -0
- package/dist/configuration/core/configurationKey.key.js +27 -0
- package/dist/configuration/core/configurationKey.key.js.map +1 -0
- package/dist/configuration/core/configurationSource.source.d.ts +114 -0
- package/dist/configuration/core/configurationSource.source.d.ts.map +1 -0
- package/dist/configuration/core/configurationSource.source.js +55 -0
- package/dist/configuration/core/configurationSource.source.js.map +1 -0
- package/dist/configuration/core/index.d.ts +12 -0
- package/dist/configuration/core/index.d.ts.map +1 -0
- package/dist/configuration/core/index.js +9 -0
- package/dist/configuration/core/index.js.map +1 -0
- package/dist/configuration/error/configurationError.error.d.ts +108 -0
- package/dist/configuration/error/configurationError.error.d.ts.map +1 -0
- package/dist/configuration/error/configurationError.error.js +168 -0
- package/dist/configuration/error/configurationError.error.js.map +1 -0
- package/dist/configuration/error/configurationRedactor.redactor.d.ts +111 -0
- package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +1 -0
- package/dist/configuration/error/configurationRedactor.redactor.js +176 -0
- package/dist/configuration/error/configurationRedactor.redactor.js.map +1 -0
- package/dist/configuration/error/index.d.ts +10 -0
- package/dist/configuration/error/index.d.ts.map +1 -0
- package/dist/configuration/error/index.js +8 -0
- package/dist/configuration/error/index.js.map +1 -0
- package/dist/configuration/events/configurationEvents.events.d.ts +174 -0
- package/dist/configuration/events/configurationEvents.events.d.ts.map +1 -0
- package/dist/configuration/events/configurationEvents.events.js +99 -0
- package/dist/configuration/events/configurationEvents.events.js.map +1 -0
- package/dist/configuration/events/index.d.ts +8 -0
- package/dist/configuration/events/index.d.ts.map +1 -0
- package/dist/configuration/events/index.js +7 -0
- package/dist/configuration/events/index.js.map +1 -0
- package/dist/configuration/index.d.ts +30 -0
- package/dist/configuration/index.d.ts.map +1 -0
- package/dist/configuration/index.js +29 -0
- package/dist/configuration/index.js.map +1 -0
- package/dist/configuration/loader/configurationLoader.loader.d.ts +113 -0
- package/dist/configuration/loader/configurationLoader.loader.d.ts.map +1 -0
- package/dist/configuration/loader/configurationLoader.loader.js +155 -0
- package/dist/configuration/loader/configurationLoader.loader.js.map +1 -0
- package/dist/configuration/loader/index.d.ts +8 -0
- package/dist/configuration/loader/index.d.ts.map +1 -0
- package/dist/configuration/loader/index.js +7 -0
- package/dist/configuration/loader/index.js.map +1 -0
- package/dist/configuration/registry/configurationProvider.provider.d.ts +130 -0
- package/dist/configuration/registry/configurationProvider.provider.d.ts.map +1 -0
- package/dist/configuration/registry/configurationProvider.provider.js +113 -0
- package/dist/configuration/registry/configurationProvider.provider.js.map +1 -0
- package/dist/configuration/registry/configurationRegistry.registry.d.ts +143 -0
- package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +1 -0
- package/dist/configuration/registry/configurationRegistry.registry.js +157 -0
- package/dist/configuration/registry/configurationRegistry.registry.js.map +1 -0
- package/dist/configuration/registry/index.d.ts +10 -0
- package/dist/configuration/registry/index.d.ts.map +1 -0
- package/dist/configuration/registry/index.js +8 -0
- package/dist/configuration/registry/index.js.map +1 -0
- package/dist/configuration/schema/configurationSchema.schema.d.ts +159 -0
- package/dist/configuration/schema/configurationSchema.schema.d.ts.map +1 -0
- package/dist/configuration/schema/configurationSchema.schema.js +155 -0
- package/dist/configuration/schema/configurationSchema.schema.js.map +1 -0
- package/dist/configuration/schema/configurationValidation.validator.d.ts +82 -0
- package/dist/configuration/schema/configurationValidation.validator.d.ts.map +1 -0
- package/dist/configuration/schema/configurationValidation.validator.js +110 -0
- package/dist/configuration/schema/configurationValidation.validator.js.map +1 -0
- package/dist/configuration/schema/index.d.ts +10 -0
- package/dist/configuration/schema/index.d.ts.map +1 -0
- package/dist/configuration/schema/index.js +8 -0
- package/dist/configuration/schema/index.js.map +1 -0
- package/dist/container/container.d.ts +43 -0
- package/dist/container/container.d.ts.map +1 -0
- package/dist/container/container.js +91 -0
- package/dist/container/container.js.map +1 -0
- package/dist/container/index.d.ts +8 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/container/index.js +8 -0
- package/dist/container/index.js.map +1 -0
- package/dist/container/provider.d.ts +28 -0
- package/dist/container/provider.d.ts.map +1 -0
- package/dist/container/provider.js +2 -0
- package/dist/container/provider.js.map +1 -0
- package/dist/container/scope.d.ts +24 -0
- package/dist/container/scope.d.ts.map +1 -0
- package/dist/container/scope.js +2 -0
- package/dist/container/scope.js.map +1 -0
- package/dist/container/token.d.ts +18 -0
- package/dist/container/token.d.ts.map +1 -0
- package/dist/container/token.js +10 -0
- package/dist/container/token.js.map +1 -0
- package/dist/context/core/context.d.ts +95 -0
- package/dist/context/core/context.d.ts.map +1 -0
- package/dist/context/core/context.js +103 -0
- package/dist/context/core/context.js.map +1 -0
- package/dist/context/core/contextKey.key.d.ts +60 -0
- package/dist/context/core/contextKey.key.d.ts.map +1 -0
- package/dist/context/core/contextKey.key.js +58 -0
- package/dist/context/core/contextKey.key.js.map +1 -0
- package/dist/context/core/executionContext.context.d.ts +131 -0
- package/dist/context/core/executionContext.context.d.ts.map +1 -0
- package/dist/context/core/executionContext.context.js +81 -0
- package/dist/context/core/executionContext.context.js.map +1 -0
- package/dist/context/core/index.d.ts +9 -0
- package/dist/context/core/index.d.ts.map +1 -0
- package/dist/context/core/index.js +9 -0
- package/dist/context/core/index.js.map +1 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +8 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/provider/contextProvider.provider.d.ts +61 -0
- package/dist/context/provider/contextProvider.provider.d.ts.map +1 -0
- package/dist/context/provider/contextProvider.provider.js +44 -0
- package/dist/context/provider/contextProvider.provider.js.map +1 -0
- package/dist/context/provider/contextStorage.storage.d.ts +54 -0
- package/dist/context/provider/contextStorage.storage.d.ts.map +1 -0
- package/dist/context/provider/contextStorage.storage.js +74 -0
- package/dist/context/provider/contextStorage.storage.js.map +1 -0
- package/dist/context/provider/index.d.ts +8 -0
- package/dist/context/provider/index.d.ts.map +1 -0
- package/dist/context/provider/index.js +8 -0
- package/dist/context/provider/index.js.map +1 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts +48 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +1 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.js +33 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.js.map +1 -0
- package/dist/context/snapshot/index.d.ts +8 -0
- package/dist/context/snapshot/index.d.ts.map +1 -0
- package/dist/context/snapshot/index.js +8 -0
- package/dist/context/snapshot/index.js.map +1 -0
- package/dist/context/values/contextValues.values.d.ts +84 -0
- package/dist/context/values/contextValues.values.d.ts.map +1 -0
- package/dist/context/values/contextValues.values.js +120 -0
- package/dist/context/values/contextValues.values.js.map +1 -0
- package/dist/context/values/index.d.ts +7 -0
- package/dist/context/values/index.d.ts.map +1 -0
- package/dist/context/values/index.js +7 -0
- package/dist/context/values/index.js.map +1 -0
- package/dist/contracts/adapter.d.ts +44 -0
- package/dist/contracts/adapter.d.ts.map +1 -0
- package/dist/contracts/adapter.js +2 -0
- package/dist/contracts/adapter.js.map +1 -0
- package/dist/contracts/disposable.d.ts +23 -0
- package/dist/contracts/disposable.d.ts.map +1 -0
- package/dist/contracts/disposable.js +2 -0
- package/dist/contracts/disposable.js.map +1 -0
- package/dist/contracts/handler.d.ts +32 -0
- package/dist/contracts/handler.d.ts.map +1 -0
- package/dist/contracts/handler.js +9 -0
- package/dist/contracts/handler.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/errors/errorCode.code.d.ts +78 -0
- package/dist/errors/errorCode.code.d.ts.map +1 -0
- package/dist/errors/errorCode.code.js +84 -0
- package/dist/errors/errorCode.code.js.map +1 -0
- package/dist/errors/exceptions.d.ts +52 -0
- package/dist/errors/exceptions.d.ts.map +1 -0
- package/dist/errors/exceptions.js +125 -0
- package/dist/errors/exceptions.js.map +1 -0
- package/dist/errors/frameworkError.error.d.ts +51 -0
- package/dist/errors/frameworkError.error.d.ts.map +1 -0
- package/dist/errors/frameworkError.error.js +54 -0
- package/dist/errors/frameworkError.error.js.map +1 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +9 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/core/index.d.ts +9 -0
- package/dist/lifecycle/core/index.d.ts.map +1 -0
- package/dist/lifecycle/core/index.js +9 -0
- package/dist/lifecycle/core/index.js.map +1 -0
- package/dist/lifecycle/core/lifecycle.d.ts +44 -0
- package/dist/lifecycle/core/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycle.js +179 -0
- package/dist/lifecycle/core/lifecycle.js.map +1 -0
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts +59 -0
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleHook.hook.js +37 -0
- package/dist/lifecycle/core/lifecycleHook.hook.js.map +1 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +101 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js +115 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +1 -0
- package/dist/lifecycle/core/lifecycleState.state.d.ts +2 -0
- package/dist/lifecycle/core/lifecycleState.state.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleState.state.js +2 -0
- package/dist/lifecycle/core/lifecycleState.state.js.map +1 -0
- package/dist/lifecycle/index.d.ts +10 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +10 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle/manager/index.d.ts +7 -0
- package/dist/lifecycle/manager/index.d.ts.map +1 -0
- package/dist/lifecycle/manager/index.js +7 -0
- package/dist/lifecycle/manager/index.js.map +1 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +33 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +1 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.js +157 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.js.map +1 -0
- package/dist/lifecycle/scope/index.d.ts +8 -0
- package/dist/lifecycle/scope/index.d.ts.map +1 -0
- package/dist/lifecycle/scope/index.js +8 -0
- package/dist/lifecycle/scope/index.js.map +1 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +49 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +1 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.js +234 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.js.map +1 -0
- package/dist/logging/console/consoleLogger.logger.d.ts +59 -0
- package/dist/logging/console/consoleLogger.logger.d.ts.map +1 -0
- package/dist/logging/console/consoleLogger.logger.js +180 -0
- package/dist/logging/console/consoleLogger.logger.js.map +1 -0
- package/dist/logging/console/index.d.ts +8 -0
- package/dist/logging/console/index.d.ts.map +1 -0
- package/dist/logging/console/index.js +8 -0
- package/dist/logging/console/index.js.map +1 -0
- package/dist/logging/console/loggerFactory.factory.d.ts +45 -0
- package/dist/logging/console/loggerFactory.factory.d.ts.map +1 -0
- package/dist/logging/console/loggerFactory.factory.js +37 -0
- package/dist/logging/console/loggerFactory.factory.js.map +1 -0
- package/dist/logging/core/index.d.ts +11 -0
- package/dist/logging/core/index.d.ts.map +1 -0
- package/dist/logging/core/index.js +11 -0
- package/dist/logging/core/index.js.map +1 -0
- package/dist/logging/core/logEntry.entry.d.ts +73 -0
- package/dist/logging/core/logEntry.entry.d.ts.map +1 -0
- package/dist/logging/core/logEntry.entry.js +38 -0
- package/dist/logging/core/logEntry.entry.js.map +1 -0
- package/dist/logging/core/logLevel.level.d.ts +29 -0
- package/dist/logging/core/logLevel.level.d.ts.map +1 -0
- package/dist/logging/core/logLevel.level.js +34 -0
- package/dist/logging/core/logLevel.level.js.map +1 -0
- package/dist/logging/core/logger.d.ts +80 -0
- package/dist/logging/core/logger.d.ts.map +1 -0
- package/dist/logging/core/logger.js +39 -0
- package/dist/logging/core/logger.js.map +1 -0
- package/dist/logging/core/loggerContext.context.d.ts +62 -0
- package/dist/logging/core/loggerContext.context.d.ts.map +1 -0
- package/dist/logging/core/loggerContext.context.js +19 -0
- package/dist/logging/core/loggerContext.context.js.map +1 -0
- package/dist/logging/core/loggerOptions.options.d.ts +69 -0
- package/dist/logging/core/loggerOptions.options.d.ts.map +1 -0
- package/dist/logging/core/loggerOptions.options.js +10 -0
- package/dist/logging/core/loggerOptions.options.js.map +1 -0
- package/dist/logging/index.d.ts +8 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +8 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/modules/index.d.ts +20 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +52 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/module.d.ts +171 -0
- package/dist/modules/module.d.ts.map +1 -0
- package/dist/modules/module.js +99 -0
- package/dist/modules/module.js.map +1 -0
- package/dist/modules/moduleContext.context.d.ts +170 -0
- package/dist/modules/moduleContext.context.d.ts.map +1 -0
- package/dist/modules/moduleContext.context.js +82 -0
- package/dist/modules/moduleContext.context.js.map +1 -0
- package/dist/modules/moduleDefinition.definition.d.ts +112 -0
- package/dist/modules/moduleDefinition.definition.d.ts.map +1 -0
- package/dist/modules/moduleDefinition.definition.js +101 -0
- package/dist/modules/moduleDefinition.definition.js.map +1 -0
- package/dist/modules/moduleDependency/index.d.ts +10 -0
- package/dist/modules/moduleDependency/index.d.ts.map +1 -0
- package/dist/modules/moduleDependency/index.js +10 -0
- package/dist/modules/moduleDependency/index.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +43 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.js +175 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +38 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js +112 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts +66 -0
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.type.js +2 -0
- package/dist/modules/moduleDependency/moduleDependency.type.js.map +1 -0
- package/dist/modules/moduleError/index.d.ts +11 -0
- package/dist/modules/moduleError/index.d.ts.map +1 -0
- package/dist/modules/moduleError/index.js +11 -0
- package/dist/modules/moduleError/index.js.map +1 -0
- package/dist/modules/moduleError/moduleError.base.d.ts +119 -0
- package/dist/modules/moduleError/moduleError.base.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.base.js +105 -0
- package/dist/modules/moduleError/moduleError.base.js.map +1 -0
- package/dist/modules/moduleError/moduleError.dependency.d.ts +45 -0
- package/dist/modules/moduleError/moduleError.dependency.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.dependency.js +55 -0
- package/dist/modules/moduleError/moduleError.dependency.js.map +1 -0
- package/dist/modules/moduleError/moduleError.helpers.d.ts +22 -0
- package/dist/modules/moduleError/moduleError.helpers.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.helpers.js +32 -0
- package/dist/modules/moduleError/moduleError.helpers.js.map +1 -0
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts +61 -0
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.lifecycle.js +107 -0
- package/dist/modules/moduleError/moduleError.lifecycle.js.map +1 -0
- package/dist/modules/moduleError/moduleError.registration.d.ts +21 -0
- package/dist/modules/moduleError/moduleError.registration.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.registration.js +39 -0
- package/dist/modules/moduleError/moduleError.registration.js.map +1 -0
- package/dist/modules/moduleLifecycle/index.d.ts +10 -0
- package/dist/modules/moduleLifecycle/index.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/index.js +10 -0
- package/dist/modules/moduleLifecycle/index.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +41 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +116 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +21 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +107 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +94 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +11 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +1 -0
- package/dist/modules/moduleLoader/index.d.ts +9 -0
- package/dist/modules/moduleLoader/index.d.ts.map +1 -0
- package/dist/modules/moduleLoader/index.js +9 -0
- package/dist/modules/moduleLoader/index.js.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +36 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.js +164 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.js.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts +57 -0
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.type.js +11 -0
- package/dist/modules/moduleLoader/moduleLoader.type.js.map +1 -0
- package/dist/modules/moduleMetadata.metadata.d.ts +36 -0
- package/dist/modules/moduleMetadata.metadata.d.ts.map +1 -0
- package/dist/modules/moduleMetadata.metadata.js +105 -0
- package/dist/modules/moduleMetadata.metadata.js.map +1 -0
- package/dist/modules/moduleRegistry/index.d.ts +8 -0
- package/dist/modules/moduleRegistry/index.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/index.js +8 -0
- package/dist/modules/moduleRegistry/index.js.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +35 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js +155 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +134 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.js +2 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +1 -0
- package/dist/runtime/index.d.ts +24 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +42 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/runtime.d.ts +89 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/runtime.js +179 -0
- package/dist/runtime/runtime.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/index.d.ts +10 -0
- package/dist/runtime/runtimeBootstrap/index.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/index.js +9 -0
- package/dist/runtime/runtimeBootstrap/index.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +8 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.js +8 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +6 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +27 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +19 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +107 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +25 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +122 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +78 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js +2 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +1 -0
- package/dist/runtime/runtimeContext/index.d.ts +10 -0
- package/dist/runtime/runtimeContext/index.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/index.js +9 -0
- package/dist/runtime/runtimeContext/index.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +38 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.js +99 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +22 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.js +43 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +68 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.js +2 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts +9 -0
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/index.js +9 -0
- package/dist/runtime/runtimeEnvironment/detection/index.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts +8 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js +92 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +51 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +26 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/index.d.ts +10 -0
- package/dist/runtime/runtimeEnvironment/index.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/index.js +9 -0
- package/dist/runtime/runtimeEnvironment/index.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +41 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +105 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +108 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js +2 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +1 -0
- package/dist/runtime/runtimeError/index.d.ts +29 -0
- package/dist/runtime/runtimeError/index.d.ts.map +1 -0
- package/dist/runtime/runtimeError/index.js +47 -0
- package/dist/runtime/runtimeError/index.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.base.d.ts +30 -0
- package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.base.js +81 -0
- package/dist/runtime/runtimeError/runtimeError.base.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +35 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js +77 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +35 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.js +79 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.type.d.ts +74 -0
- package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.type.js +28 -0
- package/dist/runtime/runtimeError/runtimeError.type.js.map +1 -0
- package/dist/runtime/runtimeLogger.d.ts +5 -0
- package/dist/runtime/runtimeLogger.d.ts.map +1 -0
- package/dist/runtime/runtimeLogger.js +18 -0
- package/dist/runtime/runtimeLogger.js.map +1 -0
- package/dist/runtime/runtimeManager/index.d.ts +12 -0
- package/dist/runtime/runtimeManager/index.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/index.js +11 -0
- package/dist/runtime/runtimeManager/index.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +31 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.js +136 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +14 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.js +21 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +7 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.js +8 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +16 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +49 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +54 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.js +2 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.js.map +1 -0
- package/dist/runtime/runtimeOptions/index.d.ts +10 -0
- package/dist/runtime/runtimeOptions/index.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/index.js +9 -0
- package/dist/runtime/runtimeOptions/index.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +6 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +37 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts +10 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +80 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +94 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js +2 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts +26 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +59 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +1 -0
- package/dist/runtime/runtimeShutdown/index.d.ts +10 -0
- package/dist/runtime/runtimeShutdown/index.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/index.js +9 -0
- package/dist/runtime/runtimeShutdown/index.js.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +7 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.js +7 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.js.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +9 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +67 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +35 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +147 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +74 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js +2 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +1 -0
- package/dist/runtime/runtimeState.state.d.ts +60 -0
- package/dist/runtime/runtimeState.state.d.ts.map +1 -0
- package/dist/runtime/runtimeState.state.js +157 -0
- package/dist/runtime/runtimeState.state.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a configuration schema.
|
|
3
|
+
*/
|
|
4
|
+
export function createConfigurationSchema(options) {
|
|
5
|
+
const path = normalizeConfigurationPath(options.path);
|
|
6
|
+
if (!path) {
|
|
7
|
+
throw new Error("Configuration schema path cannot be empty.");
|
|
8
|
+
}
|
|
9
|
+
const required = options.required ?? true;
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
path,
|
|
12
|
+
required,
|
|
13
|
+
defaultValue: options.defaultValue,
|
|
14
|
+
description: options.description,
|
|
15
|
+
async validate(configuration) {
|
|
16
|
+
const exists = configuration.has(path);
|
|
17
|
+
if (!exists) {
|
|
18
|
+
if (options.defaultValue !== undefined) {
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
value: options.defaultValue,
|
|
22
|
+
errors: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (required) {
|
|
26
|
+
return {
|
|
27
|
+
success: false,
|
|
28
|
+
errors: [
|
|
29
|
+
{
|
|
30
|
+
path,
|
|
31
|
+
message: `Required configuration "${path}" is not defined.`,
|
|
32
|
+
code: "CONFIGURATION_REQUIRED",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
success: true,
|
|
39
|
+
value: undefined,
|
|
40
|
+
errors: [],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const value = configuration.get(path);
|
|
44
|
+
if (!options.validator) {
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
value,
|
|
48
|
+
errors: [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return options.validator(value, {
|
|
52
|
+
configuration,
|
|
53
|
+
path,
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Collection of configuration schemas.
|
|
60
|
+
*/
|
|
61
|
+
export class ConfigurationSchemaRegistry {
|
|
62
|
+
schemas = new Map();
|
|
63
|
+
/**
|
|
64
|
+
* Registers a schema.
|
|
65
|
+
*/
|
|
66
|
+
register(schema) {
|
|
67
|
+
if (this.schemas.has(schema.path)) {
|
|
68
|
+
throw new Error(`Configuration schema "${schema.path}" is already registered.`);
|
|
69
|
+
}
|
|
70
|
+
this.schemas.set(schema.path, schema);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Registers multiple schemas.
|
|
74
|
+
*/
|
|
75
|
+
registerMany(schemas) {
|
|
76
|
+
for (const schema of schemas) {
|
|
77
|
+
this.register(schema);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves a schema.
|
|
82
|
+
*/
|
|
83
|
+
get(path) {
|
|
84
|
+
return this.schemas.get(normalizeConfigurationPath(path));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Checks whether a schema exists.
|
|
88
|
+
*/
|
|
89
|
+
has(path) {
|
|
90
|
+
return this.schemas.has(normalizeConfigurationPath(path));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Removes a schema.
|
|
94
|
+
*/
|
|
95
|
+
remove(path) {
|
|
96
|
+
return this.schemas.delete(normalizeConfigurationPath(path));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns all registered schemas.
|
|
100
|
+
*/
|
|
101
|
+
getAll() {
|
|
102
|
+
return [...this.schemas.values()];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns the number of registered schemas.
|
|
106
|
+
*/
|
|
107
|
+
size() {
|
|
108
|
+
return this.schemas.size;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Removes all schemas.
|
|
112
|
+
*/
|
|
113
|
+
clear() {
|
|
114
|
+
this.schemas.clear();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates a schema registry.
|
|
119
|
+
*/
|
|
120
|
+
export function createConfigurationSchemaRegistry() {
|
|
121
|
+
return new ConfigurationSchemaRegistry();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Validates every registered schema against a configuration.
|
|
125
|
+
*/
|
|
126
|
+
export async function validateConfiguration(configuration, registry) {
|
|
127
|
+
const errors = [];
|
|
128
|
+
for (const schema of registry.getAll()) {
|
|
129
|
+
const result = await schema.validate(configuration);
|
|
130
|
+
if (!result.success) {
|
|
131
|
+
errors.push(...result.errors);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (errors.length > 0) {
|
|
135
|
+
return {
|
|
136
|
+
success: false,
|
|
137
|
+
errors,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
success: true,
|
|
142
|
+
value: configuration,
|
|
143
|
+
errors: [],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Normalizes a configuration path.
|
|
148
|
+
*/
|
|
149
|
+
function normalizeConfigurationPath(path) {
|
|
150
|
+
if (typeof path !== "string") {
|
|
151
|
+
throw new TypeError("Configuration schema path must be a string.");
|
|
152
|
+
}
|
|
153
|
+
return path.trim().replace(/\s+/g, "");
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=configurationSchema.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationSchema.schema.js","sourceRoot":"","sources":["../../../src/configuration/schema/configurationSchema.schema.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ationSchemaRegistry } from "../schema/configurationSchema.schema.js";
|
|
3
|
+
import type { ConfigurationSchema, ConfigurationValidationIssue, ConfigurationValidationResult } from "../schema/configurationSchema.schema.js";
|
|
4
|
+
import { FrameworkError } from "../../errors/frameworkError.error.js";
|
|
5
|
+
/**
|
|
6
|
+
* Result returned after validating configuration.
|
|
7
|
+
*/
|
|
8
|
+
export interface ConfigurationValidationReport {
|
|
9
|
+
/**
|
|
10
|
+
* Whether every registered schema passed validation.
|
|
11
|
+
*/
|
|
12
|
+
readonly valid: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The configuration that was validated.
|
|
15
|
+
*/
|
|
16
|
+
readonly configuration: Configuration;
|
|
17
|
+
/**
|
|
18
|
+
* All validation issues discovered.
|
|
19
|
+
*/
|
|
20
|
+
readonly issues: readonly ConfigurationValidationIssue[];
|
|
21
|
+
/**
|
|
22
|
+
* Number of schemas that were evaluated.
|
|
23
|
+
*/
|
|
24
|
+
readonly schemaCount: number;
|
|
25
|
+
/**
|
|
26
|
+
* Number of schemas that passed validation.
|
|
27
|
+
*/
|
|
28
|
+
readonly validSchemaCount: number;
|
|
29
|
+
/**
|
|
30
|
+
* Number of schemas that failed validation.
|
|
31
|
+
*/
|
|
32
|
+
readonly invalidSchemaCount: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options controlling configuration validation.
|
|
36
|
+
*/
|
|
37
|
+
export interface ConfigurationValidationOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Whether validation should stop after the first
|
|
40
|
+
* failed schema.
|
|
41
|
+
*
|
|
42
|
+
* Defaults to false.
|
|
43
|
+
*
|
|
44
|
+
* Keeping this false gives developers a complete list
|
|
45
|
+
* of configuration problems during startup.
|
|
46
|
+
*/
|
|
47
|
+
readonly failFast?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Error thrown when configuration validation fails.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ConfigurationValidationError extends FrameworkError {
|
|
53
|
+
/**
|
|
54
|
+
* All configuration validation issues.
|
|
55
|
+
*/
|
|
56
|
+
readonly issues: readonly ConfigurationValidationIssue[];
|
|
57
|
+
/**
|
|
58
|
+
* Number of schemas evaluated.
|
|
59
|
+
*/
|
|
60
|
+
readonly schemaCount: number;
|
|
61
|
+
/**
|
|
62
|
+
* Number of invalid schemas.
|
|
63
|
+
*/
|
|
64
|
+
readonly invalidSchemaCount: number;
|
|
65
|
+
constructor(issues: readonly ConfigurationValidationIssue[], schemaCount: number, invalidSchemaCount: number);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Validates a configuration against a schema registry.
|
|
69
|
+
*/
|
|
70
|
+
export declare function validateConfiguration(configuration: Configuration, registry: ConfigurationSchemaRegistry, options?: ConfigurationValidationOptions): Promise<ConfigurationValidationReport>;
|
|
71
|
+
/**
|
|
72
|
+
* Validates configuration and throws when validation fails.
|
|
73
|
+
*
|
|
74
|
+
* This is the method application bootstrap code should normally
|
|
75
|
+
* use when configuration is mandatory for startup.
|
|
76
|
+
*/
|
|
77
|
+
export declare function validateConfigurationOrThrow(configuration: Configuration, registry: ConfigurationSchemaRegistry, options?: ConfigurationValidationOptions): Promise<Configuration>;
|
|
78
|
+
/**
|
|
79
|
+
* Validates one configuration schema.
|
|
80
|
+
*/
|
|
81
|
+
export declare function validateSchema<T>(configuration: Configuration, schema: ConfigurationSchema<T>): Promise<ConfigurationValidationResult<T>>;
|
|
82
|
+
//# sourceMappingURL=configurationValidation.validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationValidation.validator.d.ts","sourceRoot":"","sources":["../../../src/configuration/schema/configurationValidation.validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,KAAK,EACV,mBAAmB,EACnB,4BAA4B,EAC5B,6BAA6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AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAe3C"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ConfigurationSchemaRegistry } from "../schema/configurationSchema.schema.js";
|
|
2
|
+
import { FrameworkError } from "../../errors/frameworkError.error.js";
|
|
3
|
+
import { ErrorCode } from "../../errors/errorCode.code.js";
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when configuration validation fails.
|
|
6
|
+
*/
|
|
7
|
+
export class ConfigurationValidationError extends FrameworkError {
|
|
8
|
+
/**
|
|
9
|
+
* All configuration validation issues.
|
|
10
|
+
*/
|
|
11
|
+
issues;
|
|
12
|
+
/**
|
|
13
|
+
* Number of schemas evaluated.
|
|
14
|
+
*/
|
|
15
|
+
schemaCount;
|
|
16
|
+
/**
|
|
17
|
+
* Number of invalid schemas.
|
|
18
|
+
*/
|
|
19
|
+
invalidSchemaCount;
|
|
20
|
+
constructor(issues, schemaCount, invalidSchemaCount) {
|
|
21
|
+
super(createValidationErrorMessage(issues), {
|
|
22
|
+
code: ErrorCode.CONFIGURATION_VALIDATION_FAILED,
|
|
23
|
+
details: {
|
|
24
|
+
issues,
|
|
25
|
+
schemaCount,
|
|
26
|
+
invalidSchemaCount,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
this.name = "ConfigurationValidationError";
|
|
30
|
+
this.issues = [...issues];
|
|
31
|
+
this.schemaCount = schemaCount;
|
|
32
|
+
this.invalidSchemaCount = invalidSchemaCount;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Validates a configuration against a schema registry.
|
|
37
|
+
*/
|
|
38
|
+
export async function validateConfiguration(configuration, registry, options = {}) {
|
|
39
|
+
const schemas = registry.getAll();
|
|
40
|
+
const issues = [];
|
|
41
|
+
let validSchemaCount = 0;
|
|
42
|
+
let invalidSchemaCount = 0;
|
|
43
|
+
for (const schema of schemas) {
|
|
44
|
+
const result = await validateSchema(configuration, schema);
|
|
45
|
+
if (result.success) {
|
|
46
|
+
validSchemaCount += 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
invalidSchemaCount += 1;
|
|
50
|
+
issues.push(...result.errors);
|
|
51
|
+
if (options.failFast === true) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
valid: issues.length === 0,
|
|
57
|
+
configuration,
|
|
58
|
+
issues,
|
|
59
|
+
schemaCount: schemas.length,
|
|
60
|
+
validSchemaCount,
|
|
61
|
+
invalidSchemaCount,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Validates configuration and throws when validation fails.
|
|
66
|
+
*
|
|
67
|
+
* This is the method application bootstrap code should normally
|
|
68
|
+
* use when configuration is mandatory for startup.
|
|
69
|
+
*/
|
|
70
|
+
export async function validateConfigurationOrThrow(configuration, registry, options = {}) {
|
|
71
|
+
const report = await validateConfiguration(configuration, registry, options);
|
|
72
|
+
if (!report.valid) {
|
|
73
|
+
throw new ConfigurationValidationError(report.issues, report.schemaCount, report.invalidSchemaCount);
|
|
74
|
+
}
|
|
75
|
+
return configuration;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validates one configuration schema.
|
|
79
|
+
*/
|
|
80
|
+
export async function validateSchema(configuration, schema) {
|
|
81
|
+
try {
|
|
82
|
+
return await schema.validate(configuration);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
errors: [
|
|
88
|
+
{
|
|
89
|
+
path: schema.path,
|
|
90
|
+
message: error instanceof Error ? error.message : String(error),
|
|
91
|
+
code: "CONFIGURATION_VALIDATOR_ERROR",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Formats configuration validation issues into
|
|
99
|
+
* a readable framework error message.
|
|
100
|
+
*/
|
|
101
|
+
function createValidationErrorMessage(issues) {
|
|
102
|
+
if (issues.length === 0) {
|
|
103
|
+
return "Configuration validation failed.";
|
|
104
|
+
}
|
|
105
|
+
const formatted = issues
|
|
106
|
+
.map((issue) => `${issue.path}: ${issue.message}`)
|
|
107
|
+
.join("; ");
|
|
108
|
+
return `Configuration validation failed: ${formatted}`;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=configurationValidation.validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationValidation.validator.js","sourceRoot":"","sources":["../../../src/configuration/schema/configurationValidation.validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAQtF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAqD3D;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,cAAc;IAC9D;;OAEG;IACa,MAAM,CAA0C;IAEhE;;OAEG;IACa,WAAW,CAAS;IAEpC;;OAEG;IACa,kBAAkB,CAAS;IAE3C,YACE,MAA+C,EAC/C,WAAmB,EACnB,kBAA0B;QAE1B,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,EAAE;YAC1C,IAAI,EAAE,SAAS,CAAC,+BAA+B;YAC/C,OAAO,EAAE;gBACP,MAAM;gBACN,WAAW;gBACX,kBAAkB;aACnB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAE3C,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QAE1B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,IAAI,CAAC,kBAAkB,GAAG,kBA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CAC1B,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,aAA4B,EAC5B,MAA8B;IAE9B,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBAC/D,IAAI,EAAE,+BAA+B;iBACtC;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,4BAA4B,CACnC,MAA+C;IAE/C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,kCAAkC,CAAC;IAC5C,CAAC;IAED,MAAM,SAAS,GAAG,MAAM;SACrB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;SACjD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,oCAAoC,SAAS,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/configuration/schema
|
|
3
|
+
*
|
|
4
|
+
* Configuration schemas and validation.
|
|
5
|
+
*/
|
|
6
|
+
export { createConfigurationSchema, ConfigurationSchemaRegistry, createConfigurationSchemaRegistry, } from "./configurationSchema.schema.js";
|
|
7
|
+
export type { ConfigurationValidationResult, ConfigurationValidationIssue, ConfigurationValidationContext, ConfigurationValidator, ConfigurationSchema, ConfigurationSchemaOptions, } from "./configurationSchema.schema.js";
|
|
8
|
+
export { validateConfiguration, validateConfigurationOrThrow, validateSchema, } from "./configurationValidation.validator.js";
|
|
9
|
+
export type { ConfigurationValidationReport, ConfigurationValidationOptions, } from "./configurationValidation.validator.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configuration/schema/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,cAAc,GACf,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/configuration/schema
|
|
3
|
+
*
|
|
4
|
+
* Configuration schemas and validation.
|
|
5
|
+
*/
|
|
6
|
+
export { createConfigurationSchema, ConfigurationSchemaRegistry, createConfigurationSchemaRegistry, } from "./configurationSchema.schema.js";
|
|
7
|
+
export { validateConfiguration, validateConfigurationOrThrow, validateSchema, } from "./configurationValidation.validator.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/configuration/schema/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,cAAc,GACf,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Provider } from "./provider.js";
|
|
2
|
+
import type { Scope } from "./scope.js";
|
|
3
|
+
import type { Token } from "./token.js";
|
|
4
|
+
/**
|
|
5
|
+
* Dependency Injection container for Zudojs applications.
|
|
6
|
+
*
|
|
7
|
+
* The container is responsible for registering and resolving
|
|
8
|
+
* application dependencies.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Container {
|
|
11
|
+
private readonly providers;
|
|
12
|
+
/**
|
|
13
|
+
* Registers a provider in the container.
|
|
14
|
+
*/
|
|
15
|
+
register<T>(token: Token<T>, provider: Provider<T>, scope?: Scope): void;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a dependency from the container.
|
|
18
|
+
*/
|
|
19
|
+
resolve<T>(token: Token<T>): T;
|
|
20
|
+
/**
|
|
21
|
+
* Checks whether a token has been registered.
|
|
22
|
+
*/
|
|
23
|
+
has<T>(token: Token<T>): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Removes a provider from the container.
|
|
26
|
+
*
|
|
27
|
+
* Primarily useful for testing and controlled runtime scenarios.
|
|
28
|
+
*/
|
|
29
|
+
unregister<T>(token: Token<T>): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Clears all registered providers.
|
|
32
|
+
*/
|
|
33
|
+
clear(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Creates an instance from a provider definition.
|
|
36
|
+
*/
|
|
37
|
+
private createInstance;
|
|
38
|
+
/**
|
|
39
|
+
* Produces a readable representation of a dependency token.
|
|
40
|
+
*/
|
|
41
|
+
private describeToken;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/container/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAexC;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmD;IAE7E;;OAEG;IACI,QAAQ,CAAC,CAAC,EACf,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,KAAK,GAAE,KAAmB,GACzB,IAAI,CASN;IAED;;OAEG;IACI,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAuBpC;IAED;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAEtC;IAED;;;;OAIG;IACI,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAE7C;IAED;;OAEG;IACI,KAAK,IAAI,IAAI,CAEnB;IAED;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;OAEG;IACH,OAAO,CAAC,aAAa;CAetB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ProviderNotFoundError, ProviderAlreadyRegisteredError, } from "../errors/exceptions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Dependency Injection container for Zudojs applications.
|
|
4
|
+
*
|
|
5
|
+
* The container is responsible for registering and resolving
|
|
6
|
+
* application dependencies.
|
|
7
|
+
*/
|
|
8
|
+
export class Container {
|
|
9
|
+
providers = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Registers a provider in the container.
|
|
12
|
+
*/
|
|
13
|
+
register(token, provider, scope = "singleton") {
|
|
14
|
+
if (this.providers.has(token)) {
|
|
15
|
+
throw new ProviderAlreadyRegisteredError(token);
|
|
16
|
+
}
|
|
17
|
+
this.providers.set(token, {
|
|
18
|
+
provider: provider,
|
|
19
|
+
scope,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolves a dependency from the container.
|
|
24
|
+
*/
|
|
25
|
+
resolve(token) {
|
|
26
|
+
const registration = this.providers.get(token);
|
|
27
|
+
if (!registration) {
|
|
28
|
+
throw new ProviderNotFoundError(token);
|
|
29
|
+
}
|
|
30
|
+
if (registration.scope === "singleton" &&
|
|
31
|
+
registration.instance !== undefined) {
|
|
32
|
+
return registration.instance;
|
|
33
|
+
}
|
|
34
|
+
const instance = this.createInstance(registration.provider);
|
|
35
|
+
if (registration.scope === "singleton") {
|
|
36
|
+
registration.instance = instance;
|
|
37
|
+
}
|
|
38
|
+
return instance;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Checks whether a token has been registered.
|
|
42
|
+
*/
|
|
43
|
+
has(token) {
|
|
44
|
+
return this.providers.has(token);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Removes a provider from the container.
|
|
48
|
+
*
|
|
49
|
+
* Primarily useful for testing and controlled runtime scenarios.
|
|
50
|
+
*/
|
|
51
|
+
unregister(token) {
|
|
52
|
+
return this.providers.delete(token);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Clears all registered providers.
|
|
56
|
+
*/
|
|
57
|
+
clear() {
|
|
58
|
+
this.providers.clear();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates an instance from a provider definition.
|
|
62
|
+
*/
|
|
63
|
+
createInstance(provider) {
|
|
64
|
+
if ("useValue" in provider) {
|
|
65
|
+
return provider.useValue;
|
|
66
|
+
}
|
|
67
|
+
if ("useFactory" in provider) {
|
|
68
|
+
return provider.useFactory(this);
|
|
69
|
+
}
|
|
70
|
+
if ("useClass" in provider) {
|
|
71
|
+
return new provider.useClass();
|
|
72
|
+
}
|
|
73
|
+
throw new Error("Invalid provider definition.");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Produces a readable representation of a dependency token.
|
|
77
|
+
*/
|
|
78
|
+
describeToken(token) {
|
|
79
|
+
if (typeof token === "string") {
|
|
80
|
+
return token;
|
|
81
|
+
}
|
|
82
|
+
if (typeof token === "symbol") {
|
|
83
|
+
return token.description ?? token.toString();
|
|
84
|
+
}
|
|
85
|
+
if (typeof token === "function") {
|
|
86
|
+
return token.name || "anonymous class";
|
|
87
|
+
}
|
|
88
|
+
return "unknown";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/container/container.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AAWjC;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IACH,SAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;IAE7E;;OAEG;IACI,QAAQ,CACb,KAAe,EACf,QAAqB,EACrB,KAAK,GAAU,WAAW;QAE1B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,8BAA8B,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE;YACxB,QAAQ,EAAE,QAA6B;YACvC,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,OAAO,CAAI,KAAe;QAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAE/C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QAED,IACE,YAAY,CAAC,KAAK,KAAK,WAAW;YAClC,YAAY,CAAC,QAAQ,KAAK,SAAS,EACnC,CAAC;YACD,OAAO,YAAY,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AED,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC,IAAI,IAAI,iBAAiB,CAAC;QACzC,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency Injection Container.
|
|
3
|
+
*/
|
|
4
|
+
export { Container } from "./container.js";
|
|
5
|
+
export { createToken, type Token, type ConstructorToken } from "./token.js";
|
|
6
|
+
export { type Provider, type ClassProvider, type FactoryProvider, type ValueProvider, type Constructor, } from "./provider.js";
|
|
7
|
+
export { type Scope } from "./scope.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/container/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAqC,MAAM,YAAY,CAAC;AAE5E,OAAO,EAMN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAc,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Container } from "./container.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a dependency using the Zudojs dependency container.
|
|
4
|
+
*/
|
|
5
|
+
export interface FactoryProvider<T> {
|
|
6
|
+
readonly useFactory: (container: Container) => T;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provides an already-created value.
|
|
10
|
+
*/
|
|
11
|
+
export interface ValueProvider<T> {
|
|
12
|
+
readonly useValue: T;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a dependency from a class constructor.
|
|
16
|
+
*/
|
|
17
|
+
export interface ClassProvider<T> {
|
|
18
|
+
readonly useClass: Constructor<T>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Supported constructor type.
|
|
22
|
+
*/
|
|
23
|
+
export type Constructor<T> = new (...args: never[]) => T;
|
|
24
|
+
/**
|
|
25
|
+
* A dependency provider understood by the Zudojs container.
|
|
26
|
+
*/
|
|
27
|
+
export type Provider<T> = ClassProvider<T> | FactoryProvider<T> | ValueProvider<T>;
|
|
28
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/container/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IACpB,aAAa,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/container/provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the lifetime of a dependency registered
|
|
3
|
+
* with the Zudojs dependency injection container.
|
|
4
|
+
*/
|
|
5
|
+
export type Scope =
|
|
6
|
+
/**
|
|
7
|
+
* One instance for the lifetime of the application container.
|
|
8
|
+
*/
|
|
9
|
+
"singleton"
|
|
10
|
+
/**
|
|
11
|
+
* One instance for the lifetime of an execution context.
|
|
12
|
+
*
|
|
13
|
+
* Examples:
|
|
14
|
+
* HTTP request
|
|
15
|
+
* Background job
|
|
16
|
+
* Message consumption
|
|
17
|
+
* RPC request
|
|
18
|
+
*/
|
|
19
|
+
| "scoped"
|
|
20
|
+
/**
|
|
21
|
+
* A new instance every time the dependency is resolved.
|
|
22
|
+
*/
|
|
23
|
+
| "transient";
|
|
24
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/container/scope.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,KAAK;AACf;;GAEG;AACD,WAAW;AAEb;;;;;;;;GAQG;GACD,QAAQ;AAEV;;GAEG;GACD,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/container/scope.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A unique identifier used to register and resolve dependencies.
|
|
3
|
+
*
|
|
4
|
+
* Zudojs supports classes, strings, and symbols as dependency tokens.
|
|
5
|
+
*/
|
|
6
|
+
export type Token<T = unknown> = ConstructorToken<T> | string | symbol;
|
|
7
|
+
/**
|
|
8
|
+
* A class that can be used as a dependency token.
|
|
9
|
+
*/
|
|
10
|
+
export type ConstructorToken<T> = new (...args: unknown[]) => T;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a unique symbol token.
|
|
13
|
+
*
|
|
14
|
+
* Useful for interfaces and infrastructure contracts that do not
|
|
15
|
+
* exist at runtime.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createToken<T = unknown>(description: string): Token<T>;
|
|
18
|
+
//# sourceMappingURL=token.d.ts.map
|