@temporalio/client 0.23.0 → 1.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.
@@ -0,0 +1,76 @@
1
+ import {
2
+ CommonWorkflowOptions,
3
+ SignalDefinition,
4
+ WithCompiledWorkflowOptions,
5
+ } from '@temporalio/internal-workflow-common';
6
+
7
+ export * from '@temporalio/internal-workflow-common/lib/workflow-options';
8
+
9
+ export interface CompiledWorkflowOptions extends WithCompiledWorkflowOptions<WorkflowOptions> {
10
+ args: unknown[];
11
+ }
12
+
13
+ export interface WorkflowOptions extends CommonWorkflowOptions {
14
+ /**
15
+ * Workflow id to use when starting.
16
+ *
17
+ * Assign a meaningful business id.
18
+ * This ID can be used to ensure starting Workflows is idempotent.
19
+ * Workflow IDs are unique, see also {@link WorkflowOptions.workflowIdReusePolicy}
20
+ */
21
+ workflowId: string;
22
+
23
+ /**
24
+ * Task queue to use for Workflow tasks. It should match a task queue specified when creating a
25
+ * `Worker` that hosts the Workflow code.
26
+ */
27
+ taskQueue: string;
28
+
29
+ /**
30
+ * If set to true, instructs the client to follow the chain of execution before returning a Workflow's result.
31
+ *
32
+ * Workflow execution is chained if the Workflow has a cron schedule or continues-as-new or configured to retry
33
+ * after failure or timeout.
34
+ *
35
+ * @default true
36
+ */
37
+ followRuns?: boolean;
38
+ }
39
+
40
+ export interface WorkflowSignalWithStartOptions<SA extends any[] = []> extends WorkflowOptions {
41
+ /**
42
+ * SignalDefinition or name of signal
43
+ */
44
+ signal: SignalDefinition<SA> | string;
45
+ /**
46
+ * Arguments to invoke the signal handler with
47
+ */
48
+ signalArgs: SA;
49
+ }
50
+
51
+ // export interface WorkflowOptionsWithDefaults<T extends Workflow> extends CommonWorkflowOptionsWithDefaults<T> {
52
+ // /**
53
+ // * If set to true, instructs the client to follow the chain of execution before returning a Workflow's result.
54
+ // *
55
+ // * Workflow execution is chained if the Workflow has a cron schedule or continues-as-new or configured to retry
56
+ // * after failure or timeout.
57
+ // *
58
+ // * @default true
59
+ // */
60
+ // followRuns: boolean;
61
+ // }
62
+ //
63
+ // /**
64
+ // * Adds default values to `workflowId` and `workflowIdReusePolicy` to given workflow options.
65
+ // */
66
+ // export function addDefaults<T extends Workflow>(
67
+ // opts: WithWorkflowArgs<T, WorkflowOptions>
68
+ // ): WorkflowOptionsWithDefaults<T> {
69
+ // const { workflowId, args, ...rest } = opts;
70
+ // return {
71
+ // followRuns: true,
72
+ // args: args ?? [],
73
+ // workflowId: workflowId ?? uuid4(),
74
+ // ...rest,
75
+ // };
76
+ // }