@nsshunt/stsrunnerframework 1.0.120 → 1.0.122

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.
@@ -2392,12 +2392,14 @@ class STSWorkerManager {
2392
2392
  throw error;
2393
2393
  }
2394
2394
  });
2395
- __publicField(this, "GetWorkersSmall", async () => {
2395
+ // only include runners that are in the specified states.
2396
+ // Use [] to include all runners irrespective of state.
2397
+ __publicField(this, "GetWorkersSmall", async (states) => {
2396
2398
  try {
2397
2399
  await __privateGet(this, _SyncWorkerDataFromWorkers).call(this);
2398
2400
  const retVal = {};
2399
2401
  for (const [, workerEx] of Object.entries(__privateGet(this, _workersEx))) {
2400
- retVal[workerEx.id] = this.CreateWorkerCopySmall(workerEx);
2402
+ retVal[workerEx.id] = this.CreateWorkerCopySmall(workerEx, states);
2401
2403
  }
2402
2404
  return retVal;
2403
2405
  } catch (error) {
@@ -2405,9 +2407,10 @@ class STSWorkerManager {
2405
2407
  throw error;
2406
2408
  }
2407
2409
  });
2408
- __publicField(this, "GetArchiveList", (tag) => {
2410
+ // Filter by plan and/or tag. Leave blank to not use in filter.
2411
+ __publicField(this, "GetArchiveList", (plan, tag) => {
2409
2412
  try {
2410
- return __privateGet(this, _archiveList).filter((runner) => tag.localeCompare("") === 0 ? true : runner.options.tag.localeCompare(tag) === 0);
2413
+ return __privateGet(this, _archiveList).filter((runner) => plan.localeCompare("") === 0 ? true : runner.options.plan.localeCompare(plan) === 0).filter((runner) => tag.localeCompare("") === 0 ? true : runner.options.tag.localeCompare(tag) === 0);
2411
2414
  } catch (error) {
2412
2415
  __privateGet(this, _error2).call(this, `GetArchiveList(): Error: [${error}]`);
2413
2416
  throw error;
@@ -3261,15 +3264,15 @@ class STSWorkerManager {
3261
3264
  throw error;
3262
3265
  }
3263
3266
  }
3264
- CreateWorkerCopySmall(workerEx) {
3267
+ CreateWorkerCopySmall(workerEx, states) {
3265
3268
  try {
3266
3269
  const workerCopy = {
3267
3270
  id: workerEx.id,
3268
3271
  runners: {}
3269
3272
  };
3270
- for (const [, runnerEx] of Object.entries(workerEx.runnersEx)) {
3273
+ Object.values(workerEx.runnersEx).filter((runnerEx) => states.length === 0 ? true : states.includes(runnerEx.state)).forEach((runnerEx) => {
3271
3274
  workerCopy.runners[runnerEx.id] = this.CreateRunnerCopySmall(runnerEx);
3272
- }
3275
+ });
3273
3276
  return workerCopy;
3274
3277
  } catch (error) {
3275
3278
  __privateGet(this, _error2).call(this, `CreateWorkerCopySmall(): Error: [${error}]`);