@hatchet-dev/typescript-sdk 1.15.2 → 1.17.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.
Files changed (202) hide show
  1. package/README.md +14 -2
  2. package/clients/admin/admin-client.d.ts +2 -2
  3. package/clients/admin/admin-client.js +8 -9
  4. package/clients/dispatcher/action-listener.d.ts +3 -6
  5. package/clients/dispatcher/action-listener.js +54 -23
  6. package/clients/dispatcher/dispatcher-client.js +5 -8
  7. package/clients/dispatcher/heartbeat/heartbeat-worker.js +7 -4
  8. package/clients/event/event-client.d.ts +2 -2
  9. package/clients/event/event-client.js +5 -11
  10. package/clients/hatchet-client/hatchet-logger.js +8 -17
  11. package/clients/listeners/durable-listener/durable-listener-client.d.ts +115 -15
  12. package/clients/listeners/durable-listener/durable-listener-client.js +769 -19
  13. package/clients/listeners/durable-listener/pooled-durable-listener-client.js +11 -22
  14. package/clients/listeners/run-listener/child-listener-client.d.ts +1 -1
  15. package/clients/listeners/run-listener/child-listener-client.js +34 -30
  16. package/clients/listeners/run-listener/pooled-child-listener-client.js +9 -19
  17. package/clients/rest/generated/Api.d.ts +25 -1
  18. package/clients/rest/generated/Api.js +20 -0
  19. package/clients/rest/generated/data-contracts.d.ts +60 -1
  20. package/clients/rest/generated/data-contracts.js +9 -1
  21. package/legacy/examples/affinity-workers.js +2 -3
  22. package/legacy/examples/byo-logger.js +0 -2
  23. package/legacy/examples/concurrency/cancel-in-progress/concurrency-worker.js +4 -2
  24. package/legacy/examples/concurrency/group-round-robin/concurrency-event.js +0 -1
  25. package/legacy/examples/concurrency/group-round-robin/concurrency-worker-expression.js +4 -2
  26. package/legacy/examples/concurrency/group-round-robin/concurrency-worker-key-fn.js +4 -2
  27. package/legacy/examples/example-event.js +0 -3
  28. package/legacy/examples/logger.js +0 -1
  29. package/legacy/examples/sticky-worker-with-check.js +0 -1
  30. package/legacy/examples/sticky-worker.js +0 -1
  31. package/legacy/legacy-client.js +2 -2
  32. package/legacy/legacy-transformer.js +2 -4
  33. package/legacy/step.d.ts +16 -16
  34. package/legacy/step.js +8 -17
  35. package/legacy/workflow.d.ts +81 -81
  36. package/package.json +20 -29
  37. package/protoc/dispatcher/dispatcher.d.ts +20 -0
  38. package/protoc/dispatcher/dispatcher.js +136 -2
  39. package/protoc/v1/dispatcher.d.ts +168 -0
  40. package/protoc/v1/dispatcher.js +1920 -1
  41. package/protoc/v1/shared/trigger.d.ts +89 -0
  42. package/protoc/v1/shared/trigger.js +493 -0
  43. package/protoc/v1/workflows.d.ts +34 -34
  44. package/protoc/v1/workflows.js +252 -200
  45. package/protoc/workflows/workflows.d.ts +2 -75
  46. package/protoc/workflows/workflows.js +16 -491
  47. package/util/abort-error.d.ts +15 -1
  48. package/util/abort-error.js +30 -5
  49. package/util/config-loader/config-loader.js +4 -3
  50. package/util/config-loader/token.js +9 -2
  51. package/util/errors/eviction-not-supported-error.d.ts +5 -0
  52. package/util/errors/eviction-not-supported-error.js +18 -0
  53. package/util/errors/hatchet-error.d.ts +9 -1
  54. package/util/errors/hatchet-error.js +23 -2
  55. package/util/errors/non-determinism-error.d.ts +7 -0
  56. package/util/errors/non-determinism-error.js +21 -0
  57. package/util/errors/task-run-terminated-error.d.ts +6 -0
  58. package/util/errors/task-run-terminated-error.js +15 -0
  59. package/util/grpc-error.d.ts +9 -0
  60. package/util/grpc-error.js +25 -0
  61. package/util/hatchet-promise/hatchet-promise.d.ts +6 -1
  62. package/util/hatchet-promise/hatchet-promise.js +16 -2
  63. package/util/logger/logger.js +0 -1
  64. package/util/parse.d.ts +1 -1
  65. package/util/parse.js +4 -2
  66. package/util/retrier.js +2 -3
  67. package/util/sleep.d.ts +3 -2
  68. package/util/sleep.js +6 -4
  69. package/util/workflow-run-ref.js +5 -3
  70. package/v1/client/admin.d.ts +2 -2
  71. package/v1/client/admin.js +2 -6
  72. package/v1/client/client.d.ts +7 -11
  73. package/v1/client/client.interface.d.ts +5 -8
  74. package/v1/client/client.js +34 -40
  75. package/v1/client/duration.d.ts +11 -1
  76. package/v1/client/duration.js +44 -0
  77. package/v1/client/features/cel.js +1 -1
  78. package/v1/client/features/crons.js +2 -2
  79. package/v1/client/features/index.d.ts +5 -0
  80. package/v1/client/features/index.js +5 -0
  81. package/v1/client/features/logs.d.ts +37 -0
  82. package/v1/client/features/logs.js +46 -0
  83. package/v1/client/features/runs.d.ts +16 -3
  84. package/v1/client/features/runs.js +38 -4
  85. package/v1/client/features/schedules.js +4 -4
  86. package/v1/client/features/webhooks.js +4 -2
  87. package/v1/client/features/workflows.js +1 -1
  88. package/v1/client/worker/context.d.ts +101 -6
  89. package/v1/client/worker/context.js +257 -44
  90. package/v1/client/worker/deprecated/deprecation.js +8 -4
  91. package/v1/client/worker/deprecated/index.d.ts +1 -1
  92. package/v1/client/worker/deprecated/index.js +2 -1
  93. package/v1/client/worker/deprecated/legacy-worker.d.ts +5 -0
  94. package/v1/client/worker/deprecated/legacy-worker.js +33 -24
  95. package/v1/client/worker/deprecated/pre-eviction.d.ts +12 -0
  96. package/v1/client/worker/deprecated/pre-eviction.js +37 -0
  97. package/v1/client/worker/engine-version.d.ts +5 -0
  98. package/v1/client/worker/engine-version.js +14 -0
  99. package/v1/client/worker/eviction/eviction-cache.d.ts +33 -0
  100. package/v1/client/worker/eviction/eviction-cache.js +139 -0
  101. package/v1/client/worker/eviction/eviction-manager.d.ts +42 -0
  102. package/v1/client/worker/eviction/eviction-manager.js +132 -0
  103. package/v1/client/worker/eviction/eviction-policy.d.ts +19 -0
  104. package/v1/client/worker/eviction/eviction-policy.js +8 -0
  105. package/v1/client/worker/eviction/index.d.ts +3 -0
  106. package/v1/client/worker/eviction/index.js +11 -0
  107. package/v1/client/worker/health-server.js +3 -3
  108. package/v1/client/worker/slot-utils.js +0 -3
  109. package/v1/client/worker/worker-internal.d.ts +23 -4
  110. package/v1/client/worker/worker-internal.js +216 -148
  111. package/v1/client/worker/worker.d.ts +1 -0
  112. package/v1/client/worker/worker.js +34 -0
  113. package/v1/conditions/base.js +0 -1
  114. package/v1/conditions/index.js +2 -4
  115. package/v1/conditions/sleep-condition.js +2 -1
  116. package/v1/conditions/transformer.js +2 -1
  117. package/v1/declaration.d.ts +6 -4
  118. package/v1/declaration.js +20 -7
  119. package/v1/examples/__e2e__/harness.d.ts +5 -0
  120. package/v1/examples/__e2e__/harness.js +17 -3
  121. package/v1/examples/affinity/affinity-workers.js +0 -1
  122. package/v1/examples/bulk_operations/workflow.js +0 -1
  123. package/v1/examples/cancellation/run.js +0 -1
  124. package/v1/examples/cancellations/run.js +0 -1
  125. package/v1/examples/child_workflows/run.js +0 -2
  126. package/v1/examples/child_workflows/workflow.js +0 -1
  127. package/v1/examples/concurrency-rr/load.js +0 -1
  128. package/v1/examples/concurrency-rr/run.js +0 -3
  129. package/v1/examples/concurrency_limit_rr/load.js +0 -1
  130. package/v1/examples/concurrency_limit_rr/run.js +0 -3
  131. package/v1/examples/concurrency_workflow_level/workflow.d.ts +1 -1
  132. package/v1/examples/concurrency_workflow_level/workflow.js +1 -1
  133. package/v1/examples/conditions/event.js +0 -1
  134. package/v1/examples/conditions/run.js +0 -1
  135. package/v1/examples/dag/run.js +0 -1
  136. package/v1/examples/dag_match_condition/event.js +0 -1
  137. package/v1/examples/dag_match_condition/run.js +0 -1
  138. package/v1/examples/deep/run.js +0 -2
  139. package/v1/examples/durable/workflow.d.ts +57 -0
  140. package/v1/examples/durable/workflow.js +164 -10
  141. package/v1/examples/durable-event/event.js +0 -1
  142. package/v1/examples/durable-event/run.js +0 -2
  143. package/v1/examples/durable-event/workflow.js +2 -7
  144. package/v1/examples/durable-sleep/event.js +0 -1
  145. package/v1/examples/durable-sleep/run.js +0 -2
  146. package/v1/examples/durable_event/event.js +0 -1
  147. package/v1/examples/durable_event/run.js +0 -2
  148. package/v1/examples/durable_event/workflow.d.ts +1 -0
  149. package/v1/examples/durable_event/workflow.js +4 -9
  150. package/v1/examples/durable_eviction/capacity-worker.d.ts +1 -0
  151. package/v1/examples/durable_eviction/capacity-worker.js +31 -0
  152. package/v1/examples/durable_eviction/worker.d.ts +1 -0
  153. package/v1/examples/durable_eviction/worker.js +34 -0
  154. package/v1/examples/durable_eviction/workflow.d.ts +44 -0
  155. package/v1/examples/durable_eviction/workflow.js +129 -0
  156. package/v1/examples/durable_sleep/event.js +0 -1
  157. package/v1/examples/durable_sleep/run.js +0 -2
  158. package/v1/examples/e2e-worker.js +42 -19
  159. package/v1/examples/events/event.js +0 -1
  160. package/v1/examples/high-memory/run.js +0 -1
  161. package/v1/examples/inferred-typing/run.js +0 -1
  162. package/v1/examples/landing_page/durable-excution.js +0 -1
  163. package/v1/examples/landing_page/queues.js +0 -1
  164. package/v1/examples/legacy/run.js +0 -1
  165. package/v1/examples/logger/byo-logger.js +0 -2
  166. package/v1/examples/logger/logger.js +0 -1
  167. package/v1/examples/logging/byo-logger.js +0 -2
  168. package/v1/examples/logging/logger.js +0 -1
  169. package/v1/examples/middleware/recipes.js +3 -1
  170. package/v1/examples/migration-guides/mergent.js +2 -1
  171. package/v1/examples/multiple_wf_concurrency/run.js +0 -3
  172. package/v1/examples/non_retryable/run.js +0 -1
  173. package/v1/examples/on_event/event.js +0 -1
  174. package/v1/examples/on_failure/run.js +0 -1
  175. package/v1/examples/on_failure/workflow.js +0 -1
  176. package/v1/examples/on_success/run.js +0 -1
  177. package/v1/examples/on_success/workflow.js +0 -1
  178. package/v1/examples/priority/run.js +0 -1
  179. package/v1/examples/priority/workflow.js +0 -1
  180. package/v1/examples/retries/run.js +0 -1
  181. package/v1/examples/retries/workflow.js +0 -1
  182. package/v1/examples/simple/bulk.js +0 -1
  183. package/v1/examples/simple/cron.js +0 -2
  184. package/v1/examples/simple/delay.js +0 -1
  185. package/v1/examples/simple/enqueue.js +0 -2
  186. package/v1/examples/simple/run.js +0 -1
  187. package/v1/examples/simple/schedule.js +0 -1
  188. package/v1/examples/simple/workflow-with-child.js +10 -4
  189. package/v1/examples/sticky/run.js +0 -1
  190. package/v1/examples/sticky/workflow.js +0 -1
  191. package/v1/examples/streaming/nextjs-proxy.js +0 -1
  192. package/v1/examples/streaming/run.js +0 -1
  193. package/v1/examples/timeout/run.js +0 -1
  194. package/v1/examples/timeouts/run.js +0 -1
  195. package/v1/index.d.ts +5 -0
  196. package/v1/index.js +10 -0
  197. package/v1/parent-run-context-vars.d.ts +6 -0
  198. package/v1/slot-types.js +0 -1
  199. package/v1/task.d.ts +10 -2
  200. package/v1/task.js +2 -1
  201. package/version.d.ts +1 -1
  202. package/version.js +1 -1
@@ -17,31 +17,31 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
17
17
  units: string | number;
18
18
  key?: string | undefined;
19
19
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
20
+ limit?: string | number | undefined;
20
21
  staticKey?: string | undefined;
21
22
  dynamicKey?: string | undefined;
22
- limit?: string | number | undefined;
23
23
  }, {
24
24
  units: string | number;
25
25
  key?: string | undefined;
26
26
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
27
+ limit?: string | number | undefined;
27
28
  staticKey?: string | undefined;
28
29
  dynamicKey?: string | undefined;
29
- limit?: string | number | undefined;
30
30
  }>, "many">>;
31
31
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
32
32
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
33
33
  required: z.ZodOptional<z.ZodBoolean>;
34
34
  weight: z.ZodOptional<z.ZodNumber>;
35
- comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
35
+ comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
36
36
  }, "strip", z.ZodTypeAny, {
37
37
  value: string | number;
38
38
  required?: boolean | undefined;
39
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
39
+ comparator?: import("..").WorkerLabelComparator | undefined;
40
40
  weight?: number | undefined;
41
41
  }, {
42
42
  value: string | number;
43
43
  required?: boolean | undefined;
44
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
44
+ comparator?: import("..").WorkerLabelComparator | undefined;
45
45
  weight?: number | undefined;
46
46
  }>]>>>>>;
47
47
  backoff: z.ZodOptional<z.ZodObject<{
@@ -59,47 +59,47 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
59
59
  timeout?: string | undefined;
60
60
  parents?: string[] | undefined;
61
61
  retries?: number | undefined;
62
+ backoff?: {
63
+ factor?: number | undefined;
64
+ maxSeconds?: number | undefined;
65
+ } | undefined;
62
66
  rate_limits?: {
63
67
  units: string | number;
64
68
  key?: string | undefined;
65
69
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
70
+ limit?: string | number | undefined;
66
71
  staticKey?: string | undefined;
67
72
  dynamicKey?: string | undefined;
68
- limit?: string | number | undefined;
69
73
  }[] | undefined;
70
74
  worker_labels?: Record<string, string | number | {
71
75
  value: string | number;
72
76
  required?: boolean | undefined;
73
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
77
+ comparator?: import("..").WorkerLabelComparator | undefined;
74
78
  weight?: number | undefined;
75
79
  } | undefined> | undefined;
76
- backoff?: {
77
- factor?: number | undefined;
78
- maxSeconds?: number | undefined;
79
- } | undefined;
80
80
  }, {
81
81
  name: string;
82
82
  timeout?: string | undefined;
83
83
  parents?: string[] | undefined;
84
84
  retries?: number | undefined;
85
+ backoff?: {
86
+ factor?: number | undefined;
87
+ maxSeconds?: number | undefined;
88
+ } | undefined;
85
89
  rate_limits?: {
86
90
  units: string | number;
87
91
  key?: string | undefined;
88
92
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
93
+ limit?: string | number | undefined;
89
94
  staticKey?: string | undefined;
90
95
  dynamicKey?: string | undefined;
91
- limit?: string | number | undefined;
92
96
  }[] | undefined;
93
97
  worker_labels?: Record<string, string | number | {
94
98
  value: string | number;
95
99
  required?: boolean | undefined;
96
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
100
+ comparator?: import("..").WorkerLabelComparator | undefined;
97
101
  weight?: number | undefined;
98
102
  } | undefined> | undefined;
99
- backoff?: {
100
- factor?: number | undefined;
101
- maxSeconds?: number | undefined;
102
- } | undefined;
103
103
  }>, "many">;
104
104
  export type Steps = z.infer<typeof StepsSchema>;
105
105
  export declare const ConcurrencyLimitStrategy: typeof PbConcurrencyLimitStrategy;
@@ -110,14 +110,14 @@ export declare const WorkflowConcurrency: z.ZodObject<{
110
110
  expression: z.ZodOptional<z.ZodString>;
111
111
  }, "strip", z.ZodTypeAny, {
112
112
  name: string;
113
- expression?: string | undefined;
114
113
  maxRuns?: number | undefined;
115
114
  limitStrategy?: PbConcurrencyLimitStrategy | undefined;
115
+ expression?: string | undefined;
116
116
  }, {
117
117
  name: string;
118
- expression?: string | undefined;
119
118
  maxRuns?: number | undefined;
120
119
  limitStrategy?: PbConcurrencyLimitStrategy | undefined;
120
+ expression?: string | undefined;
121
121
  }>;
122
122
  export declare const HatchetTimeoutSchema: z.ZodString;
123
123
  export declare const StickyStrategy: typeof PbStickyStrategy;
@@ -166,31 +166,31 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
166
166
  units: string | number;
167
167
  key?: string | undefined;
168
168
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
169
+ limit?: string | number | undefined;
169
170
  staticKey?: string | undefined;
170
171
  dynamicKey?: string | undefined;
171
- limit?: string | number | undefined;
172
172
  }, {
173
173
  units: string | number;
174
174
  key?: string | undefined;
175
175
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
176
+ limit?: string | number | undefined;
176
177
  staticKey?: string | undefined;
177
178
  dynamicKey?: string | undefined;
178
- limit?: string | number | undefined;
179
179
  }>, "many">>;
180
180
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
181
181
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
182
182
  required: z.ZodOptional<z.ZodBoolean>;
183
183
  weight: z.ZodOptional<z.ZodNumber>;
184
- comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
184
+ comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
185
185
  }, "strip", z.ZodTypeAny, {
186
186
  value: string | number;
187
187
  required?: boolean | undefined;
188
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
188
+ comparator?: import("..").WorkerLabelComparator | undefined;
189
189
  weight?: number | undefined;
190
190
  }, {
191
191
  value: string | number;
192
192
  required?: boolean | undefined;
193
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
193
+ comparator?: import("..").WorkerLabelComparator | undefined;
194
194
  weight?: number | undefined;
195
195
  }>]>>>>>;
196
196
  backoff: z.ZodOptional<z.ZodObject<{
@@ -208,47 +208,47 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
208
208
  timeout?: string | undefined;
209
209
  parents?: string[] | undefined;
210
210
  retries?: number | undefined;
211
+ backoff?: {
212
+ factor?: number | undefined;
213
+ maxSeconds?: number | undefined;
214
+ } | undefined;
211
215
  rate_limits?: {
212
216
  units: string | number;
213
217
  key?: string | undefined;
214
218
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
219
+ limit?: string | number | undefined;
215
220
  staticKey?: string | undefined;
216
221
  dynamicKey?: string | undefined;
217
- limit?: string | number | undefined;
218
222
  }[] | undefined;
219
223
  worker_labels?: Record<string, string | number | {
220
224
  value: string | number;
221
225
  required?: boolean | undefined;
222
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
226
+ comparator?: import("..").WorkerLabelComparator | undefined;
223
227
  weight?: number | undefined;
224
228
  } | undefined> | undefined;
225
- backoff?: {
226
- factor?: number | undefined;
227
- maxSeconds?: number | undefined;
228
- } | undefined;
229
229
  }, {
230
230
  name: string;
231
231
  timeout?: string | undefined;
232
232
  parents?: string[] | undefined;
233
233
  retries?: number | undefined;
234
+ backoff?: {
235
+ factor?: number | undefined;
236
+ maxSeconds?: number | undefined;
237
+ } | undefined;
234
238
  rate_limits?: {
235
239
  units: string | number;
236
240
  key?: string | undefined;
237
241
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
242
+ limit?: string | number | undefined;
238
243
  staticKey?: string | undefined;
239
244
  dynamicKey?: string | undefined;
240
- limit?: string | number | undefined;
241
245
  }[] | undefined;
242
246
  worker_labels?: Record<string, string | number | {
243
247
  value: string | number;
244
248
  required?: boolean | undefined;
245
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
249
+ comparator?: import("..").WorkerLabelComparator | undefined;
246
250
  weight?: number | undefined;
247
251
  } | undefined> | undefined;
248
- backoff?: {
249
- factor?: number | undefined;
250
- maxSeconds?: number | undefined;
251
- } | undefined;
252
252
  }>, "many">;
253
253
  onFailure: z.ZodOptional<z.ZodObject<{
254
254
  name: z.ZodString;
@@ -266,31 +266,31 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
266
266
  units: string | number;
267
267
  key?: string | undefined;
268
268
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
269
+ limit?: string | number | undefined;
269
270
  staticKey?: string | undefined;
270
271
  dynamicKey?: string | undefined;
271
- limit?: string | number | undefined;
272
272
  }, {
273
273
  units: string | number;
274
274
  key?: string | undefined;
275
275
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
276
+ limit?: string | number | undefined;
276
277
  staticKey?: string | undefined;
277
278
  dynamicKey?: string | undefined;
278
- limit?: string | number | undefined;
279
279
  }>, "many">>;
280
280
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
281
281
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
282
282
  required: z.ZodOptional<z.ZodBoolean>;
283
283
  weight: z.ZodOptional<z.ZodNumber>;
284
- comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("../protoc/workflows").WorkerLabelComparator>>;
284
+ comparator: z.ZodOptional<z.ZodNativeEnum<typeof import("..").WorkerLabelComparator>>;
285
285
  }, "strip", z.ZodTypeAny, {
286
286
  value: string | number;
287
287
  required?: boolean | undefined;
288
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
288
+ comparator?: import("..").WorkerLabelComparator | undefined;
289
289
  weight?: number | undefined;
290
290
  }, {
291
291
  value: string | number;
292
292
  required?: boolean | undefined;
293
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
293
+ comparator?: import("..").WorkerLabelComparator | undefined;
294
294
  weight?: number | undefined;
295
295
  }>]>>>>>;
296
296
  backoff: z.ZodOptional<z.ZodObject<{
@@ -308,79 +308,79 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
308
308
  timeout?: string | undefined;
309
309
  parents?: string[] | undefined;
310
310
  retries?: number | undefined;
311
+ backoff?: {
312
+ factor?: number | undefined;
313
+ maxSeconds?: number | undefined;
314
+ } | undefined;
311
315
  rate_limits?: {
312
316
  units: string | number;
313
317
  key?: string | undefined;
314
318
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
319
+ limit?: string | number | undefined;
315
320
  staticKey?: string | undefined;
316
321
  dynamicKey?: string | undefined;
317
- limit?: string | number | undefined;
318
322
  }[] | undefined;
319
323
  worker_labels?: Record<string, string | number | {
320
324
  value: string | number;
321
325
  required?: boolean | undefined;
322
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
326
+ comparator?: import("..").WorkerLabelComparator | undefined;
323
327
  weight?: number | undefined;
324
328
  } | undefined> | undefined;
325
- backoff?: {
326
- factor?: number | undefined;
327
- maxSeconds?: number | undefined;
328
- } | undefined;
329
329
  }, {
330
330
  name: string;
331
331
  timeout?: string | undefined;
332
332
  parents?: string[] | undefined;
333
333
  retries?: number | undefined;
334
+ backoff?: {
335
+ factor?: number | undefined;
336
+ maxSeconds?: number | undefined;
337
+ } | undefined;
334
338
  rate_limits?: {
335
339
  units: string | number;
336
340
  key?: string | undefined;
337
341
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
342
+ limit?: string | number | undefined;
338
343
  staticKey?: string | undefined;
339
344
  dynamicKey?: string | undefined;
340
- limit?: string | number | undefined;
341
345
  }[] | undefined;
342
346
  worker_labels?: Record<string, string | number | {
343
347
  value: string | number;
344
348
  required?: boolean | undefined;
345
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
349
+ comparator?: import("..").WorkerLabelComparator | undefined;
346
350
  weight?: number | undefined;
347
351
  } | undefined> | undefined;
348
- backoff?: {
349
- factor?: number | undefined;
350
- maxSeconds?: number | undefined;
351
- } | undefined;
352
352
  }>>;
353
353
  }, "strip", z.ZodTypeAny, {
354
354
  description: string;
355
- id: string;
356
355
  steps: {
357
356
  name: string;
358
357
  timeout?: string | undefined;
359
358
  parents?: string[] | undefined;
360
359
  retries?: number | undefined;
360
+ backoff?: {
361
+ factor?: number | undefined;
362
+ maxSeconds?: number | undefined;
363
+ } | undefined;
361
364
  rate_limits?: {
362
365
  units: string | number;
363
366
  key?: string | undefined;
364
367
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
368
+ limit?: string | number | undefined;
365
369
  staticKey?: string | undefined;
366
370
  dynamicKey?: string | undefined;
367
- limit?: string | number | undefined;
368
371
  }[] | undefined;
369
372
  worker_labels?: Record<string, string | number | {
370
373
  value: string | number;
371
374
  required?: boolean | undefined;
372
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
375
+ comparator?: import("..").WorkerLabelComparator | undefined;
373
376
  weight?: number | undefined;
374
377
  } | undefined> | undefined;
375
- backoff?: {
376
- factor?: number | undefined;
377
- maxSeconds?: number | undefined;
378
- } | undefined;
379
378
  }[];
379
+ id: string;
380
380
  version?: string | undefined;
381
381
  timeout?: string | undefined;
382
- sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
383
382
  scheduleTimeout?: string | undefined;
383
+ sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
384
384
  on?: {
385
385
  cron: string;
386
386
  event?: undefined;
@@ -393,56 +393,56 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
393
393
  timeout?: string | undefined;
394
394
  parents?: string[] | undefined;
395
395
  retries?: number | undefined;
396
+ backoff?: {
397
+ factor?: number | undefined;
398
+ maxSeconds?: number | undefined;
399
+ } | undefined;
396
400
  rate_limits?: {
397
401
  units: string | number;
398
402
  key?: string | undefined;
399
403
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
404
+ limit?: string | number | undefined;
400
405
  staticKey?: string | undefined;
401
406
  dynamicKey?: string | undefined;
402
- limit?: string | number | undefined;
403
407
  }[] | undefined;
404
408
  worker_labels?: Record<string, string | number | {
405
409
  value: string | number;
406
410
  required?: boolean | undefined;
407
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
411
+ comparator?: import("..").WorkerLabelComparator | undefined;
408
412
  weight?: number | undefined;
409
413
  } | undefined> | undefined;
410
- backoff?: {
411
- factor?: number | undefined;
412
- maxSeconds?: number | undefined;
413
- } | undefined;
414
414
  } | undefined;
415
415
  }, {
416
416
  description: string;
417
- id: string;
418
417
  steps: {
419
418
  name: string;
420
419
  timeout?: string | undefined;
421
420
  parents?: string[] | undefined;
422
421
  retries?: number | undefined;
422
+ backoff?: {
423
+ factor?: number | undefined;
424
+ maxSeconds?: number | undefined;
425
+ } | undefined;
423
426
  rate_limits?: {
424
427
  units: string | number;
425
428
  key?: string | undefined;
426
429
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
430
+ limit?: string | number | undefined;
427
431
  staticKey?: string | undefined;
428
432
  dynamicKey?: string | undefined;
429
- limit?: string | number | undefined;
430
433
  }[] | undefined;
431
434
  worker_labels?: Record<string, string | number | {
432
435
  value: string | number;
433
436
  required?: boolean | undefined;
434
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
437
+ comparator?: import("..").WorkerLabelComparator | undefined;
435
438
  weight?: number | undefined;
436
439
  } | undefined> | undefined;
437
- backoff?: {
438
- factor?: number | undefined;
439
- maxSeconds?: number | undefined;
440
- } | undefined;
441
440
  }[];
441
+ id: string;
442
442
  version?: string | undefined;
443
443
  timeout?: string | undefined;
444
- sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
445
444
  scheduleTimeout?: string | undefined;
445
+ sticky?: PbStickyStrategy | "soft" | "hard" | undefined;
446
446
  on?: {
447
447
  cron: string;
448
448
  event?: undefined;
@@ -455,24 +455,24 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
455
455
  timeout?: string | undefined;
456
456
  parents?: string[] | undefined;
457
457
  retries?: number | undefined;
458
+ backoff?: {
459
+ factor?: number | undefined;
460
+ maxSeconds?: number | undefined;
461
+ } | undefined;
458
462
  rate_limits?: {
459
463
  units: string | number;
460
464
  key?: string | undefined;
461
465
  duration?: import("../protoc/workflows").RateLimitDuration | undefined;
466
+ limit?: string | number | undefined;
462
467
  staticKey?: string | undefined;
463
468
  dynamicKey?: string | undefined;
464
- limit?: string | number | undefined;
465
469
  }[] | undefined;
466
470
  worker_labels?: Record<string, string | number | {
467
471
  value: string | number;
468
472
  required?: boolean | undefined;
469
- comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
473
+ comparator?: import("..").WorkerLabelComparator | undefined;
470
474
  weight?: number | undefined;
471
475
  } | undefined> | undefined;
472
- backoff?: {
473
- factor?: number | undefined;
474
- maxSeconds?: number | undefined;
475
- } | undefined;
476
476
  } | undefined;
477
477
  }>;
478
478
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.15.2",
3
+ "version": "1.17.0",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -19,53 +19,44 @@
19
19
  "author": "",
20
20
  "license": "MIT",
21
21
  "devDependencies": {
22
- "@tsd/typescript": "^5.8.2",
22
+ "@eslint/js": "^10.0.1",
23
+ "@tsd/typescript": "^5.9.3",
23
24
  "@types/jest": "^29.5.14",
24
25
  "@types/node": "^22.13.14",
25
- "@typescript-eslint/eslint-plugin": "^7.0.0",
26
- "@typescript-eslint/parser": "^7.0.0",
27
- "autoprefixer": "^10.4.21",
26
+ "autoprefixer": "^10.4.27",
28
27
  "dotenv-cli": "^7.4.4",
29
- "eslint": "^8.56.0",
30
- "eslint-config-airbnb-typescript": "^18.0.0",
31
- "eslint-config-prettier": "^9.1.0",
32
- "eslint-config-standard": "^17.1.0",
28
+ "eslint": "^10.0.3",
29
+ "eslint-config-prettier": "^10.1.8",
33
30
  "eslint-import-resolver-typescript": "^3.10.0",
34
- "eslint-plugin-import": "^2.31.0",
35
- "eslint-plugin-jest": "^28.11.0",
36
- "eslint-plugin-n": "^16.6.2",
37
- "eslint-plugin-prettier": "^5.2.5",
38
- "eslint-plugin-promise": "^6.6.0",
39
- "eslint-plugin-react": "^7.37.4",
40
- "eslint-plugin-react-hooks": "^4.6.2",
41
- "eslint-plugin-react-refresh": "^0.4.19",
42
- "eslint-plugin-unused-imports": "^4.1.4",
43
- "grpc-tools": "^1.13.0",
31
+ "eslint-plugin-prettier": "^5.5.5",
32
+ "eslint-plugin-unused-imports": "^4.4.1",
33
+ "grpc-tools": "^1.13.1",
44
34
  "jest": "^29.7.0",
45
35
  "jest-tsd": "^0.2.2",
46
36
  "pino": "^9.12.0",
47
- "prettier": "^3.5.3",
37
+ "prettier": "^3.8.1",
48
38
  "resolve-tspaths": "^0.8.23",
49
- "ts-jest": "^29.3.1",
39
+ "ts-jest": "^29.4.6",
50
40
  "ts-node": "^10.9.2",
51
- "ts-proto": "^2.7.0",
41
+ "ts-proto": "^2.11.4",
52
42
  "typedoc": "^0.28.17",
53
- "typedoc-plugin-markdown": "^4.6.0",
43
+ "typedoc-plugin-markdown": "^4.10.0",
54
44
  "typedoc-plugin-no-inherit": "^1.6.1",
55
- "typescript": "^5.8.2"
45
+ "typescript": "^5.8.2",
46
+ "typescript-eslint": "^8.56.1"
56
47
  },
57
48
  "dependencies": {
58
- "@bufbuild/protobuf": "^2.2.5",
59
- "@types/qs": "^6.9.18",
49
+ "@bufbuild/protobuf": "^2.11.0",
50
+ "@types/qs": "^6.15.0",
60
51
  "abort-controller-x": "^0.4.3",
61
52
  "axios": "^1.13.5",
62
53
  "long": "^5.3.1",
63
- "nice-grpc": "^2.1.12",
54
+ "nice-grpc": "^2.1.14",
64
55
  "nice-grpc-common": "^2.0.2",
65
56
  "protobufjs": "^7.4.0",
66
57
  "qs": "^6.14.2",
67
- "semver": "^7.7.1",
68
- "yaml": "^2.7.1",
58
+ "semver": "^7.7.4",
59
+ "yaml": "^2.8.2",
69
60
  "zod": "^3.24.2",
70
61
  "zod-to-json-schema": "^3.24.1"
71
62
  },
@@ -176,6 +176,8 @@ export interface AssignedAction {
176
176
  workflowId?: string | undefined;
177
177
  /** (optional) the workflow version id */
178
178
  workflowVersionId?: string | undefined;
179
+ /** (optional) the invocation count for durable task events (required for durable events, otherwise null) */
180
+ durableTaskInvocationCount?: number | undefined;
179
181
  }
180
182
  export interface WorkerListenRequest {
181
183
  /** the id of the worker */
@@ -314,6 +316,12 @@ export interface ReleaseSlotRequest {
314
316
  }
315
317
  export interface ReleaseSlotResponse {
316
318
  }
319
+ export interface RestoreEvictedTaskRequest {
320
+ taskRunExternalId: string;
321
+ }
322
+ export interface RestoreEvictedTaskResponse {
323
+ requeued: boolean;
324
+ }
317
325
  export interface GetVersionRequest {
318
326
  }
319
327
  export interface GetVersionResponse {
@@ -348,6 +356,8 @@ export declare const RefreshTimeoutRequest: MessageFns<RefreshTimeoutRequest>;
348
356
  export declare const RefreshTimeoutResponse: MessageFns<RefreshTimeoutResponse>;
349
357
  export declare const ReleaseSlotRequest: MessageFns<ReleaseSlotRequest>;
350
358
  export declare const ReleaseSlotResponse: MessageFns<ReleaseSlotResponse>;
359
+ export declare const RestoreEvictedTaskRequest: MessageFns<RestoreEvictedTaskRequest>;
360
+ export declare const RestoreEvictedTaskResponse: MessageFns<RestoreEvictedTaskResponse>;
351
361
  export declare const GetVersionRequest: MessageFns<GetVersionRequest>;
352
362
  export declare const GetVersionResponse: MessageFns<GetVersionResponse>;
353
363
  export type DispatcherDefinition = typeof DispatcherDefinition;
@@ -456,6 +466,14 @@ export declare const DispatcherDefinition: {
456
466
  readonly responseStream: false;
457
467
  readonly options: {};
458
468
  };
469
+ readonly restoreEvictedTask: {
470
+ readonly name: "RestoreEvictedTask";
471
+ readonly requestType: MessageFns<RestoreEvictedTaskRequest>;
472
+ readonly requestStream: false;
473
+ readonly responseType: MessageFns<RestoreEvictedTaskResponse>;
474
+ readonly responseStream: false;
475
+ readonly options: {};
476
+ };
459
477
  readonly upsertWorkerLabels: {
460
478
  readonly name: "UpsertWorkerLabels";
461
479
  readonly requestType: MessageFns<UpsertWorkerLabelsRequest>;
@@ -497,6 +515,7 @@ export interface DispatcherServiceImplementation<CallContextExt = {}> {
497
515
  unsubscribe(request: WorkerUnsubscribeRequest, context: CallContext & CallContextExt): Promise<DeepPartial<WorkerUnsubscribeResponse>>;
498
516
  refreshTimeout(request: RefreshTimeoutRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RefreshTimeoutResponse>>;
499
517
  releaseSlot(request: ReleaseSlotRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ReleaseSlotResponse>>;
518
+ restoreEvictedTask(request: RestoreEvictedTaskRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RestoreEvictedTaskResponse>>;
500
519
  upsertWorkerLabels(request: UpsertWorkerLabelsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<UpsertWorkerLabelsResponse>>;
501
520
  /**
502
521
  * GetVersion returns the dispatcher protocol version as a simple integer.
@@ -523,6 +542,7 @@ export interface DispatcherClient<CallOptionsExt = {}> {
523
542
  unsubscribe(request: DeepPartial<WorkerUnsubscribeRequest>, options?: CallOptions & CallOptionsExt): Promise<WorkerUnsubscribeResponse>;
524
543
  refreshTimeout(request: DeepPartial<RefreshTimeoutRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimeoutResponse>;
525
544
  releaseSlot(request: DeepPartial<ReleaseSlotRequest>, options?: CallOptions & CallOptionsExt): Promise<ReleaseSlotResponse>;
545
+ restoreEvictedTask(request: DeepPartial<RestoreEvictedTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<RestoreEvictedTaskResponse>;
526
546
  upsertWorkerLabels(request: DeepPartial<UpsertWorkerLabelsRequest>, options?: CallOptions & CallOptionsExt): Promise<UpsertWorkerLabelsResponse>;
527
547
  /**
528
548
  * GetVersion returns the dispatcher protocol version as a simple integer.