@nsshunt/ststestrunner 1.0.35 → 1.0.37
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/ststestrunner.mjs +134 -115
- package/dist/ststestrunner.mjs.map +1 -1
- package/dist/ststestrunner.umd.js +134 -115
- package/dist/ststestrunner.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/serviceinstance.d.ts.map +1 -1
package/dist/ststestrunner.mjs
CHANGED
|
@@ -20170,23 +20170,26 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20170
20170
|
};
|
|
20171
20171
|
});
|
|
20172
20172
|
__privateAdd(this, _LogPayloadEventRetVal, (retVal) => {
|
|
20173
|
-
__privateGet(this, _EmitEvent).call(this, `IEventReturnValueBase`, retVal);
|
|
20174
20173
|
return retVal;
|
|
20175
20174
|
});
|
|
20176
20175
|
__publicField(this, "Stop", async () => {
|
|
20176
|
+
__privateGet(this, _EmitEvent).call(this, "Stopping", {});
|
|
20177
20177
|
if (this.socket) {
|
|
20178
20178
|
__privateGet(this, _debug5).call(this, chalk$1.magenta(`Stopping Service.`));
|
|
20179
20179
|
this.socket.disconnect();
|
|
20180
20180
|
await Sleep(500);
|
|
20181
20181
|
__privateGet(this, _debug5).call(this, chalk$1.magenta(`Service Stopped.`));
|
|
20182
20182
|
}
|
|
20183
|
+
__privateGet(this, _EmitEvent).call(this, "Stopped", {});
|
|
20183
20184
|
});
|
|
20185
|
+
// d.workers = JSON.parse(strFromU8(decompressSync(d.workers as any)));
|
|
20184
20186
|
__publicField(this, "GetService", async () => {
|
|
20185
|
-
const
|
|
20186
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20187
|
+
const raw = __privateGet(this, _EmitEvent).call(this, "GetService", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20187
20188
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.GetService, IEventReturnValueBaseType.serviceDetails),
|
|
20188
|
-
serviceDetails:
|
|
20189
|
-
});
|
|
20189
|
+
serviceDetails: await __privateGet(this, _options5).GetServiceDetails()
|
|
20190
|
+
}));
|
|
20191
|
+
raw.serviceDetails = gzipSync(strToU8(JSON.stringify(raw.serviceDetails)));
|
|
20192
|
+
return raw;
|
|
20190
20193
|
});
|
|
20191
20194
|
__privateAdd(this, _EmitStateChange, (runnerEx) => {
|
|
20192
20195
|
__privateGet(this, _debug5).call(this, chalk$1.rgb(10, 50, 200)` ==>> Runner State Change: [${runnerEx.workerId}] RunnerId: [${runnerEx.id}] State: [${runnerEx.state}]`);
|
|
@@ -20198,6 +20201,7 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20198
20201
|
name: __privateGet(this, _options5).name,
|
|
20199
20202
|
runner: __privateGet(this, _wm).CreateRunnerCopy(runnerEx)
|
|
20200
20203
|
};
|
|
20204
|
+
__privateGet(this, _EmitEvent).call(this, `StateChange`, stateChangeRetVal);
|
|
20201
20205
|
this.socket.emit("StateChange", stateChangeRetVal);
|
|
20202
20206
|
});
|
|
20203
20207
|
__privateAdd(this, _SetupRunnerEventHandlers, (runnerEx) => {
|
|
@@ -20208,33 +20212,27 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20208
20212
|
if (runnerEx) {
|
|
20209
20213
|
__privateGet(this, _SetupRunnerEventHandlers).call(this, runnerEx);
|
|
20210
20214
|
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${__privateGet(this, _clientName)}: AddRunner: WorderId: [${runnerEx.workerId}] RunnerId: [${runnerEx.id}]`));
|
|
20211
|
-
cb(__privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20215
|
+
cb(__privateGet(this, _EmitEvent).call(this, eventRequestCommand, __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20212
20216
|
...__privateGet(this, _GetKeyPayloadData).call(this, eventRequestCommand, IEventReturnValueBaseType.runner),
|
|
20213
20217
|
runner: __privateGet(this, _wm).CreateRunnerCopy(runnerEx)
|
|
20214
|
-
}));
|
|
20218
|
+
})));
|
|
20215
20219
|
} else {
|
|
20216
|
-
cb(__privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20220
|
+
cb(__privateGet(this, _EmitEvent).call(this, eventRequestCommand, __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20217
20221
|
...__privateGet(this, _GetKeyPayloadData).call(this, eventRequestCommand, IEventReturnValueBaseType.runner),
|
|
20218
20222
|
runner: {}
|
|
20219
|
-
}));
|
|
20223
|
+
})));
|
|
20220
20224
|
}
|
|
20221
20225
|
};
|
|
20222
20226
|
socket.on("AddRunner", async (options, cb) => {
|
|
20223
20227
|
var _a2;
|
|
20224
20228
|
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${__privateGet(this, _id2)} ${__privateGet(this, _clientName)}: --> AddRunner: [${JSON.stringify(options)}]`));
|
|
20225
20229
|
const runnerEx = await ((_a2 = __privateGet(this, _wm).GetNextAvailableWorker()) == null ? void 0 : _a2.AddRunner(options));
|
|
20226
|
-
if (runnerEx) {
|
|
20227
|
-
__privateGet(this, _EmitEvent).call(this, "AddRunner", __privateGet(this, _wm).CreateRunnerCopy(runnerEx));
|
|
20228
|
-
} else {
|
|
20229
|
-
__privateGet(this, _EmitEvent).call(this, "AddRunner", {});
|
|
20230
|
-
}
|
|
20231
20230
|
StartRunnerAndRespond(IEventRequestCommand.AddRunner, runnerEx, cb);
|
|
20232
20231
|
});
|
|
20233
20232
|
socket.on("AddRunnerToWorker", async (workerId, options, cb) => {
|
|
20234
20233
|
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${__privateGet(this, _id2)} ${__privateGet(this, _clientName)}: --> AddRunnerToWorker: workerId: [${workerId}] options: [${JSON.stringify(options)}]`));
|
|
20235
20234
|
const workerEx = __privateGet(this, _wm).WorkersEx[workerId];
|
|
20236
20235
|
const runnerEx = await (workerEx == null ? void 0 : workerEx.AddRunner(options));
|
|
20237
|
-
__privateGet(this, _EmitEvent).call(this, "AddRunnerToWorker", __privateGet(this, _wm).CreateRunnerCopy(runnerEx));
|
|
20238
20236
|
StartRunnerAndRespond(IEventRequestCommand.AddRunnerToWorker, runnerEx, cb);
|
|
20239
20237
|
});
|
|
20240
20238
|
});
|
|
@@ -20255,6 +20253,11 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20255
20253
|
// Handle connection logic separately
|
|
20256
20254
|
__privateAdd(this, _OnSocketConnected2, (socket, clientName, joinRooms) => {
|
|
20257
20255
|
__privateGet(this, _debug5).call(this, chalk$1.green(`${__privateGet(this, _id2)} ${clientName}: --> connected`));
|
|
20256
|
+
__privateGet(this, _EmitEvent).call(this, "SocketConnected", {
|
|
20257
|
+
id: __privateGet(this, _id2),
|
|
20258
|
+
clientName,
|
|
20259
|
+
joinRooms: [...joinRooms, "ststrnservices", __privateGet(this, _id2)]
|
|
20260
|
+
});
|
|
20258
20261
|
if (joinRooms.length > 0) {
|
|
20259
20262
|
socket.emit("__STSjoinRoom", joinRooms);
|
|
20260
20263
|
}
|
|
@@ -20278,137 +20281,149 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20278
20281
|
if (runnerEx) {
|
|
20279
20282
|
__privateGet(this, _SetupRunnerEventHandlers).call(this, runnerEx);
|
|
20280
20283
|
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${__privateGet(this, _clientName)}: AddRunner: WorderId: [${runnerEx.workerId}] RunnerId: [${runnerEx.id}]`));
|
|
20284
|
+
__privateGet(this, _EmitEvent).call(this, "AddRunnerToNextAvailableWorker", __privateGet(this, _wm).CreateRunnerCopy(runnerEx));
|
|
20285
|
+
} else {
|
|
20286
|
+
__privateGet(this, _EmitEvent).call(this, "AddRunnerToNextAvailableWorker", {});
|
|
20281
20287
|
}
|
|
20282
20288
|
return runnerEx;
|
|
20283
20289
|
});
|
|
20284
20290
|
__publicField(this, "AddWorker", async (options) => {
|
|
20285
20291
|
const workerEx = await __privateGet(this, _wm).AddWorker(options);
|
|
20286
20292
|
if (workerEx) {
|
|
20287
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20293
|
+
return __privateGet(this, _EmitEvent).call(this, "AddWorker", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20288
20294
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.AddWorker, IEventReturnValueBaseType.worker),
|
|
20289
20295
|
worker: __privateGet(this, _wm).CreateWorkerCopy(workerEx)
|
|
20290
|
-
});
|
|
20296
|
+
}));
|
|
20291
20297
|
} else {
|
|
20292
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20298
|
+
return __privateGet(this, _EmitEvent).call(this, "AddWorker", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20293
20299
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.AddWorker, IEventReturnValueBaseType.worker),
|
|
20294
20300
|
worker: {}
|
|
20295
|
-
});
|
|
20301
|
+
}));
|
|
20296
20302
|
}
|
|
20297
20303
|
});
|
|
20304
|
+
// d.workers = JSON.parse(strFromU8(decompressSync(d.workers as any)));
|
|
20298
20305
|
__publicField(this, "GetArchiveList", async (runnerSearchFilters) => {
|
|
20299
|
-
|
|
20306
|
+
const raw = __privateGet(this, _EmitEvent).call(this, "GetArchiveList", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20300
20307
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.GetArchiveList, IEventReturnValueBaseType.archiveList),
|
|
20301
20308
|
archiveList: gzipSync(strToU8(JSON.stringify(await __privateGet(this, _wm).GetArchiveList(runnerSearchFilters))))
|
|
20302
|
-
});
|
|
20309
|
+
}));
|
|
20310
|
+
raw.archiveList = gzipSync(strToU8(JSON.stringify(raw.archiveList)));
|
|
20311
|
+
return raw;
|
|
20303
20312
|
});
|
|
20313
|
+
// d.workers = JSON.parse(strFromU8(decompressSync(d.workers as any)));
|
|
20304
20314
|
__publicField(this, "GetWorkers", async () => {
|
|
20305
|
-
|
|
20315
|
+
const raw = __privateGet(this, _EmitEvent).call(this, "GetWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20306
20316
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.GetWorkers, IEventReturnValueBaseType.workers),
|
|
20307
|
-
workers:
|
|
20308
|
-
});
|
|
20317
|
+
workers: await __privateGet(this, _wm).GetWorkers()
|
|
20318
|
+
}));
|
|
20319
|
+
raw.workers = gzipSync(strToU8(JSON.stringify(raw.workers)));
|
|
20320
|
+
return raw;
|
|
20309
20321
|
});
|
|
20322
|
+
// d.workers = JSON.parse(strFromU8(decompressSync(d.workers as any)));
|
|
20310
20323
|
__publicField(this, "GetWorkersSmall", async (states) => {
|
|
20311
|
-
|
|
20324
|
+
const raw = __privateGet(this, _EmitEvent).call(this, "GetWorkersSmall", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20312
20325
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.GetWorkersSmall, IEventReturnValueBaseType.workers),
|
|
20313
20326
|
workers: gzipSync(strToU8(JSON.stringify(await __privateGet(this, _wm).GetWorkersSmall(states))))
|
|
20314
|
-
});
|
|
20327
|
+
}));
|
|
20328
|
+
raw.workers = gzipSync(strToU8(JSON.stringify(raw.workers)));
|
|
20329
|
+
return raw;
|
|
20315
20330
|
});
|
|
20316
20331
|
__publicField(this, "StartWorkers", async (workerIds) => {
|
|
20317
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20332
|
+
return __privateGet(this, _EmitEvent).call(this, "StartWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20318
20333
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.StartWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20319
20334
|
executeWorkerActionResult: await __privateGet(this, _wm).StartWorkers(workerIds)
|
|
20320
|
-
});
|
|
20335
|
+
}));
|
|
20321
20336
|
});
|
|
20322
20337
|
__publicField(this, "StopWorkers", async (workerIds) => {
|
|
20323
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20338
|
+
return __privateGet(this, _EmitEvent).call(this, "StopWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20324
20339
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.StopWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20325
20340
|
executeWorkerActionResult: await __privateGet(this, _wm).StopWorkers(workerIds)
|
|
20326
|
-
});
|
|
20341
|
+
}));
|
|
20327
20342
|
});
|
|
20328
20343
|
__publicField(this, "PauseWorkers", async (workerIds) => {
|
|
20329
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20344
|
+
return __privateGet(this, _EmitEvent).call(this, "PauseWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20330
20345
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.PauseWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20331
20346
|
executeWorkerActionResult: await __privateGet(this, _wm).PauseWorkers(workerIds)
|
|
20332
|
-
});
|
|
20347
|
+
}));
|
|
20333
20348
|
});
|
|
20334
20349
|
__publicField(this, "ResumeWorkers", async (workerIds) => {
|
|
20335
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20350
|
+
return __privateGet(this, _EmitEvent).call(this, "ResumeWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20336
20351
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ResumeWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20337
20352
|
executeWorkerActionResult: await __privateGet(this, _wm).ResumeWorkers(workerIds)
|
|
20338
|
-
});
|
|
20353
|
+
}));
|
|
20339
20354
|
});
|
|
20340
20355
|
__publicField(this, "ExecuteWorkers", async (workerIds) => {
|
|
20341
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20356
|
+
return __privateGet(this, _EmitEvent).call(this, "ExecuteWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20342
20357
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ExecuteWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20343
20358
|
executeWorkerActionResult: await __privateGet(this, _wm).ExecuteWorkers(workerIds)
|
|
20344
|
-
});
|
|
20359
|
+
}));
|
|
20345
20360
|
});
|
|
20346
20361
|
__publicField(this, "ResetWorkers", async (workerIds) => {
|
|
20347
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20362
|
+
return __privateGet(this, _EmitEvent).call(this, "ResetWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20348
20363
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ResetWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20349
20364
|
executeWorkerActionResult: await __privateGet(this, _wm).ResetWorkers(workerIds)
|
|
20350
|
-
});
|
|
20365
|
+
}));
|
|
20351
20366
|
});
|
|
20352
20367
|
__publicField(this, "TerminateWorkers", async (workerIds) => {
|
|
20353
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20368
|
+
return __privateGet(this, _EmitEvent).call(this, "TerminateWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20354
20369
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.TerminateWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20355
20370
|
executeWorkerActionResult: await __privateGet(this, _wm).TerminateWorkers(workerIds)
|
|
20356
|
-
});
|
|
20371
|
+
}));
|
|
20357
20372
|
});
|
|
20358
20373
|
__publicField(this, "UpdateWorkers", async (workerIds, options) => {
|
|
20359
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20374
|
+
return __privateGet(this, _EmitEvent).call(this, "UpdateWorkers", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20360
20375
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.UpdateWorkers, IEventReturnValueBaseType.executeWorkerActionResult),
|
|
20361
20376
|
executeWorkerActionResult: await __privateGet(this, _wm).UpdateWorkers(workerIds, options)
|
|
20362
|
-
});
|
|
20377
|
+
}));
|
|
20363
20378
|
});
|
|
20364
20379
|
// Runners (all within a worker)
|
|
20365
20380
|
__publicField(this, "StopRunners", async (workerId, runnerIds) => {
|
|
20366
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20381
|
+
return __privateGet(this, _EmitEvent).call(this, "StopRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20367
20382
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.StopRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20368
20383
|
executeRunnerActionResult: await __privateGet(this, _wm).StopRunners(workerId, runnerIds)
|
|
20369
|
-
});
|
|
20384
|
+
}));
|
|
20370
20385
|
});
|
|
20371
20386
|
__publicField(this, "StartRunners", async (workerId, runnerIds) => {
|
|
20372
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20387
|
+
return __privateGet(this, _EmitEvent).call(this, "StartRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20373
20388
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.StartRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20374
20389
|
executeRunnerActionResult: await __privateGet(this, _wm).StartRunners(workerId, runnerIds)
|
|
20375
|
-
});
|
|
20390
|
+
}));
|
|
20376
20391
|
});
|
|
20377
20392
|
__publicField(this, "PauseRunners", async (workerId, runnerIds) => {
|
|
20378
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20393
|
+
return __privateGet(this, _EmitEvent).call(this, "PauseRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20379
20394
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.PauseRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20380
20395
|
executeRunnerActionResult: await __privateGet(this, _wm).PauseRunners(workerId, runnerIds)
|
|
20381
|
-
});
|
|
20396
|
+
}));
|
|
20382
20397
|
});
|
|
20383
20398
|
__publicField(this, "ResumeRunners", async (workerId, runnerIds) => {
|
|
20384
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20399
|
+
return __privateGet(this, _EmitEvent).call(this, "ResumeRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20385
20400
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ResumeRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20386
20401
|
executeRunnerActionResult: await __privateGet(this, _wm).ResumeRunners(workerId, runnerIds)
|
|
20387
|
-
});
|
|
20402
|
+
}));
|
|
20388
20403
|
});
|
|
20389
20404
|
__publicField(this, "ExecuteRunners", async (workerId, runnerIds) => {
|
|
20390
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20405
|
+
return __privateGet(this, _EmitEvent).call(this, "ExecuteRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20391
20406
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ExecuteRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20392
20407
|
executeRunnerActionResult: await __privateGet(this, _wm).ExecuteRunners(workerId, runnerIds)
|
|
20393
|
-
});
|
|
20408
|
+
}));
|
|
20394
20409
|
});
|
|
20395
20410
|
__publicField(this, "ResetRunners", async (workerId, runnerIds) => {
|
|
20396
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20411
|
+
return __privateGet(this, _EmitEvent).call(this, "ResetRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20397
20412
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.ResetRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20398
20413
|
executeRunnerActionResult: await __privateGet(this, _wm).ResetRunners(workerId, runnerIds)
|
|
20399
|
-
});
|
|
20414
|
+
}));
|
|
20400
20415
|
});
|
|
20401
20416
|
__publicField(this, "TerminateRunners", async (workerId, runnerIds) => {
|
|
20402
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20417
|
+
return __privateGet(this, _EmitEvent).call(this, "TerminateRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20403
20418
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.TerminateRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20404
20419
|
executeRunnerActionResult: await __privateGet(this, _wm).TerminateRunners(workerId, runnerIds)
|
|
20405
|
-
});
|
|
20420
|
+
}));
|
|
20406
20421
|
});
|
|
20407
20422
|
__publicField(this, "UpdateRunners", async (workerId, runnerIds, options) => {
|
|
20408
|
-
return __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20423
|
+
return __privateGet(this, _EmitEvent).call(this, "UpdateRunners", __privateGet(this, _LogPayloadEventRetVal).call(this, {
|
|
20409
20424
|
...__privateGet(this, _GetKeyPayloadData).call(this, IEventRequestCommand.UpdateRunners, IEventReturnValueBaseType.executeRunnerActionResult),
|
|
20410
20425
|
executeRunnerActionResult: await __privateGet(this, _wm).UpdateRunners(workerId, runnerIds, options)
|
|
20411
|
-
});
|
|
20426
|
+
}));
|
|
20412
20427
|
});
|
|
20413
20428
|
// Loop through and attach handlers automatically
|
|
20414
20429
|
__privateAdd(this, _RegisterSocketEvents, (socket, clientName) => {
|
|
@@ -20423,7 +20438,6 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20423
20438
|
__privateGet(this, _HandleAddRunner).call(this, socket);
|
|
20424
20439
|
});
|
|
20425
20440
|
__privateAdd(this, _EmitEvent, (eventName, data) => {
|
|
20426
|
-
console.log(chalk$1.rgb(60, 20, 200)`Going to emit event: [${eventName}] with data: [${JSON.stringify(data, null, 2)}]`);
|
|
20427
20441
|
this.emit(eventName, data);
|
|
20428
20442
|
return data;
|
|
20429
20443
|
});
|
|
@@ -20432,7 +20446,7 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20432
20446
|
return {
|
|
20433
20447
|
// socketio and standard events
|
|
20434
20448
|
"disconnect": (reason) => {
|
|
20435
|
-
__privateGet(this, _EmitEvent).call(this, "
|
|
20449
|
+
__privateGet(this, _EmitEvent).call(this, "disconnect", reason);
|
|
20436
20450
|
__privateGet(this, _error2).call(this, `#disconnect(): [${reason}]`);
|
|
20437
20451
|
},
|
|
20438
20452
|
"connect_error": (error) => {
|
|
@@ -20451,68 +20465,73 @@ class ServiceInstance extends tinyEmitterExports.TinyEmitter {
|
|
|
20451
20465
|
__privateGet(this, _error2).call(this, `#GetSocketEventHandlers(): [${error}]`);
|
|
20452
20466
|
},
|
|
20453
20467
|
// utility commands
|
|
20454
|
-
"GetService": async (cb) => cb(
|
|
20455
|
-
"GetArchiveList": async (runnerSearchFilters, cb) => cb(
|
|
20468
|
+
"GetService": async (cb) => cb(await this.GetService()),
|
|
20469
|
+
"GetArchiveList": async (runnerSearchFilters, cb) => cb(await this.GetArchiveList(runnerSearchFilters)),
|
|
20456
20470
|
// Workers commands
|
|
20457
|
-
"AddWorker": async (options, cb) => cb(
|
|
20458
|
-
"GetWorkers": async (cb) => cb(
|
|
20459
|
-
"GetWorkersSmall": async (states, cb) => cb(
|
|
20460
|
-
"StartWorkers": async (workerIds, cb) => cb(
|
|
20461
|
-
"StopWorkers": async (workerIds, cb) => cb(
|
|
20462
|
-
"PauseWorkers": async (workerIds, cb) => cb(
|
|
20463
|
-
"ResumeWorkers": async (workerIds, cb) => cb(
|
|
20464
|
-
"ExecuteWorkers": async (workerIds, cb) => cb(
|
|
20465
|
-
"ResetWorkers": async (workerIds, cb) => cb(
|
|
20466
|
-
"TerminateWorkers": async (workerIds, cb) => cb(
|
|
20467
|
-
"UpdateWorkers": async (workerIds, options, cb) => cb(
|
|
20471
|
+
"AddWorker": async (options, cb) => cb(await this.AddWorker(options)),
|
|
20472
|
+
"GetWorkers": async (cb) => cb(await this.GetWorkers()),
|
|
20473
|
+
"GetWorkersSmall": async (states, cb) => cb(await this.GetWorkersSmall(states)),
|
|
20474
|
+
"StartWorkers": async (workerIds, cb) => cb(await this.StartWorkers(workerIds)),
|
|
20475
|
+
"StopWorkers": async (workerIds, cb) => cb(await this.StopWorkers(workerIds)),
|
|
20476
|
+
"PauseWorkers": async (workerIds, cb) => cb(await this.PauseWorkers(workerIds)),
|
|
20477
|
+
"ResumeWorkers": async (workerIds, cb) => cb(await this.ResumeWorkers(workerIds)),
|
|
20478
|
+
"ExecuteWorkers": async (workerIds, cb) => cb(await this.ExecuteWorkers(workerIds)),
|
|
20479
|
+
"ResetWorkers": async (workerIds, cb) => cb(await this.ResetWorkers(workerIds)),
|
|
20480
|
+
"TerminateWorkers": async (workerIds, cb) => cb(await this.TerminateWorkers(workerIds)),
|
|
20481
|
+
"UpdateWorkers": async (workerIds, options, cb) => cb(await this.UpdateWorkers(workerIds, options)),
|
|
20468
20482
|
// Runner Commands (All)
|
|
20469
|
-
"StartRunners": async (workerId, runnerIds, cb) => cb(
|
|
20470
|
-
"StopRunners": async (workerId, runnerIds, cb) => cb(
|
|
20471
|
-
"PauseRunners": async (workerId, runnerIds, cb) => cb(
|
|
20472
|
-
"ResumeRunners": async (workerId, runnerIds, cb) => cb(
|
|
20473
|
-
"ExecuteRunners": async (workerId, runnerIds, cb) => cb(
|
|
20474
|
-
"ResetRunners": async (workerId, runnerIds, cb) => cb(
|
|
20475
|
-
"TerminateRunners": async (workerId, runnerIds, cb) => cb(
|
|
20476
|
-
"UpdateRunners": async (workerId, runnerIds, options, cb) => cb(
|
|
20483
|
+
"StartRunners": async (workerId, runnerIds, cb) => cb(await this.StartRunners(workerId, runnerIds)),
|
|
20484
|
+
"StopRunners": async (workerId, runnerIds, cb) => cb(await this.StopRunners(workerId, runnerIds)),
|
|
20485
|
+
"PauseRunners": async (workerId, runnerIds, cb) => cb(await this.PauseRunners(workerId, runnerIds)),
|
|
20486
|
+
"ResumeRunners": async (workerId, runnerIds, cb) => cb(await this.ResumeRunners(workerId, runnerIds)),
|
|
20487
|
+
"ExecuteRunners": async (workerId, runnerIds, cb) => cb(await this.ExecuteRunners(workerId, runnerIds)),
|
|
20488
|
+
"ResetRunners": async (workerId, runnerIds, cb) => cb(await this.ResetRunners(workerId, runnerIds)),
|
|
20489
|
+
"TerminateRunners": async (workerId, runnerIds, cb) => cb(await this.TerminateRunners(workerId, runnerIds)),
|
|
20490
|
+
"UpdateRunners": async (workerId, runnerIds, options, cb) => cb(await this.UpdateRunners(workerId, runnerIds, options))
|
|
20477
20491
|
};
|
|
20478
20492
|
});
|
|
20479
20493
|
__privateSet(this, _options5, options);
|
|
20480
20494
|
__privateSet(this, _clientName, options.name);
|
|
20481
|
-
|
|
20482
|
-
|
|
20495
|
+
const start = async () => {
|
|
20496
|
+
__privateGet(this, _EmitEvent).call(this, "Starting", {});
|
|
20497
|
+
let socketUtilsoptions = {
|
|
20498
|
+
logger: defaultLogger
|
|
20499
|
+
};
|
|
20500
|
+
if (__privateGet(this, _options5).agentOptions) {
|
|
20501
|
+
const agentManager = new AgentManager({
|
|
20502
|
+
agentOptions: __privateGet(this, _options5).agentOptions,
|
|
20503
|
+
httpAgentFactory(options2) {
|
|
20504
|
+
return new https.Agent(options2);
|
|
20505
|
+
},
|
|
20506
|
+
httpsAgentFactory(options2) {
|
|
20507
|
+
return new https.Agent(options2);
|
|
20508
|
+
}
|
|
20509
|
+
});
|
|
20510
|
+
socketUtilsoptions.agentManager = agentManager;
|
|
20511
|
+
}
|
|
20512
|
+
__privateSet(this, _socketUtils2, new SocketIoClientHelper2(socketUtilsoptions));
|
|
20513
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`STS Test Runner Service Instance.`));
|
|
20514
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`This service instance emulates instances of the ststestrunnernode service.`));
|
|
20515
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`Service Instance ID: [${__privateGet(this, _id2)}]`));
|
|
20516
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`Service Instance Name: [${__privateGet(this, _options5).name}]`));
|
|
20517
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`Options: [${JSON.stringify(options)}]`));
|
|
20518
|
+
__privateSet(this, _wm, __privateGet(this, _options5).CreateSTSWorkerManager());
|
|
20519
|
+
__privateGet(this, _info2).call(this, chalk$1.yellow(`Worker Manager ID: [${__privateGet(this, _wm).id}]`));
|
|
20520
|
+
__privateGet(this, _SetupWSSClient2).call(this, __privateGet(this, _clientName), []);
|
|
20521
|
+
for (let i = 0; i < __privateGet(this, _options5).workers; i++) {
|
|
20522
|
+
await this.AddWorker({
|
|
20523
|
+
tags: [""],
|
|
20524
|
+
userData: {},
|
|
20525
|
+
mocked: false,
|
|
20526
|
+
hostName: "host01",
|
|
20527
|
+
agentId: "agent01",
|
|
20528
|
+
userAgent: v4(),
|
|
20529
|
+
logLevel: 4
|
|
20530
|
+
});
|
|
20531
|
+
}
|
|
20532
|
+
__privateGet(this, _EmitEvent).call(this, "Started", {});
|
|
20483
20533
|
};
|
|
20484
|
-
|
|
20485
|
-
const agentManager = new AgentManager({
|
|
20486
|
-
agentOptions: __privateGet(this, _options5).agentOptions,
|
|
20487
|
-
httpAgentFactory(options2) {
|
|
20488
|
-
return new https.Agent(options2);
|
|
20489
|
-
},
|
|
20490
|
-
httpsAgentFactory(options2) {
|
|
20491
|
-
return new https.Agent(options2);
|
|
20492
|
-
}
|
|
20493
|
-
});
|
|
20494
|
-
socketUtilsoptions.agentManager = agentManager;
|
|
20495
|
-
}
|
|
20496
|
-
__privateSet(this, _socketUtils2, new SocketIoClientHelper2(socketUtilsoptions));
|
|
20497
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`STS Test Runner Service Instance.`));
|
|
20498
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`This service instance emulates instances of the ststestrunnernode service.`));
|
|
20499
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`Service Instance ID: [${__privateGet(this, _id2)}]`));
|
|
20500
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`Service Instance Name: [${__privateGet(this, _options5).name}]`));
|
|
20501
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`Options: [${JSON.stringify(options)}]`));
|
|
20502
|
-
__privateSet(this, _wm, __privateGet(this, _options5).CreateSTSWorkerManager());
|
|
20503
|
-
__privateGet(this, _info2).call(this, chalk$1.yellow(`Worker Manager ID: [${__privateGet(this, _wm).id}]`));
|
|
20504
|
-
__privateGet(this, _SetupWSSClient2).call(this, __privateGet(this, _clientName), []);
|
|
20505
|
-
for (let i = 0; i < __privateGet(this, _options5).workers; i++) {
|
|
20506
|
-
this.AddWorker({
|
|
20507
|
-
tags: [""],
|
|
20508
|
-
userData: {},
|
|
20509
|
-
mocked: false,
|
|
20510
|
-
hostName: "host01",
|
|
20511
|
-
agentId: "agent01",
|
|
20512
|
-
userAgent: v4(),
|
|
20513
|
-
logLevel: 4
|
|
20514
|
-
});
|
|
20515
|
-
}
|
|
20534
|
+
start();
|
|
20516
20535
|
}
|
|
20517
20536
|
get socket() {
|
|
20518
20537
|
return __privateGet(this, _socketUtils2).GetSocket("ststccagent");
|