@superdurable/dex 0.1.4 → 0.1.6
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 +115 -5
- package/dist/src/client.d.ts +35 -18
- package/dist/src/client.js +121 -43
- package/dist/src/client.js.map +1 -1
- package/dist/src/codec.d.ts +1 -1
- package/dist/src/context.d.ts +20 -1
- package/dist/src/errors.d.ts +2 -33
- package/dist/src/errors.js +2 -45
- package/dist/src/errors.js.map +1 -1
- package/dist/src/flow-result.d.ts +47 -0
- package/dist/src/flow-result.js +82 -0
- package/dist/src/flow-result.js.map +1 -0
- package/dist/src/flow.d.ts +13 -1
- package/dist/src/flow.js +1 -0
- package/dist/src/flow.js.map +1 -1
- package/dist/src/gen/dex.d.ts +209 -33
- package/dist/src/gen/dex.js +1619 -213
- package/dist/src/gen/dex.js.map +1 -1
- package/dist/src/grpc-status.js +6 -5
- package/dist/src/grpc-status.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/invocation-context.d.ts +7 -1
- package/dist/src/invocation-context.js +53 -1
- package/dist/src/invocation-context.js.map +1 -1
- package/dist/src/options.d.ts +42 -19
- package/dist/src/options.js +20 -4
- package/dist/src/options.js.map +1 -1
- package/dist/src/persistence.d.ts +12 -0
- package/dist/src/persistence.js +16 -0
- package/dist/src/persistence.js.map +1 -1
- package/dist/src/rpc.d.ts +3 -1
- package/dist/src/rpc.js.map +1 -1
- package/dist/src/step.d.ts +33 -3
- package/dist/src/step.js +38 -1
- package/dist/src/step.js.map +1 -1
- package/dist/src/subflow.d.ts +62 -0
- package/dist/src/subflow.js +62 -0
- package/dist/src/subflow.js.map +1 -0
- package/dist/src/wait.d.ts +23 -2
- package/dist/src/wait.js +17 -0
- package/dist/src/wait.js.map +1 -1
- package/dist/src/worker-dispatcher.d.ts +4 -3
- package/dist/src/worker-dispatcher.js +271 -37
- package/dist/src/worker-dispatcher.js.map +1 -1
- package/dist/src/worker.js +21 -5
- package/dist/src/worker.js.map +1 -1
- package/native/linux-aarch64/dex_blob_cache_node.node +0 -0
- package/native/linux-x86_64/dex_blob_cache_node.node +0 -0
- package/native/macos-aarch64/dex_blob_cache_node.node +0 -0
- package/native/macos-x86_64/dex_blob_cache_node.node +0 -0
- package/native/windows-x86_64/dex_blob_cache_node.node +0 -0
- package/package.json +1 -1
package/dist/src/context.d.ts
CHANGED
|
@@ -20,6 +20,13 @@ export interface Context {
|
|
|
20
20
|
readonly firstAttemptAt: Date;
|
|
21
21
|
/** One-based handler retry attempt number. */
|
|
22
22
|
readonly attempt: number;
|
|
23
|
+
/**
|
|
24
|
+
* Signal aborted when Dex cancels the active Worker call.
|
|
25
|
+
*
|
|
26
|
+
* Pass it to abort-aware APIs or inspect it at natural CPU-work boundaries. JavaScript
|
|
27
|
+
* cannot forcibly stop synchronous code, and cancellation cannot make external effects atomic.
|
|
28
|
+
*/
|
|
29
|
+
readonly cancellationSignal: AbortSignal;
|
|
23
30
|
/**
|
|
24
31
|
* Reports whether a Timer made the current Wait ready.
|
|
25
32
|
* @param index - Optional zero-based Timer index; checks any Timer when omitted.
|
|
@@ -75,8 +82,14 @@ export interface Context {
|
|
|
75
82
|
* Stages deletion of an Attribute value.
|
|
76
83
|
* @param attribute - Registered singleton or map definition.
|
|
77
84
|
* @param instance - Required AttributeMap instance; omitted for a singleton.
|
|
78
|
-
|
|
85
|
+
*/
|
|
79
86
|
deleteAttribute(attribute: Attribute<unknown> | AttributeMap<unknown>, instance?: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Returns effective decoded AttributeMap keys in ascending order.
|
|
89
|
+
* @param attribute - Registered AttributeMap definition.
|
|
90
|
+
* @returns Keys visible after decision-local writes and deletions.
|
|
91
|
+
*/
|
|
92
|
+
attributeMapKeys(attribute: AttributeMap<unknown>): readonly string[];
|
|
80
93
|
/**
|
|
81
94
|
* Stages one typed Channel publication.
|
|
82
95
|
* @typeParam T - Channel element type.
|
|
@@ -100,4 +113,10 @@ export interface Context {
|
|
|
100
113
|
* @returns Ordered values for this Step execution.
|
|
101
114
|
*/
|
|
102
115
|
channelResults<T>(channel: Channel<T> | ChannelMap<T>, instance?: string): readonly T[];
|
|
116
|
+
/**
|
|
117
|
+
* Returns decoded non-empty ChannelMap keys in ascending order during an RPC.
|
|
118
|
+
* @param channel - Registered ChannelMap definition.
|
|
119
|
+
* @returns Keys including publications buffered by the current RPC.
|
|
120
|
+
*/
|
|
121
|
+
channelMapKeys(channel: ChannelMap<unknown>): readonly string[];
|
|
103
122
|
}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { status } from "@grpc/grpc-js";
|
|
2
|
-
import type { Codec } from "./codec.js";
|
|
3
|
-
import type { Value } from "./gen/dex.js";
|
|
4
|
-
import type { FlowStatus } from "./options.js";
|
|
5
2
|
/** Indicates that an API is intentionally unavailable in the current SDK phase. */
|
|
6
3
|
export declare class PhaseNotImplementedError extends Error {
|
|
7
4
|
}
|
|
@@ -32,6 +29,8 @@ export declare const FlowErrorType: Readonly<{
|
|
|
32
29
|
readonly INVALID_USER_FLOW_CODE: "invalidUserFlowCode";
|
|
33
30
|
/** Dex encountered an internal invariant or infrastructure failure. */
|
|
34
31
|
readonly INTERNAL: "internal";
|
|
32
|
+
/** A Dex soft Flow timeout expired under the fail policy. */
|
|
33
|
+
readonly FLOW_TIMEOUT: "flowTimeout";
|
|
35
34
|
}>;
|
|
36
35
|
/** Represents a value from {@link FlowErrorType}. */
|
|
37
36
|
export type FlowErrorType = (typeof FlowErrorType)[keyof typeof FlowErrorType];
|
|
@@ -122,36 +121,6 @@ export declare class ValueMappingError extends Error {
|
|
|
122
121
|
*/
|
|
123
122
|
constructor(operation: "encode" | "decode" | "hydrate", detail: string, options?: ErrorOptions);
|
|
124
123
|
}
|
|
125
|
-
/** Reports that `waitForFlow` observed a non-successful terminal status. */
|
|
126
|
-
export declare class FlowUncompletedError extends Error {
|
|
127
|
-
readonly runId: string;
|
|
128
|
-
readonly status: FlowStatus;
|
|
129
|
-
readonly errorType: FlowErrorType | undefined;
|
|
130
|
-
private readonly results;
|
|
131
|
-
/**
|
|
132
|
-
* Creates an error that keeps completed Step outputs for typed decoding.
|
|
133
|
-
* @param runId - Terminal server-assigned run ID.
|
|
134
|
-
* @param status - Non-completed terminal status.
|
|
135
|
-
* @param errorType - Terminal failure category, when available.
|
|
136
|
-
* @param message - Human-readable terminal detail.
|
|
137
|
-
* @param results - Hydrated Step outputs in server order.
|
|
138
|
-
*/
|
|
139
|
-
constructor(runId: string, status: FlowStatus, errorType: FlowErrorType | undefined, message: string | undefined, results: readonly Value[]);
|
|
140
|
-
/**
|
|
141
|
-
* Returns the number of retained Step completion outputs.
|
|
142
|
-
* @returns A non-negative result count.
|
|
143
|
-
*/
|
|
144
|
-
get resultCount(): number;
|
|
145
|
-
/**
|
|
146
|
-
* Decodes one completed Step output.
|
|
147
|
-
* @typeParam T - Expected output type.
|
|
148
|
-
* @param index - Zero-based output position.
|
|
149
|
-
* @param codec - Codec for the expected output type.
|
|
150
|
-
* @returns The decoded Step output.
|
|
151
|
-
* @throws {@link RangeError} when the index is outside the retained outputs.
|
|
152
|
-
*/
|
|
153
|
-
getResult<T>(index: number, codec: Codec<T>): T;
|
|
154
|
-
}
|
|
155
124
|
/**
|
|
156
125
|
* Creates a consistent error for an API planned in a later implementation phase.
|
|
157
126
|
* @param component - Human-readable unavailable component name.
|
package/dist/src/errors.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
// See the LICENSE file in the repository root.
|
|
6
6
|
//
|
|
7
7
|
// SPDX-License-Identifier: LicenseRef-Super-Durable-1.0
|
|
8
|
-
import { decodeValue } from "./value-mapper.js";
|
|
9
8
|
/** Indicates that an API is intentionally unavailable in the current SDK phase. */
|
|
10
9
|
export class PhaseNotImplementedError extends Error {
|
|
11
10
|
}
|
|
@@ -34,6 +33,8 @@ export const FlowErrorType = Object.freeze({
|
|
|
34
33
|
INVALID_USER_FLOW_CODE: "invalidUserFlowCode",
|
|
35
34
|
/** Dex encountered an internal invariant or infrastructure failure. */
|
|
36
35
|
INTERNAL: "internal",
|
|
36
|
+
/** A Dex soft Flow timeout expired under the fail policy. */
|
|
37
|
+
FLOW_TIMEOUT: "flowTimeout",
|
|
37
38
|
});
|
|
38
39
|
/** Exposes structured metadata returned by a failed FlowService operation. */
|
|
39
40
|
export class DexServiceError extends Error {
|
|
@@ -148,50 +149,6 @@ export class ValueMappingError extends Error {
|
|
|
148
149
|
this.name = new.target.name;
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
|
-
/** Reports that `waitForFlow` observed a non-successful terminal status. */
|
|
152
|
-
export class FlowUncompletedError extends Error {
|
|
153
|
-
runId;
|
|
154
|
-
status;
|
|
155
|
-
errorType;
|
|
156
|
-
results;
|
|
157
|
-
/**
|
|
158
|
-
* Creates an error that keeps completed Step outputs for typed decoding.
|
|
159
|
-
* @param runId - Terminal server-assigned run ID.
|
|
160
|
-
* @param status - Non-completed terminal status.
|
|
161
|
-
* @param errorType - Terminal failure category, when available.
|
|
162
|
-
* @param message - Human-readable terminal detail.
|
|
163
|
-
* @param results - Hydrated Step outputs in server order.
|
|
164
|
-
*/
|
|
165
|
-
constructor(runId, status, errorType, message, results) {
|
|
166
|
-
super(message);
|
|
167
|
-
this.runId = runId;
|
|
168
|
-
this.status = status;
|
|
169
|
-
this.errorType = errorType;
|
|
170
|
-
this.results = results;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Returns the number of retained Step completion outputs.
|
|
174
|
-
* @returns A non-negative result count.
|
|
175
|
-
*/
|
|
176
|
-
get resultCount() {
|
|
177
|
-
return this.results.length;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Decodes one completed Step output.
|
|
181
|
-
* @typeParam T - Expected output type.
|
|
182
|
-
* @param index - Zero-based output position.
|
|
183
|
-
* @param codec - Codec for the expected output type.
|
|
184
|
-
* @returns The decoded Step output.
|
|
185
|
-
* @throws {@link RangeError} when the index is outside the retained outputs.
|
|
186
|
-
*/
|
|
187
|
-
getResult(index, codec) {
|
|
188
|
-
const value = this.results[index];
|
|
189
|
-
if (value === undefined) {
|
|
190
|
-
throw new RangeError(`result index ${index} is out of range`);
|
|
191
|
-
}
|
|
192
|
-
return decodeValue(codec, value);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
152
|
/**
|
|
196
153
|
* Creates a consistent error for an API planned in a later implementation phase.
|
|
197
154
|
* @param component - Human-readable unavailable component name.
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,uDAAuD;AACvD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,wDAAwD;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,uDAAuD;AACvD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,wDAAwD;AAKxD,mFAAmF;AACnF,MAAM,OAAO,wBAAyB,SAAQ,KAAK;CAAG;AAEtD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,oDAAoD;IACpD,aAAa,EAAE,eAAe;IAC9B,2DAA2D;IAC3D,oBAAoB,EAAE,oBAAoB;IAC1C,2CAA2C;IAC3C,eAAe,EAAE,eAAe;IAChC,qDAAqD;IACrD,gBAAgB,EAAE,gBAAgB;IAClC,mEAAmE;IACnE,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC,CAAC;AAKZ,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,4CAA4C;IAC5C,oBAAoB,EAAE,oBAAoB;IAC1C,q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AM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,OAAO,IAAI,wBAAwB,CAAC,GAAG,SAAS,2BAA2B,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Codec } from "./codec.js";
|
|
2
|
+
import { type FlowResult as ProtoFlowResult, type StepCompletionOutput, type Value } from "./gen/dex.js";
|
|
3
|
+
import { type FlowErrorType as FlowErrorTypeValue } from "./errors.js";
|
|
4
|
+
import type { FlowStatus } from "./options.js";
|
|
5
|
+
/** Contains one output-bearing Step completion returned by {@link Client.waitForFlow}. */
|
|
6
|
+
export interface StepCompletion {
|
|
7
|
+
/** Registered Step type that produced this output. */
|
|
8
|
+
readonly stepType: string;
|
|
9
|
+
/** Exact server Step execution identity that produced this output. */
|
|
10
|
+
readonly stepExecutionId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Decodes this already hydrated Step output.
|
|
13
|
+
* @typeParam Output - Expected application output type.
|
|
14
|
+
* @param codec - Codec for the expected output type.
|
|
15
|
+
* @returns The decoded Step output.
|
|
16
|
+
*/
|
|
17
|
+
decode<Output>(codec: Codec<Output>): Output;
|
|
18
|
+
}
|
|
19
|
+
/** Describes an observed Flow status and its output-bearing completions. */
|
|
20
|
+
export interface FlowResult {
|
|
21
|
+
/** Observed lifecycle state. A running SubFlow value is a durable snapshot. */
|
|
22
|
+
readonly status: FlowStatus;
|
|
23
|
+
/** Dex failure category when available. */
|
|
24
|
+
readonly errorType: FlowErrorTypeValue | undefined;
|
|
25
|
+
/** Server failure detail when available. */
|
|
26
|
+
readonly errorMessage: string | undefined;
|
|
27
|
+
/** Whether the observed run is terminal. */
|
|
28
|
+
readonly isTerminal: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Immutable completions in server collection order. Parallel Step order is not deterministic.
|
|
31
|
+
*/
|
|
32
|
+
readonly completions: readonly StepCompletion[];
|
|
33
|
+
/**
|
|
34
|
+
* Decodes the output when exactly one completion exists.
|
|
35
|
+
* @typeParam Output - Expected application output type.
|
|
36
|
+
* @param codec - Codec for the expected output type.
|
|
37
|
+
* @returns The only decoded Step output.
|
|
38
|
+
* @throws {@link TypeError} when nonterminal or when zero or multiple outputs exist.
|
|
39
|
+
*/
|
|
40
|
+
singleOutput<Output>(codec: Codec<Output>): Output;
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare function createStepCompletions(records: readonly StepCompletionOutput[], values: readonly Value[]): readonly StepCompletion[];
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare function createFlowResult(status: FlowStatus, completions: readonly StepCompletion[], errorType?: FlowErrorTypeValue, errorMessage?: string): FlowResult;
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare function createFlowResultFromProto(result: ProtoFlowResult, values: readonly Value[]): FlowResult;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Copyright (c) 2026 Super Durable, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Super Durable Source License 1.0.
|
|
4
|
+
// You may not use this file except in compliance with the License.
|
|
5
|
+
// See the LICENSE file in the repository root.
|
|
6
|
+
//
|
|
7
|
+
// SPDX-License-Identifier: LicenseRef-Super-Durable-1.0
|
|
8
|
+
import { FlowErrorType as ProtoFlowErrorType, FlowStatus as ProtoFlowStatus, } from "./gen/dex.js";
|
|
9
|
+
import { FlowErrorType } from "./errors.js";
|
|
10
|
+
import { decodeValue } from "./value-mapper.js";
|
|
11
|
+
/** @internal */
|
|
12
|
+
export function createStepCompletions(records, values) {
|
|
13
|
+
return Object.freeze(records.map((record, index) => {
|
|
14
|
+
const value = values[index];
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
throw new TypeError(`Step completion ${index} has no output`);
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
stepType: record.completedStepType,
|
|
20
|
+
stepExecutionId: record.completedStepExecutionId,
|
|
21
|
+
decode(codec) {
|
|
22
|
+
return decodeValue(codec, value);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export function createFlowResult(status, completions, errorType, errorMessage) {
|
|
29
|
+
const isTerminal = status !== "running" && status !== "continuedAsNew";
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
status,
|
|
32
|
+
errorType,
|
|
33
|
+
errorMessage,
|
|
34
|
+
isTerminal,
|
|
35
|
+
completions,
|
|
36
|
+
singleOutput(codec) {
|
|
37
|
+
if (!isTerminal) {
|
|
38
|
+
throw new TypeError("Flow result is not terminal");
|
|
39
|
+
}
|
|
40
|
+
if (completions.length !== 1) {
|
|
41
|
+
throw new TypeError(`Expected exactly one Step output, found ${completions.length}`);
|
|
42
|
+
}
|
|
43
|
+
return completions[0].decode(codec);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
export function createFlowResultFromProto(result, values) {
|
|
49
|
+
return createFlowResult(mapStatus(result.flowStatus), createStepCompletions(result.results, values), mapErrorType(result.errorType), result.errorMessage || undefined);
|
|
50
|
+
}
|
|
51
|
+
function mapStatus(status) {
|
|
52
|
+
const values = {
|
|
53
|
+
[ProtoFlowStatus.FLOW_STATUS_RUNNING]: "running",
|
|
54
|
+
[ProtoFlowStatus.FLOW_STATUS_COMPLETED]: "completed",
|
|
55
|
+
[ProtoFlowStatus.FLOW_STATUS_FAILED]: "failed",
|
|
56
|
+
[ProtoFlowStatus.FLOW_STATUS_SERVER_SIDE_TIMEOUT_INTERNAL_ONLY]: "serverSideTimeoutInternalOnly",
|
|
57
|
+
[ProtoFlowStatus.FLOW_STATUS_TERMINATED]: "terminated",
|
|
58
|
+
[ProtoFlowStatus.FLOW_STATUS_CANCELED]: "cancelled",
|
|
59
|
+
[ProtoFlowStatus.FLOW_STATUS_CONTINUED_AS_NEW]: "continuedAsNew",
|
|
60
|
+
};
|
|
61
|
+
const mapped = values[status];
|
|
62
|
+
if (mapped === undefined)
|
|
63
|
+
throw new TypeError(`unsupported Flow status ${status}`);
|
|
64
|
+
return mapped;
|
|
65
|
+
}
|
|
66
|
+
function mapErrorType(type) {
|
|
67
|
+
switch (type) {
|
|
68
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_UNSPECIFIED: return undefined;
|
|
69
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_STEP_DECISION_FAILING_FLOW:
|
|
70
|
+
return FlowErrorType.STEP_DECISION_FAILED;
|
|
71
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_CLIENT_API_FAILING_FLOW:
|
|
72
|
+
return FlowErrorType.CLIENT_API_FAILED;
|
|
73
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_WORKER_API_FAIL:
|
|
74
|
+
return FlowErrorType.WORKER_API_FAILED;
|
|
75
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_INVALID_USER_FLOW_CODE:
|
|
76
|
+
return FlowErrorType.INVALID_USER_FLOW_CODE;
|
|
77
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_INTERNAL: return FlowErrorType.INTERNAL;
|
|
78
|
+
case ProtoFlowErrorType.FLOW_ERROR_TYPE_FLOW_TIMEOUT: return FlowErrorType.FLOW_TIMEOUT;
|
|
79
|
+
default: throw new TypeError(`unsupported Flow error type ${type}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=flow-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-result.js","sourceRoot":"","sources":["../../src/flow-result.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,uDAAuD;AACvD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,wDAAwD;AAGxD,OAAO,EACL,aAAa,IAAI,kBAAkB,EACnC,UAAU,IAAI,eAAe,GAI9B,MAAM,cAAc,CAAC;AACtB,OAA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uCAAuC;YAC7D,OAAO,aAAa,CAAC,iBAAiB,CAAC;QACzC,KAAK,kBAAkB,CAAC,+BAA+B;YACrD,OAAO,aAAa,CAAC,iBAAiB,CAAC;QACzC,KAAK,kBAAkB,CAAC,sCAAsC;YAC5D,OAAO,aAAa,CAAC,sBAAsB,CAAC;QAC9C,KAAK,kBAAkB,CAAC,wBAAwB,CAAC,CAAC,OAAO,aAAa,CAAC,QAAQ,CAAC;QAChF,KAAK,kBAAkB,CAAC,4BAA4B,CAAC,CAAC,OAAO,aAAa,CAAC,YAAY,CAAC;QACxF,OAAO,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC"}
|
package/dist/src/flow.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AttributeMap, type Attribute, type PersistenceSchema } from "./persistence.js";
|
|
2
2
|
import { IndexType as ProtoIndexType } from "./gen/dex.js";
|
|
3
3
|
import { type RegisteredRPC } from "./rpc.js";
|
|
4
|
-
import { StepList, type Step } from "./step.js";
|
|
4
|
+
import { StepList, type Step, type StepDecision } from "./step.js";
|
|
5
5
|
import type { Channel, ChannelMap } from "./wait.js";
|
|
6
|
+
import type { Context } from "./context.js";
|
|
6
7
|
/**
|
|
7
8
|
* Defines one durable application Flow and its registered API surface.
|
|
8
9
|
* @typeParam StartInput - Value accepted by the optional starting Step.
|
|
@@ -23,6 +24,16 @@ export interface Flow<StartInput = void> {
|
|
|
23
24
|
* @returns Attributes and Channels owned by this Flow. Flows without this method have none.
|
|
24
25
|
*/
|
|
25
26
|
getPersistenceSchema?(): PersistenceSchema;
|
|
27
|
+
/**
|
|
28
|
+
* Handles expiration of this Flow's durable soft-timeout timer.
|
|
29
|
+
*
|
|
30
|
+
* When present, a positive timeout defaults to the handler policy. Dex awaits the result and
|
|
31
|
+
* applies it with normal Step Execute validation. The hook runs at most once and may transition,
|
|
32
|
+
* dead-end, complete, fail, or request graceful completion.
|
|
33
|
+
* @param context - Timeout invocation Context; it must not be retained.
|
|
34
|
+
* @returns A StepDecision, synchronously or asynchronously.
|
|
35
|
+
*/
|
|
36
|
+
handleTimeout?(context: Context): StepDecision | Promise<StepDecision>;
|
|
26
37
|
}
|
|
27
38
|
/**
|
|
28
39
|
* Validates and stores Flow definitions shared by Client and Worker.
|
|
@@ -53,6 +64,7 @@ export interface RegisteredStep {
|
|
|
53
64
|
export interface RegisteredFlow {
|
|
54
65
|
readonly name: string;
|
|
55
66
|
readonly flow: Flow<any>;
|
|
67
|
+
readonly hasTimeoutHandler: boolean;
|
|
56
68
|
readonly steps: readonly RegisteredStep[];
|
|
57
69
|
readonly startStep?: RegisteredStep;
|
|
58
70
|
readonly rpcs: readonly RegisteredRPC[];
|
package/dist/src/flow.js
CHANGED
|
@@ -196,6 +196,7 @@ function doRegisterFlow(flow, name, attributeIndexes) {
|
|
|
196
196
|
return Object.freeze({
|
|
197
197
|
name,
|
|
198
198
|
flow,
|
|
199
|
+
hasTimeoutHandler: typeof flow.handleTimeout === "function",
|
|
199
200
|
steps: Object.freeze(steps),
|
|
200
201
|
...(startStep === undefined ? {} : { startStep }),
|
|
201
202
|
rpcs,
|
package/dist/src/flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../src/flow.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,uDAAuD;AACvD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,wDAAwD;AAExD,OAAO,EAAE,YAAY,EAAE,SAAS,EAA0C,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3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