@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
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ConfigurationManager } from "../../configuration/configurationManager.manager.js";
|
|
3
|
-
import type { Logger } from "../../logging/core/logger.js";
|
|
4
|
-
import type { ModuleLoader } from "../../modules/moduleLoader/index.js";
|
|
5
|
-
import type { ModuleLifecycleManager } from "../../modules/moduleLifecycle/index.js";
|
|
6
|
-
import type { ModuleRegistry } from "../../modules/moduleRegistry/index.js";
|
|
7
|
-
import type { RuntimeState } from "../runtimeState.state.js";
|
|
8
|
-
import type { RuntimeStateSnapshot } from "../runtimeState.state.js";
|
|
1
|
+
import type { ExecutionContext } from "../../context/core/executionContext.context.js";
|
|
9
2
|
import type { RuntimeMode, RuntimeRole } from "../runtimeOptions/index.js";
|
|
10
3
|
/**
|
|
11
4
|
* Runtime identity.
|
|
@@ -19,50 +12,46 @@ export interface RuntimeIdentity {
|
|
|
19
12
|
readonly processId?: number;
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
|
-
*
|
|
15
|
+
* Metadata carried by a runtime's execution context.
|
|
16
|
+
*
|
|
17
|
+
* The identity fields are always present; `RuntimeOptions.metadata`
|
|
18
|
+
* is merged in (identity fields cannot be overridden) so
|
|
19
|
+
* user-supplied values are reachable as `context.metadata[key]`.
|
|
23
20
|
*/
|
|
24
|
-
export interface
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Runtime context dependencies.
|
|
33
|
-
*/
|
|
34
|
-
export interface RuntimeContextDependencies {
|
|
35
|
-
readonly application: ApplicationContext;
|
|
36
|
-
readonly configuration: ConfigurationManager;
|
|
37
|
-
readonly logger: Logger;
|
|
38
|
-
readonly moduleRegistry: ModuleRegistry;
|
|
39
|
-
readonly moduleLoader: ModuleLoader;
|
|
40
|
-
readonly moduleLifecycle: ModuleLifecycleManager;
|
|
21
|
+
export interface RuntimeExecutionMetadata {
|
|
22
|
+
readonly runtimeId: string;
|
|
23
|
+
readonly runtimeName: string;
|
|
24
|
+
readonly runtimeMode: RuntimeMode;
|
|
25
|
+
readonly runtimeRole: RuntimeRole;
|
|
26
|
+
readonly processId?: number;
|
|
27
|
+
readonly [key: string]: unknown;
|
|
41
28
|
}
|
|
42
29
|
/**
|
|
43
|
-
*
|
|
30
|
+
* The execution context of a runtime.
|
|
31
|
+
*
|
|
32
|
+
* A runtime is single-use, so its whole lifetime is one execution:
|
|
33
|
+
* `executionId` is the runtime id, `service` is the runtime name,
|
|
34
|
+
* `startedAt` is the runtime's creation time, and `transport` /
|
|
35
|
+
* `operation` are `"runtime"`. The runtime establishes this context
|
|
36
|
+
* (via its ContextStorage) around bootstrap, shutdown, every module
|
|
37
|
+
* lifecycle hook, and application start/stop, so
|
|
38
|
+
* `contextStorage.get()` inside those returns it or a context
|
|
39
|
+
* derived from it.
|
|
40
|
+
*
|
|
41
|
+
* It is immutable. Mutable runtime state (state, timing, failure)
|
|
42
|
+
* lives on the Runtime object.
|
|
44
43
|
*/
|
|
45
|
-
export interface
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly metadata:
|
|
50
|
-
readonly application: ApplicationContext;
|
|
51
|
-
readonly configuration: ConfigurationManager;
|
|
52
|
-
readonly logger: Logger;
|
|
53
|
-
readonly moduleRegistry: ModuleRegistry;
|
|
54
|
-
readonly moduleLoader: ModuleLoader;
|
|
55
|
-
readonly moduleLifecycle: ModuleLifecycleManager;
|
|
56
|
-
getStateSnapshot(): RuntimeStateSnapshot;
|
|
57
|
-
get<T = unknown>(key: string): T | undefined;
|
|
58
|
-
has(key: string): boolean;
|
|
59
|
-
getUptime(): number;
|
|
44
|
+
export interface RuntimeExecutionContext extends ExecutionContext {
|
|
45
|
+
readonly service: string;
|
|
46
|
+
readonly transport: "runtime";
|
|
47
|
+
readonly operation: "runtime";
|
|
48
|
+
readonly metadata: RuntimeExecutionMetadata;
|
|
60
49
|
}
|
|
61
50
|
/**
|
|
62
|
-
*
|
|
51
|
+
* @deprecated Use RuntimeExecutionContext. The former mutable
|
|
52
|
+
* runtime context (state, timing, service references) no longer
|
|
53
|
+
* exists: state and timing live on the Runtime, and services are
|
|
54
|
+
* reached through the Runtime accessors.
|
|
63
55
|
*/
|
|
64
|
-
export
|
|
65
|
-
state: RuntimeState;
|
|
66
|
-
timing: RuntimeTiming;
|
|
67
|
-
}
|
|
56
|
+
export type RuntimeContext = RuntimeExecutionContext;
|
|
68
57
|
//# sourceMappingURL=runtimeContext.type.d.ts.map
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { RuntimeEnvironmentVariables } from "../runtimeEnvironment.type.js";
|
|
2
2
|
export declare function detectCI(variables: RuntimeEnvironmentVariables): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Detects a container environment from the supplied variable
|
|
5
|
+
* snapshot only, so callers that inject variables get deterministic
|
|
6
|
+
* results.
|
|
7
|
+
*/
|
|
3
8
|
export declare function detectContainer(variables: RuntimeEnvironmentVariables): boolean;
|
|
4
9
|
//# sourceMappingURL=runtimeEnvironment.env.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getProcessObject } from "./runtimeEnvironment.detection.js";
|
|
2
1
|
export function detectCI(variables) {
|
|
3
2
|
const explicit = variables.CI ?? variables.CONTINUOUS_INTEGRATION;
|
|
4
3
|
if (isTruthyEnvironmentValue(explicit)) {
|
|
@@ -21,6 +20,11 @@ export function detectCI(variables) {
|
|
|
21
20
|
}
|
|
22
21
|
return false;
|
|
23
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Detects a container environment from the supplied variable
|
|
25
|
+
* snapshot only, so callers that inject variables get deterministic
|
|
26
|
+
* results.
|
|
27
|
+
*/
|
|
24
28
|
export function detectContainer(variables) {
|
|
25
29
|
if (isTruthyEnvironmentValue(variables.CONTAINER)) {
|
|
26
30
|
return true;
|
|
@@ -31,9 +35,7 @@ export function detectContainer(variables) {
|
|
|
31
35
|
if (variables.KUBERNETES_SERVICE_HOST) {
|
|
32
36
|
return true;
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
const release = processObject?.env?.container;
|
|
36
|
-
if (release) {
|
|
38
|
+
if (variables.container) {
|
|
37
39
|
return true;
|
|
38
40
|
}
|
|
39
41
|
return false;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { RuntimeOS } from "../runtimeEnvironment.type.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the Node `os` module when running on a Node-compatible
|
|
4
|
+
* engine, or undefined on engines without a process object.
|
|
5
|
+
*/
|
|
2
6
|
export declare function getNodeOsObject(): RuntimeOS | undefined;
|
|
3
7
|
export declare function safeCall<T>(fn: (() => T) | undefined): T | undefined;
|
|
4
8
|
//# sourceMappingURL=runtimeEnvironment.os.d.ts.map
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import * as os from "node:os";
|
|
1
2
|
import { getProcessObject } from "./runtimeEnvironment.detection.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the Node `os` module when running on a Node-compatible
|
|
5
|
+
* engine, or undefined on engines without a process object.
|
|
6
|
+
*/
|
|
2
7
|
export function getNodeOsObject() {
|
|
3
|
-
|
|
4
|
-
const requireFunction = globalThis.require;
|
|
5
|
-
if (!requireFunction || !runtimeProcess) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
return requireFunction("node:os");
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
8
|
+
if (!getProcessObject()) {
|
|
12
9
|
return undefined;
|
|
13
10
|
}
|
|
11
|
+
return os;
|
|
14
12
|
}
|
|
15
13
|
export function safeCall(fn) {
|
|
16
14
|
if (!fn) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Detects and provides access to the runtime environment
|
|
5
5
|
* including engine, platform, process info, and variables.
|
|
6
6
|
*/
|
|
7
|
-
export { DefaultRuntimeEnvironment,
|
|
7
|
+
export { DefaultRuntimeEnvironment, MissingEnvironmentVariableError, createRuntimeEnvironment, } from "./runtimeEnvironment.core.js";
|
|
8
8
|
export { detectRuntimeEngine, detectPlatform, detectProcessInfo, detectHostInfo, getNodeOsObject, safeCall, detectCI, detectContainer, } from "./detection/index.js";
|
|
9
|
-
export type { RuntimePlatform, RuntimeEngine, RuntimeEnvironmentVariables, RuntimeProcessInfo, RuntimeHostInfo, RuntimeEngineInfo, RuntimeEnvironmentInfo, RuntimeEnvironment, RuntimeEnvironmentOptions, } from "./runtimeEnvironment.type.js";
|
|
9
|
+
export type { RuntimePlatform, RuntimeEngine, RuntimeEnvironmentVariables, RuntimeProcessInfo, RuntimeHostInfo, RuntimeEngineInfo, RuntimeEnvironmentInfo, RuntimeEnvironmentSummary, RuntimeEnvironment, RuntimeEnvironmentOptions, } from "./runtimeEnvironment.type.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Detects and provides access to the runtime environment
|
|
5
5
|
* including engine, platform, process info, and variables.
|
|
6
6
|
*/
|
|
7
|
-
export { DefaultRuntimeEnvironment,
|
|
7
|
+
export { DefaultRuntimeEnvironment, MissingEnvironmentVariableError, createRuntimeEnvironment, } from "./runtimeEnvironment.core.js";
|
|
8
8
|
export { detectRuntimeEngine, detectPlatform, detectProcessInfo, detectHostInfo, getNodeOsObject, safeCall, detectCI, detectContainer, } from "./detection/index.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import type { RuntimeMode } from "../runtimeOptions/index.js";
|
|
2
|
-
import type { RuntimeEnvironmentInfo, RuntimeEnvironment, RuntimeEnvironmentOptions } from "./runtimeEnvironment.type.js";
|
|
3
|
-
import { RuntimeError } from "
|
|
1
|
+
import type { RuntimeMode, RuntimeRole } from "../runtimeOptions/index.js";
|
|
2
|
+
import type { RuntimeEngine, RuntimePlatform, RuntimeEnvironmentInfo, RuntimeEnvironmentSummary, RuntimeEnvironment, RuntimeEnvironmentOptions } from "./runtimeEnvironment.type.js";
|
|
3
|
+
import { RuntimeError } from "../runtimeError/runtimeError.base.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Error thrown when a required environment variable is missing or
|
|
6
|
+
* empty.
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export declare class RuntimeEnvironmentError extends RuntimeError {
|
|
12
|
-
readonly envCode: RuntimeEnvironmentErrorCode;
|
|
13
|
-
readonly variableName?: string;
|
|
14
|
-
constructor(message: string, code: RuntimeEnvironmentErrorCode, variableName?: string);
|
|
8
|
+
export declare class MissingEnvironmentVariableError extends RuntimeError {
|
|
9
|
+
readonly variableName: string;
|
|
10
|
+
constructor(variableName: string);
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* Creates a new RuntimeEnvironment.
|
|
18
14
|
*/
|
|
19
|
-
export declare function createRuntimeEnvironment(options:
|
|
15
|
+
export declare function createRuntimeEnvironment(options: RuntimeEnvironmentOptions): RuntimeEnvironment;
|
|
20
16
|
/**
|
|
21
17
|
* Default RuntimeEnvironment implementation.
|
|
22
18
|
*/
|
|
@@ -25,9 +21,9 @@ export declare class DefaultRuntimeEnvironment implements RuntimeEnvironment {
|
|
|
25
21
|
constructor(options: RuntimeEnvironmentOptions);
|
|
26
22
|
get info(): RuntimeEnvironmentInfo;
|
|
27
23
|
get mode(): RuntimeMode;
|
|
28
|
-
get role():
|
|
29
|
-
get engine():
|
|
30
|
-
get platform():
|
|
24
|
+
get role(): RuntimeRole;
|
|
25
|
+
get engine(): RuntimeEngine;
|
|
26
|
+
get platform(): RuntimePlatform;
|
|
31
27
|
get(name: string): string | undefined;
|
|
32
28
|
require(name: string): string;
|
|
33
29
|
has(name: string): boolean;
|
|
@@ -36,6 +32,13 @@ export declare class DefaultRuntimeEnvironment implements RuntimeEnvironment {
|
|
|
36
32
|
isTest(): boolean;
|
|
37
33
|
isCI(): boolean;
|
|
38
34
|
isContainer(): boolean;
|
|
39
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Serializable summary of the environment.
|
|
37
|
+
*
|
|
38
|
+
* Environment variables are intentionally omitted: the snapshot
|
|
39
|
+
* routinely contains credentials (DATABASE_URL, cloud keys, ...)
|
|
40
|
+
* and must never reach structured logs or JSON.stringify output.
|
|
41
|
+
*/
|
|
42
|
+
toJSON(): RuntimeEnvironmentSummary;
|
|
40
43
|
}
|
|
41
44
|
//# sourceMappingURL=runtimeEnvironment.core.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { detectRuntimeEngine, detectPlatform, detectProcessInfo, detectHostInfo, readProcessEnvironment, detectCI, detectContainer, } from "./detection/index.js";
|
|
2
|
-
import { RuntimeError } from "
|
|
2
|
+
import { RuntimeError } from "../runtimeError/runtimeError.base.js";
|
|
3
|
+
import { RuntimeErrorCode } from "../runtimeError/runtimeError.type.js";
|
|
3
4
|
/**
|
|
4
|
-
* Error thrown
|
|
5
|
+
* Error thrown when a required environment variable is missing or
|
|
6
|
+
* empty.
|
|
5
7
|
*/
|
|
6
|
-
export class
|
|
7
|
-
envCode;
|
|
8
|
+
export class MissingEnvironmentVariableError extends RuntimeError {
|
|
8
9
|
variableName;
|
|
9
|
-
constructor(
|
|
10
|
-
super(
|
|
11
|
-
code:
|
|
12
|
-
|
|
10
|
+
constructor(variableName) {
|
|
11
|
+
super(`Required environment variable "${variableName}" is not defined.`, {
|
|
12
|
+
code: RuntimeErrorCode.INVALID_ENVIRONMENT,
|
|
13
|
+
metadata: { variableName },
|
|
13
14
|
});
|
|
14
|
-
this.name = "
|
|
15
|
-
this.envCode = code;
|
|
15
|
+
this.name = "MissingEnvironmentVariableError";
|
|
16
16
|
this.variableName = variableName;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -70,7 +70,7 @@ export class DefaultRuntimeEnvironment {
|
|
|
70
70
|
require(name) {
|
|
71
71
|
const value = this.get(name);
|
|
72
72
|
if (value === undefined || value.length === 0) {
|
|
73
|
-
throw new
|
|
73
|
+
throw new MissingEnvironmentVariableError(name);
|
|
74
74
|
}
|
|
75
75
|
return value;
|
|
76
76
|
}
|
|
@@ -92,13 +92,20 @@ export class DefaultRuntimeEnvironment {
|
|
|
92
92
|
isContainer() {
|
|
93
93
|
return this._info.isContainer;
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Serializable summary of the environment.
|
|
97
|
+
*
|
|
98
|
+
* Environment variables are intentionally omitted: the snapshot
|
|
99
|
+
* routinely contains credentials (DATABASE_URL, cloud keys, ...)
|
|
100
|
+
* and must never reach structured logs or JSON.stringify output.
|
|
101
|
+
*/
|
|
95
102
|
toJSON() {
|
|
103
|
+
const { variables: _variables, ...summary } = this._info;
|
|
96
104
|
return Object.freeze({
|
|
97
|
-
...
|
|
105
|
+
...summary,
|
|
98
106
|
host: Object.freeze({ ...this._info.host }),
|
|
99
107
|
process: Object.freeze({ ...this._info.process }),
|
|
100
108
|
engine: Object.freeze({ ...this._info.engine }),
|
|
101
|
-
variables: Object.freeze({ ...this._info.variables }),
|
|
102
109
|
});
|
|
103
110
|
}
|
|
104
111
|
}
|
|
@@ -41,6 +41,9 @@ export interface RuntimeEngineInfo {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Complete runtime environment information.
|
|
44
|
+
*
|
|
45
|
+
* `variables` holds the full environment snapshot and may contain
|
|
46
|
+
* secrets. It is deliberately excluded from {@link RuntimeEnvironment.toJSON}.
|
|
44
47
|
*/
|
|
45
48
|
export interface RuntimeEnvironmentInfo {
|
|
46
49
|
readonly mode: RuntimeMode;
|
|
@@ -55,6 +58,11 @@ export interface RuntimeEnvironmentInfo {
|
|
|
55
58
|
readonly isDevelopment: boolean;
|
|
56
59
|
readonly isTest: boolean;
|
|
57
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Environment information safe for logs and serialization: everything
|
|
63
|
+
* in RuntimeEnvironmentInfo except the raw variables.
|
|
64
|
+
*/
|
|
65
|
+
export type RuntimeEnvironmentSummary = Omit<RuntimeEnvironmentInfo, "variables">;
|
|
58
66
|
/**
|
|
59
67
|
* Runtime environment contract.
|
|
60
68
|
*/
|
|
@@ -72,7 +80,10 @@ export interface RuntimeEnvironment {
|
|
|
72
80
|
isTest(): boolean;
|
|
73
81
|
isCI(): boolean;
|
|
74
82
|
isContainer(): boolean;
|
|
75
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Serializable summary. Never includes environment variables.
|
|
85
|
+
*/
|
|
86
|
+
toJSON(): RuntimeEnvironmentSummary;
|
|
76
87
|
}
|
|
77
88
|
/**
|
|
78
89
|
* Options used to create a RuntimeEnvironment.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimeErrorOptions } from "./runtimeError.type.js";
|
|
1
|
+
import type { RuntimeErrorOptions, RuntimeErrorCode } from "./runtimeError.type.js";
|
|
2
2
|
import type { RuntimeError as RuntimeErrorType } from "./runtimeError.base.js";
|
|
3
3
|
/**
|
|
4
4
|
* Runtime Errors
|
|
@@ -6,7 +6,7 @@ import type { RuntimeError as RuntimeErrorType } from "./runtimeError.base.js";
|
|
|
6
6
|
* Error classes and utilities for runtime failures.
|
|
7
7
|
*/
|
|
8
8
|
export { RuntimeError } from "./runtimeError.base.js";
|
|
9
|
-
export {
|
|
9
|
+
export { InvalidRuntimeStateError, InvalidRuntimeTransitionError, RuntimeStartError, RuntimeStopError, RuntimeInitializationError, RuntimeLoadError, } from "./runtimeError.lifecycle.js";
|
|
10
10
|
export { RuntimeTimeoutError, RuntimeDependencyError, RuntimeNotReadyError, RuntimeUnsupportedOperationError, RuntimeCancellationError, } from "./runtimeError.specialized.js";
|
|
11
11
|
export { RuntimeErrorCode } from "./runtimeError.type.js";
|
|
12
12
|
export type { RuntimeOperation, RuntimeErrorPhase, RuntimeErrorMetadata, RuntimeErrorOptions, RuntimeErrorJSON, } from "./runtimeError.type.js";
|
|
@@ -21,7 +21,7 @@ export declare function isRuntimeError(error: unknown): error is RuntimeErrorTyp
|
|
|
21
21
|
/**
|
|
22
22
|
* Checks whether an unknown error has a specific runtime code.
|
|
23
23
|
*/
|
|
24
|
-
export declare function hasRuntimeErrorCode(error: unknown, code:
|
|
24
|
+
export declare function hasRuntimeErrorCode(error: unknown, code: RuntimeErrorCode): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Creates a runtime error with contextual information.
|
|
27
27
|
*/
|
|
@@ -5,7 +5,7 @@ import { RuntimeError } from "./runtimeError.base.js";
|
|
|
5
5
|
* Error classes and utilities for runtime failures.
|
|
6
6
|
*/
|
|
7
7
|
export { RuntimeError } from "./runtimeError.base.js";
|
|
8
|
-
export {
|
|
8
|
+
export { InvalidRuntimeStateError, InvalidRuntimeTransitionError, RuntimeStartError, RuntimeStopError, RuntimeInitializationError, RuntimeLoadError, } from "./runtimeError.lifecycle.js";
|
|
9
9
|
export { RuntimeTimeoutError, RuntimeDependencyError, RuntimeNotReadyError, RuntimeUnsupportedOperationError, RuntimeCancellationError, } from "./runtimeError.specialized.js";
|
|
10
10
|
export { RuntimeErrorCode } from "./runtimeError.type.js";
|
|
11
11
|
/**
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type { RuntimeErrorOptions, RuntimeErrorMetadata } from "./runtimeError.type.js";
|
|
1
|
+
import { RuntimeError as BaseRuntimeError } from "@zudojs/errors";
|
|
2
|
+
import type { RuntimeErrorOptions, RuntimeErrorJSON, RuntimeErrorMetadata, RuntimeOperation, RuntimeErrorPhase } from "./runtimeError.type.js";
|
|
4
3
|
/**
|
|
5
|
-
* Base error for all runtime failures.
|
|
4
|
+
* Base error for all runtime failures raised by @zudojs/core.
|
|
6
5
|
*
|
|
7
|
-
* Extends
|
|
8
|
-
*
|
|
6
|
+
* Extends RuntimeError from @zudojs/errors so runtime failures are
|
|
7
|
+
* recognised across packages (`instanceof RuntimeError` and
|
|
8
|
+
* `isRuntimeError()` from either package agree), while carrying the
|
|
9
|
+
* core-specific runtime context (operation, phase, identity, module).
|
|
9
10
|
*/
|
|
10
|
-
export declare class RuntimeError extends
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export declare class RuntimeError extends BaseRuntimeError {
|
|
12
|
+
/**
|
|
13
|
+
* The runtime lifecycle phase during which the error occurred.
|
|
14
|
+
* Narrows the base `phase: string` to the known runtime phases.
|
|
15
|
+
*/
|
|
16
|
+
readonly phase?: RuntimeErrorPhase;
|
|
17
|
+
readonly operation?: RuntimeOperation;
|
|
13
18
|
readonly runtimeId?: string;
|
|
14
19
|
readonly runtimeName?: string;
|
|
15
20
|
readonly moduleName?: string;
|
|
@@ -17,14 +22,6 @@ export declare class RuntimeError extends FrameworkError {
|
|
|
17
22
|
readonly recoverable: boolean;
|
|
18
23
|
constructor(message: string, options?: RuntimeErrorOptions);
|
|
19
24
|
getCause(): Error | undefined;
|
|
20
|
-
toJSON():
|
|
21
|
-
readonly operation?: string;
|
|
22
|
-
readonly phase?: string;
|
|
23
|
-
readonly runtimeId?: string;
|
|
24
|
-
readonly runtimeName?: string;
|
|
25
|
-
readonly moduleName?: string;
|
|
26
|
-
readonly errorMetadata: RuntimeErrorMetadata;
|
|
27
|
-
readonly recoverable: boolean;
|
|
28
|
-
};
|
|
25
|
+
toJSON(): RuntimeErrorJSON;
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=runtimeError.base.d.ts.map
|
|
@@ -1,50 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeError as BaseRuntimeError } from "@zudojs/errors";
|
|
2
2
|
import { RuntimeErrorCode } from "./runtimeError.type.js";
|
|
3
3
|
/**
|
|
4
|
-
* Base error for all runtime failures.
|
|
4
|
+
* Base error for all runtime failures raised by @zudojs/core.
|
|
5
5
|
*
|
|
6
|
-
* Extends
|
|
7
|
-
*
|
|
6
|
+
* Extends RuntimeError from @zudojs/errors so runtime failures are
|
|
7
|
+
* recognised across packages (`instanceof RuntimeError` and
|
|
8
|
+
* `isRuntimeError()` from either package agree), while carrying the
|
|
9
|
+
* core-specific runtime context (operation, phase, identity, module).
|
|
8
10
|
*/
|
|
9
|
-
export class RuntimeError extends
|
|
11
|
+
export class RuntimeError extends BaseRuntimeError {
|
|
10
12
|
operation;
|
|
11
|
-
phase;
|
|
12
13
|
runtimeId;
|
|
13
14
|
runtimeName;
|
|
14
15
|
moduleName;
|
|
15
16
|
errorMetadata;
|
|
16
17
|
recoverable;
|
|
17
18
|
constructor(message, options = {}) {
|
|
18
|
-
const details = {};
|
|
19
|
-
if (options.operation !== undefined) {
|
|
20
|
-
details.operation = options.operation;
|
|
21
|
-
}
|
|
22
|
-
if (options.phase !== undefined) {
|
|
23
|
-
details.phase = options.phase;
|
|
24
|
-
}
|
|
25
|
-
if (options.runtimeId !== undefined) {
|
|
26
|
-
details.runtimeId = options.runtimeId;
|
|
27
|
-
}
|
|
28
|
-
if (options.runtimeName !== undefined) {
|
|
29
|
-
details.runtimeName = options.runtimeName;
|
|
30
|
-
}
|
|
31
|
-
if (options.moduleName !== undefined) {
|
|
32
|
-
details.moduleName = options.moduleName;
|
|
33
|
-
}
|
|
34
|
-
if (options.metadata !== undefined) {
|
|
35
|
-
details.metadata = options.metadata;
|
|
36
|
-
}
|
|
37
|
-
if (options.recoverable !== undefined) {
|
|
38
|
-
details.recoverable = options.recoverable;
|
|
39
|
-
}
|
|
40
19
|
super(message, {
|
|
41
20
|
code: options.code ?? RuntimeErrorCode.RUNTIME_FAILURE,
|
|
42
|
-
|
|
21
|
+
phase: options.phase,
|
|
22
|
+
component: options.moduleName,
|
|
43
23
|
cause: options.cause,
|
|
24
|
+
isOperational: false,
|
|
25
|
+
metadata: serializableMetadata({
|
|
26
|
+
...(options.operation !== undefined && {
|
|
27
|
+
operation: options.operation,
|
|
28
|
+
}),
|
|
29
|
+
...(options.runtimeId !== undefined && {
|
|
30
|
+
runtimeId: options.runtimeId,
|
|
31
|
+
}),
|
|
32
|
+
...(options.runtimeName !== undefined && {
|
|
33
|
+
runtimeName: options.runtimeName,
|
|
34
|
+
}),
|
|
35
|
+
...(options.moduleName !== undefined && {
|
|
36
|
+
moduleName: options.moduleName,
|
|
37
|
+
}),
|
|
38
|
+
...(options.metadata ?? {}),
|
|
39
|
+
}),
|
|
44
40
|
});
|
|
45
41
|
this.name = "RuntimeError";
|
|
46
42
|
this.operation = options.operation;
|
|
47
|
-
this.phase = options.phase;
|
|
48
43
|
this.runtimeId = options.runtimeId;
|
|
49
44
|
this.runtimeName = options.runtimeName;
|
|
50
45
|
this.moduleName = options.moduleName;
|
|
@@ -54,7 +49,7 @@ export class RuntimeError extends FrameworkError {
|
|
|
54
49
|
this.recoverable = options.recoverable ?? false;
|
|
55
50
|
}
|
|
56
51
|
getCause() {
|
|
57
|
-
return
|
|
52
|
+
return this.cause instanceof Error ? this.cause : undefined;
|
|
58
53
|
}
|
|
59
54
|
toJSON() {
|
|
60
55
|
return {
|
|
@@ -70,12 +65,19 @@ export class RuntimeError extends FrameworkError {
|
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
67
|
/**
|
|
73
|
-
*
|
|
68
|
+
* Keeps only JSON-safe metadata values so BaseError metadata stays
|
|
69
|
+
* transportable; richer values remain on `errorMetadata`.
|
|
74
70
|
*/
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
function serializableMetadata(metadata) {
|
|
72
|
+
const result = {};
|
|
73
|
+
for (const [key, value] of Object.entries(metadata)) {
|
|
74
|
+
if (typeof value === "string" ||
|
|
75
|
+
typeof value === "number" ||
|
|
76
|
+
typeof value === "boolean" ||
|
|
77
|
+
value === null) {
|
|
78
|
+
result[key] = value;
|
|
79
|
+
}
|
|
78
80
|
}
|
|
79
|
-
return
|
|
81
|
+
return result;
|
|
80
82
|
}
|
|
81
83
|
//# sourceMappingURL=runtimeError.base.js.map
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import type { RuntimeErrorOptions } from "./runtimeError.type.js";
|
|
2
2
|
import { RuntimeError } from "./runtimeError.base.js";
|
|
3
3
|
/**
|
|
4
|
-
* Error thrown when
|
|
4
|
+
* Error thrown when an operation is attempted while the runtime is
|
|
5
|
+
* in a state that does not permit it (for example starting a runtime
|
|
6
|
+
* that is stopping, or stopping one that is still bootstrapping).
|
|
5
7
|
*/
|
|
6
|
-
export declare class
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export declare class InvalidRuntimeStateError extends RuntimeError {
|
|
9
|
+
/**
|
|
10
|
+
* The runtime state in which the operation was rejected.
|
|
11
|
+
*/
|
|
12
|
+
readonly state?: string;
|
|
13
|
+
constructor(message: string, options?: Omit<RuntimeErrorOptions, "code"> & {
|
|
14
|
+
readonly state?: string;
|
|
15
|
+
});
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
|
-
* Error thrown when runtime
|
|
18
|
+
* Error thrown when a runtime state transition is not allowed by the
|
|
19
|
+
* runtime state table.
|
|
20
|
+
*/
|
|
21
|
+
export declare class InvalidRuntimeTransitionError extends RuntimeError {
|
|
22
|
+
readonly from: string;
|
|
23
|
+
readonly to: string;
|
|
24
|
+
constructor(from: string, to: string, options?: Omit<RuntimeErrorOptions, "code">);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Error thrown when runtime startup (bootstrap) fails.
|
|
13
28
|
*/
|
|
14
29
|
export declare class RuntimeStartError extends RuntimeError {
|
|
15
30
|
constructor(message: string, options?: Omit<RuntimeErrorOptions, "operation">);
|
|
@@ -21,13 +36,13 @@ export declare class RuntimeStopError extends RuntimeError {
|
|
|
21
36
|
constructor(message: string, options?: Omit<RuntimeErrorOptions, "operation">);
|
|
22
37
|
}
|
|
23
38
|
/**
|
|
24
|
-
* Error thrown when
|
|
39
|
+
* Error thrown when module initialization fails during bootstrap.
|
|
25
40
|
*/
|
|
26
41
|
export declare class RuntimeInitializationError extends RuntimeError {
|
|
27
42
|
constructor(message: string, options?: Omit<RuntimeErrorOptions, "operation">);
|
|
28
43
|
}
|
|
29
44
|
/**
|
|
30
|
-
* Error thrown when
|
|
45
|
+
* Error thrown when module loading fails during bootstrap.
|
|
31
46
|
*/
|
|
32
47
|
export declare class RuntimeLoadError extends RuntimeError {
|
|
33
48
|
constructor(message: string, options?: Omit<RuntimeErrorOptions, "operation">);
|