@nsshunt/stsfhirclient 1.0.29 → 1.0.31
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 +384 -359
- package/dist/stsfhirclient.mjs.map +1 -1
- package/dist/stsfhirclient.umd.js +399 -374
- package/dist/stsfhirclient.umd.js.map +1 -1
- package/package.json +9 -12
package/dist/stsfhirclient.mjs
CHANGED
|
@@ -11,34 +11,32 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _stsfhirapiroot, _LogDebugMessage, _LogErrorMessage, _HandleError, _InvokeResourceAPI, _TestMode, ___InvokeResourceAPI;
|
|
12
12
|
import axios from "axios";
|
|
13
13
|
import { Sleep, STSAxiosConfig } from "@nsshunt/stsutils";
|
|
14
|
-
|
|
15
|
-
for (
|
|
14
|
+
const byteToHex = [];
|
|
15
|
+
for (let i = 0; i < 256; ++i) {
|
|
16
16
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
17
17
|
}
|
|
18
18
|
function unsafeStringify(arr, offset = 0) {
|
|
19
19
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let getRandomValues;
|
|
22
|
+
const rnds8 = new Uint8Array(16);
|
|
23
23
|
function rng() {
|
|
24
24
|
if (!getRandomValues) {
|
|
25
|
-
|
|
26
|
-
if (!getRandomValues) {
|
|
25
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
27
26
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
28
27
|
}
|
|
28
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
29
29
|
}
|
|
30
30
|
return getRandomValues(rnds8);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
const native = {
|
|
34
|
-
randomUUID
|
|
35
|
-
};
|
|
32
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
33
|
+
const native = { randomUUID };
|
|
36
34
|
function v4(options, buf, offset) {
|
|
37
35
|
if (native.randomUUID && !buf && !options) {
|
|
38
36
|
return native.randomUUID();
|
|
39
37
|
}
|
|
40
38
|
options = options || {};
|
|
41
|
-
|
|
39
|
+
const rnds = options.random || (options.rng || rng)();
|
|
42
40
|
rnds[6] = rnds[6] & 15 | 64;
|
|
43
41
|
rnds[8] = rnds[8] & 63 | 128;
|
|
44
42
|
return unsafeStringify(rnds);
|
|
@@ -47,7 +45,7 @@ const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? p
|
|
|
47
45
|
function getDefaultExportFromCjs(x) {
|
|
48
46
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
49
47
|
}
|
|
50
|
-
var ansiStyles
|
|
48
|
+
var ansiStyles = { exports: {} };
|
|
51
49
|
var colorName;
|
|
52
50
|
var hasRequiredColorName;
|
|
53
51
|
function requireColorName() {
|
|
@@ -1010,181 +1008,200 @@ function requireColorConvert() {
|
|
|
1010
1008
|
colorConvert = convert;
|
|
1011
1009
|
return colorConvert;
|
|
1012
1010
|
}
|
|
1013
|
-
ansiStyles
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1053
|
-
if (sourceSpace === targetSpace) {
|
|
1054
|
-
styles2[name] = wrap(identity, offset);
|
|
1055
|
-
} else if (typeof suite === "object") {
|
|
1056
|
-
styles2[name] = wrap(suite[targetSpace], offset);
|
|
1011
|
+
ansiStyles.exports;
|
|
1012
|
+
var hasRequiredAnsiStyles;
|
|
1013
|
+
function requireAnsiStyles() {
|
|
1014
|
+
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
1015
|
+
hasRequiredAnsiStyles = 1;
|
|
1016
|
+
(function(module) {
|
|
1017
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1018
|
+
const code = fn(...args);
|
|
1019
|
+
return `\x1B[${code + offset}m`;
|
|
1020
|
+
};
|
|
1021
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1022
|
+
const code = fn(...args);
|
|
1023
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
1024
|
+
};
|
|
1025
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1026
|
+
const rgb = fn(...args);
|
|
1027
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1028
|
+
};
|
|
1029
|
+
const ansi2ansi = (n) => n;
|
|
1030
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
1031
|
+
const setLazyProperty = (object, property, get) => {
|
|
1032
|
+
Object.defineProperty(object, property, {
|
|
1033
|
+
get: () => {
|
|
1034
|
+
const value = get();
|
|
1035
|
+
Object.defineProperty(object, property, {
|
|
1036
|
+
value,
|
|
1037
|
+
enumerable: true,
|
|
1038
|
+
configurable: true
|
|
1039
|
+
});
|
|
1040
|
+
return value;
|
|
1041
|
+
},
|
|
1042
|
+
enumerable: true,
|
|
1043
|
+
configurable: true
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
let colorConvert2;
|
|
1047
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1048
|
+
if (colorConvert2 === void 0) {
|
|
1049
|
+
colorConvert2 = requireColorConvert();
|
|
1057
1050
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
bold: [1, 22],
|
|
1068
|
-
dim: [2, 22],
|
|
1069
|
-
italic: [3, 23],
|
|
1070
|
-
underline: [4, 24],
|
|
1071
|
-
inverse: [7, 27],
|
|
1072
|
-
hidden: [8, 28],
|
|
1073
|
-
strikethrough: [9, 29]
|
|
1074
|
-
},
|
|
1075
|
-
color: {
|
|
1076
|
-
black: [30, 39],
|
|
1077
|
-
red: [31, 39],
|
|
1078
|
-
green: [32, 39],
|
|
1079
|
-
yellow: [33, 39],
|
|
1080
|
-
blue: [34, 39],
|
|
1081
|
-
magenta: [35, 39],
|
|
1082
|
-
cyan: [36, 39],
|
|
1083
|
-
white: [37, 39],
|
|
1084
|
-
// Bright color
|
|
1085
|
-
blackBright: [90, 39],
|
|
1086
|
-
redBright: [91, 39],
|
|
1087
|
-
greenBright: [92, 39],
|
|
1088
|
-
yellowBright: [93, 39],
|
|
1089
|
-
blueBright: [94, 39],
|
|
1090
|
-
magentaBright: [95, 39],
|
|
1091
|
-
cyanBright: [96, 39],
|
|
1092
|
-
whiteBright: [97, 39]
|
|
1093
|
-
},
|
|
1094
|
-
bgColor: {
|
|
1095
|
-
bgBlack: [40, 49],
|
|
1096
|
-
bgRed: [41, 49],
|
|
1097
|
-
bgGreen: [42, 49],
|
|
1098
|
-
bgYellow: [43, 49],
|
|
1099
|
-
bgBlue: [44, 49],
|
|
1100
|
-
bgMagenta: [45, 49],
|
|
1101
|
-
bgCyan: [46, 49],
|
|
1102
|
-
bgWhite: [47, 49],
|
|
1103
|
-
// Bright color
|
|
1104
|
-
bgBlackBright: [100, 49],
|
|
1105
|
-
bgRedBright: [101, 49],
|
|
1106
|
-
bgGreenBright: [102, 49],
|
|
1107
|
-
bgYellowBright: [103, 49],
|
|
1108
|
-
bgBlueBright: [104, 49],
|
|
1109
|
-
bgMagentaBright: [105, 49],
|
|
1110
|
-
bgCyanBright: [106, 49],
|
|
1111
|
-
bgWhiteBright: [107, 49]
|
|
1051
|
+
const offset = isBackground ? 10 : 0;
|
|
1052
|
+
const styles = {};
|
|
1053
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
1054
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1055
|
+
if (sourceSpace === targetSpace) {
|
|
1056
|
+
styles[name] = wrap(identity, offset);
|
|
1057
|
+
} else if (typeof suite === "object") {
|
|
1058
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
1059
|
+
}
|
|
1112
1060
|
}
|
|
1061
|
+
return styles;
|
|
1113
1062
|
};
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1063
|
+
function assembleStyles() {
|
|
1064
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1065
|
+
const styles = {
|
|
1066
|
+
modifier: {
|
|
1067
|
+
reset: [0, 0],
|
|
1068
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1069
|
+
bold: [1, 22],
|
|
1070
|
+
dim: [2, 22],
|
|
1071
|
+
italic: [3, 23],
|
|
1072
|
+
underline: [4, 24],
|
|
1073
|
+
inverse: [7, 27],
|
|
1074
|
+
hidden: [8, 28],
|
|
1075
|
+
strikethrough: [9, 29]
|
|
1076
|
+
},
|
|
1077
|
+
color: {
|
|
1078
|
+
black: [30, 39],
|
|
1079
|
+
red: [31, 39],
|
|
1080
|
+
green: [32, 39],
|
|
1081
|
+
yellow: [33, 39],
|
|
1082
|
+
blue: [34, 39],
|
|
1083
|
+
magenta: [35, 39],
|
|
1084
|
+
cyan: [36, 39],
|
|
1085
|
+
white: [37, 39],
|
|
1086
|
+
// Bright color
|
|
1087
|
+
blackBright: [90, 39],
|
|
1088
|
+
redBright: [91, 39],
|
|
1089
|
+
greenBright: [92, 39],
|
|
1090
|
+
yellowBright: [93, 39],
|
|
1091
|
+
blueBright: [94, 39],
|
|
1092
|
+
magentaBright: [95, 39],
|
|
1093
|
+
cyanBright: [96, 39],
|
|
1094
|
+
whiteBright: [97, 39]
|
|
1095
|
+
},
|
|
1096
|
+
bgColor: {
|
|
1097
|
+
bgBlack: [40, 49],
|
|
1098
|
+
bgRed: [41, 49],
|
|
1099
|
+
bgGreen: [42, 49],
|
|
1100
|
+
bgYellow: [43, 49],
|
|
1101
|
+
bgBlue: [44, 49],
|
|
1102
|
+
bgMagenta: [45, 49],
|
|
1103
|
+
bgCyan: [46, 49],
|
|
1104
|
+
bgWhite: [47, 49],
|
|
1105
|
+
// Bright color
|
|
1106
|
+
bgBlackBright: [100, 49],
|
|
1107
|
+
bgRedBright: [101, 49],
|
|
1108
|
+
bgGreenBright: [102, 49],
|
|
1109
|
+
bgYellowBright: [103, 49],
|
|
1110
|
+
bgBlueBright: [104, 49],
|
|
1111
|
+
bgMagentaBright: [105, 49],
|
|
1112
|
+
bgCyanBright: [106, 49],
|
|
1113
|
+
bgWhiteBright: [107, 49]
|
|
1114
|
+
}
|
|
1115
|
+
};
|
|
1116
|
+
styles.color.gray = styles.color.blackBright;
|
|
1117
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1118
|
+
styles.color.grey = styles.color.blackBright;
|
|
1119
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1120
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1121
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1122
|
+
styles[styleName] = {
|
|
1123
|
+
open: `\x1B[${style[0]}m`,
|
|
1124
|
+
close: `\x1B[${style[1]}m`
|
|
1125
|
+
};
|
|
1126
|
+
group[styleName] = styles[styleName];
|
|
1127
|
+
codes.set(style[0], style[1]);
|
|
1128
|
+
}
|
|
1129
|
+
Object.defineProperty(styles, groupName, {
|
|
1130
|
+
value: group,
|
|
1131
|
+
enumerable: false
|
|
1132
|
+
});
|
|
1126
1133
|
}
|
|
1127
|
-
Object.defineProperty(
|
|
1128
|
-
value:
|
|
1134
|
+
Object.defineProperty(styles, "codes", {
|
|
1135
|
+
value: codes,
|
|
1129
1136
|
enumerable: false
|
|
1130
1137
|
});
|
|
1138
|
+
styles.color.close = "\x1B[39m";
|
|
1139
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1140
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1141
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1142
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1143
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1144
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1145
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1146
|
+
return styles;
|
|
1131
1147
|
}
|
|
1132
|
-
Object.defineProperty(
|
|
1133
|
-
|
|
1134
|
-
|
|
1148
|
+
Object.defineProperty(module, "exports", {
|
|
1149
|
+
enumerable: true,
|
|
1150
|
+
get: assembleStyles
|
|
1135
1151
|
});
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
var
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1152
|
+
})(ansiStyles);
|
|
1153
|
+
return ansiStyles.exports;
|
|
1154
|
+
}
|
|
1155
|
+
var browser;
|
|
1156
|
+
var hasRequiredBrowser;
|
|
1157
|
+
function requireBrowser() {
|
|
1158
|
+
if (hasRequiredBrowser) return browser;
|
|
1159
|
+
hasRequiredBrowser = 1;
|
|
1160
|
+
browser = {
|
|
1161
|
+
stdout: false,
|
|
1162
|
+
stderr: false
|
|
1163
|
+
};
|
|
1164
|
+
return browser;
|
|
1165
|
+
}
|
|
1166
|
+
var util;
|
|
1167
|
+
var hasRequiredUtil;
|
|
1168
|
+
function requireUtil() {
|
|
1169
|
+
if (hasRequiredUtil) return util;
|
|
1170
|
+
hasRequiredUtil = 1;
|
|
1171
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
1172
|
+
let index = string.indexOf(substring);
|
|
1173
|
+
if (index === -1) {
|
|
1174
|
+
return string;
|
|
1175
|
+
}
|
|
1176
|
+
const substringLength = substring.length;
|
|
1177
|
+
let endIndex = 0;
|
|
1178
|
+
let returnValue = "";
|
|
1179
|
+
do {
|
|
1180
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1181
|
+
endIndex = index + substringLength;
|
|
1182
|
+
index = string.indexOf(substring, endIndex);
|
|
1183
|
+
} while (index !== -1);
|
|
1184
|
+
returnValue += string.substr(endIndex);
|
|
1185
|
+
return returnValue;
|
|
1186
|
+
};
|
|
1187
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1188
|
+
let endIndex = 0;
|
|
1189
|
+
let returnValue = "";
|
|
1190
|
+
do {
|
|
1191
|
+
const gotCR = string[index - 1] === "\r";
|
|
1192
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1193
|
+
endIndex = index + 1;
|
|
1194
|
+
index = string.indexOf("\n", endIndex);
|
|
1195
|
+
} while (index !== -1);
|
|
1196
|
+
returnValue += string.substr(endIndex);
|
|
1197
|
+
return returnValue;
|
|
1198
|
+
};
|
|
1199
|
+
util = {
|
|
1200
|
+
stringReplaceAll,
|
|
1201
|
+
stringEncaseCRLFWithFirstIndex
|
|
1202
|
+
};
|
|
1203
|
+
return util;
|
|
1204
|
+
}
|
|
1188
1205
|
var templates;
|
|
1189
1206
|
var hasRequiredTemplates;
|
|
1190
1207
|
function requireTemplates() {
|
|
@@ -1248,27 +1265,27 @@ function requireTemplates() {
|
|
|
1248
1265
|
}
|
|
1249
1266
|
return results;
|
|
1250
1267
|
}
|
|
1251
|
-
function buildStyle(chalk2,
|
|
1268
|
+
function buildStyle(chalk2, styles) {
|
|
1252
1269
|
const enabled = {};
|
|
1253
|
-
for (const layer of
|
|
1270
|
+
for (const layer of styles) {
|
|
1254
1271
|
for (const style of layer.styles) {
|
|
1255
1272
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1256
1273
|
}
|
|
1257
1274
|
}
|
|
1258
1275
|
let current = chalk2;
|
|
1259
|
-
for (const [styleName,
|
|
1260
|
-
if (!Array.isArray(
|
|
1276
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1277
|
+
if (!Array.isArray(styles2)) {
|
|
1261
1278
|
continue;
|
|
1262
1279
|
}
|
|
1263
1280
|
if (!(styleName in current)) {
|
|
1264
1281
|
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1265
1282
|
}
|
|
1266
|
-
current =
|
|
1283
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1267
1284
|
}
|
|
1268
1285
|
return current;
|
|
1269
1286
|
}
|
|
1270
1287
|
templates = (chalk2, temporary) => {
|
|
1271
|
-
const
|
|
1288
|
+
const styles = [];
|
|
1272
1289
|
const chunks = [];
|
|
1273
1290
|
let chunk = [];
|
|
1274
1291
|
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -1277,200 +1294,208 @@ function requireTemplates() {
|
|
|
1277
1294
|
} else if (style) {
|
|
1278
1295
|
const string = chunk.join("");
|
|
1279
1296
|
chunk = [];
|
|
1280
|
-
chunks.push(
|
|
1281
|
-
|
|
1297
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
1298
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
1282
1299
|
} else if (close) {
|
|
1283
|
-
if (
|
|
1300
|
+
if (styles.length === 0) {
|
|
1284
1301
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
1285
1302
|
}
|
|
1286
|
-
chunks.push(buildStyle(chalk2,
|
|
1303
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
1287
1304
|
chunk = [];
|
|
1288
|
-
|
|
1305
|
+
styles.pop();
|
|
1289
1306
|
} else {
|
|
1290
1307
|
chunk.push(character);
|
|
1291
1308
|
}
|
|
1292
1309
|
});
|
|
1293
1310
|
chunks.push(chunk.join(""));
|
|
1294
|
-
if (
|
|
1295
|
-
const errMessage = `Chalk template literal is missing ${
|
|
1311
|
+
if (styles.length > 0) {
|
|
1312
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1296
1313
|
throw new Error(errMessage);
|
|
1297
1314
|
}
|
|
1298
1315
|
return chunks.join("");
|
|
1299
1316
|
};
|
|
1300
1317
|
return templates;
|
|
1301
1318
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
const {
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
+
var source;
|
|
1320
|
+
var hasRequiredSource;
|
|
1321
|
+
function requireSource() {
|
|
1322
|
+
if (hasRequiredSource) return source;
|
|
1323
|
+
hasRequiredSource = 1;
|
|
1324
|
+
const ansiStyles2 = requireAnsiStyles();
|
|
1325
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
1326
|
+
const {
|
|
1327
|
+
stringReplaceAll,
|
|
1328
|
+
stringEncaseCRLFWithFirstIndex
|
|
1329
|
+
} = requireUtil();
|
|
1330
|
+
const { isArray } = Array;
|
|
1331
|
+
const levelMapping = [
|
|
1332
|
+
"ansi",
|
|
1333
|
+
"ansi",
|
|
1334
|
+
"ansi256",
|
|
1335
|
+
"ansi16m"
|
|
1336
|
+
];
|
|
1337
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
1338
|
+
const applyOptions = (object, options = {}) => {
|
|
1339
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1340
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1341
|
+
}
|
|
1342
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1343
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1344
|
+
};
|
|
1345
|
+
class ChalkClass {
|
|
1346
|
+
constructor(options) {
|
|
1347
|
+
return chalkFactory(options);
|
|
1348
|
+
}
|
|
1319
1349
|
}
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1350
|
+
const chalkFactory = (options) => {
|
|
1351
|
+
const chalk3 = {};
|
|
1352
|
+
applyOptions(chalk3, options);
|
|
1353
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
1354
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
1355
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
1356
|
+
chalk3.template.constructor = () => {
|
|
1357
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1358
|
+
};
|
|
1359
|
+
chalk3.template.Instance = ChalkClass;
|
|
1360
|
+
return chalk3.template;
|
|
1361
|
+
};
|
|
1362
|
+
function Chalk(options) {
|
|
1325
1363
|
return chalkFactory(options);
|
|
1326
1364
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
chalk2.template.Instance = ChalkClass;
|
|
1338
|
-
return chalk2.template;
|
|
1339
|
-
};
|
|
1340
|
-
function Chalk(options) {
|
|
1341
|
-
return chalkFactory(options);
|
|
1342
|
-
}
|
|
1343
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1344
|
-
styles[styleName] = {
|
|
1365
|
+
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
1366
|
+
styles[styleName] = {
|
|
1367
|
+
get() {
|
|
1368
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1369
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1370
|
+
return builder;
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
styles.visible = {
|
|
1345
1375
|
get() {
|
|
1346
|
-
const builder = createBuilder(this,
|
|
1347
|
-
Object.defineProperty(this,
|
|
1376
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1377
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1348
1378
|
return builder;
|
|
1349
1379
|
}
|
|
1350
1380
|
};
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1381
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1382
|
+
for (const model of usedModels) {
|
|
1383
|
+
styles[model] = {
|
|
1384
|
+
get() {
|
|
1385
|
+
const { level } = this;
|
|
1386
|
+
return function(...arguments_) {
|
|
1387
|
+
const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
1388
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1357
1392
|
}
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1393
|
+
for (const model of usedModels) {
|
|
1394
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1395
|
+
styles[bgModel] = {
|
|
1396
|
+
get() {
|
|
1397
|
+
const { level } = this;
|
|
1398
|
+
return function(...arguments_) {
|
|
1399
|
+
const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
1400
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
const proto = Object.defineProperties(() => {
|
|
1406
|
+
}, {
|
|
1407
|
+
...styles,
|
|
1408
|
+
level: {
|
|
1409
|
+
enumerable: true,
|
|
1410
|
+
get() {
|
|
1411
|
+
return this._generator.level;
|
|
1412
|
+
},
|
|
1413
|
+
set(level) {
|
|
1414
|
+
this._generator.level = level;
|
|
1415
|
+
}
|
|
1368
1416
|
}
|
|
1369
|
-
};
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
};
|
|
1417
|
+
});
|
|
1418
|
+
const createStyler = (open, close, parent) => {
|
|
1419
|
+
let openAll;
|
|
1420
|
+
let closeAll;
|
|
1421
|
+
if (parent === void 0) {
|
|
1422
|
+
openAll = open;
|
|
1423
|
+
closeAll = close;
|
|
1424
|
+
} else {
|
|
1425
|
+
openAll = parent.openAll + open;
|
|
1426
|
+
closeAll = close + parent.closeAll;
|
|
1380
1427
|
}
|
|
1428
|
+
return {
|
|
1429
|
+
open,
|
|
1430
|
+
close,
|
|
1431
|
+
openAll,
|
|
1432
|
+
closeAll,
|
|
1433
|
+
parent
|
|
1434
|
+
};
|
|
1381
1435
|
};
|
|
1382
|
-
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
const createStyler = (open, close, parent) => {
|
|
1397
|
-
let openAll;
|
|
1398
|
-
let closeAll;
|
|
1399
|
-
if (parent === void 0) {
|
|
1400
|
-
openAll = open;
|
|
1401
|
-
closeAll = close;
|
|
1402
|
-
} else {
|
|
1403
|
-
openAll = parent.openAll + open;
|
|
1404
|
-
closeAll = close + parent.closeAll;
|
|
1405
|
-
}
|
|
1406
|
-
return {
|
|
1407
|
-
open,
|
|
1408
|
-
close,
|
|
1409
|
-
openAll,
|
|
1410
|
-
closeAll,
|
|
1411
|
-
parent
|
|
1436
|
+
const createBuilder = (self, _styler, _isEmpty) => {
|
|
1437
|
+
const builder = (...arguments_) => {
|
|
1438
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1439
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1440
|
+
}
|
|
1441
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1442
|
+
};
|
|
1443
|
+
Object.setPrototypeOf(builder, proto);
|
|
1444
|
+
builder._generator = self;
|
|
1445
|
+
builder._styler = _styler;
|
|
1446
|
+
builder._isEmpty = _isEmpty;
|
|
1447
|
+
return builder;
|
|
1412
1448
|
};
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1449
|
+
const applyStyle = (self, string) => {
|
|
1450
|
+
if (self.level <= 0 || !string) {
|
|
1451
|
+
return self._isEmpty ? "" : string;
|
|
1452
|
+
}
|
|
1453
|
+
let styler = self._styler;
|
|
1454
|
+
if (styler === void 0) {
|
|
1455
|
+
return string;
|
|
1456
|
+
}
|
|
1457
|
+
const { openAll, closeAll } = styler;
|
|
1458
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
1459
|
+
while (styler !== void 0) {
|
|
1460
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1461
|
+
styler = styler.parent;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
const lfIndex = string.indexOf("\n");
|
|
1465
|
+
if (lfIndex !== -1) {
|
|
1466
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1418
1467
|
}
|
|
1419
|
-
return
|
|
1468
|
+
return openAll + string + closeAll;
|
|
1420
1469
|
};
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
};
|
|
1427
|
-
const applyStyle = (self, string) => {
|
|
1428
|
-
if (self.level <= 0 || !string) {
|
|
1429
|
-
return self._isEmpty ? "" : string;
|
|
1430
|
-
}
|
|
1431
|
-
let styler = self._styler;
|
|
1432
|
-
if (styler === void 0) {
|
|
1433
|
-
return string;
|
|
1434
|
-
}
|
|
1435
|
-
const { openAll, closeAll } = styler;
|
|
1436
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
1437
|
-
while (styler !== void 0) {
|
|
1438
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1439
|
-
styler = styler.parent;
|
|
1470
|
+
let template;
|
|
1471
|
+
const chalkTag = (chalk3, ...strings) => {
|
|
1472
|
+
const [firstString] = strings;
|
|
1473
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1474
|
+
return strings.join(" ");
|
|
1440
1475
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
return
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
}
|
|
1465
|
-
return template(chalk2, parts.join(""));
|
|
1466
|
-
};
|
|
1467
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
1468
|
-
const chalk = Chalk();
|
|
1469
|
-
chalk.supportsColor = stdoutColor;
|
|
1470
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1471
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
1472
|
-
var source = chalk;
|
|
1473
|
-
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
1476
|
+
const arguments_ = strings.slice(1);
|
|
1477
|
+
const parts = [firstString.raw[0]];
|
|
1478
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
1479
|
+
parts.push(
|
|
1480
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1481
|
+
String(firstString.raw[i])
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1484
|
+
if (template === void 0) {
|
|
1485
|
+
template = requireTemplates();
|
|
1486
|
+
}
|
|
1487
|
+
return template(chalk3, parts.join(""));
|
|
1488
|
+
};
|
|
1489
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1490
|
+
const chalk2 = Chalk();
|
|
1491
|
+
chalk2.supportsColor = stdoutColor;
|
|
1492
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1493
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
1494
|
+
source = chalk2;
|
|
1495
|
+
return source;
|
|
1496
|
+
}
|
|
1497
|
+
var sourceExports = requireSource();
|
|
1498
|
+
const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
|
|
1474
1499
|
var StatusCodes;
|
|
1475
1500
|
(function(StatusCodes2) {
|
|
1476
1501
|
StatusCodes2[StatusCodes2["CONTINUE"] = 100] = "CONTINUE";
|
|
@@ -1556,28 +1581,28 @@ class FhirClient {
|
|
|
1556
1581
|
});
|
|
1557
1582
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1558
1583
|
__privateAdd(this, _HandleError, (error) => {
|
|
1559
|
-
__privateGet(this, _LogDebugMessage).call(this, chalk
|
|
1584
|
+
__privateGet(this, _LogDebugMessage).call(this, chalk.red(`HandleError(): Error: [${error}]`));
|
|
1560
1585
|
let responseCode = 500;
|
|
1561
1586
|
if (axios.isAxiosError(error)) {
|
|
1562
1587
|
const axiosError = error;
|
|
1563
1588
|
if (axiosError.response) {
|
|
1564
1589
|
responseCode = axiosError.response.status;
|
|
1565
|
-
__privateGet(this, _LogDebugMessage).call(this, chalk
|
|
1590
|
+
__privateGet(this, _LogDebugMessage).call(this, chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
|
|
1566
1591
|
if (axiosError.response.headers) {
|
|
1567
|
-
__privateGet(this, _LogErrorMessage).call(this, chalk
|
|
1592
|
+
__privateGet(this, _LogErrorMessage).call(this, chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
|
|
1568
1593
|
}
|
|
1569
1594
|
if (axiosError.response.data) {
|
|
1570
|
-
__privateGet(this, _LogErrorMessage).call(this, chalk
|
|
1595
|
+
__privateGet(this, _LogErrorMessage).call(this, chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
|
|
1571
1596
|
}
|
|
1572
1597
|
try {
|
|
1573
1598
|
if (axiosError.response.config) {
|
|
1574
|
-
__privateGet(this, _LogErrorMessage).call(this, chalk
|
|
1599
|
+
__privateGet(this, _LogErrorMessage).call(this, chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
|
|
1575
1600
|
}
|
|
1576
1601
|
} catch (innererror) {
|
|
1577
|
-
__privateGet(this, _LogErrorMessage).call(this, chalk
|
|
1602
|
+
__privateGet(this, _LogErrorMessage).call(this, chalk.red(` could not get response config, error: [${innererror}]`));
|
|
1578
1603
|
}
|
|
1579
1604
|
} else {
|
|
1580
|
-
__privateGet(this, _LogDebugMessage).call(this, chalk
|
|
1605
|
+
__privateGet(this, _LogDebugMessage).call(this, chalk.red(`AXIOS Error = [${axiosError}]`));
|
|
1581
1606
|
}
|
|
1582
1607
|
}
|
|
1583
1608
|
return responseCode;
|
|
@@ -1598,18 +1623,18 @@ class FhirClient {
|
|
|
1598
1623
|
const metadataRecord = __privateGet(this, _invokeMethods)[id2];
|
|
1599
1624
|
let performRetry = false;
|
|
1600
1625
|
const returnData = await __privateGet(this, ___InvokeResourceAPI).call(this, metadataRecord, (statusCode, error) => {
|
|
1601
|
-
console.error(chalk
|
|
1626
|
+
console.error(chalk.red(`#InvokeResourceAPI(): Error: [${error}], Attempt: [${metadataRecord.retries + 1}]`));
|
|
1602
1627
|
const noRetryIndex = __privateGet(this, _NoRetryStatusCodes).indexOf(statusCode);
|
|
1603
1628
|
if (noRetryIndex === -1) {
|
|
1604
1629
|
if (statusCode === StatusCodes.UNAUTHORIZED) {
|
|
1605
|
-
console.error(chalk
|
|
1630
|
+
console.error(chalk.red(`#InvokeResourceAPI(): Authentication error, resetting access_token (to null).`));
|
|
1606
1631
|
__privateGet(this, _options).ResetAccessToken();
|
|
1607
1632
|
if (__privateGet(this, _options).clientTelemetryEvents) {
|
|
1608
1633
|
__privateGet(this, _options).clientTelemetryEvents.AuthenticationErrorInc();
|
|
1609
1634
|
}
|
|
1610
1635
|
}
|
|
1611
1636
|
if (isNode && __privateGet(this, _options).agentManager) {
|
|
1612
|
-
console.error(chalk
|
|
1637
|
+
console.error(chalk.red(`#InvokeResourceAPI(): Resetting https agent (to null).`));
|
|
1613
1638
|
__privateGet(this, _options).agentManager.ResetAgent();
|
|
1614
1639
|
}
|
|
1615
1640
|
performRetry = true;
|