@nsshunt/stsobservability 1.0.3 → 1.0.4
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/stsobservability.mjs +317 -2417
- package/dist/stsobservability.mjs.map +1 -1
- package/dist/stsobservability.umd.js +312 -2412
- package/dist/stsobservability.umd.js.map +1 -1
- package/package.json +1 -2
- package/types/globalServiceDefinitions.d.ts +1 -0
- package/types/globalServiceDefinitions.d.ts.map +1 -1
|
@@ -993,12 +993,12 @@ class InstrumentLog extends InstrumentBase {
|
|
|
993
993
|
__privateSet(this, _useLatestMessages, useLatestMessages);
|
|
994
994
|
return this;
|
|
995
995
|
}
|
|
996
|
-
WithConsoleLogging(
|
|
997
|
-
__privateSet(this, _consoleLogging,
|
|
996
|
+
WithConsoleLogging(consoleLogging2) {
|
|
997
|
+
__privateSet(this, _consoleLogging, consoleLogging2);
|
|
998
998
|
return this;
|
|
999
999
|
}
|
|
1000
|
-
WithInstrumentLogging(
|
|
1001
|
-
__privateSet(this, _instrumentLogging,
|
|
1000
|
+
WithInstrumentLogging(instrumentLogging2) {
|
|
1001
|
+
__privateSet(this, _instrumentLogging, instrumentLogging2);
|
|
1002
1002
|
return this;
|
|
1003
1003
|
}
|
|
1004
1004
|
get MaxSize() {
|
|
@@ -1259,44 +1259,18 @@ convertMS_fn = function(ms) {
|
|
|
1259
1259
|
return (d + "." + pad(h) + ":" + pad(m) + ":" + pad(s)).padStart(12);
|
|
1260
1260
|
};
|
|
1261
1261
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1262
|
-
function getDefaultExportFromCjs
|
|
1262
|
+
function getDefaultExportFromCjs(x) {
|
|
1263
1263
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1264
1264
|
}
|
|
1265
|
-
function getAugmentedNamespace(n) {
|
|
1266
|
-
if (n.__esModule)
|
|
1267
|
-
return n;
|
|
1268
|
-
var f = n.default;
|
|
1269
|
-
if (typeof f == "function") {
|
|
1270
|
-
var a = function a2() {
|
|
1271
|
-
if (this instanceof a2) {
|
|
1272
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
1273
|
-
}
|
|
1274
|
-
return f.apply(this, arguments);
|
|
1275
|
-
};
|
|
1276
|
-
a.prototype = f.prototype;
|
|
1277
|
-
} else
|
|
1278
|
-
a = {};
|
|
1279
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
1280
|
-
Object.keys(n).forEach(function(k) {
|
|
1281
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1282
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
1283
|
-
enumerable: true,
|
|
1284
|
-
get: function() {
|
|
1285
|
-
return n[k];
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
});
|
|
1289
|
-
return a;
|
|
1290
|
-
}
|
|
1291
1265
|
var timsort$1 = {};
|
|
1292
|
-
(function(
|
|
1266
|
+
(function(exports) {
|
|
1293
1267
|
(function(global2, factory) {
|
|
1294
1268
|
{
|
|
1295
|
-
factory(
|
|
1269
|
+
factory(exports);
|
|
1296
1270
|
}
|
|
1297
|
-
})(commonjsGlobal, function(
|
|
1298
|
-
|
|
1299
|
-
|
|
1271
|
+
})(commonjsGlobal, function(exports2) {
|
|
1272
|
+
exports2.__esModule = true;
|
|
1273
|
+
exports2.sort = sort;
|
|
1300
1274
|
function _classCallCheck(instance, Constructor) {
|
|
1301
1275
|
if (!(instance instanceof Constructor)) {
|
|
1302
1276
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -1955,7 +1929,7 @@ function percentile(pOrPs, list, fn) {
|
|
|
1955
1929
|
});
|
|
1956
1930
|
}
|
|
1957
1931
|
var lib = percentile;
|
|
1958
|
-
const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs
|
|
1932
|
+
const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs(lib);
|
|
1959
1933
|
class InstrumentGaugeOptions extends InstrumentBaseOptions {
|
|
1960
1934
|
constructor() {
|
|
1961
1935
|
super(...arguments);
|
|
@@ -2579,14 +2553,14 @@ class RequestLoggerMiddleware extends STSOptionsBase {
|
|
|
2579
2553
|
}
|
|
2580
2554
|
_tinyEmitter = new WeakMap();
|
|
2581
2555
|
_RequestCompleted = new WeakMap();
|
|
2582
|
-
var ansiStyles$
|
|
2583
|
-
var colorName
|
|
2584
|
-
var hasRequiredColorName
|
|
2585
|
-
function requireColorName
|
|
2586
|
-
if (hasRequiredColorName
|
|
2587
|
-
return colorName
|
|
2588
|
-
hasRequiredColorName
|
|
2589
|
-
colorName
|
|
2556
|
+
var ansiStyles$1 = { exports: {} };
|
|
2557
|
+
var colorName;
|
|
2558
|
+
var hasRequiredColorName;
|
|
2559
|
+
function requireColorName() {
|
|
2560
|
+
if (hasRequiredColorName)
|
|
2561
|
+
return colorName;
|
|
2562
|
+
hasRequiredColorName = 1;
|
|
2563
|
+
colorName = {
|
|
2590
2564
|
"aliceblue": [240, 248, 255],
|
|
2591
2565
|
"antiquewhite": [250, 235, 215],
|
|
2592
2566
|
"aqua": [0, 255, 255],
|
|
@@ -2736,15 +2710,15 @@ function requireColorName$1() {
|
|
|
2736
2710
|
"yellow": [255, 255, 0],
|
|
2737
2711
|
"yellowgreen": [154, 205, 50]
|
|
2738
2712
|
};
|
|
2739
|
-
return colorName
|
|
2713
|
+
return colorName;
|
|
2740
2714
|
}
|
|
2741
|
-
var conversions
|
|
2742
|
-
var hasRequiredConversions
|
|
2743
|
-
function requireConversions
|
|
2744
|
-
if (hasRequiredConversions
|
|
2745
|
-
return conversions
|
|
2746
|
-
hasRequiredConversions
|
|
2747
|
-
const cssKeywords = requireColorName
|
|
2715
|
+
var conversions;
|
|
2716
|
+
var hasRequiredConversions;
|
|
2717
|
+
function requireConversions() {
|
|
2718
|
+
if (hasRequiredConversions)
|
|
2719
|
+
return conversions;
|
|
2720
|
+
hasRequiredConversions = 1;
|
|
2721
|
+
const cssKeywords = requireColorName();
|
|
2748
2722
|
const reverseKeywords = {};
|
|
2749
2723
|
for (const key of Object.keys(cssKeywords)) {
|
|
2750
2724
|
reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -2766,7 +2740,7 @@ function requireConversions$1() {
|
|
|
2766
2740
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
2767
2741
|
gray: { channels: 1, labels: ["gray"] }
|
|
2768
2742
|
};
|
|
2769
|
-
conversions
|
|
2743
|
+
conversions = convert;
|
|
2770
2744
|
for (const model of Object.keys(convert)) {
|
|
2771
2745
|
if (!("channels" in convert[model])) {
|
|
2772
2746
|
throw new Error("missing channels property: " + model);
|
|
@@ -3409,15 +3383,15 @@ function requireConversions$1() {
|
|
|
3409
3383
|
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
3410
3384
|
return [val / 255 * 100];
|
|
3411
3385
|
};
|
|
3412
|
-
return conversions
|
|
3386
|
+
return conversions;
|
|
3413
3387
|
}
|
|
3414
|
-
var route
|
|
3415
|
-
var hasRequiredRoute
|
|
3416
|
-
function requireRoute
|
|
3417
|
-
if (hasRequiredRoute
|
|
3418
|
-
return route
|
|
3419
|
-
hasRequiredRoute
|
|
3420
|
-
const conversions2 = requireConversions
|
|
3388
|
+
var route;
|
|
3389
|
+
var hasRequiredRoute;
|
|
3390
|
+
function requireRoute() {
|
|
3391
|
+
if (hasRequiredRoute)
|
|
3392
|
+
return route;
|
|
3393
|
+
hasRequiredRoute = 1;
|
|
3394
|
+
const conversions2 = requireConversions();
|
|
3421
3395
|
function buildGraph() {
|
|
3422
3396
|
const graph = {};
|
|
3423
3397
|
const models = Object.keys(conversions2);
|
|
@@ -3456,18 +3430,18 @@ function requireRoute$1() {
|
|
|
3456
3430
|
};
|
|
3457
3431
|
}
|
|
3458
3432
|
function wrapConversion(toModel, graph) {
|
|
3459
|
-
const
|
|
3433
|
+
const path = [graph[toModel].parent, toModel];
|
|
3460
3434
|
let fn = conversions2[graph[toModel].parent][toModel];
|
|
3461
3435
|
let cur = graph[toModel].parent;
|
|
3462
3436
|
while (graph[cur].parent) {
|
|
3463
|
-
|
|
3437
|
+
path.unshift(graph[cur].parent);
|
|
3464
3438
|
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
3465
3439
|
cur = graph[cur].parent;
|
|
3466
3440
|
}
|
|
3467
|
-
fn.conversion =
|
|
3441
|
+
fn.conversion = path;
|
|
3468
3442
|
return fn;
|
|
3469
3443
|
}
|
|
3470
|
-
route
|
|
3444
|
+
route = function(fromModel) {
|
|
3471
3445
|
const graph = deriveBFS(fromModel);
|
|
3472
3446
|
const conversion = {};
|
|
3473
3447
|
const models = Object.keys(graph);
|
|
@@ -3481,16 +3455,16 @@ function requireRoute$1() {
|
|
|
3481
3455
|
}
|
|
3482
3456
|
return conversion;
|
|
3483
3457
|
};
|
|
3484
|
-
return route
|
|
3458
|
+
return route;
|
|
3485
3459
|
}
|
|
3486
|
-
var colorConvert
|
|
3487
|
-
var hasRequiredColorConvert
|
|
3488
|
-
function requireColorConvert
|
|
3489
|
-
if (hasRequiredColorConvert
|
|
3490
|
-
return colorConvert
|
|
3491
|
-
hasRequiredColorConvert
|
|
3492
|
-
const conversions2 = requireConversions
|
|
3493
|
-
const route2 = requireRoute
|
|
3460
|
+
var colorConvert;
|
|
3461
|
+
var hasRequiredColorConvert;
|
|
3462
|
+
function requireColorConvert() {
|
|
3463
|
+
if (hasRequiredColorConvert)
|
|
3464
|
+
return colorConvert;
|
|
3465
|
+
hasRequiredColorConvert = 1;
|
|
3466
|
+
const conversions2 = requireConversions();
|
|
3467
|
+
const route2 = requireRoute();
|
|
3494
3468
|
const convert = {};
|
|
3495
3469
|
const models = Object.keys(conversions2);
|
|
3496
3470
|
function wrapRaw(fn) {
|
|
@@ -3543,10 +3517,10 @@ function requireColorConvert$1() {
|
|
|
3543
3517
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
3544
3518
|
});
|
|
3545
3519
|
});
|
|
3546
|
-
colorConvert
|
|
3547
|
-
return colorConvert
|
|
3520
|
+
colorConvert = convert;
|
|
3521
|
+
return colorConvert;
|
|
3548
3522
|
}
|
|
3549
|
-
ansiStyles$
|
|
3523
|
+
ansiStyles$1.exports;
|
|
3550
3524
|
(function(module) {
|
|
3551
3525
|
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
3552
3526
|
const code = fn(...args);
|
|
@@ -3580,16 +3554,16 @@ ansiStyles$3.exports;
|
|
|
3580
3554
|
let colorConvert2;
|
|
3581
3555
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
3582
3556
|
if (colorConvert2 === void 0) {
|
|
3583
|
-
colorConvert2 = requireColorConvert
|
|
3557
|
+
colorConvert2 = requireColorConvert();
|
|
3584
3558
|
}
|
|
3585
3559
|
const offset = isBackground ? 10 : 0;
|
|
3586
3560
|
const styles2 = {};
|
|
3587
3561
|
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
3588
|
-
const
|
|
3562
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
3589
3563
|
if (sourceSpace === targetSpace) {
|
|
3590
|
-
styles2[
|
|
3564
|
+
styles2[name] = wrap(identity, offset);
|
|
3591
3565
|
} else if (typeof suite === "object") {
|
|
3592
|
-
styles2[
|
|
3566
|
+
styles2[name] = wrap(suite[targetSpace], offset);
|
|
3593
3567
|
}
|
|
3594
3568
|
}
|
|
3595
3569
|
return styles2;
|
|
@@ -3683,13 +3657,13 @@ ansiStyles$3.exports;
|
|
|
3683
3657
|
enumerable: true,
|
|
3684
3658
|
get: assembleStyles
|
|
3685
3659
|
});
|
|
3686
|
-
})(ansiStyles$
|
|
3687
|
-
var ansiStylesExports
|
|
3688
|
-
var browser
|
|
3660
|
+
})(ansiStyles$1);
|
|
3661
|
+
var ansiStylesExports = ansiStyles$1.exports;
|
|
3662
|
+
var browser = {
|
|
3689
3663
|
stdout: false,
|
|
3690
3664
|
stderr: false
|
|
3691
3665
|
};
|
|
3692
|
-
const stringReplaceAll$
|
|
3666
|
+
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
3693
3667
|
let index = string.indexOf(substring);
|
|
3694
3668
|
if (index === -1) {
|
|
3695
3669
|
return string;
|
|
@@ -3705,7 +3679,7 @@ const stringReplaceAll$3 = (string, substring, replacer) => {
|
|
|
3705
3679
|
returnValue += string.substr(endIndex);
|
|
3706
3680
|
return returnValue;
|
|
3707
3681
|
};
|
|
3708
|
-
const stringEncaseCRLFWithFirstIndex$
|
|
3682
|
+
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
3709
3683
|
let endIndex = 0;
|
|
3710
3684
|
let returnValue = "";
|
|
3711
3685
|
do {
|
|
@@ -3717,16 +3691,16 @@ const stringEncaseCRLFWithFirstIndex$3 = (string, prefix, postfix, index) => {
|
|
|
3717
3691
|
returnValue += string.substr(endIndex);
|
|
3718
3692
|
return returnValue;
|
|
3719
3693
|
};
|
|
3720
|
-
var util
|
|
3721
|
-
stringReplaceAll: stringReplaceAll$
|
|
3722
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$
|
|
3694
|
+
var util = {
|
|
3695
|
+
stringReplaceAll: stringReplaceAll$1,
|
|
3696
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
3723
3697
|
};
|
|
3724
|
-
var templates
|
|
3725
|
-
var hasRequiredTemplates
|
|
3726
|
-
function requireTemplates
|
|
3727
|
-
if (hasRequiredTemplates
|
|
3728
|
-
return templates
|
|
3729
|
-
hasRequiredTemplates
|
|
3698
|
+
var templates;
|
|
3699
|
+
var hasRequiredTemplates;
|
|
3700
|
+
function requireTemplates() {
|
|
3701
|
+
if (hasRequiredTemplates)
|
|
3702
|
+
return templates;
|
|
3703
|
+
hasRequiredTemplates = 1;
|
|
3730
3704
|
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
3731
3705
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
3732
3706
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -3754,7 +3728,7 @@ function requireTemplates$1() {
|
|
|
3754
3728
|
}
|
|
3755
3729
|
return ESCAPES.get(c) || c;
|
|
3756
3730
|
}
|
|
3757
|
-
function parseArguments(
|
|
3731
|
+
function parseArguments(name, arguments_) {
|
|
3758
3732
|
const results = [];
|
|
3759
3733
|
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
3760
3734
|
let matches;
|
|
@@ -3765,7 +3739,7 @@ function requireTemplates$1() {
|
|
|
3765
3739
|
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
3766
3740
|
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
3767
3741
|
} else {
|
|
3768
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${
|
|
3742
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
3769
3743
|
}
|
|
3770
3744
|
}
|
|
3771
3745
|
return results;
|
|
@@ -3775,12 +3749,12 @@ function requireTemplates$1() {
|
|
|
3775
3749
|
const results = [];
|
|
3776
3750
|
let matches;
|
|
3777
3751
|
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
3778
|
-
const
|
|
3752
|
+
const name = matches[1];
|
|
3779
3753
|
if (matches[2]) {
|
|
3780
|
-
const args = parseArguments(
|
|
3781
|
-
results.push([
|
|
3754
|
+
const args = parseArguments(name, matches[2]);
|
|
3755
|
+
results.push([name].concat(args));
|
|
3782
3756
|
} else {
|
|
3783
|
-
results.push([
|
|
3757
|
+
results.push([name]);
|
|
3784
3758
|
}
|
|
3785
3759
|
}
|
|
3786
3760
|
return results;
|
|
@@ -3804,7 +3778,7 @@ function requireTemplates$1() {
|
|
|
3804
3778
|
}
|
|
3805
3779
|
return current;
|
|
3806
3780
|
}
|
|
3807
|
-
templates
|
|
3781
|
+
templates = (chalk2, temporary) => {
|
|
3808
3782
|
const styles2 = [];
|
|
3809
3783
|
const chunks = [];
|
|
3810
3784
|
let chunk = [];
|
|
@@ -3834,92 +3808,92 @@ function requireTemplates$1() {
|
|
|
3834
3808
|
}
|
|
3835
3809
|
return chunks.join("");
|
|
3836
3810
|
};
|
|
3837
|
-
return templates
|
|
3811
|
+
return templates;
|
|
3838
3812
|
}
|
|
3839
|
-
const ansiStyles
|
|
3840
|
-
const { stdout: stdoutColor
|
|
3813
|
+
const ansiStyles = ansiStylesExports;
|
|
3814
|
+
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
3841
3815
|
const {
|
|
3842
|
-
stringReplaceAll
|
|
3843
|
-
stringEncaseCRLFWithFirstIndex
|
|
3844
|
-
} = util
|
|
3845
|
-
const { isArray
|
|
3846
|
-
const levelMapping
|
|
3816
|
+
stringReplaceAll,
|
|
3817
|
+
stringEncaseCRLFWithFirstIndex
|
|
3818
|
+
} = util;
|
|
3819
|
+
const { isArray } = Array;
|
|
3820
|
+
const levelMapping = [
|
|
3847
3821
|
"ansi",
|
|
3848
3822
|
"ansi",
|
|
3849
3823
|
"ansi256",
|
|
3850
3824
|
"ansi16m"
|
|
3851
3825
|
];
|
|
3852
|
-
const styles
|
|
3853
|
-
const applyOptions
|
|
3826
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
3827
|
+
const applyOptions = (object, options = {}) => {
|
|
3854
3828
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
3855
3829
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
3856
3830
|
}
|
|
3857
|
-
const colorLevel = stdoutColor
|
|
3831
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
3858
3832
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
3859
3833
|
};
|
|
3860
|
-
|
|
3834
|
+
class ChalkClass {
|
|
3861
3835
|
constructor(options) {
|
|
3862
|
-
return chalkFactory
|
|
3836
|
+
return chalkFactory(options);
|
|
3863
3837
|
}
|
|
3864
|
-
}
|
|
3865
|
-
const chalkFactory
|
|
3838
|
+
}
|
|
3839
|
+
const chalkFactory = (options) => {
|
|
3866
3840
|
const chalk2 = {};
|
|
3867
|
-
applyOptions
|
|
3868
|
-
chalk2.template = (...arguments_) => chalkTag
|
|
3869
|
-
Object.setPrototypeOf(chalk2, Chalk
|
|
3841
|
+
applyOptions(chalk2, options);
|
|
3842
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
3843
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
3870
3844
|
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
3871
3845
|
chalk2.template.constructor = () => {
|
|
3872
3846
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
3873
3847
|
};
|
|
3874
|
-
chalk2.template.Instance = ChalkClass
|
|
3848
|
+
chalk2.template.Instance = ChalkClass;
|
|
3875
3849
|
return chalk2.template;
|
|
3876
3850
|
};
|
|
3877
|
-
function Chalk
|
|
3878
|
-
return chalkFactory
|
|
3851
|
+
function Chalk(options) {
|
|
3852
|
+
return chalkFactory(options);
|
|
3879
3853
|
}
|
|
3880
|
-
for (const [styleName, style] of Object.entries(ansiStyles
|
|
3881
|
-
styles
|
|
3854
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
3855
|
+
styles[styleName] = {
|
|
3882
3856
|
get() {
|
|
3883
|
-
const builder = createBuilder
|
|
3857
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
3884
3858
|
Object.defineProperty(this, styleName, { value: builder });
|
|
3885
3859
|
return builder;
|
|
3886
3860
|
}
|
|
3887
3861
|
};
|
|
3888
3862
|
}
|
|
3889
|
-
styles
|
|
3863
|
+
styles.visible = {
|
|
3890
3864
|
get() {
|
|
3891
|
-
const builder = createBuilder
|
|
3865
|
+
const builder = createBuilder(this, this._styler, true);
|
|
3892
3866
|
Object.defineProperty(this, "visible", { value: builder });
|
|
3893
3867
|
return builder;
|
|
3894
3868
|
}
|
|
3895
3869
|
};
|
|
3896
|
-
const usedModels
|
|
3897
|
-
for (const model of usedModels
|
|
3898
|
-
styles
|
|
3870
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
3871
|
+
for (const model of usedModels) {
|
|
3872
|
+
styles[model] = {
|
|
3899
3873
|
get() {
|
|
3900
3874
|
const { level } = this;
|
|
3901
3875
|
return function(...arguments_) {
|
|
3902
|
-
const styler = createStyler
|
|
3903
|
-
return createBuilder
|
|
3876
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
3877
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
3904
3878
|
};
|
|
3905
3879
|
}
|
|
3906
3880
|
};
|
|
3907
3881
|
}
|
|
3908
|
-
for (const model of usedModels
|
|
3882
|
+
for (const model of usedModels) {
|
|
3909
3883
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
3910
|
-
styles
|
|
3884
|
+
styles[bgModel] = {
|
|
3911
3885
|
get() {
|
|
3912
3886
|
const { level } = this;
|
|
3913
3887
|
return function(...arguments_) {
|
|
3914
|
-
const styler = createStyler
|
|
3915
|
-
return createBuilder
|
|
3888
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
3889
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
3916
3890
|
};
|
|
3917
3891
|
}
|
|
3918
3892
|
};
|
|
3919
3893
|
}
|
|
3920
|
-
const proto
|
|
3894
|
+
const proto = Object.defineProperties(() => {
|
|
3921
3895
|
}, {
|
|
3922
|
-
...styles
|
|
3896
|
+
...styles,
|
|
3923
3897
|
level: {
|
|
3924
3898
|
enumerable: true,
|
|
3925
3899
|
get() {
|
|
@@ -3930,7 +3904,7 @@ const proto$1 = Object.defineProperties(() => {
|
|
|
3930
3904
|
}
|
|
3931
3905
|
}
|
|
3932
3906
|
});
|
|
3933
|
-
const createStyler
|
|
3907
|
+
const createStyler = (open, close, parent) => {
|
|
3934
3908
|
let openAll;
|
|
3935
3909
|
let closeAll;
|
|
3936
3910
|
if (parent === void 0) {
|
|
@@ -3948,20 +3922,20 @@ const createStyler$1 = (open, close, parent) => {
|
|
|
3948
3922
|
parent
|
|
3949
3923
|
};
|
|
3950
3924
|
};
|
|
3951
|
-
const createBuilder
|
|
3925
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
3952
3926
|
const builder = (...arguments_) => {
|
|
3953
|
-
if (isArray
|
|
3954
|
-
return applyStyle
|
|
3927
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
3928
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
3955
3929
|
}
|
|
3956
|
-
return applyStyle
|
|
3930
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
3957
3931
|
};
|
|
3958
|
-
Object.setPrototypeOf(builder, proto
|
|
3932
|
+
Object.setPrototypeOf(builder, proto);
|
|
3959
3933
|
builder._generator = self2;
|
|
3960
3934
|
builder._styler = _styler;
|
|
3961
3935
|
builder._isEmpty = _isEmpty;
|
|
3962
3936
|
return builder;
|
|
3963
3937
|
};
|
|
3964
|
-
const applyStyle
|
|
3938
|
+
const applyStyle = (self2, string) => {
|
|
3965
3939
|
if (self2.level <= 0 || !string) {
|
|
3966
3940
|
return self2._isEmpty ? "" : string;
|
|
3967
3941
|
}
|
|
@@ -3972,20 +3946,20 @@ const applyStyle$1 = (self2, string) => {
|
|
|
3972
3946
|
const { openAll, closeAll } = styler;
|
|
3973
3947
|
if (string.indexOf("\x1B") !== -1) {
|
|
3974
3948
|
while (styler !== void 0) {
|
|
3975
|
-
string = stringReplaceAll
|
|
3949
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
3976
3950
|
styler = styler.parent;
|
|
3977
3951
|
}
|
|
3978
3952
|
}
|
|
3979
3953
|
const lfIndex = string.indexOf("\n");
|
|
3980
3954
|
if (lfIndex !== -1) {
|
|
3981
|
-
string = stringEncaseCRLFWithFirstIndex
|
|
3955
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
3982
3956
|
}
|
|
3983
3957
|
return openAll + string + closeAll;
|
|
3984
3958
|
};
|
|
3985
|
-
let template
|
|
3986
|
-
const chalkTag
|
|
3959
|
+
let template;
|
|
3960
|
+
const chalkTag = (chalk2, ...strings) => {
|
|
3987
3961
|
const [firstString] = strings;
|
|
3988
|
-
if (!isArray
|
|
3962
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
3989
3963
|
return strings.join(" ");
|
|
3990
3964
|
}
|
|
3991
3965
|
const arguments_ = strings.slice(1);
|
|
@@ -3996,18 +3970,18 @@ const chalkTag$1 = (chalk2, ...strings) => {
|
|
|
3996
3970
|
String(firstString.raw[i])
|
|
3997
3971
|
);
|
|
3998
3972
|
}
|
|
3999
|
-
if (template
|
|
4000
|
-
template
|
|
3973
|
+
if (template === void 0) {
|
|
3974
|
+
template = requireTemplates();
|
|
4001
3975
|
}
|
|
4002
|
-
return template
|
|
3976
|
+
return template(chalk2, parts.join(""));
|
|
4003
3977
|
};
|
|
4004
|
-
Object.defineProperties(Chalk
|
|
4005
|
-
const chalk
|
|
4006
|
-
chalk
|
|
4007
|
-
chalk
|
|
4008
|
-
chalk
|
|
4009
|
-
var source
|
|
4010
|
-
const chalk$
|
|
3978
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
3979
|
+
const chalk = Chalk();
|
|
3980
|
+
chalk.supportsColor = stdoutColor;
|
|
3981
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
3982
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
3983
|
+
var source = chalk;
|
|
3984
|
+
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
4011
3985
|
var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
|
|
4012
3986
|
ePublishState2[ePublishState2["init"] = 0] = "init";
|
|
4013
3987
|
ePublishState2[ePublishState2["started"] = 1] = "started";
|
|
@@ -4059,7 +4033,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4059
4033
|
}
|
|
4060
4034
|
async StartPublish() {
|
|
4061
4035
|
if (__privateGet(this, _publishState) !== 0) {
|
|
4062
|
-
this.options.logger.debug(chalk$
|
|
4036
|
+
this.options.logger.debug(chalk$1.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state.`));
|
|
4063
4037
|
return false;
|
|
4064
4038
|
}
|
|
4065
4039
|
__privateSet(this, _publishState, 1);
|
|
@@ -4068,7 +4042,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4068
4042
|
}
|
|
4069
4043
|
async EndPublish() {
|
|
4070
4044
|
if (__privateGet(this, _publishState) !== 1) {
|
|
4071
|
-
this.options.logger.debug(chalk$
|
|
4045
|
+
this.options.logger.debug(chalk$1.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state.`));
|
|
4072
4046
|
return false;
|
|
4073
4047
|
}
|
|
4074
4048
|
__privateSet(this, _publishState, 2);
|
|
@@ -4083,11 +4057,11 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4083
4057
|
}
|
|
4084
4058
|
SetupInstrumentation() {
|
|
4085
4059
|
if (!this.options.instrumentDefinitions) {
|
|
4086
|
-
this.options.logger.debug(chalk$
|
|
4060
|
+
this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
|
|
4087
4061
|
return;
|
|
4088
4062
|
}
|
|
4089
4063
|
if (!this.options.processContext) {
|
|
4090
|
-
this.options.logger.debug(chalk$
|
|
4064
|
+
this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation: No context defined within supplied options.`));
|
|
4091
4065
|
return;
|
|
4092
4066
|
}
|
|
4093
4067
|
__privateMethod(this, _CreateInstruments, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
|
|
@@ -4112,7 +4086,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4112
4086
|
if (__privateGet(this, _instruments)[instrumentName]) {
|
|
4113
4087
|
__privateMethod(this, _ProcessTelemetryCommand, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
|
|
4114
4088
|
} else {
|
|
4115
|
-
this.options.logger.debug(chalk$
|
|
4089
|
+
this.options.logger.debug(chalk$1.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
|
|
4116
4090
|
}
|
|
4117
4091
|
}
|
|
4118
4092
|
/*
|
|
@@ -4341,21 +4315,21 @@ const GetSTSInstrumentController = (app) => {
|
|
|
4341
4315
|
const STSInstrumentControllerPlugin = {
|
|
4342
4316
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4343
4317
|
install: (app, options) => {
|
|
4344
|
-
options.logger.debug(chalk$
|
|
4318
|
+
options.logger.debug(chalk$1.yellow(`STSInstrumentControllerPlugin:install:Start`));
|
|
4345
4319
|
const aic = new AgentInstrumentController(options);
|
|
4346
4320
|
if (!app.config.globalProperties.$sts) {
|
|
4347
|
-
options.logger.debug(chalk$
|
|
4321
|
+
options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
|
|
4348
4322
|
app.config.globalProperties.$sts = {};
|
|
4349
|
-
options.logger.debug(chalk$
|
|
4323
|
+
options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
|
|
4350
4324
|
} else {
|
|
4351
|
-
options.logger.debug(chalk$
|
|
4325
|
+
options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
|
|
4352
4326
|
}
|
|
4353
4327
|
app.config.globalProperties.$sts.aic = aic;
|
|
4354
4328
|
app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
|
|
4355
|
-
options.logger.debug(chalk$
|
|
4329
|
+
options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
4356
4330
|
app.provide(STSInstrumentControllerPluginKey, aic);
|
|
4357
|
-
options.logger.debug(chalk$
|
|
4358
|
-
options.logger.debug(chalk$
|
|
4331
|
+
options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
4332
|
+
options.logger.debug(chalk$1.green(`STSInstrumentControllerPlugin:install:End`));
|
|
4359
4333
|
}
|
|
4360
4334
|
};
|
|
4361
4335
|
function utf8Count(str) {
|
|
@@ -5041,14 +5015,14 @@ class PublishTransportRESTServer extends STSOptionsBase {
|
|
|
5041
5015
|
}
|
|
5042
5016
|
}
|
|
5043
5017
|
if (retVal.status !== 200) {
|
|
5044
|
-
this.options.logger.debug(chalk$
|
|
5018
|
+
this.options.logger.debug(chalk$1.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
|
|
5045
5019
|
return false;
|
|
5046
5020
|
} else {
|
|
5047
|
-
this.options.logger.debug(chalk$
|
|
5021
|
+
this.options.logger.debug(chalk$1.green(`_PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
|
|
5048
5022
|
}
|
|
5049
5023
|
return true;
|
|
5050
5024
|
} catch (error) {
|
|
5051
|
-
this.options.logger.error(chalk$
|
|
5025
|
+
this.options.logger.error(chalk$1.red(`Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
|
|
5052
5026
|
return false;
|
|
5053
5027
|
}
|
|
5054
5028
|
});
|
|
@@ -5407,7 +5381,7 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5407
5381
|
subscription.cb(payload);
|
|
5408
5382
|
}
|
|
5409
5383
|
} catch (error) {
|
|
5410
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
5384
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5411
5385
|
__privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
|
|
5412
5386
|
}
|
|
5413
5387
|
});
|
|
@@ -5419,11 +5393,11 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5419
5393
|
async Subscribe(subscriptions) {
|
|
5420
5394
|
subscriptions.map(async (subId) => {
|
|
5421
5395
|
__privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
|
|
5422
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
5396
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5423
5397
|
try {
|
|
5424
5398
|
__privateMethod(this, _AddKeepAlive, AddKeepAlive_fn).call(this, subId);
|
|
5425
5399
|
} catch (error) {
|
|
5426
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
5400
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5427
5401
|
__privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
|
|
5428
5402
|
}
|
|
5429
5403
|
});
|
|
@@ -5434,7 +5408,7 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5434
5408
|
UnSubscribe(subscriptions) {
|
|
5435
5409
|
subscriptions.map(async (subId) => {
|
|
5436
5410
|
__privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
|
|
5437
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
5411
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5438
5412
|
});
|
|
5439
5413
|
}
|
|
5440
5414
|
}
|
|
@@ -5571,13 +5545,13 @@ SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
|
|
|
5571
5545
|
if (timeoutDuration < 500) {
|
|
5572
5546
|
timeoutDuration = 500;
|
|
5573
5547
|
}
|
|
5574
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
5548
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
|
|
5575
5549
|
socketSubscribeKeepAlive.timeout = __privateMethod(this, _SetupTimeout, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
|
|
5576
5550
|
} else {
|
|
5577
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
5551
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
|
|
5578
5552
|
}
|
|
5579
5553
|
} catch (error) {
|
|
5580
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
5554
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5581
5555
|
__privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
|
|
5582
5556
|
}
|
|
5583
5557
|
}, timeout);
|
|
@@ -5595,7 +5569,7 @@ AddKeepAlive_fn = function(subscription) {
|
|
|
5595
5569
|
_RemoveKeepAlive = new WeakSet();
|
|
5596
5570
|
RemoveKeepAlive_fn = function(subscription) {
|
|
5597
5571
|
if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
|
|
5598
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
5572
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5599
5573
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
|
|
5600
5574
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
|
|
5601
5575
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
|
|
@@ -5673,7 +5647,7 @@ class SocketIoMessageSender {
|
|
|
5673
5647
|
return __privateGet(this, _socket);
|
|
5674
5648
|
}
|
|
5675
5649
|
set socket(socket) {
|
|
5676
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5650
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
|
|
5677
5651
|
__privateSet(this, _socket, socket);
|
|
5678
5652
|
}
|
|
5679
5653
|
AckListener(message, payload) {
|
|
@@ -5686,25 +5660,25 @@ class SocketIoMessageSender {
|
|
|
5686
5660
|
message.status = "SUCCESS";
|
|
5687
5661
|
message.subscriptionKeyResponse = payload;
|
|
5688
5662
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5689
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5663
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5690
5664
|
message.resolve(message);
|
|
5691
5665
|
}
|
|
5692
5666
|
}
|
|
5693
5667
|
ResponseTimout(message) {
|
|
5694
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5668
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5695
5669
|
delete message.timeoutId;
|
|
5696
5670
|
__privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5697
5671
|
message.endTime = performance.now();
|
|
5698
5672
|
if (message.retryCount >= __privateGet(this, _maxReties)) {
|
|
5699
5673
|
message.status = "FAIL";
|
|
5700
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5674
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5701
5675
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5702
5676
|
message.reject(message);
|
|
5703
5677
|
return;
|
|
5704
5678
|
}
|
|
5705
5679
|
message.status = "INRETRY";
|
|
5706
5680
|
message.retryCount++;
|
|
5707
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5681
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5708
5682
|
this.SendMessage(message);
|
|
5709
5683
|
}
|
|
5710
5684
|
SendMessage(message) {
|
|
@@ -5717,7 +5691,7 @@ class SocketIoMessageSender {
|
|
|
5717
5691
|
};
|
|
5718
5692
|
message.BoundAckListenerCallback = AckListenerCallback.bind(this);
|
|
5719
5693
|
__privateGet(this, _socket).on(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5720
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5694
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5721
5695
|
__privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
|
|
5722
5696
|
}
|
|
5723
5697
|
SendMessageWithAck(eventName, subscriptionKey) {
|
|
@@ -5741,7 +5715,7 @@ class SocketIoMessageSender {
|
|
|
5741
5715
|
const killIds = [];
|
|
5742
5716
|
for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
|
|
5743
5717
|
if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
|
|
5744
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
5718
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5745
5719
|
clearTimeout(message.timeoutId);
|
|
5746
5720
|
delete message.timeoutId;
|
|
5747
5721
|
__privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
@@ -5791,7 +5765,7 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5791
5765
|
return __privateGet(this, _socket2);
|
|
5792
5766
|
}
|
|
5793
5767
|
set socket(socket) {
|
|
5794
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5768
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
|
|
5795
5769
|
__privateSet(this, _socket2, socket);
|
|
5796
5770
|
__privateGet(this, _socketIoMessageSender).socket = socket;
|
|
5797
5771
|
}
|
|
@@ -5802,14 +5776,14 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5802
5776
|
const socket = __privateGet(this, _socket2);
|
|
5803
5777
|
subscriptions.map(async (subId) => {
|
|
5804
5778
|
__privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
|
|
5805
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5779
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5806
5780
|
try {
|
|
5807
5781
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
|
|
5808
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5782
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5809
5783
|
__privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subId);
|
|
5810
5784
|
socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5811
5785
|
} catch (error) {
|
|
5812
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
5786
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5813
5787
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5814
5788
|
__privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
|
|
5815
5789
|
}
|
|
@@ -5824,12 +5798,12 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5824
5798
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5825
5799
|
__privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
|
|
5826
5800
|
__privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
|
|
5827
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5801
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5828
5802
|
try {
|
|
5829
5803
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
|
|
5830
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5804
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5831
5805
|
} catch (error) {
|
|
5832
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
5806
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
|
|
5833
5807
|
}
|
|
5834
5808
|
});
|
|
5835
5809
|
}
|
|
@@ -5865,13 +5839,13 @@ AddKeepAlive_fn2 = function(socket, subscription) {
|
|
|
5865
5839
|
__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
|
|
5866
5840
|
id: subscription.subscriptionKey.id,
|
|
5867
5841
|
timeout: setTimeout(async () => {
|
|
5868
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5842
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5869
5843
|
try {
|
|
5870
5844
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
|
|
5871
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5845
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5872
5846
|
__privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subscription);
|
|
5873
5847
|
} catch (error) {
|
|
5874
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
5848
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5875
5849
|
socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
|
|
5876
5850
|
__privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subscription);
|
|
5877
5851
|
}
|
|
@@ -5881,7 +5855,7 @@ AddKeepAlive_fn2 = function(socket, subscription) {
|
|
|
5881
5855
|
_RemoveKeepAlive2 = new WeakSet();
|
|
5882
5856
|
RemoveKeepAlive_fn2 = function(subscription) {
|
|
5883
5857
|
if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
|
|
5884
|
-
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$
|
|
5858
|
+
__privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5885
5859
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
|
|
5886
5860
|
delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
|
|
5887
5861
|
}
|
|
@@ -5929,7 +5903,7 @@ class ObservabilitySubscriptionManager {
|
|
|
5929
5903
|
subscriptions.map((subscription) => {
|
|
5930
5904
|
const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
|
|
5931
5905
|
if (retVal) {
|
|
5932
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
5906
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
|
|
5933
5907
|
} else {
|
|
5934
5908
|
subscriptionsToAdd.push(subscription);
|
|
5935
5909
|
}
|
|
@@ -5938,7 +5912,7 @@ class ObservabilitySubscriptionManager {
|
|
|
5938
5912
|
subscriptionsToAdd.map((s) => this.subscriptions.push(s));
|
|
5939
5913
|
(_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
|
|
5940
5914
|
} else {
|
|
5941
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
5915
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
|
|
5942
5916
|
}
|
|
5943
5917
|
}
|
|
5944
5918
|
RemoveSubscriptionsByKey(keyToFind) {
|
|
@@ -6033,7 +6007,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6033
6007
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
|
|
6034
6008
|
__privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6035
6009
|
if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
|
|
6036
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6010
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
|
|
6037
6011
|
}
|
|
6038
6012
|
}
|
|
6039
6013
|
} catch (error) {
|
|
@@ -6048,7 +6022,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6048
6022
|
for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6049
6023
|
__privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6050
6024
|
if (__privateGet(this, _serviceModel)[serviceId] === null) {
|
|
6051
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6025
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServices():Error: GetModelForService() returned null`));
|
|
6052
6026
|
}
|
|
6053
6027
|
}
|
|
6054
6028
|
} catch (error) {
|
|
@@ -6082,7 +6056,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6082
6056
|
}
|
|
6083
6057
|
}
|
|
6084
6058
|
} else {
|
|
6085
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6059
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
|
|
6086
6060
|
}
|
|
6087
6061
|
} else {
|
|
6088
6062
|
if (subscribeToKafka) {
|
|
@@ -6125,7 +6099,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6125
6099
|
}
|
|
6126
6100
|
}
|
|
6127
6101
|
} else {
|
|
6128
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6102
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
|
|
6129
6103
|
}
|
|
6130
6104
|
} else {
|
|
6131
6105
|
if (subscribeToKafka) {
|
|
@@ -6150,7 +6124,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6150
6124
|
if (Object.keys(subscriptionPayload.data).length !== 0) {
|
|
6151
6125
|
__privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6152
6126
|
if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
|
|
6153
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6127
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
|
|
6154
6128
|
}
|
|
6155
6129
|
}
|
|
6156
6130
|
}
|
|
@@ -6184,7 +6158,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6184
6158
|
}
|
|
6185
6159
|
}
|
|
6186
6160
|
} else {
|
|
6187
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6161
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
|
|
6188
6162
|
}
|
|
6189
6163
|
} else {
|
|
6190
6164
|
if (subscribeToKafka) {
|
|
@@ -6195,7 +6169,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6195
6169
|
}
|
|
6196
6170
|
}
|
|
6197
6171
|
} catch (error) {
|
|
6198
|
-
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$
|
|
6172
|
+
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
|
|
6199
6173
|
}
|
|
6200
6174
|
}
|
|
6201
6175
|
// /agentId/agentWorkerId
|
|
@@ -6228,7 +6202,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6228
6202
|
}
|
|
6229
6203
|
}
|
|
6230
6204
|
} else {
|
|
6231
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6205
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
|
|
6232
6206
|
}
|
|
6233
6207
|
} else {
|
|
6234
6208
|
if (subscribeToKafka) {
|
|
@@ -6240,7 +6214,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6240
6214
|
}
|
|
6241
6215
|
}
|
|
6242
6216
|
} catch (error) {
|
|
6243
|
-
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$
|
|
6217
|
+
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
|
|
6244
6218
|
}
|
|
6245
6219
|
}
|
|
6246
6220
|
// /agentId/agentWorkerId/asyncRunnerId
|
|
@@ -6270,7 +6244,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6270
6244
|
}
|
|
6271
6245
|
}
|
|
6272
6246
|
} else {
|
|
6273
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6247
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
|
|
6274
6248
|
}
|
|
6275
6249
|
} else {
|
|
6276
6250
|
if (subscribeToKafka) {
|
|
@@ -6283,7 +6257,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6283
6257
|
}
|
|
6284
6258
|
}
|
|
6285
6259
|
} catch (error) {
|
|
6286
|
-
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$
|
|
6260
|
+
__privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
|
|
6287
6261
|
}
|
|
6288
6262
|
}
|
|
6289
6263
|
// --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
|
|
@@ -6294,7 +6268,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6294
6268
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
|
|
6295
6269
|
__privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6296
6270
|
if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
|
|
6297
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6271
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
|
|
6298
6272
|
}
|
|
6299
6273
|
}
|
|
6300
6274
|
} catch (error) {
|
|
@@ -6309,7 +6283,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6309
6283
|
for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6310
6284
|
__privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6311
6285
|
if (__privateGet(this, _lambdaModel)[technologyId] === null) {
|
|
6312
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6286
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
|
|
6313
6287
|
}
|
|
6314
6288
|
}
|
|
6315
6289
|
} catch (error) {
|
|
@@ -6343,7 +6317,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6343
6317
|
}
|
|
6344
6318
|
}
|
|
6345
6319
|
} else {
|
|
6346
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6320
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
|
|
6347
6321
|
}
|
|
6348
6322
|
} else {
|
|
6349
6323
|
if (subscribeToKafka) {
|
|
@@ -6386,7 +6360,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6386
6360
|
}
|
|
6387
6361
|
}
|
|
6388
6362
|
} else {
|
|
6389
|
-
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$
|
|
6363
|
+
__privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
|
|
6390
6364
|
}
|
|
6391
6365
|
} else {
|
|
6392
6366
|
if (subscribeToKafka) {
|
|
@@ -6445,21 +6419,21 @@ class SocketIoClientHelper {
|
|
|
6445
6419
|
get sockets() {
|
|
6446
6420
|
return __privateGet(this, _sockets);
|
|
6447
6421
|
}
|
|
6448
|
-
SetupClientSideSocket(
|
|
6449
|
-
this.sockets[
|
|
6450
|
-
name
|
|
6422
|
+
SetupClientSideSocket(name, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
|
|
6423
|
+
this.sockets[name] = {
|
|
6424
|
+
name,
|
|
6451
6425
|
address,
|
|
6452
6426
|
socket: null,
|
|
6453
6427
|
errorCallBack
|
|
6454
6428
|
};
|
|
6455
|
-
__privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6456
|
-
return this.sockets[
|
|
6429
|
+
__privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack);
|
|
6430
|
+
return this.sockets[name].socket;
|
|
6457
6431
|
}
|
|
6458
|
-
GetSocket(
|
|
6459
|
-
return this.sockets[
|
|
6432
|
+
GetSocket(name) {
|
|
6433
|
+
return this.sockets[name].socket;
|
|
6460
6434
|
}
|
|
6461
|
-
GetSocketDetail(
|
|
6462
|
-
return this.sockets[
|
|
6435
|
+
GetSocketDetail(name) {
|
|
6436
|
+
return this.sockets[name];
|
|
6463
6437
|
}
|
|
6464
6438
|
}
|
|
6465
6439
|
_options6 = new WeakMap();
|
|
@@ -6476,17 +6450,17 @@ LogErrorMessage_fn4 = function(message) {
|
|
|
6476
6450
|
__privateGet(this, _options6).logger.error(message);
|
|
6477
6451
|
};
|
|
6478
6452
|
_EstablishSocketConnect = new WeakSet();
|
|
6479
|
-
EstablishSocketConnect_fn = function(
|
|
6480
|
-
const socketDetail = this.sockets[
|
|
6453
|
+
EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBack) {
|
|
6454
|
+
const socketDetail = this.sockets[name];
|
|
6481
6455
|
if (socketDetail.socket !== null) {
|
|
6482
6456
|
if (socketDetail.socket.connected === true) {
|
|
6483
6457
|
socketDetail.socket.disconnect();
|
|
6484
6458
|
}
|
|
6485
6459
|
socketDetail.socket = null;
|
|
6486
6460
|
if (isNode) {
|
|
6487
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6461
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6488
6462
|
} else {
|
|
6489
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6463
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6490
6464
|
}
|
|
6491
6465
|
return;
|
|
6492
6466
|
}
|
|
@@ -6528,12 +6502,12 @@ EstablishSocketConnect_fn = function(name2, onConnectCallBack, socketEventsCallB
|
|
|
6528
6502
|
{
|
|
6529
6503
|
__privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
6530
6504
|
__privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
|
|
6531
|
-
const socketDetail2 = this.sockets[
|
|
6505
|
+
const socketDetail2 = this.sockets[name];
|
|
6532
6506
|
socketDetail2.socket = null;
|
|
6533
6507
|
if (isNode) {
|
|
6534
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6508
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6535
6509
|
} else {
|
|
6536
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6510
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6537
6511
|
}
|
|
6538
6512
|
}
|
|
6539
6513
|
break;
|
|
@@ -6547,2197 +6521,120 @@ EstablishSocketConnect_fn = function(name2, onConnectCallBack, socketEventsCallB
|
|
|
6547
6521
|
{
|
|
6548
6522
|
__privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
6549
6523
|
__privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
|
|
6550
|
-
const socketDetail2 = this.sockets[
|
|
6524
|
+
const socketDetail2 = this.sockets[name];
|
|
6551
6525
|
if (socketDetail2.socket) {
|
|
6552
6526
|
socketDetail2.socket.disconnect();
|
|
6553
6527
|
}
|
|
6554
6528
|
socketDetail2.socket = null;
|
|
6555
6529
|
if (isNode) {
|
|
6556
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6530
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6557
6531
|
} else {
|
|
6558
|
-
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this,
|
|
6532
|
+
setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6559
6533
|
}
|
|
6560
6534
|
}
|
|
6561
6535
|
break;
|
|
6562
6536
|
}
|
|
6563
6537
|
});
|
|
6564
6538
|
};
|
|
6565
|
-
var
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
}
|
|
6571
|
-
const
|
|
6572
|
-
const
|
|
6573
|
-
const
|
|
6574
|
-
const
|
|
6575
|
-
const
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
"
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
test: "tap tests/*.js --100 -Rspec",
|
|
6597
|
-
"test:coverage": "tap --coverage-report=lcov",
|
|
6598
|
-
prerelease: "npm test",
|
|
6599
|
-
release: "standard-version"
|
|
6600
|
-
};
|
|
6601
|
-
const repository = {
|
|
6602
|
-
type: "git",
|
|
6603
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
6604
|
-
};
|
|
6605
|
-
const funding = "https://dotenvx.com";
|
|
6606
|
-
const keywords = [
|
|
6607
|
-
"dotenv",
|
|
6608
|
-
"env",
|
|
6609
|
-
".env",
|
|
6610
|
-
"environment",
|
|
6611
|
-
"variables",
|
|
6612
|
-
"config",
|
|
6613
|
-
"settings"
|
|
6614
|
-
];
|
|
6615
|
-
const readmeFilename = "README.md";
|
|
6616
|
-
const license = "BSD-2-Clause";
|
|
6617
|
-
const devDependencies = {
|
|
6618
|
-
"@definitelytyped/dtslint": "^0.0.133",
|
|
6619
|
-
"@types/node": "^18.11.3",
|
|
6620
|
-
decache: "^4.6.1",
|
|
6621
|
-
sinon: "^14.0.1",
|
|
6622
|
-
standard: "^17.0.0",
|
|
6623
|
-
"standard-markdown": "^7.1.0",
|
|
6624
|
-
"standard-version": "^9.5.0",
|
|
6625
|
-
tap: "^16.3.0",
|
|
6626
|
-
tar: "^6.1.11",
|
|
6627
|
-
typescript: "^4.8.4"
|
|
6628
|
-
};
|
|
6629
|
-
const engines = {
|
|
6630
|
-
node: ">=12"
|
|
6631
|
-
};
|
|
6632
|
-
const browser$1 = {
|
|
6633
|
-
fs: false
|
|
6634
|
-
};
|
|
6635
|
-
const require$$4 = {
|
|
6636
|
-
name,
|
|
6637
|
-
version: version$1,
|
|
6638
|
-
description,
|
|
6639
|
-
main,
|
|
6640
|
-
types,
|
|
6641
|
-
exports,
|
|
6642
|
-
scripts,
|
|
6643
|
-
repository,
|
|
6644
|
-
funding,
|
|
6645
|
-
keywords,
|
|
6646
|
-
readmeFilename,
|
|
6647
|
-
license,
|
|
6648
|
-
devDependencies,
|
|
6649
|
-
engines,
|
|
6650
|
-
browser: browser$1
|
|
6651
|
-
};
|
|
6652
|
-
const fs$1 = require$$3;
|
|
6653
|
-
const path = require$$3;
|
|
6654
|
-
const os = require$$3;
|
|
6655
|
-
const crypto$1 = require$$3;
|
|
6656
|
-
const packageJson = require$$4;
|
|
6657
|
-
const version = packageJson.version;
|
|
6658
|
-
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
6659
|
-
function parse(src) {
|
|
6660
|
-
const obj = {};
|
|
6661
|
-
let lines = src.toString();
|
|
6662
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
6663
|
-
let match;
|
|
6664
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
6665
|
-
const key = match[1];
|
|
6666
|
-
let value = match[2] || "";
|
|
6667
|
-
value = value.trim();
|
|
6668
|
-
const maybeQuote = value[0];
|
|
6669
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
6670
|
-
if (maybeQuote === '"') {
|
|
6671
|
-
value = value.replace(/\\n/g, "\n");
|
|
6672
|
-
value = value.replace(/\\r/g, "\r");
|
|
6673
|
-
}
|
|
6674
|
-
obj[key] = value;
|
|
6675
|
-
}
|
|
6676
|
-
return obj;
|
|
6677
|
-
}
|
|
6678
|
-
function _parseVault(options) {
|
|
6679
|
-
const vaultPath = _vaultPath(options);
|
|
6680
|
-
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
6681
|
-
if (!result.parsed) {
|
|
6682
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
6683
|
-
err.code = "MISSING_DATA";
|
|
6684
|
-
throw err;
|
|
6685
|
-
}
|
|
6686
|
-
const keys = _dotenvKey(options).split(",");
|
|
6687
|
-
const length = keys.length;
|
|
6688
|
-
let decrypted;
|
|
6689
|
-
for (let i = 0; i < length; i++) {
|
|
6690
|
-
try {
|
|
6691
|
-
const key = keys[i].trim();
|
|
6692
|
-
const attrs = _instructions(result, key);
|
|
6693
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
6694
|
-
break;
|
|
6695
|
-
} catch (error) {
|
|
6696
|
-
if (i + 1 >= length) {
|
|
6697
|
-
throw error;
|
|
6698
|
-
}
|
|
6699
|
-
}
|
|
6700
|
-
}
|
|
6701
|
-
return DotenvModule.parse(decrypted);
|
|
6702
|
-
}
|
|
6703
|
-
function _log(message) {
|
|
6704
|
-
console.log(`[dotenv@${version}][INFO] ${message}`);
|
|
6705
|
-
}
|
|
6706
|
-
function _warn(message) {
|
|
6707
|
-
console.log(`[dotenv@${version}][WARN] ${message}`);
|
|
6708
|
-
}
|
|
6709
|
-
function _debug(message) {
|
|
6710
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
6711
|
-
}
|
|
6712
|
-
function _dotenvKey(options) {
|
|
6713
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
6714
|
-
return options.DOTENV_KEY;
|
|
6715
|
-
}
|
|
6716
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
6717
|
-
return process.env.DOTENV_KEY;
|
|
6718
|
-
}
|
|
6719
|
-
return "";
|
|
6720
|
-
}
|
|
6721
|
-
function _instructions(result, dotenvKey) {
|
|
6722
|
-
let uri;
|
|
6723
|
-
try {
|
|
6724
|
-
uri = new URL(dotenvKey);
|
|
6725
|
-
} catch (error) {
|
|
6726
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
6727
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
6728
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
6729
|
-
throw err;
|
|
6730
|
-
}
|
|
6731
|
-
throw error;
|
|
6732
|
-
}
|
|
6733
|
-
const key = uri.password;
|
|
6734
|
-
if (!key) {
|
|
6735
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
6736
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
6737
|
-
throw err;
|
|
6738
|
-
}
|
|
6739
|
-
const environment = uri.searchParams.get("environment");
|
|
6740
|
-
if (!environment) {
|
|
6741
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
6742
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
6743
|
-
throw err;
|
|
6744
|
-
}
|
|
6745
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
6746
|
-
const ciphertext = result.parsed[environmentKey];
|
|
6747
|
-
if (!ciphertext) {
|
|
6748
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
6749
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
6750
|
-
throw err;
|
|
6751
|
-
}
|
|
6752
|
-
return { ciphertext, key };
|
|
6753
|
-
}
|
|
6754
|
-
function _vaultPath(options) {
|
|
6755
|
-
let possibleVaultPath = null;
|
|
6756
|
-
if (options && options.path && options.path.length > 0) {
|
|
6757
|
-
if (Array.isArray(options.path)) {
|
|
6758
|
-
for (const filepath of options.path) {
|
|
6759
|
-
if (fs$1.existsSync(filepath)) {
|
|
6760
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
6761
|
-
}
|
|
6762
|
-
}
|
|
6763
|
-
} else {
|
|
6764
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
6765
|
-
}
|
|
6766
|
-
} else {
|
|
6767
|
-
possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
|
|
6768
|
-
}
|
|
6769
|
-
if (fs$1.existsSync(possibleVaultPath)) {
|
|
6770
|
-
return possibleVaultPath;
|
|
6771
|
-
}
|
|
6772
|
-
return null;
|
|
6773
|
-
}
|
|
6774
|
-
function _resolveHome(envPath) {
|
|
6775
|
-
return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
6776
|
-
}
|
|
6777
|
-
function _configVault(options) {
|
|
6778
|
-
_log("Loading env from encrypted .env.vault");
|
|
6779
|
-
const parsed = DotenvModule._parseVault(options);
|
|
6780
|
-
let processEnv = process.env;
|
|
6781
|
-
if (options && options.processEnv != null) {
|
|
6782
|
-
processEnv = options.processEnv;
|
|
6783
|
-
}
|
|
6784
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
6785
|
-
return { parsed };
|
|
6786
|
-
}
|
|
6787
|
-
function configDotenv(options) {
|
|
6788
|
-
const dotenvPath = path.resolve(process.cwd(), ".env");
|
|
6789
|
-
let encoding = "utf8";
|
|
6790
|
-
const debug = Boolean(options && options.debug);
|
|
6791
|
-
if (options && options.encoding) {
|
|
6792
|
-
encoding = options.encoding;
|
|
6793
|
-
} else {
|
|
6794
|
-
if (debug) {
|
|
6795
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
6796
|
-
}
|
|
6797
|
-
}
|
|
6798
|
-
let optionPaths = [dotenvPath];
|
|
6799
|
-
if (options && options.path) {
|
|
6800
|
-
if (!Array.isArray(options.path)) {
|
|
6801
|
-
optionPaths = [_resolveHome(options.path)];
|
|
6802
|
-
} else {
|
|
6803
|
-
optionPaths = [];
|
|
6804
|
-
for (const filepath of options.path) {
|
|
6805
|
-
optionPaths.push(_resolveHome(filepath));
|
|
6539
|
+
var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
|
|
6540
|
+
influxDBDataType2["intField"] = "intField";
|
|
6541
|
+
influxDBDataType2["floatField"] = "floatField";
|
|
6542
|
+
influxDBDataType2["stringField"] = "stringField";
|
|
6543
|
+
return influxDBDataType2;
|
|
6544
|
+
})(influxDBDataType || {});
|
|
6545
|
+
const instrumentationObservationInterval = 1e3;
|
|
6546
|
+
const instrumentationTimeWindow = 600;
|
|
6547
|
+
const consoleLogging = true;
|
|
6548
|
+
const instrumentLogging = true;
|
|
6549
|
+
const globalServiceDefinitions = {
|
|
6550
|
+
coreFieldList: [
|
|
6551
|
+
{ fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6552
|
+
{ fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6553
|
+
{ fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6554
|
+
{ fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6555
|
+
{ fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6556
|
+
{ fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6557
|
+
{ fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
6558
|
+
{
|
|
6559
|
+
fieldName: "activeRequestCount",
|
|
6560
|
+
gauge: Gauge.ACTIVE_REQUEST_GAUGE,
|
|
6561
|
+
instrumentProperty: "val",
|
|
6562
|
+
dataType: "number",
|
|
6563
|
+
timeSeriesIndex: true,
|
|
6564
|
+
quantile: true,
|
|
6565
|
+
influxdbDataType: "intField",
|
|
6566
|
+
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
6567
|
+
instrumentOptions: {
|
|
6568
|
+
interval: instrumentationObservationInterval,
|
|
6569
|
+
sampleSize: instrumentationTimeWindow
|
|
6806
6570
|
}
|
|
6571
|
+
},
|
|
6572
|
+
{ fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
6573
|
+
{ fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
6574
|
+
{ fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
6575
|
+
{ fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
|
|
6576
|
+
{
|
|
6577
|
+
fieldName: "duration",
|
|
6578
|
+
gauge: Gauge.DURATION_GAUGE,
|
|
6579
|
+
instrumentProperty: "val",
|
|
6580
|
+
dataType: "number",
|
|
6581
|
+
timeSeriesIndex: true,
|
|
6582
|
+
quantile: true,
|
|
6583
|
+
influxdbDataType: "floatField",
|
|
6584
|
+
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
6585
|
+
instrumentOptions: {
|
|
6586
|
+
interval: instrumentationObservationInterval,
|
|
6587
|
+
sampleSize: instrumentationTimeWindow
|
|
6588
|
+
},
|
|
6589
|
+
histo: [
|
|
6590
|
+
{ label: "B10", bucketLimit: 10 },
|
|
6591
|
+
{ label: "B20", bucketLimit: 20 },
|
|
6592
|
+
{ label: "B50", bucketLimit: 50 },
|
|
6593
|
+
{ label: "B100", bucketLimit: 100 },
|
|
6594
|
+
{ label: "B1000", bucketLimit: 1e3 },
|
|
6595
|
+
{ label: "B50000", bucketLimit: 5e4 },
|
|
6596
|
+
{ label: "BInfinity", bucketLimit: -1 }
|
|
6597
|
+
],
|
|
6598
|
+
histoGaugeType: Gauge.DURATION_HISTOGRAM_GAUGE
|
|
6599
|
+
},
|
|
6600
|
+
{
|
|
6601
|
+
fieldName: "latency",
|
|
6602
|
+
gauge: Gauge.LATENCY_GAUGE,
|
|
6603
|
+
instrumentProperty: "val",
|
|
6604
|
+
dataType: "number",
|
|
6605
|
+
timeSeriesIndex: true,
|
|
6606
|
+
quantile: true,
|
|
6607
|
+
influxdbDataType: "floatField",
|
|
6608
|
+
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
6609
|
+
instrumentOptions: {
|
|
6610
|
+
interval: instrumentationObservationInterval,
|
|
6611
|
+
sampleSize: instrumentationTimeWindow
|
|
6612
|
+
},
|
|
6613
|
+
histo: [
|
|
6614
|
+
{ label: "B10", bucketLimit: 10 },
|
|
6615
|
+
{ label: "B20", bucketLimit: 20 },
|
|
6616
|
+
{ label: "B50", bucketLimit: 50 },
|
|
6617
|
+
{ label: "B100", bucketLimit: 100 },
|
|
6618
|
+
{ label: "B1000", bucketLimit: 1e3 },
|
|
6619
|
+
{ label: "B50000", bucketLimit: 5e4 },
|
|
6620
|
+
{ label: "BInfinity", bucketLimit: -1 }
|
|
6621
|
+
],
|
|
6622
|
+
histoGaugeType: Gauge.LATENCY_HISTOGRAM_GAUGE
|
|
6807
6623
|
}
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
let processEnv = process.env;
|
|
6823
|
-
if (options && options.processEnv != null) {
|
|
6824
|
-
processEnv = options.processEnv;
|
|
6825
|
-
}
|
|
6826
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
|
6827
|
-
if (lastError) {
|
|
6828
|
-
return { parsed: parsedAll, error: lastError };
|
|
6829
|
-
} else {
|
|
6830
|
-
return { parsed: parsedAll };
|
|
6831
|
-
}
|
|
6832
|
-
}
|
|
6833
|
-
function config(options) {
|
|
6834
|
-
if (_dotenvKey(options).length === 0) {
|
|
6835
|
-
return DotenvModule.configDotenv(options);
|
|
6836
|
-
}
|
|
6837
|
-
const vaultPath = _vaultPath(options);
|
|
6838
|
-
if (!vaultPath) {
|
|
6839
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
6840
|
-
return DotenvModule.configDotenv(options);
|
|
6841
|
-
}
|
|
6842
|
-
return DotenvModule._configVault(options);
|
|
6843
|
-
}
|
|
6844
|
-
function decrypt(encrypted, keyStr) {
|
|
6845
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
6846
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
6847
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
6848
|
-
const authTag = ciphertext.subarray(-16);
|
|
6849
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
6850
|
-
try {
|
|
6851
|
-
const aesgcm = crypto$1.createDecipheriv("aes-256-gcm", key, nonce);
|
|
6852
|
-
aesgcm.setAuthTag(authTag);
|
|
6853
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
6854
|
-
} catch (error) {
|
|
6855
|
-
const isRange = error instanceof RangeError;
|
|
6856
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
6857
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
6858
|
-
if (isRange || invalidKeyLength) {
|
|
6859
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
6860
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
6861
|
-
throw err;
|
|
6862
|
-
} else if (decryptionFailed) {
|
|
6863
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
6864
|
-
err.code = "DECRYPTION_FAILED";
|
|
6865
|
-
throw err;
|
|
6866
|
-
} else {
|
|
6867
|
-
throw error;
|
|
6868
|
-
}
|
|
6869
|
-
}
|
|
6870
|
-
}
|
|
6871
|
-
function populate(processEnv, parsed, options = {}) {
|
|
6872
|
-
const debug = Boolean(options && options.debug);
|
|
6873
|
-
const override = Boolean(options && options.override);
|
|
6874
|
-
if (typeof parsed !== "object") {
|
|
6875
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
6876
|
-
err.code = "OBJECT_REQUIRED";
|
|
6877
|
-
throw err;
|
|
6878
|
-
}
|
|
6879
|
-
for (const key of Object.keys(parsed)) {
|
|
6880
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
6881
|
-
if (override === true) {
|
|
6882
|
-
processEnv[key] = parsed[key];
|
|
6883
|
-
}
|
|
6884
|
-
if (debug) {
|
|
6885
|
-
if (override === true) {
|
|
6886
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
6887
|
-
} else {
|
|
6888
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
6889
|
-
}
|
|
6890
|
-
}
|
|
6891
|
-
} else {
|
|
6892
|
-
processEnv[key] = parsed[key];
|
|
6893
|
-
}
|
|
6894
|
-
}
|
|
6895
|
-
}
|
|
6896
|
-
const DotenvModule = {
|
|
6897
|
-
configDotenv,
|
|
6898
|
-
_configVault,
|
|
6899
|
-
_parseVault,
|
|
6900
|
-
config,
|
|
6901
|
-
decrypt,
|
|
6902
|
-
parse,
|
|
6903
|
-
populate
|
|
6904
|
-
};
|
|
6905
|
-
main$1.exports.configDotenv = DotenvModule.configDotenv;
|
|
6906
|
-
main$1.exports._configVault = DotenvModule._configVault;
|
|
6907
|
-
main$1.exports._parseVault = DotenvModule._parseVault;
|
|
6908
|
-
var config_1 = main$1.exports.config = DotenvModule.config;
|
|
6909
|
-
main$1.exports.decrypt = DotenvModule.decrypt;
|
|
6910
|
-
main$1.exports.parse = DotenvModule.parse;
|
|
6911
|
-
main$1.exports.populate = DotenvModule.populate;
|
|
6912
|
-
main$1.exports = DotenvModule;
|
|
6913
|
-
const __viteBrowserExternal = {};
|
|
6914
|
-
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6915
|
-
__proto__: null,
|
|
6916
|
-
default: __viteBrowserExternal
|
|
6917
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
6918
|
-
function getDefaultExportFromCjs(x) {
|
|
6919
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
6920
|
-
}
|
|
6921
|
-
var ansiStyles$1 = { exports: {} };
|
|
6922
|
-
var colorName;
|
|
6923
|
-
var hasRequiredColorName;
|
|
6924
|
-
function requireColorName() {
|
|
6925
|
-
if (hasRequiredColorName)
|
|
6926
|
-
return colorName;
|
|
6927
|
-
hasRequiredColorName = 1;
|
|
6928
|
-
colorName = {
|
|
6929
|
-
"aliceblue": [240, 248, 255],
|
|
6930
|
-
"antiquewhite": [250, 235, 215],
|
|
6931
|
-
"aqua": [0, 255, 255],
|
|
6932
|
-
"aquamarine": [127, 255, 212],
|
|
6933
|
-
"azure": [240, 255, 255],
|
|
6934
|
-
"beige": [245, 245, 220],
|
|
6935
|
-
"bisque": [255, 228, 196],
|
|
6936
|
-
"black": [0, 0, 0],
|
|
6937
|
-
"blanchedalmond": [255, 235, 205],
|
|
6938
|
-
"blue": [0, 0, 255],
|
|
6939
|
-
"blueviolet": [138, 43, 226],
|
|
6940
|
-
"brown": [165, 42, 42],
|
|
6941
|
-
"burlywood": [222, 184, 135],
|
|
6942
|
-
"cadetblue": [95, 158, 160],
|
|
6943
|
-
"chartreuse": [127, 255, 0],
|
|
6944
|
-
"chocolate": [210, 105, 30],
|
|
6945
|
-
"coral": [255, 127, 80],
|
|
6946
|
-
"cornflowerblue": [100, 149, 237],
|
|
6947
|
-
"cornsilk": [255, 248, 220],
|
|
6948
|
-
"crimson": [220, 20, 60],
|
|
6949
|
-
"cyan": [0, 255, 255],
|
|
6950
|
-
"darkblue": [0, 0, 139],
|
|
6951
|
-
"darkcyan": [0, 139, 139],
|
|
6952
|
-
"darkgoldenrod": [184, 134, 11],
|
|
6953
|
-
"darkgray": [169, 169, 169],
|
|
6954
|
-
"darkgreen": [0, 100, 0],
|
|
6955
|
-
"darkgrey": [169, 169, 169],
|
|
6956
|
-
"darkkhaki": [189, 183, 107],
|
|
6957
|
-
"darkmagenta": [139, 0, 139],
|
|
6958
|
-
"darkolivegreen": [85, 107, 47],
|
|
6959
|
-
"darkorange": [255, 140, 0],
|
|
6960
|
-
"darkorchid": [153, 50, 204],
|
|
6961
|
-
"darkred": [139, 0, 0],
|
|
6962
|
-
"darksalmon": [233, 150, 122],
|
|
6963
|
-
"darkseagreen": [143, 188, 143],
|
|
6964
|
-
"darkslateblue": [72, 61, 139],
|
|
6965
|
-
"darkslategray": [47, 79, 79],
|
|
6966
|
-
"darkslategrey": [47, 79, 79],
|
|
6967
|
-
"darkturquoise": [0, 206, 209],
|
|
6968
|
-
"darkviolet": [148, 0, 211],
|
|
6969
|
-
"deeppink": [255, 20, 147],
|
|
6970
|
-
"deepskyblue": [0, 191, 255],
|
|
6971
|
-
"dimgray": [105, 105, 105],
|
|
6972
|
-
"dimgrey": [105, 105, 105],
|
|
6973
|
-
"dodgerblue": [30, 144, 255],
|
|
6974
|
-
"firebrick": [178, 34, 34],
|
|
6975
|
-
"floralwhite": [255, 250, 240],
|
|
6976
|
-
"forestgreen": [34, 139, 34],
|
|
6977
|
-
"fuchsia": [255, 0, 255],
|
|
6978
|
-
"gainsboro": [220, 220, 220],
|
|
6979
|
-
"ghostwhite": [248, 248, 255],
|
|
6980
|
-
"gold": [255, 215, 0],
|
|
6981
|
-
"goldenrod": [218, 165, 32],
|
|
6982
|
-
"gray": [128, 128, 128],
|
|
6983
|
-
"green": [0, 128, 0],
|
|
6984
|
-
"greenyellow": [173, 255, 47],
|
|
6985
|
-
"grey": [128, 128, 128],
|
|
6986
|
-
"honeydew": [240, 255, 240],
|
|
6987
|
-
"hotpink": [255, 105, 180],
|
|
6988
|
-
"indianred": [205, 92, 92],
|
|
6989
|
-
"indigo": [75, 0, 130],
|
|
6990
|
-
"ivory": [255, 255, 240],
|
|
6991
|
-
"khaki": [240, 230, 140],
|
|
6992
|
-
"lavender": [230, 230, 250],
|
|
6993
|
-
"lavenderblush": [255, 240, 245],
|
|
6994
|
-
"lawngreen": [124, 252, 0],
|
|
6995
|
-
"lemonchiffon": [255, 250, 205],
|
|
6996
|
-
"lightblue": [173, 216, 230],
|
|
6997
|
-
"lightcoral": [240, 128, 128],
|
|
6998
|
-
"lightcyan": [224, 255, 255],
|
|
6999
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
7000
|
-
"lightgray": [211, 211, 211],
|
|
7001
|
-
"lightgreen": [144, 238, 144],
|
|
7002
|
-
"lightgrey": [211, 211, 211],
|
|
7003
|
-
"lightpink": [255, 182, 193],
|
|
7004
|
-
"lightsalmon": [255, 160, 122],
|
|
7005
|
-
"lightseagreen": [32, 178, 170],
|
|
7006
|
-
"lightskyblue": [135, 206, 250],
|
|
7007
|
-
"lightslategray": [119, 136, 153],
|
|
7008
|
-
"lightslategrey": [119, 136, 153],
|
|
7009
|
-
"lightsteelblue": [176, 196, 222],
|
|
7010
|
-
"lightyellow": [255, 255, 224],
|
|
7011
|
-
"lime": [0, 255, 0],
|
|
7012
|
-
"limegreen": [50, 205, 50],
|
|
7013
|
-
"linen": [250, 240, 230],
|
|
7014
|
-
"magenta": [255, 0, 255],
|
|
7015
|
-
"maroon": [128, 0, 0],
|
|
7016
|
-
"mediumaquamarine": [102, 205, 170],
|
|
7017
|
-
"mediumblue": [0, 0, 205],
|
|
7018
|
-
"mediumorchid": [186, 85, 211],
|
|
7019
|
-
"mediumpurple": [147, 112, 219],
|
|
7020
|
-
"mediumseagreen": [60, 179, 113],
|
|
7021
|
-
"mediumslateblue": [123, 104, 238],
|
|
7022
|
-
"mediumspringgreen": [0, 250, 154],
|
|
7023
|
-
"mediumturquoise": [72, 209, 204],
|
|
7024
|
-
"mediumvioletred": [199, 21, 133],
|
|
7025
|
-
"midnightblue": [25, 25, 112],
|
|
7026
|
-
"mintcream": [245, 255, 250],
|
|
7027
|
-
"mistyrose": [255, 228, 225],
|
|
7028
|
-
"moccasin": [255, 228, 181],
|
|
7029
|
-
"navajowhite": [255, 222, 173],
|
|
7030
|
-
"navy": [0, 0, 128],
|
|
7031
|
-
"oldlace": [253, 245, 230],
|
|
7032
|
-
"olive": [128, 128, 0],
|
|
7033
|
-
"olivedrab": [107, 142, 35],
|
|
7034
|
-
"orange": [255, 165, 0],
|
|
7035
|
-
"orangered": [255, 69, 0],
|
|
7036
|
-
"orchid": [218, 112, 214],
|
|
7037
|
-
"palegoldenrod": [238, 232, 170],
|
|
7038
|
-
"palegreen": [152, 251, 152],
|
|
7039
|
-
"paleturquoise": [175, 238, 238],
|
|
7040
|
-
"palevioletred": [219, 112, 147],
|
|
7041
|
-
"papayawhip": [255, 239, 213],
|
|
7042
|
-
"peachpuff": [255, 218, 185],
|
|
7043
|
-
"peru": [205, 133, 63],
|
|
7044
|
-
"pink": [255, 192, 203],
|
|
7045
|
-
"plum": [221, 160, 221],
|
|
7046
|
-
"powderblue": [176, 224, 230],
|
|
7047
|
-
"purple": [128, 0, 128],
|
|
7048
|
-
"rebeccapurple": [102, 51, 153],
|
|
7049
|
-
"red": [255, 0, 0],
|
|
7050
|
-
"rosybrown": [188, 143, 143],
|
|
7051
|
-
"royalblue": [65, 105, 225],
|
|
7052
|
-
"saddlebrown": [139, 69, 19],
|
|
7053
|
-
"salmon": [250, 128, 114],
|
|
7054
|
-
"sandybrown": [244, 164, 96],
|
|
7055
|
-
"seagreen": [46, 139, 87],
|
|
7056
|
-
"seashell": [255, 245, 238],
|
|
7057
|
-
"sienna": [160, 82, 45],
|
|
7058
|
-
"silver": [192, 192, 192],
|
|
7059
|
-
"skyblue": [135, 206, 235],
|
|
7060
|
-
"slateblue": [106, 90, 205],
|
|
7061
|
-
"slategray": [112, 128, 144],
|
|
7062
|
-
"slategrey": [112, 128, 144],
|
|
7063
|
-
"snow": [255, 250, 250],
|
|
7064
|
-
"springgreen": [0, 255, 127],
|
|
7065
|
-
"steelblue": [70, 130, 180],
|
|
7066
|
-
"tan": [210, 180, 140],
|
|
7067
|
-
"teal": [0, 128, 128],
|
|
7068
|
-
"thistle": [216, 191, 216],
|
|
7069
|
-
"tomato": [255, 99, 71],
|
|
7070
|
-
"turquoise": [64, 224, 208],
|
|
7071
|
-
"violet": [238, 130, 238],
|
|
7072
|
-
"wheat": [245, 222, 179],
|
|
7073
|
-
"white": [255, 255, 255],
|
|
7074
|
-
"whitesmoke": [245, 245, 245],
|
|
7075
|
-
"yellow": [255, 255, 0],
|
|
7076
|
-
"yellowgreen": [154, 205, 50]
|
|
7077
|
-
};
|
|
7078
|
-
return colorName;
|
|
7079
|
-
}
|
|
7080
|
-
var conversions;
|
|
7081
|
-
var hasRequiredConversions;
|
|
7082
|
-
function requireConversions() {
|
|
7083
|
-
if (hasRequiredConversions)
|
|
7084
|
-
return conversions;
|
|
7085
|
-
hasRequiredConversions = 1;
|
|
7086
|
-
const cssKeywords = requireColorName();
|
|
7087
|
-
const reverseKeywords = {};
|
|
7088
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
7089
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
7090
|
-
}
|
|
7091
|
-
const convert = {
|
|
7092
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
7093
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
7094
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
7095
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
7096
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
7097
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
7098
|
-
lab: { channels: 3, labels: "lab" },
|
|
7099
|
-
lch: { channels: 3, labels: "lch" },
|
|
7100
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
7101
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
7102
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
7103
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
7104
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
7105
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
7106
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
7107
|
-
};
|
|
7108
|
-
conversions = convert;
|
|
7109
|
-
for (const model of Object.keys(convert)) {
|
|
7110
|
-
if (!("channels" in convert[model])) {
|
|
7111
|
-
throw new Error("missing channels property: " + model);
|
|
7112
|
-
}
|
|
7113
|
-
if (!("labels" in convert[model])) {
|
|
7114
|
-
throw new Error("missing channel labels property: " + model);
|
|
7115
|
-
}
|
|
7116
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
7117
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
7118
|
-
}
|
|
7119
|
-
const { channels, labels } = convert[model];
|
|
7120
|
-
delete convert[model].channels;
|
|
7121
|
-
delete convert[model].labels;
|
|
7122
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
7123
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
7124
|
-
}
|
|
7125
|
-
convert.rgb.hsl = function(rgb) {
|
|
7126
|
-
const r = rgb[0] / 255;
|
|
7127
|
-
const g = rgb[1] / 255;
|
|
7128
|
-
const b = rgb[2] / 255;
|
|
7129
|
-
const min = Math.min(r, g, b);
|
|
7130
|
-
const max = Math.max(r, g, b);
|
|
7131
|
-
const delta = max - min;
|
|
7132
|
-
let h;
|
|
7133
|
-
let s;
|
|
7134
|
-
if (max === min) {
|
|
7135
|
-
h = 0;
|
|
7136
|
-
} else if (r === max) {
|
|
7137
|
-
h = (g - b) / delta;
|
|
7138
|
-
} else if (g === max) {
|
|
7139
|
-
h = 2 + (b - r) / delta;
|
|
7140
|
-
} else if (b === max) {
|
|
7141
|
-
h = 4 + (r - g) / delta;
|
|
7142
|
-
}
|
|
7143
|
-
h = Math.min(h * 60, 360);
|
|
7144
|
-
if (h < 0) {
|
|
7145
|
-
h += 360;
|
|
7146
|
-
}
|
|
7147
|
-
const l = (min + max) / 2;
|
|
7148
|
-
if (max === min) {
|
|
7149
|
-
s = 0;
|
|
7150
|
-
} else if (l <= 0.5) {
|
|
7151
|
-
s = delta / (max + min);
|
|
7152
|
-
} else {
|
|
7153
|
-
s = delta / (2 - max - min);
|
|
7154
|
-
}
|
|
7155
|
-
return [h, s * 100, l * 100];
|
|
7156
|
-
};
|
|
7157
|
-
convert.rgb.hsv = function(rgb) {
|
|
7158
|
-
let rdif;
|
|
7159
|
-
let gdif;
|
|
7160
|
-
let bdif;
|
|
7161
|
-
let h;
|
|
7162
|
-
let s;
|
|
7163
|
-
const r = rgb[0] / 255;
|
|
7164
|
-
const g = rgb[1] / 255;
|
|
7165
|
-
const b = rgb[2] / 255;
|
|
7166
|
-
const v = Math.max(r, g, b);
|
|
7167
|
-
const diff = v - Math.min(r, g, b);
|
|
7168
|
-
const diffc = function(c) {
|
|
7169
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
7170
|
-
};
|
|
7171
|
-
if (diff === 0) {
|
|
7172
|
-
h = 0;
|
|
7173
|
-
s = 0;
|
|
7174
|
-
} else {
|
|
7175
|
-
s = diff / v;
|
|
7176
|
-
rdif = diffc(r);
|
|
7177
|
-
gdif = diffc(g);
|
|
7178
|
-
bdif = diffc(b);
|
|
7179
|
-
if (r === v) {
|
|
7180
|
-
h = bdif - gdif;
|
|
7181
|
-
} else if (g === v) {
|
|
7182
|
-
h = 1 / 3 + rdif - bdif;
|
|
7183
|
-
} else if (b === v) {
|
|
7184
|
-
h = 2 / 3 + gdif - rdif;
|
|
7185
|
-
}
|
|
7186
|
-
if (h < 0) {
|
|
7187
|
-
h += 1;
|
|
7188
|
-
} else if (h > 1) {
|
|
7189
|
-
h -= 1;
|
|
7190
|
-
}
|
|
7191
|
-
}
|
|
7192
|
-
return [
|
|
7193
|
-
h * 360,
|
|
7194
|
-
s * 100,
|
|
7195
|
-
v * 100
|
|
7196
|
-
];
|
|
7197
|
-
};
|
|
7198
|
-
convert.rgb.hwb = function(rgb) {
|
|
7199
|
-
const r = rgb[0];
|
|
7200
|
-
const g = rgb[1];
|
|
7201
|
-
let b = rgb[2];
|
|
7202
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
7203
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
7204
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
7205
|
-
return [h, w * 100, b * 100];
|
|
7206
|
-
};
|
|
7207
|
-
convert.rgb.cmyk = function(rgb) {
|
|
7208
|
-
const r = rgb[0] / 255;
|
|
7209
|
-
const g = rgb[1] / 255;
|
|
7210
|
-
const b = rgb[2] / 255;
|
|
7211
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
7212
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
7213
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
7214
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
7215
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
7216
|
-
};
|
|
7217
|
-
function comparativeDistance(x, y) {
|
|
7218
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
7219
|
-
}
|
|
7220
|
-
convert.rgb.keyword = function(rgb) {
|
|
7221
|
-
const reversed = reverseKeywords[rgb];
|
|
7222
|
-
if (reversed) {
|
|
7223
|
-
return reversed;
|
|
7224
|
-
}
|
|
7225
|
-
let currentClosestDistance = Infinity;
|
|
7226
|
-
let currentClosestKeyword;
|
|
7227
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
7228
|
-
const value = cssKeywords[keyword];
|
|
7229
|
-
const distance = comparativeDistance(rgb, value);
|
|
7230
|
-
if (distance < currentClosestDistance) {
|
|
7231
|
-
currentClosestDistance = distance;
|
|
7232
|
-
currentClosestKeyword = keyword;
|
|
7233
|
-
}
|
|
7234
|
-
}
|
|
7235
|
-
return currentClosestKeyword;
|
|
7236
|
-
};
|
|
7237
|
-
convert.keyword.rgb = function(keyword) {
|
|
7238
|
-
return cssKeywords[keyword];
|
|
7239
|
-
};
|
|
7240
|
-
convert.rgb.xyz = function(rgb) {
|
|
7241
|
-
let r = rgb[0] / 255;
|
|
7242
|
-
let g = rgb[1] / 255;
|
|
7243
|
-
let b = rgb[2] / 255;
|
|
7244
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
7245
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
7246
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
7247
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
7248
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
7249
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
7250
|
-
return [x * 100, y * 100, z * 100];
|
|
7251
|
-
};
|
|
7252
|
-
convert.rgb.lab = function(rgb) {
|
|
7253
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
7254
|
-
let x = xyz[0];
|
|
7255
|
-
let y = xyz[1];
|
|
7256
|
-
let z = xyz[2];
|
|
7257
|
-
x /= 95.047;
|
|
7258
|
-
y /= 100;
|
|
7259
|
-
z /= 108.883;
|
|
7260
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
7261
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
7262
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
7263
|
-
const l = 116 * y - 16;
|
|
7264
|
-
const a = 500 * (x - y);
|
|
7265
|
-
const b = 200 * (y - z);
|
|
7266
|
-
return [l, a, b];
|
|
7267
|
-
};
|
|
7268
|
-
convert.hsl.rgb = function(hsl) {
|
|
7269
|
-
const h = hsl[0] / 360;
|
|
7270
|
-
const s = hsl[1] / 100;
|
|
7271
|
-
const l = hsl[2] / 100;
|
|
7272
|
-
let t2;
|
|
7273
|
-
let t3;
|
|
7274
|
-
let val;
|
|
7275
|
-
if (s === 0) {
|
|
7276
|
-
val = l * 255;
|
|
7277
|
-
return [val, val, val];
|
|
7278
|
-
}
|
|
7279
|
-
if (l < 0.5) {
|
|
7280
|
-
t2 = l * (1 + s);
|
|
7281
|
-
} else {
|
|
7282
|
-
t2 = l + s - l * s;
|
|
7283
|
-
}
|
|
7284
|
-
const t1 = 2 * l - t2;
|
|
7285
|
-
const rgb = [0, 0, 0];
|
|
7286
|
-
for (let i = 0; i < 3; i++) {
|
|
7287
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
7288
|
-
if (t3 < 0) {
|
|
7289
|
-
t3++;
|
|
7290
|
-
}
|
|
7291
|
-
if (t3 > 1) {
|
|
7292
|
-
t3--;
|
|
7293
|
-
}
|
|
7294
|
-
if (6 * t3 < 1) {
|
|
7295
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
7296
|
-
} else if (2 * t3 < 1) {
|
|
7297
|
-
val = t2;
|
|
7298
|
-
} else if (3 * t3 < 2) {
|
|
7299
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
7300
|
-
} else {
|
|
7301
|
-
val = t1;
|
|
7302
|
-
}
|
|
7303
|
-
rgb[i] = val * 255;
|
|
7304
|
-
}
|
|
7305
|
-
return rgb;
|
|
7306
|
-
};
|
|
7307
|
-
convert.hsl.hsv = function(hsl) {
|
|
7308
|
-
const h = hsl[0];
|
|
7309
|
-
let s = hsl[1] / 100;
|
|
7310
|
-
let l = hsl[2] / 100;
|
|
7311
|
-
let smin = s;
|
|
7312
|
-
const lmin = Math.max(l, 0.01);
|
|
7313
|
-
l *= 2;
|
|
7314
|
-
s *= l <= 1 ? l : 2 - l;
|
|
7315
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
7316
|
-
const v = (l + s) / 2;
|
|
7317
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
7318
|
-
return [h, sv * 100, v * 100];
|
|
7319
|
-
};
|
|
7320
|
-
convert.hsv.rgb = function(hsv) {
|
|
7321
|
-
const h = hsv[0] / 60;
|
|
7322
|
-
const s = hsv[1] / 100;
|
|
7323
|
-
let v = hsv[2] / 100;
|
|
7324
|
-
const hi = Math.floor(h) % 6;
|
|
7325
|
-
const f = h - Math.floor(h);
|
|
7326
|
-
const p = 255 * v * (1 - s);
|
|
7327
|
-
const q = 255 * v * (1 - s * f);
|
|
7328
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
7329
|
-
v *= 255;
|
|
7330
|
-
switch (hi) {
|
|
7331
|
-
case 0:
|
|
7332
|
-
return [v, t, p];
|
|
7333
|
-
case 1:
|
|
7334
|
-
return [q, v, p];
|
|
7335
|
-
case 2:
|
|
7336
|
-
return [p, v, t];
|
|
7337
|
-
case 3:
|
|
7338
|
-
return [p, q, v];
|
|
7339
|
-
case 4:
|
|
7340
|
-
return [t, p, v];
|
|
7341
|
-
case 5:
|
|
7342
|
-
return [v, p, q];
|
|
7343
|
-
}
|
|
7344
|
-
};
|
|
7345
|
-
convert.hsv.hsl = function(hsv) {
|
|
7346
|
-
const h = hsv[0];
|
|
7347
|
-
const s = hsv[1] / 100;
|
|
7348
|
-
const v = hsv[2] / 100;
|
|
7349
|
-
const vmin = Math.max(v, 0.01);
|
|
7350
|
-
let sl;
|
|
7351
|
-
let l;
|
|
7352
|
-
l = (2 - s) * v;
|
|
7353
|
-
const lmin = (2 - s) * vmin;
|
|
7354
|
-
sl = s * vmin;
|
|
7355
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
7356
|
-
sl = sl || 0;
|
|
7357
|
-
l /= 2;
|
|
7358
|
-
return [h, sl * 100, l * 100];
|
|
7359
|
-
};
|
|
7360
|
-
convert.hwb.rgb = function(hwb) {
|
|
7361
|
-
const h = hwb[0] / 360;
|
|
7362
|
-
let wh = hwb[1] / 100;
|
|
7363
|
-
let bl = hwb[2] / 100;
|
|
7364
|
-
const ratio = wh + bl;
|
|
7365
|
-
let f;
|
|
7366
|
-
if (ratio > 1) {
|
|
7367
|
-
wh /= ratio;
|
|
7368
|
-
bl /= ratio;
|
|
7369
|
-
}
|
|
7370
|
-
const i = Math.floor(6 * h);
|
|
7371
|
-
const v = 1 - bl;
|
|
7372
|
-
f = 6 * h - i;
|
|
7373
|
-
if ((i & 1) !== 0) {
|
|
7374
|
-
f = 1 - f;
|
|
7375
|
-
}
|
|
7376
|
-
const n = wh + f * (v - wh);
|
|
7377
|
-
let r;
|
|
7378
|
-
let g;
|
|
7379
|
-
let b;
|
|
7380
|
-
switch (i) {
|
|
7381
|
-
default:
|
|
7382
|
-
case 6:
|
|
7383
|
-
case 0:
|
|
7384
|
-
r = v;
|
|
7385
|
-
g = n;
|
|
7386
|
-
b = wh;
|
|
7387
|
-
break;
|
|
7388
|
-
case 1:
|
|
7389
|
-
r = n;
|
|
7390
|
-
g = v;
|
|
7391
|
-
b = wh;
|
|
7392
|
-
break;
|
|
7393
|
-
case 2:
|
|
7394
|
-
r = wh;
|
|
7395
|
-
g = v;
|
|
7396
|
-
b = n;
|
|
7397
|
-
break;
|
|
7398
|
-
case 3:
|
|
7399
|
-
r = wh;
|
|
7400
|
-
g = n;
|
|
7401
|
-
b = v;
|
|
7402
|
-
break;
|
|
7403
|
-
case 4:
|
|
7404
|
-
r = n;
|
|
7405
|
-
g = wh;
|
|
7406
|
-
b = v;
|
|
7407
|
-
break;
|
|
7408
|
-
case 5:
|
|
7409
|
-
r = v;
|
|
7410
|
-
g = wh;
|
|
7411
|
-
b = n;
|
|
7412
|
-
break;
|
|
7413
|
-
}
|
|
7414
|
-
return [r * 255, g * 255, b * 255];
|
|
7415
|
-
};
|
|
7416
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
7417
|
-
const c = cmyk[0] / 100;
|
|
7418
|
-
const m = cmyk[1] / 100;
|
|
7419
|
-
const y = cmyk[2] / 100;
|
|
7420
|
-
const k = cmyk[3] / 100;
|
|
7421
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
7422
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
7423
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
7424
|
-
return [r * 255, g * 255, b * 255];
|
|
7425
|
-
};
|
|
7426
|
-
convert.xyz.rgb = function(xyz) {
|
|
7427
|
-
const x = xyz[0] / 100;
|
|
7428
|
-
const y = xyz[1] / 100;
|
|
7429
|
-
const z = xyz[2] / 100;
|
|
7430
|
-
let r;
|
|
7431
|
-
let g;
|
|
7432
|
-
let b;
|
|
7433
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
7434
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
7435
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
7436
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
7437
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
7438
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
7439
|
-
r = Math.min(Math.max(0, r), 1);
|
|
7440
|
-
g = Math.min(Math.max(0, g), 1);
|
|
7441
|
-
b = Math.min(Math.max(0, b), 1);
|
|
7442
|
-
return [r * 255, g * 255, b * 255];
|
|
7443
|
-
};
|
|
7444
|
-
convert.xyz.lab = function(xyz) {
|
|
7445
|
-
let x = xyz[0];
|
|
7446
|
-
let y = xyz[1];
|
|
7447
|
-
let z = xyz[2];
|
|
7448
|
-
x /= 95.047;
|
|
7449
|
-
y /= 100;
|
|
7450
|
-
z /= 108.883;
|
|
7451
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
7452
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
7453
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
7454
|
-
const l = 116 * y - 16;
|
|
7455
|
-
const a = 500 * (x - y);
|
|
7456
|
-
const b = 200 * (y - z);
|
|
7457
|
-
return [l, a, b];
|
|
7458
|
-
};
|
|
7459
|
-
convert.lab.xyz = function(lab) {
|
|
7460
|
-
const l = lab[0];
|
|
7461
|
-
const a = lab[1];
|
|
7462
|
-
const b = lab[2];
|
|
7463
|
-
let x;
|
|
7464
|
-
let y;
|
|
7465
|
-
let z;
|
|
7466
|
-
y = (l + 16) / 116;
|
|
7467
|
-
x = a / 500 + y;
|
|
7468
|
-
z = y - b / 200;
|
|
7469
|
-
const y2 = y ** 3;
|
|
7470
|
-
const x2 = x ** 3;
|
|
7471
|
-
const z2 = z ** 3;
|
|
7472
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
7473
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
7474
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
7475
|
-
x *= 95.047;
|
|
7476
|
-
y *= 100;
|
|
7477
|
-
z *= 108.883;
|
|
7478
|
-
return [x, y, z];
|
|
7479
|
-
};
|
|
7480
|
-
convert.lab.lch = function(lab) {
|
|
7481
|
-
const l = lab[0];
|
|
7482
|
-
const a = lab[1];
|
|
7483
|
-
const b = lab[2];
|
|
7484
|
-
let h;
|
|
7485
|
-
const hr = Math.atan2(b, a);
|
|
7486
|
-
h = hr * 360 / 2 / Math.PI;
|
|
7487
|
-
if (h < 0) {
|
|
7488
|
-
h += 360;
|
|
7489
|
-
}
|
|
7490
|
-
const c = Math.sqrt(a * a + b * b);
|
|
7491
|
-
return [l, c, h];
|
|
7492
|
-
};
|
|
7493
|
-
convert.lch.lab = function(lch) {
|
|
7494
|
-
const l = lch[0];
|
|
7495
|
-
const c = lch[1];
|
|
7496
|
-
const h = lch[2];
|
|
7497
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
7498
|
-
const a = c * Math.cos(hr);
|
|
7499
|
-
const b = c * Math.sin(hr);
|
|
7500
|
-
return [l, a, b];
|
|
7501
|
-
};
|
|
7502
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
7503
|
-
const [r, g, b] = args;
|
|
7504
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
7505
|
-
value = Math.round(value / 50);
|
|
7506
|
-
if (value === 0) {
|
|
7507
|
-
return 30;
|
|
7508
|
-
}
|
|
7509
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
7510
|
-
if (value === 2) {
|
|
7511
|
-
ansi += 60;
|
|
7512
|
-
}
|
|
7513
|
-
return ansi;
|
|
7514
|
-
};
|
|
7515
|
-
convert.hsv.ansi16 = function(args) {
|
|
7516
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
7517
|
-
};
|
|
7518
|
-
convert.rgb.ansi256 = function(args) {
|
|
7519
|
-
const r = args[0];
|
|
7520
|
-
const g = args[1];
|
|
7521
|
-
const b = args[2];
|
|
7522
|
-
if (r === g && g === b) {
|
|
7523
|
-
if (r < 8) {
|
|
7524
|
-
return 16;
|
|
7525
|
-
}
|
|
7526
|
-
if (r > 248) {
|
|
7527
|
-
return 231;
|
|
7528
|
-
}
|
|
7529
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
7530
|
-
}
|
|
7531
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
7532
|
-
return ansi;
|
|
7533
|
-
};
|
|
7534
|
-
convert.ansi16.rgb = function(args) {
|
|
7535
|
-
let color = args % 10;
|
|
7536
|
-
if (color === 0 || color === 7) {
|
|
7537
|
-
if (args > 50) {
|
|
7538
|
-
color += 3.5;
|
|
7539
|
-
}
|
|
7540
|
-
color = color / 10.5 * 255;
|
|
7541
|
-
return [color, color, color];
|
|
7542
|
-
}
|
|
7543
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
7544
|
-
const r = (color & 1) * mult * 255;
|
|
7545
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
7546
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
7547
|
-
return [r, g, b];
|
|
7548
|
-
};
|
|
7549
|
-
convert.ansi256.rgb = function(args) {
|
|
7550
|
-
if (args >= 232) {
|
|
7551
|
-
const c = (args - 232) * 10 + 8;
|
|
7552
|
-
return [c, c, c];
|
|
7553
|
-
}
|
|
7554
|
-
args -= 16;
|
|
7555
|
-
let rem;
|
|
7556
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
7557
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
7558
|
-
const b = rem % 6 / 5 * 255;
|
|
7559
|
-
return [r, g, b];
|
|
7560
|
-
};
|
|
7561
|
-
convert.rgb.hex = function(args) {
|
|
7562
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
7563
|
-
const string = integer.toString(16).toUpperCase();
|
|
7564
|
-
return "000000".substring(string.length) + string;
|
|
7565
|
-
};
|
|
7566
|
-
convert.hex.rgb = function(args) {
|
|
7567
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
7568
|
-
if (!match) {
|
|
7569
|
-
return [0, 0, 0];
|
|
7570
|
-
}
|
|
7571
|
-
let colorString = match[0];
|
|
7572
|
-
if (match[0].length === 3) {
|
|
7573
|
-
colorString = colorString.split("").map((char) => {
|
|
7574
|
-
return char + char;
|
|
7575
|
-
}).join("");
|
|
7576
|
-
}
|
|
7577
|
-
const integer = parseInt(colorString, 16);
|
|
7578
|
-
const r = integer >> 16 & 255;
|
|
7579
|
-
const g = integer >> 8 & 255;
|
|
7580
|
-
const b = integer & 255;
|
|
7581
|
-
return [r, g, b];
|
|
7582
|
-
};
|
|
7583
|
-
convert.rgb.hcg = function(rgb) {
|
|
7584
|
-
const r = rgb[0] / 255;
|
|
7585
|
-
const g = rgb[1] / 255;
|
|
7586
|
-
const b = rgb[2] / 255;
|
|
7587
|
-
const max = Math.max(Math.max(r, g), b);
|
|
7588
|
-
const min = Math.min(Math.min(r, g), b);
|
|
7589
|
-
const chroma = max - min;
|
|
7590
|
-
let grayscale;
|
|
7591
|
-
let hue;
|
|
7592
|
-
if (chroma < 1) {
|
|
7593
|
-
grayscale = min / (1 - chroma);
|
|
7594
|
-
} else {
|
|
7595
|
-
grayscale = 0;
|
|
7596
|
-
}
|
|
7597
|
-
if (chroma <= 0) {
|
|
7598
|
-
hue = 0;
|
|
7599
|
-
} else if (max === r) {
|
|
7600
|
-
hue = (g - b) / chroma % 6;
|
|
7601
|
-
} else if (max === g) {
|
|
7602
|
-
hue = 2 + (b - r) / chroma;
|
|
7603
|
-
} else {
|
|
7604
|
-
hue = 4 + (r - g) / chroma;
|
|
7605
|
-
}
|
|
7606
|
-
hue /= 6;
|
|
7607
|
-
hue %= 1;
|
|
7608
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
7609
|
-
};
|
|
7610
|
-
convert.hsl.hcg = function(hsl) {
|
|
7611
|
-
const s = hsl[1] / 100;
|
|
7612
|
-
const l = hsl[2] / 100;
|
|
7613
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
7614
|
-
let f = 0;
|
|
7615
|
-
if (c < 1) {
|
|
7616
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
7617
|
-
}
|
|
7618
|
-
return [hsl[0], c * 100, f * 100];
|
|
7619
|
-
};
|
|
7620
|
-
convert.hsv.hcg = function(hsv) {
|
|
7621
|
-
const s = hsv[1] / 100;
|
|
7622
|
-
const v = hsv[2] / 100;
|
|
7623
|
-
const c = s * v;
|
|
7624
|
-
let f = 0;
|
|
7625
|
-
if (c < 1) {
|
|
7626
|
-
f = (v - c) / (1 - c);
|
|
7627
|
-
}
|
|
7628
|
-
return [hsv[0], c * 100, f * 100];
|
|
7629
|
-
};
|
|
7630
|
-
convert.hcg.rgb = function(hcg) {
|
|
7631
|
-
const h = hcg[0] / 360;
|
|
7632
|
-
const c = hcg[1] / 100;
|
|
7633
|
-
const g = hcg[2] / 100;
|
|
7634
|
-
if (c === 0) {
|
|
7635
|
-
return [g * 255, g * 255, g * 255];
|
|
7636
|
-
}
|
|
7637
|
-
const pure = [0, 0, 0];
|
|
7638
|
-
const hi = h % 1 * 6;
|
|
7639
|
-
const v = hi % 1;
|
|
7640
|
-
const w = 1 - v;
|
|
7641
|
-
let mg = 0;
|
|
7642
|
-
switch (Math.floor(hi)) {
|
|
7643
|
-
case 0:
|
|
7644
|
-
pure[0] = 1;
|
|
7645
|
-
pure[1] = v;
|
|
7646
|
-
pure[2] = 0;
|
|
7647
|
-
break;
|
|
7648
|
-
case 1:
|
|
7649
|
-
pure[0] = w;
|
|
7650
|
-
pure[1] = 1;
|
|
7651
|
-
pure[2] = 0;
|
|
7652
|
-
break;
|
|
7653
|
-
case 2:
|
|
7654
|
-
pure[0] = 0;
|
|
7655
|
-
pure[1] = 1;
|
|
7656
|
-
pure[2] = v;
|
|
7657
|
-
break;
|
|
7658
|
-
case 3:
|
|
7659
|
-
pure[0] = 0;
|
|
7660
|
-
pure[1] = w;
|
|
7661
|
-
pure[2] = 1;
|
|
7662
|
-
break;
|
|
7663
|
-
case 4:
|
|
7664
|
-
pure[0] = v;
|
|
7665
|
-
pure[1] = 0;
|
|
7666
|
-
pure[2] = 1;
|
|
7667
|
-
break;
|
|
7668
|
-
default:
|
|
7669
|
-
pure[0] = 1;
|
|
7670
|
-
pure[1] = 0;
|
|
7671
|
-
pure[2] = w;
|
|
7672
|
-
}
|
|
7673
|
-
mg = (1 - c) * g;
|
|
7674
|
-
return [
|
|
7675
|
-
(c * pure[0] + mg) * 255,
|
|
7676
|
-
(c * pure[1] + mg) * 255,
|
|
7677
|
-
(c * pure[2] + mg) * 255
|
|
7678
|
-
];
|
|
7679
|
-
};
|
|
7680
|
-
convert.hcg.hsv = function(hcg) {
|
|
7681
|
-
const c = hcg[1] / 100;
|
|
7682
|
-
const g = hcg[2] / 100;
|
|
7683
|
-
const v = c + g * (1 - c);
|
|
7684
|
-
let f = 0;
|
|
7685
|
-
if (v > 0) {
|
|
7686
|
-
f = c / v;
|
|
7687
|
-
}
|
|
7688
|
-
return [hcg[0], f * 100, v * 100];
|
|
7689
|
-
};
|
|
7690
|
-
convert.hcg.hsl = function(hcg) {
|
|
7691
|
-
const c = hcg[1] / 100;
|
|
7692
|
-
const g = hcg[2] / 100;
|
|
7693
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
7694
|
-
let s = 0;
|
|
7695
|
-
if (l > 0 && l < 0.5) {
|
|
7696
|
-
s = c / (2 * l);
|
|
7697
|
-
} else if (l >= 0.5 && l < 1) {
|
|
7698
|
-
s = c / (2 * (1 - l));
|
|
7699
|
-
}
|
|
7700
|
-
return [hcg[0], s * 100, l * 100];
|
|
7701
|
-
};
|
|
7702
|
-
convert.hcg.hwb = function(hcg) {
|
|
7703
|
-
const c = hcg[1] / 100;
|
|
7704
|
-
const g = hcg[2] / 100;
|
|
7705
|
-
const v = c + g * (1 - c);
|
|
7706
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
7707
|
-
};
|
|
7708
|
-
convert.hwb.hcg = function(hwb) {
|
|
7709
|
-
const w = hwb[1] / 100;
|
|
7710
|
-
const b = hwb[2] / 100;
|
|
7711
|
-
const v = 1 - b;
|
|
7712
|
-
const c = v - w;
|
|
7713
|
-
let g = 0;
|
|
7714
|
-
if (c < 1) {
|
|
7715
|
-
g = (v - c) / (1 - c);
|
|
7716
|
-
}
|
|
7717
|
-
return [hwb[0], c * 100, g * 100];
|
|
7718
|
-
};
|
|
7719
|
-
convert.apple.rgb = function(apple) {
|
|
7720
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
7721
|
-
};
|
|
7722
|
-
convert.rgb.apple = function(rgb) {
|
|
7723
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
7724
|
-
};
|
|
7725
|
-
convert.gray.rgb = function(args) {
|
|
7726
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
7727
|
-
};
|
|
7728
|
-
convert.gray.hsl = function(args) {
|
|
7729
|
-
return [0, 0, args[0]];
|
|
7730
|
-
};
|
|
7731
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
7732
|
-
convert.gray.hwb = function(gray) {
|
|
7733
|
-
return [0, 100, gray[0]];
|
|
7734
|
-
};
|
|
7735
|
-
convert.gray.cmyk = function(gray) {
|
|
7736
|
-
return [0, 0, 0, gray[0]];
|
|
7737
|
-
};
|
|
7738
|
-
convert.gray.lab = function(gray) {
|
|
7739
|
-
return [gray[0], 0, 0];
|
|
7740
|
-
};
|
|
7741
|
-
convert.gray.hex = function(gray) {
|
|
7742
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
7743
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
7744
|
-
const string = integer.toString(16).toUpperCase();
|
|
7745
|
-
return "000000".substring(string.length) + string;
|
|
7746
|
-
};
|
|
7747
|
-
convert.rgb.gray = function(rgb) {
|
|
7748
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
7749
|
-
return [val / 255 * 100];
|
|
7750
|
-
};
|
|
7751
|
-
return conversions;
|
|
7752
|
-
}
|
|
7753
|
-
var route;
|
|
7754
|
-
var hasRequiredRoute;
|
|
7755
|
-
function requireRoute() {
|
|
7756
|
-
if (hasRequiredRoute)
|
|
7757
|
-
return route;
|
|
7758
|
-
hasRequiredRoute = 1;
|
|
7759
|
-
const conversions2 = requireConversions();
|
|
7760
|
-
function buildGraph() {
|
|
7761
|
-
const graph = {};
|
|
7762
|
-
const models = Object.keys(conversions2);
|
|
7763
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
7764
|
-
graph[models[i]] = {
|
|
7765
|
-
// http://jsperf.com/1-vs-infinity
|
|
7766
|
-
// micro-opt, but this is simple.
|
|
7767
|
-
distance: -1,
|
|
7768
|
-
parent: null
|
|
7769
|
-
};
|
|
7770
|
-
}
|
|
7771
|
-
return graph;
|
|
7772
|
-
}
|
|
7773
|
-
function deriveBFS(fromModel) {
|
|
7774
|
-
const graph = buildGraph();
|
|
7775
|
-
const queue = [fromModel];
|
|
7776
|
-
graph[fromModel].distance = 0;
|
|
7777
|
-
while (queue.length) {
|
|
7778
|
-
const current = queue.pop();
|
|
7779
|
-
const adjacents = Object.keys(conversions2[current]);
|
|
7780
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
7781
|
-
const adjacent = adjacents[i];
|
|
7782
|
-
const node = graph[adjacent];
|
|
7783
|
-
if (node.distance === -1) {
|
|
7784
|
-
node.distance = graph[current].distance + 1;
|
|
7785
|
-
node.parent = current;
|
|
7786
|
-
queue.unshift(adjacent);
|
|
7787
|
-
}
|
|
7788
|
-
}
|
|
7789
|
-
}
|
|
7790
|
-
return graph;
|
|
7791
|
-
}
|
|
7792
|
-
function link(from, to) {
|
|
7793
|
-
return function(args) {
|
|
7794
|
-
return to(from(args));
|
|
7795
|
-
};
|
|
7796
|
-
}
|
|
7797
|
-
function wrapConversion(toModel, graph) {
|
|
7798
|
-
const path2 = [graph[toModel].parent, toModel];
|
|
7799
|
-
let fn = conversions2[graph[toModel].parent][toModel];
|
|
7800
|
-
let cur = graph[toModel].parent;
|
|
7801
|
-
while (graph[cur].parent) {
|
|
7802
|
-
path2.unshift(graph[cur].parent);
|
|
7803
|
-
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
7804
|
-
cur = graph[cur].parent;
|
|
7805
|
-
}
|
|
7806
|
-
fn.conversion = path2;
|
|
7807
|
-
return fn;
|
|
7808
|
-
}
|
|
7809
|
-
route = function(fromModel) {
|
|
7810
|
-
const graph = deriveBFS(fromModel);
|
|
7811
|
-
const conversion = {};
|
|
7812
|
-
const models = Object.keys(graph);
|
|
7813
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
7814
|
-
const toModel = models[i];
|
|
7815
|
-
const node = graph[toModel];
|
|
7816
|
-
if (node.parent === null) {
|
|
7817
|
-
continue;
|
|
7818
|
-
}
|
|
7819
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
7820
|
-
}
|
|
7821
|
-
return conversion;
|
|
7822
|
-
};
|
|
7823
|
-
return route;
|
|
7824
|
-
}
|
|
7825
|
-
var colorConvert;
|
|
7826
|
-
var hasRequiredColorConvert;
|
|
7827
|
-
function requireColorConvert() {
|
|
7828
|
-
if (hasRequiredColorConvert)
|
|
7829
|
-
return colorConvert;
|
|
7830
|
-
hasRequiredColorConvert = 1;
|
|
7831
|
-
const conversions2 = requireConversions();
|
|
7832
|
-
const route2 = requireRoute();
|
|
7833
|
-
const convert = {};
|
|
7834
|
-
const models = Object.keys(conversions2);
|
|
7835
|
-
function wrapRaw(fn) {
|
|
7836
|
-
const wrappedFn = function(...args) {
|
|
7837
|
-
const arg0 = args[0];
|
|
7838
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
7839
|
-
return arg0;
|
|
7840
|
-
}
|
|
7841
|
-
if (arg0.length > 1) {
|
|
7842
|
-
args = arg0;
|
|
7843
|
-
}
|
|
7844
|
-
return fn(args);
|
|
7845
|
-
};
|
|
7846
|
-
if ("conversion" in fn) {
|
|
7847
|
-
wrappedFn.conversion = fn.conversion;
|
|
7848
|
-
}
|
|
7849
|
-
return wrappedFn;
|
|
7850
|
-
}
|
|
7851
|
-
function wrapRounded(fn) {
|
|
7852
|
-
const wrappedFn = function(...args) {
|
|
7853
|
-
const arg0 = args[0];
|
|
7854
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
7855
|
-
return arg0;
|
|
7856
|
-
}
|
|
7857
|
-
if (arg0.length > 1) {
|
|
7858
|
-
args = arg0;
|
|
7859
|
-
}
|
|
7860
|
-
const result = fn(args);
|
|
7861
|
-
if (typeof result === "object") {
|
|
7862
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
7863
|
-
result[i] = Math.round(result[i]);
|
|
7864
|
-
}
|
|
7865
|
-
}
|
|
7866
|
-
return result;
|
|
7867
|
-
};
|
|
7868
|
-
if ("conversion" in fn) {
|
|
7869
|
-
wrappedFn.conversion = fn.conversion;
|
|
7870
|
-
}
|
|
7871
|
-
return wrappedFn;
|
|
7872
|
-
}
|
|
7873
|
-
models.forEach((fromModel) => {
|
|
7874
|
-
convert[fromModel] = {};
|
|
7875
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
|
|
7876
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
|
|
7877
|
-
const routes = route2(fromModel);
|
|
7878
|
-
const routeModels = Object.keys(routes);
|
|
7879
|
-
routeModels.forEach((toModel) => {
|
|
7880
|
-
const fn = routes[toModel];
|
|
7881
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
7882
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
7883
|
-
});
|
|
7884
|
-
});
|
|
7885
|
-
colorConvert = convert;
|
|
7886
|
-
return colorConvert;
|
|
7887
|
-
}
|
|
7888
|
-
ansiStyles$1.exports;
|
|
7889
|
-
(function(module) {
|
|
7890
|
-
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
7891
|
-
const code = fn(...args);
|
|
7892
|
-
return `\x1B[${code + offset}m`;
|
|
7893
|
-
};
|
|
7894
|
-
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
7895
|
-
const code = fn(...args);
|
|
7896
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
7897
|
-
};
|
|
7898
|
-
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
7899
|
-
const rgb = fn(...args);
|
|
7900
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
7901
|
-
};
|
|
7902
|
-
const ansi2ansi = (n) => n;
|
|
7903
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
7904
|
-
const setLazyProperty = (object, property, get) => {
|
|
7905
|
-
Object.defineProperty(object, property, {
|
|
7906
|
-
get: () => {
|
|
7907
|
-
const value = get();
|
|
7908
|
-
Object.defineProperty(object, property, {
|
|
7909
|
-
value,
|
|
7910
|
-
enumerable: true,
|
|
7911
|
-
configurable: true
|
|
7912
|
-
});
|
|
7913
|
-
return value;
|
|
7914
|
-
},
|
|
7915
|
-
enumerable: true,
|
|
7916
|
-
configurable: true
|
|
7917
|
-
});
|
|
7918
|
-
};
|
|
7919
|
-
let colorConvert2;
|
|
7920
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
7921
|
-
if (colorConvert2 === void 0) {
|
|
7922
|
-
colorConvert2 = requireColorConvert();
|
|
7923
|
-
}
|
|
7924
|
-
const offset = isBackground ? 10 : 0;
|
|
7925
|
-
const styles2 = {};
|
|
7926
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
7927
|
-
const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
7928
|
-
if (sourceSpace === targetSpace) {
|
|
7929
|
-
styles2[name2] = wrap(identity, offset);
|
|
7930
|
-
} else if (typeof suite === "object") {
|
|
7931
|
-
styles2[name2] = wrap(suite[targetSpace], offset);
|
|
7932
|
-
}
|
|
7933
|
-
}
|
|
7934
|
-
return styles2;
|
|
7935
|
-
};
|
|
7936
|
-
function assembleStyles() {
|
|
7937
|
-
const codes = /* @__PURE__ */ new Map();
|
|
7938
|
-
const styles2 = {
|
|
7939
|
-
modifier: {
|
|
7940
|
-
reset: [0, 0],
|
|
7941
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
7942
|
-
bold: [1, 22],
|
|
7943
|
-
dim: [2, 22],
|
|
7944
|
-
italic: [3, 23],
|
|
7945
|
-
underline: [4, 24],
|
|
7946
|
-
inverse: [7, 27],
|
|
7947
|
-
hidden: [8, 28],
|
|
7948
|
-
strikethrough: [9, 29]
|
|
7949
|
-
},
|
|
7950
|
-
color: {
|
|
7951
|
-
black: [30, 39],
|
|
7952
|
-
red: [31, 39],
|
|
7953
|
-
green: [32, 39],
|
|
7954
|
-
yellow: [33, 39],
|
|
7955
|
-
blue: [34, 39],
|
|
7956
|
-
magenta: [35, 39],
|
|
7957
|
-
cyan: [36, 39],
|
|
7958
|
-
white: [37, 39],
|
|
7959
|
-
// Bright color
|
|
7960
|
-
blackBright: [90, 39],
|
|
7961
|
-
redBright: [91, 39],
|
|
7962
|
-
greenBright: [92, 39],
|
|
7963
|
-
yellowBright: [93, 39],
|
|
7964
|
-
blueBright: [94, 39],
|
|
7965
|
-
magentaBright: [95, 39],
|
|
7966
|
-
cyanBright: [96, 39],
|
|
7967
|
-
whiteBright: [97, 39]
|
|
7968
|
-
},
|
|
7969
|
-
bgColor: {
|
|
7970
|
-
bgBlack: [40, 49],
|
|
7971
|
-
bgRed: [41, 49],
|
|
7972
|
-
bgGreen: [42, 49],
|
|
7973
|
-
bgYellow: [43, 49],
|
|
7974
|
-
bgBlue: [44, 49],
|
|
7975
|
-
bgMagenta: [45, 49],
|
|
7976
|
-
bgCyan: [46, 49],
|
|
7977
|
-
bgWhite: [47, 49],
|
|
7978
|
-
// Bright color
|
|
7979
|
-
bgBlackBright: [100, 49],
|
|
7980
|
-
bgRedBright: [101, 49],
|
|
7981
|
-
bgGreenBright: [102, 49],
|
|
7982
|
-
bgYellowBright: [103, 49],
|
|
7983
|
-
bgBlueBright: [104, 49],
|
|
7984
|
-
bgMagentaBright: [105, 49],
|
|
7985
|
-
bgCyanBright: [106, 49],
|
|
7986
|
-
bgWhiteBright: [107, 49]
|
|
7987
|
-
}
|
|
7988
|
-
};
|
|
7989
|
-
styles2.color.gray = styles2.color.blackBright;
|
|
7990
|
-
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
7991
|
-
styles2.color.grey = styles2.color.blackBright;
|
|
7992
|
-
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
7993
|
-
for (const [groupName, group] of Object.entries(styles2)) {
|
|
7994
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
7995
|
-
styles2[styleName] = {
|
|
7996
|
-
open: `\x1B[${style[0]}m`,
|
|
7997
|
-
close: `\x1B[${style[1]}m`
|
|
7998
|
-
};
|
|
7999
|
-
group[styleName] = styles2[styleName];
|
|
8000
|
-
codes.set(style[0], style[1]);
|
|
8001
|
-
}
|
|
8002
|
-
Object.defineProperty(styles2, groupName, {
|
|
8003
|
-
value: group,
|
|
8004
|
-
enumerable: false
|
|
8005
|
-
});
|
|
8006
|
-
}
|
|
8007
|
-
Object.defineProperty(styles2, "codes", {
|
|
8008
|
-
value: codes,
|
|
8009
|
-
enumerable: false
|
|
8010
|
-
});
|
|
8011
|
-
styles2.color.close = "\x1B[39m";
|
|
8012
|
-
styles2.bgColor.close = "\x1B[49m";
|
|
8013
|
-
setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
8014
|
-
setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
8015
|
-
setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
8016
|
-
setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
8017
|
-
setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
8018
|
-
setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
8019
|
-
return styles2;
|
|
8020
|
-
}
|
|
8021
|
-
Object.defineProperty(module, "exports", {
|
|
8022
|
-
enumerable: true,
|
|
8023
|
-
get: assembleStyles
|
|
8024
|
-
});
|
|
8025
|
-
})(ansiStyles$1);
|
|
8026
|
-
var ansiStylesExports = ansiStyles$1.exports;
|
|
8027
|
-
var browser = {
|
|
8028
|
-
stdout: false,
|
|
8029
|
-
stderr: false
|
|
8030
|
-
};
|
|
8031
|
-
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
8032
|
-
let index = string.indexOf(substring);
|
|
8033
|
-
if (index === -1) {
|
|
8034
|
-
return string;
|
|
8035
|
-
}
|
|
8036
|
-
const substringLength = substring.length;
|
|
8037
|
-
let endIndex = 0;
|
|
8038
|
-
let returnValue = "";
|
|
8039
|
-
do {
|
|
8040
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
8041
|
-
endIndex = index + substringLength;
|
|
8042
|
-
index = string.indexOf(substring, endIndex);
|
|
8043
|
-
} while (index !== -1);
|
|
8044
|
-
returnValue += string.substr(endIndex);
|
|
8045
|
-
return returnValue;
|
|
8046
|
-
};
|
|
8047
|
-
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
8048
|
-
let endIndex = 0;
|
|
8049
|
-
let returnValue = "";
|
|
8050
|
-
do {
|
|
8051
|
-
const gotCR = string[index - 1] === "\r";
|
|
8052
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
8053
|
-
endIndex = index + 1;
|
|
8054
|
-
index = string.indexOf("\n", endIndex);
|
|
8055
|
-
} while (index !== -1);
|
|
8056
|
-
returnValue += string.substr(endIndex);
|
|
8057
|
-
return returnValue;
|
|
8058
|
-
};
|
|
8059
|
-
var util = {
|
|
8060
|
-
stringReplaceAll: stringReplaceAll$1,
|
|
8061
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
8062
|
-
};
|
|
8063
|
-
var templates;
|
|
8064
|
-
var hasRequiredTemplates;
|
|
8065
|
-
function requireTemplates() {
|
|
8066
|
-
if (hasRequiredTemplates)
|
|
8067
|
-
return templates;
|
|
8068
|
-
hasRequiredTemplates = 1;
|
|
8069
|
-
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
8070
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
8071
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
8072
|
-
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
8073
|
-
const ESCAPES = /* @__PURE__ */ new Map([
|
|
8074
|
-
["n", "\n"],
|
|
8075
|
-
["r", "\r"],
|
|
8076
|
-
["t", " "],
|
|
8077
|
-
["b", "\b"],
|
|
8078
|
-
["f", "\f"],
|
|
8079
|
-
["v", "\v"],
|
|
8080
|
-
["0", "\0"],
|
|
8081
|
-
["\\", "\\"],
|
|
8082
|
-
["e", "\x1B"],
|
|
8083
|
-
["a", "\x07"]
|
|
8084
|
-
]);
|
|
8085
|
-
function unescape(c) {
|
|
8086
|
-
const u = c[0] === "u";
|
|
8087
|
-
const bracket = c[1] === "{";
|
|
8088
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
8089
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
8090
|
-
}
|
|
8091
|
-
if (u && bracket) {
|
|
8092
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
8093
|
-
}
|
|
8094
|
-
return ESCAPES.get(c) || c;
|
|
8095
|
-
}
|
|
8096
|
-
function parseArguments(name2, arguments_) {
|
|
8097
|
-
const results = [];
|
|
8098
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
8099
|
-
let matches;
|
|
8100
|
-
for (const chunk of chunks) {
|
|
8101
|
-
const number = Number(chunk);
|
|
8102
|
-
if (!Number.isNaN(number)) {
|
|
8103
|
-
results.push(number);
|
|
8104
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
8105
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
8106
|
-
} else {
|
|
8107
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
|
|
8108
|
-
}
|
|
8109
|
-
}
|
|
8110
|
-
return results;
|
|
8111
|
-
}
|
|
8112
|
-
function parseStyle(style) {
|
|
8113
|
-
STYLE_REGEX.lastIndex = 0;
|
|
8114
|
-
const results = [];
|
|
8115
|
-
let matches;
|
|
8116
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
8117
|
-
const name2 = matches[1];
|
|
8118
|
-
if (matches[2]) {
|
|
8119
|
-
const args = parseArguments(name2, matches[2]);
|
|
8120
|
-
results.push([name2].concat(args));
|
|
8121
|
-
} else {
|
|
8122
|
-
results.push([name2]);
|
|
8123
|
-
}
|
|
8124
|
-
}
|
|
8125
|
-
return results;
|
|
8126
|
-
}
|
|
8127
|
-
function buildStyle(chalk2, styles2) {
|
|
8128
|
-
const enabled = {};
|
|
8129
|
-
for (const layer of styles2) {
|
|
8130
|
-
for (const style of layer.styles) {
|
|
8131
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
8132
|
-
}
|
|
8133
|
-
}
|
|
8134
|
-
let current = chalk2;
|
|
8135
|
-
for (const [styleName, styles3] of Object.entries(enabled)) {
|
|
8136
|
-
if (!Array.isArray(styles3)) {
|
|
8137
|
-
continue;
|
|
8138
|
-
}
|
|
8139
|
-
if (!(styleName in current)) {
|
|
8140
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
8141
|
-
}
|
|
8142
|
-
current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
|
|
8143
|
-
}
|
|
8144
|
-
return current;
|
|
8145
|
-
}
|
|
8146
|
-
templates = (chalk2, temporary) => {
|
|
8147
|
-
const styles2 = [];
|
|
8148
|
-
const chunks = [];
|
|
8149
|
-
let chunk = [];
|
|
8150
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
8151
|
-
if (escapeCharacter) {
|
|
8152
|
-
chunk.push(unescape(escapeCharacter));
|
|
8153
|
-
} else if (style) {
|
|
8154
|
-
const string = chunk.join("");
|
|
8155
|
-
chunk = [];
|
|
8156
|
-
chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
|
|
8157
|
-
styles2.push({ inverse, styles: parseStyle(style) });
|
|
8158
|
-
} else if (close) {
|
|
8159
|
-
if (styles2.length === 0) {
|
|
8160
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
8161
|
-
}
|
|
8162
|
-
chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
|
|
8163
|
-
chunk = [];
|
|
8164
|
-
styles2.pop();
|
|
8165
|
-
} else {
|
|
8166
|
-
chunk.push(character);
|
|
8167
|
-
}
|
|
8168
|
-
});
|
|
8169
|
-
chunks.push(chunk.join(""));
|
|
8170
|
-
if (styles2.length > 0) {
|
|
8171
|
-
const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
|
|
8172
|
-
throw new Error(errMessage);
|
|
8173
|
-
}
|
|
8174
|
-
return chunks.join("");
|
|
8175
|
-
};
|
|
8176
|
-
return templates;
|
|
8177
|
-
}
|
|
8178
|
-
const ansiStyles = ansiStylesExports;
|
|
8179
|
-
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
8180
|
-
const {
|
|
8181
|
-
stringReplaceAll,
|
|
8182
|
-
stringEncaseCRLFWithFirstIndex
|
|
8183
|
-
} = util;
|
|
8184
|
-
const { isArray } = Array;
|
|
8185
|
-
const levelMapping = [
|
|
8186
|
-
"ansi",
|
|
8187
|
-
"ansi",
|
|
8188
|
-
"ansi256",
|
|
8189
|
-
"ansi16m"
|
|
8190
|
-
];
|
|
8191
|
-
const styles = /* @__PURE__ */ Object.create(null);
|
|
8192
|
-
const applyOptions = (object, options = {}) => {
|
|
8193
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
8194
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
8195
|
-
}
|
|
8196
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
8197
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
8198
|
-
};
|
|
8199
|
-
class ChalkClass2 {
|
|
8200
|
-
constructor(options) {
|
|
8201
|
-
return chalkFactory(options);
|
|
8202
|
-
}
|
|
8203
|
-
}
|
|
8204
|
-
const chalkFactory = (options) => {
|
|
8205
|
-
const chalk2 = {};
|
|
8206
|
-
applyOptions(chalk2, options);
|
|
8207
|
-
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
8208
|
-
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
8209
|
-
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
8210
|
-
chalk2.template.constructor = () => {
|
|
8211
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
8212
|
-
};
|
|
8213
|
-
chalk2.template.Instance = ChalkClass2;
|
|
8214
|
-
return chalk2.template;
|
|
8215
|
-
};
|
|
8216
|
-
function Chalk(options) {
|
|
8217
|
-
return chalkFactory(options);
|
|
8218
|
-
}
|
|
8219
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
8220
|
-
styles[styleName] = {
|
|
8221
|
-
get() {
|
|
8222
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
8223
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
8224
|
-
return builder;
|
|
8225
|
-
}
|
|
8226
|
-
};
|
|
8227
|
-
}
|
|
8228
|
-
styles.visible = {
|
|
8229
|
-
get() {
|
|
8230
|
-
const builder = createBuilder(this, this._styler, true);
|
|
8231
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
8232
|
-
return builder;
|
|
8233
|
-
}
|
|
8234
|
-
};
|
|
8235
|
-
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
8236
|
-
for (const model of usedModels) {
|
|
8237
|
-
styles[model] = {
|
|
8238
|
-
get() {
|
|
8239
|
-
const { level } = this;
|
|
8240
|
-
return function(...arguments_) {
|
|
8241
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
8242
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
8243
|
-
};
|
|
8244
|
-
}
|
|
8245
|
-
};
|
|
8246
|
-
}
|
|
8247
|
-
for (const model of usedModels) {
|
|
8248
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
8249
|
-
styles[bgModel] = {
|
|
8250
|
-
get() {
|
|
8251
|
-
const { level } = this;
|
|
8252
|
-
return function(...arguments_) {
|
|
8253
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
8254
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
8255
|
-
};
|
|
8256
|
-
}
|
|
8257
|
-
};
|
|
8258
|
-
}
|
|
8259
|
-
const proto = Object.defineProperties(() => {
|
|
8260
|
-
}, {
|
|
8261
|
-
...styles,
|
|
8262
|
-
level: {
|
|
8263
|
-
enumerable: true,
|
|
8264
|
-
get() {
|
|
8265
|
-
return this._generator.level;
|
|
8266
|
-
},
|
|
8267
|
-
set(level) {
|
|
8268
|
-
this._generator.level = level;
|
|
8269
|
-
}
|
|
8270
|
-
}
|
|
8271
|
-
});
|
|
8272
|
-
const createStyler = (open, close, parent) => {
|
|
8273
|
-
let openAll;
|
|
8274
|
-
let closeAll;
|
|
8275
|
-
if (parent === void 0) {
|
|
8276
|
-
openAll = open;
|
|
8277
|
-
closeAll = close;
|
|
8278
|
-
} else {
|
|
8279
|
-
openAll = parent.openAll + open;
|
|
8280
|
-
closeAll = close + parent.closeAll;
|
|
8281
|
-
}
|
|
8282
|
-
return {
|
|
8283
|
-
open,
|
|
8284
|
-
close,
|
|
8285
|
-
openAll,
|
|
8286
|
-
closeAll,
|
|
8287
|
-
parent
|
|
8288
|
-
};
|
|
8289
|
-
};
|
|
8290
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
8291
|
-
const builder = (...arguments_) => {
|
|
8292
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
8293
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
8294
|
-
}
|
|
8295
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
8296
|
-
};
|
|
8297
|
-
Object.setPrototypeOf(builder, proto);
|
|
8298
|
-
builder._generator = self2;
|
|
8299
|
-
builder._styler = _styler;
|
|
8300
|
-
builder._isEmpty = _isEmpty;
|
|
8301
|
-
return builder;
|
|
8302
|
-
};
|
|
8303
|
-
const applyStyle = (self2, string) => {
|
|
8304
|
-
if (self2.level <= 0 || !string) {
|
|
8305
|
-
return self2._isEmpty ? "" : string;
|
|
8306
|
-
}
|
|
8307
|
-
let styler = self2._styler;
|
|
8308
|
-
if (styler === void 0) {
|
|
8309
|
-
return string;
|
|
8310
|
-
}
|
|
8311
|
-
const { openAll, closeAll } = styler;
|
|
8312
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
8313
|
-
while (styler !== void 0) {
|
|
8314
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
8315
|
-
styler = styler.parent;
|
|
8316
|
-
}
|
|
8317
|
-
}
|
|
8318
|
-
const lfIndex = string.indexOf("\n");
|
|
8319
|
-
if (lfIndex !== -1) {
|
|
8320
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
8321
|
-
}
|
|
8322
|
-
return openAll + string + closeAll;
|
|
8323
|
-
};
|
|
8324
|
-
let template;
|
|
8325
|
-
const chalkTag = (chalk2, ...strings) => {
|
|
8326
|
-
const [firstString] = strings;
|
|
8327
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
8328
|
-
return strings.join(" ");
|
|
8329
|
-
}
|
|
8330
|
-
const arguments_ = strings.slice(1);
|
|
8331
|
-
const parts = [firstString.raw[0]];
|
|
8332
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
8333
|
-
parts.push(
|
|
8334
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
8335
|
-
String(firstString.raw[i])
|
|
8336
|
-
);
|
|
8337
|
-
}
|
|
8338
|
-
if (template === void 0) {
|
|
8339
|
-
template = requireTemplates();
|
|
8340
|
-
}
|
|
8341
|
-
return template(chalk2, parts.join(""));
|
|
8342
|
-
};
|
|
8343
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
8344
|
-
const chalk = Chalk();
|
|
8345
|
-
chalk.supportsColor = stdoutColor;
|
|
8346
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
8347
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
8348
|
-
var source = chalk;
|
|
8349
|
-
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
8350
|
-
const { accessSync, constants, readFileSync } = fs;
|
|
8351
|
-
let envOptions = null;
|
|
8352
|
-
function SetupConfig(envOptions2, logger) {
|
|
8353
|
-
const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
|
|
8354
|
-
config_1({ path: envfile });
|
|
8355
|
-
const defconfig = {
|
|
8356
|
-
// Node runtime environment
|
|
8357
|
-
isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
|
|
8358
|
-
isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
|
|
8359
|
-
consoleLogErrors: process.env.CONSOLE_LOG_ERRORS === void 0 ? false : process.env.CONSOLE_LOG_ERRORS === "true" ? true : false,
|
|
8360
|
-
dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
|
|
8361
|
-
dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
|
|
8362
|
-
dbpasswordfile: process.env.DB_PASSWORD_FILE,
|
|
8363
|
-
dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
|
|
8364
|
-
database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
|
|
8365
|
-
databaseUrl: process.env.DATABASE_URL,
|
|
8366
|
-
databasescriptfolder: process.env.DB_SCRIPT_FOLDER === void 0 ? "/var/lib/sts/stsglobalresources/db-scripts" : process.env.DB_SCRIPT_FOLDER,
|
|
8367
|
-
connectionString: "",
|
|
8368
|
-
defaultDatabaseConnectionString: "",
|
|
8369
|
-
logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
|
|
8370
|
-
logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
|
|
8371
|
-
logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
|
|
8372
|
-
poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
|
|
8373
|
-
useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
|
|
8374
|
-
respawnOnFail: process.env.RESPAWN === void 0 ? false : process.env.RESPAWN === "true" ? true : false,
|
|
8375
|
-
defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
|
|
8376
|
-
useRedis: process.env.USE_REDIS === void 0 ? false : process.env.USE_REDIS === "true" ? true : false,
|
|
8377
|
-
useL1Redis: process.env.USE_L1_REDIS === void 0 ? false : process.env.USE_L1_REDIS === "true" ? true : false,
|
|
8378
|
-
useRedisAdaptor: process.env.USE_REDIS_ADAPTOR === void 0 ? false : process.env.USE_REDIS_ADAPTOR === "true" ? true : false,
|
|
8379
|
-
redisAdaptorUrl: process.env.REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_ADAPTOR_URL,
|
|
8380
|
-
useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
|
|
8381
|
-
redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
|
|
8382
|
-
endFlush: process.env.REDIS_END_FLUSH === void 0 ? false : process.env.REDIS_END_FLUSH === "true" ? true : false,
|
|
8383
|
-
redisPort: process.env.REDIS_PORT === void 0 ? "6379" : process.env.REDIS_PORT,
|
|
8384
|
-
redisServer: process.env.REDIS_SERVER === void 0 ? "localhost" : process.env.REDIS_SERVER,
|
|
8385
|
-
k6ScriptPath: process.env.K6SCRIPTPATH === void 0 ? "." : process.env.K6SCRIPTPATH,
|
|
8386
|
-
defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
|
|
8387
|
-
defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
|
|
8388
|
-
rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
|
|
8389
|
-
rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
|
|
8390
|
-
rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
|
|
8391
|
-
rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
|
|
8392
|
-
rest01apiidentifier: process.env.REST01_API_IDENTIFIER,
|
|
8393
|
-
rest01apiidentifierfile: process.env.REST01_API_IDENTIFIER_FILE,
|
|
8394
|
-
rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
|
|
8395
|
-
rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
|
|
8396
|
-
rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
|
|
8397
|
-
rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
|
|
8398
|
-
rest01clientid: process.env.REST01_CLIENT_ID,
|
|
8399
|
-
rest01clientidfile: process.env.REST01_CLIENT_ID_FILE,
|
|
8400
|
-
rest01clientsecret: process.env.REST01_CLIENT_SECRET,
|
|
8401
|
-
rest01clientsecretfile: process.env.REST01_CLIENT_SECRET_FILE,
|
|
8402
|
-
imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
|
|
8403
|
-
imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
|
|
8404
|
-
import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
|
|
8405
|
-
imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
|
|
8406
|
-
imapiidentifier: process.env.IM_API_IDENTIFIER,
|
|
8407
|
-
imapiidentifierfile: process.env.IM_API_IDENTIFIER_FILE,
|
|
8408
|
-
imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
|
|
8409
|
-
imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
|
|
8410
|
-
imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
|
|
8411
|
-
imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
|
|
8412
|
-
imclientid: process.env.IM_CLIENT_ID,
|
|
8413
|
-
imclientidfile: process.env.IM_CLIENT_ID_FILE,
|
|
8414
|
-
imclientsecret: process.env.IM_CLIENT_SECRET,
|
|
8415
|
-
imclientsecretfile: process.env.IM_CLIENT_SECRET_FILE,
|
|
8416
|
-
toendpoint: process.env.TO_ENDPOINT === void 0 ? "https://localhost" : process.env.TO_ENDPOINT,
|
|
8417
|
-
tohostport: process.env.TO_HOST_PORT === void 0 ? "3004" : process.env.TO_HOST_PORT,
|
|
8418
|
-
toport: process.env.TO_PORT === void 0 ? "3004" : process.env.TO_PORT,
|
|
8419
|
-
toapiroot: process.env.TO_APIROOT === void 0 ? "/ststestorchestrator/v1" : process.env.TO_APIROOT,
|
|
8420
|
-
toapiidentifier: process.env.TO_API_IDENTIFIER,
|
|
8421
|
-
toapiidentifierfile: process.env.TO_API_IDENTIFIER_FILE,
|
|
8422
|
-
toprometheussupport: process.env.TO_PROM_SUPPORT === void 0 ? true : process.env.TO_PROM_SUPPORT === "true" ? true : false,
|
|
8423
|
-
toprometheusclusterport: process.env.TO_PROM_CLUSTER_PORT === void 0 ? "3014" : process.env.TO_PROM_CLUSTER_PORT,
|
|
8424
|
-
toservicename: process.env.TO_SERVICE_NAME === void 0 ? "STSTestOrchestrator" : process.env.TO_SERVICE_NAME,
|
|
8425
|
-
toserviceversion: process.env.TO_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TO_SERVICE_VERSION,
|
|
8426
|
-
toclientid: process.env.TO_CLIENT_ID,
|
|
8427
|
-
toclientidfile: process.env.TO_CLIENT_ID_FILE,
|
|
8428
|
-
toclientsecret: process.env.TO_CLIENT_SECRET,
|
|
8429
|
-
toclientsecretfile: process.env.TO_CLIENT_SECRET_FILE,
|
|
8430
|
-
asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
|
|
8431
|
-
ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
|
|
8432
|
-
asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
|
|
8433
|
-
asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
|
|
8434
|
-
asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
|
|
8435
|
-
asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
|
|
8436
|
-
asapiidentifier: process.env.AS_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthapi/v1.0/" : process.env.AS_API_IDENTIFIER,
|
|
8437
|
-
asapiidentifierfile: process.env.AS_API_IDENTIFIER_FILE,
|
|
8438
|
-
asoauthapiidentifier: process.env.AS_OAUTH_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthoauthapi/v2.0/" : process.env.AS_OAUTH_API_IDENTIFIER,
|
|
8439
|
-
asoauthapiidentifierfile: process.env.AS_OAUTH_API_IDENTIFIER_FILE,
|
|
8440
|
-
asadminapiidentifier: process.env.AS_ADMIN_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthadminapi/v1.0/" : process.env.AS_ADMIN_API_IDENTIFIER,
|
|
8441
|
-
asadminapiidentifierfile: process.env.AS_ADMIN_API_IDENTIFIER_FILE,
|
|
8442
|
-
asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
|
|
8443
|
-
asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
|
|
8444
|
-
asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
|
|
8445
|
-
asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
|
|
8446
|
-
asclientid: process.env.AS_CLIENT_ID,
|
|
8447
|
-
asclientidfile: process.env.AS_CLIENT_ID_FILE,
|
|
8448
|
-
asclientsecret: process.env.AS_CLIENT_SECRET,
|
|
8449
|
-
asclientsecretfile: process.env.AS_CLIENT_SECRET_FILE,
|
|
8450
|
-
asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
|
|
8451
|
-
asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
|
|
8452
|
-
asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
|
|
8453
|
-
asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
|
|
8454
|
-
asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
|
|
8455
|
-
authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
|
|
8456
|
-
authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
|
|
8457
|
-
authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
|
|
8458
|
-
authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
|
|
8459
|
-
brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
|
|
8460
|
-
brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
|
|
8461
|
-
brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
|
|
8462
|
-
brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
|
|
8463
|
-
brokerapiidentifier: process.env.BROKER_API_IDENTIFIER,
|
|
8464
|
-
brokerapiidentifierfile: process.env.BROKER_API_IDENTIFIER_FILE,
|
|
8465
|
-
brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
|
|
8466
|
-
brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
|
|
8467
|
-
brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
|
|
8468
|
-
brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
|
|
8469
|
-
brokerclientid: process.env.BROKER_CLIENT_ID,
|
|
8470
|
-
brokerclientidfile: process.env.BROKER_CLIENT_ID_FILE,
|
|
8471
|
-
brokerclientsecret: process.env.BROKER_CLIENT_SECRET,
|
|
8472
|
-
brokerclientsecretfile: process.env.BROKER_CLIENT_SECRET_FILE,
|
|
8473
|
-
trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
|
|
8474
|
-
trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
|
|
8475
|
-
trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
|
|
8476
|
-
trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
|
|
8477
|
-
trnapiidentifier: process.env.TRN_API_IDENTIFIER,
|
|
8478
|
-
trnapiidentifierfile: process.env.TRN_API_IDENTIFIER_FILE,
|
|
8479
|
-
trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
|
|
8480
|
-
trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
|
|
8481
|
-
trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
|
|
8482
|
-
trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
|
|
8483
|
-
trnclientid: process.env.TRN_CLIENT_ID,
|
|
8484
|
-
trnclientidfile: process.env.TRN_CLIENT_ID_FILE,
|
|
8485
|
-
trnclientsecret: process.env.TRN_CLIENT_SECRET,
|
|
8486
|
-
trnclientsecretfile: process.env.TRN_CLIENT_SECRET_FILE,
|
|
8487
|
-
trncallbackuri: process.env.TRN_CALLBACK_URI === void 0 ? "https://localhost:3007/ststrn/v1.0/" : process.env.TRN_CALLBACK_URI,
|
|
8488
|
-
trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
|
|
8489
|
-
trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
|
|
8490
|
-
trprometheussupport: process.env.TR_PROM_SUPPORT === void 0 ? true : process.env.TR_PROM_SUPPORT === "true" ? true : false,
|
|
8491
|
-
trprometheusclusterport: process.env.TR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.TR_PROM_CLUSTER_PORT,
|
|
8492
|
-
trservicename: process.env.TR_SERVICE_NAME === void 0 ? "STSRestRunner" : process.env.TR_SERVICE_NAME,
|
|
8493
|
-
trserviceversion: process.env.TR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TR_SERVICE_VERSION,
|
|
8494
|
-
trclientid: process.env.TR_CLIENT_ID,
|
|
8495
|
-
trclientidfile: process.env.TR_CLIENT_ID_FILE,
|
|
8496
|
-
trclientsecret: process.env.TR_CLIENT_SECRET,
|
|
8497
|
-
trclientsecretfile: process.env.TR_CLIENT_SECRET_FILE,
|
|
8498
|
-
lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
|
|
8499
|
-
lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
|
|
8500
|
-
lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
|
|
8501
|
-
lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
|
|
8502
|
-
lambdaapiidentifier: process.env.LAMBDA_API_IDENTIFIER,
|
|
8503
|
-
lambdaapiidentifierfile: process.env.LAMBDA_API_IDENTIFIER_FILE,
|
|
8504
|
-
lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
|
|
8505
|
-
lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
|
|
8506
|
-
lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
|
|
8507
|
-
lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
|
|
8508
|
-
lambdaclientid: process.env.LAMBDA_CLIENT_ID,
|
|
8509
|
-
lambdaclientidfile: process.env.LAMBDA_CLIENT_ID_FILE,
|
|
8510
|
-
lambdaclientsecret: process.env.LAMBDA_CLIENT_SECRET,
|
|
8511
|
-
lambdaclientsecretfile: process.env.LAMBDA_CLIENT_SECRET_FILE,
|
|
8512
|
-
publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
|
|
8513
|
-
publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
|
|
8514
|
-
publishdebug: process.env.PUBLISH_DEBUG === void 0 ? false : process.env.PUBLISH_DEBUG === "true" ? true : false,
|
|
8515
|
-
transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
|
|
8516
|
-
useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
|
|
8517
|
-
keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
|
|
8518
|
-
maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
|
|
8519
|
-
maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
|
|
8520
|
-
maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
|
|
8521
|
-
timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
|
|
8522
|
-
maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
|
|
8523
|
-
instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
|
|
8524
|
-
instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
|
|
8525
|
-
authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
|
|
8526
|
-
authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
|
|
8527
|
-
authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
|
|
8528
|
-
masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
|
|
8529
|
-
childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
|
|
8530
|
-
systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
|
|
8531
|
-
ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
|
|
8532
|
-
httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
|
|
8533
|
-
httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
|
|
8534
|
-
tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
|
|
8535
|
-
tsjwksstorepath: process.env.TS_JWKS_STORE_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.stsauthprivate/jwks-private.json" : process.env.TS_JWKS_STORE_PATH,
|
|
8536
|
-
tsjwksstorepathfile: process.env.TS_JWKS_STORE_PATH_FILE,
|
|
8537
|
-
tsjwksstorepublicpath: process.env.TS_JWKS_STORE_PUBLIC_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.well-known/jwks.json" : process.env.TS_JWKS_STORE_PUBLIC_PATH,
|
|
8538
|
-
jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
|
|
8539
|
-
jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
|
|
8540
|
-
jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
|
|
8541
|
-
jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
|
|
8542
|
-
jwksAuthConfigRateLimitRequestsPerMinute: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE === void 0 ? 10 : parseInt(process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE),
|
|
8543
|
-
jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
|
|
8544
|
-
influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
|
|
8545
|
-
influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
|
|
8546
|
-
influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
|
|
8547
|
-
influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
|
|
8548
|
-
influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
|
|
8549
|
-
influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
|
|
8550
|
-
influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
|
|
8551
|
-
influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
|
|
8552
|
-
influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
|
|
8553
|
-
influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
|
|
8554
|
-
influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
8555
|
-
influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
|
|
8556
|
-
kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
|
|
8557
|
-
kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
|
|
8558
|
-
kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
|
|
8559
|
-
kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
|
|
8560
|
-
kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
|
|
8561
|
-
kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
|
|
8562
|
-
kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
|
|
8563
|
-
kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
|
|
8564
|
-
kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
8565
|
-
kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
|
|
8566
|
-
kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
|
|
8567
|
-
kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
|
|
8568
|
-
kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
|
|
8569
|
-
observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
|
|
8570
|
-
stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
|
|
8571
|
-
};
|
|
8572
|
-
const ReadFile = (passwordFile) => {
|
|
8573
|
-
try {
|
|
8574
|
-
accessSync(passwordFile, constants.R_OK);
|
|
8575
|
-
const data = readFileSync(passwordFile, "utf8");
|
|
8576
|
-
if (logger)
|
|
8577
|
-
logger.debug(chalk$1.green(`Successfully loaded password file: [${passwordFile}]`));
|
|
8578
|
-
return data;
|
|
8579
|
-
} catch (err) {
|
|
8580
|
-
if (logger)
|
|
8581
|
-
logger.debug(chalk$1.red(`Problem loading password file: [${passwordFile}], Error: [${err}]`));
|
|
8582
|
-
return "";
|
|
8583
|
-
}
|
|
8584
|
-
};
|
|
8585
|
-
const fileconfig = [
|
|
8586
|
-
{ fileprop: "dbpasswordfile", prop: "dbpassword" },
|
|
8587
|
-
// API identifier file processing
|
|
8588
|
-
{ fileprop: "asapiidentifierfile", prop: "asapiidentifier" },
|
|
8589
|
-
{ fileprop: "asoauthapiidentifierfile", prop: "asoauthapiidentifier" },
|
|
8590
|
-
{ fileprop: "asadminapiidentifierfile", prop: "asadminapiidentifier" },
|
|
8591
|
-
{ fileprop: "rest01apiidentifierfile", prop: "rest01apiidentifier" },
|
|
8592
|
-
{ fileprop: "brokerapiidentifierfile", prop: "brokerapiidentifier" },
|
|
8593
|
-
{ fileprop: "toapiidentifierfile", prop: "toapiidentifier" },
|
|
8594
|
-
{ fileprop: "imapiidentifierfile", prop: "imapiidentifier" },
|
|
8595
|
-
{ fileprop: "trnapiidentifierfile", prop: "trnapiidentifier" },
|
|
8596
|
-
{ fileprop: "lambdaapiidentifierfile", prop: "lambdaapiidentifier" },
|
|
8597
|
-
// Client ID file processing
|
|
8598
|
-
{ fileprop: "asclientidfile", prop: "asclientid" },
|
|
8599
|
-
{ fileprop: "rest01clientidfile", prop: "rest01clientid" },
|
|
8600
|
-
{ fileprop: "brokerclientidfile", prop: "brokerclientid" },
|
|
8601
|
-
{ fileprop: "toclientidfile", prop: "toclientid" },
|
|
8602
|
-
{ fileprop: "imclientidfile", prop: "imclientid" },
|
|
8603
|
-
{ fileprop: "trclientidfile", prop: "trclientid" },
|
|
8604
|
-
{ fileprop: "trnclientidfile", prop: "trnclientid" },
|
|
8605
|
-
{ fileprop: "lambdaclientidfile", prop: "lambdaclientid" },
|
|
8606
|
-
// Client secret file processing
|
|
8607
|
-
{ fileprop: "asclientsecretfile", prop: "asclientsecret" },
|
|
8608
|
-
{ fileprop: "rest01clientsecretfile", prop: "rest01clientsecret" },
|
|
8609
|
-
{ fileprop: "brokerclientsecretfile", prop: "brokerclientsecret" },
|
|
8610
|
-
{ fileprop: "toclientsecretfile", prop: "toclientsecret" },
|
|
8611
|
-
{ fileprop: "imclientsecretfile", prop: "imclientsecret" },
|
|
8612
|
-
{ fileprop: "trclientsecretfile", prop: "trclientsecret" },
|
|
8613
|
-
{ fileprop: "trnclientsecretfile", prop: "trnclientsecret" },
|
|
8614
|
-
{ fileprop: "lambdaclientsecretfile", prop: "lambdaclientsecret" },
|
|
8615
|
-
// JWKS secret file processing
|
|
8616
|
-
{ fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
|
|
8617
|
-
// InfluxDB file processing
|
|
8618
|
-
{ fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
|
|
8619
|
-
];
|
|
8620
|
-
fileconfig.forEach((v) => {
|
|
8621
|
-
if (defconfig[v.fileprop] !== void 0) {
|
|
8622
|
-
defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
|
|
8623
|
-
}
|
|
8624
|
-
});
|
|
8625
|
-
for (const [key, val] of Object.entries(defconfig)) {
|
|
8626
|
-
envOptions2[key] = val;
|
|
8627
|
-
}
|
|
8628
|
-
}
|
|
8629
|
-
function $SetupOptions(envOptions2) {
|
|
8630
|
-
SetupConfig(envOptions2);
|
|
8631
|
-
const options = envOptions2;
|
|
8632
|
-
const hosts = options.dbhost.split(",");
|
|
8633
|
-
envOptions2.connectionString = hosts.map((host) => {
|
|
8634
|
-
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
|
|
8635
|
-
}).join(",");
|
|
8636
|
-
envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
|
|
8637
|
-
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
|
|
8638
|
-
}).join(",");
|
|
8639
|
-
}
|
|
8640
|
-
function $Options() {
|
|
8641
|
-
if (envOptions === null) {
|
|
8642
|
-
envOptions = {};
|
|
8643
|
-
$SetupOptions(envOptions);
|
|
8644
|
-
}
|
|
8645
|
-
return envOptions;
|
|
8646
|
-
}
|
|
8647
|
-
const goptions = $Options();
|
|
8648
|
-
var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
|
|
8649
|
-
influxDBDataType2["intField"] = "intField";
|
|
8650
|
-
influxDBDataType2["floatField"] = "floatField";
|
|
8651
|
-
influxDBDataType2["stringField"] = "stringField";
|
|
8652
|
-
return influxDBDataType2;
|
|
8653
|
-
})(influxDBDataType || {});
|
|
8654
|
-
const globalServiceDefinitions = {
|
|
8655
|
-
coreFieldList: [
|
|
8656
|
-
{ fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8657
|
-
{ fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8658
|
-
{ fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8659
|
-
{ fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8660
|
-
{ fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8661
|
-
{ fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8662
|
-
{ fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
8663
|
-
{
|
|
8664
|
-
fieldName: "activeRequestCount",
|
|
8665
|
-
gauge: Gauge.ACTIVE_REQUEST_GAUGE,
|
|
8666
|
-
instrumentProperty: "val",
|
|
8667
|
-
dataType: "number",
|
|
8668
|
-
timeSeriesIndex: true,
|
|
8669
|
-
quantile: true,
|
|
8670
|
-
influxdbDataType: "intField",
|
|
8671
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
8672
|
-
instrumentOptions: {
|
|
8673
|
-
interval: goptions.instrumentationObservationInterval,
|
|
8674
|
-
sampleSize: goptions.instrumentationTimeWindow
|
|
8675
|
-
}
|
|
8676
|
-
},
|
|
8677
|
-
{ fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
8678
|
-
{ fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
8679
|
-
{ fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
8680
|
-
{ fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
|
|
8681
|
-
{
|
|
8682
|
-
fieldName: "duration",
|
|
8683
|
-
gauge: Gauge.DURATION_GAUGE,
|
|
8684
|
-
instrumentProperty: "val",
|
|
8685
|
-
dataType: "number",
|
|
8686
|
-
timeSeriesIndex: true,
|
|
8687
|
-
quantile: true,
|
|
8688
|
-
influxdbDataType: "floatField",
|
|
8689
|
-
gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
|
|
8690
|
-
instrumentOptions: {
|
|
8691
|
-
interval: goptions.instrumentationObservationInterval,
|
|
8692
|
-
sampleSize: goptions.instrumentationTimeWindow
|
|
8693
|
-
},
|
|
8694
|
-
histo: [
|
|
8695
|
-
{ label: "B10", bucketLimit: 10 },
|
|
8696
|
-
{ label: "B20", bucketLimit: 20 },
|
|
8697
|
-
{ label: "B50", bucketLimit: 50 },
|
|
8698
|
-
{ label: "B100", bucketLimit: 100 },
|
|
8699
|
-
{ label: "B1000", bucketLimit: 1e3 },
|
|
8700
|
-
{ label: "B50000", bucketLimit: 5e4 },
|
|
8701
|
-
{ label: "BInfinity", bucketLimit: -1 }
|
|
8702
|
-
]
|
|
8703
|
-
},
|
|
8704
|
-
{
|
|
8705
|
-
fieldName: "latency",
|
|
8706
|
-
gauge: Gauge.LATENCY_GAUGE,
|
|
8707
|
-
instrumentProperty: "val",
|
|
8708
|
-
dataType: "number",
|
|
8709
|
-
timeSeriesIndex: true,
|
|
8710
|
-
quantile: true,
|
|
8711
|
-
influxdbDataType: "floatField",
|
|
8712
|
-
gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
|
|
8713
|
-
instrumentOptions: {
|
|
8714
|
-
interval: goptions.instrumentationObservationInterval,
|
|
8715
|
-
sampleSize: goptions.instrumentationTimeWindow
|
|
8716
|
-
},
|
|
8717
|
-
histo: [
|
|
8718
|
-
{ label: "B10", bucketLimit: 10 },
|
|
8719
|
-
{ label: "B20", bucketLimit: 20 },
|
|
8720
|
-
{ label: "B50", bucketLimit: 50 },
|
|
8721
|
-
{ label: "B100", bucketLimit: 100 },
|
|
8722
|
-
{ label: "B1000", bucketLimit: 1e3 },
|
|
8723
|
-
{ label: "B50000", bucketLimit: 5e4 },
|
|
8724
|
-
{ label: "BInfinity", bucketLimit: -1 }
|
|
8725
|
-
]
|
|
8726
|
-
}
|
|
8727
|
-
],
|
|
8728
|
-
logFieldList: [
|
|
8729
|
-
{
|
|
8730
|
-
fieldName: "log",
|
|
8731
|
-
gauge: Gauge.LOGGER,
|
|
8732
|
-
instrumentProperty: "val",
|
|
8733
|
-
dataType: "string",
|
|
8734
|
-
timeSeriesIndex: false,
|
|
8735
|
-
quantile: false,
|
|
8736
|
-
influxdbDataType: "stringField",
|
|
8737
|
-
gaugeType: GaugeTypes.INSTRUMENT_LOG,
|
|
8738
|
-
instrumentOptions: {
|
|
8739
|
-
consoleLogging: goptions.consoleLogging,
|
|
8740
|
-
instrumentLogging: goptions.instrumentLogging
|
|
6624
|
+
],
|
|
6625
|
+
logFieldList: [
|
|
6626
|
+
{
|
|
6627
|
+
fieldName: "log",
|
|
6628
|
+
gauge: Gauge.LOGGER,
|
|
6629
|
+
instrumentProperty: "val",
|
|
6630
|
+
dataType: "string",
|
|
6631
|
+
timeSeriesIndex: false,
|
|
6632
|
+
quantile: false,
|
|
6633
|
+
influxdbDataType: "stringField",
|
|
6634
|
+
gaugeType: GaugeTypes.INSTRUMENT_LOG,
|
|
6635
|
+
instrumentOptions: {
|
|
6636
|
+
consoleLogging,
|
|
6637
|
+
instrumentLogging
|
|
8741
6638
|
}
|
|
8742
6639
|
}
|
|
8743
6640
|
],
|
|
@@ -8770,8 +6667,8 @@ const globalServiceDefinitions = {
|
|
|
8770
6667
|
influxdbDataType: "floatField",
|
|
8771
6668
|
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
8772
6669
|
instrumentOptions: {
|
|
8773
|
-
interval:
|
|
8774
|
-
sampleSize:
|
|
6670
|
+
interval: instrumentationObservationInterval,
|
|
6671
|
+
sampleSize: instrumentationTimeWindow
|
|
8775
6672
|
}
|
|
8776
6673
|
},
|
|
8777
6674
|
{
|
|
@@ -8784,8 +6681,8 @@ const globalServiceDefinitions = {
|
|
|
8784
6681
|
influxdbDataType: "intField",
|
|
8785
6682
|
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
8786
6683
|
instrumentOptions: {
|
|
8787
|
-
interval:
|
|
8788
|
-
sampleSize:
|
|
6684
|
+
interval: instrumentationObservationInterval,
|
|
6685
|
+
sampleSize: instrumentationTimeWindow
|
|
8789
6686
|
}
|
|
8790
6687
|
},
|
|
8791
6688
|
{ fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
@@ -8955,6 +6852,9 @@ const GetInstruments = (service) => {
|
|
|
8955
6852
|
} else {
|
|
8956
6853
|
retVal.push([v.gauge, v.gaugeType]);
|
|
8957
6854
|
}
|
|
6855
|
+
if (v.histo) {
|
|
6856
|
+
retVal.push([v.histoGaugeType, GaugeTypes.INSTRUMENT_HISTOGRAM]);
|
|
6857
|
+
}
|
|
8958
6858
|
});
|
|
8959
6859
|
return retVal;
|
|
8960
6860
|
};
|