@temporalio/client 1.0.0-rc.0 → 1.0.1
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/LICENSE.md +1 -1
- package/lib/async-completion-client.d.ts +3 -3
- package/lib/async-completion-client.js +3 -3
- package/lib/connection.d.ts +33 -21
- package/lib/connection.js +24 -17
- package/lib/connection.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/workflow-client.d.ts +9 -3
- package/lib/workflow-client.js +15 -4
- package/lib/workflow-client.js.map +1 -1
- package/package.json +13 -12
- package/src/async-completion-client.ts +256 -0
- package/src/connection.ts +374 -0
- package/src/errors.ts +57 -0
- package/src/grpc-retry.ts +119 -0
- package/src/index.ts +37 -0
- package/src/interceptors.ts +132 -0
- package/src/pkg.ts +7 -0
- package/src/types.ts +88 -0
- package/src/workflow-client.ts +979 -0
- package/src/workflow-options.ts +76 -0
|
@@ -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
|
+
// }
|