@zudojs/core 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +141 -7
- package/dist/application/application.d.ts +43 -2
- package/dist/application/application.js +111 -13
- package/dist/application/applicationContext.context.d.ts +15 -0
- package/dist/application/applicationContext.context.js +12 -0
- package/dist/application/createApplication.d.ts +78 -0
- package/dist/application/createApplication.js +104 -0
- package/dist/application/index.d.ts +2 -1
- package/dist/application/index.js +2 -1
- package/dist/configuration/configurationManager.manager.d.ts +32 -0
- package/dist/configuration/configurationManager.manager.js +86 -7
- package/dist/configuration/core/configuration.d.ts +60 -15
- package/dist/configuration/core/configuration.js +248 -51
- package/dist/configuration/core/configurationKey.key.d.ts +4 -2
- package/dist/configuration/core/configurationKey.key.js +2 -13
- package/dist/configuration/core/configurationPath.path.d.ts +17 -0
- package/dist/configuration/core/configurationPath.path.js +33 -0
- package/dist/configuration/core/index.d.ts +7 -1
- package/dist/configuration/core/index.js +1 -0
- package/dist/configuration/error/configurationError.error.d.ts +11 -0
- package/dist/configuration/error/configurationError.error.js +29 -1
- package/dist/configuration/error/configurationRedactor.redactor.d.ts +16 -0
- package/dist/configuration/error/configurationRedactor.redactor.js +83 -5
- package/dist/configuration/error/index.d.ts +2 -1
- package/dist/configuration/error/index.js +2 -1
- package/dist/configuration/index.d.ts +1 -1
- package/dist/configuration/loader/configurationLoader.loader.d.ts +47 -9
- package/dist/configuration/loader/configurationLoader.loader.js +107 -26
- package/dist/configuration/loader/index.d.ts +1 -1
- package/dist/configuration/loader/index.js +1 -1
- package/dist/configuration/registry/configurationProvider.provider.d.ts +26 -1
- package/dist/configuration/registry/configurationProvider.provider.js +33 -7
- package/dist/configuration/registry/configurationRegistry.registry.js +2 -1
- package/dist/configuration/schema/configurationSchema.schema.d.ts +0 -4
- package/dist/configuration/schema/configurationSchema.schema.js +11 -32
- package/dist/configuration/schema/configurationValidation.validator.d.ts +14 -2
- package/dist/configuration/schema/configurationValidation.validator.js +55 -7
- package/dist/configuration/schema/index.d.ts +1 -1
- package/dist/configuration/schema/index.js +1 -1
- package/dist/container/container.d.ts +52 -5
- package/dist/container/container.js +110 -33
- package/dist/container/index.d.ts +1 -1
- package/dist/container/index.js +1 -1
- package/dist/container/scope.d.ts +7 -6
- package/dist/context/core/contextAliases.deprecated.d.ts +32 -0
- package/dist/context/core/contextAliases.deprecated.js +6 -0
- package/dist/context/core/executionContext.context.d.ts +8 -0
- package/dist/context/core/executionContext.context.js +38 -15
- package/dist/context/core/index.d.ts +2 -2
- package/dist/context/core/index.js +2 -2
- package/dist/context/index.d.ts +20 -0
- package/dist/context/index.js +20 -0
- package/dist/context/provider/contextProvider.provider.d.ts +7 -4
- package/dist/context/provider/contextProvider.provider.js +9 -6
- package/dist/context/provider/contextStorage.storage.d.ts +47 -7
- package/dist/context/provider/contextStorage.storage.js +54 -12
- package/dist/context/provider/defaultContextStorage.storage.d.ts +18 -0
- package/dist/context/provider/defaultContextStorage.storage.js +20 -0
- package/dist/context/provider/index.d.ts +2 -1
- package/dist/context/provider/index.js +1 -0
- package/dist/errors/exceptions.d.ts +22 -0
- package/dist/errors/exceptions.js +38 -1
- package/dist/errors/frameworkError.error.d.ts +6 -9
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +14 -0
- package/dist/lifecycle/core/index.d.ts +1 -1
- package/dist/lifecycle/core/index.js +1 -1
- package/dist/lifecycle/core/lifecycle.d.ts +47 -2
- package/dist/lifecycle/core/lifecycle.js +251 -85
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +8 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js +20 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +21 -2
- package/dist/lifecycle/manager/lifecycleManager.manager.js +62 -99
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +22 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.js +85 -17
- package/dist/logging/console/consoleLogger.logger.d.ts +20 -1
- package/dist/logging/console/consoleLogger.logger.js +77 -11
- package/dist/logging/console/loggerFactory.factory.d.ts +6 -5
- package/dist/logging/console/loggerFactory.factory.js +1 -7
- package/dist/logging/core/index.d.ts +4 -3
- package/dist/logging/core/index.js +4 -3
- package/dist/logging/core/logEntry.entry.d.ts +41 -3
- package/dist/logging/core/logEntry.entry.js +114 -4
- package/dist/logging/core/logLevel.level.d.ts +18 -0
- package/dist/logging/core/logLevel.level.js +25 -1
- package/dist/logging/core/logRedaction.redaction.d.ts +38 -0
- package/dist/logging/core/logRedaction.redaction.js +19 -0
- package/dist/logging/core/logger.d.ts +14 -11
- package/dist/logging/core/logger.js +31 -6
- package/dist/logging/core/loggerContext.context.d.ts +12 -0
- package/dist/logging/core/loggerContext.context.js +19 -0
- package/dist/logging/core/loggerOptions.options.d.ts +17 -0
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -6
- package/dist/modules/module.d.ts +7 -1
- package/dist/modules/moduleContext.context.d.ts +41 -7
- package/dist/modules/moduleContext.context.js +31 -8
- package/dist/modules/moduleDefinition.definition.d.ts +11 -7
- package/dist/modules/moduleDefinition.definition.js +41 -8
- package/dist/modules/moduleDependency/index.d.ts +2 -2
- package/dist/modules/moduleDependency/index.js +1 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +19 -2
- package/dist/modules/moduleDependency/moduleDependency.graph.js +122 -8
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +8 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js +85 -57
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts +28 -1
- package/dist/modules/moduleError/index.d.ts +1 -1
- package/dist/modules/moduleError/index.js +1 -1
- package/dist/modules/moduleError/moduleError.dependency.d.ts +11 -0
- package/dist/modules/moduleError/moduleError.dependency.js +15 -0
- package/dist/modules/moduleLifecycle/index.d.ts +5 -2
- package/dist/modules/moduleLifecycle/index.js +4 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +44 -6
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +153 -9
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +30 -5
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +130 -10
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +65 -28
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +15 -4
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +39 -5
- package/dist/modules/moduleLoader/moduleLoader.loader.js +123 -50
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts +4 -2
- package/dist/modules/moduleLoader/moduleLoader.type.js +10 -3
- package/dist/modules/moduleMetadata.metadata.js +15 -5
- package/dist/modules/moduleRegistry/index.d.ts +1 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +2 -2
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js +38 -6
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +18 -1
- package/dist/runtime/index.d.ts +17 -15
- package/dist/runtime/index.js +14 -10
- package/dist/runtime/runtime.d.ts +135 -33
- package/dist/runtime/runtime.js +344 -114
- package/dist/runtime/runtimeBootstrap/index.d.ts +2 -1
- package/dist/runtime/runtimeBootstrap/index.js +1 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +2 -2
- package/dist/runtime/runtimeBootstrap/pipeline/index.js +1 -2
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +41 -15
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +98 -76
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +7 -4
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +87 -59
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +10 -4
- package/dist/runtime/runtimeContext/index.d.ts +3 -5
- package/dist/runtime/runtimeContext/index.js +2 -4
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +10 -4
- package/dist/runtime/runtimeContext/runtimeContext.factory.js +30 -7
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +36 -47
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +5 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +6 -4
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +7 -9
- package/dist/runtime/runtimeEnvironment/index.d.ts +2 -2
- package/dist/runtime/runtimeEnvironment/index.js +1 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +20 -17
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +20 -13
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +12 -1
- package/dist/runtime/runtimeError/index.d.ts +3 -3
- package/dist/runtime/runtimeError/index.js +1 -1
- package/dist/runtime/runtimeError/runtimeError.base.d.ts +15 -18
- package/dist/runtime/runtimeError/runtimeError.base.js +38 -36
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +23 -8
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js +31 -7
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +1 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.js +1 -1
- package/dist/runtime/runtimeError/runtimeError.type.d.ts +5 -9
- package/dist/runtime/runtimeLogger.d.ts +2 -2
- package/dist/runtime/runtimeLogger.js +3 -3
- package/dist/runtime/runtimeOptions/index.d.ts +1 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +1 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +2 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +5 -2
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +45 -16
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +0 -1
- package/dist/runtime/runtimeShutdown/index.d.ts +3 -2
- package/dist/runtime/runtimeShutdown/index.js +2 -2
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +2 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.js +1 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +37 -7
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +77 -51
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +8 -16
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +85 -87
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +9 -5
- package/dist/runtime/runtimeSignals/index.d.ts +8 -0
- package/dist/runtime/runtimeSignals/index.js +7 -0
- package/dist/runtime/runtimeSignals/runtimeSignals.d.ts +93 -0
- package/dist/runtime/runtimeSignals/runtimeSignals.js +149 -0
- package/dist/runtime/runtimeState.state.d.ts +32 -14
- package/dist/runtime/runtimeState.state.js +34 -27
- package/dist/runtime/runtimeTimeout.d.ts +40 -0
- package/dist/runtime/runtimeTimeout.js +42 -0
- package/package.json +21 -15
- package/dist/.tsbuildinfo +0 -1
- package/dist/application/application.d.ts.map +0 -1
- package/dist/application/application.js.map +0 -1
- package/dist/application/applicationContext.context.d.ts.map +0 -1
- package/dist/application/applicationContext.context.js.map +0 -1
- package/dist/application/applicationState.state.d.ts.map +0 -1
- package/dist/application/applicationState.state.js.map +0 -1
- package/dist/application/index.d.ts.map +0 -1
- package/dist/application/index.js.map +0 -1
- package/dist/configuration/configurationManager.manager.d.ts.map +0 -1
- package/dist/configuration/configurationManager.manager.js.map +0 -1
- package/dist/configuration/core/configuration.d.ts.map +0 -1
- package/dist/configuration/core/configuration.js.map +0 -1
- package/dist/configuration/core/configurationKey.key.d.ts.map +0 -1
- package/dist/configuration/core/configurationKey.key.js.map +0 -1
- package/dist/configuration/core/configurationSource.source.d.ts.map +0 -1
- package/dist/configuration/core/configurationSource.source.js.map +0 -1
- package/dist/configuration/core/index.d.ts.map +0 -1
- package/dist/configuration/core/index.js.map +0 -1
- package/dist/configuration/error/configurationError.error.d.ts.map +0 -1
- package/dist/configuration/error/configurationError.error.js.map +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.js.map +0 -1
- package/dist/configuration/error/index.d.ts.map +0 -1
- package/dist/configuration/error/index.js.map +0 -1
- package/dist/configuration/events/configurationEvents.events.d.ts.map +0 -1
- package/dist/configuration/events/configurationEvents.events.js.map +0 -1
- package/dist/configuration/events/index.d.ts.map +0 -1
- package/dist/configuration/events/index.js.map +0 -1
- package/dist/configuration/index.d.ts.map +0 -1
- package/dist/configuration/index.js.map +0 -1
- package/dist/configuration/loader/configurationLoader.loader.d.ts.map +0 -1
- package/dist/configuration/loader/configurationLoader.loader.js.map +0 -1
- package/dist/configuration/loader/index.d.ts.map +0 -1
- package/dist/configuration/loader/index.js.map +0 -1
- package/dist/configuration/registry/configurationProvider.provider.d.ts.map +0 -1
- package/dist/configuration/registry/configurationProvider.provider.js.map +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.js.map +0 -1
- package/dist/configuration/registry/index.d.ts.map +0 -1
- package/dist/configuration/registry/index.js.map +0 -1
- package/dist/configuration/schema/configurationSchema.schema.d.ts.map +0 -1
- package/dist/configuration/schema/configurationSchema.schema.js.map +0 -1
- package/dist/configuration/schema/configurationValidation.validator.d.ts.map +0 -1
- package/dist/configuration/schema/configurationValidation.validator.js.map +0 -1
- package/dist/configuration/schema/index.d.ts.map +0 -1
- package/dist/configuration/schema/index.js.map +0 -1
- package/dist/container/container.d.ts.map +0 -1
- package/dist/container/container.js.map +0 -1
- package/dist/container/index.d.ts.map +0 -1
- package/dist/container/index.js.map +0 -1
- package/dist/container/provider.d.ts.map +0 -1
- package/dist/container/provider.js.map +0 -1
- package/dist/container/scope.d.ts.map +0 -1
- package/dist/container/scope.js.map +0 -1
- package/dist/container/token.d.ts.map +0 -1
- package/dist/container/token.js.map +0 -1
- package/dist/context/core/context.d.ts +0 -95
- package/dist/context/core/context.d.ts.map +0 -1
- package/dist/context/core/context.js +0 -103
- package/dist/context/core/context.js.map +0 -1
- package/dist/context/core/contextKey.key.d.ts.map +0 -1
- package/dist/context/core/contextKey.key.js.map +0 -1
- package/dist/context/core/executionContext.context.d.ts.map +0 -1
- package/dist/context/core/executionContext.context.js.map +0 -1
- package/dist/context/core/index.d.ts.map +0 -1
- package/dist/context/core/index.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/provider/contextProvider.provider.d.ts.map +0 -1
- package/dist/context/provider/contextProvider.provider.js.map +0 -1
- package/dist/context/provider/contextStorage.storage.d.ts.map +0 -1
- package/dist/context/provider/contextStorage.storage.js.map +0 -1
- package/dist/context/provider/index.d.ts.map +0 -1
- package/dist/context/provider/index.js.map +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.js.map +0 -1
- package/dist/context/snapshot/index.d.ts.map +0 -1
- package/dist/context/snapshot/index.js.map +0 -1
- package/dist/context/values/contextValues.values.d.ts.map +0 -1
- package/dist/context/values/contextValues.values.js.map +0 -1
- package/dist/context/values/index.d.ts.map +0 -1
- package/dist/context/values/index.js.map +0 -1
- package/dist/contracts/adapter.d.ts.map +0 -1
- package/dist/contracts/adapter.js.map +0 -1
- package/dist/contracts/disposable.d.ts.map +0 -1
- package/dist/contracts/disposable.js.map +0 -1
- package/dist/contracts/handler.d.ts.map +0 -1
- package/dist/contracts/handler.js.map +0 -1
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/errors/errorCode.code.d.ts.map +0 -1
- package/dist/errors/errorCode.code.js.map +0 -1
- package/dist/errors/exceptions.d.ts.map +0 -1
- package/dist/errors/exceptions.js.map +0 -1
- package/dist/errors/frameworkError.error.d.ts.map +0 -1
- package/dist/errors/frameworkError.error.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lifecycle/core/index.d.ts.map +0 -1
- package/dist/lifecycle/core/index.js.map +0 -1
- package/dist/lifecycle/core/lifecycle.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycle.js.map +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.js.map +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +0 -1
- package/dist/lifecycle/core/lifecycleState.state.d.ts +0 -2
- package/dist/lifecycle/core/lifecycleState.state.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleState.state.js +0 -2
- package/dist/lifecycle/core/lifecycleState.state.js.map +0 -1
- package/dist/lifecycle/index.d.ts.map +0 -1
- package/dist/lifecycle/index.js.map +0 -1
- package/dist/lifecycle/manager/index.d.ts.map +0 -1
- package/dist/lifecycle/manager/index.js.map +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.js.map +0 -1
- package/dist/lifecycle/scope/index.d.ts.map +0 -1
- package/dist/lifecycle/scope/index.js.map +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.js.map +0 -1
- package/dist/logging/console/consoleLogger.logger.d.ts.map +0 -1
- package/dist/logging/console/consoleLogger.logger.js.map +0 -1
- package/dist/logging/console/index.d.ts.map +0 -1
- package/dist/logging/console/index.js.map +0 -1
- package/dist/logging/console/loggerFactory.factory.d.ts.map +0 -1
- package/dist/logging/console/loggerFactory.factory.js.map +0 -1
- package/dist/logging/core/index.d.ts.map +0 -1
- package/dist/logging/core/index.js.map +0 -1
- package/dist/logging/core/logEntry.entry.d.ts.map +0 -1
- package/dist/logging/core/logEntry.entry.js.map +0 -1
- package/dist/logging/core/logLevel.level.d.ts.map +0 -1
- package/dist/logging/core/logLevel.level.js.map +0 -1
- package/dist/logging/core/logger.d.ts.map +0 -1
- package/dist/logging/core/logger.js.map +0 -1
- package/dist/logging/core/loggerContext.context.d.ts.map +0 -1
- package/dist/logging/core/loggerContext.context.js.map +0 -1
- package/dist/logging/core/loggerOptions.options.d.ts.map +0 -1
- package/dist/logging/core/loggerOptions.options.js.map +0 -1
- package/dist/logging/index.d.ts.map +0 -1
- package/dist/logging/index.js.map +0 -1
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/modules/index.js.map +0 -1
- package/dist/modules/module.d.ts.map +0 -1
- package/dist/modules/module.js.map +0 -1
- package/dist/modules/moduleContext.context.d.ts.map +0 -1
- package/dist/modules/moduleContext.context.js.map +0 -1
- package/dist/modules/moduleDefinition.definition.d.ts.map +0 -1
- package/dist/modules/moduleDefinition.definition.js.map +0 -1
- package/dist/modules/moduleDependency/index.d.ts.map +0 -1
- package/dist/modules/moduleDependency/index.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.js.map +0 -1
- package/dist/modules/moduleError/index.d.ts.map +0 -1
- package/dist/modules/moduleError/index.js.map +0 -1
- package/dist/modules/moduleError/moduleError.base.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.base.js.map +0 -1
- package/dist/modules/moduleError/moduleError.dependency.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.dependency.js.map +0 -1
- package/dist/modules/moduleError/moduleError.helpers.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.helpers.js.map +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.js.map +0 -1
- package/dist/modules/moduleError/moduleError.registration.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.registration.js.map +0 -1
- package/dist/modules/moduleLifecycle/index.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/index.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +0 -1
- package/dist/modules/moduleLoader/index.d.ts.map +0 -1
- package/dist/modules/moduleLoader/index.js.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.js.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.js.map +0 -1
- package/dist/modules/moduleMetadata.metadata.d.ts.map +0 -1
- package/dist/modules/moduleMetadata.metadata.js.map +0 -1
- package/dist/modules/moduleRegistry/index.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/index.js.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/index.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/index.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +0 -6
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +0 -27
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +0 -1
- package/dist/runtime/runtimeContext/index.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/index.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +0 -38
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.core.js +0 -99
- package/dist/runtime/runtimeContext/runtimeContext.core.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/index.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/index.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +0 -1
- package/dist/runtime/runtimeError/index.d.ts.map +0 -1
- package/dist/runtime/runtimeError/index.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.js.map +0 -1
- package/dist/runtime/runtimeLogger.d.ts.map +0 -1
- package/dist/runtime/runtimeLogger.js.map +0 -1
- package/dist/runtime/runtimeManager/index.d.ts +0 -12
- package/dist/runtime/runtimeManager/index.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/index.js +0 -11
- package/dist/runtime/runtimeManager/index.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +0 -31
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.core.js +0 -136
- package/dist/runtime/runtimeManager/runtimeManager.core.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +0 -14
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.error.js +0 -21
- package/dist/runtime/runtimeManager/runtimeManager.error.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +0 -7
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.factory.js +0 -8
- package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +0 -16
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +0 -49
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +0 -54
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.type.js +0 -2
- package/dist/runtime/runtimeManager/runtimeManager.type.js.map +0 -1
- package/dist/runtime/runtimeOptions/index.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/index.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +0 -1
- package/dist/runtime/runtimeShutdown/index.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/index.js.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.js.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +0 -1
- package/dist/runtime/runtimeState.state.d.ts.map +0 -1
- package/dist/runtime/runtimeState.state.js.map +0 -1
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
export const DEFAULT_SENSITIVE_PATTERNS = [
|
|
8
8
|
"password",
|
|
9
9
|
"passwd",
|
|
10
|
+
"pwd",
|
|
11
|
+
"passphrase",
|
|
10
12
|
"secret",
|
|
11
13
|
"token",
|
|
12
14
|
"access_token",
|
|
@@ -17,8 +19,12 @@ export const DEFAULT_SENSITIVE_PATTERNS = [
|
|
|
17
19
|
"privatekey",
|
|
18
20
|
"client_secret",
|
|
19
21
|
"authorization",
|
|
22
|
+
"auth",
|
|
20
23
|
"credential",
|
|
21
24
|
"credentials",
|
|
25
|
+
"dsn",
|
|
26
|
+
"connectionstring",
|
|
27
|
+
"connection_string",
|
|
22
28
|
];
|
|
23
29
|
/**
|
|
24
30
|
* Default value used when a sensitive configuration value
|
|
@@ -62,7 +68,11 @@ export class ConfigurationRedactor {
|
|
|
62
68
|
reason: "exact-path",
|
|
63
69
|
};
|
|
64
70
|
}
|
|
65
|
-
|
|
71
|
+
/*
|
|
72
|
+
* Pattern matching runs on the original casing so camelCase
|
|
73
|
+
* word boundaries (apiToken → api token) survive.
|
|
74
|
+
*/
|
|
75
|
+
const pathSegments = path.trim().split(".");
|
|
66
76
|
for (const segment of pathSegments) {
|
|
67
77
|
if (this.matchesSensitivePattern(segment)) {
|
|
68
78
|
return {
|
|
@@ -71,7 +81,7 @@ export class ConfigurationRedactor {
|
|
|
71
81
|
};
|
|
72
82
|
}
|
|
73
83
|
}
|
|
74
|
-
if (this.matchesSensitivePattern(
|
|
84
|
+
if (this.matchesSensitivePattern(path.trim())) {
|
|
75
85
|
return {
|
|
76
86
|
sensitive: true,
|
|
77
87
|
reason: "pattern",
|
|
@@ -129,7 +139,12 @@ export class ConfigurationRedactor {
|
|
|
129
139
|
}
|
|
130
140
|
return value.map((item, index) => this.redactValue(item, parentPath ? `${parentPath}.${index}` : String(index)));
|
|
131
141
|
}
|
|
132
|
-
|
|
142
|
+
/*
|
|
143
|
+
* The result is built with a null prototype so keys such as
|
|
144
|
+
* "__proto__" are stored as ordinary own properties instead
|
|
145
|
+
* of hitting Object.prototype setters and vanishing.
|
|
146
|
+
*/
|
|
147
|
+
const result = Object.create(null);
|
|
133
148
|
for (const [key, childValue] of Object.entries(value)) {
|
|
134
149
|
const path = parentPath ? `${parentPath}.${key}` : key;
|
|
135
150
|
if (this.isSensitive(path)) {
|
|
@@ -143,11 +158,74 @@ export class ConfigurationRedactor {
|
|
|
143
158
|
/**
|
|
144
159
|
* Checks whether a path segment matches one of the
|
|
145
160
|
* configured sensitive patterns.
|
|
161
|
+
*
|
|
162
|
+
* Matching is word-boundary aware: the segment is split into
|
|
163
|
+
* words on separators and camelCase transitions, and a pattern
|
|
164
|
+
* matches only when a consecutive run of words spells it out.
|
|
165
|
+
* This means "apiToken" and "access_token" match "token", but
|
|
166
|
+
* "tokenizer" and "secretary" do not match "token"/"secret".
|
|
146
167
|
*/
|
|
147
168
|
matchesSensitivePattern(value) {
|
|
148
|
-
const
|
|
149
|
-
|
|
169
|
+
const words = splitWords(value);
|
|
170
|
+
if (words.length === 0) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return this.sensitivePatterns.some((pattern) => matchesWordRun(words, pattern));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Redacts sensitive-looking fragments from free-form text such
|
|
177
|
+
* as error messages.
|
|
178
|
+
*
|
|
179
|
+
* Occurrences of "<sensitive>=value", "<sensitive>: value", and
|
|
180
|
+
* "<sensitive> value" have their value replaced. This is a
|
|
181
|
+
* best-effort scrub for diagnostics; it does not guarantee that
|
|
182
|
+
* arbitrary text contains no secrets.
|
|
183
|
+
*/
|
|
184
|
+
redactText(text) {
|
|
185
|
+
let result = text;
|
|
186
|
+
for (const pattern of this.sensitivePatterns) {
|
|
187
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
188
|
+
const expression = new RegExp(`(${escaped}[a-z0-9_-]*\\s*[=:]\\s*)("[^"]*"|'[^']*'|\\S+)`, "gi");
|
|
189
|
+
result = result.replace(expression, `$1${this.redactionValue}`);
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Splits an identifier into normalized lowercase words.
|
|
196
|
+
*
|
|
197
|
+
* Splitting occurs on non-alphanumeric separators and on
|
|
198
|
+
* camelCase transitions.
|
|
199
|
+
*/
|
|
200
|
+
function splitWords(value) {
|
|
201
|
+
return value
|
|
202
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
203
|
+
.split(/[^a-zA-Z0-9]+/)
|
|
204
|
+
.map((word) => word.toLowerCase())
|
|
205
|
+
.filter((word) => word.length > 0);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Checks whether a consecutive run of words spells out
|
|
209
|
+
* the supplied pattern.
|
|
210
|
+
*/
|
|
211
|
+
function matchesWordRun(words, pattern) {
|
|
212
|
+
const target = splitWords(pattern).join("");
|
|
213
|
+
if (!target) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
for (let start = 0; start < words.length; start++) {
|
|
217
|
+
let accumulated = "";
|
|
218
|
+
for (let index = start; index < words.length; index++) {
|
|
219
|
+
accumulated += words[index];
|
|
220
|
+
if (accumulated === target) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
if (accumulated.length >= target.length) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
150
227
|
}
|
|
228
|
+
return false;
|
|
151
229
|
}
|
|
152
230
|
/**
|
|
153
231
|
* Creates a ConfigurationRedactor.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configuration errors and redaction.
|
|
5
5
|
*/
|
|
6
|
-
export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
|
|
6
|
+
export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationPathError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
|
|
7
|
+
export { describeConfigurationCause } from "./configurationError.error.js";
|
|
7
8
|
export type { ConfigurationErrorIssue } from "./configurationError.error.js";
|
|
8
9
|
export { ConfigurationRedactor, createConfigurationRedactor, redactConfiguration, DEFAULT_SENSITIVE_PATTERNS, DEFAULT_REDACTION_VALUE, } from "./configurationRedactor.redactor.js";
|
|
9
10
|
export type { ConfigurationRedactorOptions, ConfigurationSensitivity, RedactedConfiguration, } from "./configurationRedactor.redactor.js";
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configuration errors and redaction.
|
|
5
5
|
*/
|
|
6
|
-
export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
|
|
6
|
+
export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationPathError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
|
|
7
|
+
export { describeConfigurationCause } from "./configurationError.error.js";
|
|
7
8
|
export { ConfigurationRedactor, createConfigurationRedactor, redactConfiguration, DEFAULT_SENSITIVE_PATTERNS, DEFAULT_REDACTION_VALUE, } from "./configurationRedactor.redactor.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,7 +22,7 @@ export * from "./error/index.js";
|
|
|
22
22
|
* Configuration manager.
|
|
23
23
|
*/
|
|
24
24
|
export { ConfigurationManager, ConfigurationManagerState, createConfigurationManager, } from "./configurationManager.manager.js";
|
|
25
|
-
export type { ConfigurationManagerOptions, ConfigurationManagerResult, } from "./configurationManager.manager.js";
|
|
25
|
+
export type { ConfigurationManagerOptions, ConfigurationManagerResult, ConfigurationEventSubscription, } from "./configurationManager.manager.js";
|
|
26
26
|
/**
|
|
27
27
|
* Configuration lifecycle events.
|
|
28
28
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Configuration } from "../core/configuration.js";
|
|
2
|
-
import type { ConfigurationSource } from "../core/configurationSource.source.js";
|
|
2
|
+
import type { ConfigurationSource, ConfigurationSourceEntry } from "../core/configurationSource.source.js";
|
|
3
|
+
import { ConfigurationSourceError } from "../error/configurationError.error.js";
|
|
3
4
|
/**
|
|
4
5
|
* Options for loading configuration.
|
|
5
6
|
*/
|
|
@@ -35,6 +36,13 @@ export interface ConfigurationLoadResult {
|
|
|
35
36
|
*/
|
|
36
37
|
readonly entryCount: number;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Applies entries from one source onto a configuration.
|
|
41
|
+
*
|
|
42
|
+
* Higher level components (loader, provider) share this logic so
|
|
43
|
+
* source precedence behaves identically everywhere.
|
|
44
|
+
*/
|
|
45
|
+
export declare function applyConfigurationSourceEntries(configuration: Configuration, source: ConfigurationSource, entries: readonly ConfigurationSourceEntry[]): Configuration;
|
|
38
46
|
/**
|
|
39
47
|
* Loads and combines configuration from multiple sources.
|
|
40
48
|
*
|
|
@@ -51,8 +59,14 @@ export declare class ConfigurationLoader {
|
|
|
51
59
|
* Sources are ordered by ascending priority.
|
|
52
60
|
* Higher priority sources are therefore applied later
|
|
53
61
|
* and override lower priority values.
|
|
62
|
+
*
|
|
63
|
+
* Additional sources (for example, sources registered with a
|
|
64
|
+
* ConfigurationRegistry) can be supplied; they are merged with
|
|
65
|
+
* the loader's own sources and ordered by priority. When an
|
|
66
|
+
* extra source shares a name with a registered source, the
|
|
67
|
+
* loader's own source wins.
|
|
54
68
|
*/
|
|
55
|
-
load(): Promise<ConfigurationLoadResult>;
|
|
69
|
+
load(extraSources?: readonly ConfigurationSource[]): Promise<ConfigurationLoadResult>;
|
|
56
70
|
/**
|
|
57
71
|
* Loads sources sequentially.
|
|
58
72
|
*
|
|
@@ -65,16 +79,15 @@ export declare class ConfigurationLoader {
|
|
|
65
79
|
* Even though loading happens concurrently, entries are
|
|
66
80
|
* applied according to source priority to preserve
|
|
67
81
|
* deterministic precedence.
|
|
82
|
+
*
|
|
83
|
+
* All sources are attempted; when any fail, a single
|
|
84
|
+
* aggregated error listing every failed source is thrown.
|
|
68
85
|
*/
|
|
69
86
|
private loadConcurrently;
|
|
70
87
|
/**
|
|
71
88
|
* Loads a single configuration source.
|
|
72
89
|
*/
|
|
73
90
|
private loadSource;
|
|
74
|
-
/**
|
|
75
|
-
* Applies source entries to the configuration.
|
|
76
|
-
*/
|
|
77
|
-
private applyEntries;
|
|
78
91
|
/**
|
|
79
92
|
* Returns sources ordered by priority.
|
|
80
93
|
*
|
|
@@ -100,11 +113,36 @@ export declare class ConfigurationLoader {
|
|
|
100
113
|
clearSources(): void;
|
|
101
114
|
}
|
|
102
115
|
/**
|
|
103
|
-
* Error thrown when
|
|
116
|
+
* Error thrown when one or more configuration sources cannot
|
|
117
|
+
* be loaded.
|
|
118
|
+
*
|
|
119
|
+
* A ConfigurationSourceError (code CONFIGURATION_LOAD_FAILED)
|
|
120
|
+
* that additionally carries the failed source object(s), so
|
|
121
|
+
* callers can catch load failures by either type or by code. Raw
|
|
122
|
+
* cause text is redacted before being embedded in the message.
|
|
104
123
|
*/
|
|
105
|
-
export declare class ConfigurationLoadError extends
|
|
106
|
-
|
|
124
|
+
export declare class ConfigurationLoadError extends ConfigurationSourceError {
|
|
125
|
+
/**
|
|
126
|
+
* The source that failed, for single-source failures.
|
|
127
|
+
*/
|
|
128
|
+
readonly source?: ConfigurationSource;
|
|
129
|
+
/**
|
|
130
|
+
* Every failed source, for aggregate failures. Contains a
|
|
131
|
+
* single element for single-source failures.
|
|
132
|
+
*/
|
|
133
|
+
readonly failures: readonly {
|
|
134
|
+
readonly source: ConfigurationSource;
|
|
135
|
+
readonly error: unknown;
|
|
136
|
+
}[];
|
|
107
137
|
constructor(source: ConfigurationSource, cause: unknown);
|
|
138
|
+
/**
|
|
139
|
+
* Creates a single aggregated load error listing every
|
|
140
|
+
* failed source.
|
|
141
|
+
*/
|
|
142
|
+
static aggregate(failures: readonly {
|
|
143
|
+
readonly source: ConfigurationSource;
|
|
144
|
+
readonly error: unknown;
|
|
145
|
+
}[]): ConfigurationLoadError;
|
|
108
146
|
}
|
|
109
147
|
/**
|
|
110
148
|
* Creates a ConfigurationLoader.
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { Configuration } from "../core/configuration.js";
|
|
2
|
+
import { sortConfigurationSources } from "../core/configurationSource.source.js";
|
|
3
|
+
import { ConfigurationSourceError, describeConfigurationCause, } from "../error/configurationError.error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Applies entries from one source onto a configuration.
|
|
6
|
+
*
|
|
7
|
+
* Higher level components (loader, provider) share this logic so
|
|
8
|
+
* source precedence behaves identically everywhere.
|
|
9
|
+
*/
|
|
10
|
+
export function applyConfigurationSourceEntries(configuration, source, entries) {
|
|
11
|
+
let result = configuration;
|
|
12
|
+
for (const entry of entries) {
|
|
13
|
+
const path = entry.path.trim();
|
|
14
|
+
if (!path) {
|
|
15
|
+
throw new ConfigurationLoadError(source, new Error("Configuration entry path cannot be empty."));
|
|
16
|
+
}
|
|
17
|
+
result = result.with(path, entry.value, source.type);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
2
21
|
/**
|
|
3
22
|
* Loads and combines configuration from multiple sources.
|
|
4
23
|
*
|
|
@@ -18,9 +37,15 @@ export class ConfigurationLoader {
|
|
|
18
37
|
* Sources are ordered by ascending priority.
|
|
19
38
|
* Higher priority sources are therefore applied later
|
|
20
39
|
* and override lower priority values.
|
|
40
|
+
*
|
|
41
|
+
* Additional sources (for example, sources registered with a
|
|
42
|
+
* ConfigurationRegistry) can be supplied; they are merged with
|
|
43
|
+
* the loader's own sources and ordered by priority. When an
|
|
44
|
+
* extra source shares a name with a registered source, the
|
|
45
|
+
* loader's own source wins.
|
|
21
46
|
*/
|
|
22
|
-
async load() {
|
|
23
|
-
const sources = this.getSortedSources();
|
|
47
|
+
async load(extraSources = []) {
|
|
48
|
+
const sources = this.getSortedSources(extraSources);
|
|
24
49
|
if (this.sequential) {
|
|
25
50
|
return this.loadSequentially(sources);
|
|
26
51
|
}
|
|
@@ -36,7 +61,7 @@ export class ConfigurationLoader {
|
|
|
36
61
|
let entryCount = 0;
|
|
37
62
|
for (const source of sources) {
|
|
38
63
|
const entries = await this.loadSource(source);
|
|
39
|
-
configuration =
|
|
64
|
+
configuration = applyConfigurationSourceEntries(configuration, source, entries);
|
|
40
65
|
entryCount += entries.length;
|
|
41
66
|
}
|
|
42
67
|
return {
|
|
@@ -51,16 +76,32 @@ export class ConfigurationLoader {
|
|
|
51
76
|
* Even though loading happens concurrently, entries are
|
|
52
77
|
* applied according to source priority to preserve
|
|
53
78
|
* deterministic precedence.
|
|
79
|
+
*
|
|
80
|
+
* All sources are attempted; when any fail, a single
|
|
81
|
+
* aggregated error listing every failed source is thrown.
|
|
54
82
|
*/
|
|
55
83
|
async loadConcurrently(sources) {
|
|
56
|
-
const
|
|
84
|
+
const settled = await Promise.allSettled(sources.map(async (source) => ({
|
|
57
85
|
source,
|
|
58
86
|
entries: await this.loadSource(source),
|
|
59
87
|
})));
|
|
88
|
+
const failures = [];
|
|
89
|
+
const loaded = [];
|
|
90
|
+
for (let index = 0; index < settled.length; index++) {
|
|
91
|
+
const result = settled[index];
|
|
92
|
+
if (result.status === "fulfilled") {
|
|
93
|
+
loaded.push(result.value);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
failures.push({ source: sources[index], error: result.reason });
|
|
97
|
+
}
|
|
98
|
+
if (failures.length > 0) {
|
|
99
|
+
throw ConfigurationLoadError.aggregate(failures);
|
|
100
|
+
}
|
|
60
101
|
let configuration = new Configuration();
|
|
61
102
|
let entryCount = 0;
|
|
62
103
|
for (const result of loaded) {
|
|
63
|
-
configuration =
|
|
104
|
+
configuration = applyConfigurationSourceEntries(configuration, result.source, result.entries);
|
|
64
105
|
entryCount += result.entries.length;
|
|
65
106
|
}
|
|
66
107
|
return {
|
|
@@ -81,28 +122,21 @@ export class ConfigurationLoader {
|
|
|
81
122
|
throw new ConfigurationLoadError(source, error);
|
|
82
123
|
}
|
|
83
124
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Applies source entries to the configuration.
|
|
86
|
-
*/
|
|
87
|
-
applyEntries(configuration, entries, source) {
|
|
88
|
-
let result = configuration;
|
|
89
|
-
for (const entry of entries) {
|
|
90
|
-
const path = entry.path.trim();
|
|
91
|
-
if (!path) {
|
|
92
|
-
throw new ConfigurationLoadError(source, new Error("Configuration entry path cannot be empty."));
|
|
93
|
-
}
|
|
94
|
-
result = result.with(path, entry.value, source.type);
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
125
|
/**
|
|
99
126
|
* Returns sources ordered by priority.
|
|
100
127
|
*
|
|
101
128
|
* Lower priority sources are loaded first.
|
|
102
129
|
* Higher priority sources override them.
|
|
103
130
|
*/
|
|
104
|
-
getSortedSources() {
|
|
105
|
-
|
|
131
|
+
getSortedSources(extraSources = []) {
|
|
132
|
+
const merged = new Map();
|
|
133
|
+
for (const source of extraSources) {
|
|
134
|
+
merged.set(source.name, source);
|
|
135
|
+
}
|
|
136
|
+
for (const source of this.sources) {
|
|
137
|
+
merged.set(source.name, source);
|
|
138
|
+
}
|
|
139
|
+
return sortConfigurationSources([...merged.values()]);
|
|
106
140
|
}
|
|
107
141
|
/**
|
|
108
142
|
* Adds a configuration source.
|
|
@@ -135,15 +169,62 @@ export class ConfigurationLoader {
|
|
|
135
169
|
}
|
|
136
170
|
}
|
|
137
171
|
/**
|
|
138
|
-
* Error thrown when
|
|
172
|
+
* Error thrown when one or more configuration sources cannot
|
|
173
|
+
* be loaded.
|
|
174
|
+
*
|
|
175
|
+
* A ConfigurationSourceError (code CONFIGURATION_LOAD_FAILED)
|
|
176
|
+
* that additionally carries the failed source object(s), so
|
|
177
|
+
* callers can catch load failures by either type or by code. Raw
|
|
178
|
+
* cause text is redacted before being embedded in the message.
|
|
139
179
|
*/
|
|
140
|
-
export class ConfigurationLoadError extends
|
|
180
|
+
export class ConfigurationLoadError extends ConfigurationSourceError {
|
|
181
|
+
/**
|
|
182
|
+
* The source that failed, for single-source failures.
|
|
183
|
+
*/
|
|
141
184
|
source;
|
|
185
|
+
/**
|
|
186
|
+
* Every failed source, for aggregate failures. Contains a
|
|
187
|
+
* single element for single-source failures.
|
|
188
|
+
*/
|
|
189
|
+
failures;
|
|
142
190
|
constructor(source, cause) {
|
|
143
|
-
|
|
144
|
-
|
|
191
|
+
super(source.name, source.type, cause);
|
|
192
|
+
this.name = "ConfigurationLoadError";
|
|
145
193
|
this.source = source;
|
|
146
|
-
this.
|
|
194
|
+
this.failures = Object.freeze([{ source, error: cause }]);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Creates a single aggregated load error listing every
|
|
198
|
+
* failed source.
|
|
199
|
+
*/
|
|
200
|
+
static aggregate(failures) {
|
|
201
|
+
if (failures.length === 1) {
|
|
202
|
+
const failure = failures[0];
|
|
203
|
+
const single = failure.error;
|
|
204
|
+
if (single instanceof ConfigurationLoadError)
|
|
205
|
+
return single;
|
|
206
|
+
return new ConfigurationLoadError(failure.source, single);
|
|
207
|
+
}
|
|
208
|
+
const first = failures[0];
|
|
209
|
+
const error = new ConfigurationLoadError(first.source, first.error);
|
|
210
|
+
const summary = failures
|
|
211
|
+
.map((failure) => `"${failure.source.name}": ${describeConfigurationCause(failure.error instanceof ConfigurationLoadError
|
|
212
|
+
? (failure.error.cause ?? failure.error)
|
|
213
|
+
: failure.error)}`)
|
|
214
|
+
.join("; ");
|
|
215
|
+
Object.defineProperty(error, "message", {
|
|
216
|
+
value: `Failed to load ${failures.length} configuration sources: ${summary}`,
|
|
217
|
+
configurable: true,
|
|
218
|
+
writable: true,
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(error, "failures", {
|
|
221
|
+
value: Object.freeze(failures.map((failure) => ({
|
|
222
|
+
source: failure.source,
|
|
223
|
+
error: failure.error,
|
|
224
|
+
}))),
|
|
225
|
+
configurable: true,
|
|
226
|
+
});
|
|
227
|
+
return error;
|
|
147
228
|
}
|
|
148
229
|
}
|
|
149
230
|
/**
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configuration loading pipeline.
|
|
5
5
|
*/
|
|
6
|
-
export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, } from "./configurationLoader.loader.js";
|
|
6
|
+
export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, applyConfigurationSourceEntries, } from "./configurationLoader.loader.js";
|
|
7
7
|
export type { ConfigurationLoaderOptions, ConfigurationLoadResult, } from "./configurationLoader.loader.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configuration loading pipeline.
|
|
5
5
|
*/
|
|
6
|
-
export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, } from "./configurationLoader.loader.js";
|
|
6
|
+
export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, applyConfigurationSourceEntries, } from "./configurationLoader.loader.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -43,6 +43,15 @@ export interface ConfigurationProvider {
|
|
|
43
43
|
* registered with the provider.
|
|
44
44
|
*/
|
|
45
45
|
getSources(): readonly ConfigurationSource[];
|
|
46
|
+
/**
|
|
47
|
+
* Replaces the provider's active configuration.
|
|
48
|
+
*
|
|
49
|
+
* Optional: providers that build configuration exclusively
|
|
50
|
+
* from their own sources may omit it. When present, it is used
|
|
51
|
+
* by ConfigurationManager to push loaded configuration into
|
|
52
|
+
* the provider.
|
|
53
|
+
*/
|
|
54
|
+
setConfiguration?(configuration: Configuration): void;
|
|
46
55
|
}
|
|
47
56
|
/**
|
|
48
57
|
* Options used to create a ConfigurationProvider.
|
|
@@ -65,7 +74,15 @@ export interface ConfigurationProviderOptions {
|
|
|
65
74
|
*/
|
|
66
75
|
export declare class DefaultConfigurationProvider implements ConfigurationProvider {
|
|
67
76
|
private configuration;
|
|
77
|
+
/**
|
|
78
|
+
* Configuration supplied at construction time.
|
|
79
|
+
*
|
|
80
|
+
* Reloads layer source values on top of this configuration so
|
|
81
|
+
* programmatic defaults survive a reload.
|
|
82
|
+
*/
|
|
83
|
+
private readonly initialConfiguration;
|
|
68
84
|
private readonly sources;
|
|
85
|
+
private reloadPromise;
|
|
69
86
|
constructor(options?: ConfigurationProviderOptions);
|
|
70
87
|
/**
|
|
71
88
|
* Returns the current configuration.
|
|
@@ -95,9 +112,17 @@ export declare class DefaultConfigurationProvider implements ConfigurationProvid
|
|
|
95
112
|
* Reloads configuration from all registered sources.
|
|
96
113
|
*
|
|
97
114
|
* Sources are loaded according to priority. Higher priority
|
|
98
|
-
* sources override values from lower priority sources.
|
|
115
|
+
* sources override values from lower priority sources. Values
|
|
116
|
+
* are layered on top of the initial configuration so
|
|
117
|
+
* programmatic defaults are preserved.
|
|
118
|
+
*
|
|
119
|
+
* Concurrent reload calls share a single in-flight reload.
|
|
99
120
|
*/
|
|
100
121
|
reload(): Promise<Configuration>;
|
|
122
|
+
/**
|
|
123
|
+
* Executes one reload pass.
|
|
124
|
+
*/
|
|
125
|
+
private performReload;
|
|
101
126
|
/**
|
|
102
127
|
* Returns the registered configuration sources.
|
|
103
128
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Configuration } from "../core/configuration.js";
|
|
2
|
+
import { sortConfigurationSources } from "../core/configurationSource.source.js";
|
|
3
|
+
import { applyConfigurationSourceEntries } from "../loader/configurationLoader.loader.js";
|
|
2
4
|
/**
|
|
3
5
|
* Default implementation of ConfigurationProvider.
|
|
4
6
|
*
|
|
@@ -7,9 +9,18 @@ import { Configuration } from "../core/configuration.js";
|
|
|
7
9
|
*/
|
|
8
10
|
export class DefaultConfigurationProvider {
|
|
9
11
|
configuration;
|
|
12
|
+
/**
|
|
13
|
+
* Configuration supplied at construction time.
|
|
14
|
+
*
|
|
15
|
+
* Reloads layer source values on top of this configuration so
|
|
16
|
+
* programmatic defaults survive a reload.
|
|
17
|
+
*/
|
|
18
|
+
initialConfiguration;
|
|
10
19
|
sources;
|
|
20
|
+
reloadPromise;
|
|
11
21
|
constructor(options = {}) {
|
|
12
|
-
this.
|
|
22
|
+
this.initialConfiguration = options.configuration ?? new Configuration();
|
|
23
|
+
this.configuration = this.initialConfiguration;
|
|
13
24
|
this.sources = [...(options.sources ?? [])];
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
@@ -52,16 +63,31 @@ export class DefaultConfigurationProvider {
|
|
|
52
63
|
* Reloads configuration from all registered sources.
|
|
53
64
|
*
|
|
54
65
|
* Sources are loaded according to priority. Higher priority
|
|
55
|
-
* sources override values from lower priority sources.
|
|
66
|
+
* sources override values from lower priority sources. Values
|
|
67
|
+
* are layered on top of the initial configuration so
|
|
68
|
+
* programmatic defaults are preserved.
|
|
69
|
+
*
|
|
70
|
+
* Concurrent reload calls share a single in-flight reload.
|
|
56
71
|
*/
|
|
57
72
|
async reload() {
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
if (this.reloadPromise) {
|
|
74
|
+
return this.reloadPromise;
|
|
75
|
+
}
|
|
76
|
+
const reload = this.performReload().finally(() => {
|
|
77
|
+
this.reloadPromise = undefined;
|
|
78
|
+
});
|
|
79
|
+
this.reloadPromise = reload;
|
|
80
|
+
return reload;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Executes one reload pass.
|
|
84
|
+
*/
|
|
85
|
+
async performReload() {
|
|
86
|
+
const sources = sortConfigurationSources(this.sources);
|
|
87
|
+
let configuration = this.initialConfiguration;
|
|
60
88
|
for (const source of sources) {
|
|
61
89
|
const entries = await source.load();
|
|
62
|
-
|
|
63
|
-
configuration = configuration.with(entry.path, entry.value, source.type);
|
|
64
|
-
}
|
|
90
|
+
configuration = applyConfigurationSourceEntries(configuration, source, entries);
|
|
65
91
|
}
|
|
66
92
|
this.configuration = configuration;
|
|
67
93
|
return configuration;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Configuration } from "../core/configuration.js";
|
|
2
|
+
import { normalizeConfigurationPath } from "../core/configurationPath.path.js";
|
|
2
3
|
/**
|
|
3
4
|
* Registry containing configuration sources and sections
|
|
4
5
|
* registered by the framework and application modules.
|
|
@@ -62,7 +63,7 @@ export class ConfigurationRegistry {
|
|
|
62
63
|
if (this.sections.has(name)) {
|
|
63
64
|
throw new Error(`Configuration section "${name}" is already registered.`);
|
|
64
65
|
}
|
|
65
|
-
const path = (options.path ?? name)
|
|
66
|
+
const path = normalizeConfigurationPath(options.path ?? name);
|
|
66
67
|
if (!path) {
|
|
67
68
|
throw new Error(`Configuration path for section "${name}" cannot be empty.`);
|
|
68
69
|
}
|
|
@@ -152,8 +152,4 @@ export declare class ConfigurationSchemaRegistry {
|
|
|
152
152
|
* Creates a schema registry.
|
|
153
153
|
*/
|
|
154
154
|
export declare function createConfigurationSchemaRegistry(): ConfigurationSchemaRegistry;
|
|
155
|
-
/**
|
|
156
|
-
* Validates every registered schema against a configuration.
|
|
157
|
-
*/
|
|
158
|
-
export declare function validateConfiguration(configuration: Configuration, registry: ConfigurationSchemaRegistry): Promise<ConfigurationValidationResult<Configuration>>;
|
|
159
155
|
//# sourceMappingURL=configurationSchema.schema.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeConfigurationPath } from "../core/configurationPath.path.js";
|
|
1
2
|
/**
|
|
2
3
|
* Creates a configuration schema.
|
|
3
4
|
*/
|
|
@@ -16,6 +17,16 @@ export function createConfigurationSchema(options) {
|
|
|
16
17
|
const exists = configuration.has(path);
|
|
17
18
|
if (!exists) {
|
|
18
19
|
if (options.defaultValue !== undefined) {
|
|
20
|
+
/*
|
|
21
|
+
* Defaults are validated too, so an invalid default
|
|
22
|
+
* cannot silently pass validation.
|
|
23
|
+
*/
|
|
24
|
+
if (options.validator) {
|
|
25
|
+
return options.validator(options.defaultValue, {
|
|
26
|
+
configuration,
|
|
27
|
+
path,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
19
30
|
return {
|
|
20
31
|
success: true,
|
|
21
32
|
value: options.defaultValue,
|
|
@@ -120,36 +131,4 @@ export class ConfigurationSchemaRegistry {
|
|
|
120
131
|
export function createConfigurationSchemaRegistry() {
|
|
121
132
|
return new ConfigurationSchemaRegistry();
|
|
122
133
|
}
|
|
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
134
|
//# sourceMappingURL=configurationSchema.schema.js.map
|