@workflow/world-testing 4.0.1-beta.39 → 4.0.1-beta.40
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/.well-known/workflow/v1/flow.js +55 -55
- package/dist/.well-known/workflow/v1/flow.js.map +1 -1
- package/dist/.well-known/workflow/v1/manifest.json +60 -60
- package/dist/.well-known/workflow/v1/step.js +37 -37
- package/dist/.well-known/workflow/v1/step.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,11 +1,6 @@
|
|
|
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
|
-
},
|
|
9
4
|
"workflow/dist/internal/builtins.js": {
|
|
10
5
|
"__builtin_response_array_buffer": {
|
|
11
6
|
"stepId": "__builtin_response_array_buffer"
|
|
@@ -17,14 +12,19 @@
|
|
|
17
12
|
"stepId": "__builtin_response_text"
|
|
18
13
|
}
|
|
19
14
|
},
|
|
15
|
+
"workflows/hooks.ts": {
|
|
16
|
+
"writeEvent": {
|
|
17
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
20
|
"workflows/addition.ts": {
|
|
21
21
|
"add": {
|
|
22
22
|
"stepId": "step//workflows/addition.ts//add"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"workflows/
|
|
26
|
-
"
|
|
27
|
-
"stepId": "step//workflows/
|
|
25
|
+
"workflows/noop.ts": {
|
|
26
|
+
"noop": {
|
|
27
|
+
"stepId": "step//workflows/noop.ts//noop"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"workflows/retriable-and-fatal.ts": {
|
|
@@ -35,28 +35,28 @@
|
|
|
35
35
|
"stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
"workflows/hooks.ts": {
|
|
39
|
-
"writeEvent": {
|
|
40
|
-
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
38
|
"workflow/dist/stdlib.js": {
|
|
44
39
|
"fetch": {
|
|
45
40
|
"stepId": "step//workflow/dist/stdlib.js//fetch"
|
|
46
41
|
}
|
|
42
|
+
},
|
|
43
|
+
"workflows/null-byte.ts": {
|
|
44
|
+
"nullByteStep": {
|
|
45
|
+
"stepId": "step//workflows/null-byte.ts//nullByteStep"
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"workflows": {
|
|
50
|
-
"workflows/
|
|
51
|
-
"
|
|
52
|
-
"workflowId": "workflow//workflows/
|
|
50
|
+
"workflows/hooks.ts": {
|
|
51
|
+
"collectWithHook": {
|
|
52
|
+
"workflowId": "workflow//workflows/hooks.ts//collectWithHook",
|
|
53
53
|
"graph": {
|
|
54
54
|
"nodes": [
|
|
55
55
|
{
|
|
56
56
|
"id": "start",
|
|
57
57
|
"type": "workflowStart",
|
|
58
58
|
"data": {
|
|
59
|
-
"label": "Start:
|
|
59
|
+
"label": "Start: collectWithHook",
|
|
60
60
|
"nodeKind": "workflow_start"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
@@ -64,18 +64,22 @@
|
|
|
64
64
|
"id": "node_0",
|
|
65
65
|
"type": "step",
|
|
66
66
|
"data": {
|
|
67
|
-
"label": "
|
|
67
|
+
"label": "writeEvent",
|
|
68
68
|
"nodeKind": "step",
|
|
69
|
-
"stepId": "step//workflows/
|
|
69
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"id": "node_1",
|
|
74
74
|
"type": "step",
|
|
75
75
|
"data": {
|
|
76
|
-
"label": "
|
|
76
|
+
"label": "writeEvent",
|
|
77
77
|
"nodeKind": "step",
|
|
78
|
-
"stepId": "step//workflows/
|
|
78
|
+
"stepId": "step//workflows/hooks.ts//writeEvent"
|
|
79
|
+
},
|
|
80
|
+
"metadata": {
|
|
81
|
+
"loopId": "loop_0",
|
|
82
|
+
"loopIsAwait": true
|
|
79
83
|
}
|
|
80
84
|
},
|
|
81
85
|
{
|
|
@@ -94,6 +98,12 @@
|
|
|
94
98
|
"target": "node_0",
|
|
95
99
|
"type": "default"
|
|
96
100
|
},
|
|
101
|
+
{
|
|
102
|
+
"id": "e_node_1_back_node_1",
|
|
103
|
+
"source": "node_1",
|
|
104
|
+
"target": "node_1",
|
|
105
|
+
"type": "loop"
|
|
106
|
+
},
|
|
97
107
|
{
|
|
98
108
|
"id": "e_node_0_node_1",
|
|
99
109
|
"source": "node_0",
|
|
@@ -158,16 +168,16 @@
|
|
|
158
168
|
}
|
|
159
169
|
}
|
|
160
170
|
},
|
|
161
|
-
"workflows/
|
|
162
|
-
"
|
|
163
|
-
"workflowId": "workflow//workflows/
|
|
171
|
+
"workflows/noop.ts": {
|
|
172
|
+
"brokenWf": {
|
|
173
|
+
"workflowId": "workflow//workflows/noop.ts//brokenWf",
|
|
164
174
|
"graph": {
|
|
165
175
|
"nodes": [
|
|
166
176
|
{
|
|
167
177
|
"id": "start",
|
|
168
178
|
"type": "workflowStart",
|
|
169
179
|
"data": {
|
|
170
|
-
"label": "Start:
|
|
180
|
+
"label": "Start: brokenWf",
|
|
171
181
|
"nodeKind": "workflow_start"
|
|
172
182
|
}
|
|
173
183
|
},
|
|
@@ -175,9 +185,18 @@
|
|
|
175
185
|
"id": "node_0",
|
|
176
186
|
"type": "step",
|
|
177
187
|
"data": {
|
|
178
|
-
"label": "
|
|
188
|
+
"label": "noop",
|
|
179
189
|
"nodeKind": "step",
|
|
180
|
-
"stepId": "step//workflows/
|
|
190
|
+
"stepId": "step//workflows/noop.ts//noop"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "node_1",
|
|
195
|
+
"type": "step",
|
|
196
|
+
"data": {
|
|
197
|
+
"label": "noop",
|
|
198
|
+
"nodeKind": "step",
|
|
199
|
+
"stepId": "step//workflows/noop.ts//noop"
|
|
181
200
|
}
|
|
182
201
|
},
|
|
183
202
|
{
|
|
@@ -197,8 +216,14 @@
|
|
|
197
216
|
"type": "default"
|
|
198
217
|
},
|
|
199
218
|
{
|
|
200
|
-
"id": "
|
|
219
|
+
"id": "e_node_0_node_1",
|
|
201
220
|
"source": "node_0",
|
|
221
|
+
"target": "node_1",
|
|
222
|
+
"type": "default"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "e_node_1_end",
|
|
226
|
+
"source": "node_1",
|
|
202
227
|
"target": "end",
|
|
203
228
|
"type": "default"
|
|
204
229
|
}
|
|
@@ -254,16 +279,16 @@
|
|
|
254
279
|
}
|
|
255
280
|
}
|
|
256
281
|
},
|
|
257
|
-
"workflows/
|
|
258
|
-
"
|
|
259
|
-
"workflowId": "workflow//workflows/
|
|
282
|
+
"workflows/null-byte.ts": {
|
|
283
|
+
"nullByteWorkflow": {
|
|
284
|
+
"workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
|
|
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: nullByteWorkflow",
|
|
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": "nullByteStep",
|
|
284
300
|
"nodeKind": "step",
|
|
285
|
-
"stepId": "step//workflows/
|
|
286
|
-
},
|
|
287
|
-
"metadata": {
|
|
288
|
-
"loopId": "loop_0",
|
|
289
|
-
"loopIsAwait": true
|
|
301
|
+
"stepId": "step//workflows/null-byte.ts//nullByteStep"
|
|
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
|
}
|
|
@@ -24511,41 +24511,6 @@ __name(__builtin_response_text, "__builtin_response_text");
|
|
|
24511
24511
|
registerStepFunction("__builtin_response_array_buffer", __builtin_response_array_buffer);
|
|
24512
24512
|
registerStepFunction("__builtin_response_json", __builtin_response_json);
|
|
24513
24513
|
registerStepFunction("__builtin_response_text", __builtin_response_text);
|
|
24514
|
-
// workflows/addition.ts
|
|
24515
|
-
async function add(num, num2) {
|
|
24516
|
-
return num + num2;
|
|
24517
|
-
}
|
|
24518
|
-
__name(add, "add");
|
|
24519
|
-
async function addition(num, num2) {
|
|
24520
|
-
throw new Error("You attempted to execute workflow addition function directly. To start a workflow, use start(addition) from workflow/api");
|
|
24521
|
-
}
|
|
24522
|
-
__name(addition, "addition");
|
|
24523
|
-
addition.workflowId = "workflow//workflows/addition.ts//addition";
|
|
24524
|
-
registerStepFunction("step//workflows/addition.ts//add", add);
|
|
24525
|
-
// workflows/noop.ts
|
|
24526
|
-
var count = 0;
|
|
24527
|
-
async function noop(_i) {
|
|
24528
|
-
count++;
|
|
24529
|
-
return count;
|
|
24530
|
-
}
|
|
24531
|
-
__name(noop, "noop");
|
|
24532
|
-
async function brokenWf() {
|
|
24533
|
-
throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
|
|
24534
|
-
}
|
|
24535
|
-
__name(brokenWf, "brokenWf");
|
|
24536
|
-
brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
|
|
24537
|
-
registerStepFunction("step//workflows/noop.ts//noop", noop);
|
|
24538
|
-
// workflows/null-byte.ts
|
|
24539
|
-
async function nullByteStep() {
|
|
24540
|
-
return "null byte \0";
|
|
24541
|
-
}
|
|
24542
|
-
__name(nullByteStep, "nullByteStep");
|
|
24543
|
-
async function nullByteWorkflow() {
|
|
24544
|
-
throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
|
|
24545
|
-
}
|
|
24546
|
-
__name(nullByteWorkflow, "nullByteWorkflow");
|
|
24547
|
-
nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
|
|
24548
|
-
registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
|
|
24549
24514
|
// ../utils/dist/promise.js
|
|
24550
24515
|
function once(fn) {
|
|
24551
24516
|
const result = {
|
|
@@ -42409,9 +42374,9 @@ function createStreamer(basedir) {
|
|
|
42409
42374
|
__name(registerStreamForRun, "registerStreamForRun");
|
|
42410
42375
|
return {
|
|
42411
42376
|
async writeToStream(name, _runId, chunk) {
|
|
42377
|
+
const chunkId = `chnk_${monotonicUlid2()}`;
|
|
42412
42378
|
const runId = await _runId;
|
|
42413
42379
|
await registerStreamForRun(runId, name);
|
|
42414
|
-
const chunkId = `chnk_${monotonicUlid2()}`;
|
|
42415
42380
|
let chunkBuffer;
|
|
42416
42381
|
if (typeof chunk === "string") {
|
|
42417
42382
|
chunkBuffer = Buffer.from(new TextEncoder().encode(chunk));
|
|
@@ -42436,9 +42401,9 @@ function createStreamer(basedir) {
|
|
|
42436
42401
|
});
|
|
42437
42402
|
},
|
|
42438
42403
|
async closeStream(name, _runId) {
|
|
42404
|
+
const chunkId = `chnk_${monotonicUlid2()}`;
|
|
42439
42405
|
const runId = await _runId;
|
|
42440
42406
|
await registerStreamForRun(runId, name);
|
|
42441
|
-
const chunkId = `chnk_${monotonicUlid2()}`;
|
|
42442
42407
|
const chunkPath = import_node_path4.default.join(basedir, "streams", "chunks", `${name}-${chunkId}.json`);
|
|
42443
42408
|
await write(chunkPath, serializeChunk({
|
|
42444
42409
|
chunk: Buffer.from([]),
|
|
@@ -44295,6 +44260,28 @@ async function writeEvent(writable, event, payload) {
|
|
|
44295
44260
|
}
|
|
44296
44261
|
__name(writeEvent, "writeEvent");
|
|
44297
44262
|
registerStepFunction("step//workflows/hooks.ts//writeEvent", writeEvent);
|
|
44263
|
+
// workflows/addition.ts
|
|
44264
|
+
async function add(num, num2) {
|
|
44265
|
+
return num + num2;
|
|
44266
|
+
}
|
|
44267
|
+
__name(add, "add");
|
|
44268
|
+
async function addition(num, num2) {
|
|
44269
|
+
throw new Error("You attempted to execute workflow addition function directly. To start a workflow, use start(addition) from workflow/api");
|
|
44270
|
+
}
|
|
44271
|
+
__name(addition, "addition");
|
|
44272
|
+
addition.workflowId = "workflow//workflows/addition.ts//addition";
|
|
44273
|
+
registerStepFunction("step//workflows/addition.ts//add", add);
|
|
44274
|
+
// workflows/null-byte.ts
|
|
44275
|
+
async function nullByteStep() {
|
|
44276
|
+
return "null byte \0";
|
|
44277
|
+
}
|
|
44278
|
+
__name(nullByteStep, "nullByteStep");
|
|
44279
|
+
async function nullByteWorkflow() {
|
|
44280
|
+
throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
|
|
44281
|
+
}
|
|
44282
|
+
__name(nullByteWorkflow, "nullByteWorkflow");
|
|
44283
|
+
nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
|
|
44284
|
+
registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
|
|
44298
44285
|
// workflows/retriable-and-fatal.ts
|
|
44299
44286
|
async function retryableAndFatalErrorWorkflow() {
|
|
44300
44287
|
throw new Error("You attempted to execute workflow retryableAndFatalErrorWorkflow function directly. To start a workflow, use start(retryableAndFatalErrorWorkflow) from workflow/api");
|
|
@@ -44322,6 +44309,19 @@ async function stepThatFails() {
|
|
|
44322
44309
|
__name(stepThatFails, "stepThatFails");
|
|
44323
44310
|
registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError", stepThatThrowsRetryableError);
|
|
44324
44311
|
registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatFails", stepThatFails);
|
|
44312
|
+
// workflows/noop.ts
|
|
44313
|
+
var count = 0;
|
|
44314
|
+
async function noop(_i) {
|
|
44315
|
+
count++;
|
|
44316
|
+
return count;
|
|
44317
|
+
}
|
|
44318
|
+
__name(noop, "noop");
|
|
44319
|
+
async function brokenWf() {
|
|
44320
|
+
throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
|
|
44321
|
+
}
|
|
44322
|
+
__name(brokenWf, "brokenWf");
|
|
44323
|
+
brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
|
|
44324
|
+
registerStepFunction("step//workflows/noop.ts//noop", noop);
|
|
44325
44325
|
// ../core/dist/logger.js
|
|
44326
44326
|
var import_debug = __toESM(require_src2(), 1);
|
|
44327
44327
|
function createLogger(namespace) {
|