@nsshunt/stsrunnerframework 1.0.129 → 1.0.131

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.
@@ -1551,7 +1551,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1551
1551
  for (let i = 0; i < removeList.length; i++) {
1552
1552
  __privateGet(this, _runners)[removeList[i]].archived = true;
1553
1553
  if (__privateGet(this, _archiveDeleteTimeout) !== 0) {
1554
- setTimeout(() => delete __privateGet(this, _runners)[removeList[i]], __privateGet(this, _archiveDeleteTimeout) * 1e3).unref();
1554
+ if (isNode) {
1555
+ setTimeout(() => delete __privateGet(this, _runners)[removeList[i]], __privateGet(this, _archiveDeleteTimeout) * 1e3).unref();
1556
+ } else {
1557
+ setTimeout(() => delete __privateGet(this, _runners)[removeList[i]], __privateGet(this, _archiveDeleteTimeout) * 1e3);
1558
+ }
1555
1559
  }
1556
1560
  }
1557
1561
  __privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Remaining Runner Count: [${Object.keys(__privateGet(this, _runners)).length}]`));
@@ -1578,12 +1582,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1578
1582
  __privateSet(this, _collectorCollectorPort, workerMessagePort.port);
1579
1583
  if (isNode) {
1580
1584
  __privateGet(this, _collectorCollectorPort).on("message", (data) => {
1581
- __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data)}`);
1585
+ __privateGet(this, _debug).call(this, `collectorCollectorPort on('message'): ${JSON.stringify(data)}`);
1582
1586
  });
1583
1587
  } else {
1584
- __privateGet(this, _collectorCollectorPort).onmessage = function(data) {
1585
- __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data.data)}`);
1586
- };
1588
+ __privateGet(this, _collectorCollectorPort).addEventListener("message", (data) => {
1589
+ __privateGet(this, _debug).call(this, `collectorCollectorPort addEventListener('message'): ${JSON.stringify(data.data)}`);
1590
+ });
1587
1591
  }
1588
1592
  const response = {
1589
1593
  command: eIWMessageCommands.MessagePortResponse,
@@ -2328,7 +2332,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2328
2332
  }
2329
2333
  runnerEx.archived = true;
2330
2334
  if (__privateGet(this, _archiveDeleteTimeout2) !== 0) {
2331
- setTimeout(() => delete workerEx.runnersEx[removeList[i].runnerId], __privateGet(this, _archiveDeleteTimeout2) * 1e3).unref();
2335
+ if (isNode) {
2336
+ setTimeout(() => delete workerEx.runnersEx[removeList[i].runnerId], __privateGet(this, _archiveDeleteTimeout2) * 1e3).unref();
2337
+ } else {
2338
+ setTimeout(() => delete workerEx.runnersEx[removeList[i].runnerId], __privateGet(this, _archiveDeleteTimeout2) * 1e3);
2339
+ }
2332
2340
  }
2333
2341
  }
2334
2342
  }
@@ -2377,7 +2385,16 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2377
2385
  // Filter by plan and/or tag. Leave blank to not use in filter.
2378
2386
  __publicField(this, "GetArchiveList", (runnerSearchFilters) => {
2379
2387
  try {
2380
- return __privateGet(this, _archiveList).filter((runner) => !runnerSearchFilters.plan ? true : !runner.options.plan ? false : runner.options.plan.localeCompare(runnerSearchFilters.plan) === 0).filter((runner) => !runnerSearchFilters.planId ? true : !runner.options.planId ? false : runner.options.planId.localeCompare(runnerSearchFilters.planId) === 0).filter((runner) => !runnerSearchFilters.tag ? true : !runner.options.tag ? false : runner.options.tag.includes(runnerSearchFilters.tag)).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : runner.options.userData[runnerSearchFilters.userDataKey] ? true : false);
2388
+ return __privateGet(this, _archiveList).filter((runner) => {
2389
+ var _a, _b;
2390
+ return !runnerSearchFilters.plan ? true : ((_b = (_a = runner.options.runnerPlan) == null ? void 0 : _a.plan) == null ? void 0 : _b.localeCompare(runnerSearchFilters.plan)) === 0;
2391
+ }).filter((runner) => {
2392
+ var _a, _b;
2393
+ return !runnerSearchFilters.planId ? true : ((_b = (_a = runner.options.runnerPlan) == null ? void 0 : _a.planId) == null ? void 0 : _b.localeCompare(runnerSearchFilters.planId)) === 0;
2394
+ }).filter((runner) => {
2395
+ var _a;
2396
+ return !runnerSearchFilters.tag ? true : (_a = runner.options.tag) == null ? void 0 : _a.includes(runnerSearchFilters.tag);
2397
+ }).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : !!runner.options.userData[runnerSearchFilters.userDataKey]);
2381
2398
  } catch (error) {
2382
2399
  __privateGet(this, _error2).call(this, `GetArchiveList(): Error: [${error}]`);
2383
2400
  return [];
@@ -2415,6 +2432,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2415
2432
  port2
2416
2433
  // collector message port
2417
2434
  } = new MessageChannel();
2435
+ if (!isNode) {
2436
+ port1.start();
2437
+ }
2418
2438
  const workerId = v4();
2419
2439
  const stsWorkerEx = {
2420
2440
  id: workerId,
@@ -2556,10 +2576,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2556
2576
  processMessage(publishMessagePayload);
2557
2577
  });
2558
2578
  } else {
2559
- stsWorkerEx.messagePort.onmessage = (data) => {
2579
+ stsWorkerEx.messagePort.addEventListener("message", (data) => {
2560
2580
  publishMessagePayload = data.data;
2561
2581
  processMessage(publishMessagePayload);
2562
- };
2582
+ });
2563
2583
  }
2564
2584
  __privateGet(this, _workersEx)[stsWorkerEx.id] = stsWorkerEx;
2565
2585
  __privateGet(this, _debug2).call(this, `Added worker: [${stsWorkerEx.id}]`);
@@ -3202,11 +3222,15 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3202
3222
  const retVal = {
3203
3223
  id: runnerEx.id,
3204
3224
  iteration: runnerEx.iteration,
3205
- state: runnerEx.state,
3206
- options: {
3207
- plan: runnerEx.options.plan
3208
- }
3225
+ state: runnerEx.state
3209
3226
  };
3227
+ if (runnerEx.options && runnerEx.options.runnerPlan) {
3228
+ retVal.options = {
3229
+ runnerPlan: {
3230
+ plan: runnerEx.options.runnerPlan.plan
3231
+ }
3232
+ };
3233
+ }
3210
3234
  return retVal;
3211
3235
  } catch (error) {
3212
3236
  __privateGet(this, _error2).call(this, `CreateRunnerCopy(): Error: [${error}]`);