@nsshunt/stsrunnerframework 1.0.95 → 1.0.97

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.
@@ -13,7 +13,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
13
13
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
14
14
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
15
15
 
16
- var _collectorCollectorPort, _runners, _options, _workerId, _logMessage, _debug, _error, _warn, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _logMessage2, _debug2, _error2, _processLoopExecutor2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _ExecuteRunnerActionResultFalse, _STSWorkerManager_instances, GetRunnersResponse_fn, _SyncRunnerData, _SyncWorkerDataFromPayload, _SyncWorkerDataFromWorker, _SyncWorkerDataFromWorkers, _PostMessageToWorkerGetRunners;
16
+ var _collectorCollectorPort, _runners, _options, _workerId, _logMessage, _debug, _error, _warn, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _logMessage2, _debug2, _error2, _processLoopExecutor2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _ExecuteCommandOnRunners, _STSWorkerManager_instances, GetRunnersResponse_fn, _SyncRunnerData, _SyncWorkerDataFromPayload, _SyncWorkerDataFromWorker, _SyncWorkerDataFromWorkers, _PostMessageToWorkerGetRunners;
17
17
  const URI_BASE_VUEUTILS = "/";
18
18
  const STS_RF_RES_PREFIX = "STS_R_RF_";
19
19
  const STS_RF_RES_ENT_PREFIX = "STS_RE_RF_";
@@ -2793,8 +2793,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2793
2793
  return busyWorker;
2794
2794
  });
2795
2795
  // IExecuteRunnerActionResult[]
2796
- __privateAdd(this, _HandleAllWorkers, (action, options) => {
2797
- const retVal = Object.values(this.WorkersEx).map((worker) => {
2796
+ __privateAdd(this, _HandleAllWorkers, (workerIds, action, options) => {
2797
+ const retVal = Object.values(this.WorkersEx).filter((workerEx) => workerIds.length === 0 ? true : workerIds.includes(workerEx.id)).map((worker) => {
2798
2798
  if (action === "UpdateOptions") {
2799
2799
  return {
2800
2800
  workerManagerId: __privateGet(this, _id),
@@ -2811,149 +2811,77 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2811
2811
  });
2812
2812
  return retVal;
2813
2813
  });
2814
- __publicField(this, "StartAllWorkers", () => {
2815
- return __privateGet(this, _HandleAllWorkers).call(this, "Start");
2814
+ __publicField(this, "StartAllWorkers", (workerIds) => {
2815
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Start");
2816
2816
  });
2817
- __publicField(this, "StopAllWorkers", () => {
2818
- return __privateGet(this, _HandleAllWorkers).call(this, "Stop");
2817
+ __publicField(this, "StopAllWorkers", (workerIds) => {
2818
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Stop");
2819
2819
  });
2820
- __publicField(this, "PauseAllWorkers", () => {
2821
- return __privateGet(this, _HandleAllWorkers).call(this, "Pause");
2820
+ __publicField(this, "PauseAllWorkers", (workerIds) => {
2821
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Pause");
2822
2822
  });
2823
- __publicField(this, "ResumeAllWorkers", () => {
2824
- return __privateGet(this, _HandleAllWorkers).call(this, "Resume");
2823
+ __publicField(this, "ResumeAllWorkers", (workerIds) => {
2824
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Resume");
2825
2825
  });
2826
- __publicField(this, "ExecuteAllWorkers", () => {
2827
- return __privateGet(this, _HandleAllWorkers).call(this, "Execute");
2826
+ __publicField(this, "ExecuteAllWorkers", (workerIds) => {
2827
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Execute");
2828
2828
  });
2829
- __publicField(this, "ResetAllWorkers", () => {
2830
- return __privateGet(this, _HandleAllWorkers).call(this, "Reset");
2829
+ __publicField(this, "ResetAllWorkers", (workerIds) => {
2830
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Reset");
2831
2831
  });
2832
- __publicField(this, "TerminateAllWorkers", () => {
2833
- return __privateGet(this, _HandleAllWorkers).call(this, "Terminate");
2832
+ __publicField(this, "TerminateAllWorkers", (workerIds) => {
2833
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Terminate");
2834
2834
  });
2835
- __publicField(this, "UpdateAllWorkers", (options) => {
2836
- return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
2835
+ __publicField(this, "UpdateAllWorkers", (workerIds, options) => {
2836
+ return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "UpdateOptions", options);
2837
2837
  });
2838
- __publicField(this, "StopAllRunners", (workerId) => {
2838
+ __privateAdd(this, _ExecuteCommandOnRunners, (workerId, runnerIds, command, executionProfile) => {
2839
2839
  if (__privateGet(this, _workersEx)[workerId]) {
2840
- return __privateGet(this, _workersEx)[workerId].Stop();
2841
- }
2842
- return [];
2843
- });
2844
- __publicField(this, "StopRunner", (workerId, runnerId) => {
2845
- if (__privateGet(this, _workersEx)[workerId]) {
2846
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2847
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Stop();
2848
- }
2849
- }
2850
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2851
- });
2852
- __publicField(this, "StartAllRunners", (workerId) => {
2853
- if (__privateGet(this, _workersEx)[workerId]) {
2854
- return __privateGet(this, _workersEx)[workerId].Start();
2855
- }
2856
- return [];
2857
- });
2858
- __publicField(this, "StartRunner", (workerId, runnerId) => {
2859
- if (__privateGet(this, _workersEx)[workerId]) {
2860
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2861
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Start();
2862
- }
2863
- }
2864
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2865
- });
2866
- __publicField(this, "PauseAllRunners", (workerId) => {
2867
- if (__privateGet(this, _workersEx)[workerId]) {
2868
- return __privateGet(this, _workersEx)[workerId].Pause();
2869
- }
2870
- return [];
2871
- });
2872
- __publicField(this, "PauseRunner", (workerId, runnerId) => {
2873
- if (__privateGet(this, _workersEx)[workerId]) {
2874
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2875
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Pause();
2876
- }
2877
- }
2878
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2879
- });
2880
- __publicField(this, "ResumeAllRunners", (workerId) => {
2881
- if (__privateGet(this, _workersEx)[workerId]) {
2882
- return __privateGet(this, _workersEx)[workerId].Resume();
2883
- }
2884
- return [];
2885
- });
2886
- __publicField(this, "ResumeRunner", (workerId, runnerId) => {
2887
- if (__privateGet(this, _workersEx)[workerId]) {
2888
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2889
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Resume();
2840
+ if (runnerIds.length === 0) {
2841
+ if (command === "UpdateOptions") {
2842
+ return __privateGet(this, _workersEx)[workerId][command](executionProfile);
2843
+ } else {
2844
+ return __privateGet(this, _workersEx)[workerId][command]();
2845
+ }
2846
+ } else {
2847
+ const retVal = [];
2848
+ runnerIds.forEach((runnerId) => {
2849
+ if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2850
+ if (command === "UpdateOptions") {
2851
+ retVal.push(__privateGet(this, _workersEx)[workerId].runnersEx[runnerId][command](executionProfile));
2852
+ } else {
2853
+ retVal.push(__privateGet(this, _workersEx)[workerId].runnersEx[runnerId][command]());
2854
+ }
2855
+ }
2856
+ });
2857
+ return retVal;
2890
2858
  }
2891
2859
  }
2892
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2893
- });
2894
- __publicField(this, "TerminateAllRunners", (workerId) => {
2895
- if (__privateGet(this, _workersEx)[workerId]) {
2896
- return __privateGet(this, _workersEx)[workerId].Terminate();
2897
- }
2898
2860
  return [];
2899
2861
  });
2900
- __publicField(this, "TerminateRunner", (workerId, runnerId) => {
2901
- if (__privateGet(this, _workersEx)[workerId]) {
2902
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2903
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Terminate();
2904
- }
2905
- }
2906
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2862
+ __publicField(this, "StopRunners", (workerId, runnerIds) => {
2863
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Stop");
2907
2864
  });
2908
- __publicField(this, "ResetAllRunners", (workerId) => {
2909
- if (__privateGet(this, _workersEx)[workerId]) {
2910
- return __privateGet(this, _workersEx)[workerId].Reset();
2911
- }
2912
- return [];
2865
+ __publicField(this, "StartRunners", (workerId, runnerIds) => {
2866
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Start");
2913
2867
  });
2914
- __publicField(this, "ResetRunner", (workerId, runnerId) => {
2915
- if (__privateGet(this, _workersEx)[workerId]) {
2916
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2917
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Reset();
2918
- }
2919
- }
2920
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2868
+ __publicField(this, "PauseRunners", (workerId, runnerIds) => {
2869
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Pause");
2921
2870
  });
2922
- __publicField(this, "ExecuteAllRunners", (workerId) => {
2923
- if (__privateGet(this, _workersEx)[workerId]) {
2924
- return __privateGet(this, _workersEx)[workerId].Execute();
2925
- }
2926
- return [];
2871
+ __publicField(this, "ResumeRunners", (workerId, runnerIds) => {
2872
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Resume");
2927
2873
  });
2928
- __publicField(this, "ExecuteRunner", (workerId, runnerId) => {
2929
- if (__privateGet(this, _workersEx)[workerId]) {
2930
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2931
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Execute();
2932
- }
2933
- }
2934
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2874
+ __publicField(this, "ExecuteRunners", (workerId, runnerIds) => {
2875
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Execute");
2935
2876
  });
2936
- __publicField(this, "UpdateAllRunners", (workerId, executionProfile) => {
2937
- if (__privateGet(this, _workersEx)[workerId]) {
2938
- return __privateGet(this, _workersEx)[workerId].UpdateOptions(executionProfile);
2939
- }
2940
- return [];
2877
+ __publicField(this, "ResetRunners", (workerId, runnerIds) => {
2878
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Reset");
2941
2879
  });
2942
- __privateAdd(this, _ExecuteRunnerActionResultFalse, (workerId, runnerId) => {
2943
- return {
2944
- workerManagerId: __privateGet(this, _id),
2945
- workerId,
2946
- runnerId,
2947
- result: false
2948
- };
2880
+ __publicField(this, "TerminateRunners", (workerId, runnerIds) => {
2881
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Terminate");
2949
2882
  });
2950
- __publicField(this, "UpdateRunner", (workerId, runnerId, executionProfile) => {
2951
- if (__privateGet(this, _workersEx)[workerId]) {
2952
- if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
2953
- return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].UpdateOptions(executionProfile);
2954
- }
2955
- }
2956
- return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
2883
+ __publicField(this, "UpdateRunners", (workerId, runnerIds, executionProfile) => {
2884
+ return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "UpdateOptions", executionProfile);
2957
2885
  });
2958
2886
  __privateAdd(this, _SyncRunnerData, (runnerEx, runner) => {
2959
2887
  runnerEx.iteration = runner.iteration;
@@ -3096,7 +3024,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3096
3024
  _TerminateWorker = new WeakMap();
3097
3025
  _BroadcastCommandToAllRunners = new WeakMap();
3098
3026
  _HandleAllWorkers = new WeakMap();
3099
- _ExecuteRunnerActionResultFalse = new WeakMap();
3027
+ _ExecuteCommandOnRunners = new WeakMap();
3100
3028
  _STSWorkerManager_instances = new WeakSet();
3101
3029
  //GetWorkersEx = async (messageId: string, workerEx: IWorkerEx): Promise<IWorkers> => {
3102
3030
  //const retVal2 = await this.#PostMessageToWorkerGetRunners(workerEx, eIWMessageCommands.GetRunners);