@workflow/world-testing 4.0.1-beta.48 → 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,6 +1,11 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "steps": {
4
+ "workflows/noop.ts": {
5
+ "noop": {
6
+ "stepId": "step//workflows/noop.ts//noop"
7
+ }
8
+ },
4
9
  "workflows/retriable-and-fatal.ts": {
5
10
  "stepThatFails": {
6
11
  "stepId": "step//workflows/retriable-and-fatal.ts//stepThatFails"
@@ -9,16 +14,6 @@
9
14
  "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
10
15
  }
11
16
  },
12
- "workflows/hooks.ts": {
13
- "writeEvent": {
14
- "stepId": "step//workflows/hooks.ts//writeEvent"
15
- }
16
- },
17
- "workflows/noop.ts": {
18
- "noop": {
19
- "stepId": "step//workflows/noop.ts//noop"
20
- }
21
- },
22
17
  "workflow/dist/stdlib.js": {
23
18
  "fetch": {
24
19
  "stepId": "step//workflow/dist/stdlib.js//fetch"
@@ -29,6 +24,11 @@
29
24
  "stepId": "step//workflows/null-byte.ts//nullByteStep"
30
25
  }
31
26
  },
27
+ "workflows/hooks.ts": {
28
+ "writeEvent": {
29
+ "stepId": "step//workflows/hooks.ts//writeEvent"
30
+ }
31
+ },
32
32
  "workflow/dist/internal/builtins.js": {
33
33
  "__builtin_response_array_buffer": {
34
34
  "stepId": "__builtin_response_array_buffer"
@@ -47,16 +47,16 @@
47
47
  }
48
48
  },
49
49
  "workflows": {
50
- "workflows/retriable-and-fatal.ts": {
51
- "retryableAndFatalErrorWorkflow": {
52
- "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow",
50
+ "workflows/noop.ts": {
51
+ "brokenWf": {
52
+ "workflowId": "workflow//workflows/noop.ts//brokenWf",
53
53
  "graph": {
54
54
  "nodes": [
55
55
  {
56
56
  "id": "start",
57
57
  "type": "workflowStart",
58
58
  "data": {
59
- "label": "Start: retryableAndFatalErrorWorkflow",
59
+ "label": "Start: brokenWf",
60
60
  "nodeKind": "workflow_start"
61
61
  }
62
62
  },
@@ -64,9 +64,18 @@
64
64
  "id": "node_0",
65
65
  "type": "step",
66
66
  "data": {
67
- "label": "stepThatThrowsRetryableError",
67
+ "label": "noop",
68
68
  "nodeKind": "step",
69
- "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
69
+ "stepId": "step//workflows/noop.ts//noop"
70
+ }
71
+ },
72
+ {
73
+ "id": "node_1",
74
+ "type": "step",
75
+ "data": {
76
+ "label": "noop",
77
+ "nodeKind": "step",
78
+ "stepId": "step//workflows/noop.ts//noop"
70
79
  }
71
80
  },
72
81
  {
@@ -86,8 +95,14 @@
86
95
  "type": "default"
87
96
  },
88
97
  {
89
- "id": "e_node_0_end",
98
+ "id": "e_node_0_node_1",
90
99
  "source": "node_0",
100
+ "target": "node_1",
101
+ "type": "default"
102
+ },
103
+ {
104
+ "id": "e_node_1_end",
105
+ "source": "node_1",
91
106
  "target": "end",
92
107
  "type": "default"
93
108
  }
@@ -95,16 +110,16 @@
95
110
  }
96
111
  }
97
112
  },
98
- "workflows/hooks.ts": {
99
- "collectWithHook": {
100
- "workflowId": "workflow//workflows/hooks.ts//collectWithHook",
113
+ "workflows/retriable-and-fatal.ts": {
114
+ "retryableAndFatalErrorWorkflow": {
115
+ "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow",
101
116
  "graph": {
102
117
  "nodes": [
103
118
  {
104
119
  "id": "start",
105
120
  "type": "workflowStart",
106
121
  "data": {
107
- "label": "Start: collectWithHook",
122
+ "label": "Start: retryableAndFatalErrorWorkflow",
108
123
  "nodeKind": "workflow_start"
109
124
  }
110
125
  },
@@ -112,22 +127,9 @@
112
127
  "id": "node_0",
113
128
  "type": "step",
114
129
  "data": {
115
- "label": "writeEvent",
116
- "nodeKind": "step",
117
- "stepId": "step//workflows/hooks.ts//writeEvent"
118
- }
119
- },
120
- {
121
- "id": "node_1",
122
- "type": "step",
123
- "data": {
124
- "label": "writeEvent",
130
+ "label": "stepThatThrowsRetryableError",
125
131
  "nodeKind": "step",
126
- "stepId": "step//workflows/hooks.ts//writeEvent"
127
- },
128
- "metadata": {
129
- "loopId": "loop_0",
130
- "loopIsAwait": true
132
+ "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
131
133
  }
132
134
  },
133
135
  {
@@ -147,20 +149,8 @@
147
149
  "type": "default"
148
150
  },
149
151
  {
150
- "id": "e_node_1_back_node_1",
151
- "source": "node_1",
152
- "target": "node_1",
153
- "type": "loop"
154
- },
155
- {
156
- "id": "e_node_0_node_1",
152
+ "id": "e_node_0_end",
157
153
  "source": "node_0",
158
- "target": "node_1",
159
- "type": "default"
160
- },
161
- {
162
- "id": "e_node_1_end",
163
- "source": "node_1",
164
154
  "target": "end",
165
155
  "type": "default"
166
156
  }
@@ -168,16 +158,16 @@
168
158
  }
169
159
  }
170
160
  },
171
- "workflows/noop.ts": {
172
- "brokenWf": {
173
- "workflowId": "workflow//workflows/noop.ts//brokenWf",
161
+ "workflows/null-byte.ts": {
162
+ "nullByteWorkflow": {
163
+ "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
174
164
  "graph": {
175
165
  "nodes": [
176
166
  {
177
167
  "id": "start",
178
168
  "type": "workflowStart",
179
169
  "data": {
180
- "label": "Start: brokenWf",
170
+ "label": "Start: nullByteWorkflow",
181
171
  "nodeKind": "workflow_start"
182
172
  }
183
173
  },
@@ -185,18 +175,9 @@
185
175
  "id": "node_0",
186
176
  "type": "step",
187
177
  "data": {
188
- "label": "noop",
189
- "nodeKind": "step",
190
- "stepId": "step//workflows/noop.ts//noop"
191
- }
192
- },
193
- {
194
- "id": "node_1",
195
- "type": "step",
196
- "data": {
197
- "label": "noop",
178
+ "label": "nullByteStep",
198
179
  "nodeKind": "step",
199
- "stepId": "step//workflows/noop.ts//noop"
180
+ "stepId": "step//workflows/null-byte.ts//nullByteStep"
200
181
  }
201
182
  },
202
183
  {
@@ -216,14 +197,8 @@
216
197
  "type": "default"
217
198
  },
218
199
  {
219
- "id": "e_node_0_node_1",
200
+ "id": "e_node_0_end",
220
201
  "source": "node_0",
221
- "target": "node_1",
222
- "type": "default"
223
- },
224
- {
225
- "id": "e_node_1_end",
226
- "source": "node_1",
227
202
  "target": "end",
228
203
  "type": "default"
229
204
  }
@@ -231,16 +206,16 @@
231
206
  }
232
207
  }
233
208
  },
234
- "workflows/null-byte.ts": {
235
- "nullByteWorkflow": {
236
- "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
209
+ "workflows/hooks.ts": {
210
+ "collectWithHook": {
211
+ "workflowId": "workflow//workflows/hooks.ts//collectWithHook",
237
212
  "graph": {
238
213
  "nodes": [
239
214
  {
240
215
  "id": "start",
241
216
  "type": "workflowStart",
242
217
  "data": {
243
- "label": "Start: nullByteWorkflow",
218
+ "label": "Start: collectWithHook",
244
219
  "nodeKind": "workflow_start"
245
220
  }
246
221
  },
@@ -248,9 +223,22 @@
248
223
  "id": "node_0",
249
224
  "type": "step",
250
225
  "data": {
251
- "label": "nullByteStep",
226
+ "label": "writeEvent",
252
227
  "nodeKind": "step",
253
- "stepId": "step//workflows/null-byte.ts//nullByteStep"
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
254
242
  }
255
243
  },
256
244
  {
@@ -270,8 +258,20 @@
270
258
  "type": "default"
271
259
  },
272
260
  {
273
- "id": "e_node_0_end",
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",
274
268
  "source": "node_0",
269
+ "target": "node_1",
270
+ "type": "default"
271
+ },
272
+ {
273
+ "id": "e_node_1_end",
274
+ "source": "node_1",
275
275
  "target": "end",
276
276
  "type": "default"
277
277
  }
@@ -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/noop.ts
44455
- var count = 0;
44456
- async function noop(_i) {
44457
- count++;
44458
- return count;
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(noop, "noop");
44461
- async function brokenWf() {
44462
- throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
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(brokenWf, "brokenWf");
44465
- brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
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) {