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