@blokjs/helper 0.4.0 → 0.6.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/dist/components/AddElse.d.ts +0 -5
- package/dist/components/AddIf.d.ts +0 -5
- package/dist/components/StepNode.js +0 -1
- package/dist/components/StepNode.js.map +1 -1
- package/dist/components/forEach.d.ts +53 -0
- package/dist/components/forEach.js +64 -0
- package/dist/components/forEach.js.map +1 -0
- package/dist/components/loop.d.ts +52 -0
- package/dist/components/loop.js +54 -0
- package/dist/components/loop.js.map +1 -0
- package/dist/components/switchOn.d.ts +68 -0
- package/dist/components/switchOn.js +76 -0
- package/dist/components/switchOn.js.map +1 -0
- package/dist/components/tryCatch.d.ts +63 -0
- package/dist/components/tryCatch.js +68 -0
- package/dist/components/tryCatch.js.map +1 -0
- package/dist/components/workflowV2.d.ts +1 -1
- package/dist/components/workflowV2.js +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/proxy/$.d.ts +7 -0
- package/dist/proxy/$.js.map +1 -1
- package/dist/types/StepOpts.d.ts +301 -34
- package/dist/types/StepOpts.js +262 -16
- package/dist/types/StepOpts.js.map +1 -1
- package/dist/types/TriggerOpts.d.ts +419 -31
- package/dist/types/TriggerOpts.js +206 -10
- package/dist/types/TriggerOpts.js.map +1 -1
- package/dist/types/WorkflowOpts.d.ts +186 -20
- package/dist/types/WorkflowOpts.js +12 -1
- package/dist/types/WorkflowOpts.js.map +1 -1
- package/dist/workflow.schema.json +243 -7
- package/package.json +1 -1
|
@@ -20,7 +20,6 @@ export declare const WorkflowOptsSchema: z.ZodObject<{
|
|
|
20
20
|
type: z.ZodEnum<["local", "module", "runtime.python3", "runtime.nodejs", "runtime.bun", "runtime.go", "runtime.java", "runtime.rust", "runtime.php", "runtime.csharp", "runtime.ruby", "runtime.docker", "runtime.wasm"]>;
|
|
21
21
|
inputs: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
22
22
|
runtime: z.ZodOptional<z.ZodEnum<["nodejs", "bun", "python3", "go", "java", "rust", "php", "csharp", "ruby", "docker", "wasm"]>>;
|
|
23
|
-
set_var: z.ZodOptional<z.ZodBoolean>;
|
|
24
23
|
active: z.ZodOptional<z.ZodBoolean>;
|
|
25
24
|
stop: z.ZodOptional<z.ZodBoolean>;
|
|
26
25
|
stream_logs: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -30,7 +29,6 @@ export declare const WorkflowOptsSchema: z.ZodObject<{
|
|
|
30
29
|
type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
|
|
31
30
|
inputs?: {} | undefined;
|
|
32
31
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
33
|
-
set_var?: boolean | undefined;
|
|
34
32
|
active?: boolean | undefined;
|
|
35
33
|
stop?: boolean | undefined;
|
|
36
34
|
stream_logs?: boolean | undefined;
|
|
@@ -40,7 +38,6 @@ export declare const WorkflowOptsSchema: z.ZodObject<{
|
|
|
40
38
|
type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
|
|
41
39
|
inputs?: {} | undefined;
|
|
42
40
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
43
|
-
set_var?: boolean | undefined;
|
|
44
41
|
active?: boolean | undefined;
|
|
45
42
|
stop?: boolean | undefined;
|
|
46
43
|
stream_logs?: boolean | undefined;
|
|
@@ -56,7 +53,6 @@ export declare const WorkflowOptsSchema: z.ZodObject<{
|
|
|
56
53
|
type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
|
|
57
54
|
inputs?: {} | undefined;
|
|
58
55
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
59
|
-
set_var?: boolean | undefined;
|
|
60
56
|
active?: boolean | undefined;
|
|
61
57
|
stop?: boolean | undefined;
|
|
62
58
|
stream_logs?: boolean | undefined;
|
|
@@ -73,7 +69,6 @@ export declare const WorkflowOptsSchema: z.ZodObject<{
|
|
|
73
69
|
type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
|
|
74
70
|
inputs?: {} | undefined;
|
|
75
71
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
76
|
-
set_var?: boolean | undefined;
|
|
77
72
|
active?: boolean | undefined;
|
|
78
73
|
stop?: boolean | undefined;
|
|
79
74
|
stream_logs?: boolean | undefined;
|
|
@@ -109,21 +104,21 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
109
104
|
name: z.ZodString;
|
|
110
105
|
version: z.ZodString;
|
|
111
106
|
description: z.ZodOptional<z.ZodString>;
|
|
112
|
-
trigger: z.ZodRecord<z.ZodEnum<["http", "grpc", "manual", "cron", "queue", "pubsub", "worker", "webhook", "sse", "websocket"]>, z.ZodUnknown
|
|
107
|
+
trigger: z.ZodOptional<z.ZodRecord<z.ZodEnum<["http", "grpc", "manual", "cron", "queue", "pubsub", "worker", "webhook", "sse", "websocket"]>, z.ZodUnknown>>;
|
|
108
|
+
middleware: z.ZodOptional<z.ZodLiteral<true>>;
|
|
113
109
|
steps: z.ZodArray<z.ZodType<{
|
|
114
110
|
id: string;
|
|
115
111
|
use: string;
|
|
116
112
|
type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
|
|
117
113
|
inputs?: Record<string, unknown> | undefined;
|
|
118
114
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
119
|
-
set_var?: boolean | undefined;
|
|
120
115
|
active?: boolean | undefined;
|
|
121
116
|
stop?: boolean | undefined;
|
|
122
117
|
stream_logs?: boolean | undefined;
|
|
118
|
+
idempotencyKey?: string | undefined;
|
|
123
119
|
as?: string | undefined;
|
|
124
120
|
spread?: boolean | undefined;
|
|
125
121
|
ephemeral?: boolean | undefined;
|
|
126
|
-
idempotencyKey?: string | undefined;
|
|
127
122
|
idempotencyKeyTTL?: number | undefined;
|
|
128
123
|
retry?: {
|
|
129
124
|
maxAttempts: number;
|
|
@@ -154,6 +149,8 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
154
149
|
idempotencyKey?: string;
|
|
155
150
|
idempotencyKeyTTL?: number;
|
|
156
151
|
retry?: import("./StepOpts").RetryConfig;
|
|
152
|
+
allowList?: readonly string[];
|
|
153
|
+
dispatch?: "in-process" | "http-self";
|
|
157
154
|
} | {
|
|
158
155
|
id: string;
|
|
159
156
|
wait: {
|
|
@@ -163,26 +160,66 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
163
160
|
active?: boolean | undefined;
|
|
164
161
|
stop?: boolean | undefined;
|
|
165
162
|
concurrencyKey?: undefined;
|
|
163
|
+
idempotencyKey?: undefined;
|
|
166
164
|
as?: string | undefined;
|
|
167
165
|
spread?: undefined;
|
|
168
166
|
ephemeral?: boolean | undefined;
|
|
169
|
-
idempotencyKey?: undefined;
|
|
170
167
|
retry?: undefined;
|
|
171
168
|
maxDuration?: undefined;
|
|
169
|
+
} | {
|
|
170
|
+
forEach: {
|
|
171
|
+
as: string;
|
|
172
|
+
do: unknown[];
|
|
173
|
+
mode?: "sequential" | "parallel" | undefined;
|
|
174
|
+
concurrency?: number | undefined;
|
|
175
|
+
in?: unknown;
|
|
176
|
+
};
|
|
177
|
+
id: string;
|
|
178
|
+
active?: boolean | undefined;
|
|
179
|
+
stop?: boolean | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
id: string;
|
|
182
|
+
loop: {
|
|
183
|
+
do: unknown[];
|
|
184
|
+
while: string;
|
|
185
|
+
maxIterations?: number | undefined;
|
|
186
|
+
};
|
|
187
|
+
active?: boolean | undefined;
|
|
188
|
+
stop?: boolean | undefined;
|
|
189
|
+
} | {
|
|
190
|
+
id: string;
|
|
191
|
+
switch: {
|
|
192
|
+
cases: {
|
|
193
|
+
do: unknown[];
|
|
194
|
+
when?: unknown;
|
|
195
|
+
}[];
|
|
196
|
+
on?: unknown;
|
|
197
|
+
default?: unknown[] | undefined;
|
|
198
|
+
};
|
|
199
|
+
active?: boolean | undefined;
|
|
200
|
+
stop?: boolean | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
id: string;
|
|
203
|
+
tryCatch: {
|
|
204
|
+
try: unknown[];
|
|
205
|
+
catch: unknown[];
|
|
206
|
+
finally?: unknown[] | undefined;
|
|
207
|
+
};
|
|
208
|
+
active?: boolean | undefined;
|
|
209
|
+
stop?: boolean | undefined;
|
|
172
210
|
}, z.ZodTypeDef, {
|
|
173
211
|
id: string;
|
|
174
212
|
use: string;
|
|
175
213
|
type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
|
|
176
214
|
inputs?: Record<string, unknown> | undefined;
|
|
177
215
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
178
|
-
set_var?: boolean | undefined;
|
|
179
216
|
active?: boolean | undefined;
|
|
180
217
|
stop?: boolean | undefined;
|
|
181
218
|
stream_logs?: boolean | undefined;
|
|
219
|
+
idempotencyKey?: string | undefined;
|
|
182
220
|
as?: string | undefined;
|
|
183
221
|
spread?: boolean | undefined;
|
|
184
222
|
ephemeral?: boolean | undefined;
|
|
185
|
-
idempotencyKey?: string | undefined;
|
|
186
223
|
idempotencyKeyTTL?: number | undefined;
|
|
187
224
|
retry?: {
|
|
188
225
|
maxAttempts: number;
|
|
@@ -213,6 +250,8 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
213
250
|
idempotencyKey?: string;
|
|
214
251
|
idempotencyKeyTTL?: number;
|
|
215
252
|
retry?: import("./StepOpts").RetryConfig;
|
|
253
|
+
allowList?: readonly string[];
|
|
254
|
+
dispatch?: "in-process" | "http-self";
|
|
216
255
|
} | {
|
|
217
256
|
id: string;
|
|
218
257
|
wait: {
|
|
@@ -222,12 +261,53 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
222
261
|
active?: boolean | undefined;
|
|
223
262
|
stop?: boolean | undefined;
|
|
224
263
|
concurrencyKey?: undefined;
|
|
264
|
+
idempotencyKey?: undefined;
|
|
225
265
|
as?: string | undefined;
|
|
226
266
|
spread?: undefined;
|
|
227
267
|
ephemeral?: boolean | undefined;
|
|
228
|
-
idempotencyKey?: undefined;
|
|
229
268
|
retry?: undefined;
|
|
230
269
|
maxDuration?: undefined;
|
|
270
|
+
} | {
|
|
271
|
+
forEach: {
|
|
272
|
+
as: string;
|
|
273
|
+
do: unknown[];
|
|
274
|
+
mode?: "sequential" | "parallel" | undefined;
|
|
275
|
+
concurrency?: number | undefined;
|
|
276
|
+
in?: unknown;
|
|
277
|
+
};
|
|
278
|
+
id: string;
|
|
279
|
+
active?: boolean | undefined;
|
|
280
|
+
stop?: boolean | undefined;
|
|
281
|
+
} | {
|
|
282
|
+
id: string;
|
|
283
|
+
loop: {
|
|
284
|
+
do: unknown[];
|
|
285
|
+
while: string;
|
|
286
|
+
maxIterations?: number | undefined;
|
|
287
|
+
};
|
|
288
|
+
active?: boolean | undefined;
|
|
289
|
+
stop?: boolean | undefined;
|
|
290
|
+
} | {
|
|
291
|
+
id: string;
|
|
292
|
+
switch: {
|
|
293
|
+
cases: {
|
|
294
|
+
do: unknown[];
|
|
295
|
+
when?: unknown;
|
|
296
|
+
}[];
|
|
297
|
+
on?: unknown;
|
|
298
|
+
default?: unknown[] | undefined;
|
|
299
|
+
};
|
|
300
|
+
active?: boolean | undefined;
|
|
301
|
+
stop?: boolean | undefined;
|
|
302
|
+
} | {
|
|
303
|
+
id: string;
|
|
304
|
+
tryCatch: {
|
|
305
|
+
try: unknown[];
|
|
306
|
+
catch: unknown[];
|
|
307
|
+
finally?: unknown[] | undefined;
|
|
308
|
+
};
|
|
309
|
+
active?: boolean | undefined;
|
|
310
|
+
stop?: boolean | undefined;
|
|
231
311
|
}>, "many">;
|
|
232
312
|
}, "strip", z.ZodTypeAny, {
|
|
233
313
|
name: string;
|
|
@@ -237,14 +317,13 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
237
317
|
type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
|
|
238
318
|
inputs?: Record<string, unknown> | undefined;
|
|
239
319
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
240
|
-
set_var?: boolean | undefined;
|
|
241
320
|
active?: boolean | undefined;
|
|
242
321
|
stop?: boolean | undefined;
|
|
243
322
|
stream_logs?: boolean | undefined;
|
|
323
|
+
idempotencyKey?: string | undefined;
|
|
244
324
|
as?: string | undefined;
|
|
245
325
|
spread?: boolean | undefined;
|
|
246
326
|
ephemeral?: boolean | undefined;
|
|
247
|
-
idempotencyKey?: string | undefined;
|
|
248
327
|
idempotencyKeyTTL?: number | undefined;
|
|
249
328
|
retry?: {
|
|
250
329
|
maxAttempts: number;
|
|
@@ -275,6 +354,8 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
275
354
|
idempotencyKey?: string;
|
|
276
355
|
idempotencyKeyTTL?: number;
|
|
277
356
|
retry?: import("./StepOpts").RetryConfig;
|
|
357
|
+
allowList?: readonly string[];
|
|
358
|
+
dispatch?: "in-process" | "http-self";
|
|
278
359
|
} | {
|
|
279
360
|
id: string;
|
|
280
361
|
wait: {
|
|
@@ -284,16 +365,58 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
284
365
|
active?: boolean | undefined;
|
|
285
366
|
stop?: boolean | undefined;
|
|
286
367
|
concurrencyKey?: undefined;
|
|
368
|
+
idempotencyKey?: undefined;
|
|
287
369
|
as?: string | undefined;
|
|
288
370
|
spread?: undefined;
|
|
289
371
|
ephemeral?: boolean | undefined;
|
|
290
|
-
idempotencyKey?: undefined;
|
|
291
372
|
retry?: undefined;
|
|
292
373
|
maxDuration?: undefined;
|
|
374
|
+
} | {
|
|
375
|
+
forEach: {
|
|
376
|
+
as: string;
|
|
377
|
+
do: unknown[];
|
|
378
|
+
mode?: "sequential" | "parallel" | undefined;
|
|
379
|
+
concurrency?: number | undefined;
|
|
380
|
+
in?: unknown;
|
|
381
|
+
};
|
|
382
|
+
id: string;
|
|
383
|
+
active?: boolean | undefined;
|
|
384
|
+
stop?: boolean | undefined;
|
|
385
|
+
} | {
|
|
386
|
+
id: string;
|
|
387
|
+
loop: {
|
|
388
|
+
do: unknown[];
|
|
389
|
+
while: string;
|
|
390
|
+
maxIterations?: number | undefined;
|
|
391
|
+
};
|
|
392
|
+
active?: boolean | undefined;
|
|
393
|
+
stop?: boolean | undefined;
|
|
394
|
+
} | {
|
|
395
|
+
id: string;
|
|
396
|
+
switch: {
|
|
397
|
+
cases: {
|
|
398
|
+
do: unknown[];
|
|
399
|
+
when?: unknown;
|
|
400
|
+
}[];
|
|
401
|
+
on?: unknown;
|
|
402
|
+
default?: unknown[] | undefined;
|
|
403
|
+
};
|
|
404
|
+
active?: boolean | undefined;
|
|
405
|
+
stop?: boolean | undefined;
|
|
406
|
+
} | {
|
|
407
|
+
id: string;
|
|
408
|
+
tryCatch: {
|
|
409
|
+
try: unknown[];
|
|
410
|
+
catch: unknown[];
|
|
411
|
+
finally?: unknown[] | undefined;
|
|
412
|
+
};
|
|
413
|
+
active?: boolean | undefined;
|
|
414
|
+
stop?: boolean | undefined;
|
|
293
415
|
})[];
|
|
294
416
|
version: string;
|
|
295
|
-
|
|
417
|
+
middleware?: true | undefined;
|
|
296
418
|
description?: string | undefined;
|
|
419
|
+
trigger?: Partial<Record<"queue" | "http" | "worker" | "grpc" | "manual" | "cron" | "pubsub" | "webhook" | "sse" | "websocket", unknown>> | undefined;
|
|
297
420
|
}, {
|
|
298
421
|
name: string;
|
|
299
422
|
steps: ({
|
|
@@ -302,14 +425,13 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
302
425
|
type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
|
|
303
426
|
inputs?: Record<string, unknown> | undefined;
|
|
304
427
|
runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
|
|
305
|
-
set_var?: boolean | undefined;
|
|
306
428
|
active?: boolean | undefined;
|
|
307
429
|
stop?: boolean | undefined;
|
|
308
430
|
stream_logs?: boolean | undefined;
|
|
431
|
+
idempotencyKey?: string | undefined;
|
|
309
432
|
as?: string | undefined;
|
|
310
433
|
spread?: boolean | undefined;
|
|
311
434
|
ephemeral?: boolean | undefined;
|
|
312
|
-
idempotencyKey?: string | undefined;
|
|
313
435
|
idempotencyKeyTTL?: number | undefined;
|
|
314
436
|
retry?: {
|
|
315
437
|
maxAttempts: number;
|
|
@@ -340,6 +462,8 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
340
462
|
idempotencyKey?: string;
|
|
341
463
|
idempotencyKeyTTL?: number;
|
|
342
464
|
retry?: import("./StepOpts").RetryConfig;
|
|
465
|
+
allowList?: readonly string[];
|
|
466
|
+
dispatch?: "in-process" | "http-self";
|
|
343
467
|
} | {
|
|
344
468
|
id: string;
|
|
345
469
|
wait: {
|
|
@@ -349,15 +473,57 @@ export declare const WorkflowV2Schema: z.ZodObject<{
|
|
|
349
473
|
active?: boolean | undefined;
|
|
350
474
|
stop?: boolean | undefined;
|
|
351
475
|
concurrencyKey?: undefined;
|
|
476
|
+
idempotencyKey?: undefined;
|
|
352
477
|
as?: string | undefined;
|
|
353
478
|
spread?: undefined;
|
|
354
479
|
ephemeral?: boolean | undefined;
|
|
355
|
-
idempotencyKey?: undefined;
|
|
356
480
|
retry?: undefined;
|
|
357
481
|
maxDuration?: undefined;
|
|
482
|
+
} | {
|
|
483
|
+
forEach: {
|
|
484
|
+
as: string;
|
|
485
|
+
do: unknown[];
|
|
486
|
+
mode?: "sequential" | "parallel" | undefined;
|
|
487
|
+
concurrency?: number | undefined;
|
|
488
|
+
in?: unknown;
|
|
489
|
+
};
|
|
490
|
+
id: string;
|
|
491
|
+
active?: boolean | undefined;
|
|
492
|
+
stop?: boolean | undefined;
|
|
493
|
+
} | {
|
|
494
|
+
id: string;
|
|
495
|
+
loop: {
|
|
496
|
+
do: unknown[];
|
|
497
|
+
while: string;
|
|
498
|
+
maxIterations?: number | undefined;
|
|
499
|
+
};
|
|
500
|
+
active?: boolean | undefined;
|
|
501
|
+
stop?: boolean | undefined;
|
|
502
|
+
} | {
|
|
503
|
+
id: string;
|
|
504
|
+
switch: {
|
|
505
|
+
cases: {
|
|
506
|
+
do: unknown[];
|
|
507
|
+
when?: unknown;
|
|
508
|
+
}[];
|
|
509
|
+
on?: unknown;
|
|
510
|
+
default?: unknown[] | undefined;
|
|
511
|
+
};
|
|
512
|
+
active?: boolean | undefined;
|
|
513
|
+
stop?: boolean | undefined;
|
|
514
|
+
} | {
|
|
515
|
+
id: string;
|
|
516
|
+
tryCatch: {
|
|
517
|
+
try: unknown[];
|
|
518
|
+
catch: unknown[];
|
|
519
|
+
finally?: unknown[] | undefined;
|
|
520
|
+
};
|
|
521
|
+
active?: boolean | undefined;
|
|
522
|
+
stop?: boolean | undefined;
|
|
358
523
|
})[];
|
|
359
524
|
version: string;
|
|
360
|
-
|
|
525
|
+
middleware?: true | undefined;
|
|
361
526
|
description?: string | undefined;
|
|
527
|
+
trigger?: Partial<Record<"queue" | "http" | "worker" | "grpc" | "manual" | "cron" | "pubsub" | "webhook" | "sse" | "websocket", unknown>> | undefined;
|
|
362
528
|
}>;
|
|
363
529
|
export type WorkflowV2 = z.infer<typeof WorkflowV2Schema>;
|
|
@@ -67,8 +67,19 @@ export const WorkflowV2Schema = z.object({
|
|
|
67
67
|
.describe("What this workflow does. Optional but recommended — surfaces in Studio and CLI."),
|
|
68
68
|
trigger: z
|
|
69
69
|
.record(TriggersSchema, z.unknown())
|
|
70
|
+
.optional()
|
|
70
71
|
.describe("Trigger configuration. Most workflows use { http: { method: 'GET' } }. " +
|
|
71
|
-
"
|
|
72
|
+
"Optional ONLY when `middleware: true` is set — middleware-only workflows " +
|
|
73
|
+
"are invoked from another workflow's `trigger.http.middleware: [...]` array " +
|
|
74
|
+
"and don't have a public route of their own. See TRIGGER_SCHEMAS for per-kind shapes."),
|
|
75
|
+
middleware: z
|
|
76
|
+
.literal(true)
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("v0.5 — when true, this workflow is registered as middleware and is NOT exposed as a " +
|
|
79
|
+
"public HTTP route. It's invoked by another workflow that lists this one's `name` in " +
|
|
80
|
+
"its `trigger.http.middleware: [...]` array. Middleware runs on the parent ctx (state " +
|
|
81
|
+
"mutations carry forward) and can short-circuit by setting `ctx.response` and using a " +
|
|
82
|
+
"step with `stop: true`. Middleware-only workflows MAY omit `trigger`."),
|
|
72
83
|
steps: z.array(V2StepSchema).min(1).describe("Pipeline of steps to execute in order. At least one step required."),
|
|
73
84
|
});
|
|
74
85
|
//# sourceMappingURL=WorkflowOpts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowOpts.js","sourceRoot":"","sources":["../../src/types/WorkflowOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC;SACL,MAAM,CAAC;QACP,cAAc,EAAE,kBAAkB;QAClC,kBAAkB,EAAE,uBAAuB;KAC3C,CAAC;SACD,GAAG,CAAC,CAAC,CAAC;IACR,OAAO,EAAE,CAAC;SACR,MAAM,CAAC;QACP,cAAc,EAAE,qBAAqB;QACrC,kBAAkB,EAAE,0BAA0B;KAC9C,CAAC;SACD,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;IAC9C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC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