@zudojs/core 0.1.0 → 1.1.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 +27 -1
- package/dist/application/applicationContext.context.js +22 -2
- package/dist/application/createApplication.d.ts +78 -0
- package/dist/application/createApplication.js +109 -0
- package/dist/application/index.d.ts +2 -1
- package/dist/application/index.js +2 -1
- package/dist/configuration/configurationManager.manager.d.ts +42 -0
- package/dist/configuration/configurationManager.manager.js +104 -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 +51 -5
- package/dist/container/container.js +104 -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 +125 -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 +73 -10
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +204 -19
- 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 +78 -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 +168 -59
- 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 +111 -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 +13 -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 +85 -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 +25 -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
|
@@ -16,8 +16,13 @@ export interface LoggerFactoryOptions extends LoggerOptions {
|
|
|
16
16
|
* Logger implementation to use.
|
|
17
17
|
*
|
|
18
18
|
* Defaults to "console".
|
|
19
|
+
*
|
|
20
|
+
* The type is deliberately widened to accept arbitrary
|
|
21
|
+
* strings because this value frequently arrives from
|
|
22
|
+
* configuration files; unknown implementations fail with a
|
|
23
|
+
* descriptive error at creation time.
|
|
19
24
|
*/
|
|
20
|
-
readonly implementation?: LoggerImplementation;
|
|
25
|
+
readonly implementation?: LoggerImplementation | (string & {});
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Creates and configures Zudojs logger instances.
|
|
@@ -37,9 +42,5 @@ export declare class LoggerFactory {
|
|
|
37
42
|
* module-specific or operation-specific context.
|
|
38
43
|
*/
|
|
39
44
|
child(logger: Logger, context: LoggerContext): Logger;
|
|
40
|
-
/**
|
|
41
|
-
* Handles unsupported logger implementations.
|
|
42
|
-
*/
|
|
43
|
-
private unsupportedImplementation;
|
|
44
45
|
}
|
|
45
46
|
//# sourceMappingURL=loggerFactory.factory.d.ts.map
|
|
@@ -15,7 +15,7 @@ export class LoggerFactory {
|
|
|
15
15
|
case "console":
|
|
16
16
|
return new ConsoleLogger(options, context);
|
|
17
17
|
default:
|
|
18
|
-
|
|
18
|
+
throw new Error(`Unsupported logger implementation: ${String(implementation)}`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -27,11 +27,5 @@ export class LoggerFactory {
|
|
|
27
27
|
child(logger, context) {
|
|
28
28
|
return logger.child(context);
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Handles unsupported logger implementations.
|
|
32
|
-
*/
|
|
33
|
-
unsupportedImplementation(implementation) {
|
|
34
|
-
throw new Error(`Unsupported logger implementation: ${String(implementation)}`);
|
|
35
|
-
}
|
|
36
30
|
}
|
|
37
31
|
//# sourceMappingURL=loggerFactory.factory.js.map
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Core logger types, levels, entries, context, and options.
|
|
5
5
|
*/
|
|
6
6
|
export { BaseLogger, type Logger, type LogContext } from "./logger.js";
|
|
7
|
-
export { LogLevel, LogLevelPriority, shouldLog, type LogLevel as LogLevelType, } from "./logLevel.level.js";
|
|
8
|
-
export { createLoggerContext, type LoggerContext, } from "./loggerContext.context.js";
|
|
9
|
-
export { serializeLogError, type LogEntry, type LogError, } from "./logEntry.entry.js";
|
|
7
|
+
export { LogLevel, LogLevelPriority, DEFAULT_LOG_LEVEL, shouldLog, isLogLevel, resolveLogLevel, type LogLevel as LogLevelType, } from "./logLevel.level.js";
|
|
8
|
+
export { createLoggerContext, loggerContextFromExecution, type LoggerContext, } from "./loggerContext.context.js";
|
|
9
|
+
export { serializeLogError, sanitizeLogValue, safeLogStringify, type LogEntry, type LogError, type LogErrorSerializationOptions, } from "./logEntry.entry.js";
|
|
10
|
+
export { createLogRedactor, type LogRedactionHook, type LogRedactorOptions, } from "./logRedaction.redaction.js";
|
|
10
11
|
export { DEFAULT_LOGGER_OPTIONS, type LoggerOptions, type LogLevelOption, } from "./loggerOptions.options.js";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Core logger types, levels, entries, context, and options.
|
|
5
5
|
*/
|
|
6
6
|
export { BaseLogger } from "./logger.js";
|
|
7
|
-
export { LogLevel, LogLevelPriority, shouldLog, } from "./logLevel.level.js";
|
|
8
|
-
export { createLoggerContext, } from "./loggerContext.context.js";
|
|
9
|
-
export { serializeLogError, } from "./logEntry.entry.js";
|
|
7
|
+
export { LogLevel, LogLevelPriority, DEFAULT_LOG_LEVEL, shouldLog, isLogLevel, resolveLogLevel, } from "./logLevel.level.js";
|
|
8
|
+
export { createLoggerContext, loggerContextFromExecution, } from "./loggerContext.context.js";
|
|
9
|
+
export { serializeLogError, sanitizeLogValue, safeLogStringify, } from "./logEntry.entry.js";
|
|
10
|
+
export { createLogRedactor, } from "./logRedaction.redaction.js";
|
|
10
11
|
export { DEFAULT_LOGGER_OPTIONS, } from "./loggerOptions.options.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from "./logLevel.level.js";
|
|
2
2
|
import type { LoggerContext } from "./loggerContext.context.js";
|
|
3
|
+
import type { LogContext } from "./logger.js";
|
|
3
4
|
/**
|
|
4
5
|
* Represents a single structured log entry.
|
|
5
6
|
*
|
|
@@ -21,9 +22,12 @@ export interface LogEntry {
|
|
|
21
22
|
*/
|
|
22
23
|
readonly timestamp: Date;
|
|
23
24
|
/**
|
|
24
|
-
* Structured
|
|
25
|
+
* Structured context attached to the entry.
|
|
26
|
+
*
|
|
27
|
+
* Either well-known framework context fields (LoggerContext)
|
|
28
|
+
* or arbitrary structured metadata supplied by the caller.
|
|
25
29
|
*/
|
|
26
|
-
readonly context?: LoggerContext;
|
|
30
|
+
readonly context?: LoggerContext | LogContext;
|
|
27
31
|
/**
|
|
28
32
|
* Error associated with the log event.
|
|
29
33
|
*/
|
|
@@ -58,6 +62,16 @@ export interface LogError {
|
|
|
58
62
|
*/
|
|
59
63
|
readonly cause?: unknown;
|
|
60
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Options controlling error serialization.
|
|
67
|
+
*/
|
|
68
|
+
export interface LogErrorSerializationOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Redaction hook applied to the sanitized details of every
|
|
71
|
+
* error in the cause chain.
|
|
72
|
+
*/
|
|
73
|
+
readonly redact?: (value: unknown) => unknown;
|
|
74
|
+
}
|
|
61
75
|
/**
|
|
62
76
|
* Creates a structured LogError from an unknown thrown value.
|
|
63
77
|
*
|
|
@@ -68,6 +82,30 @@ export interface LogError {
|
|
|
68
82
|
* Strings
|
|
69
83
|
* Objects
|
|
70
84
|
* Unknown thrown values
|
|
85
|
+
*
|
|
86
|
+
* Nested causes are serialized recursively up to a bounded
|
|
87
|
+
* depth, and details pass through the safe sanitizer (and the
|
|
88
|
+
* optional redaction hook) so circular references and BigInt
|
|
89
|
+
* values cannot crash logging and secrets do not leak.
|
|
90
|
+
*/
|
|
91
|
+
export declare function serializeLogError(error: unknown, options?: LogErrorSerializationOptions): LogError;
|
|
92
|
+
/**
|
|
93
|
+
* Converts an arbitrary value into a JSON-safe structure.
|
|
94
|
+
*
|
|
95
|
+
* Handles the cases that break JSON.stringify:
|
|
96
|
+
*
|
|
97
|
+
* circular references → "[Circular]"
|
|
98
|
+
* BigInt → decimal string
|
|
99
|
+
* throwing toJSON → "[Unserializable]"
|
|
100
|
+
* functions → "[Function name]"
|
|
101
|
+
* symbols → their string description
|
|
102
|
+
*/
|
|
103
|
+
export declare function sanitizeLogValue(value: unknown, seen?: WeakSet<object>, depth?: number): unknown;
|
|
104
|
+
/**
|
|
105
|
+
* Safely serializes an arbitrary value to a JSON string.
|
|
106
|
+
*
|
|
107
|
+
* Never throws: values that resist serialization degrade to
|
|
108
|
+
* placeholder strings.
|
|
71
109
|
*/
|
|
72
|
-
export declare function
|
|
110
|
+
export declare function safeLogStringify(value: unknown): string;
|
|
73
111
|
//# sourceMappingURL=logEntry.entry.d.ts.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maximum depth to which nested error causes are serialized.
|
|
3
|
+
*/
|
|
4
|
+
const MAX_ERROR_CAUSE_DEPTH = 5;
|
|
1
5
|
/**
|
|
2
6
|
* Creates a structured LogError from an unknown thrown value.
|
|
3
7
|
*
|
|
@@ -8,8 +12,20 @@
|
|
|
8
12
|
* Strings
|
|
9
13
|
* Objects
|
|
10
14
|
* Unknown thrown values
|
|
15
|
+
*
|
|
16
|
+
* Nested causes are serialized recursively up to a bounded
|
|
17
|
+
* depth, and details pass through the safe sanitizer (and the
|
|
18
|
+
* optional redaction hook) so circular references and BigInt
|
|
19
|
+
* values cannot crash logging and secrets do not leak.
|
|
11
20
|
*/
|
|
12
|
-
export function serializeLogError(error) {
|
|
21
|
+
export function serializeLogError(error, options = {}) {
|
|
22
|
+
return serializeLogErrorAtDepth(error, options, 0);
|
|
23
|
+
}
|
|
24
|
+
function serializeDetails(value, options) {
|
|
25
|
+
const sanitized = sanitizeLogValue(value);
|
|
26
|
+
return options.redact ? options.redact(sanitized) : sanitized;
|
|
27
|
+
}
|
|
28
|
+
function serializeLogErrorAtDepth(error, options, depth) {
|
|
13
29
|
if (error instanceof Error) {
|
|
14
30
|
const candidate = error;
|
|
15
31
|
return {
|
|
@@ -17,8 +33,14 @@ export function serializeLogError(error) {
|
|
|
17
33
|
message: candidate.message,
|
|
18
34
|
stack: candidate.stack,
|
|
19
35
|
code: candidate.code,
|
|
20
|
-
details: candidate.details
|
|
21
|
-
|
|
36
|
+
details: candidate.details !== undefined
|
|
37
|
+
? serializeDetails(candidate.details, options)
|
|
38
|
+
: undefined,
|
|
39
|
+
cause: candidate.cause !== undefined
|
|
40
|
+
? depth < MAX_ERROR_CAUSE_DEPTH
|
|
41
|
+
? serializeLogErrorAtDepth(candidate.cause, options, depth + 1)
|
|
42
|
+
: "[MaxDepth]"
|
|
43
|
+
: undefined,
|
|
22
44
|
};
|
|
23
45
|
}
|
|
24
46
|
if (typeof error === "string") {
|
|
@@ -28,11 +50,110 @@ export function serializeLogError(error) {
|
|
|
28
50
|
}
|
|
29
51
|
if (error !== null && typeof error === "object") {
|
|
30
52
|
return {
|
|
31
|
-
details: error,
|
|
53
|
+
details: serializeDetails(error, options),
|
|
32
54
|
};
|
|
33
55
|
}
|
|
34
56
|
return {
|
|
35
57
|
message: String(error),
|
|
36
58
|
};
|
|
37
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Maximum depth to which arbitrary values are sanitized.
|
|
62
|
+
*/
|
|
63
|
+
const MAX_SANITIZE_DEPTH = 16;
|
|
64
|
+
/**
|
|
65
|
+
* Converts an arbitrary value into a JSON-safe structure.
|
|
66
|
+
*
|
|
67
|
+
* Handles the cases that break JSON.stringify:
|
|
68
|
+
*
|
|
69
|
+
* circular references → "[Circular]"
|
|
70
|
+
* BigInt → decimal string
|
|
71
|
+
* throwing toJSON → "[Unserializable]"
|
|
72
|
+
* functions → "[Function name]"
|
|
73
|
+
* symbols → their string description
|
|
74
|
+
*/
|
|
75
|
+
export function sanitizeLogValue(value, seen = new WeakSet(), depth = 0) {
|
|
76
|
+
if (value === null || value === undefined)
|
|
77
|
+
return value;
|
|
78
|
+
const type = typeof value;
|
|
79
|
+
if (type === "bigint")
|
|
80
|
+
return value.toString();
|
|
81
|
+
if (type === "function")
|
|
82
|
+
return `[Function ${value.name || "anonymous"}]`;
|
|
83
|
+
if (type === "symbol")
|
|
84
|
+
return String(value);
|
|
85
|
+
if (type !== "object")
|
|
86
|
+
return value;
|
|
87
|
+
const objectValue = value;
|
|
88
|
+
if (seen.has(objectValue))
|
|
89
|
+
return "[Circular]";
|
|
90
|
+
if (depth >= MAX_SANITIZE_DEPTH)
|
|
91
|
+
return "[MaxDepth]";
|
|
92
|
+
if (objectValue instanceof Date)
|
|
93
|
+
return objectValue.toISOString();
|
|
94
|
+
if (objectValue instanceof Error)
|
|
95
|
+
return serializeLogErrorAtDepth(objectValue, {}, MAX_ERROR_CAUSE_DEPTH);
|
|
96
|
+
seen.add(objectValue);
|
|
97
|
+
try {
|
|
98
|
+
const withToJson = objectValue;
|
|
99
|
+
if (typeof withToJson.toJSON === "function") {
|
|
100
|
+
let converted;
|
|
101
|
+
try {
|
|
102
|
+
converted = withToJson.toJSON();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return "[Unserializable]";
|
|
106
|
+
}
|
|
107
|
+
if (converted !== objectValue) {
|
|
108
|
+
return sanitizeLogValue(converted, seen, depth + 1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (Array.isArray(objectValue)) {
|
|
112
|
+
return objectValue.map((item) => sanitizeLogValue(item, seen, depth + 1));
|
|
113
|
+
}
|
|
114
|
+
if (objectValue instanceof Map) {
|
|
115
|
+
const result = {};
|
|
116
|
+
for (const [key, item] of objectValue.entries()) {
|
|
117
|
+
result[String(key)] = sanitizeLogValue(item, seen, depth + 1);
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
if (objectValue instanceof Set) {
|
|
122
|
+
return [...objectValue].map((item) => sanitizeLogValue(item, seen, depth + 1));
|
|
123
|
+
}
|
|
124
|
+
const result = {};
|
|
125
|
+
for (const [key, item] of Object.entries(objectValue)) {
|
|
126
|
+
/*
|
|
127
|
+
* Assigning result["__proto__"] would replace the prototype
|
|
128
|
+
* (and drop the value from serialized output) instead of
|
|
129
|
+
* storing the key, so own "__proto__" keys — as produced by
|
|
130
|
+
* JSON.parse on untrusted input — are defined explicitly.
|
|
131
|
+
*/
|
|
132
|
+
Object.defineProperty(result, key, {
|
|
133
|
+
value: sanitizeLogValue(item, seen, depth + 1),
|
|
134
|
+
enumerable: true,
|
|
135
|
+
writable: true,
|
|
136
|
+
configurable: true,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
seen.delete(objectValue);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Safely serializes an arbitrary value to a JSON string.
|
|
147
|
+
*
|
|
148
|
+
* Never throws: values that resist serialization degrade to
|
|
149
|
+
* placeholder strings.
|
|
150
|
+
*/
|
|
151
|
+
export function safeLogStringify(value) {
|
|
152
|
+
try {
|
|
153
|
+
return JSON.stringify(sanitizeLogValue(value));
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return '"[Unserializable]"';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
38
159
|
//# sourceMappingURL=logEntry.entry.js.map
|
|
@@ -21,9 +21,27 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
21
21
|
* Higher values represent more severe events.
|
|
22
22
|
*/
|
|
23
23
|
export declare const LogLevelPriority: Record<LogLevel, number>;
|
|
24
|
+
/**
|
|
25
|
+
* The level used when a configured level is unknown.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_LOG_LEVEL: LogLevel;
|
|
28
|
+
/**
|
|
29
|
+
* Checks whether a value is a known log level.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isLogLevel(value: unknown): value is LogLevel;
|
|
32
|
+
/**
|
|
33
|
+
* Resolves an arbitrary value to a known log level.
|
|
34
|
+
*
|
|
35
|
+
* Unknown values fall back to "info" so a configuration typo
|
|
36
|
+
* can never silently disable all logging.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveLogLevel(value: unknown): LogLevel;
|
|
24
39
|
/**
|
|
25
40
|
* Determines whether a log level should be emitted when
|
|
26
41
|
* the configured minimum level is applied.
|
|
42
|
+
*
|
|
43
|
+
* Unknown minimum levels are treated as "info" instead of
|
|
44
|
+
* silently disabling all logging.
|
|
27
45
|
*/
|
|
28
46
|
export declare function shouldLog(level: LogLevel, minimumLevel: LogLevel): boolean;
|
|
29
47
|
//# sourceMappingURL=logLevel.level.d.ts.map
|
|
@@ -24,11 +24,35 @@ export const LogLevelPriority = {
|
|
|
24
24
|
error: 50,
|
|
25
25
|
fatal: 60,
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* The level used when a configured level is unknown.
|
|
29
|
+
*/
|
|
30
|
+
export const DEFAULT_LOG_LEVEL = LogLevel.INFO;
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether a value is a known log level.
|
|
33
|
+
*/
|
|
34
|
+
export function isLogLevel(value) {
|
|
35
|
+
return typeof value === "string" && Object.hasOwn(LogLevelPriority, value);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolves an arbitrary value to a known log level.
|
|
39
|
+
*
|
|
40
|
+
* Unknown values fall back to "info" so a configuration typo
|
|
41
|
+
* can never silently disable all logging.
|
|
42
|
+
*/
|
|
43
|
+
export function resolveLogLevel(value) {
|
|
44
|
+
return isLogLevel(value) ? value : DEFAULT_LOG_LEVEL;
|
|
45
|
+
}
|
|
27
46
|
/**
|
|
28
47
|
* Determines whether a log level should be emitted when
|
|
29
48
|
* the configured minimum level is applied.
|
|
49
|
+
*
|
|
50
|
+
* Unknown minimum levels are treated as "info" instead of
|
|
51
|
+
* silently disabling all logging.
|
|
30
52
|
*/
|
|
31
53
|
export function shouldLog(level, minimumLevel) {
|
|
32
|
-
|
|
54
|
+
const levelPriority = LogLevelPriority[level] ?? LogLevelPriority[DEFAULT_LOG_LEVEL];
|
|
55
|
+
const minimumPriority = LogLevelPriority[minimumLevel] ?? LogLevelPriority[DEFAULT_LOG_LEVEL];
|
|
56
|
+
return levelPriority >= minimumPriority;
|
|
33
57
|
}
|
|
34
58
|
//# sourceMappingURL=logLevel.level.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook applied to structured log data before it is written.
|
|
3
|
+
*
|
|
4
|
+
* The hook receives already-sanitized (JSON-safe) values: the
|
|
5
|
+
* merged context object of an entry, and the details of each
|
|
6
|
+
* serialized error in an error's cause chain. It returns the
|
|
7
|
+
* value to emit instead.
|
|
8
|
+
*/
|
|
9
|
+
export type LogRedactionHook = (value: unknown) => unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Options for the built-in key-based log redactor.
|
|
12
|
+
*/
|
|
13
|
+
export interface LogRedactorOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Additional key patterns treated as sensitive, on top of the
|
|
16
|
+
* framework defaults (password, secret, token, api key, ...).
|
|
17
|
+
*/
|
|
18
|
+
readonly patterns?: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Exact dot-paths (relative to the redacted value) treated as
|
|
21
|
+
* sensitive.
|
|
22
|
+
*/
|
|
23
|
+
readonly paths?: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* Replacement value. Defaults to "[REDACTED]".
|
|
26
|
+
*/
|
|
27
|
+
readonly replacement?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates a redaction hook that replaces values stored under
|
|
31
|
+
* sensitive-looking keys.
|
|
32
|
+
*
|
|
33
|
+
* Key matching is word-boundary aware (shared with the
|
|
34
|
+
* configuration redactor): "apiToken" and "db.password" are
|
|
35
|
+
* redacted, "tokenizer" is not.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createLogRedactor(options?: LogRedactorOptions): LogRedactionHook;
|
|
38
|
+
//# sourceMappingURL=logRedaction.redaction.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ConfigurationRedactor } from "../../configuration/error/configurationRedactor.redactor.js";
|
|
2
|
+
import { sanitizeLogValue } from "./logEntry.entry.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a redaction hook that replaces values stored under
|
|
5
|
+
* sensitive-looking keys.
|
|
6
|
+
*
|
|
7
|
+
* Key matching is word-boundary aware (shared with the
|
|
8
|
+
* configuration redactor): "apiToken" and "db.password" are
|
|
9
|
+
* redacted, "tokenizer" is not.
|
|
10
|
+
*/
|
|
11
|
+
export function createLogRedactor(options = {}) {
|
|
12
|
+
const redactor = new ConfigurationRedactor({
|
|
13
|
+
sensitivePatterns: options.patterns,
|
|
14
|
+
sensitivePaths: options.paths,
|
|
15
|
+
redactionValue: options.replacement,
|
|
16
|
+
});
|
|
17
|
+
return (value) => redactor.redactObject(sanitizeLogValue(value));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=logRedaction.redaction.js.map
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogLevel } from "./logLevel.level.js";
|
|
2
2
|
/**
|
|
3
3
|
* Structured metadata attached to a log entry.
|
|
4
4
|
*/
|
|
5
5
|
export type LogContext = Record<string, unknown>;
|
|
6
|
-
/**
|
|
7
|
-
* A structured log entry.
|
|
8
|
-
*/
|
|
9
|
-
export interface LogEntry {
|
|
10
|
-
readonly level: LogLevel;
|
|
11
|
-
readonly message: string;
|
|
12
|
-
readonly context?: LogContext;
|
|
13
|
-
readonly timestamp: Date;
|
|
14
|
-
readonly error?: unknown;
|
|
15
|
-
}
|
|
16
6
|
/**
|
|
17
7
|
* Logger contract used throughout Zudojs.
|
|
18
8
|
*
|
|
@@ -59,6 +49,19 @@ export interface Logger {
|
|
|
59
49
|
export declare abstract class BaseLogger implements Logger {
|
|
60
50
|
private readonly persistentContext;
|
|
61
51
|
protected constructor(context?: LogContext);
|
|
52
|
+
/**
|
|
53
|
+
* Merges the persistent (constructor/child) context under the
|
|
54
|
+
* per-call context. Per-call values win on key conflicts.
|
|
55
|
+
*
|
|
56
|
+
* Returns undefined only when there is no context at all, so
|
|
57
|
+
* implementations can keep omitting empty context objects.
|
|
58
|
+
*/
|
|
59
|
+
protected mergeCallContext(context?: LogContext): LogContext | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Returns a copy of the persistent context attached to this
|
|
62
|
+
* logger.
|
|
63
|
+
*/
|
|
64
|
+
protected getPersistentContext(): LogContext;
|
|
62
65
|
trace(message: string, context?: LogContext): void;
|
|
63
66
|
debug(message: string, context?: LogContext): void;
|
|
64
67
|
info(message: string, context?: LogContext): void;
|
|
@@ -11,23 +11,48 @@ export class BaseLogger {
|
|
|
11
11
|
...context,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Merges the persistent (constructor/child) context under the
|
|
16
|
+
* per-call context. Per-call values win on key conflicts.
|
|
17
|
+
*
|
|
18
|
+
* Returns undefined only when there is no context at all, so
|
|
19
|
+
* implementations can keep omitting empty context objects.
|
|
20
|
+
*/
|
|
21
|
+
mergeCallContext(context) {
|
|
22
|
+
const hasPersistent = Object.keys(this.persistentContext).length > 0;
|
|
23
|
+
if (!hasPersistent)
|
|
24
|
+
return context;
|
|
25
|
+
if (context === undefined)
|
|
26
|
+
return { ...this.persistentContext };
|
|
27
|
+
return {
|
|
28
|
+
...this.persistentContext,
|
|
29
|
+
...context,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns a copy of the persistent context attached to this
|
|
34
|
+
* logger.
|
|
35
|
+
*/
|
|
36
|
+
getPersistentContext() {
|
|
37
|
+
return { ...this.persistentContext };
|
|
38
|
+
}
|
|
14
39
|
trace(message, context) {
|
|
15
|
-
this.write("trace", message, context);
|
|
40
|
+
this.write("trace", message, this.mergeCallContext(context));
|
|
16
41
|
}
|
|
17
42
|
debug(message, context) {
|
|
18
|
-
this.write("debug", message, context);
|
|
43
|
+
this.write("debug", message, this.mergeCallContext(context));
|
|
19
44
|
}
|
|
20
45
|
info(message, context) {
|
|
21
|
-
this.write("info", message, context);
|
|
46
|
+
this.write("info", message, this.mergeCallContext(context));
|
|
22
47
|
}
|
|
23
48
|
warn(message, context) {
|
|
24
|
-
this.write("warn", message, context);
|
|
49
|
+
this.write("warn", message, this.mergeCallContext(context));
|
|
25
50
|
}
|
|
26
51
|
error(message, error, context) {
|
|
27
|
-
this.write("error", message, context, error);
|
|
52
|
+
this.write("error", message, this.mergeCallContext(context), error);
|
|
28
53
|
}
|
|
29
54
|
fatal(message, error, context) {
|
|
30
|
-
this.write("fatal", message, context, error);
|
|
55
|
+
this.write("fatal", message, this.mergeCallContext(context), error);
|
|
31
56
|
}
|
|
32
57
|
child(context) {
|
|
33
58
|
return this.createChild({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../../context/core/executionContext.context.js";
|
|
1
2
|
/**
|
|
2
3
|
* Standard context fields that Zudojs can attach to log entries.
|
|
3
4
|
*
|
|
@@ -17,6 +18,10 @@ export interface LoggerContext {
|
|
|
17
18
|
* Unique identifier for the current execution.
|
|
18
19
|
*/
|
|
19
20
|
readonly executionId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Identifier of the runtime the execution belongs to.
|
|
23
|
+
*/
|
|
24
|
+
readonly runtimeId?: string;
|
|
20
25
|
/**
|
|
21
26
|
* Correlation identifier used to connect related operations.
|
|
22
27
|
*/
|
|
@@ -54,6 +59,13 @@ export interface LoggerContext {
|
|
|
54
59
|
*/
|
|
55
60
|
readonly metadata?: Record<string, unknown>;
|
|
56
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Extracts the LoggerContext fields carried by an execution context.
|
|
64
|
+
*
|
|
65
|
+
* Only defined values are returned, so merging the result never
|
|
66
|
+
* overwrites explicit context with `undefined`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function loggerContextFromExecution(context: ExecutionContext): LoggerContext;
|
|
57
69
|
/**
|
|
58
70
|
* Creates a new logger context by merging existing context
|
|
59
71
|
* with additional values.
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the LoggerContext fields carried by an execution context.
|
|
3
|
+
*
|
|
4
|
+
* Only defined values are returned, so merging the result never
|
|
5
|
+
* overwrites explicit context with `undefined`.
|
|
6
|
+
*/
|
|
7
|
+
export function loggerContextFromExecution(context) {
|
|
8
|
+
const fields = { executionId: context.executionId };
|
|
9
|
+
if (context.correlationId !== undefined)
|
|
10
|
+
fields.correlationId = context.correlationId;
|
|
11
|
+
if (context.traceId !== undefined)
|
|
12
|
+
fields.traceId = context.traceId;
|
|
13
|
+
if (context.spanId !== undefined)
|
|
14
|
+
fields.spanId = context.spanId;
|
|
15
|
+
const runtimeId = context.metadata.runtimeId;
|
|
16
|
+
if (typeof runtimeId === "string")
|
|
17
|
+
fields.runtimeId = runtimeId;
|
|
18
|
+
return fields;
|
|
19
|
+
}
|
|
1
20
|
/**
|
|
2
21
|
* Creates a new logger context by merging existing context
|
|
3
22
|
* with additional values.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { LogRedactionHook } from "./logRedaction.redaction.js";
|
|
2
|
+
import type { ContextStorage } from "../../context/provider/contextStorage.storage.js";
|
|
1
3
|
/**
|
|
2
4
|
* Configuration options for the Zudojs logging system.
|
|
3
5
|
*
|
|
@@ -54,6 +56,21 @@ export interface LoggerOptions {
|
|
|
54
56
|
* Additional default context attached to every log entry.
|
|
55
57
|
*/
|
|
56
58
|
readonly context?: Record<string, unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* Redaction hook applied to structured log data (entry context
|
|
61
|
+
* and error details) before it is written.
|
|
62
|
+
*
|
|
63
|
+
* See createLogRedactor for a key-based implementation.
|
|
64
|
+
*/
|
|
65
|
+
readonly redact?: LogRedactionHook;
|
|
66
|
+
/**
|
|
67
|
+
* ContextStorage consulted on every write. When an execution
|
|
68
|
+
* context is active, its `executionId`, `correlationId`,
|
|
69
|
+
* `traceId`, `spanId`, and `metadata.runtimeId` are merged into
|
|
70
|
+
* the entry context beneath the logger's persistent and per-call
|
|
71
|
+
* context (explicit values win). Child loggers inherit it.
|
|
72
|
+
*/
|
|
73
|
+
readonly contextStorage?: ContextStorage;
|
|
57
74
|
}
|
|
58
75
|
/**
|
|
59
76
|
* Logging levels accepted by LoggerOptions.
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* Module implementation logic belongs in the individual
|
|
8
8
|
* module files.
|
|
9
9
|
*/
|
|
10
|
-
export {} from "./module.js";
|
|
11
10
|
export { type ModuleId, type ModuleOptions, type ModuleLifecycle, type Module, BaseModule, isModule, createModule, } from "./module.js";
|
|
12
11
|
export * from "./moduleDefinition.definition.js";
|
|
13
12
|
export * from "./moduleMetadata.metadata.js";
|
package/dist/modules/index.js
CHANGED
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
/*
|
|
11
11
|
* Module contract
|
|
12
12
|
*/
|
|
13
|
-
export {} from // Export everything publicly exposed by module.ts.
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
// Using `export *` here keeps the barrel synchronized
|
|
17
|
-
// with the module contract as it evolves.
|
|
18
|
-
"./module.js";
|
|
19
13
|
export { BaseModule, isModule, createModule, } from "./module.js";
|
|
20
14
|
/*
|
|
21
15
|
* Module definition
|
package/dist/modules/module.d.ts
CHANGED
|
@@ -12,7 +12,13 @@ export type ModuleOptions = Readonly<Record<string, unknown>>;
|
|
|
12
12
|
/**
|
|
13
13
|
* Lifecycle hooks supported by a module.
|
|
14
14
|
*
|
|
15
|
-
* Modules can implement only the hooks they need.
|
|
15
|
+
* Modules can implement only the hooks they need. These are the
|
|
16
|
+
* only hook names the lifecycle engine invokes:
|
|
17
|
+
*
|
|
18
|
+
* initialize step → onInitialize
|
|
19
|
+
* start step → onReady
|
|
20
|
+
* stop step → onShutdown
|
|
21
|
+
* destroy step → onDestroy
|
|
16
22
|
*/
|
|
17
23
|
export interface ModuleLifecycle {
|
|
18
24
|
/**
|