@nsshunt/stsrunnerframework 2.0.17 → 2.0.19

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/dist/index.mjs CHANGED
@@ -73,13 +73,6 @@ var IWorkerState = /* @__PURE__ */ function(IWorkerState) {
73
73
  IWorkerState["error"] = "error";
74
74
  return IWorkerState;
75
75
  }({});
76
- var IRunnerSignalType = /* @__PURE__ */ function(IRunnerSignalType) {
77
- IRunnerSignalType["duration"] = "duration";
78
- IRunnerSignalType["iteration"] = "iteration";
79
- IRunnerSignalType["log"] = "log";
80
- IRunnerSignalType["user"] = "user";
81
- return IRunnerSignalType;
82
- }({});
83
76
  var PublishMessageCommandsTestRunner = {
84
77
  ...eIWMessageCommands,
85
78
  GetAccessToken: "__GetAccessToken",
@@ -3480,6 +3473,10 @@ var RunnerInstance = class {
3480
3473
  /** Broker used to send runner commands to the worker and await responses. */
3481
3474
  #messageBroker;
3482
3475
  /**
3476
+ * Runtime data for this runner being executed within a runner plan
3477
+ */
3478
+ runnerPlanRuntime;
3479
+ /**
3483
3480
  * Construct a new live runner runtime instance.
3484
3481
  *
3485
3482
  * Behaviour:
@@ -3683,7 +3680,7 @@ var RunnerInstance = class {
3683
3680
  iteration: this.iteration,
3684
3681
  state: this.state
3685
3682
  };
3686
- if (this.options?.runnerPlan) retVal.runnerPlan = { ...this.options.runnerPlan };
3683
+ if (this.runnerPlanRuntime) retVal.runnerPlanRuntime = { ...this.runnerPlanRuntime };
3687
3684
  return retVal;
3688
3685
  } catch (error) {
3689
3686
  defaultLogger.error(`toRunnerCore(): Error: [${error}]`);
@@ -4069,7 +4066,7 @@ var ArchiveManager = class {
4069
4066
  GetArchiveList = async (runnerSearchFilters) => {
4070
4067
  this.options.logger.debug(`GetArchiveList()`);
4071
4068
  try {
4072
- return this.archiveList.filter((runner) => !runnerSearchFilters.plan ? true : runner.options.runnerPlan?.plan?.localeCompare(runnerSearchFilters.plan) === 0).filter((runner) => !runnerSearchFilters.planInstanceId ? true : runner.options.runnerPlan?.planInstanceId?.localeCompare(runnerSearchFilters.planInstanceId) === 0).filter((runner) => !runnerSearchFilters.tag ? true : runner.options.tag?.includes(runnerSearchFilters.tag)).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : !!runner.options.userData[runnerSearchFilters.userDataKey]);
4069
+ return this.archiveList.filter((runner) => !runnerSearchFilters.plan ? true : runner.options.runnerPlanInstance?.plan?.localeCompare(runnerSearchFilters.plan) === 0).filter((runner) => !runnerSearchFilters.planInstanceId ? true : runner.options.runnerPlanInstance?.planInstanceId?.localeCompare(runnerSearchFilters.planInstanceId) === 0).filter((runner) => !runnerSearchFilters.tag ? true : runner.options.tag?.includes(runnerSearchFilters.tag)).filter((runner) => !runnerSearchFilters.userDataKey ? true : !runner.options.userData ? false : !!runner.options.userData[runnerSearchFilters.userDataKey]);
4073
4070
  } catch (error) {
4074
4071
  this.options.logger.error(`GetArchiveList(): Error: [${error}]`);
4075
4072
  return [];
@@ -6339,6 +6336,17 @@ var STSWorkerManager = class {
6339
6336
  throw error;
6340
6337
  }
6341
6338
  };
6339
+ AddRunnerToWorkerByWorkerId = async (workerId, runnerOptions) => {
6340
+ this.#debug(`AddRunnerToWorkerByWorkerId()`);
6341
+ try {
6342
+ const stsWorkerEx = this.#workerRegistry.GetWorkerEx(workerId);
6343
+ if (stsWorkerEx) {} else throw new Error(`AddRunnerToWorkerByWorkerId(): Error: [Could not GetWorkerEx from workerId: [${workerId}]]`);
6344
+ return this.AddRunnerToWorker(stsWorkerEx, runnerOptions);
6345
+ } catch (error) {
6346
+ this.#error(`AddRunnerToWorkerByWorkerId(): Error: [${error}]`);
6347
+ throw error;
6348
+ }
6349
+ };
6342
6350
  /**
6343
6351
  * Get the current worker-manager options object.
6344
6352
  *
@@ -6559,8 +6567,22 @@ var STSWorkerManager = class {
6559
6567
  GetWorkersCore = async (states) => {
6560
6568
  return this.#workerStateSynchroniser.GetSyncedWorkersCore(states);
6561
6569
  };
6570
+ AddRunner = async (runnerOptions) => {
6571
+ this.#debug(`AddRunner()`);
6572
+ try {
6573
+ const stsWorkerEx = this.GetNextAvailableWorker();
6574
+ if (stsWorkerEx) return this.AddRunnerToWorker(stsWorkerEx, runnerOptions);
6575
+ else throw new Error(`AddRunner(): Error: [Could not get GetNextAvailableWorker()]`);
6576
+ } catch (error) {
6577
+ this.#error(`AddRunner(): Error: [${error}]`);
6578
+ throw error;
6579
+ }
6580
+ };
6581
+ GetNextAvailableWorker = () => {
6582
+ return this.#workerRegistry.GetNextAvailableWorker();
6583
+ };
6562
6584
  };
6563
6585
  //#endregion
6564
- export { AbstractRunnerExecutionWorker, IRunnerSignalType, IRunnerState, IWorkerState, PublishMessageCommandsTestRunner, STSWorkerManager, eIWMessageCommands };
6586
+ export { AbstractRunnerExecutionWorker, IRunnerState, IWorkerState, PublishMessageCommandsTestRunner, STSWorkerManager, eIWMessageCommands };
6565
6587
 
6566
6588
  //# sourceMappingURL=index.mjs.map