@workflow/world-testing 4.0.1-beta.35 → 4.0.1-beta.36

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,5 +1,18 @@
1
1
  {
2
2
  "steps": {
3
+ "workflow/dist/stdlib.js": {
4
+ "fetch": {
5
+ "stepId": "step//workflow/dist/stdlib.js//fetch"
6
+ }
7
+ },
8
+ "workflows/retriable-and-fatal.ts": {
9
+ "stepThatFails": {
10
+ "stepId": "step//workflows/retriable-and-fatal.ts//stepThatFails"
11
+ },
12
+ "stepThatThrowsRetryableError": {
13
+ "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
14
+ }
15
+ },
3
16
  "workflow/dist/internal/builtins.js": {
4
17
  "__builtin_response_array_buffer": {
5
18
  "stepId": "__builtin_response_array_buffer"
@@ -11,17 +24,14 @@
11
24
  "stepId": "__builtin_response_text"
12
25
  }
13
26
  },
14
- "workflows/retriable-and-fatal.ts": {
15
- "stepThatFails": {
16
- "stepId": "step//workflows/retriable-and-fatal.ts//stepThatFails"
17
- },
18
- "stepThatThrowsRetryableError": {
19
- "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
27
+ "workflows/addition.ts": {
28
+ "add": {
29
+ "stepId": "step//workflows/addition.ts//add"
20
30
  }
21
31
  },
22
- "workflow/dist/stdlib.js": {
23
- "fetch": {
24
- "stepId": "step//workflow/dist/stdlib.js//fetch"
32
+ "workflows/noop.ts": {
33
+ "noop": {
34
+ "stepId": "step//workflows/noop.ts//noop"
25
35
  }
26
36
  },
27
37
  "workflows/null-byte.ts": {
@@ -29,20 +39,10 @@
29
39
  "stepId": "step//workflows/null-byte.ts//nullByteStep"
30
40
  }
31
41
  },
32
- "workflows/noop.ts": {
33
- "noop": {
34
- "stepId": "step//workflows/noop.ts//noop"
35
- }
36
- },
37
42
  "workflows/hooks.ts": {
38
43
  "writeEvent": {
39
44
  "stepId": "step//workflows/hooks.ts//writeEvent"
40
45
  }
41
- },
42
- "workflows/addition.ts": {
43
- "add": {
44
- "stepId": "step//workflows/addition.ts//add"
45
- }
46
46
  }
47
47
  },
48
48
  "workflows": {
@@ -56,11 +56,6 @@
56
56
  "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow"
57
57
  }
58
58
  },
59
- "workflows/noop.ts": {
60
- "brokenWf": {
61
- "workflowId": "workflow//workflows/noop.ts//brokenWf"
62
- }
63
- },
64
59
  "workflows/null-byte.ts": {
65
60
  "nullByteWorkflow": {
66
61
  "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow"
@@ -70,6 +65,11 @@
70
65
  "collectWithHook": {
71
66
  "workflowId": "workflow//workflows/hooks.ts//collectWithHook"
72
67
  }
68
+ },
69
+ "workflows/noop.ts": {
70
+ "brokenWf": {
71
+ "workflowId": "workflow//workflows/noop.ts//brokenWf"
72
+ }
73
73
  }
74
74
  }
75
75
  }
@@ -24511,6 +24511,17 @@ __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);
24514
24525
  // ../utils/dist/index.js
24515
24526
  var import_ms = __toESM(require_ms(), 1);
24516
24527
  function once(fn) {
@@ -41638,7 +41649,17 @@ async function paginatedFileSystemQuery(config3) {
41638
41649
  const validItems = [];
41639
41650
  for (const fileId of candidateFileIds) {
41640
41651
  const filePath = import_node_path.default.join(directory, `${fileId}.json`);
41641
- const item = await readJSON(filePath, schema);
41652
+ let item = null;
41653
+ try {
41654
+ item = await readJSON(filePath, schema);
41655
+ }
41656
+ catch (error45) {
41657
+ if (error45 instanceof external_exports.ZodError) {
41658
+ console.warn(`Skipping item ${fileId} due to malformed JSON: ${error45.message}`);
41659
+ continue;
41660
+ }
41661
+ throw error45;
41662
+ }
41642
41663
  if (item) {
41643
41664
  if (filter && !filter(item))
41644
41665
  continue;
@@ -41773,6 +41794,7 @@ function createHooksStorage(basedir) {
41773
41794
  createdAt: now
41774
41795
  };
41775
41796
  const hookPath = import_node_path2.default.join(basedir, "hooks", `${data.hookId}.json`);
41797
+ HookSchema.parse(result);
41776
41798
  await writeJSON(hookPath, result);
41777
41799
  return result;
41778
41800
  }
@@ -41874,6 +41896,7 @@ function createStorage(basedir) {
41874
41896
  updatedAt: now
41875
41897
  };
41876
41898
  const runPath = import_node_path2.default.join(basedir, "runs", `${runId}.json`);
41899
+ WorkflowRunSchema.parse(result);
41877
41900
  await writeJSON(runPath, result);
41878
41901
  return result;
41879
41902
  },
@@ -41914,6 +41937,7 @@ function createStorage(basedir) {
41914
41937
  if (isBecomingTerminal) {
41915
41938
  updatedRun.completedAt = now;
41916
41939
  }
41940
+ WorkflowRunSchema.parse(updatedRun);
41917
41941
  await writeJSON(runPath, updatedRun, {
41918
41942
  overwrite: true
41919
41943
  });
@@ -41995,6 +42019,7 @@ function createStorage(basedir) {
41995
42019
  };
41996
42020
  const compositeKey = `${runId}-${data.stepId}`;
41997
42021
  const stepPath = import_node_path2.default.join(basedir, "steps", `${compositeKey}.json`);
42022
+ StepSchema.parse(result);
41998
42023
  await writeJSON(stepPath, result);
41999
42024
  return result;
42000
42025
  },
@@ -42042,6 +42067,7 @@ function createStorage(basedir) {
42042
42067
  if (data.status === "completed" || data.status === "failed") {
42043
42068
  updatedStep.completedAt = now;
42044
42069
  }
42070
+ StepSchema.parse(updatedStep);
42045
42071
  await writeJSON(stepPath, updatedStep, {
42046
42072
  overwrite: true
42047
42073
  });
@@ -42085,6 +42111,7 @@ function createStorage(basedir) {
42085
42111
  };
42086
42112
  const compositeKey = `${runId}-${eventId}`;
42087
42113
  const eventPath = import_node_path2.default.join(basedir, "events", `${compositeKey}.json`);
42114
+ EventSchema.parse(result);
42088
42115
  await writeJSON(eventPath, result);
42089
42116
  const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION;
42090
42117
  return filterEventData(result, resolveData);
@@ -44067,17 +44094,17 @@ async function writeEvent(writable, event, payload) {
44067
44094
  }
44068
44095
  __name(writeEvent, "writeEvent");
44069
44096
  registerStepFunction("step//workflows/hooks.ts//writeEvent", writeEvent);
44070
- // workflows/addition.ts
44071
- async function add(num, num2) {
44072
- return num + num2;
44097
+ // workflows/null-byte.ts
44098
+ async function nullByteStep() {
44099
+ return "null byte \0";
44073
44100
  }
44074
- __name(add, "add");
44075
- async function addition(num, num2) {
44076
- throw new Error("You attempted to execute workflow addition function directly. To start a workflow, use start(addition) from workflow/api");
44101
+ __name(nullByteStep, "nullByteStep");
44102
+ async function nullByteWorkflow() {
44103
+ throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
44077
44104
  }
44078
- __name(addition, "addition");
44079
- addition.workflowId = "workflow//workflows/addition.ts//addition";
44080
- registerStepFunction("step//workflows/addition.ts//add", add);
44105
+ __name(nullByteWorkflow, "nullByteWorkflow");
44106
+ nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
44107
+ registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
44081
44108
  // workflows/noop.ts
44082
44109
  var count = 0;
44083
44110
  async function noop(_i) {
@@ -44091,17 +44118,6 @@ async function brokenWf() {
44091
44118
  __name(brokenWf, "brokenWf");
44092
44119
  brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
44093
44120
  registerStepFunction("step//workflows/noop.ts//noop", noop);
44094
- // workflows/null-byte.ts
44095
- async function nullByteStep() {
44096
- return "null byte \0";
44097
- }
44098
- __name(nullByteStep, "nullByteStep");
44099
- async function nullByteWorkflow() {
44100
- throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
44101
- }
44102
- __name(nullByteWorkflow, "nullByteWorkflow");
44103
- nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
44104
- registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
44105
44121
  // workflows/retriable-and-fatal.ts
44106
44122
  async function retryableAndFatalErrorWorkflow() {
44107
44123
  throw new Error("You attempted to execute workflow retryableAndFatalErrorWorkflow function directly. To start a workflow, use start(retryableAndFatalErrorWorkflow) from workflow/api");