awaitly 2.0.0 → 3.0.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/di-Biw_plBn.d.cts +15 -0
- package/dist/di-DxyH2N3i.d.ts +15 -0
- package/dist/durable.cjs +4670 -0
- package/dist/durable.cjs.map +1 -0
- package/dist/durable.d.cts +9 -0
- package/dist/durable.d.ts +9 -0
- package/dist/durable.js +4610 -0
- package/dist/durable.js.map +1 -0
- package/dist/{di-BbFFfO8y.d.ts → duration-BjVn3QpB.d.cts} +1 -15
- package/dist/{di-BDlT7InM.d.cts → duration-BjVn3QpB.d.ts} +1 -15
- package/dist/engine.cjs +4501 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +113 -0
- package/dist/engine.d.ts +113 -0
- package/dist/engine.js +4474 -0
- package/dist/engine.js.map +1 -0
- package/dist/{errors-DtXvrCiO.d.cts → errors-sDSeaZBO.d.cts} +1 -1
- package/dist/{errors-DtXvrCiO.d.ts → errors-sDSeaZBO.d.ts} +1 -1
- package/dist/guards-CwQZro1F.d.ts +72 -0
- package/dist/guards-DhhOJZda.d.cts +72 -0
- package/dist/hitl-BnnnLzh2.d.cts +468 -0
- package/dist/hitl-pYfkQMv_.d.ts +468 -0
- package/dist/hitl.cjs +646 -0
- package/dist/hitl.cjs.map +1 -0
- package/dist/hitl.d.cts +440 -0
- package/dist/hitl.d.ts +440 -0
- package/dist/hitl.js +605 -0
- package/dist/hitl.js.map +1 -0
- package/dist/index-Bew12SZ8.d.ts +417 -0
- package/dist/index-Bwt-iz50.d.cts +417 -0
- package/dist/{types-B8NfNRGX.d.ts → index-Cv4K_3sZ.d.ts} +2 -1162
- package/dist/{types-BZ2f4MRR.d.cts → index-ICmfQi08.d.cts} +2 -1162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1527
- package/dist/index.d.ts +11 -1527
- package/dist/persistence.cjs +552 -0
- package/dist/persistence.cjs.map +1 -0
- package/dist/persistence.d.cts +254 -0
- package/dist/persistence.d.ts +254 -0
- package/dist/persistence.js +499 -0
- package/dist/persistence.js.map +1 -0
- package/dist/reliability.cjs +1651 -0
- package/dist/reliability.cjs.map +1 -0
- package/dist/reliability.d.cts +1442 -0
- package/dist/reliability.d.ts +1442 -0
- package/dist/reliability.js +1589 -0
- package/dist/reliability.js.map +1 -0
- package/dist/result.d.cts +1 -1
- package/dist/result.d.ts +1 -1
- package/dist/run.cjs +2283 -0
- package/dist/run.cjs.map +1 -0
- package/dist/run.d.cts +90 -0
- package/dist/run.d.ts +90 -0
- package/dist/run.js +2247 -0
- package/dist/run.js.map +1 -0
- package/dist/saga.cjs +3699 -0
- package/dist/saga.cjs.map +1 -0
- package/dist/saga.d.cts +162 -0
- package/dist/saga.d.ts +162 -0
- package/dist/saga.js +3670 -0
- package/dist/saga.js.map +1 -0
- package/dist/store-contract-BI98VYmX.d.ts +66 -0
- package/dist/store-contract-C2HyR_o6.d.cts +66 -0
- package/dist/streaming.cjs +895 -0
- package/dist/streaming.cjs.map +1 -0
- package/dist/streaming.d.cts +594 -0
- package/dist/streaming.d.ts +594 -0
- package/dist/streaming.js +832 -0
- package/dist/streaming.js.map +1 -0
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/types-BDTxgKKc.d.ts +845 -0
- package/dist/types-C9Y71dua.d.cts +845 -0
- package/dist/types-d8q8iQlk.d.cts +323 -0
- package/dist/types-sObbY4mX.d.ts +323 -0
- package/dist/webhook.cjs +461 -0
- package/dist/webhook.cjs.map +1 -0
- package/dist/webhook.d.cts +497 -0
- package/dist/webhook.d.ts +497 -0
- package/dist/webhook.js +422 -0
- package/dist/webhook.js.map +1 -0
- package/dist/workflow.cjs +2 -2614
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +12 -3023
- package/dist/workflow.d.ts +12 -3023
- package/dist/workflow.js +2 -2535
- package/dist/workflow.js.map +1 -1
- package/package.json +46 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { h as StepResult, R as ResumeState, b as WorkflowSnapshot } from './types-BDTxgKKc.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Serialization for ResumeState to/from JSON-safe format.
|
|
5
|
+
* Centralizes Map serialization so adapters don't re-implement it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* JSON-serializable resume state. Use this shape when persisting to storage.
|
|
10
|
+
* Discriminator `kind: "ResumeState"` enables adapters and migrations to detect format.
|
|
11
|
+
*/
|
|
12
|
+
type SerializedResumeState = {
|
|
13
|
+
kind: "ResumeState";
|
|
14
|
+
steps: [string, StepResult][];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Serialize resume state to a JSON-safe object. Preserves step order (array).
|
|
18
|
+
* Use with JSON.stringify for storage; adapters can rely on this shape.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const serialized = serializeResumeState(collector.getResumeState());
|
|
22
|
+
* await store.save(id, JSON.stringify(serialized));
|
|
23
|
+
*/
|
|
24
|
+
declare function serializeResumeState(state: ResumeState): SerializedResumeState;
|
|
25
|
+
/**
|
|
26
|
+
* Type guard for SerializedResumeState. Use when loading from storage to discriminate from WorkflowSnapshot.
|
|
27
|
+
*/
|
|
28
|
+
declare function isSerializedResumeState(x: unknown): x is SerializedResumeState;
|
|
29
|
+
/**
|
|
30
|
+
* Deserialize from JSON-parsed object back to ResumeState (runtime Map).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const parsed = JSON.parse(await store.load(id));
|
|
34
|
+
* if (isSerializedResumeState(parsed)) {
|
|
35
|
+
* const state = deserializeResumeState(parsed);
|
|
36
|
+
* await workflow.run(fn, { resumeState: state });
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
declare function deserializeResumeState(raw: SerializedResumeState): ResumeState;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Extended persistence contract: save/load accept both WorkflowSnapshot and ResumeState.
|
|
43
|
+
* Use type guards (isWorkflowSnapshot, isResumeState, isSerializedResumeState) in adapters.
|
|
44
|
+
* Core persistence.SnapshotStore stays narrow; this module defines the broad contract and helpers.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/** What stores persist (JSON/database shape). Use for type discrimination in adapters. */
|
|
48
|
+
type PersistedWorkflowState = WorkflowSnapshot | SerializedResumeState;
|
|
49
|
+
/** What save() can accept: snapshot or runtime resume state. Adapters branch with type guards. */
|
|
50
|
+
type StoreSaveInput = WorkflowSnapshot | ResumeState;
|
|
51
|
+
/** What load() can return. Use toResumeState() or loadResumeState for type-safe restore. */
|
|
52
|
+
type StoreLoadResult = WorkflowSnapshot | ResumeState | null;
|
|
53
|
+
/**
|
|
54
|
+
* Convert a loaded value to ResumeState for workflow.run(fn, { resumeState }).
|
|
55
|
+
* - If loaded is already ResumeState, returns it.
|
|
56
|
+
* - If loaded is null or WorkflowSnapshot, returns undefined (use run(fn, { snapshot }) for snapshots).
|
|
57
|
+
* Two explicit flows: resume from ResumeState vs resume from snapshot; don't pass snapshot to resumeState.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const loaded = await store.load('wf-123');
|
|
61
|
+
* const resumeState = toResumeState(loaded);
|
|
62
|
+
* if (resumeState) await workflow.run(fn, { resumeState });
|
|
63
|
+
*/
|
|
64
|
+
declare function toResumeState(loaded: StoreLoadResult): ResumeState | undefined;
|
|
65
|
+
|
|
66
|
+
export { type PersistedWorkflowState as P, type SerializedResumeState as S, type StoreLoadResult as a, type StoreSaveInput as b, deserializeResumeState as d, isSerializedResumeState as i, serializeResumeState as s, toResumeState as t };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { h as StepResult, R as ResumeState, b as WorkflowSnapshot } from './types-C9Y71dua.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Serialization for ResumeState to/from JSON-safe format.
|
|
5
|
+
* Centralizes Map serialization so adapters don't re-implement it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* JSON-serializable resume state. Use this shape when persisting to storage.
|
|
10
|
+
* Discriminator `kind: "ResumeState"` enables adapters and migrations to detect format.
|
|
11
|
+
*/
|
|
12
|
+
type SerializedResumeState = {
|
|
13
|
+
kind: "ResumeState";
|
|
14
|
+
steps: [string, StepResult][];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Serialize resume state to a JSON-safe object. Preserves step order (array).
|
|
18
|
+
* Use with JSON.stringify for storage; adapters can rely on this shape.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const serialized = serializeResumeState(collector.getResumeState());
|
|
22
|
+
* await store.save(id, JSON.stringify(serialized));
|
|
23
|
+
*/
|
|
24
|
+
declare function serializeResumeState(state: ResumeState): SerializedResumeState;
|
|
25
|
+
/**
|
|
26
|
+
* Type guard for SerializedResumeState. Use when loading from storage to discriminate from WorkflowSnapshot.
|
|
27
|
+
*/
|
|
28
|
+
declare function isSerializedResumeState(x: unknown): x is SerializedResumeState;
|
|
29
|
+
/**
|
|
30
|
+
* Deserialize from JSON-parsed object back to ResumeState (runtime Map).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const parsed = JSON.parse(await store.load(id));
|
|
34
|
+
* if (isSerializedResumeState(parsed)) {
|
|
35
|
+
* const state = deserializeResumeState(parsed);
|
|
36
|
+
* await workflow.run(fn, { resumeState: state });
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
declare function deserializeResumeState(raw: SerializedResumeState): ResumeState;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Extended persistence contract: save/load accept both WorkflowSnapshot and ResumeState.
|
|
43
|
+
* Use type guards (isWorkflowSnapshot, isResumeState, isSerializedResumeState) in adapters.
|
|
44
|
+
* Core persistence.SnapshotStore stays narrow; this module defines the broad contract and helpers.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/** What stores persist (JSON/database shape). Use for type discrimination in adapters. */
|
|
48
|
+
type PersistedWorkflowState = WorkflowSnapshot | SerializedResumeState;
|
|
49
|
+
/** What save() can accept: snapshot or runtime resume state. Adapters branch with type guards. */
|
|
50
|
+
type StoreSaveInput = WorkflowSnapshot | ResumeState;
|
|
51
|
+
/** What load() can return. Use toResumeState() or loadResumeState for type-safe restore. */
|
|
52
|
+
type StoreLoadResult = WorkflowSnapshot | ResumeState | null;
|
|
53
|
+
/**
|
|
54
|
+
* Convert a loaded value to ResumeState for workflow.run(fn, { resumeState }).
|
|
55
|
+
* - If loaded is already ResumeState, returns it.
|
|
56
|
+
* - If loaded is null or WorkflowSnapshot, returns undefined (use run(fn, { snapshot }) for snapshots).
|
|
57
|
+
* Two explicit flows: resume from ResumeState vs resume from snapshot; don't pass snapshot to resumeState.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const loaded = await store.load('wf-123');
|
|
61
|
+
* const resumeState = toResumeState(loaded);
|
|
62
|
+
* if (resumeState) await workflow.run(fn, { resumeState });
|
|
63
|
+
*/
|
|
64
|
+
declare function toResumeState(loaded: StoreLoadResult): ResumeState | undefined;
|
|
65
|
+
|
|
66
|
+
export { type PersistedWorkflowState as P, type SerializedResumeState as S, type StoreLoadResult as a, type StoreSaveInput as b, deserializeResumeState as d, isSerializedResumeState as i, serializeResumeState as s, toResumeState as t };
|