@nsshunt/stsfhirclient 1.0.44 → 1.0.45
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/stsfhirclient.mjs +105 -2103
- package/dist/stsfhirclient.mjs.map +1 -1
- package/dist/stsfhirclient.umd.js +106 -2098
- package/dist/stsfhirclient.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/src/FhirClient.d.ts.map +1 -0
- package/types/src/STSFhirTypes.d.ts.map +1 -0
- package/types/src/commonTypes.d.ts.map +1 -0
- package/types/{fhirSocketClient.d.ts → src/fhirSocketClient.d.ts} +2 -0
- package/types/src/fhirSocketClient.d.ts.map +1 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/{index.test.d.ts.map → src/index.test.d.ts.map} +1 -1
- package/types/src/stsfhircontroller-pgres.test.d.ts.map +1 -0
- package/types/src/wsFhirEvents.d.ts.map +1 -0
- package/types/srv_dev/stsfhircontrollertestcasesclient.d.ts.map +1 -0
- package/types/{stsfhircontrollertestcasesdirect.d.ts → srv_dev/stsfhircontrollertestcasesdirect.d.ts} +1 -1
- package/types/srv_dev/stsfhircontrollertestcasesdirect.d.ts.map +1 -0
- package/types/FhirClient.d.ts.map +0 -1
- package/types/STSFhirTypes.d.ts.map +0 -1
- package/types/commonTypes.d.ts.map +0 -1
- package/types/fhirSocketClient.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/stsfhircontroller-pgres.test.d.ts.map +0 -1
- package/types/stsfhircontrollertestcasesclient.d.ts.map +0 -1
- package/types/stsfhircontrollertestcasesdirect.d.ts.map +0 -1
- package/types/wsFhirEvents.d.ts.map +0 -1
- /package/types/{FhirClient.d.ts → src/FhirClient.d.ts} +0 -0
- /package/types/{STSFhirTypes.d.ts → src/STSFhirTypes.d.ts} +0 -0
- /package/types/{commonTypes.d.ts → src/commonTypes.d.ts} +0 -0
- /package/types/{index.d.ts → src/index.d.ts} +0 -0
- /package/types/{index.test.d.ts → src/index.test.d.ts} +0 -0
- /package/types/{stsfhircontroller-pgres.test.d.ts → src/stsfhircontroller-pgres.test.d.ts} +0 -0
- /package/types/{wsFhirEvents.d.ts → src/wsFhirEvents.d.ts} +0 -0
- /package/types/{stsfhircontrollertestcasesclient.d.ts → srv_dev/stsfhircontrollertestcasesclient.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("axios"), require("@nsshunt/stsutils")
|
|
3
|
-
})(this, function(exports2, axios, stsutils
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("axios"), require("@nsshunt/stsutils")) : typeof define === "function" && define.amd ? define(["exports", "axios", "@nsshunt/stsutils"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsfhirclient"] = {}, global.axios, global.stsutils));
|
|
3
|
+
})(this, function(exports2, axios, stsutils) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __typeError = (msg) => {
|
|
6
6
|
throw TypeError(msg);
|
|
@@ -51,37 +51,13 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
51
51
|
function getDefaultExportFromCjs(x) {
|
|
52
52
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
return f.apply(this, arguments);
|
|
63
|
-
};
|
|
64
|
-
a.prototype = f.prototype;
|
|
65
|
-
} else a = {};
|
|
66
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
67
|
-
Object.keys(n).forEach(function(k) {
|
|
68
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
69
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function() {
|
|
72
|
-
return n[k];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return a;
|
|
77
|
-
}
|
|
78
|
-
var ansiStyles$1 = { exports: {} };
|
|
79
|
-
var colorName$1;
|
|
80
|
-
var hasRequiredColorName$1;
|
|
81
|
-
function requireColorName$1() {
|
|
82
|
-
if (hasRequiredColorName$1) return colorName$1;
|
|
83
|
-
hasRequiredColorName$1 = 1;
|
|
84
|
-
colorName$1 = {
|
|
54
|
+
var ansiStyles = { exports: {} };
|
|
55
|
+
var colorName;
|
|
56
|
+
var hasRequiredColorName;
|
|
57
|
+
function requireColorName() {
|
|
58
|
+
if (hasRequiredColorName) return colorName;
|
|
59
|
+
hasRequiredColorName = 1;
|
|
60
|
+
colorName = {
|
|
85
61
|
"aliceblue": [240, 248, 255],
|
|
86
62
|
"antiquewhite": [250, 235, 215],
|
|
87
63
|
"aqua": [0, 255, 255],
|
|
@@ -231,14 +207,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
231
207
|
"yellow": [255, 255, 0],
|
|
232
208
|
"yellowgreen": [154, 205, 50]
|
|
233
209
|
};
|
|
234
|
-
return colorName
|
|
210
|
+
return colorName;
|
|
235
211
|
}
|
|
236
|
-
var conversions
|
|
237
|
-
var hasRequiredConversions
|
|
238
|
-
function requireConversions
|
|
239
|
-
if (hasRequiredConversions
|
|
240
|
-
hasRequiredConversions
|
|
241
|
-
const cssKeywords = requireColorName
|
|
212
|
+
var conversions;
|
|
213
|
+
var hasRequiredConversions;
|
|
214
|
+
function requireConversions() {
|
|
215
|
+
if (hasRequiredConversions) return conversions;
|
|
216
|
+
hasRequiredConversions = 1;
|
|
217
|
+
const cssKeywords = requireColorName();
|
|
242
218
|
const reverseKeywords = {};
|
|
243
219
|
for (const key of Object.keys(cssKeywords)) {
|
|
244
220
|
reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -260,7 +236,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
260
236
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
261
237
|
gray: { channels: 1, labels: ["gray"] }
|
|
262
238
|
};
|
|
263
|
-
conversions
|
|
239
|
+
conversions = convert;
|
|
264
240
|
for (const model of Object.keys(convert)) {
|
|
265
241
|
if (!("channels" in convert[model])) {
|
|
266
242
|
throw new Error("missing channels property: " + model);
|
|
@@ -903,14 +879,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
903
879
|
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
904
880
|
return [val / 255 * 100];
|
|
905
881
|
};
|
|
906
|
-
return conversions
|
|
882
|
+
return conversions;
|
|
907
883
|
}
|
|
908
|
-
var route
|
|
909
|
-
var hasRequiredRoute
|
|
910
|
-
function requireRoute
|
|
911
|
-
if (hasRequiredRoute
|
|
912
|
-
hasRequiredRoute
|
|
913
|
-
const conversions2 = requireConversions
|
|
884
|
+
var route;
|
|
885
|
+
var hasRequiredRoute;
|
|
886
|
+
function requireRoute() {
|
|
887
|
+
if (hasRequiredRoute) return route;
|
|
888
|
+
hasRequiredRoute = 1;
|
|
889
|
+
const conversions2 = requireConversions();
|
|
914
890
|
function buildGraph() {
|
|
915
891
|
const graph = {};
|
|
916
892
|
const models = Object.keys(conversions2);
|
|
@@ -960,7 +936,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
960
936
|
fn.conversion = path;
|
|
961
937
|
return fn;
|
|
962
938
|
}
|
|
963
|
-
route
|
|
939
|
+
route = function(fromModel) {
|
|
964
940
|
const graph = deriveBFS(fromModel);
|
|
965
941
|
const conversion = {};
|
|
966
942
|
const models = Object.keys(graph);
|
|
@@ -974,15 +950,15 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
974
950
|
}
|
|
975
951
|
return conversion;
|
|
976
952
|
};
|
|
977
|
-
return route
|
|
953
|
+
return route;
|
|
978
954
|
}
|
|
979
|
-
var colorConvert
|
|
980
|
-
var hasRequiredColorConvert
|
|
981
|
-
function requireColorConvert
|
|
982
|
-
if (hasRequiredColorConvert
|
|
983
|
-
hasRequiredColorConvert
|
|
984
|
-
const conversions2 = requireConversions
|
|
985
|
-
const route2 = requireRoute
|
|
955
|
+
var colorConvert;
|
|
956
|
+
var hasRequiredColorConvert;
|
|
957
|
+
function requireColorConvert() {
|
|
958
|
+
if (hasRequiredColorConvert) return colorConvert;
|
|
959
|
+
hasRequiredColorConvert = 1;
|
|
960
|
+
const conversions2 = requireConversions();
|
|
961
|
+
const route2 = requireRoute();
|
|
986
962
|
const convert = {};
|
|
987
963
|
const models = Object.keys(conversions2);
|
|
988
964
|
function wrapRaw(fn) {
|
|
@@ -1035,14 +1011,14 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1035
1011
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1036
1012
|
});
|
|
1037
1013
|
});
|
|
1038
|
-
colorConvert
|
|
1039
|
-
return colorConvert
|
|
1014
|
+
colorConvert = convert;
|
|
1015
|
+
return colorConvert;
|
|
1040
1016
|
}
|
|
1041
|
-
ansiStyles
|
|
1042
|
-
var hasRequiredAnsiStyles
|
|
1043
|
-
function requireAnsiStyles
|
|
1044
|
-
if (hasRequiredAnsiStyles
|
|
1045
|
-
hasRequiredAnsiStyles
|
|
1017
|
+
ansiStyles.exports;
|
|
1018
|
+
var hasRequiredAnsiStyles;
|
|
1019
|
+
function requireAnsiStyles() {
|
|
1020
|
+
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
1021
|
+
hasRequiredAnsiStyles = 1;
|
|
1046
1022
|
(function(module2) {
|
|
1047
1023
|
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1048
1024
|
const code = fn(...args);
|
|
@@ -1076,7 +1052,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1076
1052
|
let colorConvert2;
|
|
1077
1053
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1078
1054
|
if (colorConvert2 === void 0) {
|
|
1079
|
-
colorConvert2 = requireColorConvert
|
|
1055
|
+
colorConvert2 = requireColorConvert();
|
|
1080
1056
|
}
|
|
1081
1057
|
const offset = isBackground ? 10 : 0;
|
|
1082
1058
|
const styles = {};
|
|
@@ -1179,25 +1155,25 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1179
1155
|
enumerable: true,
|
|
1180
1156
|
get: assembleStyles
|
|
1181
1157
|
});
|
|
1182
|
-
})(ansiStyles
|
|
1183
|
-
return ansiStyles
|
|
1158
|
+
})(ansiStyles);
|
|
1159
|
+
return ansiStyles.exports;
|
|
1184
1160
|
}
|
|
1185
|
-
var browser
|
|
1186
|
-
var hasRequiredBrowser
|
|
1187
|
-
function requireBrowser
|
|
1188
|
-
if (hasRequiredBrowser
|
|
1189
|
-
hasRequiredBrowser
|
|
1190
|
-
browser
|
|
1161
|
+
var browser;
|
|
1162
|
+
var hasRequiredBrowser;
|
|
1163
|
+
function requireBrowser() {
|
|
1164
|
+
if (hasRequiredBrowser) return browser;
|
|
1165
|
+
hasRequiredBrowser = 1;
|
|
1166
|
+
browser = {
|
|
1191
1167
|
stdout: false,
|
|
1192
1168
|
stderr: false
|
|
1193
1169
|
};
|
|
1194
|
-
return browser
|
|
1170
|
+
return browser;
|
|
1195
1171
|
}
|
|
1196
|
-
var util
|
|
1197
|
-
var hasRequiredUtil
|
|
1198
|
-
function requireUtil
|
|
1199
|
-
if (hasRequiredUtil
|
|
1200
|
-
hasRequiredUtil
|
|
1172
|
+
var util;
|
|
1173
|
+
var hasRequiredUtil;
|
|
1174
|
+
function requireUtil() {
|
|
1175
|
+
if (hasRequiredUtil) return util;
|
|
1176
|
+
hasRequiredUtil = 1;
|
|
1201
1177
|
const stringReplaceAll = (string, substring, replacer) => {
|
|
1202
1178
|
let index = string.indexOf(substring);
|
|
1203
1179
|
if (index === -1) {
|
|
@@ -1226,17 +1202,17 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1226
1202
|
returnValue += string.substr(endIndex);
|
|
1227
1203
|
return returnValue;
|
|
1228
1204
|
};
|
|
1229
|
-
util
|
|
1205
|
+
util = {
|
|
1230
1206
|
stringReplaceAll,
|
|
1231
1207
|
stringEncaseCRLFWithFirstIndex
|
|
1232
1208
|
};
|
|
1233
|
-
return util
|
|
1209
|
+
return util;
|
|
1234
1210
|
}
|
|
1235
|
-
var templates
|
|
1236
|
-
var hasRequiredTemplates
|
|
1237
|
-
function requireTemplates
|
|
1238
|
-
if (hasRequiredTemplates
|
|
1239
|
-
hasRequiredTemplates
|
|
1211
|
+
var templates;
|
|
1212
|
+
var hasRequiredTemplates;
|
|
1213
|
+
function requireTemplates() {
|
|
1214
|
+
if (hasRequiredTemplates) return templates;
|
|
1215
|
+
hasRequiredTemplates = 1;
|
|
1240
1216
|
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;
|
|
1241
1217
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1242
1218
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -1314,7 +1290,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1314
1290
|
}
|
|
1315
1291
|
return current;
|
|
1316
1292
|
}
|
|
1317
|
-
templates
|
|
1293
|
+
templates = (chalk2, temporary) => {
|
|
1318
1294
|
const styles = [];
|
|
1319
1295
|
const chunks = [];
|
|
1320
1296
|
let chunk = [];
|
|
@@ -1344,19 +1320,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1344
1320
|
}
|
|
1345
1321
|
return chunks.join("");
|
|
1346
1322
|
};
|
|
1347
|
-
return templates
|
|
1323
|
+
return templates;
|
|
1348
1324
|
}
|
|
1349
|
-
var source
|
|
1350
|
-
var hasRequiredSource
|
|
1351
|
-
function requireSource
|
|
1352
|
-
if (hasRequiredSource
|
|
1353
|
-
hasRequiredSource
|
|
1354
|
-
const ansiStyles2 = requireAnsiStyles
|
|
1355
|
-
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser
|
|
1325
|
+
var source;
|
|
1326
|
+
var hasRequiredSource;
|
|
1327
|
+
function requireSource() {
|
|
1328
|
+
if (hasRequiredSource) return source;
|
|
1329
|
+
hasRequiredSource = 1;
|
|
1330
|
+
const ansiStyles2 = requireAnsiStyles();
|
|
1331
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
1356
1332
|
const {
|
|
1357
1333
|
stringReplaceAll,
|
|
1358
1334
|
stringEncaseCRLFWithFirstIndex
|
|
1359
|
-
} = requireUtil
|
|
1335
|
+
} = requireUtil();
|
|
1360
1336
|
const { isArray } = Array;
|
|
1361
1337
|
const levelMapping = [
|
|
1362
1338
|
"ansi",
|
|
@@ -1512,7 +1488,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1512
1488
|
);
|
|
1513
1489
|
}
|
|
1514
1490
|
if (template === void 0) {
|
|
1515
|
-
template = requireTemplates
|
|
1491
|
+
template = requireTemplates();
|
|
1516
1492
|
}
|
|
1517
1493
|
return template(chalk3, parts2.join(""));
|
|
1518
1494
|
};
|
|
@@ -1521,10 +1497,10 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1521
1497
|
chalk2.supportsColor = stdoutColor;
|
|
1522
1498
|
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1523
1499
|
chalk2.stderr.supportsColor = stderrColor;
|
|
1524
|
-
source
|
|
1525
|
-
return source
|
|
1500
|
+
source = chalk2;
|
|
1501
|
+
return source;
|
|
1526
1502
|
}
|
|
1527
|
-
var sourceExports = requireSource
|
|
1503
|
+
var sourceExports = requireSource();
|
|
1528
1504
|
const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
|
|
1529
1505
|
var StatusCodes;
|
|
1530
1506
|
(function(StatusCodes2) {
|
|
@@ -5042,1982 +5018,35 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
5042
5018
|
}
|
|
5043
5019
|
});
|
|
5044
5020
|
};
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
let value2 = match[2] || "";
|
|
5075
|
-
value2 = value2.trim();
|
|
5076
|
-
const maybeQuote = value2[0];
|
|
5077
|
-
value2 = value2.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
5078
|
-
if (maybeQuote === '"') {
|
|
5079
|
-
value2 = value2.replace(/\\n/g, "\n");
|
|
5080
|
-
value2 = value2.replace(/\\r/g, "\r");
|
|
5081
|
-
}
|
|
5082
|
-
obj[key] = value2;
|
|
5083
|
-
}
|
|
5084
|
-
return obj;
|
|
5085
|
-
}
|
|
5086
|
-
function _parseVault(options) {
|
|
5087
|
-
const vaultPath = _vaultPath(options);
|
|
5088
|
-
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
5089
|
-
if (!result.parsed) {
|
|
5090
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
5091
|
-
err.code = "MISSING_DATA";
|
|
5092
|
-
throw err;
|
|
5093
|
-
}
|
|
5094
|
-
const keys = _dotenvKey(options).split(",");
|
|
5095
|
-
const length = keys.length;
|
|
5096
|
-
let decrypted;
|
|
5097
|
-
for (let i = 0; i < length; i++) {
|
|
5098
|
-
try {
|
|
5099
|
-
const key = keys[i].trim();
|
|
5100
|
-
const attrs = _instructions(result, key);
|
|
5101
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
5102
|
-
break;
|
|
5103
|
-
} catch (error) {
|
|
5104
|
-
if (i + 1 >= length) {
|
|
5105
|
-
throw error;
|
|
5106
|
-
}
|
|
5107
|
-
}
|
|
5108
|
-
}
|
|
5109
|
-
return DotenvModule.parse(decrypted);
|
|
5110
|
-
}
|
|
5111
|
-
function _warn(message) {
|
|
5112
|
-
console.log(`[dotenv@${version2}][WARN] ${message}`);
|
|
5113
|
-
}
|
|
5114
|
-
function _debug2(message) {
|
|
5115
|
-
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
|
5116
|
-
}
|
|
5117
|
-
function _dotenvKey(options) {
|
|
5118
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
5119
|
-
return options.DOTENV_KEY;
|
|
5120
|
-
}
|
|
5121
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
5122
|
-
return process.env.DOTENV_KEY;
|
|
5123
|
-
}
|
|
5124
|
-
return "";
|
|
5125
|
-
}
|
|
5126
|
-
function _instructions(result, dotenvKey) {
|
|
5127
|
-
let uri;
|
|
5128
|
-
try {
|
|
5129
|
-
uri = new URL(dotenvKey);
|
|
5130
|
-
} catch (error) {
|
|
5131
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
5132
|
-
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");
|
|
5133
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
5134
|
-
throw err;
|
|
5135
|
-
}
|
|
5136
|
-
throw error;
|
|
5137
|
-
}
|
|
5138
|
-
const key = uri.password;
|
|
5139
|
-
if (!key) {
|
|
5140
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
5141
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
5142
|
-
throw err;
|
|
5143
|
-
}
|
|
5144
|
-
const environment = uri.searchParams.get("environment");
|
|
5145
|
-
if (!environment) {
|
|
5146
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
5147
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
5148
|
-
throw err;
|
|
5149
|
-
}
|
|
5150
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
5151
|
-
const ciphertext = result.parsed[environmentKey];
|
|
5152
|
-
if (!ciphertext) {
|
|
5153
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
5154
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
5155
|
-
throw err;
|
|
5156
|
-
}
|
|
5157
|
-
return { ciphertext, key };
|
|
5158
|
-
}
|
|
5159
|
-
function _vaultPath(options) {
|
|
5160
|
-
let possibleVaultPath = null;
|
|
5161
|
-
if (options && options.path && options.path.length > 0) {
|
|
5162
|
-
if (Array.isArray(options.path)) {
|
|
5163
|
-
for (const filepath of options.path) {
|
|
5164
|
-
if (fs.existsSync(filepath)) {
|
|
5165
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
5166
|
-
}
|
|
5167
|
-
}
|
|
5168
|
-
} else {
|
|
5169
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
5170
|
-
}
|
|
5171
|
-
} else {
|
|
5172
|
-
possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
|
|
5173
|
-
}
|
|
5174
|
-
if (fs.existsSync(possibleVaultPath)) {
|
|
5175
|
-
return possibleVaultPath;
|
|
5176
|
-
}
|
|
5177
|
-
return null;
|
|
5178
|
-
}
|
|
5179
|
-
function _resolveHome(envPath) {
|
|
5180
|
-
return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
5181
|
-
}
|
|
5182
|
-
function _configVault(options) {
|
|
5183
|
-
const debug = Boolean(options && options.debug);
|
|
5184
|
-
if (debug) {
|
|
5185
|
-
_debug2("Loading env from encrypted .env.vault");
|
|
5186
|
-
}
|
|
5187
|
-
const parsed = DotenvModule._parseVault(options);
|
|
5188
|
-
let processEnv = process.env;
|
|
5189
|
-
if (options && options.processEnv != null) {
|
|
5190
|
-
processEnv = options.processEnv;
|
|
5191
|
-
}
|
|
5192
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
5193
|
-
return { parsed };
|
|
5194
|
-
}
|
|
5195
|
-
function configDotenv(options) {
|
|
5196
|
-
const dotenvPath = path.resolve(process.cwd(), ".env");
|
|
5197
|
-
let encoding = "utf8";
|
|
5198
|
-
const debug = Boolean(options && options.debug);
|
|
5199
|
-
if (options && options.encoding) {
|
|
5200
|
-
encoding = options.encoding;
|
|
5201
|
-
} else {
|
|
5202
|
-
if (debug) {
|
|
5203
|
-
_debug2("No encoding is specified. UTF-8 is used by default");
|
|
5204
|
-
}
|
|
5205
|
-
}
|
|
5206
|
-
let optionPaths = [dotenvPath];
|
|
5207
|
-
if (options && options.path) {
|
|
5208
|
-
if (!Array.isArray(options.path)) {
|
|
5209
|
-
optionPaths = [_resolveHome(options.path)];
|
|
5210
|
-
} else {
|
|
5211
|
-
optionPaths = [];
|
|
5212
|
-
for (const filepath of options.path) {
|
|
5213
|
-
optionPaths.push(_resolveHome(filepath));
|
|
5214
|
-
}
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
let lastError;
|
|
5218
|
-
const parsedAll = {};
|
|
5219
|
-
for (const path2 of optionPaths) {
|
|
5220
|
-
try {
|
|
5221
|
-
const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
|
|
5222
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
5223
|
-
} catch (e) {
|
|
5224
|
-
if (debug) {
|
|
5225
|
-
_debug2(`Failed to load ${path2} ${e.message}`);
|
|
5226
|
-
}
|
|
5227
|
-
lastError = e;
|
|
5228
|
-
}
|
|
5229
|
-
}
|
|
5230
|
-
let processEnv = process.env;
|
|
5231
|
-
if (options && options.processEnv != null) {
|
|
5232
|
-
processEnv = options.processEnv;
|
|
5233
|
-
}
|
|
5234
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
|
5235
|
-
if (lastError) {
|
|
5236
|
-
return { parsed: parsedAll, error: lastError };
|
|
5237
|
-
} else {
|
|
5238
|
-
return { parsed: parsedAll };
|
|
5239
|
-
}
|
|
5240
|
-
}
|
|
5241
|
-
function config(options) {
|
|
5242
|
-
if (_dotenvKey(options).length === 0) {
|
|
5243
|
-
return DotenvModule.configDotenv(options);
|
|
5244
|
-
}
|
|
5245
|
-
const vaultPath = _vaultPath(options);
|
|
5246
|
-
if (!vaultPath) {
|
|
5247
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
5248
|
-
return DotenvModule.configDotenv(options);
|
|
5249
|
-
}
|
|
5250
|
-
return DotenvModule._configVault(options);
|
|
5251
|
-
}
|
|
5252
|
-
function decrypt(encrypted, keyStr) {
|
|
5253
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
5254
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
5255
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
5256
|
-
const authTag = ciphertext.subarray(-16);
|
|
5257
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
5258
|
-
try {
|
|
5259
|
-
const aesgcm = crypto2.createDecipheriv("aes-256-gcm", key, nonce);
|
|
5260
|
-
aesgcm.setAuthTag(authTag);
|
|
5261
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
5262
|
-
} catch (error) {
|
|
5263
|
-
const isRange = error instanceof RangeError;
|
|
5264
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
5265
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
5266
|
-
if (isRange || invalidKeyLength) {
|
|
5267
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
5268
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
5269
|
-
throw err;
|
|
5270
|
-
} else if (decryptionFailed) {
|
|
5271
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
5272
|
-
err.code = "DECRYPTION_FAILED";
|
|
5273
|
-
throw err;
|
|
5274
|
-
} else {
|
|
5275
|
-
throw error;
|
|
5276
|
-
}
|
|
5277
|
-
}
|
|
5278
|
-
}
|
|
5279
|
-
function populate(processEnv, parsed, options = {}) {
|
|
5280
|
-
const debug = Boolean(options && options.debug);
|
|
5281
|
-
const override = Boolean(options && options.override);
|
|
5282
|
-
if (typeof parsed !== "object") {
|
|
5283
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
5284
|
-
err.code = "OBJECT_REQUIRED";
|
|
5285
|
-
throw err;
|
|
5286
|
-
}
|
|
5287
|
-
for (const key of Object.keys(parsed)) {
|
|
5288
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
5289
|
-
if (override === true) {
|
|
5290
|
-
processEnv[key] = parsed[key];
|
|
5291
|
-
}
|
|
5292
|
-
if (debug) {
|
|
5293
|
-
if (override === true) {
|
|
5294
|
-
_debug2(`"${key}" is already defined and WAS overwritten`);
|
|
5295
|
-
} else {
|
|
5296
|
-
_debug2(`"${key}" is already defined and was NOT overwritten`);
|
|
5297
|
-
}
|
|
5298
|
-
}
|
|
5299
|
-
} else {
|
|
5300
|
-
processEnv[key] = parsed[key];
|
|
5301
|
-
}
|
|
5302
|
-
}
|
|
5303
|
-
}
|
|
5304
|
-
const DotenvModule = {
|
|
5305
|
-
configDotenv,
|
|
5306
|
-
_configVault,
|
|
5307
|
-
_parseVault,
|
|
5308
|
-
config,
|
|
5309
|
-
decrypt,
|
|
5310
|
-
parse: parse2,
|
|
5311
|
-
populate
|
|
5312
|
-
};
|
|
5313
|
-
main.exports.configDotenv = DotenvModule.configDotenv;
|
|
5314
|
-
main.exports._configVault = DotenvModule._configVault;
|
|
5315
|
-
main.exports._parseVault = DotenvModule._parseVault;
|
|
5316
|
-
main.exports.config = DotenvModule.config;
|
|
5317
|
-
main.exports.decrypt = DotenvModule.decrypt;
|
|
5318
|
-
main.exports.parse = DotenvModule.parse;
|
|
5319
|
-
main.exports.populate = DotenvModule.populate;
|
|
5320
|
-
main.exports = DotenvModule;
|
|
5321
|
-
return main.exports;
|
|
5322
|
-
}
|
|
5323
|
-
var mainExports = requireMain();
|
|
5324
|
-
const dotenv = /* @__PURE__ */ getDefaultExportFromCjs(mainExports);
|
|
5325
|
-
var ansiStyles = { exports: {} };
|
|
5326
|
-
var colorName;
|
|
5327
|
-
var hasRequiredColorName;
|
|
5328
|
-
function requireColorName() {
|
|
5329
|
-
if (hasRequiredColorName) return colorName;
|
|
5330
|
-
hasRequiredColorName = 1;
|
|
5331
|
-
colorName = {
|
|
5332
|
-
"aliceblue": [240, 248, 255],
|
|
5333
|
-
"antiquewhite": [250, 235, 215],
|
|
5334
|
-
"aqua": [0, 255, 255],
|
|
5335
|
-
"aquamarine": [127, 255, 212],
|
|
5336
|
-
"azure": [240, 255, 255],
|
|
5337
|
-
"beige": [245, 245, 220],
|
|
5338
|
-
"bisque": [255, 228, 196],
|
|
5339
|
-
"black": [0, 0, 0],
|
|
5340
|
-
"blanchedalmond": [255, 235, 205],
|
|
5341
|
-
"blue": [0, 0, 255],
|
|
5342
|
-
"blueviolet": [138, 43, 226],
|
|
5343
|
-
"brown": [165, 42, 42],
|
|
5344
|
-
"burlywood": [222, 184, 135],
|
|
5345
|
-
"cadetblue": [95, 158, 160],
|
|
5346
|
-
"chartreuse": [127, 255, 0],
|
|
5347
|
-
"chocolate": [210, 105, 30],
|
|
5348
|
-
"coral": [255, 127, 80],
|
|
5349
|
-
"cornflowerblue": [100, 149, 237],
|
|
5350
|
-
"cornsilk": [255, 248, 220],
|
|
5351
|
-
"crimson": [220, 20, 60],
|
|
5352
|
-
"cyan": [0, 255, 255],
|
|
5353
|
-
"darkblue": [0, 0, 139],
|
|
5354
|
-
"darkcyan": [0, 139, 139],
|
|
5355
|
-
"darkgoldenrod": [184, 134, 11],
|
|
5356
|
-
"darkgray": [169, 169, 169],
|
|
5357
|
-
"darkgreen": [0, 100, 0],
|
|
5358
|
-
"darkgrey": [169, 169, 169],
|
|
5359
|
-
"darkkhaki": [189, 183, 107],
|
|
5360
|
-
"darkmagenta": [139, 0, 139],
|
|
5361
|
-
"darkolivegreen": [85, 107, 47],
|
|
5362
|
-
"darkorange": [255, 140, 0],
|
|
5363
|
-
"darkorchid": [153, 50, 204],
|
|
5364
|
-
"darkred": [139, 0, 0],
|
|
5365
|
-
"darksalmon": [233, 150, 122],
|
|
5366
|
-
"darkseagreen": [143, 188, 143],
|
|
5367
|
-
"darkslateblue": [72, 61, 139],
|
|
5368
|
-
"darkslategray": [47, 79, 79],
|
|
5369
|
-
"darkslategrey": [47, 79, 79],
|
|
5370
|
-
"darkturquoise": [0, 206, 209],
|
|
5371
|
-
"darkviolet": [148, 0, 211],
|
|
5372
|
-
"deeppink": [255, 20, 147],
|
|
5373
|
-
"deepskyblue": [0, 191, 255],
|
|
5374
|
-
"dimgray": [105, 105, 105],
|
|
5375
|
-
"dimgrey": [105, 105, 105],
|
|
5376
|
-
"dodgerblue": [30, 144, 255],
|
|
5377
|
-
"firebrick": [178, 34, 34],
|
|
5378
|
-
"floralwhite": [255, 250, 240],
|
|
5379
|
-
"forestgreen": [34, 139, 34],
|
|
5380
|
-
"fuchsia": [255, 0, 255],
|
|
5381
|
-
"gainsboro": [220, 220, 220],
|
|
5382
|
-
"ghostwhite": [248, 248, 255],
|
|
5383
|
-
"gold": [255, 215, 0],
|
|
5384
|
-
"goldenrod": [218, 165, 32],
|
|
5385
|
-
"gray": [128, 128, 128],
|
|
5386
|
-
"green": [0, 128, 0],
|
|
5387
|
-
"greenyellow": [173, 255, 47],
|
|
5388
|
-
"grey": [128, 128, 128],
|
|
5389
|
-
"honeydew": [240, 255, 240],
|
|
5390
|
-
"hotpink": [255, 105, 180],
|
|
5391
|
-
"indianred": [205, 92, 92],
|
|
5392
|
-
"indigo": [75, 0, 130],
|
|
5393
|
-
"ivory": [255, 255, 240],
|
|
5394
|
-
"khaki": [240, 230, 140],
|
|
5395
|
-
"lavender": [230, 230, 250],
|
|
5396
|
-
"lavenderblush": [255, 240, 245],
|
|
5397
|
-
"lawngreen": [124, 252, 0],
|
|
5398
|
-
"lemonchiffon": [255, 250, 205],
|
|
5399
|
-
"lightblue": [173, 216, 230],
|
|
5400
|
-
"lightcoral": [240, 128, 128],
|
|
5401
|
-
"lightcyan": [224, 255, 255],
|
|
5402
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
5403
|
-
"lightgray": [211, 211, 211],
|
|
5404
|
-
"lightgreen": [144, 238, 144],
|
|
5405
|
-
"lightgrey": [211, 211, 211],
|
|
5406
|
-
"lightpink": [255, 182, 193],
|
|
5407
|
-
"lightsalmon": [255, 160, 122],
|
|
5408
|
-
"lightseagreen": [32, 178, 170],
|
|
5409
|
-
"lightskyblue": [135, 206, 250],
|
|
5410
|
-
"lightslategray": [119, 136, 153],
|
|
5411
|
-
"lightslategrey": [119, 136, 153],
|
|
5412
|
-
"lightsteelblue": [176, 196, 222],
|
|
5413
|
-
"lightyellow": [255, 255, 224],
|
|
5414
|
-
"lime": [0, 255, 0],
|
|
5415
|
-
"limegreen": [50, 205, 50],
|
|
5416
|
-
"linen": [250, 240, 230],
|
|
5417
|
-
"magenta": [255, 0, 255],
|
|
5418
|
-
"maroon": [128, 0, 0],
|
|
5419
|
-
"mediumaquamarine": [102, 205, 170],
|
|
5420
|
-
"mediumblue": [0, 0, 205],
|
|
5421
|
-
"mediumorchid": [186, 85, 211],
|
|
5422
|
-
"mediumpurple": [147, 112, 219],
|
|
5423
|
-
"mediumseagreen": [60, 179, 113],
|
|
5424
|
-
"mediumslateblue": [123, 104, 238],
|
|
5425
|
-
"mediumspringgreen": [0, 250, 154],
|
|
5426
|
-
"mediumturquoise": [72, 209, 204],
|
|
5427
|
-
"mediumvioletred": [199, 21, 133],
|
|
5428
|
-
"midnightblue": [25, 25, 112],
|
|
5429
|
-
"mintcream": [245, 255, 250],
|
|
5430
|
-
"mistyrose": [255, 228, 225],
|
|
5431
|
-
"moccasin": [255, 228, 181],
|
|
5432
|
-
"navajowhite": [255, 222, 173],
|
|
5433
|
-
"navy": [0, 0, 128],
|
|
5434
|
-
"oldlace": [253, 245, 230],
|
|
5435
|
-
"olive": [128, 128, 0],
|
|
5436
|
-
"olivedrab": [107, 142, 35],
|
|
5437
|
-
"orange": [255, 165, 0],
|
|
5438
|
-
"orangered": [255, 69, 0],
|
|
5439
|
-
"orchid": [218, 112, 214],
|
|
5440
|
-
"palegoldenrod": [238, 232, 170],
|
|
5441
|
-
"palegreen": [152, 251, 152],
|
|
5442
|
-
"paleturquoise": [175, 238, 238],
|
|
5443
|
-
"palevioletred": [219, 112, 147],
|
|
5444
|
-
"papayawhip": [255, 239, 213],
|
|
5445
|
-
"peachpuff": [255, 218, 185],
|
|
5446
|
-
"peru": [205, 133, 63],
|
|
5447
|
-
"pink": [255, 192, 203],
|
|
5448
|
-
"plum": [221, 160, 221],
|
|
5449
|
-
"powderblue": [176, 224, 230],
|
|
5450
|
-
"purple": [128, 0, 128],
|
|
5451
|
-
"rebeccapurple": [102, 51, 153],
|
|
5452
|
-
"red": [255, 0, 0],
|
|
5453
|
-
"rosybrown": [188, 143, 143],
|
|
5454
|
-
"royalblue": [65, 105, 225],
|
|
5455
|
-
"saddlebrown": [139, 69, 19],
|
|
5456
|
-
"salmon": [250, 128, 114],
|
|
5457
|
-
"sandybrown": [244, 164, 96],
|
|
5458
|
-
"seagreen": [46, 139, 87],
|
|
5459
|
-
"seashell": [255, 245, 238],
|
|
5460
|
-
"sienna": [160, 82, 45],
|
|
5461
|
-
"silver": [192, 192, 192],
|
|
5462
|
-
"skyblue": [135, 206, 235],
|
|
5463
|
-
"slateblue": [106, 90, 205],
|
|
5464
|
-
"slategray": [112, 128, 144],
|
|
5465
|
-
"slategrey": [112, 128, 144],
|
|
5466
|
-
"snow": [255, 250, 250],
|
|
5467
|
-
"springgreen": [0, 255, 127],
|
|
5468
|
-
"steelblue": [70, 130, 180],
|
|
5469
|
-
"tan": [210, 180, 140],
|
|
5470
|
-
"teal": [0, 128, 128],
|
|
5471
|
-
"thistle": [216, 191, 216],
|
|
5472
|
-
"tomato": [255, 99, 71],
|
|
5473
|
-
"turquoise": [64, 224, 208],
|
|
5474
|
-
"violet": [238, 130, 238],
|
|
5475
|
-
"wheat": [245, 222, 179],
|
|
5476
|
-
"white": [255, 255, 255],
|
|
5477
|
-
"whitesmoke": [245, 245, 245],
|
|
5478
|
-
"yellow": [255, 255, 0],
|
|
5479
|
-
"yellowgreen": [154, 205, 50]
|
|
5480
|
-
};
|
|
5481
|
-
return colorName;
|
|
5482
|
-
}
|
|
5483
|
-
var conversions;
|
|
5484
|
-
var hasRequiredConversions;
|
|
5485
|
-
function requireConversions() {
|
|
5486
|
-
if (hasRequiredConversions) return conversions;
|
|
5487
|
-
hasRequiredConversions = 1;
|
|
5488
|
-
const cssKeywords = requireColorName();
|
|
5489
|
-
const reverseKeywords = {};
|
|
5490
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
5491
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
5492
|
-
}
|
|
5493
|
-
const convert = {
|
|
5494
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
5495
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
5496
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
5497
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
5498
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
5499
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
5500
|
-
lab: { channels: 3, labels: "lab" },
|
|
5501
|
-
lch: { channels: 3, labels: "lch" },
|
|
5502
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
5503
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
5504
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
5505
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
5506
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
5507
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
5508
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
5509
|
-
};
|
|
5510
|
-
conversions = convert;
|
|
5511
|
-
for (const model of Object.keys(convert)) {
|
|
5512
|
-
if (!("channels" in convert[model])) {
|
|
5513
|
-
throw new Error("missing channels property: " + model);
|
|
5514
|
-
}
|
|
5515
|
-
if (!("labels" in convert[model])) {
|
|
5516
|
-
throw new Error("missing channel labels property: " + model);
|
|
5517
|
-
}
|
|
5518
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
5519
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
5520
|
-
}
|
|
5521
|
-
const { channels, labels } = convert[model];
|
|
5522
|
-
delete convert[model].channels;
|
|
5523
|
-
delete convert[model].labels;
|
|
5524
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
5525
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
5526
|
-
}
|
|
5527
|
-
convert.rgb.hsl = function(rgb) {
|
|
5528
|
-
const r = rgb[0] / 255;
|
|
5529
|
-
const g = rgb[1] / 255;
|
|
5530
|
-
const b = rgb[2] / 255;
|
|
5531
|
-
const min = Math.min(r, g, b);
|
|
5532
|
-
const max = Math.max(r, g, b);
|
|
5533
|
-
const delta = max - min;
|
|
5534
|
-
let h;
|
|
5535
|
-
let s;
|
|
5536
|
-
if (max === min) {
|
|
5537
|
-
h = 0;
|
|
5538
|
-
} else if (r === max) {
|
|
5539
|
-
h = (g - b) / delta;
|
|
5540
|
-
} else if (g === max) {
|
|
5541
|
-
h = 2 + (b - r) / delta;
|
|
5542
|
-
} else if (b === max) {
|
|
5543
|
-
h = 4 + (r - g) / delta;
|
|
5544
|
-
}
|
|
5545
|
-
h = Math.min(h * 60, 360);
|
|
5546
|
-
if (h < 0) {
|
|
5547
|
-
h += 360;
|
|
5548
|
-
}
|
|
5549
|
-
const l = (min + max) / 2;
|
|
5550
|
-
if (max === min) {
|
|
5551
|
-
s = 0;
|
|
5552
|
-
} else if (l <= 0.5) {
|
|
5553
|
-
s = delta / (max + min);
|
|
5554
|
-
} else {
|
|
5555
|
-
s = delta / (2 - max - min);
|
|
5556
|
-
}
|
|
5557
|
-
return [h, s * 100, l * 100];
|
|
5558
|
-
};
|
|
5559
|
-
convert.rgb.hsv = function(rgb) {
|
|
5560
|
-
let rdif;
|
|
5561
|
-
let gdif;
|
|
5562
|
-
let bdif;
|
|
5563
|
-
let h;
|
|
5564
|
-
let s;
|
|
5565
|
-
const r = rgb[0] / 255;
|
|
5566
|
-
const g = rgb[1] / 255;
|
|
5567
|
-
const b = rgb[2] / 255;
|
|
5568
|
-
const v = Math.max(r, g, b);
|
|
5569
|
-
const diff = v - Math.min(r, g, b);
|
|
5570
|
-
const diffc = function(c) {
|
|
5571
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
5572
|
-
};
|
|
5573
|
-
if (diff === 0) {
|
|
5574
|
-
h = 0;
|
|
5575
|
-
s = 0;
|
|
5576
|
-
} else {
|
|
5577
|
-
s = diff / v;
|
|
5578
|
-
rdif = diffc(r);
|
|
5579
|
-
gdif = diffc(g);
|
|
5580
|
-
bdif = diffc(b);
|
|
5581
|
-
if (r === v) {
|
|
5582
|
-
h = bdif - gdif;
|
|
5583
|
-
} else if (g === v) {
|
|
5584
|
-
h = 1 / 3 + rdif - bdif;
|
|
5585
|
-
} else if (b === v) {
|
|
5586
|
-
h = 2 / 3 + gdif - rdif;
|
|
5587
|
-
}
|
|
5588
|
-
if (h < 0) {
|
|
5589
|
-
h += 1;
|
|
5590
|
-
} else if (h > 1) {
|
|
5591
|
-
h -= 1;
|
|
5592
|
-
}
|
|
5593
|
-
}
|
|
5594
|
-
return [
|
|
5595
|
-
h * 360,
|
|
5596
|
-
s * 100,
|
|
5597
|
-
v * 100
|
|
5598
|
-
];
|
|
5599
|
-
};
|
|
5600
|
-
convert.rgb.hwb = function(rgb) {
|
|
5601
|
-
const r = rgb[0];
|
|
5602
|
-
const g = rgb[1];
|
|
5603
|
-
let b = rgb[2];
|
|
5604
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
5605
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
5606
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
5607
|
-
return [h, w * 100, b * 100];
|
|
5608
|
-
};
|
|
5609
|
-
convert.rgb.cmyk = function(rgb) {
|
|
5610
|
-
const r = rgb[0] / 255;
|
|
5611
|
-
const g = rgb[1] / 255;
|
|
5612
|
-
const b = rgb[2] / 255;
|
|
5613
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
5614
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
5615
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
5616
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
5617
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
5618
|
-
};
|
|
5619
|
-
function comparativeDistance(x, y) {
|
|
5620
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
5621
|
-
}
|
|
5622
|
-
convert.rgb.keyword = function(rgb) {
|
|
5623
|
-
const reversed = reverseKeywords[rgb];
|
|
5624
|
-
if (reversed) {
|
|
5625
|
-
return reversed;
|
|
5626
|
-
}
|
|
5627
|
-
let currentClosestDistance = Infinity;
|
|
5628
|
-
let currentClosestKeyword;
|
|
5629
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
5630
|
-
const value2 = cssKeywords[keyword];
|
|
5631
|
-
const distance = comparativeDistance(rgb, value2);
|
|
5632
|
-
if (distance < currentClosestDistance) {
|
|
5633
|
-
currentClosestDistance = distance;
|
|
5634
|
-
currentClosestKeyword = keyword;
|
|
5635
|
-
}
|
|
5636
|
-
}
|
|
5637
|
-
return currentClosestKeyword;
|
|
5638
|
-
};
|
|
5639
|
-
convert.keyword.rgb = function(keyword) {
|
|
5640
|
-
return cssKeywords[keyword];
|
|
5641
|
-
};
|
|
5642
|
-
convert.rgb.xyz = function(rgb) {
|
|
5643
|
-
let r = rgb[0] / 255;
|
|
5644
|
-
let g = rgb[1] / 255;
|
|
5645
|
-
let b = rgb[2] / 255;
|
|
5646
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
5647
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
5648
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
5649
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
5650
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
5651
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
5652
|
-
return [x * 100, y * 100, z * 100];
|
|
5653
|
-
};
|
|
5654
|
-
convert.rgb.lab = function(rgb) {
|
|
5655
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
5656
|
-
let x = xyz[0];
|
|
5657
|
-
let y = xyz[1];
|
|
5658
|
-
let z = xyz[2];
|
|
5659
|
-
x /= 95.047;
|
|
5660
|
-
y /= 100;
|
|
5661
|
-
z /= 108.883;
|
|
5662
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
5663
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
5664
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
5665
|
-
const l = 116 * y - 16;
|
|
5666
|
-
const a = 500 * (x - y);
|
|
5667
|
-
const b = 200 * (y - z);
|
|
5668
|
-
return [l, a, b];
|
|
5669
|
-
};
|
|
5670
|
-
convert.hsl.rgb = function(hsl) {
|
|
5671
|
-
const h = hsl[0] / 360;
|
|
5672
|
-
const s = hsl[1] / 100;
|
|
5673
|
-
const l = hsl[2] / 100;
|
|
5674
|
-
let t2;
|
|
5675
|
-
let t3;
|
|
5676
|
-
let val;
|
|
5677
|
-
if (s === 0) {
|
|
5678
|
-
val = l * 255;
|
|
5679
|
-
return [val, val, val];
|
|
5680
|
-
}
|
|
5681
|
-
if (l < 0.5) {
|
|
5682
|
-
t2 = l * (1 + s);
|
|
5683
|
-
} else {
|
|
5684
|
-
t2 = l + s - l * s;
|
|
5685
|
-
}
|
|
5686
|
-
const t1 = 2 * l - t2;
|
|
5687
|
-
const rgb = [0, 0, 0];
|
|
5688
|
-
for (let i = 0; i < 3; i++) {
|
|
5689
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
5690
|
-
if (t3 < 0) {
|
|
5691
|
-
t3++;
|
|
5692
|
-
}
|
|
5693
|
-
if (t3 > 1) {
|
|
5694
|
-
t3--;
|
|
5695
|
-
}
|
|
5696
|
-
if (6 * t3 < 1) {
|
|
5697
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
5698
|
-
} else if (2 * t3 < 1) {
|
|
5699
|
-
val = t2;
|
|
5700
|
-
} else if (3 * t3 < 2) {
|
|
5701
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
5702
|
-
} else {
|
|
5703
|
-
val = t1;
|
|
5704
|
-
}
|
|
5705
|
-
rgb[i] = val * 255;
|
|
5706
|
-
}
|
|
5707
|
-
return rgb;
|
|
5708
|
-
};
|
|
5709
|
-
convert.hsl.hsv = function(hsl) {
|
|
5710
|
-
const h = hsl[0];
|
|
5711
|
-
let s = hsl[1] / 100;
|
|
5712
|
-
let l = hsl[2] / 100;
|
|
5713
|
-
let smin = s;
|
|
5714
|
-
const lmin = Math.max(l, 0.01);
|
|
5715
|
-
l *= 2;
|
|
5716
|
-
s *= l <= 1 ? l : 2 - l;
|
|
5717
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
5718
|
-
const v = (l + s) / 2;
|
|
5719
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
5720
|
-
return [h, sv * 100, v * 100];
|
|
5721
|
-
};
|
|
5722
|
-
convert.hsv.rgb = function(hsv) {
|
|
5723
|
-
const h = hsv[0] / 60;
|
|
5724
|
-
const s = hsv[1] / 100;
|
|
5725
|
-
let v = hsv[2] / 100;
|
|
5726
|
-
const hi = Math.floor(h) % 6;
|
|
5727
|
-
const f = h - Math.floor(h);
|
|
5728
|
-
const p = 255 * v * (1 - s);
|
|
5729
|
-
const q = 255 * v * (1 - s * f);
|
|
5730
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
5731
|
-
v *= 255;
|
|
5732
|
-
switch (hi) {
|
|
5733
|
-
case 0:
|
|
5734
|
-
return [v, t, p];
|
|
5735
|
-
case 1:
|
|
5736
|
-
return [q, v, p];
|
|
5737
|
-
case 2:
|
|
5738
|
-
return [p, v, t];
|
|
5739
|
-
case 3:
|
|
5740
|
-
return [p, q, v];
|
|
5741
|
-
case 4:
|
|
5742
|
-
return [t, p, v];
|
|
5743
|
-
case 5:
|
|
5744
|
-
return [v, p, q];
|
|
5745
|
-
}
|
|
5746
|
-
};
|
|
5747
|
-
convert.hsv.hsl = function(hsv) {
|
|
5748
|
-
const h = hsv[0];
|
|
5749
|
-
const s = hsv[1] / 100;
|
|
5750
|
-
const v = hsv[2] / 100;
|
|
5751
|
-
const vmin = Math.max(v, 0.01);
|
|
5752
|
-
let sl;
|
|
5753
|
-
let l;
|
|
5754
|
-
l = (2 - s) * v;
|
|
5755
|
-
const lmin = (2 - s) * vmin;
|
|
5756
|
-
sl = s * vmin;
|
|
5757
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
5758
|
-
sl = sl || 0;
|
|
5759
|
-
l /= 2;
|
|
5760
|
-
return [h, sl * 100, l * 100];
|
|
5761
|
-
};
|
|
5762
|
-
convert.hwb.rgb = function(hwb) {
|
|
5763
|
-
const h = hwb[0] / 360;
|
|
5764
|
-
let wh = hwb[1] / 100;
|
|
5765
|
-
let bl = hwb[2] / 100;
|
|
5766
|
-
const ratio = wh + bl;
|
|
5767
|
-
let f;
|
|
5768
|
-
if (ratio > 1) {
|
|
5769
|
-
wh /= ratio;
|
|
5770
|
-
bl /= ratio;
|
|
5771
|
-
}
|
|
5772
|
-
const i = Math.floor(6 * h);
|
|
5773
|
-
const v = 1 - bl;
|
|
5774
|
-
f = 6 * h - i;
|
|
5775
|
-
if ((i & 1) !== 0) {
|
|
5776
|
-
f = 1 - f;
|
|
5777
|
-
}
|
|
5778
|
-
const n = wh + f * (v - wh);
|
|
5779
|
-
let r;
|
|
5780
|
-
let g;
|
|
5781
|
-
let b;
|
|
5782
|
-
switch (i) {
|
|
5783
|
-
default:
|
|
5784
|
-
case 6:
|
|
5785
|
-
case 0:
|
|
5786
|
-
r = v;
|
|
5787
|
-
g = n;
|
|
5788
|
-
b = wh;
|
|
5789
|
-
break;
|
|
5790
|
-
case 1:
|
|
5791
|
-
r = n;
|
|
5792
|
-
g = v;
|
|
5793
|
-
b = wh;
|
|
5794
|
-
break;
|
|
5795
|
-
case 2:
|
|
5796
|
-
r = wh;
|
|
5797
|
-
g = v;
|
|
5798
|
-
b = n;
|
|
5799
|
-
break;
|
|
5800
|
-
case 3:
|
|
5801
|
-
r = wh;
|
|
5802
|
-
g = n;
|
|
5803
|
-
b = v;
|
|
5804
|
-
break;
|
|
5805
|
-
case 4:
|
|
5806
|
-
r = n;
|
|
5807
|
-
g = wh;
|
|
5808
|
-
b = v;
|
|
5809
|
-
break;
|
|
5810
|
-
case 5:
|
|
5811
|
-
r = v;
|
|
5812
|
-
g = wh;
|
|
5813
|
-
b = n;
|
|
5814
|
-
break;
|
|
5815
|
-
}
|
|
5816
|
-
return [r * 255, g * 255, b * 255];
|
|
5817
|
-
};
|
|
5818
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
5819
|
-
const c = cmyk[0] / 100;
|
|
5820
|
-
const m = cmyk[1] / 100;
|
|
5821
|
-
const y = cmyk[2] / 100;
|
|
5822
|
-
const k = cmyk[3] / 100;
|
|
5823
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
5824
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
5825
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
5826
|
-
return [r * 255, g * 255, b * 255];
|
|
5827
|
-
};
|
|
5828
|
-
convert.xyz.rgb = function(xyz) {
|
|
5829
|
-
const x = xyz[0] / 100;
|
|
5830
|
-
const y = xyz[1] / 100;
|
|
5831
|
-
const z = xyz[2] / 100;
|
|
5832
|
-
let r;
|
|
5833
|
-
let g;
|
|
5834
|
-
let b;
|
|
5835
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
5836
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
5837
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
5838
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
5839
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
5840
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
5841
|
-
r = Math.min(Math.max(0, r), 1);
|
|
5842
|
-
g = Math.min(Math.max(0, g), 1);
|
|
5843
|
-
b = Math.min(Math.max(0, b), 1);
|
|
5844
|
-
return [r * 255, g * 255, b * 255];
|
|
5845
|
-
};
|
|
5846
|
-
convert.xyz.lab = function(xyz) {
|
|
5847
|
-
let x = xyz[0];
|
|
5848
|
-
let y = xyz[1];
|
|
5849
|
-
let z = xyz[2];
|
|
5850
|
-
x /= 95.047;
|
|
5851
|
-
y /= 100;
|
|
5852
|
-
z /= 108.883;
|
|
5853
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
5854
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
5855
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
5856
|
-
const l = 116 * y - 16;
|
|
5857
|
-
const a = 500 * (x - y);
|
|
5858
|
-
const b = 200 * (y - z);
|
|
5859
|
-
return [l, a, b];
|
|
5860
|
-
};
|
|
5861
|
-
convert.lab.xyz = function(lab) {
|
|
5862
|
-
const l = lab[0];
|
|
5863
|
-
const a = lab[1];
|
|
5864
|
-
const b = lab[2];
|
|
5865
|
-
let x;
|
|
5866
|
-
let y;
|
|
5867
|
-
let z;
|
|
5868
|
-
y = (l + 16) / 116;
|
|
5869
|
-
x = a / 500 + y;
|
|
5870
|
-
z = y - b / 200;
|
|
5871
|
-
const y2 = y ** 3;
|
|
5872
|
-
const x2 = x ** 3;
|
|
5873
|
-
const z2 = z ** 3;
|
|
5874
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
5875
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
5876
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
5877
|
-
x *= 95.047;
|
|
5878
|
-
y *= 100;
|
|
5879
|
-
z *= 108.883;
|
|
5880
|
-
return [x, y, z];
|
|
5881
|
-
};
|
|
5882
|
-
convert.lab.lch = function(lab) {
|
|
5883
|
-
const l = lab[0];
|
|
5884
|
-
const a = lab[1];
|
|
5885
|
-
const b = lab[2];
|
|
5886
|
-
let h;
|
|
5887
|
-
const hr = Math.atan2(b, a);
|
|
5888
|
-
h = hr * 360 / 2 / Math.PI;
|
|
5889
|
-
if (h < 0) {
|
|
5890
|
-
h += 360;
|
|
5891
|
-
}
|
|
5892
|
-
const c = Math.sqrt(a * a + b * b);
|
|
5893
|
-
return [l, c, h];
|
|
5894
|
-
};
|
|
5895
|
-
convert.lch.lab = function(lch) {
|
|
5896
|
-
const l = lch[0];
|
|
5897
|
-
const c = lch[1];
|
|
5898
|
-
const h = lch[2];
|
|
5899
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
5900
|
-
const a = c * Math.cos(hr);
|
|
5901
|
-
const b = c * Math.sin(hr);
|
|
5902
|
-
return [l, a, b];
|
|
5903
|
-
};
|
|
5904
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
5905
|
-
const [r, g, b] = args;
|
|
5906
|
-
let value2 = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
5907
|
-
value2 = Math.round(value2 / 50);
|
|
5908
|
-
if (value2 === 0) {
|
|
5909
|
-
return 30;
|
|
5910
|
-
}
|
|
5911
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
5912
|
-
if (value2 === 2) {
|
|
5913
|
-
ansi += 60;
|
|
5914
|
-
}
|
|
5915
|
-
return ansi;
|
|
5916
|
-
};
|
|
5917
|
-
convert.hsv.ansi16 = function(args) {
|
|
5918
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
5919
|
-
};
|
|
5920
|
-
convert.rgb.ansi256 = function(args) {
|
|
5921
|
-
const r = args[0];
|
|
5922
|
-
const g = args[1];
|
|
5923
|
-
const b = args[2];
|
|
5924
|
-
if (r === g && g === b) {
|
|
5925
|
-
if (r < 8) {
|
|
5926
|
-
return 16;
|
|
5927
|
-
}
|
|
5928
|
-
if (r > 248) {
|
|
5929
|
-
return 231;
|
|
5930
|
-
}
|
|
5931
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
5932
|
-
}
|
|
5933
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
5934
|
-
return ansi;
|
|
5935
|
-
};
|
|
5936
|
-
convert.ansi16.rgb = function(args) {
|
|
5937
|
-
let color = args % 10;
|
|
5938
|
-
if (color === 0 || color === 7) {
|
|
5939
|
-
if (args > 50) {
|
|
5940
|
-
color += 3.5;
|
|
5941
|
-
}
|
|
5942
|
-
color = color / 10.5 * 255;
|
|
5943
|
-
return [color, color, color];
|
|
5944
|
-
}
|
|
5945
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
5946
|
-
const r = (color & 1) * mult * 255;
|
|
5947
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
5948
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
5949
|
-
return [r, g, b];
|
|
5950
|
-
};
|
|
5951
|
-
convert.ansi256.rgb = function(args) {
|
|
5952
|
-
if (args >= 232) {
|
|
5953
|
-
const c = (args - 232) * 10 + 8;
|
|
5954
|
-
return [c, c, c];
|
|
5955
|
-
}
|
|
5956
|
-
args -= 16;
|
|
5957
|
-
let rem;
|
|
5958
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
5959
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
5960
|
-
const b = rem % 6 / 5 * 255;
|
|
5961
|
-
return [r, g, b];
|
|
5962
|
-
};
|
|
5963
|
-
convert.rgb.hex = function(args) {
|
|
5964
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
5965
|
-
const string = integer.toString(16).toUpperCase();
|
|
5966
|
-
return "000000".substring(string.length) + string;
|
|
5967
|
-
};
|
|
5968
|
-
convert.hex.rgb = function(args) {
|
|
5969
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
5970
|
-
if (!match) {
|
|
5971
|
-
return [0, 0, 0];
|
|
5972
|
-
}
|
|
5973
|
-
let colorString = match[0];
|
|
5974
|
-
if (match[0].length === 3) {
|
|
5975
|
-
colorString = colorString.split("").map((char) => {
|
|
5976
|
-
return char + char;
|
|
5977
|
-
}).join("");
|
|
5978
|
-
}
|
|
5979
|
-
const integer = parseInt(colorString, 16);
|
|
5980
|
-
const r = integer >> 16 & 255;
|
|
5981
|
-
const g = integer >> 8 & 255;
|
|
5982
|
-
const b = integer & 255;
|
|
5983
|
-
return [r, g, b];
|
|
5984
|
-
};
|
|
5985
|
-
convert.rgb.hcg = function(rgb) {
|
|
5986
|
-
const r = rgb[0] / 255;
|
|
5987
|
-
const g = rgb[1] / 255;
|
|
5988
|
-
const b = rgb[2] / 255;
|
|
5989
|
-
const max = Math.max(Math.max(r, g), b);
|
|
5990
|
-
const min = Math.min(Math.min(r, g), b);
|
|
5991
|
-
const chroma = max - min;
|
|
5992
|
-
let grayscale;
|
|
5993
|
-
let hue;
|
|
5994
|
-
if (chroma < 1) {
|
|
5995
|
-
grayscale = min / (1 - chroma);
|
|
5996
|
-
} else {
|
|
5997
|
-
grayscale = 0;
|
|
5998
|
-
}
|
|
5999
|
-
if (chroma <= 0) {
|
|
6000
|
-
hue = 0;
|
|
6001
|
-
} else if (max === r) {
|
|
6002
|
-
hue = (g - b) / chroma % 6;
|
|
6003
|
-
} else if (max === g) {
|
|
6004
|
-
hue = 2 + (b - r) / chroma;
|
|
6005
|
-
} else {
|
|
6006
|
-
hue = 4 + (r - g) / chroma;
|
|
6007
|
-
}
|
|
6008
|
-
hue /= 6;
|
|
6009
|
-
hue %= 1;
|
|
6010
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
6011
|
-
};
|
|
6012
|
-
convert.hsl.hcg = function(hsl) {
|
|
6013
|
-
const s = hsl[1] / 100;
|
|
6014
|
-
const l = hsl[2] / 100;
|
|
6015
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
6016
|
-
let f = 0;
|
|
6017
|
-
if (c < 1) {
|
|
6018
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
6019
|
-
}
|
|
6020
|
-
return [hsl[0], c * 100, f * 100];
|
|
6021
|
-
};
|
|
6022
|
-
convert.hsv.hcg = function(hsv) {
|
|
6023
|
-
const s = hsv[1] / 100;
|
|
6024
|
-
const v = hsv[2] / 100;
|
|
6025
|
-
const c = s * v;
|
|
6026
|
-
let f = 0;
|
|
6027
|
-
if (c < 1) {
|
|
6028
|
-
f = (v - c) / (1 - c);
|
|
6029
|
-
}
|
|
6030
|
-
return [hsv[0], c * 100, f * 100];
|
|
6031
|
-
};
|
|
6032
|
-
convert.hcg.rgb = function(hcg) {
|
|
6033
|
-
const h = hcg[0] / 360;
|
|
6034
|
-
const c = hcg[1] / 100;
|
|
6035
|
-
const g = hcg[2] / 100;
|
|
6036
|
-
if (c === 0) {
|
|
6037
|
-
return [g * 255, g * 255, g * 255];
|
|
6038
|
-
}
|
|
6039
|
-
const pure = [0, 0, 0];
|
|
6040
|
-
const hi = h % 1 * 6;
|
|
6041
|
-
const v = hi % 1;
|
|
6042
|
-
const w = 1 - v;
|
|
6043
|
-
let mg = 0;
|
|
6044
|
-
switch (Math.floor(hi)) {
|
|
6045
|
-
case 0:
|
|
6046
|
-
pure[0] = 1;
|
|
6047
|
-
pure[1] = v;
|
|
6048
|
-
pure[2] = 0;
|
|
6049
|
-
break;
|
|
6050
|
-
case 1:
|
|
6051
|
-
pure[0] = w;
|
|
6052
|
-
pure[1] = 1;
|
|
6053
|
-
pure[2] = 0;
|
|
6054
|
-
break;
|
|
6055
|
-
case 2:
|
|
6056
|
-
pure[0] = 0;
|
|
6057
|
-
pure[1] = 1;
|
|
6058
|
-
pure[2] = v;
|
|
6059
|
-
break;
|
|
6060
|
-
case 3:
|
|
6061
|
-
pure[0] = 0;
|
|
6062
|
-
pure[1] = w;
|
|
6063
|
-
pure[2] = 1;
|
|
6064
|
-
break;
|
|
6065
|
-
case 4:
|
|
6066
|
-
pure[0] = v;
|
|
6067
|
-
pure[1] = 0;
|
|
6068
|
-
pure[2] = 1;
|
|
6069
|
-
break;
|
|
6070
|
-
default:
|
|
6071
|
-
pure[0] = 1;
|
|
6072
|
-
pure[1] = 0;
|
|
6073
|
-
pure[2] = w;
|
|
6074
|
-
}
|
|
6075
|
-
mg = (1 - c) * g;
|
|
6076
|
-
return [
|
|
6077
|
-
(c * pure[0] + mg) * 255,
|
|
6078
|
-
(c * pure[1] + mg) * 255,
|
|
6079
|
-
(c * pure[2] + mg) * 255
|
|
6080
|
-
];
|
|
6081
|
-
};
|
|
6082
|
-
convert.hcg.hsv = function(hcg) {
|
|
6083
|
-
const c = hcg[1] / 100;
|
|
6084
|
-
const g = hcg[2] / 100;
|
|
6085
|
-
const v = c + g * (1 - c);
|
|
6086
|
-
let f = 0;
|
|
6087
|
-
if (v > 0) {
|
|
6088
|
-
f = c / v;
|
|
6089
|
-
}
|
|
6090
|
-
return [hcg[0], f * 100, v * 100];
|
|
6091
|
-
};
|
|
6092
|
-
convert.hcg.hsl = function(hcg) {
|
|
6093
|
-
const c = hcg[1] / 100;
|
|
6094
|
-
const g = hcg[2] / 100;
|
|
6095
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
6096
|
-
let s = 0;
|
|
6097
|
-
if (l > 0 && l < 0.5) {
|
|
6098
|
-
s = c / (2 * l);
|
|
6099
|
-
} else if (l >= 0.5 && l < 1) {
|
|
6100
|
-
s = c / (2 * (1 - l));
|
|
6101
|
-
}
|
|
6102
|
-
return [hcg[0], s * 100, l * 100];
|
|
6103
|
-
};
|
|
6104
|
-
convert.hcg.hwb = function(hcg) {
|
|
6105
|
-
const c = hcg[1] / 100;
|
|
6106
|
-
const g = hcg[2] / 100;
|
|
6107
|
-
const v = c + g * (1 - c);
|
|
6108
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
6109
|
-
};
|
|
6110
|
-
convert.hwb.hcg = function(hwb) {
|
|
6111
|
-
const w = hwb[1] / 100;
|
|
6112
|
-
const b = hwb[2] / 100;
|
|
6113
|
-
const v = 1 - b;
|
|
6114
|
-
const c = v - w;
|
|
6115
|
-
let g = 0;
|
|
6116
|
-
if (c < 1) {
|
|
6117
|
-
g = (v - c) / (1 - c);
|
|
6118
|
-
}
|
|
6119
|
-
return [hwb[0], c * 100, g * 100];
|
|
6120
|
-
};
|
|
6121
|
-
convert.apple.rgb = function(apple) {
|
|
6122
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
6123
|
-
};
|
|
6124
|
-
convert.rgb.apple = function(rgb) {
|
|
6125
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
6126
|
-
};
|
|
6127
|
-
convert.gray.rgb = function(args) {
|
|
6128
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
6129
|
-
};
|
|
6130
|
-
convert.gray.hsl = function(args) {
|
|
6131
|
-
return [0, 0, args[0]];
|
|
6132
|
-
};
|
|
6133
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
6134
|
-
convert.gray.hwb = function(gray) {
|
|
6135
|
-
return [0, 100, gray[0]];
|
|
6136
|
-
};
|
|
6137
|
-
convert.gray.cmyk = function(gray) {
|
|
6138
|
-
return [0, 0, 0, gray[0]];
|
|
6139
|
-
};
|
|
6140
|
-
convert.gray.lab = function(gray) {
|
|
6141
|
-
return [gray[0], 0, 0];
|
|
6142
|
-
};
|
|
6143
|
-
convert.gray.hex = function(gray) {
|
|
6144
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
6145
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
6146
|
-
const string = integer.toString(16).toUpperCase();
|
|
6147
|
-
return "000000".substring(string.length) + string;
|
|
6148
|
-
};
|
|
6149
|
-
convert.rgb.gray = function(rgb) {
|
|
6150
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
6151
|
-
return [val / 255 * 100];
|
|
6152
|
-
};
|
|
6153
|
-
return conversions;
|
|
6154
|
-
}
|
|
6155
|
-
var route;
|
|
6156
|
-
var hasRequiredRoute;
|
|
6157
|
-
function requireRoute() {
|
|
6158
|
-
if (hasRequiredRoute) return route;
|
|
6159
|
-
hasRequiredRoute = 1;
|
|
6160
|
-
const conversions2 = requireConversions();
|
|
6161
|
-
function buildGraph() {
|
|
6162
|
-
const graph = {};
|
|
6163
|
-
const models = Object.keys(conversions2);
|
|
6164
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
6165
|
-
graph[models[i]] = {
|
|
6166
|
-
// http://jsperf.com/1-vs-infinity
|
|
6167
|
-
// micro-opt, but this is simple.
|
|
6168
|
-
distance: -1,
|
|
6169
|
-
parent: null
|
|
6170
|
-
};
|
|
6171
|
-
}
|
|
6172
|
-
return graph;
|
|
6173
|
-
}
|
|
6174
|
-
function deriveBFS(fromModel) {
|
|
6175
|
-
const graph = buildGraph();
|
|
6176
|
-
const queue = [fromModel];
|
|
6177
|
-
graph[fromModel].distance = 0;
|
|
6178
|
-
while (queue.length) {
|
|
6179
|
-
const current = queue.pop();
|
|
6180
|
-
const adjacents = Object.keys(conversions2[current]);
|
|
6181
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
6182
|
-
const adjacent = adjacents[i];
|
|
6183
|
-
const node = graph[adjacent];
|
|
6184
|
-
if (node.distance === -1) {
|
|
6185
|
-
node.distance = graph[current].distance + 1;
|
|
6186
|
-
node.parent = current;
|
|
6187
|
-
queue.unshift(adjacent);
|
|
6188
|
-
}
|
|
6189
|
-
}
|
|
6190
|
-
}
|
|
6191
|
-
return graph;
|
|
6192
|
-
}
|
|
6193
|
-
function link(from, to) {
|
|
6194
|
-
return function(args) {
|
|
6195
|
-
return to(from(args));
|
|
6196
|
-
};
|
|
6197
|
-
}
|
|
6198
|
-
function wrapConversion(toModel, graph) {
|
|
6199
|
-
const path = [graph[toModel].parent, toModel];
|
|
6200
|
-
let fn = conversions2[graph[toModel].parent][toModel];
|
|
6201
|
-
let cur = graph[toModel].parent;
|
|
6202
|
-
while (graph[cur].parent) {
|
|
6203
|
-
path.unshift(graph[cur].parent);
|
|
6204
|
-
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
6205
|
-
cur = graph[cur].parent;
|
|
6206
|
-
}
|
|
6207
|
-
fn.conversion = path;
|
|
6208
|
-
return fn;
|
|
6209
|
-
}
|
|
6210
|
-
route = function(fromModel) {
|
|
6211
|
-
const graph = deriveBFS(fromModel);
|
|
6212
|
-
const conversion = {};
|
|
6213
|
-
const models = Object.keys(graph);
|
|
6214
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
6215
|
-
const toModel = models[i];
|
|
6216
|
-
const node = graph[toModel];
|
|
6217
|
-
if (node.parent === null) {
|
|
6218
|
-
continue;
|
|
6219
|
-
}
|
|
6220
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
6221
|
-
}
|
|
6222
|
-
return conversion;
|
|
6223
|
-
};
|
|
6224
|
-
return route;
|
|
6225
|
-
}
|
|
6226
|
-
var colorConvert;
|
|
6227
|
-
var hasRequiredColorConvert;
|
|
6228
|
-
function requireColorConvert() {
|
|
6229
|
-
if (hasRequiredColorConvert) return colorConvert;
|
|
6230
|
-
hasRequiredColorConvert = 1;
|
|
6231
|
-
const conversions2 = requireConversions();
|
|
6232
|
-
const route2 = requireRoute();
|
|
6233
|
-
const convert = {};
|
|
6234
|
-
const models = Object.keys(conversions2);
|
|
6235
|
-
function wrapRaw(fn) {
|
|
6236
|
-
const wrappedFn = function(...args) {
|
|
6237
|
-
const arg0 = args[0];
|
|
6238
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
6239
|
-
return arg0;
|
|
6240
|
-
}
|
|
6241
|
-
if (arg0.length > 1) {
|
|
6242
|
-
args = arg0;
|
|
6243
|
-
}
|
|
6244
|
-
return fn(args);
|
|
6245
|
-
};
|
|
6246
|
-
if ("conversion" in fn) {
|
|
6247
|
-
wrappedFn.conversion = fn.conversion;
|
|
6248
|
-
}
|
|
6249
|
-
return wrappedFn;
|
|
6250
|
-
}
|
|
6251
|
-
function wrapRounded(fn) {
|
|
6252
|
-
const wrappedFn = function(...args) {
|
|
6253
|
-
const arg0 = args[0];
|
|
6254
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
6255
|
-
return arg0;
|
|
6256
|
-
}
|
|
6257
|
-
if (arg0.length > 1) {
|
|
6258
|
-
args = arg0;
|
|
6259
|
-
}
|
|
6260
|
-
const result = fn(args);
|
|
6261
|
-
if (typeof result === "object") {
|
|
6262
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
6263
|
-
result[i] = Math.round(result[i]);
|
|
6264
|
-
}
|
|
6265
|
-
}
|
|
6266
|
-
return result;
|
|
6267
|
-
};
|
|
6268
|
-
if ("conversion" in fn) {
|
|
6269
|
-
wrappedFn.conversion = fn.conversion;
|
|
6270
|
-
}
|
|
6271
|
-
return wrappedFn;
|
|
6272
|
-
}
|
|
6273
|
-
models.forEach((fromModel) => {
|
|
6274
|
-
convert[fromModel] = {};
|
|
6275
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
|
|
6276
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
|
|
6277
|
-
const routes = route2(fromModel);
|
|
6278
|
-
const routeModels = Object.keys(routes);
|
|
6279
|
-
routeModels.forEach((toModel) => {
|
|
6280
|
-
const fn = routes[toModel];
|
|
6281
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
6282
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
6283
|
-
});
|
|
6284
|
-
});
|
|
6285
|
-
colorConvert = convert;
|
|
6286
|
-
return colorConvert;
|
|
6287
|
-
}
|
|
6288
|
-
ansiStyles.exports;
|
|
6289
|
-
var hasRequiredAnsiStyles;
|
|
6290
|
-
function requireAnsiStyles() {
|
|
6291
|
-
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
6292
|
-
hasRequiredAnsiStyles = 1;
|
|
6293
|
-
(function(module2) {
|
|
6294
|
-
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
6295
|
-
const code = fn(...args);
|
|
6296
|
-
return `\x1B[${code + offset}m`;
|
|
6297
|
-
};
|
|
6298
|
-
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
6299
|
-
const code = fn(...args);
|
|
6300
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
6301
|
-
};
|
|
6302
|
-
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
6303
|
-
const rgb = fn(...args);
|
|
6304
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
6305
|
-
};
|
|
6306
|
-
const ansi2ansi = (n) => n;
|
|
6307
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
6308
|
-
const setLazyProperty = (object, property, get) => {
|
|
6309
|
-
Object.defineProperty(object, property, {
|
|
6310
|
-
get: () => {
|
|
6311
|
-
const value2 = get();
|
|
6312
|
-
Object.defineProperty(object, property, {
|
|
6313
|
-
value: value2,
|
|
6314
|
-
enumerable: true,
|
|
6315
|
-
configurable: true
|
|
6316
|
-
});
|
|
6317
|
-
return value2;
|
|
6318
|
-
},
|
|
6319
|
-
enumerable: true,
|
|
6320
|
-
configurable: true
|
|
6321
|
-
});
|
|
6322
|
-
};
|
|
6323
|
-
let colorConvert2;
|
|
6324
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
6325
|
-
if (colorConvert2 === void 0) {
|
|
6326
|
-
colorConvert2 = requireColorConvert();
|
|
6327
|
-
}
|
|
6328
|
-
const offset = isBackground ? 10 : 0;
|
|
6329
|
-
const styles = {};
|
|
6330
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
6331
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
6332
|
-
if (sourceSpace === targetSpace) {
|
|
6333
|
-
styles[name] = wrap(identity, offset);
|
|
6334
|
-
} else if (typeof suite === "object") {
|
|
6335
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
|
6336
|
-
}
|
|
6337
|
-
}
|
|
6338
|
-
return styles;
|
|
6339
|
-
};
|
|
6340
|
-
function assembleStyles() {
|
|
6341
|
-
const codes = /* @__PURE__ */ new Map();
|
|
6342
|
-
const styles = {
|
|
6343
|
-
modifier: {
|
|
6344
|
-
reset: [0, 0],
|
|
6345
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
6346
|
-
bold: [1, 22],
|
|
6347
|
-
dim: [2, 22],
|
|
6348
|
-
italic: [3, 23],
|
|
6349
|
-
underline: [4, 24],
|
|
6350
|
-
inverse: [7, 27],
|
|
6351
|
-
hidden: [8, 28],
|
|
6352
|
-
strikethrough: [9, 29]
|
|
6353
|
-
},
|
|
6354
|
-
color: {
|
|
6355
|
-
black: [30, 39],
|
|
6356
|
-
red: [31, 39],
|
|
6357
|
-
green: [32, 39],
|
|
6358
|
-
yellow: [33, 39],
|
|
6359
|
-
blue: [34, 39],
|
|
6360
|
-
magenta: [35, 39],
|
|
6361
|
-
cyan: [36, 39],
|
|
6362
|
-
white: [37, 39],
|
|
6363
|
-
// Bright color
|
|
6364
|
-
blackBright: [90, 39],
|
|
6365
|
-
redBright: [91, 39],
|
|
6366
|
-
greenBright: [92, 39],
|
|
6367
|
-
yellowBright: [93, 39],
|
|
6368
|
-
blueBright: [94, 39],
|
|
6369
|
-
magentaBright: [95, 39],
|
|
6370
|
-
cyanBright: [96, 39],
|
|
6371
|
-
whiteBright: [97, 39]
|
|
6372
|
-
},
|
|
6373
|
-
bgColor: {
|
|
6374
|
-
bgBlack: [40, 49],
|
|
6375
|
-
bgRed: [41, 49],
|
|
6376
|
-
bgGreen: [42, 49],
|
|
6377
|
-
bgYellow: [43, 49],
|
|
6378
|
-
bgBlue: [44, 49],
|
|
6379
|
-
bgMagenta: [45, 49],
|
|
6380
|
-
bgCyan: [46, 49],
|
|
6381
|
-
bgWhite: [47, 49],
|
|
6382
|
-
// Bright color
|
|
6383
|
-
bgBlackBright: [100, 49],
|
|
6384
|
-
bgRedBright: [101, 49],
|
|
6385
|
-
bgGreenBright: [102, 49],
|
|
6386
|
-
bgYellowBright: [103, 49],
|
|
6387
|
-
bgBlueBright: [104, 49],
|
|
6388
|
-
bgMagentaBright: [105, 49],
|
|
6389
|
-
bgCyanBright: [106, 49],
|
|
6390
|
-
bgWhiteBright: [107, 49]
|
|
6391
|
-
}
|
|
6392
|
-
};
|
|
6393
|
-
styles.color.gray = styles.color.blackBright;
|
|
6394
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
6395
|
-
styles.color.grey = styles.color.blackBright;
|
|
6396
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
6397
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
6398
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
6399
|
-
styles[styleName] = {
|
|
6400
|
-
open: `\x1B[${style[0]}m`,
|
|
6401
|
-
close: `\x1B[${style[1]}m`
|
|
6402
|
-
};
|
|
6403
|
-
group[styleName] = styles[styleName];
|
|
6404
|
-
codes.set(style[0], style[1]);
|
|
6405
|
-
}
|
|
6406
|
-
Object.defineProperty(styles, groupName, {
|
|
6407
|
-
value: group,
|
|
6408
|
-
enumerable: false
|
|
6409
|
-
});
|
|
6410
|
-
}
|
|
6411
|
-
Object.defineProperty(styles, "codes", {
|
|
6412
|
-
value: codes,
|
|
6413
|
-
enumerable: false
|
|
6414
|
-
});
|
|
6415
|
-
styles.color.close = "\x1B[39m";
|
|
6416
|
-
styles.bgColor.close = "\x1B[49m";
|
|
6417
|
-
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
6418
|
-
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
6419
|
-
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
6420
|
-
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
6421
|
-
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
6422
|
-
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
6423
|
-
return styles;
|
|
6424
|
-
}
|
|
6425
|
-
Object.defineProperty(module2, "exports", {
|
|
6426
|
-
enumerable: true,
|
|
6427
|
-
get: assembleStyles
|
|
6428
|
-
});
|
|
6429
|
-
})(ansiStyles);
|
|
6430
|
-
return ansiStyles.exports;
|
|
6431
|
-
}
|
|
6432
|
-
var browser;
|
|
6433
|
-
var hasRequiredBrowser;
|
|
6434
|
-
function requireBrowser() {
|
|
6435
|
-
if (hasRequiredBrowser) return browser;
|
|
6436
|
-
hasRequiredBrowser = 1;
|
|
6437
|
-
browser = {
|
|
6438
|
-
stdout: false,
|
|
6439
|
-
stderr: false
|
|
6440
|
-
};
|
|
6441
|
-
return browser;
|
|
6442
|
-
}
|
|
6443
|
-
var util;
|
|
6444
|
-
var hasRequiredUtil;
|
|
6445
|
-
function requireUtil() {
|
|
6446
|
-
if (hasRequiredUtil) return util;
|
|
6447
|
-
hasRequiredUtil = 1;
|
|
6448
|
-
const stringReplaceAll = (string, substring, replacer) => {
|
|
6449
|
-
let index = string.indexOf(substring);
|
|
6450
|
-
if (index === -1) {
|
|
6451
|
-
return string;
|
|
6452
|
-
}
|
|
6453
|
-
const substringLength = substring.length;
|
|
6454
|
-
let endIndex = 0;
|
|
6455
|
-
let returnValue = "";
|
|
6456
|
-
do {
|
|
6457
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
6458
|
-
endIndex = index + substringLength;
|
|
6459
|
-
index = string.indexOf(substring, endIndex);
|
|
6460
|
-
} while (index !== -1);
|
|
6461
|
-
returnValue += string.substr(endIndex);
|
|
6462
|
-
return returnValue;
|
|
6463
|
-
};
|
|
6464
|
-
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
6465
|
-
let endIndex = 0;
|
|
6466
|
-
let returnValue = "";
|
|
6467
|
-
do {
|
|
6468
|
-
const gotCR = string[index - 1] === "\r";
|
|
6469
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
6470
|
-
endIndex = index + 1;
|
|
6471
|
-
index = string.indexOf("\n", endIndex);
|
|
6472
|
-
} while (index !== -1);
|
|
6473
|
-
returnValue += string.substr(endIndex);
|
|
6474
|
-
return returnValue;
|
|
6475
|
-
};
|
|
6476
|
-
util = {
|
|
6477
|
-
stringReplaceAll,
|
|
6478
|
-
stringEncaseCRLFWithFirstIndex
|
|
6479
|
-
};
|
|
6480
|
-
return util;
|
|
6481
|
-
}
|
|
6482
|
-
var templates;
|
|
6483
|
-
var hasRequiredTemplates;
|
|
6484
|
-
function requireTemplates() {
|
|
6485
|
-
if (hasRequiredTemplates) return templates;
|
|
6486
|
-
hasRequiredTemplates = 1;
|
|
6487
|
-
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;
|
|
6488
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
6489
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
6490
|
-
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
6491
|
-
const ESCAPES = /* @__PURE__ */ new Map([
|
|
6492
|
-
["n", "\n"],
|
|
6493
|
-
["r", "\r"],
|
|
6494
|
-
["t", " "],
|
|
6495
|
-
["b", "\b"],
|
|
6496
|
-
["f", "\f"],
|
|
6497
|
-
["v", "\v"],
|
|
6498
|
-
["0", "\0"],
|
|
6499
|
-
["\\", "\\"],
|
|
6500
|
-
["e", "\x1B"],
|
|
6501
|
-
["a", "\x07"]
|
|
6502
|
-
]);
|
|
6503
|
-
function unescape(c) {
|
|
6504
|
-
const u = c[0] === "u";
|
|
6505
|
-
const bracket = c[1] === "{";
|
|
6506
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
6507
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
6508
|
-
}
|
|
6509
|
-
if (u && bracket) {
|
|
6510
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
6511
|
-
}
|
|
6512
|
-
return ESCAPES.get(c) || c;
|
|
6513
|
-
}
|
|
6514
|
-
function parseArguments(name, arguments_) {
|
|
6515
|
-
const results = [];
|
|
6516
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
6517
|
-
let matches;
|
|
6518
|
-
for (const chunk of chunks) {
|
|
6519
|
-
const number = Number(chunk);
|
|
6520
|
-
if (!Number.isNaN(number)) {
|
|
6521
|
-
results.push(number);
|
|
6522
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
6523
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
6524
|
-
} else {
|
|
6525
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
6526
|
-
}
|
|
6527
|
-
}
|
|
6528
|
-
return results;
|
|
6529
|
-
}
|
|
6530
|
-
function parseStyle(style) {
|
|
6531
|
-
STYLE_REGEX.lastIndex = 0;
|
|
6532
|
-
const results = [];
|
|
6533
|
-
let matches;
|
|
6534
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
6535
|
-
const name = matches[1];
|
|
6536
|
-
if (matches[2]) {
|
|
6537
|
-
const args = parseArguments(name, matches[2]);
|
|
6538
|
-
results.push([name].concat(args));
|
|
6539
|
-
} else {
|
|
6540
|
-
results.push([name]);
|
|
6541
|
-
}
|
|
6542
|
-
}
|
|
6543
|
-
return results;
|
|
6544
|
-
}
|
|
6545
|
-
function buildStyle(chalk2, styles) {
|
|
6546
|
-
const enabled = {};
|
|
6547
|
-
for (const layer of styles) {
|
|
6548
|
-
for (const style of layer.styles) {
|
|
6549
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
6550
|
-
}
|
|
6551
|
-
}
|
|
6552
|
-
let current = chalk2;
|
|
6553
|
-
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
6554
|
-
if (!Array.isArray(styles2)) {
|
|
6555
|
-
continue;
|
|
6556
|
-
}
|
|
6557
|
-
if (!(styleName in current)) {
|
|
6558
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
6559
|
-
}
|
|
6560
|
-
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
6561
|
-
}
|
|
6562
|
-
return current;
|
|
6563
|
-
}
|
|
6564
|
-
templates = (chalk2, temporary) => {
|
|
6565
|
-
const styles = [];
|
|
6566
|
-
const chunks = [];
|
|
6567
|
-
let chunk = [];
|
|
6568
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
6569
|
-
if (escapeCharacter) {
|
|
6570
|
-
chunk.push(unescape(escapeCharacter));
|
|
6571
|
-
} else if (style) {
|
|
6572
|
-
const string = chunk.join("");
|
|
6573
|
-
chunk = [];
|
|
6574
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
6575
|
-
styles.push({ inverse, styles: parseStyle(style) });
|
|
6576
|
-
} else if (close) {
|
|
6577
|
-
if (styles.length === 0) {
|
|
6578
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
6579
|
-
}
|
|
6580
|
-
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
6581
|
-
chunk = [];
|
|
6582
|
-
styles.pop();
|
|
6583
|
-
} else {
|
|
6584
|
-
chunk.push(character);
|
|
6585
|
-
}
|
|
6586
|
-
});
|
|
6587
|
-
chunks.push(chunk.join(""));
|
|
6588
|
-
if (styles.length > 0) {
|
|
6589
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
6590
|
-
throw new Error(errMessage);
|
|
6591
|
-
}
|
|
6592
|
-
return chunks.join("");
|
|
6593
|
-
};
|
|
6594
|
-
return templates;
|
|
6595
|
-
}
|
|
6596
|
-
var source;
|
|
6597
|
-
var hasRequiredSource;
|
|
6598
|
-
function requireSource() {
|
|
6599
|
-
if (hasRequiredSource) return source;
|
|
6600
|
-
hasRequiredSource = 1;
|
|
6601
|
-
const ansiStyles2 = requireAnsiStyles();
|
|
6602
|
-
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
6603
|
-
const {
|
|
6604
|
-
stringReplaceAll,
|
|
6605
|
-
stringEncaseCRLFWithFirstIndex
|
|
6606
|
-
} = requireUtil();
|
|
6607
|
-
const { isArray } = Array;
|
|
6608
|
-
const levelMapping = [
|
|
6609
|
-
"ansi",
|
|
6610
|
-
"ansi",
|
|
6611
|
-
"ansi256",
|
|
6612
|
-
"ansi16m"
|
|
6613
|
-
];
|
|
6614
|
-
const styles = /* @__PURE__ */ Object.create(null);
|
|
6615
|
-
const applyOptions = (object, options = {}) => {
|
|
6616
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
6617
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
6618
|
-
}
|
|
6619
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
6620
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
6621
|
-
};
|
|
6622
|
-
class ChalkClass {
|
|
6623
|
-
constructor(options) {
|
|
6624
|
-
return chalkFactory(options);
|
|
6625
|
-
}
|
|
6626
|
-
}
|
|
6627
|
-
const chalkFactory = (options) => {
|
|
6628
|
-
const chalk3 = {};
|
|
6629
|
-
applyOptions(chalk3, options);
|
|
6630
|
-
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
6631
|
-
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
6632
|
-
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
6633
|
-
chalk3.template.constructor = () => {
|
|
6634
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
6635
|
-
};
|
|
6636
|
-
chalk3.template.Instance = ChalkClass;
|
|
6637
|
-
return chalk3.template;
|
|
6638
|
-
};
|
|
6639
|
-
function Chalk(options) {
|
|
6640
|
-
return chalkFactory(options);
|
|
6641
|
-
}
|
|
6642
|
-
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
6643
|
-
styles[styleName] = {
|
|
6644
|
-
get() {
|
|
6645
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
6646
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
6647
|
-
return builder;
|
|
6648
|
-
}
|
|
6649
|
-
};
|
|
6650
|
-
}
|
|
6651
|
-
styles.visible = {
|
|
6652
|
-
get() {
|
|
6653
|
-
const builder = createBuilder(this, this._styler, true);
|
|
6654
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
6655
|
-
return builder;
|
|
6656
|
-
}
|
|
6657
|
-
};
|
|
6658
|
-
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
6659
|
-
for (const model of usedModels) {
|
|
6660
|
-
styles[model] = {
|
|
6661
|
-
get() {
|
|
6662
|
-
const { level } = this;
|
|
6663
|
-
return function(...arguments_) {
|
|
6664
|
-
const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
6665
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
6666
|
-
};
|
|
6667
|
-
}
|
|
6668
|
-
};
|
|
6669
|
-
}
|
|
6670
|
-
for (const model of usedModels) {
|
|
6671
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
6672
|
-
styles[bgModel] = {
|
|
6673
|
-
get() {
|
|
6674
|
-
const { level } = this;
|
|
6675
|
-
return function(...arguments_) {
|
|
6676
|
-
const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
6677
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
6678
|
-
};
|
|
6679
|
-
}
|
|
6680
|
-
};
|
|
6681
|
-
}
|
|
6682
|
-
const proto = Object.defineProperties(() => {
|
|
6683
|
-
}, {
|
|
6684
|
-
...styles,
|
|
6685
|
-
level: {
|
|
6686
|
-
enumerable: true,
|
|
6687
|
-
get() {
|
|
6688
|
-
return this._generator.level;
|
|
6689
|
-
},
|
|
6690
|
-
set(level) {
|
|
6691
|
-
this._generator.level = level;
|
|
6692
|
-
}
|
|
6693
|
-
}
|
|
6694
|
-
});
|
|
6695
|
-
const createStyler = (open, close, parent) => {
|
|
6696
|
-
let openAll;
|
|
6697
|
-
let closeAll;
|
|
6698
|
-
if (parent === void 0) {
|
|
6699
|
-
openAll = open;
|
|
6700
|
-
closeAll = close;
|
|
6701
|
-
} else {
|
|
6702
|
-
openAll = parent.openAll + open;
|
|
6703
|
-
closeAll = close + parent.closeAll;
|
|
6704
|
-
}
|
|
6705
|
-
return {
|
|
6706
|
-
open,
|
|
6707
|
-
close,
|
|
6708
|
-
openAll,
|
|
6709
|
-
closeAll,
|
|
6710
|
-
parent
|
|
6711
|
-
};
|
|
6712
|
-
};
|
|
6713
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
6714
|
-
const builder = (...arguments_) => {
|
|
6715
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
6716
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
6717
|
-
}
|
|
6718
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
6719
|
-
};
|
|
6720
|
-
Object.setPrototypeOf(builder, proto);
|
|
6721
|
-
builder._generator = self2;
|
|
6722
|
-
builder._styler = _styler;
|
|
6723
|
-
builder._isEmpty = _isEmpty;
|
|
6724
|
-
return builder;
|
|
6725
|
-
};
|
|
6726
|
-
const applyStyle = (self2, string) => {
|
|
6727
|
-
if (self2.level <= 0 || !string) {
|
|
6728
|
-
return self2._isEmpty ? "" : string;
|
|
6729
|
-
}
|
|
6730
|
-
let styler = self2._styler;
|
|
6731
|
-
if (styler === void 0) {
|
|
6732
|
-
return string;
|
|
6733
|
-
}
|
|
6734
|
-
const { openAll, closeAll } = styler;
|
|
6735
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
6736
|
-
while (styler !== void 0) {
|
|
6737
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
6738
|
-
styler = styler.parent;
|
|
6739
|
-
}
|
|
6740
|
-
}
|
|
6741
|
-
const lfIndex = string.indexOf("\n");
|
|
6742
|
-
if (lfIndex !== -1) {
|
|
6743
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
6744
|
-
}
|
|
6745
|
-
return openAll + string + closeAll;
|
|
6746
|
-
};
|
|
6747
|
-
let template;
|
|
6748
|
-
const chalkTag = (chalk3, ...strings) => {
|
|
6749
|
-
const [firstString] = strings;
|
|
6750
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
6751
|
-
return strings.join(" ");
|
|
6752
|
-
}
|
|
6753
|
-
const arguments_ = strings.slice(1);
|
|
6754
|
-
const parts2 = [firstString.raw[0]];
|
|
6755
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
6756
|
-
parts2.push(
|
|
6757
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
6758
|
-
String(firstString.raw[i])
|
|
6759
|
-
);
|
|
6760
|
-
}
|
|
6761
|
-
if (template === void 0) {
|
|
6762
|
-
template = requireTemplates();
|
|
6763
|
-
}
|
|
6764
|
-
return template(chalk3, parts2.join(""));
|
|
6765
|
-
};
|
|
6766
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
6767
|
-
const chalk2 = Chalk();
|
|
6768
|
-
chalk2.supportsColor = stdoutColor;
|
|
6769
|
-
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
6770
|
-
chalk2.stderr.supportsColor = stderrColor;
|
|
6771
|
-
source = chalk2;
|
|
6772
|
-
return source;
|
|
6773
|
-
}
|
|
6774
|
-
requireSource();
|
|
6775
|
-
const envOptions = {};
|
|
6776
|
-
function SetupConfig(envOptions2, logger) {
|
|
6777
|
-
const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
|
|
6778
|
-
dotenv.config({ path: envfile });
|
|
6779
|
-
const defconfig = {
|
|
6780
|
-
// Node runtime environment
|
|
6781
|
-
isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
|
|
6782
|
-
isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
|
|
6783
|
-
dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
|
|
6784
|
-
dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
|
|
6785
|
-
dbpasswordfile: process.env.DB_PASSWORD_FILE,
|
|
6786
|
-
dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
|
|
6787
|
-
database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
|
|
6788
|
-
databaseUrl: process.env.DATABASE_URL,
|
|
6789
|
-
connectionString: "",
|
|
6790
|
-
defaultDatabaseConnectionString: "",
|
|
6791
|
-
STSServerType: process.env.STS_SERVER_TYPE === void 0 ? "EXPRESS_TLS" : process.env.STS_SERVER_TYPE,
|
|
6792
|
-
logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
|
|
6793
|
-
logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
|
|
6794
|
-
logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
|
|
6795
|
-
poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
|
|
6796
|
-
useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
|
|
6797
|
-
respawnOnFail: process.env.RESPAWN === void 0 ? true : process.env.RESPAWN === "true" ? true : false,
|
|
6798
|
-
defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
|
|
6799
|
-
useRedisDatabaseCache: process.env.USE_REDIS_DATABASE_CACHE === void 0 ? false : process.env.USE_REDIS_DATABASE_CACHE === "true" ? true : false,
|
|
6800
|
-
useSocketIoRedisAdaptor: process.env.USE_SOCKET_IO_REDIS_ADAPTOR === void 0 ? false : process.env.USE_SOCKET_IO_REDIS_ADAPTOR === "true" ? true : false,
|
|
6801
|
-
socketIoRedisAdaptorUrl: process.env.SOCKET_IO_REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.SOCKET_IO_REDIS_ADAPTOR_URL,
|
|
6802
|
-
useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
|
|
6803
|
-
redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
|
|
6804
|
-
redisDatabaseCacheEndFlush: process.env.REDIS_DATABASE_CACHE_END_FLUSH === void 0 ? false : process.env.REDIS_DATABASE_CACHE_END_FLUSH === "true" ? true : false,
|
|
6805
|
-
redisDatabaseCacheUrl: process.env.REDIS_DATABASE_CACHE_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_DATABASE_CACHE_URL,
|
|
6806
|
-
defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
|
|
6807
|
-
defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
|
|
6808
|
-
rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
|
|
6809
|
-
rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
|
|
6810
|
-
rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
|
|
6811
|
-
rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
|
|
6812
|
-
rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
|
|
6813
|
-
rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
|
|
6814
|
-
rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
|
|
6815
|
-
rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
|
|
6816
|
-
stsfhirendpoint: process.env.STSFHIR_ENDPOINT === void 0 ? "https://localhost" : process.env.STSFHIR_ENDPOINT,
|
|
6817
|
-
stsfhirhostport: process.env.STSFHIR_HOST_PORT === void 0 ? "3005" : process.env.STSFHIR_HOST_PORT,
|
|
6818
|
-
stsfhirport: process.env.STSFHIR_PORT === void 0 ? "3005" : process.env.STSFHIR_PORT,
|
|
6819
|
-
stsfhirapiroot: process.env.STSFHIR_APIROOT === void 0 ? "/stsfhir/r5" : process.env.STSFHIR_APIROOT,
|
|
6820
|
-
stsfhirprometheussupport: process.env.STSFHIR_PROM_SUPPORT === void 0 ? true : process.env.STSFHIR_PROM_SUPPORT === "true" ? true : false,
|
|
6821
|
-
stsfhirprometheusclusterport: process.env.STSFHIR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.STSFHIR_PROM_CLUSTER_PORT,
|
|
6822
|
-
stsfhirservicename: process.env.STSFHIR_SERVICE_NAME === void 0 ? "STSFHIR" : process.env.STSFHIR_SERVICE_NAME,
|
|
6823
|
-
stsfhirserviceversion: process.env.STSFHIR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.STSFHIR_SERVICE_VERSION,
|
|
6824
|
-
ststccendpoint: process.env.STSTCC_ENDPOINT === void 0 ? "https://localhost" : process.env.STSTCC_ENDPOINT,
|
|
6825
|
-
ststcchostport: process.env.STSTCC_HOST_PORT === void 0 ? "3024" : process.env.STSTCC_HOST_PORT,
|
|
6826
|
-
ststccport: process.env.STSTCC_PORT === void 0 ? "3024" : process.env.STSTCC_PORT,
|
|
6827
|
-
ststccapiroot: process.env.STSTCC_APIROOT === void 0 ? "/ststcc/v1" : process.env.STSTCC_APIROOT,
|
|
6828
|
-
ststccprometheussupport: process.env.STSTCC_PROM_SUPPORT === void 0 ? true : process.env.STSTCC_PROM_SUPPORT === "true" ? true : false,
|
|
6829
|
-
ststccprometheusclusterport: process.env.STSTCC_PROM_CLUSTER_PORT === void 0 ? "3025" : process.env.STSTCC_PROM_CLUSTER_PORT,
|
|
6830
|
-
ststccservicename: process.env.STSTCC_SERVICE_NAME === void 0 ? "STSTCC" : process.env.STSTCC_SERVICE_NAME,
|
|
6831
|
-
ststccserviceversion: process.env.STSTCC_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.STSTCC_SERVICE_VERSION,
|
|
6832
|
-
imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
|
|
6833
|
-
imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
|
|
6834
|
-
import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
|
|
6835
|
-
imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
|
|
6836
|
-
imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
|
|
6837
|
-
imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
|
|
6838
|
-
imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
|
|
6839
|
-
imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
|
|
6840
|
-
imRedisKeepAliveProcessorUrl: process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL,
|
|
6841
|
-
imRedisMessageProcessorUrl: process.env.IM_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_MESSAGE_PROCESSOR_URL,
|
|
6842
|
-
asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
|
|
6843
|
-
ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
|
|
6844
|
-
asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
|
|
6845
|
-
asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
|
|
6846
|
-
asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
|
|
6847
|
-
asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
|
|
6848
|
-
asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
|
|
6849
|
-
asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
|
|
6850
|
-
asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
|
|
6851
|
-
asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
|
|
6852
|
-
asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
|
|
6853
|
-
asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
|
|
6854
|
-
asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
|
|
6855
|
-
asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
|
|
6856
|
-
asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
|
|
6857
|
-
authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
|
|
6858
|
-
authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
|
|
6859
|
-
authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
|
|
6860
|
-
authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
|
|
6861
|
-
brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
|
|
6862
|
-
brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
|
|
6863
|
-
brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
|
|
6864
|
-
brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
|
|
6865
|
-
brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
|
|
6866
|
-
brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
|
|
6867
|
-
brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
|
|
6868
|
-
brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
|
|
6869
|
-
trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
|
|
6870
|
-
trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
|
|
6871
|
-
trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
|
|
6872
|
-
trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
|
|
6873
|
-
trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
|
|
6874
|
-
trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
|
|
6875
|
-
trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
|
|
6876
|
-
trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
|
|
6877
|
-
trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
|
|
6878
|
-
trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
|
|
6879
|
-
trnRedisMessageProcessorUrl: process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL,
|
|
6880
|
-
lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
|
|
6881
|
-
lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
|
|
6882
|
-
lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
|
|
6883
|
-
lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
|
|
6884
|
-
lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
|
|
6885
|
-
lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
|
|
6886
|
-
lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
|
|
6887
|
-
lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
|
|
6888
|
-
publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
|
|
6889
|
-
publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
|
|
6890
|
-
transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
|
|
6891
|
-
useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
|
|
6892
|
-
keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
|
|
6893
|
-
maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
|
|
6894
|
-
maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
|
|
6895
|
-
maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
|
|
6896
|
-
timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
|
|
6897
|
-
maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
|
|
6898
|
-
instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
|
|
6899
|
-
instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
|
|
6900
|
-
authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
|
|
6901
|
-
authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
|
|
6902
|
-
authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
|
|
6903
|
-
masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
|
|
6904
|
-
childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
|
|
6905
|
-
systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
|
|
6906
|
-
ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
|
|
6907
|
-
httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
|
|
6908
|
-
httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
|
|
6909
|
-
tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
|
|
6910
|
-
jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
|
|
6911
|
-
jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
|
|
6912
|
-
jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
|
|
6913
|
-
jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
|
|
6914
|
-
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),
|
|
6915
|
-
jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
|
|
6916
|
-
influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
|
|
6917
|
-
influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
|
|
6918
|
-
influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
|
|
6919
|
-
influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
|
|
6920
|
-
influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
|
|
6921
|
-
influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
|
|
6922
|
-
influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
|
|
6923
|
-
influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
|
|
6924
|
-
influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
|
|
6925
|
-
influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
|
|
6926
|
-
influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
6927
|
-
influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
|
|
6928
|
-
kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
|
|
6929
|
-
kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
|
|
6930
|
-
kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
|
|
6931
|
-
kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
|
|
6932
|
-
kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
|
|
6933
|
-
kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
|
|
6934
|
-
kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
|
|
6935
|
-
kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
|
|
6936
|
-
kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
6937
|
-
kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
|
|
6938
|
-
kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
|
|
6939
|
-
kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
|
|
6940
|
-
kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
|
|
6941
|
-
observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
|
|
6942
|
-
stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
|
|
6943
|
-
};
|
|
6944
|
-
const ReadFile = (passwordFile) => {
|
|
6945
|
-
try {
|
|
6946
|
-
node_fs.accessSync(passwordFile, node_fs.constants.R_OK);
|
|
6947
|
-
const data = node_fs.readFileSync(passwordFile, "utf8");
|
|
6948
|
-
if (logger) ;
|
|
6949
|
-
return data;
|
|
6950
|
-
} catch (err) {
|
|
6951
|
-
return "";
|
|
6952
|
-
}
|
|
6953
|
-
};
|
|
6954
|
-
const fileconfig = [
|
|
6955
|
-
{ fileprop: "dbpasswordfile", prop: "dbpassword" },
|
|
6956
|
-
// JWKS secret file processing
|
|
6957
|
-
{ fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
|
|
6958
|
-
// InfluxDB file processing
|
|
6959
|
-
{ fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
|
|
6960
|
-
];
|
|
6961
|
-
fileconfig.forEach((v) => {
|
|
6962
|
-
if (defconfig[v.fileprop] !== void 0) {
|
|
6963
|
-
defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
|
|
6964
|
-
}
|
|
6965
|
-
});
|
|
6966
|
-
for (const [key, val] of Object.entries(defconfig)) {
|
|
6967
|
-
envOptions2[key] = val;
|
|
6968
|
-
}
|
|
6969
|
-
}
|
|
6970
|
-
function $SetupOptions(envOptions2) {
|
|
6971
|
-
SetupConfig(envOptions2);
|
|
6972
|
-
const options = envOptions2;
|
|
6973
|
-
if (options.dbhost) {
|
|
6974
|
-
const hosts = options.dbhost.split(",");
|
|
6975
|
-
envOptions2.connectionString = hosts.map((host) => {
|
|
6976
|
-
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
|
|
6977
|
-
}).join(",");
|
|
6978
|
-
envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
|
|
6979
|
-
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
|
|
6980
|
-
}).join(",");
|
|
6981
|
-
}
|
|
6982
|
-
}
|
|
6983
|
-
const envOptionsHandler = {
|
|
6984
|
-
get(target, prop, receiver) {
|
|
6985
|
-
if (Object.keys(target).length === 0) {
|
|
6986
|
-
$SetupOptions(target);
|
|
6987
|
-
}
|
|
6988
|
-
return Reflect.get(target, prop, receiver);
|
|
6989
|
-
}
|
|
6990
|
-
};
|
|
6991
|
-
const goptions = new Proxy(envOptions, envOptionsHandler);
|
|
6992
|
-
class FhirSocketClient {
|
|
6993
|
-
constructor(options) {
|
|
6994
|
-
__privateAdd(this, _socketUtils);
|
|
6995
|
-
__privateAdd(this, _id, v4());
|
|
6996
|
-
__privateAdd(this, _options2);
|
|
6997
|
-
__privateAdd(this, _debug, (message) => stsutils.defaultLogger.debug(message));
|
|
6998
|
-
__privateAdd(this, _error, (error) => stsutils.defaultLogger.error(error));
|
|
6999
|
-
__privateAdd(this, _info, (message) => stsutils.defaultLogger.info(message));
|
|
7000
|
-
__privateAdd(this, _SetupWSSClient, async (clientName, joinRooms) => {
|
|
7001
|
-
const cstr = `${__privateGet(this, _options2).fhirServerEndpoint}/nsstsfhir/`;
|
|
7002
|
-
__privateGet(this, _socketUtils).SetupClientSideSocket(
|
|
7003
|
-
__privateGet(this, _options2).socketClientName,
|
|
7004
|
-
// 'ststestrunner',
|
|
7005
|
-
cstr,
|
|
7006
|
-
// `https://stscore.stsmda.org:3005/nsstsfhir/` this.#options.ststccendpoint, stsfhir as the namespace
|
|
7007
|
-
// Connected Callback
|
|
7008
|
-
(socket2) => __privateGet(this, _OnSocketConnected).call(this, socket2, clientName, joinRooms),
|
|
7009
|
-
// Events Registration
|
|
7010
|
-
(socket2) => {
|
|
7011
|
-
},
|
|
7012
|
-
// Error Callback
|
|
7013
|
-
(error) => __privateGet(this, _error).call(this, `${clientName}: SetupClientSideSocket call back: [${error}]`)
|
|
7014
|
-
);
|
|
7015
|
-
});
|
|
7016
|
-
// Handle connection logic separately
|
|
7017
|
-
__privateAdd(this, _OnSocketConnected, (socket, clientName, joinRooms) => {
|
|
7018
|
-
__privateGet(this, _debug).call(this, chalk.green(`${__privateGet(this, _id)} ${clientName}: --> connected`));
|
|
7019
|
-
if (joinRooms.length > 0) {
|
|
7020
|
-
socket.emit("__STSjoinRoom", joinRooms);
|
|
5021
|
+
class FhirSocketClient {
|
|
5022
|
+
constructor(options) {
|
|
5023
|
+
__privateAdd(this, _socketUtils);
|
|
5024
|
+
__privateAdd(this, _id, v4());
|
|
5025
|
+
__privateAdd(this, _options2);
|
|
5026
|
+
__privateAdd(this, _debug, (message) => stsutils.defaultLogger.debug(message));
|
|
5027
|
+
__privateAdd(this, _error, (error) => stsutils.defaultLogger.error(error));
|
|
5028
|
+
__privateAdd(this, _info, (message) => stsutils.defaultLogger.info(message));
|
|
5029
|
+
__privateAdd(this, _SetupWSSClient, async (clientName, joinRooms) => {
|
|
5030
|
+
const cstr = `${__privateGet(this, _options2).fhirServerEndpoint}/nsstsfhir/`;
|
|
5031
|
+
__privateGet(this, _socketUtils).SetupClientSideSocket(
|
|
5032
|
+
__privateGet(this, _options2).socketClientName,
|
|
5033
|
+
// 'ststestrunner',
|
|
5034
|
+
cstr,
|
|
5035
|
+
// `https://stscore.stsmda.org:3005/nsstsfhir/` this.#options.ststccendpoint, stsfhir as the namespace
|
|
5036
|
+
// Connected Callback
|
|
5037
|
+
(socket2) => __privateGet(this, _OnSocketConnected).call(this, socket2, clientName, joinRooms),
|
|
5038
|
+
// Events Registration
|
|
5039
|
+
(socket2) => {
|
|
5040
|
+
},
|
|
5041
|
+
// Error Callback
|
|
5042
|
+
(error) => __privateGet(this, _error).call(this, `${clientName}: SetupClientSideSocket call back: [${error}]`)
|
|
5043
|
+
);
|
|
5044
|
+
});
|
|
5045
|
+
// Handle connection logic separately
|
|
5046
|
+
__privateAdd(this, _OnSocketConnected, (socket, clientName, joinRooms) => {
|
|
5047
|
+
__privateGet(this, _debug).call(this, chalk.green(`${__privateGet(this, _id)} ${clientName}: --> connected`));
|
|
5048
|
+
if (joinRooms.length > 0) {
|
|
5049
|
+
socket.emit("__STSjoinRoom", joinRooms);
|
|
7021
5050
|
}
|
|
7022
5051
|
});
|
|
7023
5052
|
__publicField(this, "CreateResource", async (resource, domainResource) => {
|
|
@@ -7249,28 +5278,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
7249
5278
|
return (await prom()).value;
|
|
7250
5279
|
});
|
|
7251
5280
|
__privateSet(this, _options2, options);
|
|
7252
|
-
|
|
7253
|
-
logger: stsutils.defaultLogger,
|
|
7254
|
-
agentManager: new stsutils.AgentManager({
|
|
7255
|
-
agentOptions: {
|
|
7256
|
-
keepAlive: goptions.keepAlive,
|
|
7257
|
-
maxSockets: goptions.maxSockets,
|
|
7258
|
-
maxTotalSockets: goptions.maxTotalSockets,
|
|
7259
|
-
maxFreeSockets: goptions.maxFreeSockets,
|
|
7260
|
-
timeout: 3e4,
|
|
7261
|
-
//@@ config
|
|
7262
|
-
rejectUnauthorized: goptions.isProduction
|
|
7263
|
-
// Allows self signed certs in non production mode(s)
|
|
7264
|
-
},
|
|
7265
|
-
httpAgentFactory(options2) {
|
|
7266
|
-
return new http.Agent(options2);
|
|
7267
|
-
},
|
|
7268
|
-
httpsAgentFactory(options2) {
|
|
7269
|
-
return new https.Agent(options2);
|
|
7270
|
-
}
|
|
7271
|
-
})
|
|
7272
|
-
};
|
|
7273
|
-
__privateSet(this, _socketUtils, new SocketIoClientHelper(socketUtilsoptions));
|
|
5281
|
+
__privateSet(this, _socketUtils, new SocketIoClientHelper(__privateGet(this, _options2).socketIoClientHelperOptions));
|
|
7274
5282
|
const clientName = v4();
|
|
7275
5283
|
setTimeout(() => {
|
|
7276
5284
|
__privateGet(this, _SetupWSSClient).call(this, clientName, []);
|