@nsshunt/ststestrunner 1.1.39 → 1.1.41

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.
@@ -1,44 +1,49 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3
+ var __create$1 = Object.create;
4
+ var __defProp$1 = Object.defineProperty;
5
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
7
+ var __getProtoOf$1 = Object.getPrototypeOf;
8
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin$1 = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
10
  var __exportAll = (all, no_symbols) => {
10
11
  let target = {};
11
- for (var name in all) __defProp(target, name, {
12
+ for (var name in all) __defProp$1(target, name, {
12
13
  get: all[name],
13
14
  enumerable: true
14
15
  });
15
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ if (!no_symbols) __defProp$1(target, Symbol.toStringTag, { value: "Module" });
16
17
  return target;
17
18
  };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ var __copyProps$1 = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
20
21
  key = keys[i];
21
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
22
23
  get: ((k) => from[k]).bind(null, key),
23
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
24
25
  });
25
26
  }
26
27
  return to;
27
28
  };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
29
30
  value: mod,
30
31
  enumerable: true
31
32
  }) : target, mod));
32
33
  //#endregion
33
34
  let _nsshunt_stsrunnerframework = require("@nsshunt/stsrunnerframework");
34
35
  let chalk = require("chalk");
35
- chalk = __toESM(chalk, 1);
36
+ chalk = __toESM$1(chalk, 1);
36
37
  let _nsshunt_stsutils = require("@nsshunt/stsutils");
37
38
  let _nsshunt_stsfhirclient = require("@nsshunt/stsfhirclient");
38
39
  let node_http = require("node:http");
39
- node_http = __toESM(node_http, 1);
40
+ node_http = __toESM$1(node_http, 1);
40
41
  let node_https = require("node:https");
41
- node_https = __toESM(node_https, 1);
42
+ node_https = __toESM$1(node_https, 1);
43
+ require("lodash.clonedeep");
44
+ require("axios");
45
+ require("vue");
46
+ let _nsshunt_stssocketioutils = require("@nsshunt/stssocketioutils");
42
47
  //#region src/libmodule/testCaseFhirBase.ts
43
48
  var TestCaseFhirBase = class {
44
49
  #options;
@@ -35765,55 +35770,1323 @@ var ResourceDataGenerator = class {
35765
35770
  return this.#randomNameList[index.toString()];
35766
35771
  };
35767
35772
  };
35773
+ (/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
35774
+ function E() {}
35775
+ E.prototype = {
35776
+ on: function(name, callback, ctx) {
35777
+ var e = this.e || (this.e = {});
35778
+ (e[name] || (e[name] = [])).push({
35779
+ fn: callback,
35780
+ ctx
35781
+ });
35782
+ return this;
35783
+ },
35784
+ once: function(name, callback, ctx) {
35785
+ var self = this;
35786
+ function listener() {
35787
+ self.off(name, listener);
35788
+ callback.apply(ctx, arguments);
35789
+ }
35790
+ listener._ = callback;
35791
+ return this.on(name, listener, ctx);
35792
+ },
35793
+ emit: function(name) {
35794
+ var data = [].slice.call(arguments, 1);
35795
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
35796
+ var i = 0;
35797
+ var len = evtArr.length;
35798
+ for (; i < len; i++) evtArr[i].fn.apply(evtArr[i].ctx, data);
35799
+ return this;
35800
+ },
35801
+ off: function(name, callback) {
35802
+ var e = this.e || (this.e = {});
35803
+ var evts = e[name];
35804
+ var liveEvents = [];
35805
+ if (evts && callback) {
35806
+ for (var i = 0, len = evts.length; i < len; i++) if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]);
35807
+ }
35808
+ liveEvents.length ? e[name] = liveEvents : delete e[name];
35809
+ return this;
35810
+ }
35811
+ };
35812
+ module.exports = E;
35813
+ module.exports.TinyEmitter = E;
35814
+ })))();
35815
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
35816
+ var Gauge = /* @__PURE__ */ function(Gauge) {
35817
+ Gauge["ACTIVE_REQUEST_GAUGE"] = "a";
35818
+ Gauge["AUTHENTICATION_COUNT_GAUGE"] = "b";
35819
+ Gauge["AUTHENTICATION_ERROR_COUNT_GAUGE"] = "aa";
35820
+ Gauge["AUTHENTICATION_RETRY_COUNT_GAUGE"] = "ab";
35821
+ Gauge["CONNECTION_POOL_IDLE_GAUGE"] = "c";
35822
+ Gauge["CONNECTION_POOL_TOTAL_GAUGE"] = "d";
35823
+ Gauge["CONNECTION_POOL_WAITING_GAUGE"] = "e";
35824
+ Gauge["CPU_LOAD_GAUGE"] = "f";
35825
+ Gauge["CPU_SYSTEM_LOAD_GAUGE"] = "g";
35826
+ Gauge["DURATION_GAUGE"] = "h";
35827
+ Gauge["DURATION_HISTOGRAM_GAUGE"] = "i";
35828
+ Gauge["ERROR_COUNT_GAUGE"] = "j";
35829
+ Gauge["LATENCY_GAUGE"] = "k";
35830
+ Gauge["LATENCY_HISTOGRAM_GAUGE"] = "l";
35831
+ Gauge["LOGGER"] = "m";
35832
+ Gauge["LOGGER_COPY"] = "n";
35833
+ Gauge["NETWORK_RX_GAUGE"] = "o";
35834
+ Gauge["NETWORK_TX_GAUGE"] = "p";
35835
+ Gauge["REQUEST_COUNT_GAUGE"] = "q";
35836
+ Gauge["RETRY_COUNT_GAUGE"] = "r";
35837
+ Gauge["TIMER_GAUGE"] = "s";
35838
+ Gauge["VELOCITY_GAUGE"] = "t";
35839
+ Gauge["CONNECTION_COUNT_GAUGE"] = "u";
35840
+ Gauge["OBJECT_GAUGE"] = "v";
35841
+ Gauge["PAYLOAD_SIZE"] = "w";
35842
+ Gauge["CORE_COUNT_GAUGE"] = "x";
35843
+ Gauge["CHILD_COUNT"] = "y";
35844
+ Gauge["UNKNOWN"] = "z";
35845
+ return Gauge;
35846
+ }({});
35847
+ var GaugeTypes = /* @__PURE__ */ function(GaugeTypes) {
35848
+ GaugeTypes["GAUGE_TYPE"] = "_";
35849
+ GaugeTypes["INSTRUMENT_GAUGE"] = "a";
35850
+ GaugeTypes["INSTRUMENT_VELOCITY"] = "b";
35851
+ GaugeTypes["INSTRUMENT_HISTOGRAM"] = "c";
35852
+ GaugeTypes["INSTRUMENT_LOG"] = "d";
35853
+ GaugeTypes["INSTRUMENT_TIMER"] = "e";
35854
+ GaugeTypes["INSTRUMENT_OBJECT"] = "f";
35855
+ return GaugeTypes;
35856
+ }({});
35857
+ GaugeTypes.GAUGE_TYPE;
35858
+ var require_timsort$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
35859
+ /****
35860
+ * The MIT License
35861
+ *
35862
+ * Copyright (c) 2015 Marco Ziccardi
35863
+ *
35864
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
35865
+ * of this software and associated documentation files (the "Software"), to deal
35866
+ * in the Software without restriction, including without limitation the rights
35867
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35868
+ * copies of the Software, and to permit persons to whom the Software is
35869
+ * furnished to do so, subject to the following conditions:
35870
+ *
35871
+ * The above copyright notice and this permission notice shall be included in
35872
+ * all copies or substantial portions of the Software.
35873
+ *
35874
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35875
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35876
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35877
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35878
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35879
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35880
+ * THE SOFTWARE.
35881
+ *
35882
+ ****/
35883
+ (function(global, factory) {
35884
+ if (typeof define === "function" && define.amd) define("timsort", ["exports"], factory);
35885
+ else if (typeof exports !== "undefined") factory(exports);
35886
+ else {
35887
+ var mod = { exports: {} };
35888
+ factory(mod.exports);
35889
+ global.timsort = mod.exports;
35890
+ }
35891
+ })(exports, function(exports$1) {
35892
+ "use strict";
35893
+ exports$1.__esModule = true;
35894
+ exports$1.sort = sort;
35895
+ function _classCallCheck(instance, Constructor) {
35896
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
35897
+ }
35898
+ var DEFAULT_MIN_MERGE = 32;
35899
+ var DEFAULT_MIN_GALLOPING = 7;
35900
+ var DEFAULT_TMP_STORAGE_LENGTH = 256;
35901
+ var POWERS_OF_TEN = [
35902
+ 1,
35903
+ 10,
35904
+ 100,
35905
+ 1e3,
35906
+ 1e4,
35907
+ 1e5,
35908
+ 1e6,
35909
+ 1e7,
35910
+ 1e8,
35911
+ 1e9
35912
+ ];
35913
+ function log10(x) {
35914
+ if (x < 1e5) {
35915
+ if (x < 100) return x < 10 ? 0 : 1;
35916
+ if (x < 1e4) return x < 1e3 ? 2 : 3;
35917
+ return 4;
35918
+ }
35919
+ if (x < 1e7) return x < 1e6 ? 5 : 6;
35920
+ if (x < 1e9) return x < 1e8 ? 7 : 8;
35921
+ return 9;
35922
+ }
35923
+ function alphabeticalCompare(a, b) {
35924
+ if (a === b) return 0;
35925
+ if (~~a === a && ~~b === b) {
35926
+ if (a === 0 || b === 0) return a < b ? -1 : 1;
35927
+ if (a < 0 || b < 0) {
35928
+ if (b >= 0) return -1;
35929
+ if (a >= 0) return 1;
35930
+ a = -a;
35931
+ b = -b;
35932
+ }
35933
+ var al = log10(a);
35934
+ var bl = log10(b);
35935
+ var t = 0;
35936
+ if (al < bl) {
35937
+ a *= POWERS_OF_TEN[bl - al - 1];
35938
+ b /= 10;
35939
+ t = -1;
35940
+ } else if (al > bl) {
35941
+ b *= POWERS_OF_TEN[al - bl - 1];
35942
+ a /= 10;
35943
+ t = 1;
35944
+ }
35945
+ if (a === b) return t;
35946
+ return a < b ? -1 : 1;
35947
+ }
35948
+ var aStr = String(a);
35949
+ var bStr = String(b);
35950
+ if (aStr === bStr) return 0;
35951
+ return aStr < bStr ? -1 : 1;
35952
+ }
35953
+ function minRunLength(n) {
35954
+ var r = 0;
35955
+ while (n >= DEFAULT_MIN_MERGE) {
35956
+ r |= n & 1;
35957
+ n >>= 1;
35958
+ }
35959
+ return n + r;
35960
+ }
35961
+ function makeAscendingRun(array, lo, hi, compare) {
35962
+ var runHi = lo + 1;
35963
+ if (runHi === hi) return 1;
35964
+ if (compare(array[runHi++], array[lo]) < 0) {
35965
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) runHi++;
35966
+ reverseRun(array, lo, runHi);
35967
+ } else while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) runHi++;
35968
+ return runHi - lo;
35969
+ }
35970
+ function reverseRun(array, lo, hi) {
35971
+ hi--;
35972
+ while (lo < hi) {
35973
+ var t = array[lo];
35974
+ array[lo++] = array[hi];
35975
+ array[hi--] = t;
35976
+ }
35977
+ }
35978
+ function binaryInsertionSort(array, lo, hi, start, compare) {
35979
+ if (start === lo) start++;
35980
+ for (; start < hi; start++) {
35981
+ var pivot = array[start];
35982
+ var left = lo;
35983
+ var right = start;
35984
+ while (left < right) {
35985
+ var mid = left + right >>> 1;
35986
+ if (compare(pivot, array[mid]) < 0) right = mid;
35987
+ else left = mid + 1;
35988
+ }
35989
+ var n = start - left;
35990
+ switch (n) {
35991
+ case 3: array[left + 3] = array[left + 2];
35992
+ case 2: array[left + 2] = array[left + 1];
35993
+ case 1:
35994
+ array[left + 1] = array[left];
35995
+ break;
35996
+ default: while (n > 0) {
35997
+ array[left + n] = array[left + n - 1];
35998
+ n--;
35999
+ }
36000
+ }
36001
+ array[left] = pivot;
36002
+ }
36003
+ }
36004
+ function gallopLeft(value, array, start, length, hint, compare) {
36005
+ var lastOffset = 0;
36006
+ var maxOffset = 0;
36007
+ var offset = 1;
36008
+ if (compare(value, array[start + hint]) > 0) {
36009
+ maxOffset = length - hint;
36010
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
36011
+ lastOffset = offset;
36012
+ offset = (offset << 1) + 1;
36013
+ if (offset <= 0) offset = maxOffset;
36014
+ }
36015
+ if (offset > maxOffset) offset = maxOffset;
36016
+ lastOffset += hint;
36017
+ offset += hint;
36018
+ } else {
36019
+ maxOffset = hint + 1;
36020
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
36021
+ lastOffset = offset;
36022
+ offset = (offset << 1) + 1;
36023
+ if (offset <= 0) offset = maxOffset;
36024
+ }
36025
+ if (offset > maxOffset) offset = maxOffset;
36026
+ var tmp = lastOffset;
36027
+ lastOffset = hint - offset;
36028
+ offset = hint - tmp;
36029
+ }
36030
+ lastOffset++;
36031
+ while (lastOffset < offset) {
36032
+ var m = lastOffset + (offset - lastOffset >>> 1);
36033
+ if (compare(value, array[start + m]) > 0) lastOffset = m + 1;
36034
+ else offset = m;
36035
+ }
36036
+ return offset;
36037
+ }
36038
+ function gallopRight(value, array, start, length, hint, compare) {
36039
+ var lastOffset = 0;
36040
+ var maxOffset = 0;
36041
+ var offset = 1;
36042
+ if (compare(value, array[start + hint]) < 0) {
36043
+ maxOffset = hint + 1;
36044
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
36045
+ lastOffset = offset;
36046
+ offset = (offset << 1) + 1;
36047
+ if (offset <= 0) offset = maxOffset;
36048
+ }
36049
+ if (offset > maxOffset) offset = maxOffset;
36050
+ var tmp = lastOffset;
36051
+ lastOffset = hint - offset;
36052
+ offset = hint - tmp;
36053
+ } else {
36054
+ maxOffset = length - hint;
36055
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
36056
+ lastOffset = offset;
36057
+ offset = (offset << 1) + 1;
36058
+ if (offset <= 0) offset = maxOffset;
36059
+ }
36060
+ if (offset > maxOffset) offset = maxOffset;
36061
+ lastOffset += hint;
36062
+ offset += hint;
36063
+ }
36064
+ lastOffset++;
36065
+ while (lastOffset < offset) {
36066
+ var m = lastOffset + (offset - lastOffset >>> 1);
36067
+ if (compare(value, array[start + m]) < 0) offset = m;
36068
+ else lastOffset = m + 1;
36069
+ }
36070
+ return offset;
36071
+ }
36072
+ var TimSort = (function() {
36073
+ function TimSort(array, compare) {
36074
+ _classCallCheck(this, TimSort);
36075
+ this.array = null;
36076
+ this.compare = null;
36077
+ this.minGallop = DEFAULT_MIN_GALLOPING;
36078
+ this.length = 0;
36079
+ this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
36080
+ this.stackLength = 0;
36081
+ this.runStart = null;
36082
+ this.runLength = null;
36083
+ this.stackSize = 0;
36084
+ this.array = array;
36085
+ this.compare = compare;
36086
+ this.length = array.length;
36087
+ if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) this.tmpStorageLength = this.length >>> 1;
36088
+ this.tmp = new Array(this.tmpStorageLength);
36089
+ this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
36090
+ this.runStart = new Array(this.stackLength);
36091
+ this.runLength = new Array(this.stackLength);
36092
+ }
36093
+ TimSort.prototype.pushRun = function pushRun(runStart, runLength) {
36094
+ this.runStart[this.stackSize] = runStart;
36095
+ this.runLength[this.stackSize] = runLength;
36096
+ this.stackSize += 1;
36097
+ };
36098
+ TimSort.prototype.mergeRuns = function mergeRuns() {
36099
+ while (this.stackSize > 1) {
36100
+ var n = this.stackSize - 2;
36101
+ if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
36102
+ if (this.runLength[n - 1] < this.runLength[n + 1]) n--;
36103
+ } else if (this.runLength[n] > this.runLength[n + 1]) break;
36104
+ this.mergeAt(n);
36105
+ }
36106
+ };
36107
+ TimSort.prototype.forceMergeRuns = function forceMergeRuns() {
36108
+ while (this.stackSize > 1) {
36109
+ var n = this.stackSize - 2;
36110
+ if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) n--;
36111
+ this.mergeAt(n);
36112
+ }
36113
+ };
36114
+ TimSort.prototype.mergeAt = function mergeAt(i) {
36115
+ var compare = this.compare;
36116
+ var array = this.array;
36117
+ var start1 = this.runStart[i];
36118
+ var length1 = this.runLength[i];
36119
+ var start2 = this.runStart[i + 1];
36120
+ var length2 = this.runLength[i + 1];
36121
+ this.runLength[i] = length1 + length2;
36122
+ if (i === this.stackSize - 3) {
36123
+ this.runStart[i + 1] = this.runStart[i + 2];
36124
+ this.runLength[i + 1] = this.runLength[i + 2];
36125
+ }
36126
+ this.stackSize--;
36127
+ var k = gallopRight(array[start2], array, start1, length1, 0, compare);
36128
+ start1 += k;
36129
+ length1 -= k;
36130
+ if (length1 === 0) return;
36131
+ length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
36132
+ if (length2 === 0) return;
36133
+ if (length1 <= length2) this.mergeLow(start1, length1, start2, length2);
36134
+ else this.mergeHigh(start1, length1, start2, length2);
36135
+ };
36136
+ TimSort.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
36137
+ var compare = this.compare;
36138
+ var array = this.array;
36139
+ var tmp = this.tmp;
36140
+ var i = 0;
36141
+ for (i = 0; i < length1; i++) tmp[i] = array[start1 + i];
36142
+ var cursor1 = 0;
36143
+ var cursor2 = start2;
36144
+ var dest = start1;
36145
+ array[dest++] = array[cursor2++];
36146
+ if (--length2 === 0) {
36147
+ for (i = 0; i < length1; i++) array[dest + i] = tmp[cursor1 + i];
36148
+ return;
36149
+ }
36150
+ if (length1 === 1) {
36151
+ for (i = 0; i < length2; i++) array[dest + i] = array[cursor2 + i];
36152
+ array[dest + length2] = tmp[cursor1];
36153
+ return;
36154
+ }
36155
+ var minGallop = this.minGallop;
36156
+ while (true) {
36157
+ var count1 = 0;
36158
+ var count2 = 0;
36159
+ var exit = false;
36160
+ do
36161
+ if (compare(array[cursor2], tmp[cursor1]) < 0) {
36162
+ array[dest++] = array[cursor2++];
36163
+ count2++;
36164
+ count1 = 0;
36165
+ if (--length2 === 0) {
36166
+ exit = true;
36167
+ break;
36168
+ }
36169
+ } else {
36170
+ array[dest++] = tmp[cursor1++];
36171
+ count1++;
36172
+ count2 = 0;
36173
+ if (--length1 === 1) {
36174
+ exit = true;
36175
+ break;
36176
+ }
36177
+ }
36178
+ while ((count1 | count2) < minGallop);
36179
+ if (exit) break;
36180
+ do {
36181
+ count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
36182
+ if (count1 !== 0) {
36183
+ for (i = 0; i < count1; i++) array[dest + i] = tmp[cursor1 + i];
36184
+ dest += count1;
36185
+ cursor1 += count1;
36186
+ length1 -= count1;
36187
+ if (length1 <= 1) {
36188
+ exit = true;
36189
+ break;
36190
+ }
36191
+ }
36192
+ array[dest++] = array[cursor2++];
36193
+ if (--length2 === 0) {
36194
+ exit = true;
36195
+ break;
36196
+ }
36197
+ count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
36198
+ if (count2 !== 0) {
36199
+ for (i = 0; i < count2; i++) array[dest + i] = array[cursor2 + i];
36200
+ dest += count2;
36201
+ cursor2 += count2;
36202
+ length2 -= count2;
36203
+ if (length2 === 0) {
36204
+ exit = true;
36205
+ break;
36206
+ }
36207
+ }
36208
+ array[dest++] = tmp[cursor1++];
36209
+ if (--length1 === 1) {
36210
+ exit = true;
36211
+ break;
36212
+ }
36213
+ minGallop--;
36214
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
36215
+ if (exit) break;
36216
+ if (minGallop < 0) minGallop = 0;
36217
+ minGallop += 2;
36218
+ }
36219
+ this.minGallop = minGallop;
36220
+ if (minGallop < 1) this.minGallop = 1;
36221
+ if (length1 === 1) {
36222
+ for (i = 0; i < length2; i++) array[dest + i] = array[cursor2 + i];
36223
+ array[dest + length2] = tmp[cursor1];
36224
+ } else if (length1 === 0) throw new Error("mergeLow preconditions were not respected");
36225
+ else for (i = 0; i < length1; i++) array[dest + i] = tmp[cursor1 + i];
36226
+ };
36227
+ TimSort.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
36228
+ var compare = this.compare;
36229
+ var array = this.array;
36230
+ var tmp = this.tmp;
36231
+ var i = 0;
36232
+ for (i = 0; i < length2; i++) tmp[i] = array[start2 + i];
36233
+ var cursor1 = start1 + length1 - 1;
36234
+ var cursor2 = length2 - 1;
36235
+ var dest = start2 + length2 - 1;
36236
+ var customCursor = 0;
36237
+ var customDest = 0;
36238
+ array[dest--] = array[cursor1--];
36239
+ if (--length1 === 0) {
36240
+ customCursor = dest - (length2 - 1);
36241
+ for (i = 0; i < length2; i++) array[customCursor + i] = tmp[i];
36242
+ return;
36243
+ }
36244
+ if (length2 === 1) {
36245
+ dest -= length1;
36246
+ cursor1 -= length1;
36247
+ customDest = dest + 1;
36248
+ customCursor = cursor1 + 1;
36249
+ for (i = length1 - 1; i >= 0; i--) array[customDest + i] = array[customCursor + i];
36250
+ array[dest] = tmp[cursor2];
36251
+ return;
36252
+ }
36253
+ var minGallop = this.minGallop;
36254
+ while (true) {
36255
+ var count1 = 0;
36256
+ var count2 = 0;
36257
+ var exit = false;
36258
+ do
36259
+ if (compare(tmp[cursor2], array[cursor1]) < 0) {
36260
+ array[dest--] = array[cursor1--];
36261
+ count1++;
36262
+ count2 = 0;
36263
+ if (--length1 === 0) {
36264
+ exit = true;
36265
+ break;
36266
+ }
36267
+ } else {
36268
+ array[dest--] = tmp[cursor2--];
36269
+ count2++;
36270
+ count1 = 0;
36271
+ if (--length2 === 1) {
36272
+ exit = true;
36273
+ break;
36274
+ }
36275
+ }
36276
+ while ((count1 | count2) < minGallop);
36277
+ if (exit) break;
36278
+ do {
36279
+ count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
36280
+ if (count1 !== 0) {
36281
+ dest -= count1;
36282
+ cursor1 -= count1;
36283
+ length1 -= count1;
36284
+ customDest = dest + 1;
36285
+ customCursor = cursor1 + 1;
36286
+ for (i = count1 - 1; i >= 0; i--) array[customDest + i] = array[customCursor + i];
36287
+ if (length1 === 0) {
36288
+ exit = true;
36289
+ break;
36290
+ }
36291
+ }
36292
+ array[dest--] = tmp[cursor2--];
36293
+ if (--length2 === 1) {
36294
+ exit = true;
36295
+ break;
36296
+ }
36297
+ count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
36298
+ if (count2 !== 0) {
36299
+ dest -= count2;
36300
+ cursor2 -= count2;
36301
+ length2 -= count2;
36302
+ customDest = dest + 1;
36303
+ customCursor = cursor2 + 1;
36304
+ for (i = 0; i < count2; i++) array[customDest + i] = tmp[customCursor + i];
36305
+ if (length2 <= 1) {
36306
+ exit = true;
36307
+ break;
36308
+ }
36309
+ }
36310
+ array[dest--] = array[cursor1--];
36311
+ if (--length1 === 0) {
36312
+ exit = true;
36313
+ break;
36314
+ }
36315
+ minGallop--;
36316
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
36317
+ if (exit) break;
36318
+ if (minGallop < 0) minGallop = 0;
36319
+ minGallop += 2;
36320
+ }
36321
+ this.minGallop = minGallop;
36322
+ if (minGallop < 1) this.minGallop = 1;
36323
+ if (length2 === 1) {
36324
+ dest -= length1;
36325
+ cursor1 -= length1;
36326
+ customDest = dest + 1;
36327
+ customCursor = cursor1 + 1;
36328
+ for (i = length1 - 1; i >= 0; i--) array[customDest + i] = array[customCursor + i];
36329
+ array[dest] = tmp[cursor2];
36330
+ } else if (length2 === 0) throw new Error("mergeHigh preconditions were not respected");
36331
+ else {
36332
+ customCursor = dest - (length2 - 1);
36333
+ for (i = 0; i < length2; i++) array[customCursor + i] = tmp[i];
36334
+ }
36335
+ };
36336
+ return TimSort;
36337
+ })();
36338
+ function sort(array, compare, lo, hi) {
36339
+ if (!Array.isArray(array)) throw new TypeError("Can only sort arrays");
36340
+ if (!compare) compare = alphabeticalCompare;
36341
+ else if (typeof compare !== "function") {
36342
+ hi = lo;
36343
+ lo = compare;
36344
+ compare = alphabeticalCompare;
36345
+ }
36346
+ if (!lo) lo = 0;
36347
+ if (!hi) hi = array.length;
36348
+ var remaining = hi - lo;
36349
+ if (remaining < 2) return;
36350
+ var runLength = 0;
36351
+ if (remaining < DEFAULT_MIN_MERGE) {
36352
+ runLength = makeAscendingRun(array, lo, hi, compare);
36353
+ binaryInsertionSort(array, lo, hi, lo + runLength, compare);
36354
+ return;
36355
+ }
36356
+ var ts = new TimSort(array, compare);
36357
+ var minRun = minRunLength(remaining);
36358
+ do {
36359
+ runLength = makeAscendingRun(array, lo, hi, compare);
36360
+ if (runLength < minRun) {
36361
+ var force = remaining;
36362
+ if (force > minRun) force = minRun;
36363
+ binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
36364
+ runLength = force;
36365
+ }
36366
+ ts.pushRun(lo, runLength);
36367
+ ts.mergeRuns();
36368
+ remaining -= runLength;
36369
+ lo += runLength;
36370
+ } while (remaining !== 0);
36371
+ ts.forceMergeRuns();
36372
+ }
36373
+ });
36374
+ }));
36375
+ var require_timsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36376
+ module.exports = require_timsort$1();
36377
+ }));
36378
+ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36379
+ /**
36380
+ @typedef {(Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array)} TypedArray
36381
+ */
36382
+ /**
36383
+ * Error message for a case when percentile is less than 0.
36384
+ *
36385
+ * @param {Number} p
36386
+ *
36387
+ * @return {String}
36388
+ */
36389
+ function lessThanZeroError(p) {
36390
+ return "Expect percentile to be >= 0 but given \"" + p + "\" and its type is \"" + typeof p + "\".";
36391
+ }
36392
+ /**
36393
+ * Error message for a case when percentile is greater than 100.
36394
+ *
36395
+ * @param {Number} p
36396
+ *
36397
+ * @return {String}
36398
+ */
36399
+ function greaterThanHundredError(p) {
36400
+ return "Expect percentile to be <= 100 but given \"" + p + "\" and its type is \"" + typeof p + "\".";
36401
+ }
36402
+ /**
36403
+ * Error message for a case when percentile is not a number (NaN).
36404
+ *
36405
+ * @param {Number} p
36406
+ *
36407
+ * @return {String}
36408
+ */
36409
+ function nanError(p) {
36410
+ return "Expect percentile to be a number but given \"" + p + "\" and its type is \"" + typeof p + "\".";
36411
+ }
36412
+ /**
36413
+ * Checks that a list of percentiles are all numbers and they lie in range 0..100.
36414
+ *
36415
+ * @param {Array<Number>} ps - percentiles to calculate
36416
+ *
36417
+ * @return {Array} List of errors
36418
+ */
36419
+ function validateInput(ps) {
36420
+ return ps.reduce(function(errors, p) {
36421
+ if (isNaN(Number(p))) errors.push(nanError(p));
36422
+ else if (p < 0) errors.push(lessThanZeroError(p));
36423
+ else if (p > 100) errors.push(greaterThanHundredError(p));
36424
+ return errors;
36425
+ }, []);
36426
+ }
36427
+ /**
36428
+ * Get percentile value from an array.
36429
+ *
36430
+ * @param {Number} p - percentile
36431
+ * @param {Array|TypedArray} list - list of values
36432
+ *
36433
+ * @return {*}
36434
+ */
36435
+ function getPsValue(p, list) {
36436
+ if (p === 0) return list[0];
36437
+ return list[Math.ceil(list.length * (p / 100)) - 1];
36438
+ }
36439
+ /**
36440
+ * Calculate percentile for given array of values.
36441
+ *
36442
+ * @template T
36443
+ * @param {Number|Array<Number>} pOrPs - percentile or a list of percentiles
36444
+ * @param {Array<T>|Array<Number>|TypedArray} list - array of values
36445
+ * @param {function(T): Number} [fn] - optional function to extract a value from an array item
36446
+ *
36447
+ * @return {Number|T|Array<Number>|Array<T>}
36448
+ */
36449
+ function percentile(pOrPs, list, fn) {
36450
+ var ps = Array.isArray(pOrPs) ? pOrPs : [pOrPs];
36451
+ var validationErrors = validateInput(ps);
36452
+ if (validationErrors.length) throw new Error(validationErrors.join(" "));
36453
+ list = list.slice().sort(function(a, b) {
36454
+ if (fn) {
36455
+ a = fn(a);
36456
+ b = fn(b);
36457
+ }
36458
+ a = Number.isNaN(a) ? Number.NEGATIVE_INFINITY : a;
36459
+ b = Number.isNaN(b) ? Number.NEGATIVE_INFINITY : b;
36460
+ if (a > b) return 1;
36461
+ if (a < b) return -1;
36462
+ return 0;
36463
+ });
36464
+ if (ps.length === 1) return getPsValue(ps[0], list);
36465
+ return ps.map(function(p) {
36466
+ return getPsValue(p, list);
36467
+ });
36468
+ }
36469
+ module.exports = percentile;
36470
+ }));
36471
+ require_timsort();
36472
+ require_lib();
35768
36473
  //#endregion
35769
- //#region src/libmodule/workerTestCaseLogger.ts
35770
- var WorkerTestCaseLogger = class {
36474
+ //#region node_modules/@nsshunt/stsinstrumentmanagerclient/dist/index.mjs
36475
+ var SubscriptionTopic = /* @__PURE__ */ function(SubscriptionTopic) {
36476
+ SubscriptionTopic["AllServicesCombined"] = "AllServicesCombined";
36477
+ SubscriptionTopic["Services"] = "Services";
36478
+ SubscriptionTopic["ServiceInstances"] = "ServiceInstances";
36479
+ SubscriptionTopic["ServiceInstance"] = "ServiceInstance";
36480
+ SubscriptionTopic["AllAgentsCombined"] = "AllAgentsCombined";
36481
+ SubscriptionTopic["Agents"] = "Agents";
36482
+ SubscriptionTopic["AgentWorkers"] = "AgentWorkers";
36483
+ SubscriptionTopic["AgentWorker"] = "AgentWorker";
36484
+ SubscriptionTopic["AllLambdasCombined"] = "AllLambdasCombined";
36485
+ SubscriptionTopic["LambdaTechnologies"] = "LambdaTechnologies";
36486
+ SubscriptionTopic["LambdaSubTechnologies"] = "LambdaSubTechnologies";
36487
+ SubscriptionTopic["LambdaSubTechnologiesInstance"] = "LambdaSubTechnologiesInstance";
36488
+ SubscriptionTopic["LogProcessing"] = "LogProcessing";
36489
+ return SubscriptionTopic;
36490
+ }({});
36491
+ var ANSI_BACKGROUND_OFFSET = 10;
36492
+ var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
36493
+ var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
36494
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
36495
+ var styles$1 = {
36496
+ modifier: {
36497
+ reset: [0, 0],
36498
+ bold: [1, 22],
36499
+ dim: [2, 22],
36500
+ italic: [3, 23],
36501
+ underline: [4, 24],
36502
+ overline: [53, 55],
36503
+ inverse: [7, 27],
36504
+ hidden: [8, 28],
36505
+ strikethrough: [9, 29]
36506
+ },
36507
+ color: {
36508
+ black: [30, 39],
36509
+ red: [31, 39],
36510
+ green: [32, 39],
36511
+ yellow: [33, 39],
36512
+ blue: [34, 39],
36513
+ magenta: [35, 39],
36514
+ cyan: [36, 39],
36515
+ white: [37, 39],
36516
+ blackBright: [90, 39],
36517
+ gray: [90, 39],
36518
+ grey: [90, 39],
36519
+ redBright: [91, 39],
36520
+ greenBright: [92, 39],
36521
+ yellowBright: [93, 39],
36522
+ blueBright: [94, 39],
36523
+ magentaBright: [95, 39],
36524
+ cyanBright: [96, 39],
36525
+ whiteBright: [97, 39]
36526
+ },
36527
+ bgColor: {
36528
+ bgBlack: [40, 49],
36529
+ bgRed: [41, 49],
36530
+ bgGreen: [42, 49],
36531
+ bgYellow: [43, 49],
36532
+ bgBlue: [44, 49],
36533
+ bgMagenta: [45, 49],
36534
+ bgCyan: [46, 49],
36535
+ bgWhite: [47, 49],
36536
+ bgBlackBright: [100, 49],
36537
+ bgGray: [100, 49],
36538
+ bgGrey: [100, 49],
36539
+ bgRedBright: [101, 49],
36540
+ bgGreenBright: [102, 49],
36541
+ bgYellowBright: [103, 49],
36542
+ bgBlueBright: [104, 49],
36543
+ bgMagentaBright: [105, 49],
36544
+ bgCyanBright: [106, 49],
36545
+ bgWhiteBright: [107, 49]
36546
+ }
36547
+ };
36548
+ Object.keys(styles$1.modifier);
36549
+ var foregroundColorNames = Object.keys(styles$1.color);
36550
+ var backgroundColorNames = Object.keys(styles$1.bgColor);
36551
+ [...foregroundColorNames, ...backgroundColorNames];
36552
+ function assembleStyles() {
36553
+ const codes = /* @__PURE__ */ new Map();
36554
+ for (const [groupName, group] of Object.entries(styles$1)) {
36555
+ for (const [styleName, style] of Object.entries(group)) {
36556
+ styles$1[styleName] = {
36557
+ open: `\u001B[${style[0]}m`,
36558
+ close: `\u001B[${style[1]}m`
36559
+ };
36560
+ group[styleName] = styles$1[styleName];
36561
+ codes.set(style[0], style[1]);
36562
+ }
36563
+ Object.defineProperty(styles$1, groupName, {
36564
+ value: group,
36565
+ enumerable: false
36566
+ });
36567
+ }
36568
+ Object.defineProperty(styles$1, "codes", {
36569
+ value: codes,
36570
+ enumerable: false
36571
+ });
36572
+ styles$1.color.close = "\x1B[39m";
36573
+ styles$1.bgColor.close = "\x1B[49m";
36574
+ styles$1.color.ansi = wrapAnsi16();
36575
+ styles$1.color.ansi256 = wrapAnsi256();
36576
+ styles$1.color.ansi16m = wrapAnsi16m();
36577
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
36578
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
36579
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
36580
+ Object.defineProperties(styles$1, {
36581
+ rgbToAnsi256: {
36582
+ value(red, green, blue) {
36583
+ if (red === green && green === blue) {
36584
+ if (red < 8) return 16;
36585
+ if (red > 248) return 231;
36586
+ return Math.round((red - 8) / 247 * 24) + 232;
36587
+ }
36588
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
36589
+ },
36590
+ enumerable: false
36591
+ },
36592
+ hexToRgb: {
36593
+ value(hex) {
36594
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
36595
+ if (!matches) return [
36596
+ 0,
36597
+ 0,
36598
+ 0
36599
+ ];
36600
+ let [colorString] = matches;
36601
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
36602
+ const integer = Number.parseInt(colorString, 16);
36603
+ return [
36604
+ integer >> 16 & 255,
36605
+ integer >> 8 & 255,
36606
+ integer & 255
36607
+ ];
36608
+ },
36609
+ enumerable: false
36610
+ },
36611
+ hexToAnsi256: {
36612
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
36613
+ enumerable: false
36614
+ },
36615
+ ansi256ToAnsi: {
36616
+ value(code) {
36617
+ if (code < 8) return 30 + code;
36618
+ if (code < 16) return 90 + (code - 8);
36619
+ let red;
36620
+ let green;
36621
+ let blue;
36622
+ if (code >= 232) {
36623
+ red = ((code - 232) * 10 + 8) / 255;
36624
+ green = red;
36625
+ blue = red;
36626
+ } else {
36627
+ code -= 16;
36628
+ const remainder = code % 36;
36629
+ red = Math.floor(code / 36) / 5;
36630
+ green = Math.floor(remainder / 6) / 5;
36631
+ blue = remainder % 6 / 5;
36632
+ }
36633
+ const value = Math.max(red, green, blue) * 2;
36634
+ if (value === 0) return 30;
36635
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
36636
+ if (value === 2) result += 60;
36637
+ return result;
36638
+ },
36639
+ enumerable: false
36640
+ },
36641
+ rgbToAnsi: {
36642
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
36643
+ enumerable: false
36644
+ },
36645
+ hexToAnsi: {
36646
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
36647
+ enumerable: false
36648
+ }
36649
+ });
36650
+ return styles$1;
36651
+ }
36652
+ var ansiStyles = assembleStyles();
36653
+ var level = (() => {
36654
+ if (!("navigator" in globalThis)) return 0;
36655
+ if (globalThis.navigator.userAgentData) {
36656
+ const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
36657
+ if (brand && brand.version > 93) return 3;
36658
+ }
36659
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
36660
+ return 0;
36661
+ })();
36662
+ var colorSupport = level !== 0 && {
36663
+ level,
36664
+ hasBasic: true,
36665
+ has256: level >= 2,
36666
+ has16m: level >= 3
36667
+ };
36668
+ var supportsColor = {
36669
+ stdout: colorSupport,
36670
+ stderr: colorSupport
36671
+ };
36672
+ function stringReplaceAll(string, substring, replacer) {
36673
+ let index = string.indexOf(substring);
36674
+ if (index === -1) return string;
36675
+ const substringLength = substring.length;
36676
+ let endIndex = 0;
36677
+ let returnValue = "";
36678
+ do {
36679
+ returnValue += string.slice(endIndex, index) + substring + replacer;
36680
+ endIndex = index + substringLength;
36681
+ index = string.indexOf(substring, endIndex);
36682
+ } while (index !== -1);
36683
+ returnValue += string.slice(endIndex);
36684
+ return returnValue;
36685
+ }
36686
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
36687
+ let endIndex = 0;
36688
+ let returnValue = "";
36689
+ do {
36690
+ const gotCR = string[index - 1] === "\r";
36691
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
36692
+ endIndex = index + 1;
36693
+ index = string.indexOf("\n", endIndex);
36694
+ } while (index !== -1);
36695
+ returnValue += string.slice(endIndex);
36696
+ return returnValue;
36697
+ }
36698
+ var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
36699
+ var GENERATOR = Symbol("GENERATOR");
36700
+ var STYLER = Symbol("STYLER");
36701
+ var IS_EMPTY = Symbol("IS_EMPTY");
36702
+ var levelMapping = [
36703
+ "ansi",
36704
+ "ansi",
36705
+ "ansi256",
36706
+ "ansi16m"
36707
+ ];
36708
+ var styles = Object.create(null);
36709
+ var applyOptions = (object, options = {}) => {
36710
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
36711
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
36712
+ object.level = options.level === void 0 ? colorLevel : options.level;
36713
+ };
36714
+ var chalkFactory = (options) => {
36715
+ const chalk = (...strings) => strings.join(" ");
36716
+ applyOptions(chalk, options);
36717
+ Object.setPrototypeOf(chalk, createChalk.prototype);
36718
+ return chalk;
36719
+ };
36720
+ function createChalk(options) {
36721
+ return chalkFactory(options);
36722
+ }
36723
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
36724
+ for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
36725
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
36726
+ Object.defineProperty(this, styleName, { value: builder });
36727
+ return builder;
36728
+ } };
36729
+ styles.visible = { get() {
36730
+ const builder = createBuilder(this, this[STYLER], true);
36731
+ Object.defineProperty(this, "visible", { value: builder });
36732
+ return builder;
36733
+ } };
36734
+ var getModelAnsi = (model, level, type, ...arguments_) => {
36735
+ if (model === "rgb") {
36736
+ if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
36737
+ if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
36738
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
36739
+ }
36740
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
36741
+ return ansiStyles[type][model](...arguments_);
36742
+ };
36743
+ for (const model of [
36744
+ "rgb",
36745
+ "hex",
36746
+ "ansi256"
36747
+ ]) {
36748
+ styles[model] = { get() {
36749
+ const { level } = this;
36750
+ return function(...arguments_) {
36751
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
36752
+ return createBuilder(this, styler, this[IS_EMPTY]);
36753
+ };
36754
+ } };
36755
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
36756
+ styles[bgModel] = { get() {
36757
+ const { level } = this;
36758
+ return function(...arguments_) {
36759
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
36760
+ return createBuilder(this, styler, this[IS_EMPTY]);
36761
+ };
36762
+ } };
36763
+ }
36764
+ var proto = Object.defineProperties(() => {}, {
36765
+ ...styles,
36766
+ level: {
36767
+ enumerable: true,
36768
+ get() {
36769
+ return this[GENERATOR].level;
36770
+ },
36771
+ set(level) {
36772
+ this[GENERATOR].level = level;
36773
+ }
36774
+ }
36775
+ });
36776
+ var createStyler = (open, close, parent) => {
36777
+ let openAll;
36778
+ let closeAll;
36779
+ if (parent === void 0) {
36780
+ openAll = open;
36781
+ closeAll = close;
36782
+ } else {
36783
+ openAll = parent.openAll + open;
36784
+ closeAll = close + parent.closeAll;
36785
+ }
36786
+ return {
36787
+ open,
36788
+ close,
36789
+ openAll,
36790
+ closeAll,
36791
+ parent
36792
+ };
36793
+ };
36794
+ var createBuilder = (self, _styler, _isEmpty) => {
36795
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
36796
+ Object.setPrototypeOf(builder, proto);
36797
+ builder[GENERATOR] = self;
36798
+ builder[STYLER] = _styler;
36799
+ builder[IS_EMPTY] = _isEmpty;
36800
+ return builder;
36801
+ };
36802
+ var applyStyle = (self, string) => {
36803
+ if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
36804
+ let styler = self[STYLER];
36805
+ if (styler === void 0) return string;
36806
+ const { openAll, closeAll } = styler;
36807
+ if (string.includes("\x1B")) while (styler !== void 0) {
36808
+ string = stringReplaceAll(string, styler.close, styler.open);
36809
+ styler = styler.parent;
36810
+ }
36811
+ const lfIndex = string.indexOf("\n");
36812
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
36813
+ return openAll + string + closeAll;
36814
+ };
36815
+ Object.defineProperties(createChalk.prototype, styles);
36816
+ var chalk$1 = createChalk();
36817
+ createChalk({ level: stderrColor ? stderrColor.level : 0 });
36818
+ new TextEncoder();
36819
+ new TextDecoder();
36820
+ /**
36821
+ * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.
36822
+ */
36823
+ var ExtData = class {
36824
+ type;
36825
+ data;
36826
+ constructor(type, data) {
36827
+ this.type = type;
36828
+ this.data = data;
36829
+ }
36830
+ };
36831
+ var DecodeError = class DecodeError extends Error {
36832
+ constructor(message) {
36833
+ super(message);
36834
+ const proto = Object.create(DecodeError.prototype);
36835
+ Object.setPrototypeOf(this, proto);
36836
+ Object.defineProperty(this, "name", {
36837
+ configurable: true,
36838
+ enumerable: false,
36839
+ value: DecodeError.name
36840
+ });
36841
+ }
36842
+ };
36843
+ function setInt64(view, offset, value) {
36844
+ const high = Math.floor(value / 4294967296);
36845
+ const low = value;
36846
+ view.setUint32(offset, high);
36847
+ view.setUint32(offset + 4, low);
36848
+ }
36849
+ function getInt64(view, offset) {
36850
+ const high = view.getInt32(offset);
36851
+ const low = view.getUint32(offset + 4);
36852
+ return high * 4294967296 + low;
36853
+ }
36854
+ var TIMESTAMP32_MAX_SEC = 4294967295;
36855
+ var TIMESTAMP64_MAX_SEC = 17179869183;
36856
+ function encodeTimeSpecToTimestamp({ sec, nsec }) {
36857
+ if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
36858
+ const rv = new Uint8Array(4);
36859
+ new DataView(rv.buffer).setUint32(0, sec);
36860
+ return rv;
36861
+ } else {
36862
+ const secHigh = sec / 4294967296;
36863
+ const secLow = sec & 4294967295;
36864
+ const rv = new Uint8Array(8);
36865
+ const view = new DataView(rv.buffer);
36866
+ view.setUint32(0, nsec << 2 | secHigh & 3);
36867
+ view.setUint32(4, secLow);
36868
+ return rv;
36869
+ }
36870
+ else {
36871
+ const rv = new Uint8Array(12);
36872
+ const view = new DataView(rv.buffer);
36873
+ view.setUint32(0, nsec);
36874
+ setInt64(view, 4, sec);
36875
+ return rv;
36876
+ }
36877
+ }
36878
+ function encodeDateToTimeSpec(date) {
36879
+ const msec = date.getTime();
36880
+ const sec = Math.floor(msec / 1e3);
36881
+ const nsec = (msec - sec * 1e3) * 1e6;
36882
+ const nsecInSec = Math.floor(nsec / 1e9);
36883
+ return {
36884
+ sec: sec + nsecInSec,
36885
+ nsec: nsec - nsecInSec * 1e9
36886
+ };
36887
+ }
36888
+ function encodeTimestampExtension(object) {
36889
+ if (object instanceof Date) return encodeTimeSpecToTimestamp(encodeDateToTimeSpec(object));
36890
+ else return null;
36891
+ }
36892
+ function decodeTimestampToTimeSpec(data) {
36893
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
36894
+ switch (data.byteLength) {
36895
+ case 4: return {
36896
+ sec: view.getUint32(0),
36897
+ nsec: 0
36898
+ };
36899
+ case 8: {
36900
+ const nsec30AndSecHigh2 = view.getUint32(0);
36901
+ const secLow32 = view.getUint32(4);
36902
+ return {
36903
+ sec: (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32,
36904
+ nsec: nsec30AndSecHigh2 >>> 2
36905
+ };
36906
+ }
36907
+ case 12: return {
36908
+ sec: getInt64(view, 4),
36909
+ nsec: view.getUint32(0)
36910
+ };
36911
+ default: throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);
36912
+ }
36913
+ }
36914
+ function decodeTimestampExtension(data) {
36915
+ const timeSpec = decodeTimestampToTimeSpec(data);
36916
+ return /* @__PURE__ */ new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
36917
+ }
36918
+ var timestampExtension = {
36919
+ type: -1,
36920
+ encode: encodeTimestampExtension,
36921
+ decode: decodeTimestampExtension
36922
+ };
36923
+ (class ExtensionCodec {
36924
+ static defaultCodec = new ExtensionCodec();
36925
+ __brand;
36926
+ builtInEncoders = [];
36927
+ builtInDecoders = [];
36928
+ encoders = [];
36929
+ decoders = [];
36930
+ constructor() {
36931
+ this.register(timestampExtension);
36932
+ }
36933
+ register({ type, encode, decode }) {
36934
+ if (type >= 0) {
36935
+ this.encoders[type] = encode;
36936
+ this.decoders[type] = decode;
36937
+ } else {
36938
+ const index = -1 - type;
36939
+ this.builtInEncoders[index] = encode;
36940
+ this.builtInDecoders[index] = decode;
36941
+ }
36942
+ }
36943
+ tryToEncode(object, context) {
36944
+ for (let i = 0; i < this.builtInEncoders.length; i++) {
36945
+ const encodeExt = this.builtInEncoders[i];
36946
+ if (encodeExt != null) {
36947
+ const data = encodeExt(object, context);
36948
+ if (data != null) return new ExtData(-1 - i, data);
36949
+ }
36950
+ }
36951
+ for (let i = 0; i < this.encoders.length; i++) {
36952
+ const encodeExt = this.encoders[i];
36953
+ if (encodeExt != null) {
36954
+ const data = encodeExt(object, context);
36955
+ if (data != null) return new ExtData(i, data);
36956
+ }
36957
+ }
36958
+ if (object instanceof ExtData) return object;
36959
+ return null;
36960
+ }
36961
+ decode(data, type, context) {
36962
+ const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
36963
+ if (decodeExt) return decodeExt(data, type, context);
36964
+ else return new ExtData(type, data);
36965
+ }
36966
+ });
36967
+ var influxDBDataType = /* @__PURE__ */ function(influxDBDataType) {
36968
+ influxDBDataType["intField"] = "intField";
36969
+ influxDBDataType["floatField"] = "floatField";
36970
+ influxDBDataType["stringField"] = "stringField";
36971
+ return influxDBDataType;
36972
+ }({});
36973
+ Gauge.REQUEST_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.ERROR_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.RETRY_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.AUTHENTICATION_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.VELOCITY_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_VELOCITY, Gauge.ACTIVE_REQUEST_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CORE_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.NETWORK_RX_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_VELOCITY, Gauge.NETWORK_TX_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_VELOCITY, Gauge.TIMER_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_TIMER, Gauge.DURATION_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.DURATION_HISTOGRAM_GAUGE, Gauge.LATENCY_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.LATENCY_HISTOGRAM_GAUGE, Gauge.LOGGER, influxDBDataType.stringField, GaugeTypes.INSTRUMENT_LOG, Gauge.CPU_LOAD_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_TOTAL_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_IDLE_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_WAITING_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CPU_SYSTEM_LOAD_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.OBJECT_GAUGE, influxDBDataType.stringField, GaugeTypes.INSTRUMENT_OBJECT, SubscriptionTopic.AllServicesCombined, SubscriptionTopic.Services, SubscriptionTopic.ServiceInstances, SubscriptionTopic.ServiceInstance, Gauge.CHILD_COUNT, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, SubscriptionTopic.AllAgentsCombined, SubscriptionTopic.Agents, SubscriptionTopic.AgentWorkers, SubscriptionTopic.AgentWorker, Gauge.CPU_LOAD_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_COUNT_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_TOTAL_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_IDLE_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CONNECTION_POOL_WAITING_GAUGE, influxDBDataType.intField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.CPU_SYSTEM_LOAD_GAUGE, influxDBDataType.floatField, GaugeTypes.INSTRUMENT_GAUGE, Gauge.OBJECT_GAUGE, influxDBDataType.stringField, GaugeTypes.INSTRUMENT_OBJECT, SubscriptionTopic.AllLambdasCombined, SubscriptionTopic.LambdaTechnologies, SubscriptionTopic.LambdaSubTechnologies, SubscriptionTopic.LambdaSubTechnologiesInstance;
36974
+ var SOCKET_NAMESPACE = "stsinstrumentmanager/stsmonitor";
36975
+ var SocketBrowserClientLogPublisher = class extends _nsshunt_stssocketioutils.SocketIoClient {
36976
+ #id;
36977
+ #options;
36978
+ constructor(options) {
36979
+ super("stsinstrumentmanagerclient:SocketBrowserClientLogPublisher");
36980
+ this.#options = options;
36981
+ this.#id = globalThis.crypto.randomUUID();
36982
+ this.LogDebugMessage(chalk$1.cyan(`${this.logPrefix}Start()`));
36983
+ const url = `${this.#options.imendpoint}:${this.#options.import}/${SOCKET_NAMESPACE}/`;
36984
+ this.LogDebugMessage(chalk$1.cyan(`${this.logPrefix}SetupSocket() url: [${url}]`));
36985
+ this.WithAddress(url).WithLogger(_nsshunt_stsutils.defaultLogger).SetupSocket();
36986
+ }
36987
+ get id() {
36988
+ return this.#id;
36989
+ }
36990
+ get logPrefix() {
36991
+ return `stsinstrumentmanagerclient:SocketBrowserClientLogPublisher:`;
36992
+ }
36993
+ SocketConnect(socket) {
36994
+ this.LogDebugMessage(chalk$1.magenta(`${this.logPrefix}SocketConnect(): Socket ID: [${socket.id}], Joining Room: [${this.#options.rooms}]`));
36995
+ socket.emit("__STSjoinRoom", this.#options.rooms);
36996
+ }
36997
+ SocketError(error) {
36998
+ this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketError(): Error: [${error}]`));
36999
+ }
37000
+ SetupSocketEvents(socket) {
37001
+ this.LogDebugMessage(chalk$1.magenta(`${this.logPrefix}SetupSocketEvents(): Socket ID: [${socket.id}]`));
37002
+ }
37003
+ SocketConnectError(error) {
37004
+ this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketConnectError(): Error: [${error}]`));
37005
+ }
37006
+ SocketDisconnect(reason) {
37007
+ this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketDisconnect(): reason: [${reason}]`));
37008
+ }
37009
+ };
37010
+ var STSLoggerSocket = class {
35771
37011
  #options;
35772
- #logger;
37012
+ #socketIoClient;
35773
37013
  constructor(opts) {
35774
37014
  this.#options = opts;
35775
- if (this.#options.outputToDefaultLogger === true) this.#logger = _nsshunt_stsutils.defaultLogger;
35776
- else this.#logger = _nsshunt_stsutils.emptyLogger;
37015
+ this.#socketIoClient = new SocketBrowserClientLogPublisher({
37016
+ rooms: this.#options.rooms,
37017
+ imendpoint: this.#options.imendpoint,
37018
+ import: this.#options.import
37019
+ });
37020
+ this.#socketIoClient.socket?.emit("__STSjoinRoom", this.#options.rooms);
35777
37021
  }
35778
- UsePrefix = (message) => {
35779
- return `[][] ==>> ${message}`;
35780
- };
35781
- error = (message) => {
35782
- this.#logger.error(this.UsePrefix(message));
35783
- };
35784
- warn = (message) => {
35785
- this.#logger.warn(this.UsePrefix(message));
35786
- };
35787
- info = (message) => {
35788
- this.#logger.info(this.UsePrefix(message));
35789
- };
35790
- http = (message) => {
35791
- this.#logger.http(this.UsePrefix(message));
35792
- };
35793
- verbose = (message) => {
35794
- this.#logger.verbose(this.UsePrefix(message));
35795
- };
35796
- debug = (message) => {
35797
- this.#logger.debug(this.UsePrefix(message));
35798
- };
35799
- silly = (message) => {
35800
- this.#logger.silly(this.UsePrefix(message));
37022
+ JoinRoom = () => {
37023
+ this.#socketIoClient.socket?.emit("__STSjoinRoom", this.#options.rooms);
35801
37024
  };
37025
+ error(message) {
37026
+ this.#log({
37027
+ level: "error",
37028
+ message
37029
+ });
37030
+ }
37031
+ warn(message) {
37032
+ this.#log({
37033
+ level: "warn",
37034
+ message
37035
+ });
37036
+ }
37037
+ info(message) {
37038
+ this.#log({
37039
+ level: "info",
37040
+ message
37041
+ });
37042
+ }
37043
+ http(message) {
37044
+ this.#log({
37045
+ level: "http",
37046
+ message
37047
+ });
37048
+ }
37049
+ verbose(message) {
37050
+ this.#log({
37051
+ level: "verbose",
37052
+ message
37053
+ });
37054
+ }
37055
+ debug(message) {
37056
+ this.#log({
37057
+ level: "debug",
37058
+ message
37059
+ });
37060
+ }
37061
+ silly(message) {
37062
+ this.#log({
37063
+ level: "silly",
37064
+ message
37065
+ });
37066
+ }
37067
+ #log(info) {
37068
+ this.#socketIoClient.socket?.emit("__STSsendToRoom", this.#options.rooms, {
37069
+ command: "logmessage",
37070
+ payload: {
37071
+ level: info.level,
37072
+ message: info.message,
37073
+ dateTime: Date.now()
37074
+ }
37075
+ });
37076
+ }
35802
37077
  };
35803
37078
  //#endregion
35804
37079
  //#region src/libmodule/workerFhirTestCases.ts
35805
37080
  var WorkerFhirTestCases = class extends _nsshunt_stsrunnerframework.AbstractRunnerExecutionWorker {
35806
37081
  _resourceDataGenerator;
35807
- _workerTestCaseLogger;
35808
37082
  _logRoom = `logs_workerTestCase`;
37083
+ _loggerSocket;
35809
37084
  constructor() {
35810
37085
  super();
35811
37086
  this._resourceDataGenerator = new ResourceDataGenerator();
35812
- this._workerTestCaseLogger = new WorkerTestCaseLogger({
35813
- outputToDefaultLogger: true,
37087
+ this._loggerSocket = new STSLoggerSocket({
35814
37088
  imendpoint: "https://stscore.stsmda.org",
35815
- import: 3001,
35816
- imsocketnamespace: "stsinstrumentmanager/stsmonitor",
37089
+ import: "3001",
35817
37090
  rooms: [this._logRoom]
35818
37091
  });
35819
37092
  }
@@ -35821,7 +37094,7 @@ var WorkerFhirTestCases = class extends _nsshunt_stsrunnerframework.AbstractRunn
35821
37094
  return this._resourceDataGenerator;
35822
37095
  }
35823
37096
  get logger() {
35824
- return this._workerTestCaseLogger;
37097
+ return this._loggerSocket;
35825
37098
  }
35826
37099
  CreateAsyncRunner = async (testRunnerTelemetryPayload) => {
35827
37100
  return AsyncRunnerFactory.CreateAsyncRunner(this, testRunnerTelemetryPayload);