@hatchet-dev/typescript-sdk 0.13.0 → 0.14.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/clients/event/event-client.d.ts +5 -0
- package/clients/event/event-client.js +31 -0
- package/clients/rest/generated/Api.d.ts +189 -19
- package/clients/rest/generated/Api.js +119 -10
- package/clients/rest/generated/data-contracts.d.ts +218 -12
- package/clients/rest/generated/data-contracts.js +39 -1
- package/clients/rest/generated/http-client.js +4 -1
- package/clients/worker/worker.js +4 -4
- package/examples/example-event.js +38 -0
- package/examples/fanout-worker.js +34 -13
- package/examples/rate-limit/worker.js +17 -2
- package/package.json +1 -1
- package/protoc/events/events.d.ts +18 -0
- package/protoc/events/events.js +121 -1
- package/protoc/workflows/workflows.d.ts +10 -2
- package/protoc/workflows/workflows.js +71 -6
- package/step.d.ts +50 -17
- package/step.js +72 -2
- package/util/workflow-run-ref.js +27 -4
- package/workflow.d.ts +114 -38
package/workflow.d.ts
CHANGED
|
@@ -7,14 +7,26 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
7
7
|
timeout: z.ZodOptional<z.ZodString>;
|
|
8
8
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
-
key: z.ZodString
|
|
11
|
-
|
|
10
|
+
key: z.ZodOptional<z.ZodString>;
|
|
11
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
12
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
13
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
15
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("./protoc/workflows").RateLimitDuration>>;
|
|
12
16
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
units: string | number;
|
|
18
|
+
key?: string | undefined;
|
|
19
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
20
|
+
limit?: string | number | undefined;
|
|
21
|
+
staticKey?: string | undefined;
|
|
22
|
+
dynamicKey?: string | undefined;
|
|
15
23
|
}, {
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
units: string | number;
|
|
25
|
+
key?: string | undefined;
|
|
26
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
27
|
+
limit?: string | number | undefined;
|
|
28
|
+
staticKey?: string | undefined;
|
|
29
|
+
dynamicKey?: string | undefined;
|
|
18
30
|
}>, "many">>;
|
|
19
31
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
20
32
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
@@ -38,8 +50,12 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
38
50
|
parents?: string[] | undefined;
|
|
39
51
|
retries?: number | undefined;
|
|
40
52
|
rate_limits?: {
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
units: string | number;
|
|
54
|
+
key?: string | undefined;
|
|
55
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
56
|
+
limit?: string | number | undefined;
|
|
57
|
+
staticKey?: string | undefined;
|
|
58
|
+
dynamicKey?: string | undefined;
|
|
43
59
|
}[] | undefined;
|
|
44
60
|
worker_labels?: Record<string, string | number | {
|
|
45
61
|
value: string | number;
|
|
@@ -53,8 +69,12 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
53
69
|
parents?: string[] | undefined;
|
|
54
70
|
retries?: number | undefined;
|
|
55
71
|
rate_limits?: {
|
|
56
|
-
|
|
57
|
-
|
|
72
|
+
units: string | number;
|
|
73
|
+
key?: string | undefined;
|
|
74
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
75
|
+
limit?: string | number | undefined;
|
|
76
|
+
staticKey?: string | undefined;
|
|
77
|
+
dynamicKey?: string | undefined;
|
|
58
78
|
}[] | undefined;
|
|
59
79
|
worker_labels?: Record<string, string | number | {
|
|
60
80
|
value: string | number;
|
|
@@ -121,14 +141,26 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
121
141
|
timeout: z.ZodOptional<z.ZodString>;
|
|
122
142
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
123
143
|
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
-
key: z.ZodString
|
|
125
|
-
|
|
144
|
+
key: z.ZodOptional<z.ZodString>;
|
|
145
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
146
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
147
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
148
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
149
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("./protoc/workflows").RateLimitDuration>>;
|
|
126
150
|
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
|
|
128
|
-
|
|
151
|
+
units: string | number;
|
|
152
|
+
key?: string | undefined;
|
|
153
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
154
|
+
limit?: string | number | undefined;
|
|
155
|
+
staticKey?: string | undefined;
|
|
156
|
+
dynamicKey?: string | undefined;
|
|
129
157
|
}, {
|
|
130
|
-
|
|
131
|
-
|
|
158
|
+
units: string | number;
|
|
159
|
+
key?: string | undefined;
|
|
160
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
161
|
+
limit?: string | number | undefined;
|
|
162
|
+
staticKey?: string | undefined;
|
|
163
|
+
dynamicKey?: string | undefined;
|
|
132
164
|
}>, "many">>;
|
|
133
165
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
134
166
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
@@ -152,8 +184,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
152
184
|
parents?: string[] | undefined;
|
|
153
185
|
retries?: number | undefined;
|
|
154
186
|
rate_limits?: {
|
|
155
|
-
|
|
156
|
-
|
|
187
|
+
units: string | number;
|
|
188
|
+
key?: string | undefined;
|
|
189
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
190
|
+
limit?: string | number | undefined;
|
|
191
|
+
staticKey?: string | undefined;
|
|
192
|
+
dynamicKey?: string | undefined;
|
|
157
193
|
}[] | undefined;
|
|
158
194
|
worker_labels?: Record<string, string | number | {
|
|
159
195
|
value: string | number;
|
|
@@ -167,8 +203,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
167
203
|
parents?: string[] | undefined;
|
|
168
204
|
retries?: number | undefined;
|
|
169
205
|
rate_limits?: {
|
|
170
|
-
|
|
171
|
-
|
|
206
|
+
units: string | number;
|
|
207
|
+
key?: string | undefined;
|
|
208
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
209
|
+
limit?: string | number | undefined;
|
|
210
|
+
staticKey?: string | undefined;
|
|
211
|
+
dynamicKey?: string | undefined;
|
|
172
212
|
}[] | undefined;
|
|
173
213
|
worker_labels?: Record<string, string | number | {
|
|
174
214
|
value: string | number;
|
|
@@ -183,14 +223,26 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
183
223
|
timeout: z.ZodOptional<z.ZodString>;
|
|
184
224
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
185
225
|
rate_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
186
|
-
key: z.ZodString
|
|
187
|
-
|
|
226
|
+
key: z.ZodOptional<z.ZodString>;
|
|
227
|
+
staticKey: z.ZodOptional<z.ZodString>;
|
|
228
|
+
dynamicKey: z.ZodOptional<z.ZodString>;
|
|
229
|
+
units: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
230
|
+
limit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
231
|
+
duration: z.ZodOptional<z.ZodNativeEnum<typeof import("./protoc/workflows").RateLimitDuration>>;
|
|
188
232
|
}, "strip", z.ZodTypeAny, {
|
|
189
|
-
|
|
190
|
-
|
|
233
|
+
units: string | number;
|
|
234
|
+
key?: string | undefined;
|
|
235
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
236
|
+
limit?: string | number | undefined;
|
|
237
|
+
staticKey?: string | undefined;
|
|
238
|
+
dynamicKey?: string | undefined;
|
|
191
239
|
}, {
|
|
192
|
-
|
|
193
|
-
|
|
240
|
+
units: string | number;
|
|
241
|
+
key?: string | undefined;
|
|
242
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
243
|
+
limit?: string | number | undefined;
|
|
244
|
+
staticKey?: string | undefined;
|
|
245
|
+
dynamicKey?: string | undefined;
|
|
194
246
|
}>, "many">>;
|
|
195
247
|
worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
196
248
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
@@ -214,8 +266,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
214
266
|
parents?: string[] | undefined;
|
|
215
267
|
retries?: number | undefined;
|
|
216
268
|
rate_limits?: {
|
|
217
|
-
|
|
218
|
-
|
|
269
|
+
units: string | number;
|
|
270
|
+
key?: string | undefined;
|
|
271
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
272
|
+
limit?: string | number | undefined;
|
|
273
|
+
staticKey?: string | undefined;
|
|
274
|
+
dynamicKey?: string | undefined;
|
|
219
275
|
}[] | undefined;
|
|
220
276
|
worker_labels?: Record<string, string | number | {
|
|
221
277
|
value: string | number;
|
|
@@ -229,8 +285,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
229
285
|
parents?: string[] | undefined;
|
|
230
286
|
retries?: number | undefined;
|
|
231
287
|
rate_limits?: {
|
|
232
|
-
|
|
233
|
-
|
|
288
|
+
units: string | number;
|
|
289
|
+
key?: string | undefined;
|
|
290
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
291
|
+
limit?: string | number | undefined;
|
|
292
|
+
staticKey?: string | undefined;
|
|
293
|
+
dynamicKey?: string | undefined;
|
|
234
294
|
}[] | undefined;
|
|
235
295
|
worker_labels?: Record<string, string | number | {
|
|
236
296
|
value: string | number;
|
|
@@ -247,8 +307,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
247
307
|
parents?: string[] | undefined;
|
|
248
308
|
retries?: number | undefined;
|
|
249
309
|
rate_limits?: {
|
|
250
|
-
|
|
251
|
-
|
|
310
|
+
units: string | number;
|
|
311
|
+
key?: string | undefined;
|
|
312
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
313
|
+
limit?: string | number | undefined;
|
|
314
|
+
staticKey?: string | undefined;
|
|
315
|
+
dynamicKey?: string | undefined;
|
|
252
316
|
}[] | undefined;
|
|
253
317
|
worker_labels?: Record<string, string | number | {
|
|
254
318
|
value: string | number;
|
|
@@ -275,8 +339,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
275
339
|
parents?: string[] | undefined;
|
|
276
340
|
retries?: number | undefined;
|
|
277
341
|
rate_limits?: {
|
|
278
|
-
|
|
279
|
-
|
|
342
|
+
units: string | number;
|
|
343
|
+
key?: string | undefined;
|
|
344
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
345
|
+
limit?: string | number | undefined;
|
|
346
|
+
staticKey?: string | undefined;
|
|
347
|
+
dynamicKey?: string | undefined;
|
|
280
348
|
}[] | undefined;
|
|
281
349
|
worker_labels?: Record<string, string | number | {
|
|
282
350
|
value: string | number;
|
|
@@ -293,8 +361,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
293
361
|
parents?: string[] | undefined;
|
|
294
362
|
retries?: number | undefined;
|
|
295
363
|
rate_limits?: {
|
|
296
|
-
|
|
297
|
-
|
|
364
|
+
units: string | number;
|
|
365
|
+
key?: string | undefined;
|
|
366
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
367
|
+
limit?: string | number | undefined;
|
|
368
|
+
staticKey?: string | undefined;
|
|
369
|
+
dynamicKey?: string | undefined;
|
|
298
370
|
}[] | undefined;
|
|
299
371
|
worker_labels?: Record<string, string | number | {
|
|
300
372
|
value: string | number;
|
|
@@ -321,8 +393,12 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
321
393
|
parents?: string[] | undefined;
|
|
322
394
|
retries?: number | undefined;
|
|
323
395
|
rate_limits?: {
|
|
324
|
-
|
|
325
|
-
|
|
396
|
+
units: string | number;
|
|
397
|
+
key?: string | undefined;
|
|
398
|
+
duration?: import("./protoc/workflows").RateLimitDuration | undefined;
|
|
399
|
+
limit?: string | number | undefined;
|
|
400
|
+
staticKey?: string | undefined;
|
|
401
|
+
dynamicKey?: string | undefined;
|
|
326
402
|
}[] | undefined;
|
|
327
403
|
worker_labels?: Record<string, string | number | {
|
|
328
404
|
value: string | number;
|