@nsshunt/stsoauth2plugin 1.0.122 → 1.0.124
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/stsoauth2plugin.mjs +639 -596
- package/dist/stsoauth2plugin.mjs.map +1 -1
- package/dist/stsoauth2plugin.umd.js +639 -596
- package/dist/stsoauth2plugin.umd.js.map +1 -1
- package/package.json +8 -11
package/dist/stsoauth2plugin.mjs
CHANGED
|
@@ -32,7 +32,7 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
|
|
|
32
32
|
function getDefaultExportFromCjs(x) {
|
|
33
33
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
34
34
|
}
|
|
35
|
-
var ansiStyles
|
|
35
|
+
var ansiStyles = { exports: {} };
|
|
36
36
|
var colorName;
|
|
37
37
|
var hasRequiredColorName;
|
|
38
38
|
function requireColorName() {
|
|
@@ -995,181 +995,200 @@ function requireColorConvert() {
|
|
|
995
995
|
colorConvert = convert;
|
|
996
996
|
return colorConvert;
|
|
997
997
|
}
|
|
998
|
-
ansiStyles
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1038
|
-
if (sourceSpace === targetSpace) {
|
|
1039
|
-
styles2[name] = wrap(identity, offset);
|
|
1040
|
-
} else if (typeof suite === "object") {
|
|
1041
|
-
styles2[name] = wrap(suite[targetSpace], offset);
|
|
998
|
+
ansiStyles.exports;
|
|
999
|
+
var hasRequiredAnsiStyles;
|
|
1000
|
+
function requireAnsiStyles() {
|
|
1001
|
+
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
1002
|
+
hasRequiredAnsiStyles = 1;
|
|
1003
|
+
(function(module) {
|
|
1004
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1005
|
+
const code = fn(...args);
|
|
1006
|
+
return `\x1B[${code + offset}m`;
|
|
1007
|
+
};
|
|
1008
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1009
|
+
const code = fn(...args);
|
|
1010
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
1011
|
+
};
|
|
1012
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1013
|
+
const rgb = fn(...args);
|
|
1014
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1015
|
+
};
|
|
1016
|
+
const ansi2ansi = (n) => n;
|
|
1017
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
1018
|
+
const setLazyProperty = (object, property, get) => {
|
|
1019
|
+
Object.defineProperty(object, property, {
|
|
1020
|
+
get: () => {
|
|
1021
|
+
const value = get();
|
|
1022
|
+
Object.defineProperty(object, property, {
|
|
1023
|
+
value,
|
|
1024
|
+
enumerable: true,
|
|
1025
|
+
configurable: true
|
|
1026
|
+
});
|
|
1027
|
+
return value;
|
|
1028
|
+
},
|
|
1029
|
+
enumerable: true,
|
|
1030
|
+
configurable: true
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
let colorConvert2;
|
|
1034
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1035
|
+
if (colorConvert2 === void 0) {
|
|
1036
|
+
colorConvert2 = requireColorConvert();
|
|
1042
1037
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
bold: [1, 22],
|
|
1053
|
-
dim: [2, 22],
|
|
1054
|
-
italic: [3, 23],
|
|
1055
|
-
underline: [4, 24],
|
|
1056
|
-
inverse: [7, 27],
|
|
1057
|
-
hidden: [8, 28],
|
|
1058
|
-
strikethrough: [9, 29]
|
|
1059
|
-
},
|
|
1060
|
-
color: {
|
|
1061
|
-
black: [30, 39],
|
|
1062
|
-
red: [31, 39],
|
|
1063
|
-
green: [32, 39],
|
|
1064
|
-
yellow: [33, 39],
|
|
1065
|
-
blue: [34, 39],
|
|
1066
|
-
magenta: [35, 39],
|
|
1067
|
-
cyan: [36, 39],
|
|
1068
|
-
white: [37, 39],
|
|
1069
|
-
// Bright color
|
|
1070
|
-
blackBright: [90, 39],
|
|
1071
|
-
redBright: [91, 39],
|
|
1072
|
-
greenBright: [92, 39],
|
|
1073
|
-
yellowBright: [93, 39],
|
|
1074
|
-
blueBright: [94, 39],
|
|
1075
|
-
magentaBright: [95, 39],
|
|
1076
|
-
cyanBright: [96, 39],
|
|
1077
|
-
whiteBright: [97, 39]
|
|
1078
|
-
},
|
|
1079
|
-
bgColor: {
|
|
1080
|
-
bgBlack: [40, 49],
|
|
1081
|
-
bgRed: [41, 49],
|
|
1082
|
-
bgGreen: [42, 49],
|
|
1083
|
-
bgYellow: [43, 49],
|
|
1084
|
-
bgBlue: [44, 49],
|
|
1085
|
-
bgMagenta: [45, 49],
|
|
1086
|
-
bgCyan: [46, 49],
|
|
1087
|
-
bgWhite: [47, 49],
|
|
1088
|
-
// Bright color
|
|
1089
|
-
bgBlackBright: [100, 49],
|
|
1090
|
-
bgRedBright: [101, 49],
|
|
1091
|
-
bgGreenBright: [102, 49],
|
|
1092
|
-
bgYellowBright: [103, 49],
|
|
1093
|
-
bgBlueBright: [104, 49],
|
|
1094
|
-
bgMagentaBright: [105, 49],
|
|
1095
|
-
bgCyanBright: [106, 49],
|
|
1096
|
-
bgWhiteBright: [107, 49]
|
|
1038
|
+
const offset = isBackground ? 10 : 0;
|
|
1039
|
+
const styles = {};
|
|
1040
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
1041
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1042
|
+
if (sourceSpace === targetSpace) {
|
|
1043
|
+
styles[name] = wrap(identity, offset);
|
|
1044
|
+
} else if (typeof suite === "object") {
|
|
1045
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
1046
|
+
}
|
|
1097
1047
|
}
|
|
1048
|
+
return styles;
|
|
1098
1049
|
};
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1050
|
+
function assembleStyles() {
|
|
1051
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1052
|
+
const styles = {
|
|
1053
|
+
modifier: {
|
|
1054
|
+
reset: [0, 0],
|
|
1055
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1056
|
+
bold: [1, 22],
|
|
1057
|
+
dim: [2, 22],
|
|
1058
|
+
italic: [3, 23],
|
|
1059
|
+
underline: [4, 24],
|
|
1060
|
+
inverse: [7, 27],
|
|
1061
|
+
hidden: [8, 28],
|
|
1062
|
+
strikethrough: [9, 29]
|
|
1063
|
+
},
|
|
1064
|
+
color: {
|
|
1065
|
+
black: [30, 39],
|
|
1066
|
+
red: [31, 39],
|
|
1067
|
+
green: [32, 39],
|
|
1068
|
+
yellow: [33, 39],
|
|
1069
|
+
blue: [34, 39],
|
|
1070
|
+
magenta: [35, 39],
|
|
1071
|
+
cyan: [36, 39],
|
|
1072
|
+
white: [37, 39],
|
|
1073
|
+
// Bright color
|
|
1074
|
+
blackBright: [90, 39],
|
|
1075
|
+
redBright: [91, 39],
|
|
1076
|
+
greenBright: [92, 39],
|
|
1077
|
+
yellowBright: [93, 39],
|
|
1078
|
+
blueBright: [94, 39],
|
|
1079
|
+
magentaBright: [95, 39],
|
|
1080
|
+
cyanBright: [96, 39],
|
|
1081
|
+
whiteBright: [97, 39]
|
|
1082
|
+
},
|
|
1083
|
+
bgColor: {
|
|
1084
|
+
bgBlack: [40, 49],
|
|
1085
|
+
bgRed: [41, 49],
|
|
1086
|
+
bgGreen: [42, 49],
|
|
1087
|
+
bgYellow: [43, 49],
|
|
1088
|
+
bgBlue: [44, 49],
|
|
1089
|
+
bgMagenta: [45, 49],
|
|
1090
|
+
bgCyan: [46, 49],
|
|
1091
|
+
bgWhite: [47, 49],
|
|
1092
|
+
// Bright color
|
|
1093
|
+
bgBlackBright: [100, 49],
|
|
1094
|
+
bgRedBright: [101, 49],
|
|
1095
|
+
bgGreenBright: [102, 49],
|
|
1096
|
+
bgYellowBright: [103, 49],
|
|
1097
|
+
bgBlueBright: [104, 49],
|
|
1098
|
+
bgMagentaBright: [105, 49],
|
|
1099
|
+
bgCyanBright: [106, 49],
|
|
1100
|
+
bgWhiteBright: [107, 49]
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
styles.color.gray = styles.color.blackBright;
|
|
1104
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1105
|
+
styles.color.grey = styles.color.blackBright;
|
|
1106
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1107
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1108
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1109
|
+
styles[styleName] = {
|
|
1110
|
+
open: `\x1B[${style[0]}m`,
|
|
1111
|
+
close: `\x1B[${style[1]}m`
|
|
1112
|
+
};
|
|
1113
|
+
group[styleName] = styles[styleName];
|
|
1114
|
+
codes.set(style[0], style[1]);
|
|
1115
|
+
}
|
|
1116
|
+
Object.defineProperty(styles, groupName, {
|
|
1117
|
+
value: group,
|
|
1118
|
+
enumerable: false
|
|
1119
|
+
});
|
|
1111
1120
|
}
|
|
1112
|
-
Object.defineProperty(
|
|
1113
|
-
value:
|
|
1121
|
+
Object.defineProperty(styles, "codes", {
|
|
1122
|
+
value: codes,
|
|
1114
1123
|
enumerable: false
|
|
1115
1124
|
});
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1125
|
+
styles.color.close = "\x1B[39m";
|
|
1126
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1127
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1128
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1129
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1130
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1131
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1132
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1133
|
+
return styles;
|
|
1134
|
+
}
|
|
1135
|
+
Object.defineProperty(module, "exports", {
|
|
1136
|
+
enumerable: true,
|
|
1137
|
+
get: assembleStyles
|
|
1120
1138
|
});
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
var
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1139
|
+
})(ansiStyles);
|
|
1140
|
+
return ansiStyles.exports;
|
|
1141
|
+
}
|
|
1142
|
+
var browser;
|
|
1143
|
+
var hasRequiredBrowser;
|
|
1144
|
+
function requireBrowser() {
|
|
1145
|
+
if (hasRequiredBrowser) return browser;
|
|
1146
|
+
hasRequiredBrowser = 1;
|
|
1147
|
+
browser = {
|
|
1148
|
+
stdout: false,
|
|
1149
|
+
stderr: false
|
|
1150
|
+
};
|
|
1151
|
+
return browser;
|
|
1152
|
+
}
|
|
1153
|
+
var util;
|
|
1154
|
+
var hasRequiredUtil;
|
|
1155
|
+
function requireUtil() {
|
|
1156
|
+
if (hasRequiredUtil) return util;
|
|
1157
|
+
hasRequiredUtil = 1;
|
|
1158
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
1159
|
+
let index = string.indexOf(substring);
|
|
1160
|
+
if (index === -1) {
|
|
1161
|
+
return string;
|
|
1162
|
+
}
|
|
1163
|
+
const substringLength = substring.length;
|
|
1164
|
+
let endIndex = 0;
|
|
1165
|
+
let returnValue = "";
|
|
1166
|
+
do {
|
|
1167
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1168
|
+
endIndex = index + substringLength;
|
|
1169
|
+
index = string.indexOf(substring, endIndex);
|
|
1170
|
+
} while (index !== -1);
|
|
1171
|
+
returnValue += string.substr(endIndex);
|
|
1172
|
+
return returnValue;
|
|
1173
|
+
};
|
|
1174
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1175
|
+
let endIndex = 0;
|
|
1176
|
+
let returnValue = "";
|
|
1177
|
+
do {
|
|
1178
|
+
const gotCR = string[index - 1] === "\r";
|
|
1179
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1180
|
+
endIndex = index + 1;
|
|
1181
|
+
index = string.indexOf("\n", endIndex);
|
|
1182
|
+
} while (index !== -1);
|
|
1183
|
+
returnValue += string.substr(endIndex);
|
|
1184
|
+
return returnValue;
|
|
1185
|
+
};
|
|
1186
|
+
util = {
|
|
1187
|
+
stringReplaceAll,
|
|
1188
|
+
stringEncaseCRLFWithFirstIndex
|
|
1189
|
+
};
|
|
1190
|
+
return util;
|
|
1191
|
+
}
|
|
1173
1192
|
var templates;
|
|
1174
1193
|
var hasRequiredTemplates;
|
|
1175
1194
|
function requireTemplates() {
|
|
@@ -1233,27 +1252,27 @@ function requireTemplates() {
|
|
|
1233
1252
|
}
|
|
1234
1253
|
return results;
|
|
1235
1254
|
}
|
|
1236
|
-
function buildStyle(chalk2,
|
|
1255
|
+
function buildStyle(chalk2, styles) {
|
|
1237
1256
|
const enabled = {};
|
|
1238
|
-
for (const layer of
|
|
1257
|
+
for (const layer of styles) {
|
|
1239
1258
|
for (const style of layer.styles) {
|
|
1240
1259
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1241
1260
|
}
|
|
1242
1261
|
}
|
|
1243
1262
|
let current = chalk2;
|
|
1244
|
-
for (const [styleName,
|
|
1245
|
-
if (!Array.isArray(
|
|
1263
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1264
|
+
if (!Array.isArray(styles2)) {
|
|
1246
1265
|
continue;
|
|
1247
1266
|
}
|
|
1248
1267
|
if (!(styleName in current)) {
|
|
1249
1268
|
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1250
1269
|
}
|
|
1251
|
-
current =
|
|
1270
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1252
1271
|
}
|
|
1253
1272
|
return current;
|
|
1254
1273
|
}
|
|
1255
1274
|
templates = (chalk2, temporary) => {
|
|
1256
|
-
const
|
|
1275
|
+
const styles = [];
|
|
1257
1276
|
const chunks = [];
|
|
1258
1277
|
let chunk = [];
|
|
1259
1278
|
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -1262,200 +1281,208 @@ function requireTemplates() {
|
|
|
1262
1281
|
} else if (style) {
|
|
1263
1282
|
const string = chunk.join("");
|
|
1264
1283
|
chunk = [];
|
|
1265
|
-
chunks.push(
|
|
1266
|
-
|
|
1284
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
1285
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
1267
1286
|
} else if (close) {
|
|
1268
|
-
if (
|
|
1287
|
+
if (styles.length === 0) {
|
|
1269
1288
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
1270
1289
|
}
|
|
1271
|
-
chunks.push(buildStyle(chalk2,
|
|
1290
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
1272
1291
|
chunk = [];
|
|
1273
|
-
|
|
1292
|
+
styles.pop();
|
|
1274
1293
|
} else {
|
|
1275
1294
|
chunk.push(character);
|
|
1276
1295
|
}
|
|
1277
1296
|
});
|
|
1278
1297
|
chunks.push(chunk.join(""));
|
|
1279
|
-
if (
|
|
1280
|
-
const errMessage = `Chalk template literal is missing ${
|
|
1298
|
+
if (styles.length > 0) {
|
|
1299
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1281
1300
|
throw new Error(errMessage);
|
|
1282
1301
|
}
|
|
1283
1302
|
return chunks.join("");
|
|
1284
1303
|
};
|
|
1285
1304
|
return templates;
|
|
1286
1305
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
const {
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1306
|
+
var source;
|
|
1307
|
+
var hasRequiredSource;
|
|
1308
|
+
function requireSource() {
|
|
1309
|
+
if (hasRequiredSource) return source;
|
|
1310
|
+
hasRequiredSource = 1;
|
|
1311
|
+
const ansiStyles2 = requireAnsiStyles();
|
|
1312
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
1313
|
+
const {
|
|
1314
|
+
stringReplaceAll,
|
|
1315
|
+
stringEncaseCRLFWithFirstIndex
|
|
1316
|
+
} = requireUtil();
|
|
1317
|
+
const { isArray } = Array;
|
|
1318
|
+
const levelMapping = [
|
|
1319
|
+
"ansi",
|
|
1320
|
+
"ansi",
|
|
1321
|
+
"ansi256",
|
|
1322
|
+
"ansi16m"
|
|
1323
|
+
];
|
|
1324
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
1325
|
+
const applyOptions = (object, options = {}) => {
|
|
1326
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1327
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1328
|
+
}
|
|
1329
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1330
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1331
|
+
};
|
|
1332
|
+
class ChalkClass {
|
|
1333
|
+
constructor(options) {
|
|
1334
|
+
return chalkFactory(options);
|
|
1335
|
+
}
|
|
1304
1336
|
}
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1337
|
+
const chalkFactory = (options) => {
|
|
1338
|
+
const chalk3 = {};
|
|
1339
|
+
applyOptions(chalk3, options);
|
|
1340
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
1341
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
1342
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
1343
|
+
chalk3.template.constructor = () => {
|
|
1344
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1345
|
+
};
|
|
1346
|
+
chalk3.template.Instance = ChalkClass;
|
|
1347
|
+
return chalk3.template;
|
|
1348
|
+
};
|
|
1349
|
+
function Chalk(options) {
|
|
1310
1350
|
return chalkFactory(options);
|
|
1311
1351
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
chalk2.template.Instance = ChalkClass;
|
|
1323
|
-
return chalk2.template;
|
|
1324
|
-
};
|
|
1325
|
-
function Chalk(options) {
|
|
1326
|
-
return chalkFactory(options);
|
|
1327
|
-
}
|
|
1328
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1329
|
-
styles[styleName] = {
|
|
1352
|
+
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
1353
|
+
styles[styleName] = {
|
|
1354
|
+
get() {
|
|
1355
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1356
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1357
|
+
return builder;
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
styles.visible = {
|
|
1330
1362
|
get() {
|
|
1331
|
-
const builder = createBuilder(this,
|
|
1332
|
-
Object.defineProperty(this,
|
|
1363
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1364
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1333
1365
|
return builder;
|
|
1334
1366
|
}
|
|
1335
1367
|
};
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1368
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1369
|
+
for (const model of usedModels) {
|
|
1370
|
+
styles[model] = {
|
|
1371
|
+
get() {
|
|
1372
|
+
const { level } = this;
|
|
1373
|
+
return function(...arguments_) {
|
|
1374
|
+
const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
1375
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1342
1379
|
}
|
|
1343
|
-
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
}
|
|
1380
|
+
for (const model of usedModels) {
|
|
1381
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1382
|
+
styles[bgModel] = {
|
|
1383
|
+
get() {
|
|
1384
|
+
const { level } = this;
|
|
1385
|
+
return function(...arguments_) {
|
|
1386
|
+
const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
1387
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
const proto = Object.defineProperties(() => {
|
|
1393
|
+
}, {
|
|
1394
|
+
...styles,
|
|
1395
|
+
level: {
|
|
1396
|
+
enumerable: true,
|
|
1397
|
+
get() {
|
|
1398
|
+
return this._generator.level;
|
|
1399
|
+
},
|
|
1400
|
+
set(level) {
|
|
1401
|
+
this._generator.level = level;
|
|
1402
|
+
}
|
|
1353
1403
|
}
|
|
1354
|
-
};
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
};
|
|
1404
|
+
});
|
|
1405
|
+
const createStyler = (open, close, parent) => {
|
|
1406
|
+
let openAll;
|
|
1407
|
+
let closeAll;
|
|
1408
|
+
if (parent === void 0) {
|
|
1409
|
+
openAll = open;
|
|
1410
|
+
closeAll = close;
|
|
1411
|
+
} else {
|
|
1412
|
+
openAll = parent.openAll + open;
|
|
1413
|
+
closeAll = close + parent.closeAll;
|
|
1365
1414
|
}
|
|
1415
|
+
return {
|
|
1416
|
+
open,
|
|
1417
|
+
close,
|
|
1418
|
+
openAll,
|
|
1419
|
+
closeAll,
|
|
1420
|
+
parent
|
|
1421
|
+
};
|
|
1366
1422
|
};
|
|
1367
|
-
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
const createStyler = (open, close, parent) => {
|
|
1382
|
-
let openAll;
|
|
1383
|
-
let closeAll;
|
|
1384
|
-
if (parent === void 0) {
|
|
1385
|
-
openAll = open;
|
|
1386
|
-
closeAll = close;
|
|
1387
|
-
} else {
|
|
1388
|
-
openAll = parent.openAll + open;
|
|
1389
|
-
closeAll = close + parent.closeAll;
|
|
1390
|
-
}
|
|
1391
|
-
return {
|
|
1392
|
-
open,
|
|
1393
|
-
close,
|
|
1394
|
-
openAll,
|
|
1395
|
-
closeAll,
|
|
1396
|
-
parent
|
|
1423
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
1424
|
+
const builder = (...arguments_) => {
|
|
1425
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1426
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1427
|
+
}
|
|
1428
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1429
|
+
};
|
|
1430
|
+
Object.setPrototypeOf(builder, proto);
|
|
1431
|
+
builder._generator = self2;
|
|
1432
|
+
builder._styler = _styler;
|
|
1433
|
+
builder._isEmpty = _isEmpty;
|
|
1434
|
+
return builder;
|
|
1397
1435
|
};
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1436
|
+
const applyStyle = (self2, string) => {
|
|
1437
|
+
if (self2.level <= 0 || !string) {
|
|
1438
|
+
return self2._isEmpty ? "" : string;
|
|
1439
|
+
}
|
|
1440
|
+
let styler = self2._styler;
|
|
1441
|
+
if (styler === void 0) {
|
|
1442
|
+
return string;
|
|
1443
|
+
}
|
|
1444
|
+
const { openAll, closeAll } = styler;
|
|
1445
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
1446
|
+
while (styler !== void 0) {
|
|
1447
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1448
|
+
styler = styler.parent;
|
|
1449
|
+
}
|
|
1403
1450
|
}
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
builder._generator = self2;
|
|
1408
|
-
builder._styler = _styler;
|
|
1409
|
-
builder._isEmpty = _isEmpty;
|
|
1410
|
-
return builder;
|
|
1411
|
-
};
|
|
1412
|
-
const applyStyle = (self2, string) => {
|
|
1413
|
-
if (self2.level <= 0 || !string) {
|
|
1414
|
-
return self2._isEmpty ? "" : string;
|
|
1415
|
-
}
|
|
1416
|
-
let styler = self2._styler;
|
|
1417
|
-
if (styler === void 0) {
|
|
1418
|
-
return string;
|
|
1419
|
-
}
|
|
1420
|
-
const { openAll, closeAll } = styler;
|
|
1421
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
1422
|
-
while (styler !== void 0) {
|
|
1423
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1424
|
-
styler = styler.parent;
|
|
1451
|
+
const lfIndex = string.indexOf("\n");
|
|
1452
|
+
if (lfIndex !== -1) {
|
|
1453
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1425
1454
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
);
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
chalk
|
|
1457
|
-
var source = chalk;
|
|
1458
|
-
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
1455
|
+
return openAll + string + closeAll;
|
|
1456
|
+
};
|
|
1457
|
+
let template;
|
|
1458
|
+
const chalkTag = (chalk3, ...strings) => {
|
|
1459
|
+
const [firstString] = strings;
|
|
1460
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1461
|
+
return strings.join(" ");
|
|
1462
|
+
}
|
|
1463
|
+
const arguments_ = strings.slice(1);
|
|
1464
|
+
const parts = [firstString.raw[0]];
|
|
1465
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
1466
|
+
parts.push(
|
|
1467
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1468
|
+
String(firstString.raw[i])
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
if (template === void 0) {
|
|
1472
|
+
template = requireTemplates();
|
|
1473
|
+
}
|
|
1474
|
+
return template(chalk3, parts.join(""));
|
|
1475
|
+
};
|
|
1476
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1477
|
+
const chalk2 = Chalk();
|
|
1478
|
+
chalk2.supportsColor = stdoutColor;
|
|
1479
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1480
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
1481
|
+
source = chalk2;
|
|
1482
|
+
return source;
|
|
1483
|
+
}
|
|
1484
|
+
var sourceExports = requireSource();
|
|
1485
|
+
const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
|
|
1459
1486
|
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
1460
1487
|
var AuthorizeOptionsResponseType = /* @__PURE__ */ ((AuthorizeOptionsResponseType2) => {
|
|
1461
1488
|
AuthorizeOptionsResponseType2["CODE"] = "code";
|
|
@@ -1613,7 +1640,7 @@ class STSOAuth2Manager {
|
|
|
1613
1640
|
__privateAdd(this, _semaphoreRetrySleep, 50);
|
|
1614
1641
|
__privateAdd(this, _ProcessMessageResponse, (data) => {
|
|
1615
1642
|
const messageResponse = data;
|
|
1616
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1643
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
|
|
1617
1644
|
if (messageResponse.messageId === -1) {
|
|
1618
1645
|
switch (messageResponse.command) {
|
|
1619
1646
|
case IOauth2ListenerCommand.AUTHENTICATE_EVENT:
|
|
@@ -1650,10 +1677,10 @@ class STSOAuth2Manager {
|
|
|
1650
1677
|
__privateGet(this, _messageHandlers)[message.messageId] = (response) => {
|
|
1651
1678
|
clearTimeout(timeout);
|
|
1652
1679
|
delete __privateGet(this, _messageHandlers)[message.messageId];
|
|
1653
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1680
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
|
|
1654
1681
|
resolve(response);
|
|
1655
1682
|
};
|
|
1656
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1683
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
|
|
1657
1684
|
__privateGet(this, _oauth2ManagerPort).postMessage(message);
|
|
1658
1685
|
});
|
|
1659
1686
|
});
|
|
@@ -1695,10 +1722,10 @@ class STSOAuth2Manager {
|
|
|
1695
1722
|
}
|
|
1696
1723
|
});
|
|
1697
1724
|
__privateAdd(this, _SetupRoute, (app, router) => {
|
|
1698
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1725
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.gray(`STSOAuth2Manager:#SetupRoute`));
|
|
1699
1726
|
router.beforeEach(async (to, from, next) => {
|
|
1700
1727
|
const oAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey];
|
|
1701
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1728
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
|
|
1702
1729
|
if (__privateGet(this, _GetStore).call(this).LoggedIn === false) {
|
|
1703
1730
|
__privateMethod(this, _STSOAuth2Manager_instances, LogInfoMessage_fn).call(this, `Not logged in`);
|
|
1704
1731
|
if (to.path.localeCompare(`${__privateGet(this, _options).uriBase}authorize`) === 0) {
|
|
@@ -1729,9 +1756,9 @@ class STSOAuth2Manager {
|
|
|
1729
1756
|
}
|
|
1730
1757
|
const str = to.query;
|
|
1731
1758
|
if (str[OAuth2ParameterType.CODE] || str[OAuth2ParameterType.ERROR]) {
|
|
1732
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1759
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
|
|
1733
1760
|
const retVal = await oAuth2Manager.HandleRedirect(str);
|
|
1734
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1761
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
|
|
1735
1762
|
if (retVal) {
|
|
1736
1763
|
next({
|
|
1737
1764
|
path: `${__privateGet(this, _options).uriBase}`,
|
|
@@ -1787,7 +1814,7 @@ class STSOAuth2Manager {
|
|
|
1787
1814
|
throw new Error(`STSOAuth2Manager:ExecuteRefreshToken:maxSemaphoreRetries: [${__privateGet(this, _maxSemaphoreRetries)}] exceeded.`);
|
|
1788
1815
|
}
|
|
1789
1816
|
await Sleep(__privateGet(this, _semaphoreRetrySleep));
|
|
1790
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1817
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
|
|
1791
1818
|
return await this.ExecuteRefreshToken(retryCount + 1);
|
|
1792
1819
|
} else {
|
|
1793
1820
|
__privateSet(this, _operationSemaphore, true);
|
|
@@ -1807,7 +1834,7 @@ class STSOAuth2Manager {
|
|
|
1807
1834
|
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, `STSOAuth2Manager:RestoreSession:response: [${JSON.stringify(response.payload)}]`);
|
|
1808
1835
|
return response.payload;
|
|
1809
1836
|
} catch (error) {
|
|
1810
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk
|
|
1837
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk.red(`RestoreSession Error: ${error}`));
|
|
1811
1838
|
return false;
|
|
1812
1839
|
}
|
|
1813
1840
|
});
|
|
@@ -1822,18 +1849,18 @@ class STSOAuth2Manager {
|
|
|
1822
1849
|
return response.payload.authorizeOptionsClientCopy;
|
|
1823
1850
|
}
|
|
1824
1851
|
} catch (error) {
|
|
1825
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk
|
|
1852
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk.red(`Authorize Error: ${error}`));
|
|
1826
1853
|
}
|
|
1827
1854
|
return {};
|
|
1828
1855
|
});
|
|
1829
1856
|
__publicField(this, "HandleRedirect", async (queryVars) => {
|
|
1830
1857
|
try {
|
|
1831
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1858
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.magenta(`STSOAuth2Manager:HandleRedirect`));
|
|
1832
1859
|
let response = null;
|
|
1833
1860
|
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
1834
1861
|
const authorizeOptions = __privateGet(this, _transactionStore).get(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
1835
1862
|
__privateGet(this, _transactionStore).remove(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
1836
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1863
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
|
|
1837
1864
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: {
|
|
1838
1865
|
queryVars,
|
|
1839
1866
|
authorizeOptions
|
|
@@ -1841,10 +1868,10 @@ class STSOAuth2Manager {
|
|
|
1841
1868
|
} else {
|
|
1842
1869
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: queryVars });
|
|
1843
1870
|
}
|
|
1844
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk
|
|
1871
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogDebugMessage_fn).call(this, chalk.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
|
|
1845
1872
|
return response.payload;
|
|
1846
1873
|
} catch (error) {
|
|
1847
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk
|
|
1874
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk.red(`HandleRedirect Error: ${error}`));
|
|
1848
1875
|
return false;
|
|
1849
1876
|
}
|
|
1850
1877
|
});
|
|
@@ -1853,7 +1880,7 @@ class STSOAuth2Manager {
|
|
|
1853
1880
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
1854
1881
|
return response.payload;
|
|
1855
1882
|
} catch (error) {
|
|
1856
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk
|
|
1883
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk.red(`Logout Error: ${error}`));
|
|
1857
1884
|
return false;
|
|
1858
1885
|
}
|
|
1859
1886
|
});
|
|
@@ -1862,7 +1889,7 @@ class STSOAuth2Manager {
|
|
|
1862
1889
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
1863
1890
|
return response.payload;
|
|
1864
1891
|
} catch (error) {
|
|
1865
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk
|
|
1892
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogErrorMessage_fn).call(this, chalk.red(`InvokeExternalAPI Error: ${error}`));
|
|
1866
1893
|
return null;
|
|
1867
1894
|
}
|
|
1868
1895
|
});
|
|
@@ -1893,10 +1920,10 @@ class STSOAuth2Manager {
|
|
|
1893
1920
|
}
|
|
1894
1921
|
if (!isNode) {
|
|
1895
1922
|
__privateGet(this, _worker).onmessage = (data) => {
|
|
1896
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogInfoMessage_fn).call(this, chalk
|
|
1923
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogInfoMessage_fn).call(this, chalk.green(`this.#worker.onmessage = [${data}]`));
|
|
1897
1924
|
};
|
|
1898
1925
|
__privateGet(this, _worker).onerror = (error) => {
|
|
1899
|
-
__privateMethod(this, _STSOAuth2Manager_instances, LogInfoMessage_fn).call(this, chalk
|
|
1926
|
+
__privateMethod(this, _STSOAuth2Manager_instances, LogInfoMessage_fn).call(this, chalk.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
|
|
1900
1927
|
};
|
|
1901
1928
|
}
|
|
1902
1929
|
let workerMessage;
|
|
@@ -1967,21 +1994,22 @@ _GetStore = new WeakMap();
|
|
|
1967
1994
|
_HandleErrorEvent = new WeakMap();
|
|
1968
1995
|
_HandleAuthenticateEvent = new WeakMap();
|
|
1969
1996
|
_SetupRoute = new WeakMap();
|
|
1970
|
-
var sha256$
|
|
1997
|
+
var sha256$2 = { exports: {} };
|
|
1971
1998
|
function commonjsRequire(path) {
|
|
1972
1999
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
1973
2000
|
}
|
|
1974
|
-
var core = { exports: {} };
|
|
2001
|
+
var core$1 = { exports: {} };
|
|
2002
|
+
var core = core$1.exports;
|
|
1975
2003
|
var hasRequiredCore;
|
|
1976
2004
|
function requireCore() {
|
|
1977
|
-
if (hasRequiredCore) return core.exports;
|
|
2005
|
+
if (hasRequiredCore) return core$1.exports;
|
|
1978
2006
|
hasRequiredCore = 1;
|
|
1979
2007
|
(function(module, exports) {
|
|
1980
2008
|
(function(root, factory) {
|
|
1981
2009
|
{
|
|
1982
2010
|
module.exports = factory();
|
|
1983
2011
|
}
|
|
1984
|
-
})(
|
|
2012
|
+
})(core, function() {
|
|
1985
2013
|
var CryptoJS = CryptoJS || function(Math2, undefined$1) {
|
|
1986
2014
|
var crypto2;
|
|
1987
2015
|
if (typeof window !== "undefined" && window.crypto) {
|
|
@@ -2575,226 +2603,240 @@ function requireCore() {
|
|
|
2575
2603
|
}(Math);
|
|
2576
2604
|
return CryptoJS;
|
|
2577
2605
|
});
|
|
2578
|
-
})(core);
|
|
2579
|
-
return core.exports;
|
|
2606
|
+
})(core$1);
|
|
2607
|
+
return core$1.exports;
|
|
2580
2608
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
(function(
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2609
|
+
var sha256$1 = sha256$2.exports;
|
|
2610
|
+
var hasRequiredSha256;
|
|
2611
|
+
function requireSha256() {
|
|
2612
|
+
if (hasRequiredSha256) return sha256$2.exports;
|
|
2613
|
+
hasRequiredSha256 = 1;
|
|
2614
|
+
(function(module, exports) {
|
|
2615
|
+
(function(root, factory) {
|
|
2616
|
+
{
|
|
2617
|
+
module.exports = factory(requireCore());
|
|
2618
|
+
}
|
|
2619
|
+
})(sha256$1, function(CryptoJS) {
|
|
2620
|
+
(function(Math2) {
|
|
2621
|
+
var C = CryptoJS;
|
|
2622
|
+
var C_lib = C.lib;
|
|
2623
|
+
var WordArray = C_lib.WordArray;
|
|
2624
|
+
var Hasher = C_lib.Hasher;
|
|
2625
|
+
var C_algo = C.algo;
|
|
2626
|
+
var H = [];
|
|
2627
|
+
var K = [];
|
|
2628
|
+
(function() {
|
|
2629
|
+
function isPrime(n2) {
|
|
2630
|
+
var sqrtN = Math2.sqrt(n2);
|
|
2631
|
+
for (var factor = 2; factor <= sqrtN; factor++) {
|
|
2632
|
+
if (!(n2 % factor)) {
|
|
2633
|
+
return false;
|
|
2634
|
+
}
|
|
2601
2635
|
}
|
|
2636
|
+
return true;
|
|
2602
2637
|
}
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2638
|
+
function getFractionalBits(n2) {
|
|
2639
|
+
return (n2 - (n2 | 0)) * 4294967296 | 0;
|
|
2640
|
+
}
|
|
2641
|
+
var n = 2;
|
|
2642
|
+
var nPrime = 0;
|
|
2643
|
+
while (nPrime < 64) {
|
|
2644
|
+
if (isPrime(n)) {
|
|
2645
|
+
if (nPrime < 8) {
|
|
2646
|
+
H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2));
|
|
2647
|
+
}
|
|
2648
|
+
K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3));
|
|
2649
|
+
nPrime++;
|
|
2614
2650
|
}
|
|
2615
|
-
|
|
2616
|
-
nPrime++;
|
|
2651
|
+
n++;
|
|
2617
2652
|
}
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2653
|
+
})();
|
|
2654
|
+
var W = [];
|
|
2655
|
+
var SHA256 = C_algo.SHA256 = Hasher.extend({
|
|
2656
|
+
_doReset: function() {
|
|
2657
|
+
this._hash = new WordArray.init(H.slice(0));
|
|
2658
|
+
},
|
|
2659
|
+
_doProcessBlock: function(M, offset) {
|
|
2660
|
+
var H2 = this._hash.words;
|
|
2661
|
+
var a = H2[0];
|
|
2662
|
+
var b = H2[1];
|
|
2663
|
+
var c = H2[2];
|
|
2664
|
+
var d = H2[3];
|
|
2665
|
+
var e = H2[4];
|
|
2666
|
+
var f = H2[5];
|
|
2667
|
+
var g = H2[6];
|
|
2668
|
+
var h = H2[7];
|
|
2669
|
+
for (var i = 0; i < 64; i++) {
|
|
2670
|
+
if (i < 16) {
|
|
2671
|
+
W[i] = M[offset + i] | 0;
|
|
2672
|
+
} else {
|
|
2673
|
+
var gamma0x = W[i - 15];
|
|
2674
|
+
var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
|
|
2675
|
+
var gamma1x = W[i - 2];
|
|
2676
|
+
var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
|
|
2677
|
+
W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
|
|
2678
|
+
}
|
|
2679
|
+
var ch = e & f ^ ~e & g;
|
|
2680
|
+
var maj = a & b ^ a & c ^ b & c;
|
|
2681
|
+
var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
|
|
2682
|
+
var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
|
|
2683
|
+
var t1 = h + sigma1 + ch + K[i] + W[i];
|
|
2684
|
+
var t2 = sigma0 + maj;
|
|
2685
|
+
h = g;
|
|
2686
|
+
g = f;
|
|
2687
|
+
f = e;
|
|
2688
|
+
e = d + t1 | 0;
|
|
2689
|
+
d = c;
|
|
2690
|
+
c = b;
|
|
2691
|
+
b = a;
|
|
2692
|
+
a = t1 + t2 | 0;
|
|
2645
2693
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2694
|
+
H2[0] = H2[0] + a | 0;
|
|
2695
|
+
H2[1] = H2[1] + b | 0;
|
|
2696
|
+
H2[2] = H2[2] + c | 0;
|
|
2697
|
+
H2[3] = H2[3] + d | 0;
|
|
2698
|
+
H2[4] = H2[4] + e | 0;
|
|
2699
|
+
H2[5] = H2[5] + f | 0;
|
|
2700
|
+
H2[6] = H2[6] + g | 0;
|
|
2701
|
+
H2[7] = H2[7] + h | 0;
|
|
2702
|
+
},
|
|
2703
|
+
_doFinalize: function() {
|
|
2704
|
+
var data = this._data;
|
|
2705
|
+
var dataWords = data.words;
|
|
2706
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
2707
|
+
var nBitsLeft = data.sigBytes * 8;
|
|
2708
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
2709
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296);
|
|
2710
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
|
|
2711
|
+
data.sigBytes = dataWords.length * 4;
|
|
2712
|
+
this._process();
|
|
2713
|
+
return this._hash;
|
|
2714
|
+
},
|
|
2715
|
+
clone: function() {
|
|
2716
|
+
var clone = Hasher.clone.call(this);
|
|
2717
|
+
clone._hash = this._hash.clone();
|
|
2718
|
+
return clone;
|
|
2660
2719
|
}
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
var data = this._data;
|
|
2672
|
-
var dataWords = data.words;
|
|
2673
|
-
var nBitsTotal = this._nDataBytes * 8;
|
|
2674
|
-
var nBitsLeft = data.sigBytes * 8;
|
|
2675
|
-
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
2676
|
-
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296);
|
|
2677
|
-
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
|
|
2678
|
-
data.sigBytes = dataWords.length * 4;
|
|
2679
|
-
this._process();
|
|
2680
|
-
return this._hash;
|
|
2681
|
-
},
|
|
2682
|
-
clone: function() {
|
|
2683
|
-
var clone = Hasher.clone.call(this);
|
|
2684
|
-
clone._hash = this._hash.clone();
|
|
2685
|
-
return clone;
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
C.SHA256 = Hasher._createHelper(SHA256);
|
|
2689
|
-
C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
|
|
2690
|
-
})(Math);
|
|
2691
|
-
return CryptoJS.SHA256;
|
|
2692
|
-
});
|
|
2693
|
-
})(sha256$1);
|
|
2694
|
-
var sha256Exports = sha256$1.exports;
|
|
2720
|
+
});
|
|
2721
|
+
C.SHA256 = Hasher._createHelper(SHA256);
|
|
2722
|
+
C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
|
|
2723
|
+
})(Math);
|
|
2724
|
+
return CryptoJS.SHA256;
|
|
2725
|
+
});
|
|
2726
|
+
})(sha256$2);
|
|
2727
|
+
return sha256$2.exports;
|
|
2728
|
+
}
|
|
2729
|
+
var sha256Exports = requireSha256();
|
|
2695
2730
|
const sha256 = /* @__PURE__ */ getDefaultExportFromCjs(sha256Exports);
|
|
2696
|
-
var encBase64 = { exports: {} };
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
(function() {
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
var
|
|
2730
|
-
var
|
|
2731
|
-
|
|
2732
|
-
var
|
|
2733
|
-
for (var
|
|
2734
|
-
|
|
2731
|
+
var encBase64$1 = { exports: {} };
|
|
2732
|
+
var encBase64 = encBase64$1.exports;
|
|
2733
|
+
var hasRequiredEncBase64;
|
|
2734
|
+
function requireEncBase64() {
|
|
2735
|
+
if (hasRequiredEncBase64) return encBase64$1.exports;
|
|
2736
|
+
hasRequiredEncBase64 = 1;
|
|
2737
|
+
(function(module, exports) {
|
|
2738
|
+
(function(root, factory) {
|
|
2739
|
+
{
|
|
2740
|
+
module.exports = factory(requireCore());
|
|
2741
|
+
}
|
|
2742
|
+
})(encBase64, function(CryptoJS) {
|
|
2743
|
+
(function() {
|
|
2744
|
+
var C = CryptoJS;
|
|
2745
|
+
var C_lib = C.lib;
|
|
2746
|
+
var WordArray = C_lib.WordArray;
|
|
2747
|
+
var C_enc = C.enc;
|
|
2748
|
+
C_enc.Base64 = {
|
|
2749
|
+
/**
|
|
2750
|
+
* Converts a word array to a Base64 string.
|
|
2751
|
+
*
|
|
2752
|
+
* @param {WordArray} wordArray The word array.
|
|
2753
|
+
*
|
|
2754
|
+
* @return {string} The Base64 string.
|
|
2755
|
+
*
|
|
2756
|
+
* @static
|
|
2757
|
+
*
|
|
2758
|
+
* @example
|
|
2759
|
+
*
|
|
2760
|
+
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
|
|
2761
|
+
*/
|
|
2762
|
+
stringify: function(wordArray) {
|
|
2763
|
+
var words = wordArray.words;
|
|
2764
|
+
var sigBytes = wordArray.sigBytes;
|
|
2765
|
+
var map = this._map;
|
|
2766
|
+
wordArray.clamp();
|
|
2767
|
+
var base64Chars = [];
|
|
2768
|
+
for (var i = 0; i < sigBytes; i += 3) {
|
|
2769
|
+
var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
|
|
2770
|
+
var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
|
|
2771
|
+
var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
|
|
2772
|
+
var triplet = byte1 << 16 | byte2 << 8 | byte3;
|
|
2773
|
+
for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
|
|
2774
|
+
base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
|
|
2775
|
+
}
|
|
2735
2776
|
}
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2777
|
+
var paddingChar = map.charAt(64);
|
|
2778
|
+
if (paddingChar) {
|
|
2779
|
+
while (base64Chars.length % 4) {
|
|
2780
|
+
base64Chars.push(paddingChar);
|
|
2781
|
+
}
|
|
2741
2782
|
}
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2783
|
+
return base64Chars.join("");
|
|
2784
|
+
},
|
|
2785
|
+
/**
|
|
2786
|
+
* Converts a Base64 string to a word array.
|
|
2787
|
+
*
|
|
2788
|
+
* @param {string} base64Str The Base64 string.
|
|
2789
|
+
*
|
|
2790
|
+
* @return {WordArray} The word array.
|
|
2791
|
+
*
|
|
2792
|
+
* @static
|
|
2793
|
+
*
|
|
2794
|
+
* @example
|
|
2795
|
+
*
|
|
2796
|
+
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
|
|
2797
|
+
*/
|
|
2798
|
+
parse: function(base64Str) {
|
|
2799
|
+
var base64StrLength = base64Str.length;
|
|
2800
|
+
var map = this._map;
|
|
2801
|
+
var reverseMap = this._reverseMap;
|
|
2802
|
+
if (!reverseMap) {
|
|
2803
|
+
reverseMap = this._reverseMap = [];
|
|
2804
|
+
for (var j = 0; j < map.length; j++) {
|
|
2805
|
+
reverseMap[map.charCodeAt(j)] = j;
|
|
2806
|
+
}
|
|
2766
2807
|
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2808
|
+
var paddingChar = map.charAt(64);
|
|
2809
|
+
if (paddingChar) {
|
|
2810
|
+
var paddingIndex = base64Str.indexOf(paddingChar);
|
|
2811
|
+
if (paddingIndex !== -1) {
|
|
2812
|
+
base64StrLength = paddingIndex;
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
return parseLoop(base64Str, base64StrLength, reverseMap);
|
|
2816
|
+
},
|
|
2817
|
+
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
|
2818
|
+
};
|
|
2819
|
+
function parseLoop(base64Str, base64StrLength, reverseMap) {
|
|
2820
|
+
var words = [];
|
|
2821
|
+
var nBytes = 0;
|
|
2822
|
+
for (var i = 0; i < base64StrLength; i++) {
|
|
2823
|
+
if (i % 4) {
|
|
2824
|
+
var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
|
|
2825
|
+
var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
|
|
2826
|
+
var bitsCombined = bits1 | bits2;
|
|
2827
|
+
words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
|
|
2828
|
+
nBytes++;
|
|
2773
2829
|
}
|
|
2774
2830
|
}
|
|
2775
|
-
return
|
|
2776
|
-
},
|
|
2777
|
-
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
|
2778
|
-
};
|
|
2779
|
-
function parseLoop(base64Str, base64StrLength, reverseMap) {
|
|
2780
|
-
var words = [];
|
|
2781
|
-
var nBytes = 0;
|
|
2782
|
-
for (var i = 0; i < base64StrLength; i++) {
|
|
2783
|
-
if (i % 4) {
|
|
2784
|
-
var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
|
|
2785
|
-
var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
|
|
2786
|
-
var bitsCombined = bits1 | bits2;
|
|
2787
|
-
words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
|
|
2788
|
-
nBytes++;
|
|
2789
|
-
}
|
|
2831
|
+
return WordArray.create(words, nBytes);
|
|
2790
2832
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
})
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
}
|
|
2797
|
-
var encBase64Exports =
|
|
2833
|
+
})();
|
|
2834
|
+
return CryptoJS.enc.Base64;
|
|
2835
|
+
});
|
|
2836
|
+
})(encBase64$1);
|
|
2837
|
+
return encBase64$1.exports;
|
|
2838
|
+
}
|
|
2839
|
+
var encBase64Exports = requireEncBase64();
|
|
2798
2840
|
const Base64 = /* @__PURE__ */ getDefaultExportFromCjs(encBase64Exports);
|
|
2799
2841
|
class CryptoUtils {
|
|
2800
2842
|
constructor() {
|
|
@@ -3031,6 +3073,7 @@ class STSOAuth2Worker {
|
|
|
3031
3073
|
case IOauth2ListenerCommand.LOGOUT:
|
|
3032
3074
|
__privateGet(this, _ProcessCommand).call(this, auth2ListenerMessage, await __privateGet(this, _Logout).call(this));
|
|
3033
3075
|
break;
|
|
3076
|
+
//@@ Need a way of keeping this out of the main thread - should always stay within the worker
|
|
3034
3077
|
case IOauth2ListenerCommand.ACCESS_TOKEN:
|
|
3035
3078
|
__privateGet(this, _ProcessCommand).call(this, auth2ListenerMessage, await __privateGet(this, _GetAccessToken).call(this));
|
|
3036
3079
|
break;
|
|
@@ -3074,7 +3117,7 @@ class STSOAuth2Worker {
|
|
|
3074
3117
|
[OAuth2ParameterType.REDIRECT_URI]: __privateGet(this, _options2).redirect_uri,
|
|
3075
3118
|
[OAuth2ParameterType.AUDIENCE]: __privateGet(this, _options2).audience
|
|
3076
3119
|
}).withDefaultHeaders().withCredentials().withTimeout(__privateGet(this, _options2).timeout);
|
|
3077
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3120
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
|
|
3078
3121
|
if (isNode && __privateGet(this, _agentManager)) {
|
|
3079
3122
|
rConfig.withAgentManager(__privateGet(this, _agentManager));
|
|
3080
3123
|
}
|
|
@@ -3151,29 +3194,29 @@ class STSOAuth2Worker {
|
|
|
3151
3194
|
__privateAdd(this, _HandleRedirect, async (payload) => {
|
|
3152
3195
|
const queryVars = payload.queryVars;
|
|
3153
3196
|
const authorizeOptions = payload.authorizeOptions;
|
|
3154
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3155
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3197
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#HandleRedirect: HandleRedirect`));
|
|
3198
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
|
|
3156
3199
|
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
3157
3200
|
const response = queryVars;
|
|
3158
3201
|
__privateMethod(this, _STSOAuth2Worker_instances, LogInfoMessage_fn2).call(this, `authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
|
|
3159
3202
|
const redirectState = response.state;
|
|
3160
3203
|
const authorizeOptionsState = authorizeOptions.state;
|
|
3161
3204
|
if (authorizeOptionsState.localeCompare(redirectState) === 0) {
|
|
3162
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogInfoMessage_fn2).call(this, chalk
|
|
3205
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogInfoMessage_fn2).call(this, chalk.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
|
|
3163
3206
|
return await __privateGet(this, _GetToken).call(this, authorizeOptions, response);
|
|
3164
3207
|
} else {
|
|
3165
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3166
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3167
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3208
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
|
|
3209
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
|
|
3210
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`redirectState: [${redirectState}]`));
|
|
3168
3211
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3169
3212
|
return false;
|
|
3170
3213
|
}
|
|
3171
3214
|
} else if (queryVars[OAuth2ParameterType.ERROR]) {
|
|
3172
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3215
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`State un-matched (1)`));
|
|
3173
3216
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3174
3217
|
return false;
|
|
3175
3218
|
} else {
|
|
3176
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3219
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`State un-matched (2)`));
|
|
3177
3220
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
3178
3221
|
return false;
|
|
3179
3222
|
}
|
|
@@ -3199,20 +3242,20 @@ class STSOAuth2Worker {
|
|
|
3199
3242
|
*/
|
|
3200
3243
|
// Get access_token, refresh_token and id_token using OAuth2 Authorization Code Flow
|
|
3201
3244
|
__privateAdd(this, _GetTokenFromBroker, async (authorizationCodeFlowParameters) => {
|
|
3202
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3245
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker`));
|
|
3203
3246
|
__privateGet(this, _clientSessionStore).remove(__privateGet(this, _STORAGE_SESSION_KEY));
|
|
3204
3247
|
const url = `${__privateGet(this, _options2).brokerendpoint}:${__privateGet(this, _options2).brokerport}${__privateGet(this, _options2).brokerapiroot}/token`;
|
|
3205
3248
|
try {
|
|
3206
3249
|
const rConfig = new STSAxiosConfig(url, "post").withDefaultHeaders().withData(authorizationCodeFlowParameters).withCredentials().withTimeout(__privateGet(this, _options2).timeout);
|
|
3207
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3250
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
|
|
3208
3251
|
if (isNode && __privateGet(this, _agentManager)) {
|
|
3209
3252
|
rConfig.withAgentManager(__privateGet(this, _agentManager));
|
|
3210
3253
|
}
|
|
3211
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3254
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: axios API call`));
|
|
3212
3255
|
const retVal = await axios(rConfig.config);
|
|
3213
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3256
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
|
|
3214
3257
|
if (retVal.status === StatusCodes.OK) {
|
|
3215
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3258
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: storing tokens`));
|
|
3216
3259
|
const tokenResponse = retVal.data;
|
|
3217
3260
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, tokenResponse.id_token);
|
|
3218
3261
|
const newSessionData = {
|
|
@@ -3224,18 +3267,18 @@ class STSOAuth2Worker {
|
|
|
3224
3267
|
__privateGet(this, _clientSessionStore).set(__privateGet(this, _STORAGE_SESSION_KEY), newSessionData);
|
|
3225
3268
|
return true;
|
|
3226
3269
|
} else if (retVal.status === StatusCodes.UNAUTHORIZED) {
|
|
3227
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3270
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
|
|
3228
3271
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3229
3272
|
return false;
|
|
3230
3273
|
} else {
|
|
3231
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3274
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
|
|
3232
3275
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3233
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3234
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3276
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red("Could not obtain access_token from token end-point:-"));
|
|
3277
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(JSON.stringify(retVal.data)));
|
|
3235
3278
|
return false;
|
|
3236
3279
|
}
|
|
3237
3280
|
} catch (error) {
|
|
3238
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3281
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
|
|
3239
3282
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
3240
3283
|
return false;
|
|
3241
3284
|
}
|
|
@@ -3281,10 +3324,10 @@ class STSOAuth2Worker {
|
|
|
3281
3324
|
}
|
|
3282
3325
|
*/
|
|
3283
3326
|
__privateAdd(this, _RefreshToken, async () => {
|
|
3284
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3327
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.cyan(`STSOAuth2Worker:#RefreshToken:start`));
|
|
3285
3328
|
const sessionData = __privateGet(this, _clientSessionStore).get(__privateGet(this, _STORAGE_SESSION_KEY));
|
|
3286
3329
|
if (sessionData) {
|
|
3287
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3330
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
|
|
3288
3331
|
const currentSessionData = sessionData.tokenResponse;
|
|
3289
3332
|
const refreshFlowParameters = {
|
|
3290
3333
|
client_id: __privateGet(this, _options2).client_id,
|
|
@@ -3294,7 +3337,7 @@ class STSOAuth2Worker {
|
|
|
3294
3337
|
};
|
|
3295
3338
|
return await __privateGet(this, _GetTokenFromBroker).call(this, refreshFlowParameters);
|
|
3296
3339
|
} else {
|
|
3297
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3340
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
|
|
3298
3341
|
return false;
|
|
3299
3342
|
}
|
|
3300
3343
|
});
|
|
@@ -3325,19 +3368,19 @@ class STSOAuth2Worker {
|
|
|
3325
3368
|
if (isNode && __privateGet(this, _agentManager)) {
|
|
3326
3369
|
rConfig.withAgentManager(__privateGet(this, _agentManager));
|
|
3327
3370
|
}
|
|
3328
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk
|
|
3371
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`#Logout: request config: [${rConfig}]`));
|
|
3329
3372
|
const retVal = await axios(rConfig.config);
|
|
3330
3373
|
if (retVal.data.status === StatusCodes.OK) {
|
|
3331
3374
|
return true;
|
|
3332
3375
|
} else {
|
|
3333
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3334
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3376
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red("Error during logout (1: server side)"));
|
|
3377
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(JSON.stringify(retVal.data)));
|
|
3335
3378
|
return false;
|
|
3336
3379
|
}
|
|
3337
3380
|
} catch (error) {
|
|
3338
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3339
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3340
|
-
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk
|
|
3381
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red("Error during logout (2: server side)"));
|
|
3382
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(error));
|
|
3383
|
+
__privateMethod(this, _STSOAuth2Worker_instances, LogErrorMessage_fn2).call(this, chalk.red(JSON.stringify(error)));
|
|
3341
3384
|
return false;
|
|
3342
3385
|
}
|
|
3343
3386
|
} else {
|