@temporalio/client 1.11.3 → 1.11.5

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.
Files changed (59) hide show
  1. package/lib/async-completion-client.js +4 -4
  2. package/lib/async-completion-client.js.map +1 -1
  3. package/lib/base-client.d.ts +2 -3
  4. package/lib/base-client.js +4 -4
  5. package/lib/base-client.js.map +1 -1
  6. package/lib/build-id-types.js +1 -2
  7. package/lib/build-id-types.js.map +1 -1
  8. package/lib/client.d.ts +3 -4
  9. package/lib/client.js +1 -0
  10. package/lib/client.js.map +1 -1
  11. package/lib/connection.d.ts +2 -4
  12. package/lib/connection.js +5 -5
  13. package/lib/connection.js.map +1 -1
  14. package/lib/errors.d.ts +15 -0
  15. package/lib/errors.js +36 -2
  16. package/lib/errors.js.map +1 -1
  17. package/lib/grpc-retry.js +4 -5
  18. package/lib/grpc-retry.js.map +1 -1
  19. package/lib/helpers.js +2 -3
  20. package/lib/helpers.js.map +1 -1
  21. package/lib/iterators-utils.js +1 -2
  22. package/lib/iterators-utils.js.map +1 -1
  23. package/lib/schedule-client.js +7 -5
  24. package/lib/schedule-client.js.map +1 -1
  25. package/lib/schedule-helpers.d.ts +1 -3
  26. package/lib/schedule-helpers.js +14 -27
  27. package/lib/schedule-helpers.js.map +1 -1
  28. package/lib/schedule-types.d.ts +17 -14
  29. package/lib/schedule-types.js +27 -18
  30. package/lib/schedule-types.js.map +1 -1
  31. package/lib/task-queue-client.d.ts +12 -1
  32. package/lib/task-queue-client.js +23 -38
  33. package/lib/task-queue-client.js.map +1 -1
  34. package/lib/types.d.ts +17 -3
  35. package/lib/types.js +22 -1
  36. package/lib/types.js.map +1 -1
  37. package/lib/workflow-client.d.ts +6 -6
  38. package/lib/workflow-client.js +20 -36
  39. package/lib/workflow-client.js.map +1 -1
  40. package/lib/workflow-options.d.ts +2 -1
  41. package/lib/workflow-options.js +1 -2
  42. package/lib/workflow-options.js.map +1 -1
  43. package/lib/workflow-update-stage.d.ts +12 -8
  44. package/lib/workflow-update-stage.js +18 -17
  45. package/lib/workflow-update-stage.js.map +1 -1
  46. package/package.json +4 -4
  47. package/src/async-completion-client.ts +4 -5
  48. package/src/base-client.ts +2 -2
  49. package/src/client.ts +4 -4
  50. package/src/connection.ts +2 -2
  51. package/src/errors.ts +34 -1
  52. package/src/schedule-client.ts +7 -6
  53. package/src/schedule-helpers.ts +2 -17
  54. package/src/schedule-types.ts +35 -22
  55. package/src/task-queue-client.ts +37 -38
  56. package/src/types.ts +38 -2
  57. package/src/workflow-client.ts +35 -28
  58. package/src/workflow-options.ts +2 -1
  59. package/src/workflow-update-stage.ts +29 -21
@@ -1,33 +1,41 @@
1
1
  import { temporal } from '@temporalio/proto';
2
- import { checkExtends } from '@temporalio/common/lib/type-helpers';
2
+ import { makeProtoEnumConverters } from '@temporalio/common/lib/internal-workflow';
3
3
 
4
- export enum WorkflowUpdateStage {
5
- /** This is not an allowed value. */
6
- UNSPECIFIED = 0,
4
+ export const WorkflowUpdateStage = {
7
5
  /** Admitted stage. This stage is reached when the server accepts the update request. It is not
8
6
  * allowed to wait for this stage when using startUpdate, since the update request has not yet
9
7
  * been durably persisted at this stage. */
10
- ADMITTED = 1,
8
+ ADMITTED: 'ADMITTED',
9
+
11
10
  /** Accepted stage. This stage is reached when a workflow has received the update and either
12
11
  * accepted it (i.e. it has passed validation, or there was no validator configured on the update
13
12
  * handler) or rejected it. This is currently the only allowed value when using startUpdate. */
14
- ACCEPTED = 2,
13
+ ACCEPTED: 'ACCEPTED',
14
+
15
15
  /** Completed stage. This stage is reached when a workflow has completed processing the
16
16
  * update with either a success or failure. */
17
- COMPLETED = 3,
18
- }
17
+ COMPLETED: 'COMPLETED',
19
18
 
20
- checkExtends<
21
- `UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_${keyof typeof WorkflowUpdateStage}`,
22
- keyof typeof temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage
23
- >();
24
- checkExtends<
25
- keyof typeof temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
26
- `UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_${keyof typeof WorkflowUpdateStage}`
27
- >();
19
+ /**
20
+ * This is not an allowed value.
21
+ * @deprecated
22
+ */
23
+ UNSPECIFIED: undefined, // eslint-disable-line deprecation/deprecation
24
+ } as const;
25
+ export type WorkflowUpdateStage = (typeof WorkflowUpdateStage)[keyof typeof WorkflowUpdateStage];
28
26
 
29
- export function toProtoEnum(stage: WorkflowUpdateStage): temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage {
30
- return temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage[
31
- `UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_${WorkflowUpdateStage[stage] as keyof typeof WorkflowUpdateStage}`
32
- ];
33
- }
27
+ export const [encodeWorkflowUpdateStage] = makeProtoEnumConverters<
28
+ temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
29
+ typeof temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
30
+ keyof typeof temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
31
+ typeof WorkflowUpdateStage,
32
+ 'UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_'
33
+ >(
34
+ {
35
+ [WorkflowUpdateStage.ADMITTED]: 1,
36
+ [WorkflowUpdateStage.ACCEPTED]: 2,
37
+ [WorkflowUpdateStage.COMPLETED]: 3,
38
+ UNSPECIFIED: 0,
39
+ } as const,
40
+ 'UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_'
41
+ );