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