@bluelibs/runner 5.2.1 → 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/README.md +54 -1
- package/dist/browser/index.cjs +977 -800
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.mjs +975 -801
- package/dist/browser/index.mjs.map +1 -1
- package/dist/edge/index.cjs +977 -800
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.mjs +975 -801
- package/dist/edge/index.mjs.map +1 -1
- package/dist/node/node.cjs +1994 -2056
- package/dist/node/node.cjs.map +1 -1
- package/dist/node/node.mjs +1990 -2010
- package/dist/node/node.mjs.map +1 -1
- package/dist/types/definers/builders/error/fluent-builder.interface.d.ts +6 -0
- package/dist/types/definers/builders/error/index.d.ts +10 -1
- package/dist/types/definers/builders/error/types.d.ts +2 -0
- 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/definers/defineError.d.ts +5 -3
- package/dist/types/defs.d.ts +1 -0
- package/dist/types/errors.d.ts +20 -21
- package/dist/types/globals/resources/tunnel/protocol.d.ts +3 -0
- 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 +15 -13
- package/dist/types/models/StoreRegistry.d.ts +19 -16
- 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 +24 -9
- package/dist/types/node/durable/core/DurableService.d.ts +15 -9
- package/dist/types/node/durable/core/interfaces/service.d.ts +27 -19
- package/dist/types/node/durable/core/interfaces/store.d.ts +1 -1
- package/dist/types/node/durable/core/managers/ExecutionManager.d.ts +34 -4
- package/dist/types/node/durable/core/managers/ScheduleManager.d.ts +5 -3
- package/dist/types/node/durable/core/managers/TaskRegistry.d.ts +5 -5
- package/dist/types/node/durable/core/managers/WaitManager.d.ts +1 -1
- package/dist/types/node/durable/core/resource.d.ts +5 -5
- package/dist/types/node/durable/index.d.ts +1 -0
- 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 +19 -0
- 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 +6 -1
- package/dist/types/testing.d.ts +0 -1
- package/dist/types/tools/LockableMap.d.ts +20 -0
- package/dist/types/types/error.d.ts +22 -1
- package/dist/types/types/resource.d.ts +2 -4
- package/dist/types/types/symbols.d.ts +3 -3
- package/dist/types/types/tagged.d.ts +18 -0
- 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 +977 -800
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.mjs +975 -801
- package/dist/universal/index.mjs.map +1 -1
- package/package.json +1 -2
- package/readmes/AI.md +59 -12
- 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
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { DefaultErrorType, IErrorMeta, IValidationSchema, IErrorHelper } from "../../../defs";
|
|
2
2
|
export interface ErrorFluentBuilder<TData extends DefaultErrorType = DefaultErrorType> {
|
|
3
3
|
id: string;
|
|
4
|
+
httpCode(code: number): ErrorFluentBuilder<TData>;
|
|
4
5
|
serialize(fn: (data: TData) => string): ErrorFluentBuilder<TData>;
|
|
5
6
|
parse(fn: (raw: string) => TData): ErrorFluentBuilder<TData>;
|
|
6
7
|
dataSchema(schema: IValidationSchema<TData>): ErrorFluentBuilder<TData>;
|
|
7
8
|
build(): IErrorHelper<TData>;
|
|
8
9
|
format(fn: (data: TData) => string): ErrorFluentBuilder<TData>;
|
|
10
|
+
/**
|
|
11
|
+
* Attach remediation advice that explains how to fix this error.
|
|
12
|
+
* Appears in the stringified error after the main message.
|
|
13
|
+
*/
|
|
14
|
+
remediation(advice: string | ((data: TData) => string)): ErrorFluentBuilder<TData>;
|
|
9
15
|
meta<TNewMeta extends IErrorMeta>(m: TNewMeta): ErrorFluentBuilder<TData>;
|
|
10
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DefaultErrorType } from "../../../defs";
|
|
2
2
|
import type { ErrorFluentBuilder } from "./fluent-builder.interface";
|
|
3
|
+
import { RunnerError } from "../../defineError";
|
|
3
4
|
export * from "./fluent-builder.interface";
|
|
4
5
|
export * from "./fluent-builder";
|
|
5
6
|
export * from "./types";
|
|
@@ -8,4 +9,12 @@ export * from "./utils";
|
|
|
8
9
|
* Entry point for creating an error builder.
|
|
9
10
|
*/
|
|
10
11
|
export declare function errorBuilder<TData extends DefaultErrorType = DefaultErrorType>(id: string): ErrorFluentBuilder<TData>;
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Check if an error is any Runner error (not just a specific one).
|
|
14
|
+
* @param error - The error to check
|
|
15
|
+
* @returns true if the error is a RunnerError instance
|
|
16
|
+
*/
|
|
17
|
+
declare function isRunnerError(error: unknown): error is RunnerError;
|
|
18
|
+
export declare const error: typeof errorBuilder & {
|
|
19
|
+
is: typeof isRunnerError;
|
|
20
|
+
};
|
|
@@ -6,7 +6,9 @@ import type { DefaultErrorType, IErrorMeta, IValidationSchema } from "../../../d
|
|
|
6
6
|
export type BuilderState<TData extends DefaultErrorType> = Readonly<{
|
|
7
7
|
id: string;
|
|
8
8
|
filePath: string;
|
|
9
|
+
httpCode?: number;
|
|
9
10
|
format?: (data: TData) => string;
|
|
11
|
+
remediation?: string | ((data: TData) => string);
|
|
10
12
|
serialize?: (data: TData) => string;
|
|
11
13
|
parse?: (raw: string) => TData;
|
|
12
14
|
dataSchema?: IValidationSchema<TData>;
|
|
@@ -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);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { DefaultErrorType, IErrorDefinition, IErrorHelper, IErrorDefinitionFinal } from "../types/error";
|
|
2
2
|
import { symbolError, symbolFilePath, symbolOptionalDependency } from "../types/symbols";
|
|
3
|
-
declare class RunnerError<TData extends DefaultErrorType = DefaultErrorType> extends Error {
|
|
3
|
+
export declare class RunnerError<TData extends DefaultErrorType = DefaultErrorType> extends Error {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly data: TData;
|
|
6
|
-
|
|
6
|
+
readonly httpCode?: number;
|
|
7
|
+
readonly remediation?: string;
|
|
8
|
+
constructor(id: string, message: string, data: TData, httpCode?: number, remediation?: string);
|
|
7
9
|
}
|
|
8
10
|
export declare class ErrorHelper<TData extends DefaultErrorType = DefaultErrorType> implements IErrorHelper<TData> {
|
|
9
11
|
private readonly definition;
|
|
@@ -11,6 +13,7 @@ export declare class ErrorHelper<TData extends DefaultErrorType = DefaultErrorTy
|
|
|
11
13
|
[symbolFilePath]: string;
|
|
12
14
|
constructor(definition: IErrorDefinitionFinal<TData>, filePath: string);
|
|
13
15
|
get id(): string;
|
|
16
|
+
get httpCode(): number | undefined;
|
|
14
17
|
throw(data: TData): never;
|
|
15
18
|
is(error: unknown): error is RunnerError<TData>;
|
|
16
19
|
optional(): {
|
|
@@ -24,4 +27,3 @@ export declare class ErrorHelper<TData extends DefaultErrorType = DefaultErrorTy
|
|
|
24
27
|
* @returns
|
|
25
28
|
*/
|
|
26
29
|
export declare function defineError<TData extends DefaultErrorType = DefaultErrorType>(definition: IErrorDefinition<TData>, filePath?: string): ErrorHelper<TData>;
|
|
27
|
-
export {};
|
package/dist/types/defs.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./types/runner";
|
|
|
28
28
|
export * from "./types/asyncContext";
|
|
29
29
|
export * from "./types/error";
|
|
30
30
|
export * from "./types/contracts";
|
|
31
|
+
export * from "./types/tagged";
|
|
31
32
|
export * from "./types/inputFile";
|
|
32
33
|
export type { ICacheInstance } from "./globals/middleware/cache.middleware";
|
|
33
34
|
export * from "./types/storeTypes";
|
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";
|
|
@@ -3,6 +3,7 @@ export interface ProtocolErrorShape {
|
|
|
3
3
|
code: string;
|
|
4
4
|
message: string;
|
|
5
5
|
details?: unknown;
|
|
6
|
+
httpCode?: number;
|
|
6
7
|
id?: string;
|
|
7
8
|
data?: unknown;
|
|
8
9
|
}
|
|
@@ -33,11 +34,13 @@ export interface EventRequest {
|
|
|
33
34
|
export declare class TunnelError extends Error {
|
|
34
35
|
readonly code: string;
|
|
35
36
|
readonly details?: unknown;
|
|
37
|
+
readonly httpCode?: number;
|
|
36
38
|
readonly id?: string;
|
|
37
39
|
readonly data?: unknown;
|
|
38
40
|
constructor(code: string, message: string, details?: unknown, extras?: {
|
|
39
41
|
id?: string;
|
|
40
42
|
data?: unknown;
|
|
43
|
+
httpCode?: number;
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
export declare function toTunnelError(input: unknown, fallbackMessage?: string): TunnelError;
|
|
@@ -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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResource, RegisterableItems, ITag, ITaskMiddleware, IResourceMiddleware } from "../defs";
|
|
1
|
+
import { IResource, RegisterableItems, ITag, AnyTask, ITaskMiddleware, IResourceMiddleware, TaggedTask, TaggedResource, AnyResource } from "../defs";
|
|
2
2
|
import { EventManager } from "./EventManager";
|
|
3
3
|
import { Logger } from "./Logger";
|
|
4
4
|
import { ResourceStoreElementType, TaskStoreElementType, EventStoreElementType } from "../types/storeTypes";
|
|
@@ -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;
|
|
@@ -66,11 +66,13 @@ export declare class Store {
|
|
|
66
66
|
* @param tag - The tag to filter by.
|
|
67
67
|
* @returns The tasks with the given tag.
|
|
68
68
|
*/
|
|
69
|
-
getTasksWithTag
|
|
69
|
+
getTasksWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedTask<TTag>[];
|
|
70
|
+
getTasksWithTag(tag: string): AnyTask[];
|
|
70
71
|
/**
|
|
71
72
|
* Returns all resources with the given tag.
|
|
72
73
|
* @param tag - The tag to filter by.
|
|
73
74
|
* @returns The resources with the given tag.
|
|
74
75
|
*/
|
|
75
|
-
getResourcesWithTag
|
|
76
|
+
getResourcesWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedResource<TTag>[];
|
|
77
|
+
getResourcesWithTag(tag: string): AnyResource[];
|
|
76
78
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { IResource, ITask, IResourceWithConfig, RegisterableItems, ITaskMiddleware, IResourceMiddleware, IEvent, ITag, IHook } from "../defs";
|
|
1
|
+
import { IResource, ITask, AnyTask, IResourceWithConfig, RegisterableItems, ITaskMiddleware, IResourceMiddleware, IEvent, ITag, IHook, TaggedTask, TaggedResource, AnyResource } from "../defs";
|
|
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,15 +34,16 @@ 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
|
-
|
|
42
|
-
getTasksWithTag(tag: string
|
|
43
|
-
getResourcesWithTag
|
|
42
|
+
buildEventEmissionGraph(): import("./utils/findCircularDependencies").IDependentNode[];
|
|
43
|
+
getTasksWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedTask<TTag>[];
|
|
44
|
+
getTasksWithTag(tag: string): AnyTask[];
|
|
45
|
+
getResourcesWithTag<TTag extends ITag<any, any, any>>(tag: TTag): TaggedResource<TTag>[];
|
|
46
|
+
getResourcesWithTag(tag: string): AnyResource[];
|
|
44
47
|
/**
|
|
45
48
|
* Used to fetch the value cloned, and if we're dealing with an override, we need to extend the previous value.
|
|
46
49
|
*/
|
|
@@ -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[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import type { Store } from "../../../models/Store";
|
|
3
3
|
import type { IEventDefinition } from "../../../types/event";
|
|
4
|
-
import type { ITask } from "../../../types/task";
|
|
4
|
+
import type { AnyTask, ITask } from "../../../types/task";
|
|
5
5
|
import type { IDurableContext } from "./interfaces/context";
|
|
6
|
-
import type {
|
|
6
|
+
import type { DurableStartAndWaitResult, ExecuteOptions, IDurableService, ScheduleOptions } from "./interfaces/service";
|
|
7
7
|
import type { Schedule } from "./types";
|
|
8
8
|
import type { IDurableStore } from "./interfaces/store";
|
|
9
9
|
import { DurableOperator } from "./DurableOperator";
|
|
@@ -11,7 +11,11 @@ import { type DurableFlowShape } from "./flowShape";
|
|
|
11
11
|
export interface DurableResourceConfig {
|
|
12
12
|
worker?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export interface IDurableResource extends Pick<IDurableService, "
|
|
14
|
+
export interface IDurableResource extends Pick<IDurableService, "cancelExecution" | "wait" | "schedule" | "ensureSchedule" | "pauseSchedule" | "resumeSchedule" | "getSchedule" | "listSchedules" | "updateSchedule" | "removeSchedule" | "recover" | "signal"> {
|
|
15
|
+
start<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<string>;
|
|
16
|
+
start(task: string, input?: unknown, options?: ExecuteOptions): Promise<string>;
|
|
17
|
+
startAndWait<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
18
|
+
startAndWait<TResult = unknown>(task: string, input?: unknown, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
15
19
|
/**
|
|
16
20
|
* Reads the durable context for the currently running workflow execution.
|
|
17
21
|
* Throws if called outside of a durable execution.
|
|
@@ -34,10 +38,14 @@ export interface IDurableResource extends Pick<IDurableService, "startExecution"
|
|
|
34
38
|
* (steps/audit/history and operator actions where supported by the store).
|
|
35
39
|
*/
|
|
36
40
|
readonly operator: DurableOperator;
|
|
41
|
+
/**
|
|
42
|
+
* Returns all tasks tagged as durable workflows in the current runtime.
|
|
43
|
+
*/
|
|
44
|
+
getWorkflows(): AnyTask[];
|
|
37
45
|
}
|
|
38
46
|
/**
|
|
39
47
|
* A Runner-facing wrapper around `DurableService` that exposes a per-instance
|
|
40
|
-
* context store and the public durable API (`
|
|
48
|
+
* context store and the public durable API (`start`, `startAndWait`, `signal`, `wait`, etc.).
|
|
41
49
|
*
|
|
42
50
|
* This enables tasks to depend on a specific durable instance and call
|
|
43
51
|
* `durable.use()` to access the per-execution durable context.
|
|
@@ -52,17 +60,24 @@ export declare class DurableResource implements IDurableResource {
|
|
|
52
60
|
get operator(): DurableOperator;
|
|
53
61
|
use(): IDurableContext;
|
|
54
62
|
describe<TInput>(task: ITask<TInput, any, any, any, any, any>, input?: TInput): Promise<DurableFlowShape>;
|
|
63
|
+
getWorkflows(): AnyTask[];
|
|
55
64
|
private injectRecorderIntoDurableDeps;
|
|
56
|
-
|
|
65
|
+
private resolveDescribeInput;
|
|
66
|
+
start<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<string>;
|
|
67
|
+
start(task: string, input?: unknown, options?: ExecuteOptions): Promise<string>;
|
|
57
68
|
cancelExecution(executionId: string, reason?: string): Promise<void>;
|
|
58
69
|
wait<TResult>(executionId: string, options?: {
|
|
59
70
|
timeout?: number;
|
|
60
71
|
waitPollIntervalMs?: number;
|
|
61
72
|
}): Promise<TResult>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
schedule<TInput>(task:
|
|
65
|
-
|
|
73
|
+
startAndWait<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
74
|
+
startAndWait<TResult = unknown>(task: string, input?: unknown, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
75
|
+
schedule<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input: TInput | undefined, options: ScheduleOptions): Promise<string>;
|
|
76
|
+
schedule(task: string, input: unknown, options: ScheduleOptions): Promise<string>;
|
|
77
|
+
ensureSchedule<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input: TInput | undefined, options: ScheduleOptions & {
|
|
78
|
+
id: string;
|
|
79
|
+
}): Promise<string>;
|
|
80
|
+
ensureSchedule(task: string, input: unknown, options: ScheduleOptions & {
|
|
66
81
|
id: string;
|
|
67
82
|
}): Promise<string>;
|
|
68
83
|
pauseSchedule(scheduleId: string): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NoopEventBus } from "../bus/NoopEventBus";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DurableStartAndWaitResult, DurableServiceConfig, ExecuteOptions, IDurableService, ScheduleOptions } from "./interfaces/service";
|
|
3
3
|
import { type Schedule } from "./types";
|
|
4
4
|
import type { IEventDefinition } from "../../../types/event";
|
|
5
|
+
import type { ITask } from "../../../types/task";
|
|
5
6
|
import { ExecutionManager, PollingManager } from "./managers";
|
|
6
7
|
export { DurableExecutionError } from "./utils";
|
|
7
8
|
/**
|
|
@@ -32,22 +33,27 @@ export declare class DurableService implements IDurableService {
|
|
|
32
33
|
/** Unique worker ID for distributed timer coordination */
|
|
33
34
|
private readonly workerId;
|
|
34
35
|
constructor(config: DurableServiceConfig);
|
|
35
|
-
registerTask<TInput, TResult>(task:
|
|
36
|
-
findTask(taskId: string):
|
|
37
|
-
|
|
36
|
+
registerTask<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>): void;
|
|
37
|
+
findTask(taskId: string): ITask<any, Promise<any>, any, any, any, any> | undefined;
|
|
38
|
+
start<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<string>;
|
|
39
|
+
start(task: string, input?: unknown, options?: ExecuteOptions): Promise<string>;
|
|
40
|
+
start(): void;
|
|
38
41
|
cancelExecution(executionId: string, reason?: string): Promise<void>;
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
startAndWait<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input?: TInput, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
43
|
+
startAndWait<TResult = unknown>(task: string, input?: unknown, options?: ExecuteOptions): Promise<DurableStartAndWaitResult<TResult>>;
|
|
41
44
|
wait<TResult>(executionId: string, options?: {
|
|
42
45
|
timeout?: number;
|
|
43
46
|
waitPollIntervalMs?: number;
|
|
44
47
|
}): Promise<TResult>;
|
|
45
|
-
schedule<TInput>(task:
|
|
46
|
-
|
|
48
|
+
schedule<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input: TInput | undefined, options: ScheduleOptions): Promise<string>;
|
|
49
|
+
schedule(task: string, input: unknown, options: ScheduleOptions): Promise<string>;
|
|
50
|
+
ensureSchedule<TInput, TResult>(task: ITask<TInput, Promise<TResult>, any, any, any, any>, input: TInput | undefined, options: ScheduleOptions & {
|
|
51
|
+
id: string;
|
|
52
|
+
}): Promise<string>;
|
|
53
|
+
ensureSchedule(task: string, input: unknown, options: ScheduleOptions & {
|
|
47
54
|
id: string;
|
|
48
55
|
}): Promise<string>;
|
|
49
56
|
recover(): Promise<void>;
|
|
50
|
-
start(): void;
|
|
51
57
|
stop(): Promise<void>;
|
|
52
58
|
pauseSchedule(id: string): Promise<void>;
|
|
53
59
|
resumeSchedule(id: string): Promise<void>;
|