@workflow/world-testing 4.0.1-beta.47 → 4.0.1-beta.49
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.
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"steps": {
|
|
4
|
-
"workflow/dist/internal/builtins.js": {
|
|
5
|
-
"__builtin_response_array_buffer": {
|
|
6
|
-
"stepId": "__builtin_response_array_buffer"
|
|
7
|
-
},
|
|
8
|
-
"__builtin_response_json": {
|
|
9
|
-
"stepId": "__builtin_response_json"
|
|
10
|
-
},
|
|
11
|
-
"__builtin_response_text": {
|
|
12
|
-
"stepId": "__builtin_response_text"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
4
|
"workflows/noop.ts": {
|
|
16
5
|
"noop": {
|
|
17
6
|
"stepId": "step//workflows/noop.ts//noop"
|
|
18
7
|
}
|
|
19
8
|
},
|
|
9
|
+
"workflows/retriable-and-fatal.ts": {
|
|
10
|
+
"stepThatFails": {
|
|
11
|
+
"stepId": "step//workflows/retriable-and-fatal.ts//stepThatFails"
|
|
12
|
+
},
|
|
13
|
+
"stepThatThrowsRetryableError": {
|
|
14
|
+
"stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
20
17
|
"workflow/dist/stdlib.js": {
|
|
21
18
|
"fetch": {
|
|
22
19
|
"stepId": "step//workflow/dist/stdlib.js//fetch"
|
|
@@ -27,22 +24,25 @@
|
|
|
27
24
|
"stepId": "step//workflows/null-byte.ts//nullByteStep"
|
|
28
25
|
}
|
|
29
26
|
},
|
|
30
|
-
"workflows/
|
|
31
|
-
"
|
|
32
|
-
"stepId": "step//workflows/
|
|
27
|
+
"workflows/hooks.ts": {
|
|
28
|
+
"writeEvent": {
|
|
29
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
33
30
|
}
|
|
34
31
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"stepId": "
|
|
32
|
+
"workflow/dist/internal/builtins.js": {
|
|
33
|
+
"__builtin_response_array_buffer": {
|
|
34
|
+
"stepId": "__builtin_response_array_buffer"
|
|
38
35
|
},
|
|
39
|
-
"
|
|
40
|
-
"stepId": "
|
|
36
|
+
"__builtin_response_json": {
|
|
37
|
+
"stepId": "__builtin_response_json"
|
|
38
|
+
},
|
|
39
|
+
"__builtin_response_text": {
|
|
40
|
+
"stepId": "__builtin_response_text"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"workflows/
|
|
44
|
-
"
|
|
45
|
-
"stepId": "step//workflows/
|
|
43
|
+
"workflows/addition.ts": {
|
|
44
|
+
"add": {
|
|
45
|
+
"stepId": "step//workflows/addition.ts//add"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
},
|
|
@@ -110,16 +110,16 @@
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"workflows/
|
|
114
|
-
"
|
|
115
|
-
"workflowId": "workflow//workflows/
|
|
113
|
+
"workflows/retriable-and-fatal.ts": {
|
|
114
|
+
"retryableAndFatalErrorWorkflow": {
|
|
115
|
+
"workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow",
|
|
116
116
|
"graph": {
|
|
117
117
|
"nodes": [
|
|
118
118
|
{
|
|
119
119
|
"id": "start",
|
|
120
120
|
"type": "workflowStart",
|
|
121
121
|
"data": {
|
|
122
|
-
"label": "Start:
|
|
122
|
+
"label": "Start: retryableAndFatalErrorWorkflow",
|
|
123
123
|
"nodeKind": "workflow_start"
|
|
124
124
|
}
|
|
125
125
|
},
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"id": "node_0",
|
|
128
128
|
"type": "step",
|
|
129
129
|
"data": {
|
|
130
|
-
"label": "
|
|
130
|
+
"label": "stepThatThrowsRetryableError",
|
|
131
131
|
"nodeKind": "step",
|
|
132
|
-
"stepId": "step//workflows/
|
|
132
|
+
"stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
{
|
|
@@ -158,16 +158,16 @@
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
|
-
"workflows/
|
|
162
|
-
"
|
|
163
|
-
"workflowId": "workflow//workflows/
|
|
161
|
+
"workflows/null-byte.ts": {
|
|
162
|
+
"nullByteWorkflow": {
|
|
163
|
+
"workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
|
|
164
164
|
"graph": {
|
|
165
165
|
"nodes": [
|
|
166
166
|
{
|
|
167
167
|
"id": "start",
|
|
168
168
|
"type": "workflowStart",
|
|
169
169
|
"data": {
|
|
170
|
-
"label": "Start:
|
|
170
|
+
"label": "Start: nullByteWorkflow",
|
|
171
171
|
"nodeKind": "workflow_start"
|
|
172
172
|
}
|
|
173
173
|
},
|
|
@@ -175,9 +175,9 @@
|
|
|
175
175
|
"id": "node_0",
|
|
176
176
|
"type": "step",
|
|
177
177
|
"data": {
|
|
178
|
-
"label": "
|
|
178
|
+
"label": "nullByteStep",
|
|
179
179
|
"nodeKind": "step",
|
|
180
|
-
"stepId": "step//workflows/
|
|
180
|
+
"stepId": "step//workflows/null-byte.ts//nullByteStep"
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -206,16 +206,16 @@
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
-
"workflows/
|
|
210
|
-
"
|
|
211
|
-
"workflowId": "workflow//workflows/
|
|
209
|
+
"workflows/hooks.ts": {
|
|
210
|
+
"collectWithHook": {
|
|
211
|
+
"workflowId": "workflow//workflows/hooks.ts//collectWithHook",
|
|
212
212
|
"graph": {
|
|
213
213
|
"nodes": [
|
|
214
214
|
{
|
|
215
215
|
"id": "start",
|
|
216
216
|
"type": "workflowStart",
|
|
217
217
|
"data": {
|
|
218
|
-
"label": "Start:
|
|
218
|
+
"label": "Start: collectWithHook",
|
|
219
219
|
"nodeKind": "workflow_start"
|
|
220
220
|
}
|
|
221
221
|
},
|
|
@@ -223,9 +223,22 @@
|
|
|
223
223
|
"id": "node_0",
|
|
224
224
|
"type": "step",
|
|
225
225
|
"data": {
|
|
226
|
-
"label": "
|
|
226
|
+
"label": "writeEvent",
|
|
227
227
|
"nodeKind": "step",
|
|
228
|
-
"stepId": "step//workflows/
|
|
228
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "node_1",
|
|
233
|
+
"type": "step",
|
|
234
|
+
"data": {
|
|
235
|
+
"label": "writeEvent",
|
|
236
|
+
"nodeKind": "step",
|
|
237
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
238
|
+
},
|
|
239
|
+
"metadata": {
|
|
240
|
+
"loopId": "loop_0",
|
|
241
|
+
"loopIsAwait": true
|
|
229
242
|
}
|
|
230
243
|
},
|
|
231
244
|
{
|
|
@@ -245,8 +258,20 @@
|
|
|
245
258
|
"type": "default"
|
|
246
259
|
},
|
|
247
260
|
{
|
|
248
|
-
"id": "
|
|
261
|
+
"id": "e_node_1_back_node_1",
|
|
262
|
+
"source": "node_1",
|
|
263
|
+
"target": "node_1",
|
|
264
|
+
"type": "loop"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "e_node_0_node_1",
|
|
249
268
|
"source": "node_0",
|
|
269
|
+
"target": "node_1",
|
|
270
|
+
"type": "default"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"id": "e_node_1_end",
|
|
274
|
+
"source": "node_1",
|
|
250
275
|
"target": "end",
|
|
251
276
|
"type": "default"
|
|
252
277
|
}
|
|
@@ -254,16 +279,16 @@
|
|
|
254
279
|
}
|
|
255
280
|
}
|
|
256
281
|
},
|
|
257
|
-
"workflows/
|
|
258
|
-
"
|
|
259
|
-
"workflowId": "workflow//workflows/
|
|
282
|
+
"workflows/addition.ts": {
|
|
283
|
+
"addition": {
|
|
284
|
+
"workflowId": "workflow//workflows/addition.ts//addition",
|
|
260
285
|
"graph": {
|
|
261
286
|
"nodes": [
|
|
262
287
|
{
|
|
263
288
|
"id": "start",
|
|
264
289
|
"type": "workflowStart",
|
|
265
290
|
"data": {
|
|
266
|
-
"label": "Start:
|
|
291
|
+
"label": "Start: addition",
|
|
267
292
|
"nodeKind": "workflow_start"
|
|
268
293
|
}
|
|
269
294
|
},
|
|
@@ -271,22 +296,9 @@
|
|
|
271
296
|
"id": "node_0",
|
|
272
297
|
"type": "step",
|
|
273
298
|
"data": {
|
|
274
|
-
"label": "
|
|
275
|
-
"nodeKind": "step",
|
|
276
|
-
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"id": "node_1",
|
|
281
|
-
"type": "step",
|
|
282
|
-
"data": {
|
|
283
|
-
"label": "writeEvent",
|
|
299
|
+
"label": "add",
|
|
284
300
|
"nodeKind": "step",
|
|
285
|
-
"stepId": "step//workflows/
|
|
286
|
-
},
|
|
287
|
-
"metadata": {
|
|
288
|
-
"loopId": "loop_0",
|
|
289
|
-
"loopIsAwait": true
|
|
301
|
+
"stepId": "step//workflows/addition.ts//add"
|
|
290
302
|
}
|
|
291
303
|
},
|
|
292
304
|
{
|
|
@@ -306,20 +318,8 @@
|
|
|
306
318
|
"type": "default"
|
|
307
319
|
},
|
|
308
320
|
{
|
|
309
|
-
"id": "
|
|
310
|
-
"source": "node_1",
|
|
311
|
-
"target": "node_1",
|
|
312
|
-
"type": "loop"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"id": "e_node_0_node_1",
|
|
321
|
+
"id": "e_node_0_end",
|
|
316
322
|
"source": "node_0",
|
|
317
|
-
"target": "node_1",
|
|
318
|
-
"type": "default"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
"id": "e_node_1_end",
|
|
322
|
-
"source": "node_1",
|
|
323
323
|
"target": "end",
|
|
324
324
|
"type": "default"
|
|
325
325
|
}
|
|
@@ -24528,6 +24528,19 @@ __name(__builtin_response_text, "__builtin_response_text");
|
|
|
24528
24528
|
registerStepFunction("__builtin_response_array_buffer", __builtin_response_array_buffer);
|
|
24529
24529
|
registerStepFunction("__builtin_response_json", __builtin_response_json);
|
|
24530
24530
|
registerStepFunction("__builtin_response_text", __builtin_response_text);
|
|
24531
|
+
// workflows/noop.ts
|
|
24532
|
+
var count = 0;
|
|
24533
|
+
async function noop(_i) {
|
|
24534
|
+
count++;
|
|
24535
|
+
return count;
|
|
24536
|
+
}
|
|
24537
|
+
__name(noop, "noop");
|
|
24538
|
+
async function brokenWf() {
|
|
24539
|
+
throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
|
|
24540
|
+
}
|
|
24541
|
+
__name(brokenWf, "brokenWf");
|
|
24542
|
+
brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
|
|
24543
|
+
registerStepFunction("step//workflows/noop.ts//noop", noop);
|
|
24531
24544
|
// workflows/addition.ts
|
|
24532
24545
|
async function add(num, num2) {
|
|
24533
24546
|
return num + num2;
|
|
@@ -24539,6 +24552,17 @@ async function addition(num, num2) {
|
|
|
24539
24552
|
__name(addition, "addition");
|
|
24540
24553
|
addition.workflowId = "workflow//workflows/addition.ts//addition";
|
|
24541
24554
|
registerStepFunction("step//workflows/addition.ts//add", add);
|
|
24555
|
+
// workflows/null-byte.ts
|
|
24556
|
+
async function nullByteStep() {
|
|
24557
|
+
return "null byte \0";
|
|
24558
|
+
}
|
|
24559
|
+
__name(nullByteStep, "nullByteStep");
|
|
24560
|
+
async function nullByteWorkflow() {
|
|
24561
|
+
throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
|
|
24562
|
+
}
|
|
24563
|
+
__name(nullByteWorkflow, "nullByteWorkflow");
|
|
24564
|
+
nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
|
|
24565
|
+
registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
|
|
24542
24566
|
// ../utils/dist/pluralize.js
|
|
24543
24567
|
function pluralize(singular, plural, count2) {
|
|
24544
24568
|
return count2 === 1 ? singular : plural;
|
|
@@ -44389,41 +44413,6 @@ async function fetch2(...args) {
|
|
|
44389
44413
|
}
|
|
44390
44414
|
__name(fetch2, "fetch");
|
|
44391
44415
|
registerStepFunction("step//workflow/dist/stdlib.js//fetch", fetch2);
|
|
44392
|
-
// workflows/hooks.ts
|
|
44393
|
-
var Hook = defineHook({
|
|
44394
|
-
schema: object({
|
|
44395
|
-
data: string2(),
|
|
44396
|
-
done: boolean2().optional(),
|
|
44397
|
-
metadata: unknown()
|
|
44398
|
-
})
|
|
44399
|
-
});
|
|
44400
|
-
async function collectWithHook(token, customData) {
|
|
44401
|
-
throw new Error("You attempted to execute workflow collectWithHook function directly. To start a workflow, use start(collectWithHook) from workflow/api");
|
|
44402
|
-
}
|
|
44403
|
-
__name(collectWithHook, "collectWithHook");
|
|
44404
|
-
collectWithHook.workflowId = "workflow//workflows/hooks.ts//collectWithHook";
|
|
44405
|
-
async function writeEvent(writable, event, payload) {
|
|
44406
|
-
console.log("writing event", event, payload);
|
|
44407
|
-
const writer = writable.getWriter();
|
|
44408
|
-
await writer.write(new TextEncoder().encode(`${JSON.stringify({
|
|
44409
|
-
event,
|
|
44410
|
-
payload
|
|
44411
|
-
})}\r
|
|
44412
|
-
`));
|
|
44413
|
-
}
|
|
44414
|
-
__name(writeEvent, "writeEvent");
|
|
44415
|
-
registerStepFunction("step//workflows/hooks.ts//writeEvent", writeEvent);
|
|
44416
|
-
// workflows/null-byte.ts
|
|
44417
|
-
async function nullByteStep() {
|
|
44418
|
-
return "null byte \0";
|
|
44419
|
-
}
|
|
44420
|
-
__name(nullByteStep, "nullByteStep");
|
|
44421
|
-
async function nullByteWorkflow() {
|
|
44422
|
-
throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
|
|
44423
|
-
}
|
|
44424
|
-
__name(nullByteWorkflow, "nullByteWorkflow");
|
|
44425
|
-
nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
|
|
44426
|
-
registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
|
|
44427
44416
|
// workflows/retriable-and-fatal.ts
|
|
44428
44417
|
async function retryableAndFatalErrorWorkflow() {
|
|
44429
44418
|
throw new Error("You attempted to execute workflow retryableAndFatalErrorWorkflow function directly. To start a workflow, use start(retryableAndFatalErrorWorkflow) from workflow/api");
|
|
@@ -44451,19 +44440,30 @@ async function stepThatFails() {
|
|
|
44451
44440
|
__name(stepThatFails, "stepThatFails");
|
|
44452
44441
|
registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError", stepThatThrowsRetryableError);
|
|
44453
44442
|
registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatFails", stepThatFails);
|
|
44454
|
-
// workflows/
|
|
44455
|
-
var
|
|
44456
|
-
|
|
44457
|
-
|
|
44458
|
-
|
|
44443
|
+
// workflows/hooks.ts
|
|
44444
|
+
var Hook = defineHook({
|
|
44445
|
+
schema: object({
|
|
44446
|
+
data: string2(),
|
|
44447
|
+
done: boolean2().optional(),
|
|
44448
|
+
metadata: unknown()
|
|
44449
|
+
})
|
|
44450
|
+
});
|
|
44451
|
+
async function collectWithHook(token, customData) {
|
|
44452
|
+
throw new Error("You attempted to execute workflow collectWithHook function directly. To start a workflow, use start(collectWithHook) from workflow/api");
|
|
44459
44453
|
}
|
|
44460
|
-
__name(
|
|
44461
|
-
|
|
44462
|
-
|
|
44454
|
+
__name(collectWithHook, "collectWithHook");
|
|
44455
|
+
collectWithHook.workflowId = "workflow//workflows/hooks.ts//collectWithHook";
|
|
44456
|
+
async function writeEvent(writable, event, payload) {
|
|
44457
|
+
console.log("writing event", event, payload);
|
|
44458
|
+
const writer = writable.getWriter();
|
|
44459
|
+
await writer.write(new TextEncoder().encode(`${JSON.stringify({
|
|
44460
|
+
event,
|
|
44461
|
+
payload
|
|
44462
|
+
})}\r
|
|
44463
|
+
`));
|
|
44463
44464
|
}
|
|
44464
|
-
__name(
|
|
44465
|
-
|
|
44466
|
-
registerStepFunction("step//workflows/noop.ts//noop", noop);
|
|
44465
|
+
__name(writeEvent, "writeEvent");
|
|
44466
|
+
registerStepFunction("step//workflows/hooks.ts//writeEvent", writeEvent);
|
|
44467
44467
|
// ../core/dist/logger.js
|
|
44468
44468
|
var import_debug = __toESM(require_src2(), 1);
|
|
44469
44469
|
function createLogger(namespace) {
|