@zudojs/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/application/application.d.ts +25 -0
- package/dist/application/application.d.ts.map +1 -0
- package/dist/application/application.js +86 -0
- package/dist/application/application.js.map +1 -0
- package/dist/application/applicationContext.context.d.ts +40 -0
- package/dist/application/applicationContext.context.d.ts.map +1 -0
- package/dist/application/applicationContext.context.js +43 -0
- package/dist/application/applicationContext.context.js.map +1 -0
- package/dist/application/applicationState.state.d.ts +5 -0
- package/dist/application/applicationState.state.d.ts.map +1 -0
- package/dist/application/applicationState.state.js +2 -0
- package/dist/application/applicationState.state.js.map +1 -0
- package/dist/application/index.d.ts +10 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +10 -0
- package/dist/application/index.js.map +1 -0
- package/dist/configuration/configurationManager.manager.d.ts +68 -0
- package/dist/configuration/configurationManager.manager.d.ts.map +1 -0
- package/dist/configuration/configurationManager.manager.js +157 -0
- package/dist/configuration/configurationManager.manager.js.map +1 -0
- package/dist/configuration/core/configuration.d.ts +53 -0
- package/dist/configuration/core/configuration.d.ts.map +1 -0
- package/dist/configuration/core/configuration.js +206 -0
- package/dist/configuration/core/configuration.js.map +1 -0
- package/dist/configuration/core/configurationKey.key.d.ts +43 -0
- package/dist/configuration/core/configurationKey.key.d.ts.map +1 -0
- package/dist/configuration/core/configurationKey.key.js +27 -0
- package/dist/configuration/core/configurationKey.key.js.map +1 -0
- package/dist/configuration/core/configurationSource.source.d.ts +114 -0
- package/dist/configuration/core/configurationSource.source.d.ts.map +1 -0
- package/dist/configuration/core/configurationSource.source.js +55 -0
- package/dist/configuration/core/configurationSource.source.js.map +1 -0
- package/dist/configuration/core/index.d.ts +12 -0
- package/dist/configuration/core/index.d.ts.map +1 -0
- package/dist/configuration/core/index.js +9 -0
- package/dist/configuration/core/index.js.map +1 -0
- package/dist/configuration/error/configurationError.error.d.ts +108 -0
- package/dist/configuration/error/configurationError.error.d.ts.map +1 -0
- package/dist/configuration/error/configurationError.error.js +168 -0
- package/dist/configuration/error/configurationError.error.js.map +1 -0
- package/dist/configuration/error/configurationRedactor.redactor.d.ts +111 -0
- package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +1 -0
- package/dist/configuration/error/configurationRedactor.redactor.js +176 -0
- package/dist/configuration/error/configurationRedactor.redactor.js.map +1 -0
- package/dist/configuration/error/index.d.ts +10 -0
- package/dist/configuration/error/index.d.ts.map +1 -0
- package/dist/configuration/error/index.js +8 -0
- package/dist/configuration/error/index.js.map +1 -0
- package/dist/configuration/events/configurationEvents.events.d.ts +174 -0
- package/dist/configuration/events/configurationEvents.events.d.ts.map +1 -0
- package/dist/configuration/events/configurationEvents.events.js +99 -0
- package/dist/configuration/events/configurationEvents.events.js.map +1 -0
- package/dist/configuration/events/index.d.ts +8 -0
- package/dist/configuration/events/index.d.ts.map +1 -0
- package/dist/configuration/events/index.js +7 -0
- package/dist/configuration/events/index.js.map +1 -0
- package/dist/configuration/index.d.ts +30 -0
- package/dist/configuration/index.d.ts.map +1 -0
- package/dist/configuration/index.js +29 -0
- package/dist/configuration/index.js.map +1 -0
- package/dist/configuration/loader/configurationLoader.loader.d.ts +113 -0
- package/dist/configuration/loader/configurationLoader.loader.d.ts.map +1 -0
- package/dist/configuration/loader/configurationLoader.loader.js +155 -0
- package/dist/configuration/loader/configurationLoader.loader.js.map +1 -0
- package/dist/configuration/loader/index.d.ts +8 -0
- package/dist/configuration/loader/index.d.ts.map +1 -0
- package/dist/configuration/loader/index.js +7 -0
- package/dist/configuration/loader/index.js.map +1 -0
- package/dist/configuration/registry/configurationProvider.provider.d.ts +130 -0
- package/dist/configuration/registry/configurationProvider.provider.d.ts.map +1 -0
- package/dist/configuration/registry/configurationProvider.provider.js +113 -0
- package/dist/configuration/registry/configurationProvider.provider.js.map +1 -0
- package/dist/configuration/registry/configurationRegistry.registry.d.ts +143 -0
- package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +1 -0
- package/dist/configuration/registry/configurationRegistry.registry.js +157 -0
- package/dist/configuration/registry/configurationRegistry.registry.js.map +1 -0
- package/dist/configuration/registry/index.d.ts +10 -0
- package/dist/configuration/registry/index.d.ts.map +1 -0
- package/dist/configuration/registry/index.js +8 -0
- package/dist/configuration/registry/index.js.map +1 -0
- package/dist/configuration/schema/configurationSchema.schema.d.ts +159 -0
- package/dist/configuration/schema/configurationSchema.schema.d.ts.map +1 -0
- package/dist/configuration/schema/configurationSchema.schema.js +155 -0
- package/dist/configuration/schema/configurationSchema.schema.js.map +1 -0
- package/dist/configuration/schema/configurationValidation.validator.d.ts +82 -0
- package/dist/configuration/schema/configurationValidation.validator.d.ts.map +1 -0
- package/dist/configuration/schema/configurationValidation.validator.js +110 -0
- package/dist/configuration/schema/configurationValidation.validator.js.map +1 -0
- package/dist/configuration/schema/index.d.ts +10 -0
- package/dist/configuration/schema/index.d.ts.map +1 -0
- package/dist/configuration/schema/index.js +8 -0
- package/dist/configuration/schema/index.js.map +1 -0
- package/dist/container/container.d.ts +43 -0
- package/dist/container/container.d.ts.map +1 -0
- package/dist/container/container.js +91 -0
- package/dist/container/container.js.map +1 -0
- package/dist/container/index.d.ts +8 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/container/index.js +8 -0
- package/dist/container/index.js.map +1 -0
- package/dist/container/provider.d.ts +28 -0
- package/dist/container/provider.d.ts.map +1 -0
- package/dist/container/provider.js +2 -0
- package/dist/container/provider.js.map +1 -0
- package/dist/container/scope.d.ts +24 -0
- package/dist/container/scope.d.ts.map +1 -0
- package/dist/container/scope.js +2 -0
- package/dist/container/scope.js.map +1 -0
- package/dist/container/token.d.ts +18 -0
- package/dist/container/token.d.ts.map +1 -0
- package/dist/container/token.js +10 -0
- package/dist/container/token.js.map +1 -0
- package/dist/context/core/context.d.ts +95 -0
- package/dist/context/core/context.d.ts.map +1 -0
- package/dist/context/core/context.js +103 -0
- package/dist/context/core/context.js.map +1 -0
- package/dist/context/core/contextKey.key.d.ts +60 -0
- package/dist/context/core/contextKey.key.d.ts.map +1 -0
- package/dist/context/core/contextKey.key.js +58 -0
- package/dist/context/core/contextKey.key.js.map +1 -0
- package/dist/context/core/executionContext.context.d.ts +131 -0
- package/dist/context/core/executionContext.context.d.ts.map +1 -0
- package/dist/context/core/executionContext.context.js +81 -0
- package/dist/context/core/executionContext.context.js.map +1 -0
- package/dist/context/core/index.d.ts +9 -0
- package/dist/context/core/index.d.ts.map +1 -0
- package/dist/context/core/index.js +9 -0
- package/dist/context/core/index.js.map +1 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +8 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/provider/contextProvider.provider.d.ts +61 -0
- package/dist/context/provider/contextProvider.provider.d.ts.map +1 -0
- package/dist/context/provider/contextProvider.provider.js +44 -0
- package/dist/context/provider/contextProvider.provider.js.map +1 -0
- package/dist/context/provider/contextStorage.storage.d.ts +54 -0
- package/dist/context/provider/contextStorage.storage.d.ts.map +1 -0
- package/dist/context/provider/contextStorage.storage.js +74 -0
- package/dist/context/provider/contextStorage.storage.js.map +1 -0
- package/dist/context/provider/index.d.ts +8 -0
- package/dist/context/provider/index.d.ts.map +1 -0
- package/dist/context/provider/index.js +8 -0
- package/dist/context/provider/index.js.map +1 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts +48 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +1 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.js +33 -0
- package/dist/context/snapshot/contextSnapshot.snapshot.js.map +1 -0
- package/dist/context/snapshot/index.d.ts +8 -0
- package/dist/context/snapshot/index.d.ts.map +1 -0
- package/dist/context/snapshot/index.js +8 -0
- package/dist/context/snapshot/index.js.map +1 -0
- package/dist/context/values/contextValues.values.d.ts +84 -0
- package/dist/context/values/contextValues.values.d.ts.map +1 -0
- package/dist/context/values/contextValues.values.js +120 -0
- package/dist/context/values/contextValues.values.js.map +1 -0
- package/dist/context/values/index.d.ts +7 -0
- package/dist/context/values/index.d.ts.map +1 -0
- package/dist/context/values/index.js +7 -0
- package/dist/context/values/index.js.map +1 -0
- package/dist/contracts/adapter.d.ts +44 -0
- package/dist/contracts/adapter.d.ts.map +1 -0
- package/dist/contracts/adapter.js +2 -0
- package/dist/contracts/adapter.js.map +1 -0
- package/dist/contracts/disposable.d.ts +23 -0
- package/dist/contracts/disposable.d.ts.map +1 -0
- package/dist/contracts/disposable.js +2 -0
- package/dist/contracts/disposable.js.map +1 -0
- package/dist/contracts/handler.d.ts +32 -0
- package/dist/contracts/handler.d.ts.map +1 -0
- package/dist/contracts/handler.js +9 -0
- package/dist/contracts/handler.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/errors/errorCode.code.d.ts +78 -0
- package/dist/errors/errorCode.code.d.ts.map +1 -0
- package/dist/errors/errorCode.code.js +84 -0
- package/dist/errors/errorCode.code.js.map +1 -0
- package/dist/errors/exceptions.d.ts +52 -0
- package/dist/errors/exceptions.d.ts.map +1 -0
- package/dist/errors/exceptions.js +125 -0
- package/dist/errors/exceptions.js.map +1 -0
- package/dist/errors/frameworkError.error.d.ts +51 -0
- package/dist/errors/frameworkError.error.d.ts.map +1 -0
- package/dist/errors/frameworkError.error.js +54 -0
- package/dist/errors/frameworkError.error.js.map +1 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +9 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/core/index.d.ts +9 -0
- package/dist/lifecycle/core/index.d.ts.map +1 -0
- package/dist/lifecycle/core/index.js +9 -0
- package/dist/lifecycle/core/index.js.map +1 -0
- package/dist/lifecycle/core/lifecycle.d.ts +44 -0
- package/dist/lifecycle/core/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycle.js +179 -0
- package/dist/lifecycle/core/lifecycle.js.map +1 -0
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts +59 -0
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleHook.hook.js +37 -0
- package/dist/lifecycle/core/lifecycleHook.hook.js.map +1 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +101 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js +115 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +1 -0
- package/dist/lifecycle/core/lifecycleState.state.d.ts +2 -0
- package/dist/lifecycle/core/lifecycleState.state.d.ts.map +1 -0
- package/dist/lifecycle/core/lifecycleState.state.js +2 -0
- package/dist/lifecycle/core/lifecycleState.state.js.map +1 -0
- package/dist/lifecycle/index.d.ts +10 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +10 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle/manager/index.d.ts +7 -0
- package/dist/lifecycle/manager/index.d.ts.map +1 -0
- package/dist/lifecycle/manager/index.js +7 -0
- package/dist/lifecycle/manager/index.js.map +1 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +33 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +1 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.js +157 -0
- package/dist/lifecycle/manager/lifecycleManager.manager.js.map +1 -0
- package/dist/lifecycle/scope/index.d.ts +8 -0
- package/dist/lifecycle/scope/index.d.ts.map +1 -0
- package/dist/lifecycle/scope/index.js +8 -0
- package/dist/lifecycle/scope/index.js.map +1 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +49 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +1 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.js +234 -0
- package/dist/lifecycle/scope/lifecycleScope.scope.js.map +1 -0
- package/dist/logging/console/consoleLogger.logger.d.ts +59 -0
- package/dist/logging/console/consoleLogger.logger.d.ts.map +1 -0
- package/dist/logging/console/consoleLogger.logger.js +180 -0
- package/dist/logging/console/consoleLogger.logger.js.map +1 -0
- package/dist/logging/console/index.d.ts +8 -0
- package/dist/logging/console/index.d.ts.map +1 -0
- package/dist/logging/console/index.js +8 -0
- package/dist/logging/console/index.js.map +1 -0
- package/dist/logging/console/loggerFactory.factory.d.ts +45 -0
- package/dist/logging/console/loggerFactory.factory.d.ts.map +1 -0
- package/dist/logging/console/loggerFactory.factory.js +37 -0
- package/dist/logging/console/loggerFactory.factory.js.map +1 -0
- package/dist/logging/core/index.d.ts +11 -0
- package/dist/logging/core/index.d.ts.map +1 -0
- package/dist/logging/core/index.js +11 -0
- package/dist/logging/core/index.js.map +1 -0
- package/dist/logging/core/logEntry.entry.d.ts +73 -0
- package/dist/logging/core/logEntry.entry.d.ts.map +1 -0
- package/dist/logging/core/logEntry.entry.js +38 -0
- package/dist/logging/core/logEntry.entry.js.map +1 -0
- package/dist/logging/core/logLevel.level.d.ts +29 -0
- package/dist/logging/core/logLevel.level.d.ts.map +1 -0
- package/dist/logging/core/logLevel.level.js +34 -0
- package/dist/logging/core/logLevel.level.js.map +1 -0
- package/dist/logging/core/logger.d.ts +80 -0
- package/dist/logging/core/logger.d.ts.map +1 -0
- package/dist/logging/core/logger.js +39 -0
- package/dist/logging/core/logger.js.map +1 -0
- package/dist/logging/core/loggerContext.context.d.ts +62 -0
- package/dist/logging/core/loggerContext.context.d.ts.map +1 -0
- package/dist/logging/core/loggerContext.context.js +19 -0
- package/dist/logging/core/loggerContext.context.js.map +1 -0
- package/dist/logging/core/loggerOptions.options.d.ts +69 -0
- package/dist/logging/core/loggerOptions.options.d.ts.map +1 -0
- package/dist/logging/core/loggerOptions.options.js +10 -0
- package/dist/logging/core/loggerOptions.options.js.map +1 -0
- package/dist/logging/index.d.ts +8 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +8 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/modules/index.d.ts +20 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +52 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/module.d.ts +171 -0
- package/dist/modules/module.d.ts.map +1 -0
- package/dist/modules/module.js +99 -0
- package/dist/modules/module.js.map +1 -0
- package/dist/modules/moduleContext.context.d.ts +170 -0
- package/dist/modules/moduleContext.context.d.ts.map +1 -0
- package/dist/modules/moduleContext.context.js +82 -0
- package/dist/modules/moduleContext.context.js.map +1 -0
- package/dist/modules/moduleDefinition.definition.d.ts +112 -0
- package/dist/modules/moduleDefinition.definition.d.ts.map +1 -0
- package/dist/modules/moduleDefinition.definition.js +101 -0
- package/dist/modules/moduleDefinition.definition.js.map +1 -0
- package/dist/modules/moduleDependency/index.d.ts +10 -0
- package/dist/modules/moduleDependency/index.d.ts.map +1 -0
- package/dist/modules/moduleDependency/index.js +10 -0
- package/dist/modules/moduleDependency/index.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +43 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.js +175 -0
- package/dist/modules/moduleDependency/moduleDependency.graph.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +38 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js +112 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts +66 -0
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +1 -0
- package/dist/modules/moduleDependency/moduleDependency.type.js +2 -0
- package/dist/modules/moduleDependency/moduleDependency.type.js.map +1 -0
- package/dist/modules/moduleError/index.d.ts +11 -0
- package/dist/modules/moduleError/index.d.ts.map +1 -0
- package/dist/modules/moduleError/index.js +11 -0
- package/dist/modules/moduleError/index.js.map +1 -0
- package/dist/modules/moduleError/moduleError.base.d.ts +119 -0
- package/dist/modules/moduleError/moduleError.base.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.base.js +105 -0
- package/dist/modules/moduleError/moduleError.base.js.map +1 -0
- package/dist/modules/moduleError/moduleError.dependency.d.ts +45 -0
- package/dist/modules/moduleError/moduleError.dependency.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.dependency.js +55 -0
- package/dist/modules/moduleError/moduleError.dependency.js.map +1 -0
- package/dist/modules/moduleError/moduleError.helpers.d.ts +22 -0
- package/dist/modules/moduleError/moduleError.helpers.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.helpers.js +32 -0
- package/dist/modules/moduleError/moduleError.helpers.js.map +1 -0
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts +61 -0
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.lifecycle.js +107 -0
- package/dist/modules/moduleError/moduleError.lifecycle.js.map +1 -0
- package/dist/modules/moduleError/moduleError.registration.d.ts +21 -0
- package/dist/modules/moduleError/moduleError.registration.d.ts.map +1 -0
- package/dist/modules/moduleError/moduleError.registration.js +39 -0
- package/dist/modules/moduleError/moduleError.registration.js.map +1 -0
- package/dist/modules/moduleLifecycle/index.d.ts +10 -0
- package/dist/modules/moduleLifecycle/index.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/index.js +10 -0
- package/dist/modules/moduleLifecycle/index.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +41 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +116 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +21 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +107 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +94 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +1 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +11 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +1 -0
- package/dist/modules/moduleLoader/index.d.ts +9 -0
- package/dist/modules/moduleLoader/index.d.ts.map +1 -0
- package/dist/modules/moduleLoader/index.js +9 -0
- package/dist/modules/moduleLoader/index.js.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +36 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.js +164 -0
- package/dist/modules/moduleLoader/moduleLoader.loader.js.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts +57 -0
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +1 -0
- package/dist/modules/moduleLoader/moduleLoader.type.js +11 -0
- package/dist/modules/moduleLoader/moduleLoader.type.js.map +1 -0
- package/dist/modules/moduleMetadata.metadata.d.ts +36 -0
- package/dist/modules/moduleMetadata.metadata.d.ts.map +1 -0
- package/dist/modules/moduleMetadata.metadata.js +105 -0
- package/dist/modules/moduleMetadata.metadata.js.map +1 -0
- package/dist/modules/moduleRegistry/index.d.ts +8 -0
- package/dist/modules/moduleRegistry/index.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/index.js +8 -0
- package/dist/modules/moduleRegistry/index.js.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +35 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js +155 -0
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +134 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +1 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.js +2 -0
- package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +1 -0
- package/dist/runtime/index.d.ts +24 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +42 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/runtime.d.ts +89 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/runtime.js +179 -0
- package/dist/runtime/runtime.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/index.d.ts +10 -0
- package/dist/runtime/runtimeBootstrap/index.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/index.js +9 -0
- package/dist/runtime/runtimeBootstrap/index.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +8 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.js +8 -0
- package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +6 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +27 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +19 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +107 -0
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +25 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +122 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +78 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +1 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js +2 -0
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +1 -0
- package/dist/runtime/runtimeContext/index.d.ts +10 -0
- package/dist/runtime/runtimeContext/index.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/index.js +9 -0
- package/dist/runtime/runtimeContext/index.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +38 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.js +99 -0
- package/dist/runtime/runtimeContext/runtimeContext.core.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +22 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.js +43 -0
- package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +68 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +1 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.js +2 -0
- package/dist/runtime/runtimeContext/runtimeContext.type.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts +9 -0
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/index.js +9 -0
- package/dist/runtime/runtimeEnvironment/detection/index.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts +8 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js +92 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +51 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +26 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/index.d.ts +10 -0
- package/dist/runtime/runtimeEnvironment/index.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/index.js +9 -0
- package/dist/runtime/runtimeEnvironment/index.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +41 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +105 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +108 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +1 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js +2 -0
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +1 -0
- package/dist/runtime/runtimeError/index.d.ts +29 -0
- package/dist/runtime/runtimeError/index.d.ts.map +1 -0
- package/dist/runtime/runtimeError/index.js +47 -0
- package/dist/runtime/runtimeError/index.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.base.d.ts +30 -0
- package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.base.js +81 -0
- package/dist/runtime/runtimeError/runtimeError.base.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +35 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js +77 -0
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +35 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.js +79 -0
- package/dist/runtime/runtimeError/runtimeError.specialized.js.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.type.d.ts +74 -0
- package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +1 -0
- package/dist/runtime/runtimeError/runtimeError.type.js +28 -0
- package/dist/runtime/runtimeError/runtimeError.type.js.map +1 -0
- package/dist/runtime/runtimeLogger.d.ts +5 -0
- package/dist/runtime/runtimeLogger.d.ts.map +1 -0
- package/dist/runtime/runtimeLogger.js +18 -0
- package/dist/runtime/runtimeLogger.js.map +1 -0
- package/dist/runtime/runtimeManager/index.d.ts +12 -0
- package/dist/runtime/runtimeManager/index.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/index.js +11 -0
- package/dist/runtime/runtimeManager/index.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +31 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.js +136 -0
- package/dist/runtime/runtimeManager/runtimeManager.core.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +14 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.js +21 -0
- package/dist/runtime/runtimeManager/runtimeManager.error.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +7 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.js +8 -0
- package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +16 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +49 -0
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +54 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +1 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.js +2 -0
- package/dist/runtime/runtimeManager/runtimeManager.type.js.map +1 -0
- package/dist/runtime/runtimeOptions/index.d.ts +10 -0
- package/dist/runtime/runtimeOptions/index.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/index.js +9 -0
- package/dist/runtime/runtimeOptions/index.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +6 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +37 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts +10 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +80 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +94 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js +2 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts +26 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +1 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +59 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +1 -0
- package/dist/runtime/runtimeShutdown/index.d.ts +10 -0
- package/dist/runtime/runtimeShutdown/index.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/index.js +9 -0
- package/dist/runtime/runtimeShutdown/index.js.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +7 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.js +7 -0
- package/dist/runtime/runtimeShutdown/pipeline/index.js.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +9 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +67 -0
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +35 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +147 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +74 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +1 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js +2 -0
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +1 -0
- package/dist/runtime/runtimeState.state.d.ts +60 -0
- package/dist/runtime/runtimeState.state.d.ts.map +1 -0
- package/dist/runtime/runtimeState.state.js +157 -0
- package/dist/runtime/runtimeState.state.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../core/executionContext.context.js";
|
|
2
|
+
import { ContextStorage } from "../provider/contextStorage.storage.js";
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the current execution context.
|
|
5
|
+
*
|
|
6
|
+
* ContextProvider intentionally hides the underlying storage
|
|
7
|
+
* mechanism from the rest of the framework.
|
|
8
|
+
*/
|
|
9
|
+
export interface ContextProvider {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the current execution context.
|
|
12
|
+
*
|
|
13
|
+
* Returns undefined when no context is active.
|
|
14
|
+
*/
|
|
15
|
+
get(): ExecutionContext | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the current execution context.
|
|
18
|
+
*
|
|
19
|
+
* Throws when no context is active.
|
|
20
|
+
*/
|
|
21
|
+
require(): ExecutionContext;
|
|
22
|
+
/**
|
|
23
|
+
* Determines whether an execution context is active.
|
|
24
|
+
*/
|
|
25
|
+
has(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Executes a callback within the supplied context.
|
|
28
|
+
*/
|
|
29
|
+
run<T>(context: ExecutionContext, callback: () => T): T;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Default ContextProvider implementation.
|
|
33
|
+
*
|
|
34
|
+
* Uses ContextStorage internally while keeping that
|
|
35
|
+
* implementation detail hidden behind the provider contract.
|
|
36
|
+
*/
|
|
37
|
+
export declare class DefaultContextProvider implements ContextProvider {
|
|
38
|
+
private readonly storage;
|
|
39
|
+
constructor(storage?: ContextStorage);
|
|
40
|
+
/**
|
|
41
|
+
* Returns the current execution context.
|
|
42
|
+
*/
|
|
43
|
+
get(): ExecutionContext | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the current execution context or throws.
|
|
46
|
+
*/
|
|
47
|
+
require(): ExecutionContext;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether a context is active.
|
|
50
|
+
*/
|
|
51
|
+
has(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Runs a callback within an execution context.
|
|
54
|
+
*/
|
|
55
|
+
run<T>(context: ExecutionContext, callback: () => T): T;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates the default framework context provider.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createContextProvider(): ContextProvider;
|
|
61
|
+
//# sourceMappingURL=contextProvider.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextProvider.provider.d.ts","sourceRoot":"","sources":["../../../src/context/provider/contextProvider.provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,GAAG,IAAI,gBAAgB,GAAG,SAAS,CAAC;IAEpC;;;;OAIG;IACH,OAAO,IAAI,gBAAgB,CAAC;IAE5B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC;IAEf;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;CACzD;AAED;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,YAAmB,OAAO,GAAE,cAAqC,EAEhE;IAED;;OAEG;IACI,GAAG,IAAI,gBAAgB,GAAG,SAAS,CAEzC;IAED;;OAEG;IACI,OAAO,IAAI,gBAAgB,CAEjC;IAED;;OAEG;IACI,GAAG,IAAI,OAAO,CAEpB;IAED;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAE7D;CACF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAEvD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ContextStorage } from "../provider/contextStorage.storage.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default ContextProvider implementation.
|
|
4
|
+
*
|
|
5
|
+
* Uses ContextStorage internally while keeping that
|
|
6
|
+
* implementation detail hidden behind the provider contract.
|
|
7
|
+
*/
|
|
8
|
+
export class DefaultContextProvider {
|
|
9
|
+
storage;
|
|
10
|
+
constructor(storage = new ContextStorage()) {
|
|
11
|
+
this.storage = storage;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the current execution context.
|
|
15
|
+
*/
|
|
16
|
+
get() {
|
|
17
|
+
return this.storage.get();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the current execution context or throws.
|
|
21
|
+
*/
|
|
22
|
+
require() {
|
|
23
|
+
return this.storage.require();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether a context is active.
|
|
27
|
+
*/
|
|
28
|
+
has() {
|
|
29
|
+
return this.storage.has();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Runs a callback within an execution context.
|
|
33
|
+
*/
|
|
34
|
+
run(context, callback) {
|
|
35
|
+
return this.storage.run(context, callback);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates the default framework context provider.
|
|
40
|
+
*/
|
|
41
|
+
export function createContextProvider() {
|
|
42
|
+
return new DefaultContextProvider();
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=contextProvider.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextProvider.provider.js","sourceRoot":"","sources":["../../../src/context/provider/contextProvider.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAkCvE;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IAChB,OAAO,CAAiB;IAEzC,YAAmB,OAAO,GAAmB,IAAI,cAAc,EAAE;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,GAAG;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,GAAG;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,OAAyB,EAAE,QAAiB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,sBAAsB,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../core/executionContext.context.js";
|
|
2
|
+
/**
|
|
3
|
+
* Stores the current ExecutionContext across asynchronous
|
|
4
|
+
* boundaries.
|
|
5
|
+
*
|
|
6
|
+
* This allows framework components to access the current
|
|
7
|
+
* execution without explicitly passing the context through
|
|
8
|
+
* every function call.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ContextStorage {
|
|
11
|
+
private readonly storage;
|
|
12
|
+
/**
|
|
13
|
+
* Runs a function inside an execution context.
|
|
14
|
+
*
|
|
15
|
+
* The context is automatically available to all asynchronous
|
|
16
|
+
* operations created within the callback.
|
|
17
|
+
*/
|
|
18
|
+
run<T>(context: ExecutionContext, callback: () => T): T;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the current execution context.
|
|
21
|
+
*
|
|
22
|
+
* Returns undefined when called outside a managed execution.
|
|
23
|
+
*/
|
|
24
|
+
get(): ExecutionContext | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the current execution context.
|
|
27
|
+
*
|
|
28
|
+
* Throws when no execution context is available.
|
|
29
|
+
*/
|
|
30
|
+
require(): ExecutionContext;
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether an execution context is currently available.
|
|
33
|
+
*/
|
|
34
|
+
has(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Executes a callback with a derived execution context.
|
|
37
|
+
*/
|
|
38
|
+
runWith<T>(context: ExecutionContext, callback: () => T): T;
|
|
39
|
+
/**
|
|
40
|
+
* Executes a callback using the current context with
|
|
41
|
+
* a temporary derived context.
|
|
42
|
+
*/
|
|
43
|
+
runDerived<T>(context: ExecutionContext, callback: () => T): T;
|
|
44
|
+
/**
|
|
45
|
+
* Clears the current execution context by executing the
|
|
46
|
+
* callback outside the current storage context.
|
|
47
|
+
*/
|
|
48
|
+
runWithoutContext<T>(callback: () => T): T;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a ContextStorage instance.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createContextStorage(): ContextStorage;
|
|
54
|
+
//# sourceMappingURL=contextStorage.storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextStorage.storage.d.ts","sourceRoot":"","sources":["../../../src/context/provider/contextStorage.storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAE5E;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6C;IAErE;;;;;OAKG;IACI,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAE7D;IAED;;;;OAIG;IACI,GAAG,IAAI,gBAAgB,GAAG,SAAS,CAEzC;IAED;;;;OAIG;IACI,OAAO,IAAI,gBAAgB,CAQjC;IAED;;OAEG;IACI,GAAG,IAAI,OAAO,CAEpB;IAED;;OAEG;IACI,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEjE;IAED;;;OAGG;IACI,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEpE;IAED;;;OAGG;IACI,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEhD;CACF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAErD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
/**
|
|
3
|
+
* Stores the current ExecutionContext across asynchronous
|
|
4
|
+
* boundaries.
|
|
5
|
+
*
|
|
6
|
+
* This allows framework components to access the current
|
|
7
|
+
* execution without explicitly passing the context through
|
|
8
|
+
* every function call.
|
|
9
|
+
*/
|
|
10
|
+
export class ContextStorage {
|
|
11
|
+
storage = new AsyncLocalStorage();
|
|
12
|
+
/**
|
|
13
|
+
* Runs a function inside an execution context.
|
|
14
|
+
*
|
|
15
|
+
* The context is automatically available to all asynchronous
|
|
16
|
+
* operations created within the callback.
|
|
17
|
+
*/
|
|
18
|
+
run(context, callback) {
|
|
19
|
+
return this.storage.run(context, callback);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns the current execution context.
|
|
23
|
+
*
|
|
24
|
+
* Returns undefined when called outside a managed execution.
|
|
25
|
+
*/
|
|
26
|
+
get() {
|
|
27
|
+
return this.storage.getStore();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the current execution context.
|
|
31
|
+
*
|
|
32
|
+
* Throws when no execution context is available.
|
|
33
|
+
*/
|
|
34
|
+
require() {
|
|
35
|
+
const context = this.get();
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error("No execution context is available.");
|
|
38
|
+
}
|
|
39
|
+
return context;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Checks whether an execution context is currently available.
|
|
43
|
+
*/
|
|
44
|
+
has() {
|
|
45
|
+
return this.get() !== undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Executes a callback with a derived execution context.
|
|
49
|
+
*/
|
|
50
|
+
runWith(context, callback) {
|
|
51
|
+
return this.run(context, callback);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Executes a callback using the current context with
|
|
55
|
+
* a temporary derived context.
|
|
56
|
+
*/
|
|
57
|
+
runDerived(context, callback) {
|
|
58
|
+
return this.storage.run(context, callback);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Clears the current execution context by executing the
|
|
62
|
+
* callback outside the current storage context.
|
|
63
|
+
*/
|
|
64
|
+
runWithoutContext(callback) {
|
|
65
|
+
return this.storage.exit(callback);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a ContextStorage instance.
|
|
70
|
+
*/
|
|
71
|
+
export function createContextStorage() {
|
|
72
|
+
return new ContextStorage();
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=contextStorage.storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextStorage.storage.js","sourceRoot":"","sources":["../../../src/context/provider/contextStorage.storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD;;;;;;;GAOG;AACH,MAAM,OAAO,cAAc;IACR,OAAO,GAAG,IAAI,iBAAiB,EAAoB,CAAC;IAErE;;;;;OAKG;IACI,GAAG,CAAI,OAAyB,EAAE,QAAiB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACI,GAAG;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACI,OAAO;QACZ,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE3B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,GAAG;QACR,OAAO,IAAI,CAAC,GAAG,EAAE,KAAK,SAAS,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,OAAO,CAAI,OAAyB,EAAE,QAAiB;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAI,OAAyB,EAAE,QAAiB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAI,QAAiB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/context/provider
|
|
3
|
+
*
|
|
4
|
+
* Async context storage and provider.
|
|
5
|
+
*/
|
|
6
|
+
export { ContextStorage, createContextStorage, } from "./contextStorage.storage.js";
|
|
7
|
+
export { DefaultContextProvider, createContextProvider, type ContextProvider, } from "./contextProvider.provider.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/provider/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/context/provider
|
|
3
|
+
*
|
|
4
|
+
* Async context storage and provider.
|
|
5
|
+
*/
|
|
6
|
+
export { ContextStorage, createContextStorage, } from "./contextStorage.storage.js";
|
|
7
|
+
export { DefaultContextProvider, createContextProvider, } from "./contextProvider.provider.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/provider/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../core/executionContext.context.js";
|
|
2
|
+
import { ContextValues } from "../values/contextValues.values.js";
|
|
3
|
+
/**
|
|
4
|
+
* Immutable snapshot of an execution context.
|
|
5
|
+
*
|
|
6
|
+
* A snapshot captures both:
|
|
7
|
+
*
|
|
8
|
+
* 1. The execution metadata
|
|
9
|
+
* 2. The typed context values
|
|
10
|
+
*
|
|
11
|
+
* This allows the context to be restored later, for example
|
|
12
|
+
* when processing a background job or an asynchronous task.
|
|
13
|
+
*/
|
|
14
|
+
export interface ContextSnapshot {
|
|
15
|
+
/**
|
|
16
|
+
* Execution context captured at snapshot time.
|
|
17
|
+
*/
|
|
18
|
+
readonly context: ExecutionContext;
|
|
19
|
+
/**
|
|
20
|
+
* Typed context values captured at snapshot time.
|
|
21
|
+
*/
|
|
22
|
+
readonly values: ContextValues;
|
|
23
|
+
/**
|
|
24
|
+
* Time at which the snapshot was created.
|
|
25
|
+
*/
|
|
26
|
+
readonly capturedAt: Date;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a snapshot from an execution context.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createContextSnapshot(context: ExecutionContext, values?: ContextValues): ContextSnapshot;
|
|
32
|
+
/**
|
|
33
|
+
* Restores an execution context from a snapshot.
|
|
34
|
+
*
|
|
35
|
+
* The returned objects are references to the immutable
|
|
36
|
+
* snapshot state, so no mutable state is shared accidentally.
|
|
37
|
+
*/
|
|
38
|
+
export declare function restoreContextSnapshot(snapshot: ContextSnapshot): {
|
|
39
|
+
readonly context: ExecutionContext;
|
|
40
|
+
readonly values: ContextValues;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new snapshot derived from an existing snapshot.
|
|
44
|
+
*
|
|
45
|
+
* The original snapshot remains unchanged.
|
|
46
|
+
*/
|
|
47
|
+
export declare function deriveContextSnapshot(snapshot: ContextSnapshot, context: ExecutionContext, values?: ContextValues): ContextSnapshot;
|
|
48
|
+
//# sourceMappingURL=contextSnapshot.snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextSnapshot.snapshot.d.ts","sourceRoot":"","sources":["../../../src/context/snapshot/contextSnapshot.snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,GAAE,aAAqC,GAC5C,eAAe,CAMjB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG;IACjE,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC,CAKA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,eAAe,CAKjB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ContextValues } from "../values/contextValues.values.js";
|
|
2
|
+
import { createContextValues } from "../values/contextValues.values.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a snapshot from an execution context.
|
|
5
|
+
*/
|
|
6
|
+
export function createContextSnapshot(context, values = createContextValues()) {
|
|
7
|
+
return Object.freeze({
|
|
8
|
+
context,
|
|
9
|
+
values,
|
|
10
|
+
capturedAt: new Date(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Restores an execution context from a snapshot.
|
|
15
|
+
*
|
|
16
|
+
* The returned objects are references to the immutable
|
|
17
|
+
* snapshot state, so no mutable state is shared accidentally.
|
|
18
|
+
*/
|
|
19
|
+
export function restoreContextSnapshot(snapshot) {
|
|
20
|
+
return {
|
|
21
|
+
context: snapshot.context,
|
|
22
|
+
values: new ContextValues(snapshot.values.toStore()),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new snapshot derived from an existing snapshot.
|
|
27
|
+
*
|
|
28
|
+
* The original snapshot remains unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export function deriveContextSnapshot(snapshot, context, values) {
|
|
31
|
+
return createContextSnapshot(context, values ?? new ContextValues(snapshot.values.toStore()));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=contextSnapshot.snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextSnapshot.snapshot.js","sourceRoot":"","sources":["../../../src/context/snapshot/contextSnapshot.snapshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AA8BxE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAyB,EACzB,MAAM,GAAkB,mBAAmB,EAAE;IAE7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO;QACP,MAAM;QACN,UAAU,EAAE,IAAI,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAyB;IAI9D,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,MAAM,EAAE,IAAI,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;KACrD,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAyB,EACzB,OAAyB,EACzB,MAAsB;IAEtB,OAAO,qBAAqB,CAC1B,OAAO,EACP,MAAM,IAAI,IAAI,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/context/snapshot
|
|
3
|
+
*
|
|
4
|
+
* Context snapshots for propagation across
|
|
5
|
+
* asynchronous and distributed boundaries.
|
|
6
|
+
*/
|
|
7
|
+
export { createContextSnapshot, restoreContextSnapshot, deriveContextSnapshot, type ContextSnapshot, } from "./contextSnapshot.snapshot.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/core/context/snapshot
|
|
3
|
+
*
|
|
4
|
+
* Context snapshots for propagation across
|
|
5
|
+
* asynchronous and distributed boundaries.
|
|
6
|
+
*/
|
|
7
|
+
export { createContextSnapshot, restoreContextSnapshot, deriveContextSnapshot, } from "./contextSnapshot.snapshot.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ContextKey, ContextValueStore } from "../core/contextKey.key.js";
|
|
2
|
+
/**
|
|
3
|
+
* Immutable, strongly typed storage for values associated
|
|
4
|
+
* with an ExecutionContext.
|
|
5
|
+
*
|
|
6
|
+
* ContextValues keeps application scoped values separate from
|
|
7
|
+
* the fixed properties of ExecutionContext.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ContextValues {
|
|
10
|
+
private readonly values;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a ContextValues instance.
|
|
13
|
+
*
|
|
14
|
+
* An optional initial store can be supplied when deriving
|
|
15
|
+
* a new context value collection.
|
|
16
|
+
*/
|
|
17
|
+
constructor(values?: ContextValueStore);
|
|
18
|
+
/**
|
|
19
|
+
* Returns a value associated with a context key.
|
|
20
|
+
*
|
|
21
|
+
* Returns undefined when the value does not exist.
|
|
22
|
+
*/
|
|
23
|
+
get<T>(key: ContextKey<T>): T | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Returns a required context value.
|
|
26
|
+
*
|
|
27
|
+
* Throws when the value does not exist.
|
|
28
|
+
*/
|
|
29
|
+
require<T>(key: ContextKey<T>): T;
|
|
30
|
+
/**
|
|
31
|
+
* Checks whether a value exists for the supplied key.
|
|
32
|
+
*/
|
|
33
|
+
has<T>(key: ContextKey<T>): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a new ContextValues instance with
|
|
36
|
+
* the supplied value added or replaced.
|
|
37
|
+
*/
|
|
38
|
+
set<T>(key: ContextKey<T>, value: T): ContextValues;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a new ContextValues instance with
|
|
41
|
+
* the supplied key removed.
|
|
42
|
+
*/
|
|
43
|
+
delete<T>(key: ContextKey<T>): ContextValues;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a new ContextValues instance without
|
|
46
|
+
* any stored values.
|
|
47
|
+
*/
|
|
48
|
+
clear(): ContextValues;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the number of stored context values.
|
|
51
|
+
*/
|
|
52
|
+
size(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Returns whether no values are stored.
|
|
55
|
+
*/
|
|
56
|
+
isEmpty(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new ContextValues instance containing
|
|
59
|
+
* all existing values plus the supplied values.
|
|
60
|
+
*/
|
|
61
|
+
merge(other: ContextValues): ContextValues;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a mutable internal snapshot.
|
|
64
|
+
*
|
|
65
|
+
* This is intentionally not exposed publicly as a Map.
|
|
66
|
+
*
|
|
67
|
+
* It is useful for framework infrastructure that needs to
|
|
68
|
+
* derive another ContextValues instance.
|
|
69
|
+
*/
|
|
70
|
+
toStore(): ContextValueStore;
|
|
71
|
+
/**
|
|
72
|
+
* Iterates over stored context values.
|
|
73
|
+
*
|
|
74
|
+
* Keys are exposed as symbols because the ContextKey
|
|
75
|
+
* objects themselves are intentionally not recoverable
|
|
76
|
+
* from the internal store.
|
|
77
|
+
*/
|
|
78
|
+
entries(): IterableIterator<readonly [symbol, unknown]>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Creates an empty ContextValues collection.
|
|
82
|
+
*/
|
|
83
|
+
export declare function createContextValues(): ContextValues;
|
|
84
|
+
//# sourceMappingURL=contextValues.values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextValues.values.d.ts","sourceRoot":"","sources":["../../../src/context/values/contextValues.values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAO/E;;;;;;GAMG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C;;;;;OAKG;IACH,YAAmB,MAAM,CAAC,EAAE,iBAAiB,EAE5C;IAED;;;;OAIG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAE/C;IAED;;;;OAIG;IACI,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAEvC;IAED;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAEzC;IAED;;;OAGG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,aAAa,CAMzD;IAED;;;OAGG;IACI,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAMlD;IAED;;;OAGG;IACI,KAAK,IAAI,aAAa,CAE5B;IAED;;OAEG;IACI,IAAI,IAAI,MAAM,CAEpB;IAED;;OAEG;IACI,OAAO,IAAI,OAAO,CAExB;IAED;;;OAGG;IACI,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAQhD;IAED;;;;;;;OAOG;IACI,OAAO,IAAI,iBAAiB,CAElC;IAED;;;;;;OAMG;IACK,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAI9D;CACF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { getContextValue, hasContextValue, requireContextValue, } from "../core/contextKey.key.js";
|
|
2
|
+
/**
|
|
3
|
+
* Immutable, strongly typed storage for values associated
|
|
4
|
+
* with an ExecutionContext.
|
|
5
|
+
*
|
|
6
|
+
* ContextValues keeps application scoped values separate from
|
|
7
|
+
* the fixed properties of ExecutionContext.
|
|
8
|
+
*/
|
|
9
|
+
export class ContextValues {
|
|
10
|
+
values;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a ContextValues instance.
|
|
13
|
+
*
|
|
14
|
+
* An optional initial store can be supplied when deriving
|
|
15
|
+
* a new context value collection.
|
|
16
|
+
*/
|
|
17
|
+
constructor(values) {
|
|
18
|
+
this.values = new Map(values ?? []);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns a value associated with a context key.
|
|
22
|
+
*
|
|
23
|
+
* Returns undefined when the value does not exist.
|
|
24
|
+
*/
|
|
25
|
+
get(key) {
|
|
26
|
+
return getContextValue(this.values, key);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns a required context value.
|
|
30
|
+
*
|
|
31
|
+
* Throws when the value does not exist.
|
|
32
|
+
*/
|
|
33
|
+
require(key) {
|
|
34
|
+
return requireContextValue(this.values, key);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether a value exists for the supplied key.
|
|
38
|
+
*/
|
|
39
|
+
has(key) {
|
|
40
|
+
return hasContextValue(this.values, key);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns a new ContextValues instance with
|
|
44
|
+
* the supplied value added or replaced.
|
|
45
|
+
*/
|
|
46
|
+
set(key, value) {
|
|
47
|
+
const values = new Map(this.values);
|
|
48
|
+
values.set(key.id, value);
|
|
49
|
+
return new ContextValues(values);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns a new ContextValues instance with
|
|
53
|
+
* the supplied key removed.
|
|
54
|
+
*/
|
|
55
|
+
delete(key) {
|
|
56
|
+
const values = new Map(this.values);
|
|
57
|
+
values.delete(key.id);
|
|
58
|
+
return new ContextValues(values);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns a new ContextValues instance without
|
|
62
|
+
* any stored values.
|
|
63
|
+
*/
|
|
64
|
+
clear() {
|
|
65
|
+
return new ContextValues();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns the number of stored context values.
|
|
69
|
+
*/
|
|
70
|
+
size() {
|
|
71
|
+
return this.values.size;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns whether no values are stored.
|
|
75
|
+
*/
|
|
76
|
+
isEmpty() {
|
|
77
|
+
return this.values.size === 0;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Creates a new ContextValues instance containing
|
|
81
|
+
* all existing values plus the supplied values.
|
|
82
|
+
*/
|
|
83
|
+
merge(other) {
|
|
84
|
+
const values = new Map(this.values);
|
|
85
|
+
for (const [key, value] of other.values) {
|
|
86
|
+
values.set(key, value);
|
|
87
|
+
}
|
|
88
|
+
return new ContextValues(values);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a mutable internal snapshot.
|
|
92
|
+
*
|
|
93
|
+
* This is intentionally not exposed publicly as a Map.
|
|
94
|
+
*
|
|
95
|
+
* It is useful for framework infrastructure that needs to
|
|
96
|
+
* derive another ContextValues instance.
|
|
97
|
+
*/
|
|
98
|
+
toStore() {
|
|
99
|
+
return new Map(this.values);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Iterates over stored context values.
|
|
103
|
+
*
|
|
104
|
+
* Keys are exposed as symbols because the ContextKey
|
|
105
|
+
* objects themselves are intentionally not recoverable
|
|
106
|
+
* from the internal store.
|
|
107
|
+
*/
|
|
108
|
+
*entries() {
|
|
109
|
+
for (const entry of this.values.entries()) {
|
|
110
|
+
yield entry;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates an empty ContextValues collection.
|
|
116
|
+
*/
|
|
117
|
+
export function createContextValues() {
|
|
118
|
+
return new ContextValues();
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=contextValues.values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextValues.values.js","sourceRoot":"","sources":["../../../src/context/values/contextValues.values.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IACP,MAAM,CAAoB;IAE3C;;;;;OAKG;IACH,YAAmB,MAA0B;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAI,GAAkB;QAC9B,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAI,GAAkB;QAClC,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAkB;QAC9B,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,GAAG,CAAI,GAAkB,EAAE,KAAQ;QACxC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEpC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAE1B,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAI,GAAkB;QACjC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEpC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEtB,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,OAAO,IAAI,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,KAAoB;QAC/B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;IACI,OAAO;QACZ,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACI,CAAC,OAAO;QACb,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,aAAa,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/values/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/values/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
|