@openfn/ws-worker 1.22.2 → 1.23.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # ws-worker
2
2
 
3
+ ## 1.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 01a05ff: on send complete, only send final_state for multi-leaf output state. For single-leaf runs, reutrn final_dataclip_id
8
+ ## 1.22.3
9
+
10
+ ### Patch Changes
11
+
12
+ - 5981876: Security updates
13
+ - Updated dependencies [5981876]
14
+ - @openfn/engine-multi@1.10.7
15
+ - @openfn/lexicon@1.4.2
16
+ - @openfn/runtime@1.8.6
17
+ - @openfn/logger@1.1.2
18
+
3
19
  ## 1.22.2
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -42,8 +42,8 @@ type RunState = {
42
42
  withheldDataclips: Record<string, true>;
43
43
  reasons: Record<string, ExitReason>;
44
44
 
45
- // final dataclip id
46
- lastDataclipId?: string;
45
+ // dataclip ids for leaf nodes (steps with no downstream)
46
+ leafDataclipIds: string[];
47
47
  };
48
48
 
49
49
  type ReceiveHook = {
@@ -175,4 +175,4 @@ type RunReplies = {
175
175
  [STEP_COMPLETE]: l.StepCompleteReply;
176
176
  };
177
177
 
178
- export { CLAIM, GET_CREDENTIAL, GET_DATACLIP, GET_PLAN, INTERNAL_CLAIM_COMPLETE, INTERNAL_CLAIM_START, INTERNAL_RUN_COMPLETE, INTERNAL_SOCKET_READY, QueueEventReplies, QueueEvents, RUN_COMPLETE, RUN_LOG, RUN_LOG_BATCH, RUN_START, RunEvents, RunReplies, STEP_COMPLETE, STEP_START, WORK_AVAILABLE, createServer as default };
178
+ export { CLAIM, GET_CREDENTIAL, GET_DATACLIP, GET_PLAN, INTERNAL_CLAIM_COMPLETE, INTERNAL_CLAIM_START, INTERNAL_RUN_COMPLETE, INTERNAL_SOCKET_READY, type QueueEventReplies, type QueueEvents, RUN_COMPLETE, RUN_LOG, RUN_LOG_BATCH, RUN_START, type RunEvents, type RunReplies, STEP_COMPLETE, STEP_START, WORK_AVAILABLE, createServer as default };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // src/server.ts
2
- import { EventEmitter as EventEmitter2 } from "node:events";
3
- import { promisify } from "node:util";
4
- import { exec as _exec } from "node:child_process";
2
+ import { EventEmitter as EventEmitter2 } from "events";
3
+ import { promisify } from "util";
4
+ import { exec as _exec } from "child_process";
5
5
  import * as Sentry7 from "@sentry/node";
6
6
  import Koa from "koa";
7
- import bodyParser from "koa-bodyparser";
7
+ import bodyParser from "@koa/bodyparser";
8
8
  import koaLogger from "koa-logger";
9
9
  import Router from "@koa/router";
10
10
  import { humanId } from "human-id";
@@ -77,9 +77,9 @@ var waitForRunsAndClaims = (app, logger) => new Promise((resolve) => {
77
77
  var destroy_default = destroy;
78
78
 
79
79
  // src/api/claim.ts
80
- import v8 from "node:v8";
80
+ import v8 from "v8";
81
81
  import * as Sentry from "@sentry/node";
82
- import crypto from "node:crypto";
82
+ import crypto from "crypto";
83
83
  import * as jose from "jose";
84
84
  import { createMockLogger } from "@openfn/logger";
85
85
  var mockLogger = createMockLogger();
@@ -97,10 +97,10 @@ var verifyToken = async (token, publicKey) => {
97
97
  var { DEPLOYED_POD_NAME, WORKER_NAME } = process.env;
98
98
  var NAME = WORKER_NAME || DEPLOYED_POD_NAME;
99
99
  var ClaimError = class extends Error {
100
+ // This breaks the parenting backoff loop
101
+ abort = true;
100
102
  constructor(e) {
101
103
  super(e);
102
- // This breaks the parenting backoff loop
103
- this.abort = true;
104
104
  }
105
105
  };
106
106
  var claimIdGen = 0;
@@ -208,13 +208,12 @@ import {
208
208
  } from "@openfn/engine-multi";
209
209
 
210
210
  // src/util/convert-lightning-plan.ts
211
- import crypto2 from "node:crypto";
212
- import path from "node:path";
211
+ import crypto2 from "crypto";
212
+ import path from "path";
213
213
  import { getNameAndVersion } from "@openfn/runtime";
214
214
  var mapTriggerEdgeCondition = (edge) => {
215
215
  const { condition } = edge;
216
- if (condition === void 0 || condition === "always")
217
- return true;
216
+ if (condition === void 0 || condition === "always") return true;
218
217
  return condition;
219
218
  };
220
219
  var convert_lightning_plan_default = (run, options = {}) => {
@@ -380,7 +379,7 @@ var convert_lightning_plan_default = (run, options = {}) => {
380
379
  // src/util/create-run-state.ts
381
380
  var create_run_state_default = (plan, input) => {
382
381
  const state = {
383
- lastDataclipId: "",
382
+ leafDataclipIds: [],
384
383
  dataclips: {},
385
384
  inputDataclips: {},
386
385
  withheldDataclips: {},
@@ -431,19 +430,19 @@ function serializeMessage(message) {
431
430
  return String(message);
432
431
  }
433
432
  var LightningSocketError = class extends Error {
433
+ name = "LightningSocketError";
434
+ event = "";
435
+ rejectMessage = "";
434
436
  constructor(event, message) {
435
437
  super(`[${event}] ${serializeMessage(message)}`);
436
- this.name = "LightningSocketError";
437
- this.event = "";
438
- this.rejectMessage = "";
439
438
  this.event = event;
440
439
  this.rejectMessage = message;
441
440
  }
442
441
  };
443
442
  var LightningTimeoutError = class extends Error {
443
+ name = "LightningTimeoutError";
444
444
  constructor(event) {
445
445
  super(`[${event}] timeout`);
446
- this.name = "LightningTimeoutError";
447
446
  }
448
447
  };
449
448
 
@@ -617,8 +616,8 @@ ${prefix("worker")}${versions.worker || "unknown"}`;
617
616
 
618
617
  // src/util/load-version.ts
619
618
  import fs from "fs";
620
- import path2 from "node:path";
621
- import { fileURLToPath } from "node:url";
619
+ import path2 from "path";
620
+ import { fileURLToPath } from "url";
622
621
  var version = "";
623
622
  function getVersion() {
624
623
  if (!version) {
@@ -682,7 +681,7 @@ async function onRunStart(context, event) {
682
681
  }
683
682
 
684
683
  // src/events/step-complete.ts
685
- import crypto3 from "node:crypto";
684
+ import crypto3 from "crypto";
686
685
  import { timestamp as timestamp2 } from "@openfn/logger";
687
686
 
688
687
  // src/api/reasons.ts
@@ -731,7 +730,9 @@ async function onStepComplete(context, event, error) {
731
730
  state.dataclips[dataclipId] = event.state;
732
731
  delete state.activeStep;
733
732
  delete state.activeJob;
734
- state.lastDataclipId = dataclipId;
733
+ if (!event.next?.length) {
734
+ state.leafDataclipIds.push(dataclipId);
735
+ }
735
736
  event.next?.forEach((nextJobId) => {
736
737
  state.inputDataclips[nextJobId] = dataclipId;
737
738
  });
@@ -771,7 +772,7 @@ async function onStepComplete(context, event, error) {
771
772
  }
772
773
 
773
774
  // src/events/step-start.ts
774
- import crypto4 from "node:crypto";
775
+ import crypto4 from "crypto";
775
776
  async function onStepStart(context, event) {
776
777
  const { state } = context;
777
778
  state.activeStep = crypto4.randomUUID();
@@ -820,12 +821,18 @@ async function onWorkflowComplete(context, event) {
820
821
  const result = event.state;
821
822
  const reason = calculateRunExitReason(state);
822
823
  await log_final_reason_default(context, reason);
824
+ const isSingleLeaf = state.leafDataclipIds.length === 1 && !state.withheldDataclips[state.leafDataclipIds[0]];
825
+ const payload = {
826
+ timestamp: timeInMicroseconds(event.time),
827
+ ...reason
828
+ };
829
+ if (isSingleLeaf) {
830
+ payload.final_dataclip_id = state.leafDataclipIds[0];
831
+ } else {
832
+ payload.final_state = result;
833
+ }
823
834
  try {
824
- await sendEvent(context, RUN_COMPLETE, {
825
- final_state: result,
826
- timestamp: timeInMicroseconds(event.time),
827
- ...reason
828
- });
835
+ await sendEvent(context, RUN_COMPLETE, payload);
829
836
  } catch (e) {
830
837
  logger.error(
831
838
  `${state.plan.id} failed to send ${RUN_COMPLETE} event. This run will be lost!`
@@ -1163,7 +1170,7 @@ var joinRunChannel = (socket, token, runId, logger, timeout = 30) => {
1163
1170
  var run_default = joinRunChannel;
1164
1171
 
1165
1172
  // src/channels/worker-queue.ts
1166
- import EventEmitter from "node:events";
1173
+ import EventEmitter from "events";
1167
1174
  import * as Sentry6 from "@sentry/node";
1168
1175
  import { Socket as PhxSocket } from "phoenix";
1169
1176
  import { WebSocket } from "ws";
@@ -1282,14 +1289,19 @@ var worker_queue_default = connectToWorkerQueue;
1282
1289
 
1283
1290
  // src/api/workloop.ts
1284
1291
  var Workloop = class {
1292
+ id;
1293
+ queues;
1294
+ capacity;
1295
+ activeRuns = /* @__PURE__ */ new Set();
1296
+ openClaims = {};
1297
+ cancelled = true;
1298
+ promise;
1299
+ logger;
1285
1300
  constructor({
1286
1301
  id,
1287
1302
  queues,
1288
1303
  capacity
1289
1304
  }) {
1290
- this.activeRuns = /* @__PURE__ */ new Set();
1291
- this.openClaims = {};
1292
- this.cancelled = true;
1293
1305
  this.id = id;
1294
1306
  this.queues = queues;
1295
1307
  this.capacity = capacity;
package/dist/start.js CHANGED
@@ -2,9 +2,8 @@
2
2
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
3
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
4
  }) : x)(function(x) {
5
- if (typeof require !== "undefined")
6
- return require.apply(this, arguments);
7
- throw new Error('Dynamic require of "' + x + '" is not supported');
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
7
  });
9
8
 
10
9
  // src/start.ts
@@ -12,8 +11,8 @@ import createLogger from "@openfn/logger";
12
11
  import createRTE from "@openfn/engine-multi";
13
12
 
14
13
  // src/mock/runtime-engine.ts
15
- import { EventEmitter } from "node:events";
16
- import crypto from "node:crypto";
14
+ import { EventEmitter } from "events";
15
+ import crypto from "crypto";
17
16
  import run from "@openfn/runtime";
18
17
 
19
18
  // src/mock/resolvers.ts
@@ -148,12 +147,12 @@ async function createMock() {
148
147
  var runtime_engine_default = createMock;
149
148
 
150
149
  // src/server.ts
151
- import { EventEmitter as EventEmitter3 } from "node:events";
152
- import { promisify } from "node:util";
153
- import { exec as _exec } from "node:child_process";
150
+ import { EventEmitter as EventEmitter3 } from "events";
151
+ import { promisify } from "util";
152
+ import { exec as _exec } from "child_process";
154
153
  import * as Sentry7 from "@sentry/node";
155
154
  import Koa from "koa";
156
- import bodyParser from "koa-bodyparser";
155
+ import bodyParser from "@koa/bodyparser";
157
156
  import koaLogger from "koa-logger";
158
157
  import Router from "@koa/router";
159
158
  import { humanId } from "human-id";
@@ -226,9 +225,9 @@ var waitForRunsAndClaims = (app, logger2) => new Promise((resolve5) => {
226
225
  var destroy_default = destroy;
227
226
 
228
227
  // src/api/claim.ts
229
- import v8 from "node:v8";
228
+ import v8 from "v8";
230
229
  import * as Sentry from "@sentry/node";
231
- import crypto2 from "node:crypto";
230
+ import crypto2 from "crypto";
232
231
  import * as jose from "jose";
233
232
  import { createMockLogger } from "@openfn/logger";
234
233
  var mockLogger = createMockLogger();
@@ -246,10 +245,10 @@ var verifyToken = async (token, publicKey) => {
246
245
  var { DEPLOYED_POD_NAME, WORKER_NAME } = process.env;
247
246
  var NAME = WORKER_NAME || DEPLOYED_POD_NAME;
248
247
  var ClaimError = class extends Error {
248
+ // This breaks the parenting backoff loop
249
+ abort = true;
249
250
  constructor(e) {
250
251
  super(e);
251
- // This breaks the parenting backoff loop
252
- this.abort = true;
253
252
  }
254
253
  };
255
254
  var claimIdGen = 0;
@@ -357,13 +356,12 @@ import {
357
356
  } from "@openfn/engine-multi";
358
357
 
359
358
  // src/util/convert-lightning-plan.ts
360
- import crypto3 from "node:crypto";
361
- import path from "node:path";
359
+ import crypto3 from "crypto";
360
+ import path from "path";
362
361
  import { getNameAndVersion } from "@openfn/runtime";
363
362
  var mapTriggerEdgeCondition = (edge) => {
364
363
  const { condition } = edge;
365
- if (condition === void 0 || condition === "always")
366
- return true;
364
+ if (condition === void 0 || condition === "always") return true;
367
365
  return condition;
368
366
  };
369
367
  var convert_lightning_plan_default = (run2, options = {}) => {
@@ -529,7 +527,7 @@ var convert_lightning_plan_default = (run2, options = {}) => {
529
527
  // src/util/create-run-state.ts
530
528
  var create_run_state_default = (plan, input) => {
531
529
  const state = {
532
- lastDataclipId: "",
530
+ leafDataclipIds: [],
533
531
  dataclips: {},
534
532
  inputDataclips: {},
535
533
  withheldDataclips: {},
@@ -580,19 +578,19 @@ function serializeMessage(message) {
580
578
  return String(message);
581
579
  }
582
580
  var LightningSocketError = class extends Error {
581
+ name = "LightningSocketError";
582
+ event = "";
583
+ rejectMessage = "";
583
584
  constructor(event, message) {
584
585
  super(`[${event}] ${serializeMessage(message)}`);
585
- this.name = "LightningSocketError";
586
- this.event = "";
587
- this.rejectMessage = "";
588
586
  this.event = event;
589
587
  this.rejectMessage = message;
590
588
  }
591
589
  };
592
590
  var LightningTimeoutError = class extends Error {
591
+ name = "LightningTimeoutError";
593
592
  constructor(event) {
594
593
  super(`[${event}] timeout`);
595
- this.name = "LightningTimeoutError";
596
594
  }
597
595
  };
598
596
 
@@ -766,8 +764,8 @@ ${prefix("worker")}${versions.worker || "unknown"}`;
766
764
 
767
765
  // src/util/load-version.ts
768
766
  import fs from "fs";
769
- import path2 from "node:path";
770
- import { fileURLToPath } from "node:url";
767
+ import path2 from "path";
768
+ import { fileURLToPath } from "url";
771
769
  var version = "";
772
770
  function getVersion() {
773
771
  if (!version) {
@@ -831,7 +829,7 @@ async function onRunStart(context, event) {
831
829
  }
832
830
 
833
831
  // src/events/step-complete.ts
834
- import crypto4 from "node:crypto";
832
+ import crypto4 from "crypto";
835
833
  import { timestamp as timestamp2 } from "@openfn/logger";
836
834
 
837
835
  // src/api/reasons.ts
@@ -880,7 +878,9 @@ async function onStepComplete(context, event, error) {
880
878
  state.dataclips[dataclipId] = event.state;
881
879
  delete state.activeStep;
882
880
  delete state.activeJob;
883
- state.lastDataclipId = dataclipId;
881
+ if (!event.next?.length) {
882
+ state.leafDataclipIds.push(dataclipId);
883
+ }
884
884
  event.next?.forEach((nextJobId) => {
885
885
  state.inputDataclips[nextJobId] = dataclipId;
886
886
  });
@@ -920,7 +920,7 @@ async function onStepComplete(context, event, error) {
920
920
  }
921
921
 
922
922
  // src/events/step-start.ts
923
- import crypto5 from "node:crypto";
923
+ import crypto5 from "crypto";
924
924
  async function onStepStart(context, event) {
925
925
  const { state } = context;
926
926
  state.activeStep = crypto5.randomUUID();
@@ -969,12 +969,18 @@ async function onWorkflowComplete(context, event) {
969
969
  const result = event.state;
970
970
  const reason = calculateRunExitReason(state);
971
971
  await log_final_reason_default(context, reason);
972
+ const isSingleLeaf = state.leafDataclipIds.length === 1 && !state.withheldDataclips[state.leafDataclipIds[0]];
973
+ const payload = {
974
+ timestamp: timeInMicroseconds(event.time),
975
+ ...reason
976
+ };
977
+ if (isSingleLeaf) {
978
+ payload.final_dataclip_id = state.leafDataclipIds[0];
979
+ } else {
980
+ payload.final_state = result;
981
+ }
972
982
  try {
973
- await sendEvent(context, RUN_COMPLETE, {
974
- final_state: result,
975
- timestamp: timeInMicroseconds(event.time),
976
- ...reason
977
- });
983
+ await sendEvent(context, RUN_COMPLETE, payload);
978
984
  } catch (e) {
979
985
  logger2.error(
980
986
  `${state.plan.id} failed to send ${RUN_COMPLETE} event. This run will be lost!`
@@ -1312,7 +1318,7 @@ var joinRunChannel = (socket, token, runId, logger2, timeout = 30) => {
1312
1318
  var run_default = joinRunChannel;
1313
1319
 
1314
1320
  // src/channels/worker-queue.ts
1315
- import EventEmitter2 from "node:events";
1321
+ import EventEmitter2 from "events";
1316
1322
  import * as Sentry6 from "@sentry/node";
1317
1323
  import { Socket as PhxSocket } from "phoenix";
1318
1324
  import { WebSocket } from "ws";
@@ -1431,14 +1437,19 @@ var worker_queue_default = connectToWorkerQueue;
1431
1437
 
1432
1438
  // src/api/workloop.ts
1433
1439
  var Workloop = class {
1440
+ id;
1441
+ queues;
1442
+ capacity;
1443
+ activeRuns = /* @__PURE__ */ new Set();
1444
+ openClaims = {};
1445
+ cancelled = true;
1446
+ promise;
1447
+ logger;
1434
1448
  constructor({
1435
1449
  id,
1436
1450
  queues,
1437
1451
  capacity
1438
1452
  }) {
1439
- this.activeRuns = /* @__PURE__ */ new Set();
1440
- this.openClaims = {};
1441
- this.cancelled = true;
1442
1453
  this.id = id;
1443
1454
  this.queues = queues;
1444
1455
  this.capacity = capacity;
@@ -2153,11 +2164,9 @@ function sync_default(start, callback) {
2153
2164
  }
2154
2165
  while (true) {
2155
2166
  tmp = callback(dir, readdirSync(dir));
2156
- if (tmp)
2157
- return resolve(dir, tmp);
2167
+ if (tmp) return resolve(dir, tmp);
2158
2168
  dir = dirname(tmp = dir);
2159
- if (tmp === dir)
2160
- break;
2169
+ if (tmp === dir) break;
2161
2170
  }
2162
2171
  }
2163
2172
 
@@ -3174,12 +3183,12 @@ function getProcessArgvBin() {
3174
3183
  }
3175
3184
 
3176
3185
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
3177
- var YError = class extends Error {
3186
+ var YError = class _YError extends Error {
3178
3187
  constructor(msg) {
3179
3188
  super(msg || "yargs error");
3180
3189
  this.name = "YError";
3181
3190
  if (Error.captureStackTrace) {
3182
- Error.captureStackTrace(this, YError);
3191
+ Error.captureStackTrace(this, _YError);
3183
3192
  }
3184
3193
  }
3185
3194
  };
@@ -5206,19 +5215,14 @@ function mergeDeep(config1, config2) {
5206
5215
 
5207
5216
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yargs-factory.js
5208
5217
  var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
5209
- if (kind === "m")
5210
- throw new TypeError("Private method is not writable");
5211
- if (kind === "a" && !f)
5212
- throw new TypeError("Private accessor was defined without a setter");
5213
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5214
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
5218
+ if (kind === "m") throw new TypeError("Private method is not writable");
5219
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5220
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5215
5221
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
5216
5222
  };
5217
5223
  var __classPrivateFieldGet = function(receiver, state, kind, f) {
5218
- if (kind === "a" && !f)
5219
- throw new TypeError("Private accessor was defined without a getter");
5220
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5221
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
5224
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
5225
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5222
5226
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5223
5227
  };
5224
5228
  var _YargsInstance_command;
@@ -5270,42 +5274,42 @@ function YargsFactory(_shim) {
5270
5274
  return yargs;
5271
5275
  };
5272
5276
  }
5273
- var kCopyDoubleDash = Symbol("copyDoubleDash");
5274
- var kCreateLogger = Symbol("copyDoubleDash");
5275
- var kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject");
5276
- var kEmitWarning = Symbol("emitWarning");
5277
- var kFreeze = Symbol("freeze");
5278
- var kGetDollarZero = Symbol("getDollarZero");
5279
- var kGetParserConfiguration = Symbol("getParserConfiguration");
5280
- var kGetUsageConfiguration = Symbol("getUsageConfiguration");
5281
- var kGuessLocale = Symbol("guessLocale");
5282
- var kGuessVersion = Symbol("guessVersion");
5283
- var kParsePositionalNumbers = Symbol("parsePositionalNumbers");
5284
- var kPkgUp = Symbol("pkgUp");
5285
- var kPopulateParserHintArray = Symbol("populateParserHintArray");
5286
- var kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary");
5287
- var kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary");
5288
- var kPopulateParserHintDictionary = Symbol("populateParserHintDictionary");
5289
- var kSanitizeKey = Symbol("sanitizeKey");
5290
- var kSetKey = Symbol("setKey");
5291
- var kUnfreeze = Symbol("unfreeze");
5292
- var kValidateAsync = Symbol("validateAsync");
5293
- var kGetCommandInstance = Symbol("getCommandInstance");
5294
- var kGetContext = Symbol("getContext");
5295
- var kGetHasOutput = Symbol("getHasOutput");
5296
- var kGetLoggerInstance = Symbol("getLoggerInstance");
5297
- var kGetParseContext = Symbol("getParseContext");
5298
- var kGetUsageInstance = Symbol("getUsageInstance");
5299
- var kGetValidationInstance = Symbol("getValidationInstance");
5300
- var kHasParseCallback = Symbol("hasParseCallback");
5301
- var kIsGlobalContext = Symbol("isGlobalContext");
5302
- var kPostProcess = Symbol("postProcess");
5303
- var kRebase = Symbol("rebase");
5304
- var kReset = Symbol("reset");
5305
- var kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands");
5306
- var kRunValidation = Symbol("runValidation");
5307
- var kSetHasOutput = Symbol("setHasOutput");
5308
- var kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys");
5277
+ var kCopyDoubleDash = /* @__PURE__ */ Symbol("copyDoubleDash");
5278
+ var kCreateLogger = /* @__PURE__ */ Symbol("copyDoubleDash");
5279
+ var kDeleteFromParserHintObject = /* @__PURE__ */ Symbol("deleteFromParserHintObject");
5280
+ var kEmitWarning = /* @__PURE__ */ Symbol("emitWarning");
5281
+ var kFreeze = /* @__PURE__ */ Symbol("freeze");
5282
+ var kGetDollarZero = /* @__PURE__ */ Symbol("getDollarZero");
5283
+ var kGetParserConfiguration = /* @__PURE__ */ Symbol("getParserConfiguration");
5284
+ var kGetUsageConfiguration = /* @__PURE__ */ Symbol("getUsageConfiguration");
5285
+ var kGuessLocale = /* @__PURE__ */ Symbol("guessLocale");
5286
+ var kGuessVersion = /* @__PURE__ */ Symbol("guessVersion");
5287
+ var kParsePositionalNumbers = /* @__PURE__ */ Symbol("parsePositionalNumbers");
5288
+ var kPkgUp = /* @__PURE__ */ Symbol("pkgUp");
5289
+ var kPopulateParserHintArray = /* @__PURE__ */ Symbol("populateParserHintArray");
5290
+ var kPopulateParserHintSingleValueDictionary = /* @__PURE__ */ Symbol("populateParserHintSingleValueDictionary");
5291
+ var kPopulateParserHintArrayDictionary = /* @__PURE__ */ Symbol("populateParserHintArrayDictionary");
5292
+ var kPopulateParserHintDictionary = /* @__PURE__ */ Symbol("populateParserHintDictionary");
5293
+ var kSanitizeKey = /* @__PURE__ */ Symbol("sanitizeKey");
5294
+ var kSetKey = /* @__PURE__ */ Symbol("setKey");
5295
+ var kUnfreeze = /* @__PURE__ */ Symbol("unfreeze");
5296
+ var kValidateAsync = /* @__PURE__ */ Symbol("validateAsync");
5297
+ var kGetCommandInstance = /* @__PURE__ */ Symbol("getCommandInstance");
5298
+ var kGetContext = /* @__PURE__ */ Symbol("getContext");
5299
+ var kGetHasOutput = /* @__PURE__ */ Symbol("getHasOutput");
5300
+ var kGetLoggerInstance = /* @__PURE__ */ Symbol("getLoggerInstance");
5301
+ var kGetParseContext = /* @__PURE__ */ Symbol("getParseContext");
5302
+ var kGetUsageInstance = /* @__PURE__ */ Symbol("getUsageInstance");
5303
+ var kGetValidationInstance = /* @__PURE__ */ Symbol("getValidationInstance");
5304
+ var kHasParseCallback = /* @__PURE__ */ Symbol("hasParseCallback");
5305
+ var kIsGlobalContext = /* @__PURE__ */ Symbol("isGlobalContext");
5306
+ var kPostProcess = /* @__PURE__ */ Symbol("postProcess");
5307
+ var kRebase = /* @__PURE__ */ Symbol("rebase");
5308
+ var kReset = /* @__PURE__ */ Symbol("reset");
5309
+ var kRunYargsParserAndExecuteCommands = /* @__PURE__ */ Symbol("runYargsParserAndExecuteCommands");
5310
+ var kRunValidation = /* @__PURE__ */ Symbol("runValidation");
5311
+ var kSetHasOutput = /* @__PURE__ */ Symbol("setHasOutput");
5312
+ var kTrackManuallySetKeys = /* @__PURE__ */ Symbol("kTrackManuallySetKeys");
5309
5313
  var YargsInstance = class {
5310
5314
  constructor(processArgs = [], cwd, parentRequire, shim3) {
5311
5315
  this.customScriptName = false;
@@ -6203,7 +6207,7 @@ var YargsInstance = class {
6203
6207
  }
6204
6208
  [kDeleteFromParserHintObject](optionKey) {
6205
6209
  objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => {
6206
- if (((key) => key === "configObjects")(hintKey))
6210
+ if (/* @__PURE__ */ ((key) => key === "configObjects")(hintKey))
6207
6211
  return;
6208
6212
  const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey];
6209
6213
  if (Array.isArray(hint)) {
@@ -6331,7 +6335,7 @@ var YargsInstance = class {
6331
6335
  key.forEach((k) => {
6332
6336
  builder(k, value);
6333
6337
  });
6334
- } else if (((key2) => typeof key2 === "object")(key)) {
6338
+ } else if (/* @__PURE__ */ ((key2) => typeof key2 === "object")(key)) {
6335
6339
  for (const k of objectKeys(key)) {
6336
6340
  builder(k, key[k]);
6337
6341
  }
@@ -7067,26 +7071,8 @@ if (args.mock) {
7067
7071
  /*! Bundled license information:
7068
7072
 
7069
7073
  yargs-parser/build/lib/string-utils.js:
7070
- (**
7071
- * @license
7072
- * Copyright (c) 2016, Contributors
7073
- * SPDX-License-Identifier: ISC
7074
- *)
7075
-
7076
7074
  yargs-parser/build/lib/tokenize-arg-string.js:
7077
- (**
7078
- * @license
7079
- * Copyright (c) 2016, Contributors
7080
- * SPDX-License-Identifier: ISC
7081
- *)
7082
-
7083
7075
  yargs-parser/build/lib/yargs-parser-types.js:
7084
- (**
7085
- * @license
7086
- * Copyright (c) 2016, Contributors
7087
- * SPDX-License-Identifier: ISC
7088
- *)
7089
-
7090
7076
  yargs-parser/build/lib/yargs-parser.js:
7091
7077
  (**
7092
7078
  * @license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/ws-worker",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "description": "A Websocket Worker to connect Lightning to a Runtime Engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -10,40 +10,39 @@
10
10
  "author": "Open Function Group <admin@openfn.org>",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@koa/router": "^12.0.2",
14
- "@sentry/node": "^9.46.0",
13
+ "@koa/bodyparser": "^6.1.0",
14
+ "@koa/router": "^15.4.0",
15
+ "@sentry/node": "^10.44.0",
15
16
  "@types/koa-logger": "^3.1.5",
16
17
  "@types/ws": "^8.18.1",
17
18
  "fast-safe-stringify": "^2.1.1",
18
19
  "figures": "^5.0.0",
19
- "human-id": "^4.1.1",
20
+ "human-id": "^4.1.3",
20
21
  "jose": "^4.15.9",
21
- "koa": "^2.16.2",
22
- "koa-bodyparser": "^4.4.1",
22
+ "koa": "^2.16.4",
23
23
  "koa-logger": "^3.2.1",
24
24
  "phoenix": "1.7.10",
25
- "ws": "^8.18.3",
26
- "@openfn/lexicon": "^1.4.1",
27
- "@openfn/logger": "1.1.1",
28
- "@openfn/runtime": "1.8.5",
29
- "@openfn/engine-multi": "1.10.6"
25
+ "ws": "^8.19.0",
26
+ "@openfn/engine-multi": "1.10.7",
27
+ "@openfn/runtime": "1.8.6",
28
+ "@openfn/logger": "1.1.2",
29
+ "@openfn/lexicon": "^1.4.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/koa": "^2.15.0",
33
- "@types/koa-bodyparser": "^4.3.12",
34
- "@types/koa__router": "^12.0.4",
35
- "@types/node": "^18.19.127",
33
+ "@types/koa__router": "^12.0.5",
34
+ "@types/node": "^18.19.130",
36
35
  "@types/nodemon": "1.19.3",
37
- "@types/phoenix": "^1.6.6",
38
- "@types/yargs": "^17.0.33",
39
- "ava": "5.1.0",
40
- "nodemon": "3.0.1",
36
+ "@types/phoenix": "^1.6.7",
37
+ "@types/yargs": "^17.0.35",
38
+ "ava": "5.3.1",
39
+ "nodemon": "3.1.14",
41
40
  "sentry-testkit": "^6.2.2",
42
41
  "tslib": "^2.8.1",
43
- "tsup": "^6.7.0",
42
+ "tsup": "^8.5.1",
44
43
  "typescript": "^4.9.5",
45
44
  "yargs": "^17.7.2",
46
- "@openfn/lightning-mock": "2.4.8"
45
+ "@openfn/lightning-mock": "2.4.9"
47
46
  },
48
47
  "files": [
49
48
  "dist",