@workflow/world-testing 4.0.1-beta.28 → 4.0.1-beta.29

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.
@@ -5,16 +5,16 @@
5
5
  "stepId": "step//workflows/addition.ts//add"
6
6
  }
7
7
  },
8
- "workflows/null-byte.ts": {
9
- "nullByteStep": {
10
- "stepId": "step//workflows/null-byte.ts//nullByteStep"
11
- }
12
- },
13
8
  "workflows/noop.ts": {
14
9
  "noop": {
15
10
  "stepId": "step//workflows/noop.ts//noop"
16
11
  }
17
12
  },
13
+ "workflows/null-byte.ts": {
14
+ "nullByteStep": {
15
+ "stepId": "step//workflows/null-byte.ts//nullByteStep"
16
+ }
17
+ },
18
18
  "workflow/dist/internal/builtins.js": {
19
19
  "__builtin_response_array_buffer": {
20
20
  "stepId": "__builtin_response_array_buffer"
@@ -51,25 +51,25 @@
51
51
  "workflowId": "workflow//workflows/addition.ts//addition"
52
52
  }
53
53
  },
54
- "workflows/noop.ts": {
55
- "brokenWf": {
56
- "workflowId": "workflow//workflows/noop.ts//brokenWf"
57
- }
58
- },
59
54
  "workflows/null-byte.ts": {
60
55
  "nullByteWorkflow": {
61
56
  "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow"
62
57
  }
63
58
  },
64
- "workflows/hooks.ts": {
65
- "collectWithHook": {
66
- "workflowId": "workflow//workflows/hooks.ts//collectWithHook"
59
+ "workflows/noop.ts": {
60
+ "brokenWf": {
61
+ "workflowId": "workflow//workflows/noop.ts//brokenWf"
67
62
  }
68
63
  },
69
64
  "workflows/retriable-and-fatal.ts": {
70
65
  "retryableAndFatalErrorWorkflow": {
71
66
  "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow"
72
67
  }
68
+ },
69
+ "workflows/hooks.ts": {
70
+ "collectWithHook": {
71
+ "workflowId": "workflow//workflows/hooks.ts//collectWithHook"
72
+ }
73
73
  }
74
74
  }
75
75
  }
@@ -23661,17 +23661,6 @@ __name(__builtin_response_text, "__builtin_response_text");
23661
23661
  registerStepFunction("__builtin_response_array_buffer", __builtin_response_array_buffer);
23662
23662
  registerStepFunction("__builtin_response_json", __builtin_response_json);
23663
23663
  registerStepFunction("__builtin_response_text", __builtin_response_text);
23664
- // workflows/addition.ts
23665
- async function add(num, num2) {
23666
- return num + num2;
23667
- }
23668
- __name(add, "add");
23669
- async function addition(num, num2) {
23670
- throw new Error("You attempted to execute workflow addition function directly. To start a workflow, use start(addition) from workflow/api");
23671
- }
23672
- __name(addition, "addition");
23673
- addition.workflowId = "workflow//workflows/addition.ts//addition";
23674
- registerStepFunction("step//workflows/addition.ts//add", add);
23675
23664
  // workflows/noop.ts
23676
23665
  var count = 0;
23677
23666
  async function noop(_i) {
@@ -23685,6 +23674,28 @@ async function brokenWf() {
23685
23674
  __name(brokenWf, "brokenWf");
23686
23675
  brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
23687
23676
  registerStepFunction("step//workflows/noop.ts//noop", noop);
23677
+ // workflows/addition.ts
23678
+ async function add(num, num2) {
23679
+ return num + num2;
23680
+ }
23681
+ __name(add, "add");
23682
+ async function addition(num, num2) {
23683
+ throw new Error("You attempted to execute workflow addition function directly. To start a workflow, use start(addition) from workflow/api");
23684
+ }
23685
+ __name(addition, "addition");
23686
+ addition.workflowId = "workflow//workflows/addition.ts//addition";
23687
+ registerStepFunction("step//workflows/addition.ts//add", add);
23688
+ // workflows/null-byte.ts
23689
+ async function nullByteStep() {
23690
+ return "null byte \0";
23691
+ }
23692
+ __name(nullByteStep, "nullByteStep");
23693
+ async function nullByteWorkflow() {
23694
+ throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
23695
+ }
23696
+ __name(nullByteWorkflow, "nullByteWorkflow");
23697
+ nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
23698
+ registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
23688
23699
  // ../utils/dist/index.js
23689
23700
  var import_ms = __toESM(require_ms(), 1);
23690
23701
  function once(fn) {
@@ -40198,6 +40209,7 @@ var WorkflowRunBaseSchema = external_exports.object({
40198
40209
  input: external_exports.array(external_exports.any()),
40199
40210
  output: external_exports.any().optional(),
40200
40211
  error: StructuredErrorSchema.optional(),
40212
+ expiredAt: external_exports.coerce.date().optional(),
40201
40213
  startedAt: external_exports.coerce.date().optional(),
40202
40214
  completedAt: external_exports.coerce.date().optional(),
40203
40215
  createdAt: external_exports.coerce.date(),
@@ -40428,10 +40440,12 @@ __name(monotonicFactory, "monotonicFactory");
40428
40440
  // ../world-local/dist/queue.js
40429
40441
  var import_undici = __toESM(require_undici(), 1);
40430
40442
  var LOCAL_QUEUE_MAX_VISIBILITY = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_MAX_VISIBILITY ?? "0", 10) || Infinity;
40431
- var DEFAULT_CONCURRENCY_LIMIT = 20;
40443
+ var DEFAULT_CONCURRENCY_LIMIT = 100;
40432
40444
  var WORKFLOW_LOCAL_QUEUE_CONCURRENCY = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_CONCURRENCY ?? "0", 10) || DEFAULT_CONCURRENCY_LIMIT;
40433
40445
  var httpAgent = new import_undici.Agent({
40434
- headersTimeout: 0
40446
+ headersTimeout: 0,
40447
+ connections: 100,
40448
+ keepAliveTimeout: 3e4
40435
40449
  });
40436
40450
  function createQueue(config3) {
40437
40451
  const transport = new JsonTransport();
@@ -40603,6 +40617,7 @@ var import_node_fs = require("node:fs");
40603
40617
  var import_node_path = __toESM(require("node:path"), 1);
40604
40618
  var ulid3 = monotonicFactory(() => Math.random());
40605
40619
  var Ulid = external_exports.string().ulid();
40620
+ var createdFilesCache = /* @__PURE__ */ new Set();
40606
40621
  function ulidToDate(maybeUlid) {
40607
40622
  const ulid4 = Ulid.safeParse(maybeUlid);
40608
40623
  if (!ulid4.success) {
@@ -40627,8 +40642,14 @@ async function writeJSON(filePath, data, opts) {
40627
40642
  __name(writeJSON, "writeJSON");
40628
40643
  async function write(filePath, data, opts) {
40629
40644
  if (!opts?.overwrite) {
40645
+ if (createdFilesCache.has(filePath)) {
40646
+ throw new WorkflowAPIError(`File ${filePath} already exists and 'overwrite' is false`, {
40647
+ status: 409
40648
+ });
40649
+ }
40630
40650
  try {
40631
40651
  await import_node_fs.promises.access(filePath);
40652
+ createdFilesCache.add(filePath);
40632
40653
  throw new WorkflowAPIError(`File ${filePath} already exists and 'overwrite' is false`, {
40633
40654
  status: 409
40634
40655
  });
@@ -40646,6 +40667,7 @@ async function write(filePath, data, opts) {
40646
40667
  await import_node_fs.promises.writeFile(tempPath, data);
40647
40668
  tempFileCreated = true;
40648
40669
  await import_node_fs.promises.rename(tempPath, filePath);
40670
+ createdFilesCache.add(filePath);
40649
40671
  }
40650
40672
  catch (error45) {
40651
40673
  if (tempFileCreated) {
@@ -41410,7 +41432,7 @@ __name(createLocalWorld, "createLocalWorld");
41410
41432
  var import_node_os = __toESM(require("node:os"), 1);
41411
41433
  var import_oidc2 = __toESM(require_dist(), 1);
41412
41434
  // ../world-vercel/dist/version.js
41413
- var version2 = "4.0.1-beta.16";
41435
+ var version2 = "4.0.1-beta.17";
41414
41436
  // ../world-vercel/dist/utils.js
41415
41437
  var DEFAULT_RESOLVE_DATA_OPTION2 = "all";
41416
41438
  function dateToStringReplacer(_key, value) {
@@ -43001,17 +43023,6 @@ async function writeEvent(writable, event, payload) {
43001
43023
  }
43002
43024
  __name(writeEvent, "writeEvent");
43003
43025
  registerStepFunction("step//workflows/hooks.ts//writeEvent", writeEvent);
43004
- // workflows/null-byte.ts
43005
- async function nullByteStep() {
43006
- return "null byte \0";
43007
- }
43008
- __name(nullByteStep, "nullByteStep");
43009
- async function nullByteWorkflow() {
43010
- throw new Error("You attempted to execute workflow nullByteWorkflow function directly. To start a workflow, use start(nullByteWorkflow) from workflow/api");
43011
- }
43012
- __name(nullByteWorkflow, "nullByteWorkflow");
43013
- nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
43014
- registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
43015
43026
  // workflows/retriable-and-fatal.ts
43016
43027
  async function retryableAndFatalErrorWorkflow() {
43017
43028
  throw new Error("You attempted to execute workflow retryableAndFatalErrorWorkflow function directly. To start a workflow, use start(retryableAndFatalErrorWorkflow) from workflow/api");