@zudojs/core 1.2.4 → 1.3.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/README.md +13 -2
- package/dist/application/application.d.ts +29 -1
- package/dist/application/application.js +70 -1
- package/dist/application/applicationContext.context.d.ts +0 -1
- package/dist/application/applicationContext.context.js +0 -1
- package/dist/application/applicationState.state.d.ts +0 -1
- package/dist/application/applicationState.state.js +0 -1
- package/dist/application/createApplication.d.ts +0 -1
- package/dist/application/createApplication.js +0 -1
- package/dist/application/index.d.ts +0 -1
- package/dist/application/index.js +0 -1
- package/dist/configuration/configurationManager.manager.d.ts +0 -1
- package/dist/configuration/configurationManager.manager.js +0 -1
- package/dist/configuration/core/configuration.d.ts +0 -1
- package/dist/configuration/core/configuration.js +0 -1
- package/dist/configuration/core/configurationKey.key.d.ts +0 -1
- package/dist/configuration/core/configurationKey.key.js +0 -1
- package/dist/configuration/core/configurationPath.path.d.ts +0 -1
- package/dist/configuration/core/configurationPath.path.js +0 -1
- package/dist/configuration/core/configurationSource.source.d.ts +0 -1
- package/dist/configuration/core/configurationSource.source.js +0 -1
- package/dist/configuration/core/index.d.ts +0 -1
- package/dist/configuration/core/index.js +0 -1
- package/dist/configuration/error/configurationError.error.d.ts +0 -1
- package/dist/configuration/error/configurationError.error.js +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.d.ts +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.js +0 -1
- package/dist/configuration/error/index.d.ts +0 -1
- package/dist/configuration/error/index.js +0 -1
- package/dist/configuration/events/configurationEvents.events.d.ts +0 -1
- package/dist/configuration/events/configurationEvents.events.js +0 -1
- package/dist/configuration/events/index.d.ts +0 -1
- package/dist/configuration/events/index.js +0 -1
- package/dist/configuration/index.d.ts +0 -1
- package/dist/configuration/index.js +0 -1
- package/dist/configuration/loader/configurationLoader.loader.d.ts +0 -1
- package/dist/configuration/loader/configurationLoader.loader.js +0 -1
- package/dist/configuration/loader/index.d.ts +0 -1
- package/dist/configuration/loader/index.js +0 -1
- package/dist/configuration/registry/configurationProvider.provider.d.ts +0 -1
- package/dist/configuration/registry/configurationProvider.provider.js +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.d.ts +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.js +0 -1
- package/dist/configuration/registry/index.d.ts +0 -1
- package/dist/configuration/registry/index.js +0 -1
- package/dist/configuration/schema/configurationSchema.schema.d.ts +0 -1
- package/dist/configuration/schema/configurationSchema.schema.js +0 -1
- package/dist/configuration/schema/configurationValidation.validator.d.ts +0 -1
- package/dist/configuration/schema/configurationValidation.validator.js +0 -1
- package/dist/configuration/schema/index.d.ts +0 -1
- package/dist/configuration/schema/index.js +0 -1
- package/dist/container/container.d.ts +0 -1
- package/dist/container/container.js +0 -1
- package/dist/container/container.lifetime.d.ts +0 -1
- package/dist/container/container.lifetime.js +0 -1
- package/dist/container/index.d.ts +0 -1
- package/dist/container/index.js +0 -1
- package/dist/container/provider.d.ts +0 -1
- package/dist/container/provider.js +0 -1
- package/dist/container/scope.d.ts +0 -1
- package/dist/container/scope.js +0 -1
- package/dist/container/token.d.ts +0 -1
- package/dist/container/token.js +0 -1
- package/dist/context/core/contextAliases.deprecated.d.ts +0 -1
- package/dist/context/core/contextAliases.deprecated.js +0 -1
- package/dist/context/core/contextKey.key.d.ts +0 -1
- package/dist/context/core/contextKey.key.js +4 -3
- package/dist/context/core/executionContext.context.d.ts +0 -1
- package/dist/context/core/executionContext.context.js +0 -1
- package/dist/context/core/index.d.ts +0 -1
- package/dist/context/core/index.js +0 -1
- package/dist/context/index.d.ts +0 -1
- package/dist/context/index.js +0 -1
- package/dist/context/provider/contextProvider.provider.d.ts +0 -1
- package/dist/context/provider/contextProvider.provider.js +0 -1
- package/dist/context/provider/contextStorage.storage.d.ts +0 -1
- package/dist/context/provider/contextStorage.storage.js +0 -1
- package/dist/context/provider/defaultContextStorage.storage.d.ts +0 -1
- package/dist/context/provider/defaultContextStorage.storage.js +0 -1
- package/dist/context/provider/index.d.ts +0 -1
- package/dist/context/provider/index.js +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.js +0 -1
- package/dist/context/snapshot/index.d.ts +0 -1
- package/dist/context/snapshot/index.js +0 -1
- package/dist/context/values/contextValues.values.d.ts +0 -1
- package/dist/context/values/contextValues.values.js +0 -1
- package/dist/context/values/index.d.ts +0 -1
- package/dist/context/values/index.js +0 -1
- package/dist/contracts/adapter.d.ts +0 -1
- package/dist/contracts/adapter.js +0 -1
- package/dist/contracts/disposable.d.ts +0 -1
- package/dist/contracts/disposable.js +0 -1
- package/dist/contracts/handler.d.ts +0 -1
- package/dist/contracts/handler.js +0 -1
- package/dist/contracts/index.d.ts +0 -1
- package/dist/contracts/index.js +0 -1
- package/dist/errors/contextValueNotFound.error.d.ts +15 -0
- package/dist/errors/contextValueNotFound.error.js +23 -0
- package/dist/errors/errorCode.code.d.ts +1 -1
- package/dist/errors/errorCode.code.js +1 -1
- package/dist/errors/exceptions.d.ts +0 -1
- package/dist/errors/exceptions.js +0 -1
- package/dist/errors/frameworkError.error.d.ts +0 -1
- package/dist/errors/frameworkError.error.js +0 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +16 -1
- package/dist/lifecycle/core/index.d.ts +0 -1
- package/dist/lifecycle/core/index.js +0 -1
- package/dist/lifecycle/core/lifecycle.d.ts +12 -2
- package/dist/lifecycle/core/lifecycle.js +12 -2
- package/dist/lifecycle/core/lifecycle.rollback.d.ts +0 -1
- package/dist/lifecycle/core/lifecycle.rollback.js +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.js +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.js +0 -1
- package/dist/lifecycle/index.d.ts +0 -1
- package/dist/lifecycle/index.js +0 -1
- package/dist/lifecycle/manager/index.d.ts +0 -1
- package/dist/lifecycle/manager/index.js +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.js +0 -1
- package/dist/lifecycle/scope/index.d.ts +0 -1
- package/dist/lifecycle/scope/index.js +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.js +0 -1
- package/dist/logging/console/consoleLogger.logger.d.ts +0 -1
- package/dist/logging/console/consoleLogger.logger.js +6 -2
- package/dist/logging/console/index.d.ts +0 -1
- package/dist/logging/console/index.js +0 -1
- package/dist/logging/console/loggerFactory.factory.d.ts +0 -1
- package/dist/logging/console/loggerFactory.factory.js +0 -1
- package/dist/logging/core/index.d.ts +0 -1
- package/dist/logging/core/index.js +0 -1
- package/dist/logging/core/logEntry.entry.d.ts +0 -1
- package/dist/logging/core/logEntry.entry.js +0 -1
- package/dist/logging/core/logLevel.level.d.ts +0 -1
- package/dist/logging/core/logLevel.level.js +0 -1
- package/dist/logging/core/logRedaction.redaction.d.ts +0 -1
- package/dist/logging/core/logRedaction.redaction.js +0 -1
- package/dist/logging/core/logger.d.ts +7 -2
- package/dist/logging/core/logger.js +22 -3
- package/dist/logging/core/loggerContext.context.d.ts +0 -1
- package/dist/logging/core/loggerContext.context.js +0 -1
- package/dist/logging/core/loggerOptions.options.d.ts +6 -3
- package/dist/logging/core/loggerOptions.options.js +0 -1
- package/dist/logging/index.d.ts +0 -1
- package/dist/logging/index.js +0 -1
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -1
- package/dist/modules/module.d.ts +0 -1
- package/dist/modules/module.js +0 -1
- package/dist/modules/moduleContext.context.d.ts +0 -1
- package/dist/modules/moduleContext.context.js +0 -1
- package/dist/modules/moduleDefinition.definition.d.ts +0 -1
- package/dist/modules/moduleDefinition.definition.js +0 -1
- package/dist/modules/moduleDependency/index.d.ts +0 -1
- package/dist/modules/moduleDependency/index.js +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.js +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.js +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.js +0 -1
- package/dist/modules/moduleError/index.d.ts +0 -1
- package/dist/modules/moduleError/index.js +0 -1
- package/dist/modules/moduleError/moduleError.base.d.ts +0 -1
- package/dist/modules/moduleError/moduleError.base.js +0 -1
- package/dist/modules/moduleError/moduleError.dependency.d.ts +19 -3
- package/dist/modules/moduleError/moduleError.dependency.js +16 -4
- package/dist/modules/moduleError/moduleError.helpers.d.ts +0 -1
- package/dist/modules/moduleError/moduleError.helpers.js +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.js +0 -1
- package/dist/modules/moduleError/moduleError.registration.d.ts +0 -1
- package/dist/modules/moduleError/moduleError.registration.js +0 -1
- package/dist/modules/moduleLifecycle/index.d.ts +0 -1
- package/dist/modules/moduleLifecycle/index.js +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.exclusive.d.ts +25 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.exclusive.js +63 -0
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +20 -2
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +52 -20
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +4 -3
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +0 -1
- package/dist/modules/moduleLoader/index.d.ts +0 -1
- package/dist/modules/moduleLoader/index.js +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.js +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.js +0 -1
- package/dist/modules/moduleMetadata.metadata.d.ts +0 -1
- package/dist/modules/moduleMetadata.metadata.js +0 -1
- package/dist/modules/moduleRegistry/index.d.ts +0 -1
- package/dist/modules/moduleRegistry/index.js +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.js +0 -1
- package/dist/runtime/index.d.ts +1 -2
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/runtime.d.ts +18 -2
- package/dist/runtime/runtime.js +23 -1
- package/dist/runtime/runtimeBootstrap/index.d.ts +0 -1
- package/dist/runtime/runtimeBootstrap/index.js +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.js +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +8 -2
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js +0 -1
- package/dist/runtime/runtimeContext/index.d.ts +0 -1
- package/dist/runtime/runtimeContext/index.js +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.js +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.js +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.js +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +0 -1
- package/dist/runtime/runtimeEnvironment/index.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/index.js +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js +0 -1
- package/dist/runtime/runtimeError/index.d.ts +0 -1
- package/dist/runtime/runtimeError/index.js +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.d.ts +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.js +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.js +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.d.ts +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.js +0 -1
- package/dist/runtime/runtimeLogger.d.ts +0 -1
- package/dist/runtime/runtimeLogger.js +5 -2
- package/dist/runtime/runtimeOptions/index.d.ts +0 -1
- package/dist/runtime/runtimeOptions/index.js +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.mode.d.ts +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.mode.js +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +0 -1
- package/dist/runtime/runtimeShutdown/index.d.ts +0 -1
- package/dist/runtime/runtimeShutdown/index.js +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.js +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +4 -2
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js +0 -1
- package/dist/runtime/runtimeSignals/index.d.ts +0 -1
- package/dist/runtime/runtimeSignals/index.js +0 -1
- package/dist/runtime/runtimeSignals/runtimeSignals.d.ts +7 -3
- package/dist/runtime/runtimeSignals/runtimeSignals.fatal.d.ts +0 -1
- package/dist/runtime/runtimeSignals/runtimeSignals.fatal.js +0 -1
- package/dist/runtime/runtimeSignals/runtimeSignals.js +4 -5
- package/dist/runtime/runtimeState.state.d.ts +0 -1
- package/dist/runtime/runtimeState.state.js +0 -1
- package/dist/runtime/runtimeTimeout.d.ts +0 -1
- package/dist/runtime/runtimeTimeout.js +0 -1
- package/package.json +3 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ContextValueNotFoundError } from "../../errors/contextValueNotFound.error.js";
|
|
2
|
+
import { InvalidArgumentError } from "../../errors/exceptions.js";
|
|
1
3
|
/**
|
|
2
4
|
* Creates a strongly typed ContextKey.
|
|
3
5
|
*
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
*/
|
|
10
12
|
export function createContextKey(name) {
|
|
11
13
|
if (!name.trim()) {
|
|
12
|
-
throw new
|
|
14
|
+
throw new InvalidArgumentError("Context key name cannot be empty.");
|
|
13
15
|
}
|
|
14
16
|
return Object.freeze({
|
|
15
17
|
id: Symbol(name),
|
|
@@ -39,7 +41,7 @@ export function getContextValue(store, key) {
|
|
|
39
41
|
export function requireContextValue(store, key) {
|
|
40
42
|
const value = getContextValue(store, key);
|
|
41
43
|
if (value === undefined) {
|
|
42
|
-
throw new
|
|
44
|
+
throw new ContextValueNotFoundError(key.name);
|
|
43
45
|
}
|
|
44
46
|
return value;
|
|
45
47
|
}
|
|
@@ -55,4 +57,3 @@ export function hasContextValue(store, key) {
|
|
|
55
57
|
export function deleteContextValue(store, key) {
|
|
56
58
|
return store.delete(key.id);
|
|
57
59
|
}
|
|
58
|
-
//# sourceMappingURL=contextKey.key.js.map
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { createExecutionContext, deriveExecutionContext, withExecutionMetadata, getExecutionDuration, createExecutionId, type ExecutionContext, type CreateExecutionContextInput, } from "./executionContext.context.js";
|
|
7
7
|
export { createContextKey, setContextValue, getContextValue, requireContextValue, hasContextValue, deleteContextValue, type ContextKey, type ContextValueStore, } from "./contextKey.key.js";
|
|
8
8
|
export { createContext, type Context, type ContextType, type CreateContextOptions, } from "./contextAliases.deprecated.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { createExecutionContext, deriveExecutionContext, withExecutionMetadata, getExecutionDuration, createExecutionId, } from "./executionContext.context.js";
|
|
7
7
|
export { createContextKey, setContextValue, getContextValue, requireContextValue, hasContextValue, deleteContextValue, } from "./contextKey.key.js";
|
|
8
8
|
export { createContext, } from "./contextAliases.deprecated.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/context/index.d.ts
CHANGED
package/dist/context/index.js
CHANGED
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { ContextStorage, createContextStorage, type ExecutionContextOverrides, } from "./contextStorage.storage.js";
|
|
7
7
|
export { defaultContextStorage, getDefaultContextStorage, } from "./defaultContextStorage.storage.js";
|
|
8
8
|
export { DefaultContextProvider, createContextProvider, type ContextProvider, } from "./contextProvider.provider.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { ContextStorage, createContextStorage, } from "./contextStorage.storage.js";
|
|
7
7
|
export { defaultContextStorage, getDefaultContextStorage, } from "./defaultContextStorage.storage.js";
|
|
8
8
|
export { DefaultContextProvider, createContextProvider, } from "./contextProvider.provider.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -45,4 +45,3 @@ export declare function restoreContextSnapshot(snapshot: ContextSnapshot): {
|
|
|
45
45
|
* The original snapshot remains unchanged.
|
|
46
46
|
*/
|
|
47
47
|
export declare function deriveContextSnapshot(snapshot: ContextSnapshot, context: ExecutionContext, values?: ContextValues): ContextSnapshot;
|
|
48
|
-
//# sourceMappingURL=contextSnapshot.snapshot.d.ts.map
|
|
@@ -30,4 +30,3 @@ export function restoreContextSnapshot(snapshot) {
|
|
|
30
30
|
export function deriveContextSnapshot(snapshot, context, values) {
|
|
31
31
|
return createContextSnapshot(context, values ?? new ContextValues(snapshot.values.toStore()));
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=contextSnapshot.snapshot.js.map
|
|
@@ -29,4 +29,3 @@ export type HandlerFunction<TInput = unknown, TOutput = unknown> = (input: TInpu
|
|
|
29
29
|
* Converts a handler function into a Handler object.
|
|
30
30
|
*/
|
|
31
31
|
export declare function createHandler<TInput, TOutput>(handler: HandlerFunction<TInput, TOutput>): Handler<TInput, TOutput>;
|
|
32
|
-
//# sourceMappingURL=handler.d.ts.map
|
package/dist/contracts/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FrameworkError } from "./frameworkError.error.js";
|
|
2
|
+
/**
|
|
3
|
+
* Thrown by `ContextValues.require()` when no value is stored under
|
|
4
|
+
* the requested context key.
|
|
5
|
+
*
|
|
6
|
+
* A plain `Error` used to be thrown here, so callers could neither
|
|
7
|
+
* catch it by type nor read a code from it.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ContextValueNotFoundError extends FrameworkError {
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable name of the missing key.
|
|
12
|
+
*/
|
|
13
|
+
readonly key: string;
|
|
14
|
+
constructor(keyName: string);
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FrameworkError } from "./frameworkError.error.js";
|
|
2
|
+
import { ErrorCode } from "./errorCode.code.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thrown by `ContextValues.require()` when no value is stored under
|
|
5
|
+
* the requested context key.
|
|
6
|
+
*
|
|
7
|
+
* A plain `Error` used to be thrown here, so callers could neither
|
|
8
|
+
* catch it by type nor read a code from it.
|
|
9
|
+
*/
|
|
10
|
+
export class ContextValueNotFoundError extends FrameworkError {
|
|
11
|
+
/**
|
|
12
|
+
* Human-readable name of the missing key.
|
|
13
|
+
*/
|
|
14
|
+
key;
|
|
15
|
+
constructor(keyName) {
|
|
16
|
+
super(`Required context value "${keyName}" is not available.`, {
|
|
17
|
+
code: ErrorCode.CONTEXT_VALUE_NOT_FOUND,
|
|
18
|
+
details: { key: keyName },
|
|
19
|
+
});
|
|
20
|
+
this.name = "ContextValueNotFoundError";
|
|
21
|
+
this.key = keyName;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -30,6 +30,7 @@ export declare const ErrorCode: {
|
|
|
30
30
|
readonly CONFIGURATION_CONFLICT: "CORE_CONFIGURATION_CONFLICT";
|
|
31
31
|
readonly EXECUTION_CONTEXT_NOT_FOUND: "CORE_EXECUTION_CONTEXT_NOT_FOUND";
|
|
32
32
|
readonly INVALID_EXECUTION_CONTEXT: "CORE_INVALID_EXECUTION_CONTEXT";
|
|
33
|
+
readonly CONTEXT_VALUE_NOT_FOUND: "CORE_CONTEXT_VALUE_NOT_FOUND";
|
|
33
34
|
readonly MODULE_NOT_FOUND: "CORE_MODULE_NOT_FOUND";
|
|
34
35
|
readonly MODULE_ALREADY_REGISTERED: "CORE_MODULE_ALREADY_REGISTERED";
|
|
35
36
|
readonly MODULE_INITIALIZATION_FAILED: "CORE_MODULE_INITIALIZATION_FAILED";
|
|
@@ -75,4 +76,3 @@ export declare const ErrorCode: {
|
|
|
75
76
|
* Union of all core Zudojs error codes.
|
|
76
77
|
*/
|
|
77
78
|
export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
78
|
-
//# sourceMappingURL=errorCode.code.d.ts.map
|
|
@@ -35,6 +35,7 @@ export const ErrorCode = {
|
|
|
35
35
|
// Context
|
|
36
36
|
EXECUTION_CONTEXT_NOT_FOUND: "CORE_EXECUTION_CONTEXT_NOT_FOUND",
|
|
37
37
|
INVALID_EXECUTION_CONTEXT: "CORE_INVALID_EXECUTION_CONTEXT",
|
|
38
|
+
CONTEXT_VALUE_NOT_FOUND: "CORE_CONTEXT_VALUE_NOT_FOUND",
|
|
38
39
|
// Modules
|
|
39
40
|
MODULE_NOT_FOUND: "CORE_MODULE_NOT_FOUND",
|
|
40
41
|
MODULE_ALREADY_REGISTERED: "CORE_MODULE_ALREADY_REGISTERED",
|
|
@@ -81,4 +82,3 @@ export const ErrorCode = {
|
|
|
81
82
|
// Configuration validation
|
|
82
83
|
CONFIGURATION_VALIDATION_FAILED: "CORE_CONFIGURATION_VALIDATION_FAILED",
|
|
83
84
|
};
|
|
84
|
-
//# sourceMappingURL=errorCode.code.js.map
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
export { ErrorCode } from "./errorCode.code.js";
|
|
7
7
|
export type { ErrorCode as ErrorCodeType } from "./errorCode.code.js";
|
|
8
8
|
export { FrameworkError, type FrameworkErrorJSON, } from "./frameworkError.error.js";
|
|
9
|
+
export { ContextValueNotFoundError } from "./contextValueNotFound.error.js";
|
|
9
10
|
export { InvalidArgumentError, InvalidStateError, ProviderNotFoundError, ProviderAlreadyRegisteredError, InvalidProviderError, DependencyResolutionError, ConfigurationNotFoundError, ExecutionContextNotFoundError, ModuleNotFoundError, AdapterNotFoundError, describeToken, } from "./exceptions.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/errors/index.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { ErrorCode } from "./errorCode.code.js";
|
|
7
7
|
export { FrameworkError, } from "./frameworkError.error.js";
|
|
8
|
+
export { ContextValueNotFoundError } from "./contextValueNotFound.error.js";
|
|
8
9
|
export { InvalidArgumentError, InvalidStateError, ProviderNotFoundError, ProviderAlreadyRegisteredError, InvalidProviderError, DependencyResolutionError, ConfigurationNotFoundError, ExecutionContextNotFoundError, ModuleNotFoundError, AdapterNotFoundError, describeToken, } from "./exceptions.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -31,4 +31,7 @@ export * from "./modules/index.js";
|
|
|
31
31
|
export { ModuleNotFoundError } from "./modules/index.js";
|
|
32
32
|
export * from "./runtime/index.js";
|
|
33
33
|
export * from "./application/index.js";
|
|
34
|
-
|
|
34
|
+
export { Lifecycle as CoreLifecycle, LifecycleManager as CoreLifecycleManager, LifecycleState as CoreLifecycleState, } from "./lifecycle/index.js";
|
|
35
|
+
export { Container as CoreContainer } from "./container/index.js";
|
|
36
|
+
export { ConfigurationManager as CoreConfigurationManager } from "./configuration/index.js";
|
|
37
|
+
export { createRuntime as createCoreRuntime } from "./runtime/index.js";
|
package/dist/index.js
CHANGED
|
@@ -86,4 +86,19 @@ export * from "./runtime/index.js";
|
|
|
86
86
|
* ============================================================
|
|
87
87
|
*/
|
|
88
88
|
export * from "./application/index.js";
|
|
89
|
-
|
|
89
|
+
/*
|
|
90
|
+
* ============================================================
|
|
91
|
+
* Aliases for colliding names
|
|
92
|
+
* ============================================================
|
|
93
|
+
*
|
|
94
|
+
* These names are also exported, with different meanings, by sibling
|
|
95
|
+
* packages: `LifecycleState`/`LifecycleManager` by @zudojs/lifecycle
|
|
96
|
+
* and @zudojs/constants, `createRuntime` by @zudojs/runtime,
|
|
97
|
+
* `Container` by @zudojs/container, `ConfigurationManager` by
|
|
98
|
+
* @zudojs/config. The originals stay; import the Core-prefixed alias
|
|
99
|
+
* when two of those packages meet in one file.
|
|
100
|
+
*/
|
|
101
|
+
export { Lifecycle as CoreLifecycle, LifecycleManager as CoreLifecycleManager, LifecycleState as CoreLifecycleState, } from "./lifecycle/index.js";
|
|
102
|
+
export { Container as CoreContainer } from "./container/index.js";
|
|
103
|
+
export { ConfigurationManager as CoreConfigurationManager } from "./configuration/index.js";
|
|
104
|
+
export { createRuntime as createCoreRuntime } from "./runtime/index.js";
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { Lifecycle, LifecycleState, type LifecycleOptions, type LifecycleParticipant, } from "./lifecycle.js";
|
|
7
7
|
export { hasInitializeHook, hasStartHook, hasStopHook, hasDestroyHook, type OnInitialize, type OnStart, type OnStop, type OnDestroy, type LifecycleHook, } from "./lifecycleHook.hook.js";
|
|
8
8
|
export { LifecycleRegistry, type LifecycleComponent, type LifecycleRegistration, } from "./lifecycleRegistry.registry.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,4 +6,3 @@
|
|
|
6
6
|
export { Lifecycle, LifecycleState, } from "./lifecycle.js";
|
|
7
7
|
export { hasInitializeHook, hasStartHook, hasStopHook, hasDestroyHook, } from "./lifecycleHook.hook.js";
|
|
8
8
|
export { LifecycleRegistry, } from "./lifecycleRegistry.registry.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { Logger } from "../../logging/core/logger.js";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* States of the core `Lifecycle` participant machine (created →
|
|
4
|
+
* initializing → initialized → starting → running → stopping → stopped,
|
|
5
|
+
* plus failed).
|
|
6
|
+
*
|
|
7
|
+
* This is one of three state vocabularies in the framework and they do
|
|
8
|
+
* not share values: `LifecycleState` from @zudojs/constants describes
|
|
9
|
+
* a component managed by @zudojs/lifecycle (idle … started → ready …
|
|
10
|
+
* disposed) and `RuntimeState` from @zudojs/runtime describes that
|
|
11
|
+
* package's runtime. Import this one as `CoreLifecycleState` when the
|
|
12
|
+
* names would clash.
|
|
13
|
+
*/
|
|
3
14
|
export declare const LifecycleState: {
|
|
4
15
|
readonly CREATED: "created";
|
|
5
16
|
readonly INITIALIZING: "initializing";
|
|
@@ -91,4 +102,3 @@ export declare class Lifecycle {
|
|
|
91
102
|
private runStop;
|
|
92
103
|
private invalidState;
|
|
93
104
|
}
|
|
94
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { InvalidStateError } from "../../errors/exceptions.js";
|
|
2
2
|
import { rollbackStartedParticipants } from "./lifecycle.rollback.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* States of the core `Lifecycle` participant machine (created →
|
|
5
|
+
* initializing → initialized → starting → running → stopping → stopped,
|
|
6
|
+
* plus failed).
|
|
7
|
+
*
|
|
8
|
+
* This is one of three state vocabularies in the framework and they do
|
|
9
|
+
* not share values: `LifecycleState` from @zudojs/constants describes
|
|
10
|
+
* a component managed by @zudojs/lifecycle (idle … started → ready …
|
|
11
|
+
* disposed) and `RuntimeState` from @zudojs/runtime describes that
|
|
12
|
+
* package's runtime. Import this one as `CoreLifecycleState` when the
|
|
13
|
+
* names would clash.
|
|
14
|
+
*/
|
|
4
15
|
export const LifecycleState = {
|
|
5
16
|
CREATED: "created",
|
|
6
17
|
INITIALIZING: "initializing",
|
|
@@ -355,4 +366,3 @@ export class Lifecycle {
|
|
|
355
366
|
return new InvalidStateError(`Cannot ${label} application while state is "${this.state}".`, { operation, state: this.state });
|
|
356
367
|
}
|
|
357
368
|
}
|
|
358
|
-
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -15,4 +15,3 @@ import type { LifecycleParticipant } from "./lifecycle.js";
|
|
|
15
15
|
* @returns The errors raised by `stop()` hooks during the rollback.
|
|
16
16
|
*/
|
|
17
17
|
export declare function rollbackStartedParticipants(participants: readonly LifecycleParticipant[], count: number, logger: Logger | undefined): Promise<readonly unknown[]>;
|
|
18
|
-
//# sourceMappingURL=lifecycle.rollback.d.ts.map
|
package/dist/lifecycle/index.js
CHANGED
|
@@ -299,4 +299,3 @@ export class LifecycleScope {
|
|
|
299
299
|
return new InvalidStateError(`Cannot ${operation} lifecycle scope "${this.name}" while state is "${this.state}".`, { scope: this.name, operation, state: this.state });
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
//# sourceMappingURL=lifecycleScope.scope.js.map
|
|
@@ -3,6 +3,7 @@ import { InvalidArgumentError } from "../../errors/exceptions.js";
|
|
|
3
3
|
import { safeLogStringify, sanitizeLogValue, serializeLogError, } from "../core/logEntry.entry.js";
|
|
4
4
|
import { loggerContextFromExecution } from "../core/loggerContext.context.js";
|
|
5
5
|
import { DEFAULT_LOGGER_OPTIONS, } from "../core/loggerOptions.options.js";
|
|
6
|
+
import { createLogRedactor } from "../core/logRedaction.redaction.js";
|
|
6
7
|
import { BaseLogger } from "../core/logger.js";
|
|
7
8
|
/**
|
|
8
9
|
* Logger implementation that writes structured log entries
|
|
@@ -33,10 +34,14 @@ export class ConsoleLogger extends BaseLogger {
|
|
|
33
34
|
if (!isLogLevel(level)) {
|
|
34
35
|
throw new InvalidArgumentError(`Unknown log level "${String(level)}". Expected one of: ${Object.keys(LogLevelPriority).join(", ")}.`, { level });
|
|
35
36
|
}
|
|
37
|
+
// Secure by default: sensitive keys are redacted unless the caller
|
|
38
|
+
// opts out with `redact: false` or supplies its own hook. Children
|
|
39
|
+
// receive the resolved value, so they inherit whichever it is.
|
|
36
40
|
this.options = {
|
|
37
41
|
...DEFAULT_LOGGER_OPTIONS,
|
|
38
42
|
...options,
|
|
39
43
|
level,
|
|
44
|
+
redact: options.redact === undefined ? createLogRedactor() : options.redact,
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
@@ -51,7 +56,7 @@ export class ConsoleLogger extends BaseLogger {
|
|
|
51
56
|
if (!shouldLog(level, this.options.level)) {
|
|
52
57
|
return;
|
|
53
58
|
}
|
|
54
|
-
const redact = this.options.redact;
|
|
59
|
+
const redact = this.options.redact === false ? undefined : this.options.redact;
|
|
55
60
|
context = this.withExecutionContext(context);
|
|
56
61
|
const entry = {
|
|
57
62
|
level,
|
|
@@ -243,4 +248,3 @@ export class ConsoleLogger extends BaseLogger {
|
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
250
|
}
|
|
246
|
-
//# sourceMappingURL=consoleLogger.logger.js.map
|
|
@@ -9,4 +9,3 @@ export { createLoggerContext, loggerContextFromExecution, type LoggerContext, }
|
|
|
9
9
|
export { serializeLogError, sanitizeLogValue, safeLogStringify, type LogEntry, type LogError, type LogErrorSerializationOptions, } from "./logEntry.entry.js";
|
|
10
10
|
export { createLogRedactor, type LogRedactionHook, type LogRedactorOptions, } from "./logRedaction.redaction.js";
|
|
11
11
|
export { DEFAULT_LOGGER_OPTIONS, type LoggerOptions, type LogLevelOption, } from "./loggerOptions.options.js";
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -9,4 +9,3 @@ export { createLoggerContext, loggerContextFromExecution, } from "./loggerContex
|
|
|
9
9
|
export { serializeLogError, sanitizeLogValue, safeLogStringify, } from "./logEntry.entry.js";
|
|
10
10
|
export { createLogRedactor, } from "./logRedaction.redaction.js";
|
|
11
11
|
export { DEFAULT_LOGGER_OPTIONS, } from "./loggerOptions.options.js";
|
|
12
|
-
//# sourceMappingURL=index.js.map
|