@bluelibs/runner 5.3.0 → 5.4.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/dist/browser/index.cjs +829 -742
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.mjs +828 -743
- package/dist/browser/index.mjs.map +1 -1
- package/dist/edge/index.cjs +829 -742
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.mjs +828 -743
- package/dist/edge/index.mjs.map +1 -1
- package/dist/node/node.cjs +1462 -1706
- package/dist/node/node.cjs.map +1 -1
- package/dist/node/node.mjs +1459 -1659
- package/dist/node/node.mjs.map +1 -1
- package/dist/types/definers/builders/event/utils.d.ts +1 -4
- package/dist/types/definers/builders/hook/utils.d.ts +1 -4
- package/dist/types/definers/builders/middleware/utils.d.ts +1 -4
- package/dist/types/definers/builders/resource/utils.d.ts +1 -4
- package/dist/types/definers/builders/shared/mergeUtils.d.ts +5 -0
- package/dist/types/definers/builders/task/utils.d.ts +1 -4
- package/dist/types/definers/builders/utils.d.ts +1 -1
- package/dist/types/errors.d.ts +20 -21
- package/dist/types/models/DependencyProcessor.d.ts +1 -1
- package/dist/types/models/MiddlewareManager.d.ts +2 -2
- package/dist/types/models/RunResult.d.ts +1 -1
- package/dist/types/models/Store.d.ts +10 -10
- package/dist/types/models/StoreRegistry.d.ts +14 -13
- package/dist/types/models/middleware/ResourceMiddlewareComposer.d.ts +2 -2
- package/dist/types/models/utils/buildDependencyGraph.d.ts +12 -0
- package/dist/types/models/utils/dependencyStrategies.d.ts +15 -0
- package/dist/types/models/utils/disposeOrder.d.ts +7 -0
- package/dist/types/node/durable/core/DurableResource.d.ts +1 -0
- package/dist/types/node/durable/core/resource.d.ts +5 -5
- package/dist/types/node/durable/resources/memoryDurableResource.d.ts +5 -5
- package/dist/types/node/durable/resources/redisDurableResource.d.ts +5 -5
- package/dist/types/node/durable/tags/durableWorkflow.tag.d.ts +6 -1
- package/dist/types/node/exposure/requestContext.d.ts +1 -1
- package/dist/types/node/exposure/resource.d.ts +7 -7
- package/dist/types/node/http/http-mixed-client.factory.resource.d.ts +1 -1
- package/dist/types/node/http/http-smart-client.factory.resource.d.ts +1 -1
- package/dist/types/node/node.d.ts +1 -184
- package/dist/types/platform/adapters/edge.d.ts +17 -0
- package/dist/types/platform/adapters/universal-generic.d.ts +3 -0
- package/dist/types/platform/index.d.ts +1 -0
- package/dist/types/platform/types.d.ts +7 -1
- package/dist/types/public.d.ts +2 -0
- package/dist/types/tools/LockableMap.d.ts +20 -0
- package/dist/types/types/symbols.d.ts +1 -1
- package/dist/types/types/task.d.ts +1 -1
- package/dist/ui/assets/index-Bo7Gi6Vq.js +141 -0
- package/dist/ui/assets/index-Y_9aLumt.css +1 -0
- package/dist/ui/index.html +2 -3
- package/dist/universal/index.cjs +829 -742
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.mjs +828 -743
- package/dist/universal/index.mjs.map +1 -1
- package/package.json +1 -2
- package/readmes/AI.md +34 -3
- package/dist/ui/assets/index-2cb8f39f.js +0 -141
- package/dist/ui/assets/index-b1f988bf.css +0 -1
- /package/dist/types/{tunnels → tools}/buildUniversalManifest.d.ts +0 -0
- /package/dist/types/{processHooks.d.ts → tools/processShutdownHooks.d.ts} +0 -0
|
@@ -3,7 +3,4 @@ import type { BuilderState } from "./types";
|
|
|
3
3
|
* Clones and patches the builder state immutably.
|
|
4
4
|
*/
|
|
5
5
|
export declare function clone<TPayload>(s: BuilderState<TPayload>, patch: Partial<BuilderState<TPayload>>): BuilderState<TPayload>;
|
|
6
|
-
|
|
7
|
-
* Generic array merge with override support.
|
|
8
|
-
*/
|
|
9
|
-
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
6
|
+
export { mergeArray } from "../shared/mergeUtils";
|
|
@@ -4,10 +4,7 @@ import type { BuilderState } from "./types";
|
|
|
4
4
|
* Clones and patches the builder state immutably.
|
|
5
5
|
*/
|
|
6
6
|
export declare function clone<TDeps extends DependencyMapType, TOn extends "*" | IEventDefinition<any> | readonly IEventDefinition<any>[] | undefined, TMeta extends ITaskMeta, TNextDeps extends DependencyMapType = TDeps, TNextOn extends "*" | IEventDefinition<any> | readonly IEventDefinition<any>[] | undefined = TOn, TNextMeta extends ITaskMeta = TMeta>(s: BuilderState<TDeps, TOn, TMeta>, patch: Partial<BuilderState<TNextDeps, TNextOn, TNextMeta>>): BuilderState<TNextDeps, TNextOn, TNextMeta>;
|
|
7
|
-
|
|
8
|
-
* Generic array merge with override support.
|
|
9
|
-
*/
|
|
10
|
-
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
7
|
+
export { mergeArray } from "../shared/mergeUtils";
|
|
11
8
|
/**
|
|
12
9
|
* Merges dependencies handling all combinations of objects and functions.
|
|
13
10
|
*/
|
|
@@ -8,10 +8,7 @@ export declare function cloneTask<C, In, Out, D extends DependencyMapType>(s: Ta
|
|
|
8
8
|
* Clones and patches the Resource middleware state immutably.
|
|
9
9
|
*/
|
|
10
10
|
export declare function cloneRes<C, In, Out, D extends DependencyMapType>(s: ResMwState<C, In, Out, D>, patch: Partial<ResMwState<C, In, Out, D>>): ResMwState<C, In, Out, D>;
|
|
11
|
-
|
|
12
|
-
* Generic array merge with override support.
|
|
13
|
-
*/
|
|
14
|
-
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
11
|
+
export { mergeArray } from "../shared/mergeUtils";
|
|
15
12
|
/**
|
|
16
13
|
* Merges dependencies handling all combinations of objects and functions.
|
|
17
14
|
*/
|
|
@@ -16,10 +16,7 @@ export declare function normalizeRegisterFunction<TConfig>(fn: (config: TConfig)
|
|
|
16
16
|
* Merges register state handling all combinations of arrays and functions.
|
|
17
17
|
*/
|
|
18
18
|
export declare function mergeRegister<TConfig>(existing: RegisterState<TConfig>, addition: RegisterInput<TConfig>, override: boolean): RegisterState<TConfig>;
|
|
19
|
-
|
|
20
|
-
* Generic array merge with override support.
|
|
21
|
-
*/
|
|
22
|
-
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
19
|
+
export { mergeArray } from "../shared/mergeUtils";
|
|
23
20
|
/**
|
|
24
21
|
* Merges dependencies handling all combinations of objects and functions.
|
|
25
22
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared builder utility: merges arrays with override support.
|
|
3
|
+
* When `override` is true, returns only the addition; otherwise concatenates.
|
|
4
|
+
*/
|
|
5
|
+
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
@@ -4,10 +4,7 @@ import type { BuilderState } from "./types";
|
|
|
4
4
|
* Clones and patches the builder state immutably.
|
|
5
5
|
*/
|
|
6
6
|
export declare function clone<TInput, TOutput, TDeps extends DependencyMapType, TMeta extends ITaskMeta, TTags extends TagType[], TMiddleware extends TaskMiddlewareAttachmentType[], TNextInput = TInput, TNextOutput = TOutput, TNextDeps extends DependencyMapType = TDeps, TNextMeta extends ITaskMeta = TMeta, TNextTags extends TagType[] = TTags, TNextMiddleware extends TaskMiddlewareAttachmentType[] = TMiddleware>(s: BuilderState<TInput, TOutput, TDeps, TMeta, TTags, TMiddleware>, patch: Partial<BuilderState<TNextInput, TNextOutput, TNextDeps, TNextMeta, TNextTags, TNextMiddleware>>): BuilderState<TNextInput, TNextOutput, TNextDeps, TNextMeta, TNextTags, TNextMiddleware>;
|
|
7
|
-
|
|
8
|
-
* Generic array merge with override support.
|
|
9
|
-
*/
|
|
10
|
-
export declare function mergeArray<T>(existing: ReadonlyArray<T> | undefined, addition: ReadonlyArray<T>, override: boolean): T[];
|
|
7
|
+
export { mergeArray } from "../shared/mergeUtils";
|
|
11
8
|
/**
|
|
12
9
|
* Merges dependencies handling all combinations of objects and functions.
|
|
13
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DependencyMapType } from "../../defs";
|
|
2
2
|
export declare function cloneState<S, NS>(s: S, patch: Partial<NS>): NS;
|
|
3
|
-
export
|
|
3
|
+
export { mergeArray } from "./shared/mergeUtils";
|
|
4
4
|
export declare function mergeDepsNoConfig<TExisting extends DependencyMapType, TNew extends DependencyMapType>(existing: TExisting | (() => TExisting) | undefined, addition: TNew | (() => TNew), override: boolean): (TExisting & TNew) | (() => TExisting & TNew);
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,75 +1,74 @@
|
|
|
1
1
|
import type { DefaultErrorType } from "./types/error";
|
|
2
|
-
export declare const duplicateRegistrationError: import("./
|
|
2
|
+
export declare const duplicateRegistrationError: import("./defs").IErrorHelper<{
|
|
3
3
|
type: string;
|
|
4
4
|
id: string;
|
|
5
5
|
} & DefaultErrorType>;
|
|
6
|
-
export declare const dependencyNotFoundError: import("./
|
|
6
|
+
export declare const dependencyNotFoundError: import("./defs").IErrorHelper<{
|
|
7
7
|
key: string;
|
|
8
8
|
} & DefaultErrorType>;
|
|
9
|
-
export declare const unknownItemTypeError: import("./
|
|
9
|
+
export declare const unknownItemTypeError: import("./defs").IErrorHelper<{
|
|
10
10
|
item: unknown;
|
|
11
11
|
} & DefaultErrorType>;
|
|
12
|
-
export declare const contextError: import("./
|
|
12
|
+
export declare const contextError: import("./defs").IErrorHelper<{
|
|
13
13
|
details?: string;
|
|
14
14
|
} & DefaultErrorType>;
|
|
15
|
-
export declare const circularDependenciesError: import("./
|
|
15
|
+
export declare const circularDependenciesError: import("./defs").IErrorHelper<{
|
|
16
16
|
cycles: string[];
|
|
17
17
|
} & DefaultErrorType>;
|
|
18
|
-
export declare const eventNotFoundError: import("./
|
|
18
|
+
export declare const eventNotFoundError: import("./defs").IErrorHelper<{
|
|
19
19
|
id: string;
|
|
20
20
|
} & DefaultErrorType>;
|
|
21
|
-
export declare const resourceNotFoundError: import("./
|
|
21
|
+
export declare const resourceNotFoundError: import("./defs").IErrorHelper<{
|
|
22
22
|
id: string;
|
|
23
23
|
} & DefaultErrorType>;
|
|
24
|
-
export declare const middlewareNotRegisteredError: import("./
|
|
24
|
+
export declare const middlewareNotRegisteredError: import("./defs").IErrorHelper<{
|
|
25
25
|
type: "task" | "resource";
|
|
26
26
|
source: string;
|
|
27
27
|
middlewareId: string;
|
|
28
28
|
} & DefaultErrorType>;
|
|
29
|
-
export declare const tagNotFoundError: import("./
|
|
29
|
+
export declare const tagNotFoundError: import("./defs").IErrorHelper<{
|
|
30
30
|
id: string;
|
|
31
31
|
} & DefaultErrorType>;
|
|
32
|
-
export declare const lockedError: import("./
|
|
32
|
+
export declare const lockedError: import("./defs").IErrorHelper<{
|
|
33
33
|
what: string;
|
|
34
34
|
} & DefaultErrorType>;
|
|
35
|
-
export declare const storeAlreadyInitializedError: import("./
|
|
36
|
-
export declare const validationError: import("./
|
|
35
|
+
export declare const storeAlreadyInitializedError: import("./defs").IErrorHelper<DefaultErrorType>;
|
|
36
|
+
export declare const validationError: import("./defs").IErrorHelper<{
|
|
37
37
|
subject: string;
|
|
38
38
|
id: string;
|
|
39
39
|
originalError: string | Error;
|
|
40
40
|
} & DefaultErrorType>;
|
|
41
|
-
export declare const eventCycleError: import("./
|
|
41
|
+
export declare const eventCycleError: import("./defs").IErrorHelper<{
|
|
42
42
|
path: Array<{
|
|
43
43
|
id: string;
|
|
44
44
|
source: string;
|
|
45
45
|
}>;
|
|
46
46
|
} & DefaultErrorType>;
|
|
47
|
-
export declare const eventEmissionCycleError: import("./
|
|
47
|
+
export declare const eventEmissionCycleError: import("./defs").IErrorHelper<{
|
|
48
48
|
cycles: string[];
|
|
49
49
|
} & DefaultErrorType>;
|
|
50
|
-
export declare const platformUnsupportedFunctionError: import("./
|
|
50
|
+
export declare const platformUnsupportedFunctionError: import("./defs").IErrorHelper<{
|
|
51
51
|
functionName: string;
|
|
52
52
|
} & DefaultErrorType>;
|
|
53
|
-
export declare const cancellationError: import("./
|
|
53
|
+
export declare const cancellationError: import("./defs").IErrorHelper<{
|
|
54
54
|
reason?: string;
|
|
55
55
|
} & DefaultErrorType>;
|
|
56
|
-
export declare const tunnelOwnershipConflictError: import("./
|
|
56
|
+
export declare const tunnelOwnershipConflictError: import("./defs").IErrorHelper<{
|
|
57
57
|
taskId: string;
|
|
58
58
|
currentOwnerId: string;
|
|
59
59
|
attemptedOwnerId: string;
|
|
60
60
|
} & DefaultErrorType>;
|
|
61
|
-
export declare const phantomTaskNotRoutedError: import("./
|
|
61
|
+
export declare const phantomTaskNotRoutedError: import("./defs").IErrorHelper<{
|
|
62
62
|
taskId: string;
|
|
63
63
|
} & DefaultErrorType>;
|
|
64
|
-
export declare const taskNotRegisteredError: import("./
|
|
64
|
+
export declare const taskNotRegisteredError: import("./defs").IErrorHelper<{
|
|
65
65
|
taskId: string;
|
|
66
66
|
} & DefaultErrorType>;
|
|
67
67
|
/** Builder types that require validation before build() */
|
|
68
68
|
export type BuilderType = "hook" | "task-middleware" | "resource-middleware";
|
|
69
|
-
export declare const builderIncompleteError: import("./
|
|
69
|
+
export declare const builderIncompleteError: import("./defs").IErrorHelper<{
|
|
70
70
|
type: BuilderType;
|
|
71
71
|
builderId: string;
|
|
72
72
|
missingFields: string[];
|
|
73
73
|
} & DefaultErrorType>;
|
|
74
|
-
export declare function isCancellationError(err: unknown): boolean;
|
|
75
74
|
export type { IErrorHelper } from "./types/error";
|
|
@@ -34,7 +34,7 @@ export declare class DependencyProcessor {
|
|
|
34
34
|
*/
|
|
35
35
|
attachListeners(): void;
|
|
36
36
|
extractDependencies<T extends DependencyMapType>(map: T, source: string): Promise<DependencyValuesType<T>>;
|
|
37
|
-
extractDependency(object:
|
|
37
|
+
extractDependency(object: unknown, source: string): Promise<any>;
|
|
38
38
|
/**
|
|
39
39
|
* Converts the event into a running functions with real inputs
|
|
40
40
|
* @param object
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DependencyMapType, ITask, IResource } from "../defs";
|
|
1
|
+
import { DependencyMapType, ITask, IResource, ResourceDependencyValuesType } from "../defs";
|
|
2
2
|
import { Store } from "./Store";
|
|
3
3
|
import { ITaskMiddleware, IResourceMiddleware } from "../defs";
|
|
4
4
|
import { TaskMiddlewareInterceptor, ResourceMiddlewareInterceptor } from "./middleware/types";
|
|
@@ -59,7 +59,7 @@ export declare class MiddlewareManager {
|
|
|
59
59
|
/**
|
|
60
60
|
* Run a resource init wrapped with its applicable middlewares.
|
|
61
61
|
*/
|
|
62
|
-
runResourceInit<C, V extends Promise<any>, D extends DependencyMapType, TContext>(resource: IResource<C, V, D, TContext>, config: C, dependencies:
|
|
62
|
+
runResourceInit<C, V extends Promise<any>, D extends DependencyMapType, TContext>(resource: IResource<C, V, D, TContext>, config: C, dependencies: ResourceDependencyValuesType<D>, context: TContext): Promise<V | undefined>;
|
|
63
63
|
/**
|
|
64
64
|
* Gets all "everywhere" middlewares that apply to the given task
|
|
65
65
|
* @deprecated Internal method exposed for testing - may be removed in future versions
|
|
@@ -18,7 +18,7 @@ export declare class RunResult<V> {
|
|
|
18
18
|
* @param args - The arguments to pass to the task.
|
|
19
19
|
* @returns The result of the task.
|
|
20
20
|
*/
|
|
21
|
-
runTask: <I = undefined, O extends Promise<any> = any, D extends DependencyMapType =
|
|
21
|
+
runTask: <I = undefined, O extends Promise<any> = any, D extends DependencyMapType = DependencyMapType>(task: ITask<I, O, D> | string, ...args: I extends undefined | void ? [] : [I]) => Promise<O | undefined>;
|
|
22
22
|
/**
|
|
23
23
|
* Emit an event within the context of the run result.
|
|
24
24
|
* @param event - The event to emit.
|
|
@@ -24,15 +24,15 @@ export declare class Store {
|
|
|
24
24
|
private readonly initializedResourceIds;
|
|
25
25
|
mode: RunnerMode;
|
|
26
26
|
constructor(eventManager: EventManager, logger: Logger, onUnhandledError: OnUnhandledError, mode?: RunnerMode);
|
|
27
|
-
get tasks():
|
|
28
|
-
get hooks():
|
|
29
|
-
get resources():
|
|
30
|
-
get events():
|
|
31
|
-
get errors():
|
|
32
|
-
get asyncContexts():
|
|
33
|
-
get taskMiddlewares():
|
|
34
|
-
get resourceMiddlewares():
|
|
35
|
-
get tags():
|
|
27
|
+
get tasks(): import("..").LockableMap<string, TaskStoreElementType>;
|
|
28
|
+
get hooks(): import("..").LockableMap<string, import("..").HookStoreElementType>;
|
|
29
|
+
get resources(): import("..").LockableMap<string, ResourceStoreElementType>;
|
|
30
|
+
get events(): import("..").LockableMap<string, EventStoreElementType>;
|
|
31
|
+
get errors(): import("..").LockableMap<string, import("..").IErrorHelper<any>>;
|
|
32
|
+
get asyncContexts(): import("..").LockableMap<string, import("..").IAsyncContext<any>>;
|
|
33
|
+
get taskMiddlewares(): import("..").LockableMap<string, import("..").TaskMiddlewareStoreElementType>;
|
|
34
|
+
get resourceMiddlewares(): import("..").LockableMap<string, import("..").ResourceMiddlewareStoreElementType>;
|
|
35
|
+
get tags(): import("..").LockableMap<string, ITag<void, void, void>>;
|
|
36
36
|
get overrides(): Map<string, IResourceMiddleware<any, void, void, any> | import("..").ITask<any, any, {}, any, import("..").TagType[], import("..").TaskMiddlewareAttachmentType[]> | import("..").IHook<{}, any, any> | IResource<void, Promise<any>, any, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]> | ITaskMiddleware<any, void, void, any> | import("..").IResourceWithConfig<any, Promise<any>, any, any, any, import("..").TagType[], IResourceMiddleware<any, void, void, any>[]>>;
|
|
37
37
|
get overrideRequests(): Set<{
|
|
38
38
|
source: string;
|
|
@@ -47,7 +47,7 @@ export declare class Store {
|
|
|
47
47
|
private setupRootResource;
|
|
48
48
|
validateDependencyGraph(): void;
|
|
49
49
|
validateEventEmissionGraph(): void;
|
|
50
|
-
initializeStore(root: IResource<any, any, any, any, any>, config:
|
|
50
|
+
initializeStore(root: IResource<any, any, any, any, any>, config: unknown): void;
|
|
51
51
|
dispose(): Promise<void>;
|
|
52
52
|
recordResourceInitialized(resourceId: string): void;
|
|
53
53
|
private getResourcesInDisposeOrder;
|
|
@@ -2,24 +2,26 @@ import { IResource, ITask, AnyTask, IResourceWithConfig, RegisterableItems, ITas
|
|
|
2
2
|
import { TaskStoreElementType, TaskMiddlewareStoreElementType, ResourceMiddlewareStoreElementType, ResourceStoreElementType, EventStoreElementType, HookStoreElementType } from "../defs";
|
|
3
3
|
import { StoreValidator } from "./StoreValidator";
|
|
4
4
|
import { Store } from "./Store";
|
|
5
|
-
import { IDependentNode } from "./utils/findCircularDependencies";
|
|
6
5
|
import { IErrorHelper } from "../types/error";
|
|
7
6
|
import type { IAsyncContext } from "../types/asyncContext";
|
|
7
|
+
import { LockableMap } from "../tools/LockableMap";
|
|
8
8
|
type StoringMode = "normal" | "override";
|
|
9
9
|
export declare class StoreRegistry {
|
|
10
10
|
protected readonly store: Store;
|
|
11
|
-
tasks:
|
|
12
|
-
resources:
|
|
13
|
-
events:
|
|
14
|
-
taskMiddlewares:
|
|
15
|
-
resourceMiddlewares:
|
|
16
|
-
hooks:
|
|
17
|
-
tags:
|
|
18
|
-
asyncContexts:
|
|
19
|
-
errors:
|
|
11
|
+
tasks: LockableMap<string, TaskStoreElementType>;
|
|
12
|
+
resources: LockableMap<string, ResourceStoreElementType>;
|
|
13
|
+
events: LockableMap<string, EventStoreElementType>;
|
|
14
|
+
taskMiddlewares: LockableMap<string, TaskMiddlewareStoreElementType>;
|
|
15
|
+
resourceMiddlewares: LockableMap<string, ResourceMiddlewareStoreElementType>;
|
|
16
|
+
hooks: LockableMap<string, HookStoreElementType>;
|
|
17
|
+
tags: LockableMap<string, ITag<void, void, void>>;
|
|
18
|
+
asyncContexts: LockableMap<string, IAsyncContext<any>>;
|
|
19
|
+
errors: LockableMap<string, IErrorHelper<any>>;
|
|
20
20
|
private validator;
|
|
21
21
|
constructor(store: Store);
|
|
22
22
|
getValidator(): StoreValidator;
|
|
23
|
+
/** Lock every map in the registry, preventing further mutations. */
|
|
24
|
+
lockAll(): void;
|
|
23
25
|
storeGenericItem<_C>(item: RegisterableItems): void;
|
|
24
26
|
storeError<_C>(item: IErrorHelper<any>): void;
|
|
25
27
|
storeAsyncContext<_C>(item: IAsyncContext<any>): void;
|
|
@@ -32,13 +34,12 @@ export declare class StoreRegistry {
|
|
|
32
34
|
computeRegistrationDeeply<_C>(element: IResource<_C>, config?: _C): void;
|
|
33
35
|
storeResource<_C>(item: IResource<any, any, any>, overrideMode?: StoringMode): IResource<any, any, any, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
34
36
|
storeTask<_C>(item: ITask<any, any, {}>, storingMode?: StoringMode): void;
|
|
35
|
-
getDependentNodes(): IDependentNode[];
|
|
37
|
+
getDependentNodes(): import("./utils/findCircularDependencies").IDependentNode[];
|
|
36
38
|
/**
|
|
37
39
|
* Builds a directed graph of event emissions based on hooks listening to events
|
|
38
40
|
* and their dependencies on events (emission capability). Ignores wildcard hooks by default.
|
|
39
41
|
*/
|
|
40
|
-
buildEventEmissionGraph(): IDependentNode[];
|
|
41
|
-
private setupBlankNodes;
|
|
42
|
+
buildEventEmissionGraph(): import("./utils/findCircularDependencies").IDependentNode[];
|
|
42
43
|
getTasksWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedTask<TTag>[];
|
|
43
44
|
getTasksWithTag(tag: string): AnyTask[];
|
|
44
45
|
getResourcesWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedResource<TTag>[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResource, DependencyMapType } from "../../defs";
|
|
1
|
+
import { IResource, DependencyMapType, ResourceDependencyValuesType } from "../../defs";
|
|
2
2
|
import { Store } from "../Store";
|
|
3
3
|
import { InterceptorRegistry } from "./InterceptorRegistry";
|
|
4
4
|
import { MiddlewareResolver } from "./MiddlewareResolver";
|
|
@@ -14,7 +14,7 @@ export declare class ResourceMiddlewareComposer {
|
|
|
14
14
|
/**
|
|
15
15
|
* Runs resource initialization with all middleware and interceptors applied
|
|
16
16
|
*/
|
|
17
|
-
runInit<TConfig, TValue extends Promise<any>, TDeps extends DependencyMapType, TContext>(resource: IResource<TConfig, TValue, TDeps, TContext>, config: TConfig, dependencies:
|
|
17
|
+
runInit<TConfig, TValue extends Promise<any>, TDeps extends DependencyMapType, TContext>(resource: IResource<TConfig, TValue, TDeps, TContext>, config: TConfig, dependencies: ResourceDependencyValuesType<TDeps>, context: TContext): Promise<TValue | undefined>;
|
|
18
18
|
/**
|
|
19
19
|
* Creates the base resource init runner with result validation
|
|
20
20
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoreRegistry } from "../StoreRegistry";
|
|
2
|
+
import type { IDependentNode } from "./findCircularDependencies";
|
|
3
|
+
/**
|
|
4
|
+
* Builds a dependency graph of all registered items (tasks, resources, middlewares, hooks).
|
|
5
|
+
* Returns a flat list of dependency nodes suitable for circular-dependency detection.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildDependencyGraph(registry: StoreRegistry): IDependentNode[];
|
|
8
|
+
/**
|
|
9
|
+
* Builds a directed graph of event emissions based on hooks listening to events
|
|
10
|
+
* and their dependencies on events (emission capability). Ignores wildcard hooks by default.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildEventEmissionGraph(registry: StoreRegistry): IDependentNode[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Store } from "../Store";
|
|
2
|
+
/**
|
|
3
|
+
* Maps a type-guard to its dependency-resolution logic.
|
|
4
|
+
*/
|
|
5
|
+
export interface DependencyStrategy {
|
|
6
|
+
/** Returns true if this strategy handles the given item. */
|
|
7
|
+
matches: (item: unknown) => boolean;
|
|
8
|
+
/** Returns the store map to check existence against (for optional deps). */
|
|
9
|
+
getStoreMap: (store: Store) => Map<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export declare const dependencyStrategies: readonly DependencyStrategy[];
|
|
12
|
+
/**
|
|
13
|
+
* Find the matching strategy for a dependency item, or undefined if none matches.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findDependencyStrategy(item: unknown): DependencyStrategy | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ResourceStoreElementType } from "../../types/storeTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Returns initialized resources sorted in dispose order (dependents first).
|
|
4
|
+
* Uses the recorded init-order when complete, otherwise falls back to a
|
|
5
|
+
* topological sort derived from the resource dependency graph.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getResourcesInDisposeOrder(resources: Map<string, ResourceStoreElementType>, initializedResourceIds: readonly string[]): ResourceStoreElementType[];
|
|
@@ -62,6 +62,7 @@ export declare class DurableResource implements IDurableResource {
|
|
|
62
62
|
describe<TInput>(task: ITask<TInput, any, any, any, any, any>, input?: TInput): Promise<DurableFlowShape>;
|
|
63
63
|
getWorkflows(): AnyTask[];
|
|
64
64
|
private injectRecorderIntoDurableDeps;
|
|
65
|
+
private resolveDescribeInput;
|
|
65
66
|
start<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<string>;
|
|
66
67
|
start(task: string, input?: unknown, options?: ExecuteOptions): Promise<string>;
|
|
67
68
|
cancelExecution(executionId: string, reason?: string): Promise<void>;
|
|
@@ -7,8 +7,8 @@ export type DurableResourceRuntimeConfig = RunnerDurableRuntimeConfig;
|
|
|
7
7
|
* - `const durable = durableResource.fork("app.durable");`
|
|
8
8
|
* - Register it via `durable.with({ store, queue, eventBus, ... })`
|
|
9
9
|
*/
|
|
10
|
-
export declare const durableResource: import("
|
|
11
|
-
taskRunner: import("
|
|
12
|
-
eventManager: import("
|
|
13
|
-
runnerStore: import("
|
|
14
|
-
}, any, import("
|
|
10
|
+
export declare const durableResource: import("../../../defs").IResource<RunnerDurableRuntimeConfig, Promise<import("./DurableResource").DurableResource>, {
|
|
11
|
+
taskRunner: import("../../../defs").IResource<void, Promise<import("../../../models").TaskRunner>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
12
|
+
eventManager: import("../../../defs").IResource<void, Promise<import("../../../models").EventManager>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
13
|
+
runnerStore: import("../../../defs").IResource<void, Promise<import("../../../models").Store>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
14
|
+
}, any, import("../../../defs").IResourceMeta, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
@@ -13,9 +13,9 @@ export type MemoryDurableResourceConfig = Omit<RunnerDurableRuntimeConfig, "stor
|
|
|
13
13
|
interface MemoryDurableResourceContext {
|
|
14
14
|
runtimeConfig: RunnerDurableRuntimeConfig | null;
|
|
15
15
|
}
|
|
16
|
-
export declare const memoryDurableResource: import("
|
|
17
|
-
taskRunner: import("
|
|
18
|
-
eventManager: import("
|
|
19
|
-
runnerStore: import("
|
|
20
|
-
}, MemoryDurableResourceContext, import("
|
|
16
|
+
export declare const memoryDurableResource: import("../../../defs").IResource<MemoryDurableResourceConfig, Promise<DurableResource>, {
|
|
17
|
+
taskRunner: import("../../../defs").IResource<void, Promise<import("../../../models").TaskRunner>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
18
|
+
eventManager: import("../../../defs").IResource<void, Promise<import("../../../models").EventManager>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
19
|
+
runnerStore: import("../../../defs").IResource<void, Promise<import("../../../models").Store>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
20
|
+
}, MemoryDurableResourceContext, import("../../../defs").IResourceMeta, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
21
21
|
export {};
|
|
@@ -27,9 +27,9 @@ export type RedisDurableResourceConfig = Omit<RunnerDurableRuntimeConfig, "store
|
|
|
27
27
|
interface RedisDurableResourceContext {
|
|
28
28
|
runtimeConfig: RunnerDurableRuntimeConfig | null;
|
|
29
29
|
}
|
|
30
|
-
export declare const redisDurableResource: import("
|
|
31
|
-
taskRunner: import("
|
|
32
|
-
eventManager: import("
|
|
33
|
-
runnerStore: import("
|
|
34
|
-
}, RedisDurableResourceContext, import("
|
|
30
|
+
export declare const redisDurableResource: import("../../../defs").IResource<RedisDurableResourceConfig, Promise<DurableResource>, {
|
|
31
|
+
taskRunner: import("../../../defs").IResource<void, Promise<import("../../../models").TaskRunner>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
32
|
+
eventManager: import("../../../defs").IResource<void, Promise<import("../../../models").EventManager>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
33
|
+
runnerStore: import("../../../defs").IResource<void, Promise<import("../../../models").Store>, {}, any, any, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
34
|
+
}, RedisDurableResourceContext, import("../../../defs").IResourceMeta, import("../../../defs").TagType[], import("../../../defs").ResourceMiddlewareAttachmentType[]>;
|
|
35
35
|
export {};
|
|
@@ -3,6 +3,11 @@ export interface DurableWorkflowTagConfig {
|
|
|
3
3
|
* Optional domain/category to group workflows (eg. "orders", "billing").
|
|
4
4
|
*/
|
|
5
5
|
category?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional default input used by `durable.describe(task)` when no explicit
|
|
8
|
+
* input argument is provided.
|
|
9
|
+
*/
|
|
10
|
+
defaults?: Record<string, unknown>;
|
|
6
11
|
/**
|
|
7
12
|
* Optional metadata for dashboards/tooling.
|
|
8
13
|
*/
|
|
@@ -11,4 +16,4 @@ export interface DurableWorkflowTagConfig {
|
|
|
11
16
|
/**
|
|
12
17
|
* Marks a task as a durable workflow for runtime discovery.
|
|
13
18
|
*/
|
|
14
|
-
export declare const durableWorkflowTag: import("
|
|
19
|
+
export declare const durableWorkflowTag: import("../../..").ITag<DurableWorkflowTagConfig, void, void>;
|
|
@@ -8,7 +8,7 @@ export interface ExposureRequestContextValue {
|
|
|
8
8
|
method?: string;
|
|
9
9
|
signal: AbortSignal;
|
|
10
10
|
}
|
|
11
|
-
export declare const ExposureRequestContext: import("
|
|
11
|
+
export declare const ExposureRequestContext: import("../..").IAsyncContext<ExposureRequestContextValue>;
|
|
12
12
|
export declare function useExposureContext(): ExposureRequestContextValue;
|
|
13
13
|
/**
|
|
14
14
|
* Checks if the exposure request context is currently available without throwing an error.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NodeExposureConfig } from "./resourceTypes";
|
|
2
2
|
export type { NodeExposureHttpAuthConfig } from "./authenticator";
|
|
3
|
-
export declare const nodeExposure: import("
|
|
4
|
-
store: import("
|
|
5
|
-
taskRunner: import("
|
|
6
|
-
eventManager: import("
|
|
7
|
-
logger: import("
|
|
8
|
-
serializer: import("
|
|
3
|
+
export declare const nodeExposure: import("../..").IResource<NodeExposureConfig, Promise<import("./resourceTypes").NodeExposureHandlers>, {
|
|
4
|
+
store: import("../..").IResource<void, Promise<import("../..").Store>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
5
|
+
taskRunner: import("../..").IResource<void, Promise<import("../..").TaskRunner>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
6
|
+
eventManager: import("../..").IResource<void, Promise<import("../..").EventManager>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
7
|
+
logger: import("../..").IResource<void, Promise<import("../..").Logger>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
8
|
+
serializer: import("../..").IResource<void, Promise<import("../..").SerializerLike>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
9
9
|
}, any, {
|
|
10
10
|
title: string;
|
|
11
11
|
description: string;
|
|
12
|
-
}, import("
|
|
12
|
+
}, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
@@ -13,5 +13,5 @@ export interface HttpMixedClientFactoryConfig {
|
|
|
13
13
|
}) => void | Promise<void>;
|
|
14
14
|
}
|
|
15
15
|
export type HttpMixedClientFactory = (config: HttpMixedClientFactoryConfig) => MixedHttpClient;
|
|
16
|
-
export declare const httpMixedClientFactory: import("
|
|
16
|
+
export declare const httpMixedClientFactory: import("../..").IResource<void, Promise<HttpMixedClientFactory>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
17
17
|
export type { MixedHttpClient };
|
|
@@ -12,5 +12,5 @@ export interface HttpSmartClientFactoryConfig {
|
|
|
12
12
|
}) => void | Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
export type HttpSmartClientFactory = (config: HttpSmartClientFactoryConfig) => HttpSmartClient;
|
|
15
|
-
export declare const httpSmartClientFactory: import("
|
|
15
|
+
export declare const httpSmartClientFactory: import("../..").IResource<void, Promise<HttpSmartClientFactory>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
16
16
|
export type { HttpSmartClient };
|