@nsshunt/stsoauth2plugin 0.1.11 → 0.1.14
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.
|
@@ -50,433 +50,9 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
var _store, _storage, _storageManager, _router, _store2, _cUtils, _qParams, _STORAGE_AUTHORIZE_OPTIONS_KEY, _STORAGE_SESSION_KEY, _aic, _options, _messages, _oauth2ManagerPort, _messageId, _messageHandlers, _messageTimeout, _worker, _transactionStore, _ProcessMessageResponse, _PostMessage, _HandleErrorEvent, _HandleAuthenticateEvent, _SetupRoute, _SetupStoreNamespace;
|
|
53
|
+
import Debug from "debug";
|
|
54
|
+
import jwt_decode from "jwt-decode";
|
|
53
55
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
54
|
-
var browser = { exports: {} };
|
|
55
|
-
var s = 1e3;
|
|
56
|
-
var m = s * 60;
|
|
57
|
-
var h = m * 60;
|
|
58
|
-
var d = h * 24;
|
|
59
|
-
var w = d * 7;
|
|
60
|
-
var y = d * 365.25;
|
|
61
|
-
var ms = function(val, options) {
|
|
62
|
-
options = options || {};
|
|
63
|
-
var type2 = typeof val;
|
|
64
|
-
if (type2 === "string" && val.length > 0) {
|
|
65
|
-
return parse$2(val);
|
|
66
|
-
} else if (type2 === "number" && isFinite(val)) {
|
|
67
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
68
|
-
}
|
|
69
|
-
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
70
|
-
};
|
|
71
|
-
function parse$2(str) {
|
|
72
|
-
str = String(str);
|
|
73
|
-
if (str.length > 100) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
77
|
-
if (!match) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
var n2 = parseFloat(match[1]);
|
|
81
|
-
var type2 = (match[2] || "ms").toLowerCase();
|
|
82
|
-
switch (type2) {
|
|
83
|
-
case "years":
|
|
84
|
-
case "year":
|
|
85
|
-
case "yrs":
|
|
86
|
-
case "yr":
|
|
87
|
-
case "y":
|
|
88
|
-
return n2 * y;
|
|
89
|
-
case "weeks":
|
|
90
|
-
case "week":
|
|
91
|
-
case "w":
|
|
92
|
-
return n2 * w;
|
|
93
|
-
case "days":
|
|
94
|
-
case "day":
|
|
95
|
-
case "d":
|
|
96
|
-
return n2 * d;
|
|
97
|
-
case "hours":
|
|
98
|
-
case "hour":
|
|
99
|
-
case "hrs":
|
|
100
|
-
case "hr":
|
|
101
|
-
case "h":
|
|
102
|
-
return n2 * h;
|
|
103
|
-
case "minutes":
|
|
104
|
-
case "minute":
|
|
105
|
-
case "mins":
|
|
106
|
-
case "min":
|
|
107
|
-
case "m":
|
|
108
|
-
return n2 * m;
|
|
109
|
-
case "seconds":
|
|
110
|
-
case "second":
|
|
111
|
-
case "secs":
|
|
112
|
-
case "sec":
|
|
113
|
-
case "s":
|
|
114
|
-
return n2 * s;
|
|
115
|
-
case "milliseconds":
|
|
116
|
-
case "millisecond":
|
|
117
|
-
case "msecs":
|
|
118
|
-
case "msec":
|
|
119
|
-
case "ms":
|
|
120
|
-
return n2;
|
|
121
|
-
default:
|
|
122
|
-
return void 0;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function fmtShort(ms2) {
|
|
126
|
-
var msAbs = Math.abs(ms2);
|
|
127
|
-
if (msAbs >= d) {
|
|
128
|
-
return Math.round(ms2 / d) + "d";
|
|
129
|
-
}
|
|
130
|
-
if (msAbs >= h) {
|
|
131
|
-
return Math.round(ms2 / h) + "h";
|
|
132
|
-
}
|
|
133
|
-
if (msAbs >= m) {
|
|
134
|
-
return Math.round(ms2 / m) + "m";
|
|
135
|
-
}
|
|
136
|
-
if (msAbs >= s) {
|
|
137
|
-
return Math.round(ms2 / s) + "s";
|
|
138
|
-
}
|
|
139
|
-
return ms2 + "ms";
|
|
140
|
-
}
|
|
141
|
-
function fmtLong(ms2) {
|
|
142
|
-
var msAbs = Math.abs(ms2);
|
|
143
|
-
if (msAbs >= d) {
|
|
144
|
-
return plural(ms2, msAbs, d, "day");
|
|
145
|
-
}
|
|
146
|
-
if (msAbs >= h) {
|
|
147
|
-
return plural(ms2, msAbs, h, "hour");
|
|
148
|
-
}
|
|
149
|
-
if (msAbs >= m) {
|
|
150
|
-
return plural(ms2, msAbs, m, "minute");
|
|
151
|
-
}
|
|
152
|
-
if (msAbs >= s) {
|
|
153
|
-
return plural(ms2, msAbs, s, "second");
|
|
154
|
-
}
|
|
155
|
-
return ms2 + " ms";
|
|
156
|
-
}
|
|
157
|
-
function plural(ms2, msAbs, n2, name) {
|
|
158
|
-
var isPlural = msAbs >= n2 * 1.5;
|
|
159
|
-
return Math.round(ms2 / n2) + " " + name + (isPlural ? "s" : "");
|
|
160
|
-
}
|
|
161
|
-
function setup(env) {
|
|
162
|
-
createDebug.debug = createDebug;
|
|
163
|
-
createDebug.default = createDebug;
|
|
164
|
-
createDebug.coerce = coerce;
|
|
165
|
-
createDebug.disable = disable;
|
|
166
|
-
createDebug.enable = enable;
|
|
167
|
-
createDebug.enabled = enabled;
|
|
168
|
-
createDebug.humanize = ms;
|
|
169
|
-
createDebug.destroy = destroy;
|
|
170
|
-
Object.keys(env).forEach((key) => {
|
|
171
|
-
createDebug[key] = env[key];
|
|
172
|
-
});
|
|
173
|
-
createDebug.names = [];
|
|
174
|
-
createDebug.skips = [];
|
|
175
|
-
createDebug.formatters = {};
|
|
176
|
-
function selectColor(namespace) {
|
|
177
|
-
let hash = 0;
|
|
178
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
179
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
180
|
-
hash |= 0;
|
|
181
|
-
}
|
|
182
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
183
|
-
}
|
|
184
|
-
createDebug.selectColor = selectColor;
|
|
185
|
-
function createDebug(namespace) {
|
|
186
|
-
let prevTime;
|
|
187
|
-
let enableOverride = null;
|
|
188
|
-
let namespacesCache;
|
|
189
|
-
let enabledCache;
|
|
190
|
-
function debug2(...args) {
|
|
191
|
-
if (!debug2.enabled) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const self2 = debug2;
|
|
195
|
-
const curr = Number(new Date());
|
|
196
|
-
const ms2 = curr - (prevTime || curr);
|
|
197
|
-
self2.diff = ms2;
|
|
198
|
-
self2.prev = prevTime;
|
|
199
|
-
self2.curr = curr;
|
|
200
|
-
prevTime = curr;
|
|
201
|
-
args[0] = createDebug.coerce(args[0]);
|
|
202
|
-
if (typeof args[0] !== "string") {
|
|
203
|
-
args.unshift("%O");
|
|
204
|
-
}
|
|
205
|
-
let index = 0;
|
|
206
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
207
|
-
if (match === "%%") {
|
|
208
|
-
return "%";
|
|
209
|
-
}
|
|
210
|
-
index++;
|
|
211
|
-
const formatter = createDebug.formatters[format];
|
|
212
|
-
if (typeof formatter === "function") {
|
|
213
|
-
const val = args[index];
|
|
214
|
-
match = formatter.call(self2, val);
|
|
215
|
-
args.splice(index, 1);
|
|
216
|
-
index--;
|
|
217
|
-
}
|
|
218
|
-
return match;
|
|
219
|
-
});
|
|
220
|
-
createDebug.formatArgs.call(self2, args);
|
|
221
|
-
const logFn = self2.log || createDebug.log;
|
|
222
|
-
logFn.apply(self2, args);
|
|
223
|
-
}
|
|
224
|
-
debug2.namespace = namespace;
|
|
225
|
-
debug2.useColors = createDebug.useColors();
|
|
226
|
-
debug2.color = createDebug.selectColor(namespace);
|
|
227
|
-
debug2.extend = extend;
|
|
228
|
-
debug2.destroy = createDebug.destroy;
|
|
229
|
-
Object.defineProperty(debug2, "enabled", {
|
|
230
|
-
enumerable: true,
|
|
231
|
-
configurable: false,
|
|
232
|
-
get: () => {
|
|
233
|
-
if (enableOverride !== null) {
|
|
234
|
-
return enableOverride;
|
|
235
|
-
}
|
|
236
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
237
|
-
namespacesCache = createDebug.namespaces;
|
|
238
|
-
enabledCache = createDebug.enabled(namespace);
|
|
239
|
-
}
|
|
240
|
-
return enabledCache;
|
|
241
|
-
},
|
|
242
|
-
set: (v) => {
|
|
243
|
-
enableOverride = v;
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
if (typeof createDebug.init === "function") {
|
|
247
|
-
createDebug.init(debug2);
|
|
248
|
-
}
|
|
249
|
-
return debug2;
|
|
250
|
-
}
|
|
251
|
-
function extend(namespace, delimiter) {
|
|
252
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
253
|
-
newDebug.log = this.log;
|
|
254
|
-
return newDebug;
|
|
255
|
-
}
|
|
256
|
-
function enable(namespaces) {
|
|
257
|
-
createDebug.save(namespaces);
|
|
258
|
-
createDebug.namespaces = namespaces;
|
|
259
|
-
createDebug.names = [];
|
|
260
|
-
createDebug.skips = [];
|
|
261
|
-
let i;
|
|
262
|
-
const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
263
|
-
const len = split.length;
|
|
264
|
-
for (i = 0; i < len; i++) {
|
|
265
|
-
if (!split[i]) {
|
|
266
|
-
continue;
|
|
267
|
-
}
|
|
268
|
-
namespaces = split[i].replace(/\*/g, ".*?");
|
|
269
|
-
if (namespaces[0] === "-") {
|
|
270
|
-
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
271
|
-
} else {
|
|
272
|
-
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
function disable() {
|
|
277
|
-
const namespaces = [
|
|
278
|
-
...createDebug.names.map(toNamespace),
|
|
279
|
-
...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
|
|
280
|
-
].join(",");
|
|
281
|
-
createDebug.enable("");
|
|
282
|
-
return namespaces;
|
|
283
|
-
}
|
|
284
|
-
function enabled(name) {
|
|
285
|
-
if (name[name.length - 1] === "*") {
|
|
286
|
-
return true;
|
|
287
|
-
}
|
|
288
|
-
let i;
|
|
289
|
-
let len;
|
|
290
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
291
|
-
if (createDebug.skips[i].test(name)) {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
296
|
-
if (createDebug.names[i].test(name)) {
|
|
297
|
-
return true;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
function toNamespace(regexp) {
|
|
303
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
304
|
-
}
|
|
305
|
-
function coerce(val) {
|
|
306
|
-
if (val instanceof Error) {
|
|
307
|
-
return val.stack || val.message;
|
|
308
|
-
}
|
|
309
|
-
return val;
|
|
310
|
-
}
|
|
311
|
-
function destroy() {
|
|
312
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
313
|
-
}
|
|
314
|
-
createDebug.enable(createDebug.load());
|
|
315
|
-
return createDebug;
|
|
316
|
-
}
|
|
317
|
-
var common = setup;
|
|
318
|
-
(function(module, exports) {
|
|
319
|
-
exports.formatArgs = formatArgs;
|
|
320
|
-
exports.save = save;
|
|
321
|
-
exports.load = load;
|
|
322
|
-
exports.useColors = useColors;
|
|
323
|
-
exports.storage = localstorage();
|
|
324
|
-
exports.destroy = (() => {
|
|
325
|
-
let warned = false;
|
|
326
|
-
return () => {
|
|
327
|
-
if (!warned) {
|
|
328
|
-
warned = true;
|
|
329
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
})();
|
|
333
|
-
exports.colors = [
|
|
334
|
-
"#0000CC",
|
|
335
|
-
"#0000FF",
|
|
336
|
-
"#0033CC",
|
|
337
|
-
"#0033FF",
|
|
338
|
-
"#0066CC",
|
|
339
|
-
"#0066FF",
|
|
340
|
-
"#0099CC",
|
|
341
|
-
"#0099FF",
|
|
342
|
-
"#00CC00",
|
|
343
|
-
"#00CC33",
|
|
344
|
-
"#00CC66",
|
|
345
|
-
"#00CC99",
|
|
346
|
-
"#00CCCC",
|
|
347
|
-
"#00CCFF",
|
|
348
|
-
"#3300CC",
|
|
349
|
-
"#3300FF",
|
|
350
|
-
"#3333CC",
|
|
351
|
-
"#3333FF",
|
|
352
|
-
"#3366CC",
|
|
353
|
-
"#3366FF",
|
|
354
|
-
"#3399CC",
|
|
355
|
-
"#3399FF",
|
|
356
|
-
"#33CC00",
|
|
357
|
-
"#33CC33",
|
|
358
|
-
"#33CC66",
|
|
359
|
-
"#33CC99",
|
|
360
|
-
"#33CCCC",
|
|
361
|
-
"#33CCFF",
|
|
362
|
-
"#6600CC",
|
|
363
|
-
"#6600FF",
|
|
364
|
-
"#6633CC",
|
|
365
|
-
"#6633FF",
|
|
366
|
-
"#66CC00",
|
|
367
|
-
"#66CC33",
|
|
368
|
-
"#9900CC",
|
|
369
|
-
"#9900FF",
|
|
370
|
-
"#9933CC",
|
|
371
|
-
"#9933FF",
|
|
372
|
-
"#99CC00",
|
|
373
|
-
"#99CC33",
|
|
374
|
-
"#CC0000",
|
|
375
|
-
"#CC0033",
|
|
376
|
-
"#CC0066",
|
|
377
|
-
"#CC0099",
|
|
378
|
-
"#CC00CC",
|
|
379
|
-
"#CC00FF",
|
|
380
|
-
"#CC3300",
|
|
381
|
-
"#CC3333",
|
|
382
|
-
"#CC3366",
|
|
383
|
-
"#CC3399",
|
|
384
|
-
"#CC33CC",
|
|
385
|
-
"#CC33FF",
|
|
386
|
-
"#CC6600",
|
|
387
|
-
"#CC6633",
|
|
388
|
-
"#CC9900",
|
|
389
|
-
"#CC9933",
|
|
390
|
-
"#CCCC00",
|
|
391
|
-
"#CCCC33",
|
|
392
|
-
"#FF0000",
|
|
393
|
-
"#FF0033",
|
|
394
|
-
"#FF0066",
|
|
395
|
-
"#FF0099",
|
|
396
|
-
"#FF00CC",
|
|
397
|
-
"#FF00FF",
|
|
398
|
-
"#FF3300",
|
|
399
|
-
"#FF3333",
|
|
400
|
-
"#FF3366",
|
|
401
|
-
"#FF3399",
|
|
402
|
-
"#FF33CC",
|
|
403
|
-
"#FF33FF",
|
|
404
|
-
"#FF6600",
|
|
405
|
-
"#FF6633",
|
|
406
|
-
"#FF9900",
|
|
407
|
-
"#FF9933",
|
|
408
|
-
"#FFCC00",
|
|
409
|
-
"#FFCC33"
|
|
410
|
-
];
|
|
411
|
-
function useColors() {
|
|
412
|
-
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
413
|
-
return true;
|
|
414
|
-
}
|
|
415
|
-
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
419
|
-
}
|
|
420
|
-
function formatArgs(args) {
|
|
421
|
-
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
422
|
-
if (!this.useColors) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
const c = "color: " + this.color;
|
|
426
|
-
args.splice(1, 0, c, "color: inherit");
|
|
427
|
-
let index = 0;
|
|
428
|
-
let lastC = 0;
|
|
429
|
-
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
430
|
-
if (match === "%%") {
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
index++;
|
|
434
|
-
if (match === "%c") {
|
|
435
|
-
lastC = index;
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
args.splice(lastC, 0, c);
|
|
439
|
-
}
|
|
440
|
-
exports.log = console.debug || console.log || (() => {
|
|
441
|
-
});
|
|
442
|
-
function save(namespaces) {
|
|
443
|
-
try {
|
|
444
|
-
if (namespaces) {
|
|
445
|
-
exports.storage.setItem("debug", namespaces);
|
|
446
|
-
} else {
|
|
447
|
-
exports.storage.removeItem("debug");
|
|
448
|
-
}
|
|
449
|
-
} catch (error2) {
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
function load() {
|
|
453
|
-
let r2;
|
|
454
|
-
try {
|
|
455
|
-
r2 = exports.storage.getItem("debug");
|
|
456
|
-
} catch (error2) {
|
|
457
|
-
}
|
|
458
|
-
if (!r2 && typeof process !== "undefined" && "env" in process) {
|
|
459
|
-
r2 = {}.DEBUG;
|
|
460
|
-
}
|
|
461
|
-
return r2;
|
|
462
|
-
}
|
|
463
|
-
function localstorage() {
|
|
464
|
-
try {
|
|
465
|
-
return localStorage;
|
|
466
|
-
} catch (error2) {
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
module.exports = common(exports);
|
|
470
|
-
const { formatters } = module.exports;
|
|
471
|
-
formatters.j = function(v) {
|
|
472
|
-
try {
|
|
473
|
-
return JSON.stringify(v);
|
|
474
|
-
} catch (error2) {
|
|
475
|
-
return "[UnexpectedJSONParseError]: " + error2.message;
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
})(browser, browser.exports);
|
|
479
|
-
var Debug = browser.exports;
|
|
480
56
|
var dist = {};
|
|
481
57
|
var errorhandling = {};
|
|
482
58
|
Object.defineProperty(errorhandling, "__esModule", { value: true });
|
|
@@ -507,11 +83,11 @@ var code$1 = {};
|
|
|
507
83
|
exports._CodeOrName = _CodeOrName;
|
|
508
84
|
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
509
85
|
class Name extends _CodeOrName {
|
|
510
|
-
constructor(
|
|
86
|
+
constructor(s) {
|
|
511
87
|
super();
|
|
512
|
-
if (!exports.IDENTIFIER.test(
|
|
88
|
+
if (!exports.IDENTIFIER.test(s))
|
|
513
89
|
throw new Error("CodeGen: name must be a valid identifier");
|
|
514
|
-
this.str =
|
|
90
|
+
this.str = s;
|
|
515
91
|
}
|
|
516
92
|
toString() {
|
|
517
93
|
return this.str;
|
|
@@ -540,7 +116,7 @@ var code$1 = {};
|
|
|
540
116
|
}
|
|
541
117
|
get str() {
|
|
542
118
|
var _a;
|
|
543
|
-
return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((
|
|
119
|
+
return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
|
|
544
120
|
}
|
|
545
121
|
get names() {
|
|
546
122
|
var _a;
|
|
@@ -735,9 +311,9 @@ var scope = {};
|
|
|
735
311
|
vs = this._values[prefix] = /* @__PURE__ */ new Map();
|
|
736
312
|
}
|
|
737
313
|
vs.set(valueKey, name);
|
|
738
|
-
const
|
|
739
|
-
const itemIndex =
|
|
740
|
-
|
|
314
|
+
const s = this._scope[prefix] || (this._scope[prefix] = []);
|
|
315
|
+
const itemIndex = s.length;
|
|
316
|
+
s[itemIndex] = value.ref;
|
|
741
317
|
name.setValue(value, { property: prefix, itemIndex });
|
|
742
318
|
return name;
|
|
743
319
|
}
|
|
@@ -963,17 +539,17 @@ var scope = {};
|
|
|
963
539
|
this.nodes = nodes;
|
|
964
540
|
}
|
|
965
541
|
render(opts) {
|
|
966
|
-
return this.nodes.reduce((code2,
|
|
542
|
+
return this.nodes.reduce((code2, n) => code2 + n.render(opts), "");
|
|
967
543
|
}
|
|
968
544
|
optimizeNodes() {
|
|
969
545
|
const { nodes } = this;
|
|
970
546
|
let i = nodes.length;
|
|
971
547
|
while (i--) {
|
|
972
|
-
const
|
|
973
|
-
if (Array.isArray(
|
|
974
|
-
nodes.splice(i, 1, ...
|
|
975
|
-
else if (
|
|
976
|
-
nodes[i] =
|
|
548
|
+
const n = nodes[i].optimizeNodes();
|
|
549
|
+
if (Array.isArray(n))
|
|
550
|
+
nodes.splice(i, 1, ...n);
|
|
551
|
+
else if (n)
|
|
552
|
+
nodes[i] = n;
|
|
977
553
|
else
|
|
978
554
|
nodes.splice(i, 1);
|
|
979
555
|
}
|
|
@@ -983,16 +559,16 @@ var scope = {};
|
|
|
983
559
|
const { nodes } = this;
|
|
984
560
|
let i = nodes.length;
|
|
985
561
|
while (i--) {
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
562
|
+
const n = nodes[i];
|
|
563
|
+
if (n.optimizeNames(names2, constants))
|
|
988
564
|
continue;
|
|
989
|
-
subtractNames(names2,
|
|
565
|
+
subtractNames(names2, n.names);
|
|
990
566
|
nodes.splice(i, 1);
|
|
991
567
|
}
|
|
992
568
|
return nodes.length > 0 ? this : void 0;
|
|
993
569
|
}
|
|
994
570
|
get names() {
|
|
995
|
-
return this.nodes.reduce((names2,
|
|
571
|
+
return this.nodes.reduce((names2, n) => addNames(names2, n.names), {});
|
|
996
572
|
}
|
|
997
573
|
}
|
|
998
574
|
class BlockNode extends ParentNode {
|
|
@@ -1021,17 +597,17 @@ var scope = {};
|
|
|
1021
597
|
const cond = this.condition;
|
|
1022
598
|
if (cond === true)
|
|
1023
599
|
return this.nodes;
|
|
1024
|
-
let
|
|
1025
|
-
if (
|
|
1026
|
-
const ns =
|
|
1027
|
-
|
|
600
|
+
let e = this.else;
|
|
601
|
+
if (e) {
|
|
602
|
+
const ns = e.optimizeNodes();
|
|
603
|
+
e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
|
|
1028
604
|
}
|
|
1029
|
-
if (
|
|
605
|
+
if (e) {
|
|
1030
606
|
if (cond === false)
|
|
1031
|
-
return
|
|
607
|
+
return e instanceof If ? e : e.nodes;
|
|
1032
608
|
if (this.nodes.length)
|
|
1033
609
|
return this;
|
|
1034
|
-
return new If(not(cond),
|
|
610
|
+
return new If(not(cond), e instanceof If ? [e] : e.nodes);
|
|
1035
611
|
}
|
|
1036
612
|
if (cond === false || !this.nodes.length)
|
|
1037
613
|
return void 0;
|
|
@@ -1372,8 +948,8 @@ var scope = {};
|
|
|
1372
948
|
endFunc() {
|
|
1373
949
|
return this._endBlockNode(Func);
|
|
1374
950
|
}
|
|
1375
|
-
optimize(
|
|
1376
|
-
while (
|
|
951
|
+
optimize(n = 1) {
|
|
952
|
+
while (n-- > 0) {
|
|
1377
953
|
this._root.optimizeNodes();
|
|
1378
954
|
this._root.optimizeNames(this._root.names, this._constants);
|
|
1379
955
|
}
|
|
@@ -1387,19 +963,19 @@ var scope = {};
|
|
|
1387
963
|
this._nodes.push(node);
|
|
1388
964
|
}
|
|
1389
965
|
_endBlockNode(N1, N2) {
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
966
|
+
const n = this._currNode;
|
|
967
|
+
if (n instanceof N1 || N2 && n instanceof N2) {
|
|
1392
968
|
this._nodes.pop();
|
|
1393
969
|
return this;
|
|
1394
970
|
}
|
|
1395
971
|
throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
|
|
1396
972
|
}
|
|
1397
973
|
_elseNode(node) {
|
|
1398
|
-
const
|
|
1399
|
-
if (!(
|
|
974
|
+
const n = this._currNode;
|
|
975
|
+
if (!(n instanceof If)) {
|
|
1400
976
|
throw new Error('CodeGen: "else" without "if"');
|
|
1401
977
|
}
|
|
1402
|
-
this._currNode =
|
|
978
|
+
this._currNode = n.else = node;
|
|
1403
979
|
return this;
|
|
1404
980
|
}
|
|
1405
981
|
get _root() {
|
|
@@ -1416,8 +992,8 @@ var scope = {};
|
|
|
1416
992
|
}
|
|
1417
993
|
exports.CodeGen = CodeGen;
|
|
1418
994
|
function addNames(names2, from) {
|
|
1419
|
-
for (const
|
|
1420
|
-
names2[
|
|
995
|
+
for (const n in from)
|
|
996
|
+
names2[n] = (names2[n] || 0) + (from[n] || 0);
|
|
1421
997
|
return names2;
|
|
1422
998
|
}
|
|
1423
999
|
function addExprNames(names2, from) {
|
|
@@ -1437,20 +1013,20 @@ var scope = {};
|
|
|
1437
1013
|
items.push(c);
|
|
1438
1014
|
return items;
|
|
1439
1015
|
}, []));
|
|
1440
|
-
function replaceName(
|
|
1441
|
-
const c = constants[
|
|
1442
|
-
if (c === void 0 || names2[
|
|
1443
|
-
return
|
|
1444
|
-
delete names2[
|
|
1016
|
+
function replaceName(n) {
|
|
1017
|
+
const c = constants[n.str];
|
|
1018
|
+
if (c === void 0 || names2[n.str] !== 1)
|
|
1019
|
+
return n;
|
|
1020
|
+
delete names2[n.str];
|
|
1445
1021
|
return c;
|
|
1446
1022
|
}
|
|
1447
|
-
function canOptimize(
|
|
1448
|
-
return
|
|
1023
|
+
function canOptimize(e) {
|
|
1024
|
+
return e instanceof code_12._Code && e._items.some((c) => c instanceof code_12.Name && names2[c.str] === 1 && constants[c.str] !== void 0);
|
|
1449
1025
|
}
|
|
1450
1026
|
}
|
|
1451
1027
|
function subtractNames(names2, from) {
|
|
1452
|
-
for (const
|
|
1453
|
-
names2[
|
|
1028
|
+
for (const n in from)
|
|
1029
|
+
names2[n] = (names2[n] || 0) - (from[n] || 0);
|
|
1454
1030
|
}
|
|
1455
1031
|
function not(x) {
|
|
1456
1032
|
return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_12._)`!${par(x)}`;
|
|
@@ -1467,7 +1043,7 @@ var scope = {};
|
|
|
1467
1043
|
}
|
|
1468
1044
|
exports.or = or;
|
|
1469
1045
|
function mappend(op) {
|
|
1470
|
-
return (x,
|
|
1046
|
+
return (x, y) => x === code_12.nil ? y : y === code_12.nil ? x : (0, code_12._)`${par(x)} ${op} ${par(y)}`;
|
|
1471
1047
|
}
|
|
1472
1048
|
function par(x) {
|
|
1473
1049
|
return x instanceof code_12.Name ? x : (0, code_12._)`(${x})`;
|
|
@@ -1915,7 +1491,7 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
1915
1491
|
exports.coerceAndCheckDataType = coerceAndCheckDataType;
|
|
1916
1492
|
const COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1917
1493
|
function coerceToTypes(types2, coerceTypes) {
|
|
1918
|
-
return coerceTypes ? types2.filter((
|
|
1494
|
+
return coerceTypes ? types2.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
|
|
1919
1495
|
}
|
|
1920
1496
|
function coerceData(it, types2, coerceTo) {
|
|
1921
1497
|
const { gen, data, opts } = it;
|
|
@@ -1925,9 +1501,9 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
1925
1501
|
gen.if((0, codegen_12._)`${dataType2} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_12._)`${data}[0]`).assign(dataType2, (0, codegen_12._)`typeof ${data}`).if(checkDataTypes(types2, data, opts.strictNumbers), () => gen.assign(coerced, data)));
|
|
1926
1502
|
}
|
|
1927
1503
|
gen.if((0, codegen_12._)`${coerced} !== undefined`);
|
|
1928
|
-
for (const
|
|
1929
|
-
if (COERCIBLE.has(
|
|
1930
|
-
coerceSpecificType(
|
|
1504
|
+
for (const t of coerceTo) {
|
|
1505
|
+
if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
|
|
1506
|
+
coerceSpecificType(t);
|
|
1931
1507
|
}
|
|
1932
1508
|
}
|
|
1933
1509
|
gen.else();
|
|
@@ -1937,8 +1513,8 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
1937
1513
|
gen.assign(data, coerced);
|
|
1938
1514
|
assignParentData(it, coerced);
|
|
1939
1515
|
});
|
|
1940
|
-
function coerceSpecificType(
|
|
1941
|
-
switch (
|
|
1516
|
+
function coerceSpecificType(t) {
|
|
1517
|
+
switch (t) {
|
|
1942
1518
|
case "string":
|
|
1943
1519
|
gen.elseIf((0, codegen_12._)`${dataType2} == "number" || ${dataType2} == "boolean"`).assign(coerced, (0, codegen_12._)`"" + ${data}`).elseIf((0, codegen_12._)`${data} === null`).assign(coerced, (0, codegen_12._)`""`);
|
|
1944
1520
|
return;
|
|
@@ -2010,8 +1586,8 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
2010
1586
|
}
|
|
2011
1587
|
if (types2.number)
|
|
2012
1588
|
delete types2.integer;
|
|
2013
|
-
for (const
|
|
2014
|
-
cond = (0, codegen_12.and)(cond, checkDataType(
|
|
1589
|
+
for (const t in types2)
|
|
1590
|
+
cond = (0, codegen_12.and)(cond, checkDataType(t, data, strictNums, correct));
|
|
2015
1591
|
return cond;
|
|
2016
1592
|
}
|
|
2017
1593
|
exports.checkDataTypes = checkDataTypes;
|
|
@@ -2245,7 +1821,7 @@ function funcKeywordCode(cxt, def2) {
|
|
|
2245
1821
|
}
|
|
2246
1822
|
function validateAsync() {
|
|
2247
1823
|
const ruleErrs = gen.let("ruleErrs", null);
|
|
2248
|
-
gen.try(() => assignValid((0, codegen_1$d._)`await `), (
|
|
1824
|
+
gen.try(() => assignValid((0, codegen_1$d._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1$d._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1$d._)`${e}.errors`), () => gen.throw(e)));
|
|
2249
1825
|
return ruleErrs;
|
|
2250
1826
|
}
|
|
2251
1827
|
function validateSync() {
|
|
@@ -2886,12 +2462,12 @@ function checkContextTypes(it, types2) {
|
|
|
2886
2462
|
it.dataTypes = types2;
|
|
2887
2463
|
return;
|
|
2888
2464
|
}
|
|
2889
|
-
types2.forEach((
|
|
2890
|
-
if (!includesType(it.dataTypes,
|
|
2891
|
-
strictTypesError(it, `type "${
|
|
2465
|
+
types2.forEach((t) => {
|
|
2466
|
+
if (!includesType(it.dataTypes, t)) {
|
|
2467
|
+
strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
|
|
2892
2468
|
}
|
|
2893
2469
|
});
|
|
2894
|
-
it.dataTypes = it.dataTypes.filter((
|
|
2470
|
+
it.dataTypes = it.dataTypes.filter((t) => includesType(types2, t));
|
|
2895
2471
|
}
|
|
2896
2472
|
function checkMultipleTypes(it, ts) {
|
|
2897
2473
|
if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
|
|
@@ -2904,7 +2480,7 @@ function checkKeywordTypes(it, ts) {
|
|
|
2904
2480
|
const rule = rules2[keyword2];
|
|
2905
2481
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
|
|
2906
2482
|
const { type: type2 } = rule.definition;
|
|
2907
|
-
if (type2.length && !type2.some((
|
|
2483
|
+
if (type2.length && !type2.some((t) => hasApplicableType(ts, t))) {
|
|
2908
2484
|
strictTypesError(it, `missing type "${type2.join(",")}" for keyword "${keyword2}"`);
|
|
2909
2485
|
}
|
|
2910
2486
|
}
|
|
@@ -2913,8 +2489,8 @@ function checkKeywordTypes(it, ts) {
|
|
|
2913
2489
|
function hasApplicableType(schTs, kwdT) {
|
|
2914
2490
|
return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
|
|
2915
2491
|
}
|
|
2916
|
-
function includesType(ts,
|
|
2917
|
-
return ts.includes(
|
|
2492
|
+
function includesType(ts, t) {
|
|
2493
|
+
return ts.includes(t) || t === "integer" && ts.includes("number");
|
|
2918
2494
|
}
|
|
2919
2495
|
function strictTypesError(it, msg) {
|
|
2920
2496
|
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
@@ -3270,12 +2846,12 @@ function compileSchema(sch) {
|
|
|
3270
2846
|
}
|
|
3271
2847
|
sch.validate = validate2;
|
|
3272
2848
|
return sch;
|
|
3273
|
-
} catch (
|
|
2849
|
+
} catch (e) {
|
|
3274
2850
|
delete sch.validate;
|
|
3275
2851
|
delete sch.validateName;
|
|
3276
2852
|
if (sourceCode)
|
|
3277
2853
|
this.logger.error("Error compiling schema, function code:", sourceCode);
|
|
3278
|
-
throw
|
|
2854
|
+
throw e;
|
|
3279
2855
|
} finally {
|
|
3280
2856
|
this._compilations.delete(sch);
|
|
3281
2857
|
}
|
|
@@ -3438,8 +3014,8 @@ var uri_all = { exports: {} };
|
|
|
3438
3014
|
function subexp(str) {
|
|
3439
3015
|
return "(?:" + str + ")";
|
|
3440
3016
|
}
|
|
3441
|
-
function typeOf(
|
|
3442
|
-
return
|
|
3017
|
+
function typeOf(o) {
|
|
3018
|
+
return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
|
|
3443
3019
|
}
|
|
3444
3020
|
function toUpperCase(str) {
|
|
3445
3021
|
return str.toUpperCase();
|
|
@@ -3623,7 +3199,7 @@ var uri_all = { exports: {} };
|
|
|
3623
3199
|
var output = [];
|
|
3624
3200
|
var inputLength = input.length;
|
|
3625
3201
|
var i = 0;
|
|
3626
|
-
var
|
|
3202
|
+
var n = initialN;
|
|
3627
3203
|
var bias = initialBias;
|
|
3628
3204
|
var basic = input.lastIndexOf(delimiter);
|
|
3629
3205
|
if (basic < 0) {
|
|
@@ -3637,33 +3213,33 @@ var uri_all = { exports: {} };
|
|
|
3637
3213
|
}
|
|
3638
3214
|
for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
3639
3215
|
var oldi = i;
|
|
3640
|
-
for (var
|
|
3216
|
+
for (var w = 1, k = base; ; k += base) {
|
|
3641
3217
|
if (index >= inputLength) {
|
|
3642
3218
|
error$12("invalid-input");
|
|
3643
3219
|
}
|
|
3644
3220
|
var digit = basicToDigit(input.charCodeAt(index++));
|
|
3645
|
-
if (digit >= base || digit > floor((maxInt - i) /
|
|
3221
|
+
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
|
3646
3222
|
error$12("overflow");
|
|
3647
3223
|
}
|
|
3648
|
-
i += digit *
|
|
3649
|
-
var
|
|
3650
|
-
if (digit <
|
|
3224
|
+
i += digit * w;
|
|
3225
|
+
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
3226
|
+
if (digit < t) {
|
|
3651
3227
|
break;
|
|
3652
3228
|
}
|
|
3653
|
-
var baseMinusT = base -
|
|
3654
|
-
if (
|
|
3229
|
+
var baseMinusT = base - t;
|
|
3230
|
+
if (w > floor(maxInt / baseMinusT)) {
|
|
3655
3231
|
error$12("overflow");
|
|
3656
3232
|
}
|
|
3657
|
-
|
|
3233
|
+
w *= baseMinusT;
|
|
3658
3234
|
}
|
|
3659
3235
|
var out = output.length + 1;
|
|
3660
3236
|
bias = adapt(i - oldi, out, oldi == 0);
|
|
3661
|
-
if (floor(i / out) > maxInt -
|
|
3237
|
+
if (floor(i / out) > maxInt - n) {
|
|
3662
3238
|
error$12("overflow");
|
|
3663
3239
|
}
|
|
3664
|
-
|
|
3240
|
+
n += floor(i / out);
|
|
3665
3241
|
i %= out;
|
|
3666
|
-
output.splice(i++, 0,
|
|
3242
|
+
output.splice(i++, 0, n);
|
|
3667
3243
|
}
|
|
3668
3244
|
return String.fromCodePoint.apply(String, output);
|
|
3669
3245
|
};
|
|
@@ -3671,7 +3247,7 @@ var uri_all = { exports: {} };
|
|
|
3671
3247
|
var output = [];
|
|
3672
3248
|
input = ucs2decode(input);
|
|
3673
3249
|
var inputLength = input.length;
|
|
3674
|
-
var
|
|
3250
|
+
var n = initialN;
|
|
3675
3251
|
var delta = 0;
|
|
3676
3252
|
var bias = initialBias;
|
|
3677
3253
|
var _iteratorNormalCompletion = true;
|
|
@@ -3704,15 +3280,15 @@ var uri_all = { exports: {} };
|
|
|
3704
3280
|
output.push(delimiter);
|
|
3705
3281
|
}
|
|
3706
3282
|
while (handledCPCount < inputLength) {
|
|
3707
|
-
var
|
|
3283
|
+
var m = maxInt;
|
|
3708
3284
|
var _iteratorNormalCompletion2 = true;
|
|
3709
3285
|
var _didIteratorError2 = false;
|
|
3710
3286
|
var _iteratorError2 = void 0;
|
|
3711
3287
|
try {
|
|
3712
3288
|
for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
3713
3289
|
var currentValue = _step2.value;
|
|
3714
|
-
if (currentValue >=
|
|
3715
|
-
|
|
3290
|
+
if (currentValue >= n && currentValue < m) {
|
|
3291
|
+
m = currentValue;
|
|
3716
3292
|
}
|
|
3717
3293
|
}
|
|
3718
3294
|
} catch (err) {
|
|
@@ -3730,30 +3306,30 @@ var uri_all = { exports: {} };
|
|
|
3730
3306
|
}
|
|
3731
3307
|
}
|
|
3732
3308
|
var handledCPCountPlusOne = handledCPCount + 1;
|
|
3733
|
-
if (
|
|
3309
|
+
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
3734
3310
|
error$12("overflow");
|
|
3735
3311
|
}
|
|
3736
|
-
delta += (
|
|
3737
|
-
|
|
3312
|
+
delta += (m - n) * handledCPCountPlusOne;
|
|
3313
|
+
n = m;
|
|
3738
3314
|
var _iteratorNormalCompletion3 = true;
|
|
3739
3315
|
var _didIteratorError3 = false;
|
|
3740
3316
|
var _iteratorError3 = void 0;
|
|
3741
3317
|
try {
|
|
3742
3318
|
for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
3743
3319
|
var _currentValue = _step3.value;
|
|
3744
|
-
if (_currentValue <
|
|
3320
|
+
if (_currentValue < n && ++delta > maxInt) {
|
|
3745
3321
|
error$12("overflow");
|
|
3746
3322
|
}
|
|
3747
|
-
if (_currentValue ==
|
|
3323
|
+
if (_currentValue == n) {
|
|
3748
3324
|
var q = delta;
|
|
3749
3325
|
for (var k = base; ; k += base) {
|
|
3750
|
-
var
|
|
3751
|
-
if (q <
|
|
3326
|
+
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
3327
|
+
if (q < t) {
|
|
3752
3328
|
break;
|
|
3753
3329
|
}
|
|
3754
|
-
var qMinusT = q -
|
|
3755
|
-
var baseMinusT = base -
|
|
3756
|
-
output.push(stringFromCharCode(digitToBasic(
|
|
3330
|
+
var qMinusT = q - t;
|
|
3331
|
+
var baseMinusT = base - t;
|
|
3332
|
+
output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
|
|
3757
3333
|
q = floor(qMinusT / baseMinusT);
|
|
3758
3334
|
}
|
|
3759
3335
|
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
@@ -3777,7 +3353,7 @@ var uri_all = { exports: {} };
|
|
|
3777
3353
|
}
|
|
3778
3354
|
}
|
|
3779
3355
|
++delta;
|
|
3780
|
-
++
|
|
3356
|
+
++n;
|
|
3781
3357
|
}
|
|
3782
3358
|
return output.join("");
|
|
3783
3359
|
};
|
|
@@ -3805,16 +3381,16 @@ var uri_all = { exports: {} };
|
|
|
3805
3381
|
var SCHEMES = {};
|
|
3806
3382
|
function pctEncChar(chr) {
|
|
3807
3383
|
var c = chr.charCodeAt(0);
|
|
3808
|
-
var
|
|
3384
|
+
var e = void 0;
|
|
3809
3385
|
if (c < 16)
|
|
3810
|
-
|
|
3386
|
+
e = "%0" + c.toString(16).toUpperCase();
|
|
3811
3387
|
else if (c < 128)
|
|
3812
|
-
|
|
3388
|
+
e = "%" + c.toString(16).toUpperCase();
|
|
3813
3389
|
else if (c < 2048)
|
|
3814
|
-
|
|
3390
|
+
e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
|
|
3815
3391
|
else
|
|
3816
|
-
|
|
3817
|
-
return
|
|
3392
|
+
e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
|
|
3393
|
+
return e;
|
|
3818
3394
|
}
|
|
3819
3395
|
function pctDecChars(str) {
|
|
3820
3396
|
var newStr = "";
|
|
@@ -3980,8 +3556,8 @@ var uri_all = { exports: {} };
|
|
|
3980
3556
|
if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
|
|
3981
3557
|
try {
|
|
3982
3558
|
components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
|
|
3983
|
-
} catch (
|
|
3984
|
-
components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " +
|
|
3559
|
+
} catch (e) {
|
|
3560
|
+
components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
|
|
3985
3561
|
}
|
|
3986
3562
|
}
|
|
3987
3563
|
_normalizeComponentEncoding(components, URI_PROTOCOL);
|
|
@@ -4033,9 +3609,9 @@ var uri_all = { exports: {} };
|
|
|
4033
3609
|
} else {
|
|
4034
3610
|
var im = input.match(RDS5);
|
|
4035
3611
|
if (im) {
|
|
4036
|
-
var
|
|
4037
|
-
input = input.slice(
|
|
4038
|
-
output.push(
|
|
3612
|
+
var s = im[0];
|
|
3613
|
+
input = input.slice(s.length);
|
|
3614
|
+
output.push(s);
|
|
4039
3615
|
} else {
|
|
4040
3616
|
throw new Error("Unexpected dot segment condition");
|
|
4041
3617
|
}
|
|
@@ -4056,8 +3632,8 @@ var uri_all = { exports: {} };
|
|
|
4056
3632
|
else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
|
|
4057
3633
|
try {
|
|
4058
3634
|
components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
|
|
4059
|
-
} catch (
|
|
4060
|
-
components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " +
|
|
3635
|
+
} catch (e) {
|
|
3636
|
+
components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
4061
3637
|
}
|
|
4062
3638
|
}
|
|
4063
3639
|
}
|
|
@@ -4077,14 +3653,14 @@ var uri_all = { exports: {} };
|
|
|
4077
3653
|
}
|
|
4078
3654
|
}
|
|
4079
3655
|
if (components.path !== void 0) {
|
|
4080
|
-
var
|
|
3656
|
+
var s = components.path;
|
|
4081
3657
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
4082
|
-
|
|
3658
|
+
s = removeDotSegments(s);
|
|
4083
3659
|
}
|
|
4084
3660
|
if (authority === void 0) {
|
|
4085
|
-
|
|
3661
|
+
s = s.replace(/^\/\//, "/%2F");
|
|
4086
3662
|
}
|
|
4087
|
-
uriTokens.push(
|
|
3663
|
+
uriTokens.push(s);
|
|
4088
3664
|
}
|
|
4089
3665
|
if (components.query !== void 0) {
|
|
4090
3666
|
uriTokens.push("?");
|
|
@@ -4304,8 +3880,8 @@ var uri_all = { exports: {} };
|
|
|
4304
3880
|
if (!options.unicodeSupport) {
|
|
4305
3881
|
try {
|
|
4306
3882
|
addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
|
|
4307
|
-
} catch (
|
|
4308
|
-
mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " +
|
|
3883
|
+
} catch (e) {
|
|
3884
|
+
mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
|
|
4309
3885
|
}
|
|
4310
3886
|
} else {
|
|
4311
3887
|
addr[1] = unescapeComponent(addr[1], options).toLowerCase();
|
|
@@ -4325,8 +3901,8 @@ var uri_all = { exports: {} };
|
|
|
4325
3901
|
var domain = toAddr.slice(atIdx + 1);
|
|
4326
3902
|
try {
|
|
4327
3903
|
domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
|
|
4328
|
-
} catch (
|
|
4329
|
-
components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " +
|
|
3904
|
+
} catch (e) {
|
|
3905
|
+
components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
4330
3906
|
}
|
|
4331
3907
|
to[x] = localPart + "@" + domain;
|
|
4332
3908
|
}
|
|
@@ -4507,31 +4083,31 @@ uri$1.default = uri;
|
|
|
4507
4083
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
4508
4084
|
};
|
|
4509
4085
|
const MAX_EXPRESSION = 200;
|
|
4510
|
-
function requiredOptions(
|
|
4086
|
+
function requiredOptions(o) {
|
|
4511
4087
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
4512
|
-
const
|
|
4513
|
-
const _optz = (_a =
|
|
4088
|
+
const s = o.strict;
|
|
4089
|
+
const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
|
|
4514
4090
|
const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
|
|
4515
|
-
const regExp = (_c = (_b =
|
|
4516
|
-
const uriResolver = (_d =
|
|
4091
|
+
const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
|
|
4092
|
+
const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
|
|
4517
4093
|
return {
|
|
4518
|
-
strictSchema: (_f = (_e =
|
|
4519
|
-
strictNumbers: (_h = (_g =
|
|
4520
|
-
strictTypes: (_k = (_j =
|
|
4521
|
-
strictTuples: (_m = (_l =
|
|
4522
|
-
strictRequired: (_p = (_o =
|
|
4523
|
-
code:
|
|
4524
|
-
loopRequired: (_q =
|
|
4525
|
-
loopEnum: (_r =
|
|
4526
|
-
meta: (_s =
|
|
4527
|
-
messages: (_t =
|
|
4528
|
-
inlineRefs: (_u =
|
|
4529
|
-
schemaId: (_v =
|
|
4530
|
-
addUsedSchema: (_w =
|
|
4531
|
-
validateSchema: (_x =
|
|
4532
|
-
validateFormats: (_y =
|
|
4533
|
-
unicodeRegExp: (_z =
|
|
4534
|
-
int32range: (_0 =
|
|
4094
|
+
strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
|
|
4095
|
+
strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
|
|
4096
|
+
strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
|
|
4097
|
+
strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
|
|
4098
|
+
strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
|
|
4099
|
+
code: o.code ? __spreadProps(__spreadValues({}, o.code), { optimize, regExp }) : { optimize, regExp },
|
|
4100
|
+
loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
|
|
4101
|
+
loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
|
|
4102
|
+
meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
|
|
4103
|
+
messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
|
|
4104
|
+
inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
|
|
4105
|
+
schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
|
|
4106
|
+
addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
|
|
4107
|
+
validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
|
|
4108
|
+
validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
|
|
4109
|
+
unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
|
|
4110
|
+
int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
|
|
4535
4111
|
uriResolver
|
|
4536
4112
|
};
|
|
4537
4113
|
}
|
|
@@ -4619,11 +4195,11 @@ uri$1.default = uri;
|
|
|
4619
4195
|
async function _compileAsync(sch) {
|
|
4620
4196
|
try {
|
|
4621
4197
|
return this._compileSchemaEnv(sch);
|
|
4622
|
-
} catch (
|
|
4623
|
-
if (!(
|
|
4624
|
-
throw
|
|
4625
|
-
checkLoaded.call(this,
|
|
4626
|
-
await loadMissingSchema.call(this,
|
|
4198
|
+
} catch (e) {
|
|
4199
|
+
if (!(e instanceof ref_error_12.default))
|
|
4200
|
+
throw e;
|
|
4201
|
+
checkLoaded.call(this, e);
|
|
4202
|
+
await loadMissingSchema.call(this, e.missingSchema);
|
|
4627
4203
|
return _compileAsync.call(this, sch);
|
|
4628
4204
|
}
|
|
4629
4205
|
}
|
|
@@ -4778,7 +4354,7 @@ uri$1.default = uri;
|
|
|
4778
4354
|
type: (0, dataType_12.getJSONTypes)(def2.type),
|
|
4779
4355
|
schemaType: (0, dataType_12.getJSONTypes)(def2.schemaType)
|
|
4780
4356
|
});
|
|
4781
|
-
(0, util_12.eachItem)(keyword2, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((
|
|
4357
|
+
(0, util_12.eachItem)(keyword2, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
|
|
4782
4358
|
return this;
|
|
4783
4359
|
}
|
|
4784
4360
|
getKeyword(keyword2) {
|
|
@@ -4805,7 +4381,7 @@ uri$1.default = uri;
|
|
|
4805
4381
|
errorsText(errors2 = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
4806
4382
|
if (!errors2 || errors2.length === 0)
|
|
4807
4383
|
return "No errors";
|
|
4808
|
-
return errors2.map((
|
|
4384
|
+
return errors2.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);
|
|
4809
4385
|
}
|
|
4810
4386
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
4811
4387
|
const rules2 = this.RULES.all;
|
|
@@ -4975,7 +4551,7 @@ uri$1.default = uri;
|
|
|
4975
4551
|
if (dataType2 && post)
|
|
4976
4552
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
4977
4553
|
const { RULES } = this;
|
|
4978
|
-
let ruleGroup = post ? RULES.post : RULES.rules.find(({ type:
|
|
4554
|
+
let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType2);
|
|
4979
4555
|
if (!ruleGroup) {
|
|
4980
4556
|
ruleGroup = { type: dataType2, rules: [] };
|
|
4981
4557
|
RULES.rules.push(ruleGroup);
|
|
@@ -5094,9 +4670,9 @@ function callRef(cxt, v, sch, $async) {
|
|
|
5094
4670
|
addEvaluatedFrom(v);
|
|
5095
4671
|
if (!allErrors)
|
|
5096
4672
|
gen.assign(valid, true);
|
|
5097
|
-
}, (
|
|
5098
|
-
gen.if((0, codegen_1$9._)`!(${
|
|
5099
|
-
addErrorsFrom(
|
|
4673
|
+
}, (e) => {
|
|
4674
|
+
gen.if((0, codegen_1$9._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
|
|
4675
|
+
addErrorsFrom(e);
|
|
5100
4676
|
if (!allErrors)
|
|
5101
4677
|
gen.assign(valid, false);
|
|
5102
4678
|
});
|
|
@@ -5243,10 +4819,10 @@ function validDate(str) {
|
|
|
5243
4819
|
const matches = DATE.exec(str);
|
|
5244
4820
|
if (!matches)
|
|
5245
4821
|
return false;
|
|
5246
|
-
const
|
|
5247
|
-
const
|
|
5248
|
-
const
|
|
5249
|
-
return
|
|
4822
|
+
const y = +matches[1];
|
|
4823
|
+
const m = +matches[2];
|
|
4824
|
+
const d = +matches[3];
|
|
4825
|
+
return m >= 1 && m <= 12 && d >= 1 && (d <= DAYS[m] || m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0));
|
|
5250
4826
|
}
|
|
5251
4827
|
function validTime(str) {
|
|
5252
4828
|
const matches = TIME.exec(str);
|
|
@@ -5264,19 +4840,19 @@ var error$2 = {};
|
|
|
5264
4840
|
Object.defineProperty(error$2, "__esModule", { value: true });
|
|
5265
4841
|
error$2.typeErrorParams = error$2.typeErrorMessage = error$2.typeError = void 0;
|
|
5266
4842
|
const codegen_1$7 = codegen;
|
|
5267
|
-
function typeError(
|
|
4843
|
+
function typeError(t) {
|
|
5268
4844
|
return {
|
|
5269
|
-
message: (cxt) => typeErrorMessage(cxt,
|
|
5270
|
-
params: (cxt) => typeErrorParams(cxt,
|
|
4845
|
+
message: (cxt) => typeErrorMessage(cxt, t),
|
|
4846
|
+
params: (cxt) => typeErrorParams(cxt, t)
|
|
5271
4847
|
};
|
|
5272
4848
|
}
|
|
5273
4849
|
error$2.typeError = typeError;
|
|
5274
|
-
function typeErrorMessage({ parentSchema },
|
|
5275
|
-
return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${
|
|
4850
|
+
function typeErrorMessage({ parentSchema }, t) {
|
|
4851
|
+
return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`;
|
|
5276
4852
|
}
|
|
5277
4853
|
error$2.typeErrorMessage = typeErrorMessage;
|
|
5278
|
-
function typeErrorParams({ parentSchema },
|
|
5279
|
-
return (0, codegen_1$7._)`{type: ${
|
|
4854
|
+
function typeErrorParams({ parentSchema }, t) {
|
|
4855
|
+
return (0, codegen_1$7._)`{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`;
|
|
5280
4856
|
}
|
|
5281
4857
|
error$2.typeErrorParams = typeErrorParams;
|
|
5282
4858
|
(function(exports) {
|
|
@@ -5835,7 +5411,7 @@ const schema = (root) => ({
|
|
|
5835
5411
|
optionalPropertiesForm,
|
|
5836
5412
|
discriminatorForm,
|
|
5837
5413
|
valuesForm
|
|
5838
|
-
].map((
|
|
5414
|
+
].map((s) => s(root))
|
|
5839
5415
|
}
|
|
5840
5416
|
});
|
|
5841
5417
|
const jtdMetaSchema = __spreadValues({
|
|
@@ -5870,12 +5446,12 @@ const escaped = {
|
|
|
5870
5446
|
'"': '\\"',
|
|
5871
5447
|
"\\": "\\\\"
|
|
5872
5448
|
};
|
|
5873
|
-
function quote(
|
|
5449
|
+
function quote(s) {
|
|
5874
5450
|
rxEscapable.lastIndex = 0;
|
|
5875
|
-
return '"' + (rxEscapable.test(
|
|
5451
|
+
return '"' + (rxEscapable.test(s) ? s.replace(rxEscapable, (a) => {
|
|
5876
5452
|
const c = escaped[a];
|
|
5877
5453
|
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
5878
|
-
}) :
|
|
5454
|
+
}) : s) + '"';
|
|
5879
5455
|
}
|
|
5880
5456
|
quote$1.default = quote;
|
|
5881
5457
|
quote.code = 'require("ajv/dist/runtime/quote").default';
|
|
@@ -5931,12 +5507,12 @@ function compileSerializer(sch, definitions) {
|
|
|
5931
5507
|
const serialize2 = makeSerialize(this.scope.get());
|
|
5932
5508
|
this.scope.value(serializeName, { ref: serialize2 });
|
|
5933
5509
|
sch.serialize = serialize2;
|
|
5934
|
-
} catch (
|
|
5510
|
+
} catch (e) {
|
|
5935
5511
|
if (sourceCode)
|
|
5936
5512
|
this.logger.error("Error compiling serializer, function code:", sourceCode);
|
|
5937
5513
|
delete sch.serialize;
|
|
5938
5514
|
delete sch.serializeName;
|
|
5939
|
-
throw
|
|
5515
|
+
throw e;
|
|
5940
5516
|
} finally {
|
|
5941
5517
|
this._compilations.delete(sch);
|
|
5942
5518
|
}
|
|
@@ -6096,27 +5672,27 @@ var parseJson$1 = {};
|
|
|
6096
5672
|
Object.defineProperty(parseJson$1, "__esModule", { value: true });
|
|
6097
5673
|
parseJson$1.parseJsonString = parseJson$1.parseJsonNumber = parseJson$1.parseJson = void 0;
|
|
6098
5674
|
const rxParseJson = /position\s(\d+)$/;
|
|
6099
|
-
function parseJson(
|
|
5675
|
+
function parseJson(s, pos) {
|
|
6100
5676
|
let endPos;
|
|
6101
5677
|
parseJson.message = void 0;
|
|
6102
5678
|
let matches;
|
|
6103
5679
|
if (pos)
|
|
6104
|
-
|
|
5680
|
+
s = s.slice(pos);
|
|
6105
5681
|
try {
|
|
6106
|
-
parseJson.position = pos +
|
|
6107
|
-
return JSON.parse(
|
|
6108
|
-
} catch (
|
|
6109
|
-
matches = rxParseJson.exec(
|
|
5682
|
+
parseJson.position = pos + s.length;
|
|
5683
|
+
return JSON.parse(s);
|
|
5684
|
+
} catch (e) {
|
|
5685
|
+
matches = rxParseJson.exec(e.message);
|
|
6110
5686
|
if (!matches) {
|
|
6111
5687
|
parseJson.message = "unexpected end";
|
|
6112
5688
|
return void 0;
|
|
6113
5689
|
}
|
|
6114
5690
|
endPos = +matches[1];
|
|
6115
|
-
const c =
|
|
6116
|
-
|
|
5691
|
+
const c = s[endPos];
|
|
5692
|
+
s = s.slice(0, endPos);
|
|
6117
5693
|
parseJson.position = pos + endPos;
|
|
6118
5694
|
try {
|
|
6119
|
-
return JSON.parse(
|
|
5695
|
+
return JSON.parse(s);
|
|
6120
5696
|
} catch (e1) {
|
|
6121
5697
|
parseJson.message = `unexpected token ${c}`;
|
|
6122
5698
|
return void 0;
|
|
@@ -6127,15 +5703,15 @@ parseJson$1.parseJson = parseJson;
|
|
|
6127
5703
|
parseJson.message = void 0;
|
|
6128
5704
|
parseJson.position = 0;
|
|
6129
5705
|
parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson';
|
|
6130
|
-
function parseJsonNumber(
|
|
5706
|
+
function parseJsonNumber(s, pos, maxDigits) {
|
|
6131
5707
|
let numStr = "";
|
|
6132
5708
|
let c;
|
|
6133
5709
|
parseJsonNumber.message = void 0;
|
|
6134
|
-
if (
|
|
5710
|
+
if (s[pos] === "-") {
|
|
6135
5711
|
numStr += "-";
|
|
6136
5712
|
pos++;
|
|
6137
5713
|
}
|
|
6138
|
-
if (
|
|
5714
|
+
if (s[pos] === "0") {
|
|
6139
5715
|
numStr += "0";
|
|
6140
5716
|
pos++;
|
|
6141
5717
|
} else {
|
|
@@ -6148,7 +5724,7 @@ function parseJsonNumber(s2, pos, maxDigits) {
|
|
|
6148
5724
|
parseJsonNumber.position = pos;
|
|
6149
5725
|
return +numStr;
|
|
6150
5726
|
}
|
|
6151
|
-
if (
|
|
5727
|
+
if (s[pos] === ".") {
|
|
6152
5728
|
numStr += ".";
|
|
6153
5729
|
pos++;
|
|
6154
5730
|
if (!parseDigits()) {
|
|
@@ -6156,10 +5732,10 @@ function parseJsonNumber(s2, pos, maxDigits) {
|
|
|
6156
5732
|
return void 0;
|
|
6157
5733
|
}
|
|
6158
5734
|
}
|
|
6159
|
-
if (c =
|
|
5735
|
+
if (c = s[pos], c === "e" || c === "E") {
|
|
6160
5736
|
numStr += "e";
|
|
6161
5737
|
pos++;
|
|
6162
|
-
if (c =
|
|
5738
|
+
if (c = s[pos], c === "+" || c === "-") {
|
|
6163
5739
|
numStr += c;
|
|
6164
5740
|
pos++;
|
|
6165
5741
|
}
|
|
@@ -6172,7 +5748,7 @@ function parseJsonNumber(s2, pos, maxDigits) {
|
|
|
6172
5748
|
return +numStr;
|
|
6173
5749
|
function parseDigits(maxLen) {
|
|
6174
5750
|
let digit = false;
|
|
6175
|
-
while (c =
|
|
5751
|
+
while (c = s[pos], c >= "0" && c <= "9" && (maxLen === void 0 || maxLen-- > 0)) {
|
|
6176
5752
|
digit = true;
|
|
6177
5753
|
numStr += c;
|
|
6178
5754
|
pos++;
|
|
@@ -6181,7 +5757,7 @@ function parseJsonNumber(s2, pos, maxDigits) {
|
|
|
6181
5757
|
}
|
|
6182
5758
|
function errorMessage() {
|
|
6183
5759
|
parseJsonNumber.position = pos;
|
|
6184
|
-
parseJsonNumber.message = pos <
|
|
5760
|
+
parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end";
|
|
6185
5761
|
}
|
|
6186
5762
|
}
|
|
6187
5763
|
parseJson$1.parseJsonNumber = parseJsonNumber;
|
|
@@ -6200,16 +5776,16 @@ const escapedChars = {
|
|
|
6200
5776
|
};
|
|
6201
5777
|
const CODE_A = "a".charCodeAt(0);
|
|
6202
5778
|
const CODE_0 = "0".charCodeAt(0);
|
|
6203
|
-
function parseJsonString(
|
|
5779
|
+
function parseJsonString(s, pos) {
|
|
6204
5780
|
let str = "";
|
|
6205
5781
|
let c;
|
|
6206
5782
|
parseJsonString.message = void 0;
|
|
6207
5783
|
while (true) {
|
|
6208
|
-
c =
|
|
5784
|
+
c = s[pos++];
|
|
6209
5785
|
if (c === '"')
|
|
6210
5786
|
break;
|
|
6211
5787
|
if (c === "\\") {
|
|
6212
|
-
c =
|
|
5788
|
+
c = s[pos];
|
|
6213
5789
|
if (c in escapedChars) {
|
|
6214
5790
|
str += escapedChars[c];
|
|
6215
5791
|
pos++;
|
|
@@ -6219,7 +5795,7 @@ function parseJsonString(s2, pos) {
|
|
|
6219
5795
|
let code2 = 0;
|
|
6220
5796
|
while (count--) {
|
|
6221
5797
|
code2 <<= 4;
|
|
6222
|
-
c =
|
|
5798
|
+
c = s[pos];
|
|
6223
5799
|
if (c === void 0) {
|
|
6224
5800
|
errorMessage("unexpected end");
|
|
6225
5801
|
return void 0;
|
|
@@ -6315,12 +5891,12 @@ function compileParser(sch, definitions) {
|
|
|
6315
5891
|
const parse2 = makeParse(this.scope.get());
|
|
6316
5892
|
this.scope.value(parseName, { ref: parse2 });
|
|
6317
5893
|
sch.parse = parse2;
|
|
6318
|
-
} catch (
|
|
5894
|
+
} catch (e) {
|
|
6319
5895
|
if (sourceCode)
|
|
6320
5896
|
this.logger.error("Error compiling parser, function code:", sourceCode);
|
|
6321
5897
|
delete sch.parse;
|
|
6322
5898
|
delete sch.parseName;
|
|
6323
|
-
throw
|
|
5899
|
+
throw e;
|
|
6324
5900
|
} finally {
|
|
6325
5901
|
this._compilations.delete(sch);
|
|
6326
5902
|
}
|
|
@@ -6503,14 +6079,14 @@ function parseType(cxt) {
|
|
|
6503
6079
|
parseNumber(cxt);
|
|
6504
6080
|
break;
|
|
6505
6081
|
default: {
|
|
6506
|
-
const
|
|
6507
|
-
if (!self2.opts.int32range && (
|
|
6082
|
+
const t = schema2.type;
|
|
6083
|
+
if (!self2.opts.int32range && (t === "int32" || t === "uint32")) {
|
|
6508
6084
|
parseNumber(cxt, 16);
|
|
6509
|
-
if (
|
|
6085
|
+
if (t === "uint32") {
|
|
6510
6086
|
gen.if((0, codegen_1._)`${data} < 0`, () => parsingError(cxt, (0, codegen_1.str)`integer out of range`));
|
|
6511
6087
|
}
|
|
6512
6088
|
} else {
|
|
6513
|
-
const [min, max, maxDigits] = type_1.intRange[
|
|
6089
|
+
const [min, max, maxDigits] = type_1.intRange[t];
|
|
6514
6090
|
parseNumber(cxt, maxDigits);
|
|
6515
6091
|
gen.if((0, codegen_1._)`${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str)`integer out of range`));
|
|
6516
6092
|
}
|
|
@@ -6579,10 +6155,10 @@ function parseToken(cxt, tok) {
|
|
|
6579
6155
|
}
|
|
6580
6156
|
function tryParseToken(cxt, tok, fail, success) {
|
|
6581
6157
|
const { gen } = cxt;
|
|
6582
|
-
const
|
|
6158
|
+
const n = tok.length;
|
|
6583
6159
|
skipWhitespace(cxt);
|
|
6584
|
-
gen.if((0, codegen_1._)`${jsonSlice(
|
|
6585
|
-
gen.add(names_1.default.jsonPos,
|
|
6160
|
+
gen.if((0, codegen_1._)`${jsonSlice(n)} === ${tok}`, () => {
|
|
6161
|
+
gen.add(names_1.default.jsonPos, n);
|
|
6586
6162
|
success === null || success === void 0 ? void 0 : success(cxt);
|
|
6587
6163
|
}, () => fail(cxt));
|
|
6588
6164
|
}
|
|
@@ -6830,25 +6406,25 @@ var oauth2terms = {};
|
|
|
6830
6406
|
exports.compareParameterTypes = compareParameterTypes;
|
|
6831
6407
|
})(oauth2terms);
|
|
6832
6408
|
(function(exports) {
|
|
6833
|
-
var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(
|
|
6409
|
+
var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6834
6410
|
if (k2 === void 0)
|
|
6835
6411
|
k2 = k;
|
|
6836
|
-
var desc = Object.getOwnPropertyDescriptor(
|
|
6837
|
-
if (!desc || ("get" in desc ? !
|
|
6412
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6413
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6838
6414
|
desc = { enumerable: true, get: function() {
|
|
6839
|
-
return
|
|
6415
|
+
return m[k];
|
|
6840
6416
|
} };
|
|
6841
6417
|
}
|
|
6842
|
-
Object.defineProperty(
|
|
6843
|
-
} : function(
|
|
6418
|
+
Object.defineProperty(o, k2, desc);
|
|
6419
|
+
} : function(o, m, k, k2) {
|
|
6844
6420
|
if (k2 === void 0)
|
|
6845
6421
|
k2 = k;
|
|
6846
|
-
|
|
6422
|
+
o[k2] = m[k];
|
|
6847
6423
|
});
|
|
6848
|
-
var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(
|
|
6849
|
-
for (var p in
|
|
6424
|
+
var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports2) {
|
|
6425
|
+
for (var p in m)
|
|
6850
6426
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
6851
|
-
__createBinding(exports2,
|
|
6427
|
+
__createBinding(exports2, m, p);
|
|
6852
6428
|
};
|
|
6853
6429
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6854
6430
|
exports.$stsgdf = exports.$stsgd = void 0;
|
|
@@ -6954,14 +6530,14 @@ var IOauth2ListenerCommand = /* @__PURE__ */ ((IOauth2ListenerCommand2) => {
|
|
|
6954
6530
|
return IOauth2ListenerCommand2;
|
|
6955
6531
|
})(IOauth2ListenerCommand || {});
|
|
6956
6532
|
var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
|
|
6957
|
-
__assign = Object.assign || function(
|
|
6958
|
-
for (var
|
|
6959
|
-
|
|
6960
|
-
for (var p in
|
|
6961
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
6962
|
-
|
|
6963
|
-
}
|
|
6964
|
-
return
|
|
6533
|
+
__assign = Object.assign || function(t) {
|
|
6534
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6535
|
+
s = arguments[i];
|
|
6536
|
+
for (var p in s)
|
|
6537
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6538
|
+
t[p] = s[p];
|
|
6539
|
+
}
|
|
6540
|
+
return t;
|
|
6965
6541
|
};
|
|
6966
6542
|
return __assign.apply(this, arguments);
|
|
6967
6543
|
};
|
|
@@ -6999,7 +6575,7 @@ function parse(cookieString) {
|
|
|
6999
6575
|
try {
|
|
7000
6576
|
var name_1 = parts[0].replace(rdecode, decodeURIComponent);
|
|
7001
6577
|
result[name_1] = cookie.replace(rdecode, decodeURIComponent);
|
|
7002
|
-
} catch (
|
|
6578
|
+
} catch (e) {
|
|
7003
6579
|
}
|
|
7004
6580
|
}
|
|
7005
6581
|
return result;
|
|
@@ -7019,7 +6595,7 @@ function remove(name, attributes) {
|
|
|
7019
6595
|
set(name, "", __assign(__assign({}, attributes), { expires: -1 }));
|
|
7020
6596
|
}
|
|
7021
6597
|
var remove_1 = remove;
|
|
7022
|
-
const debug$1 = Debug(`proc:${
|
|
6598
|
+
const debug$1 = Debug(`proc:${0}:storage.ts`);
|
|
7023
6599
|
var ClientStorageType = /* @__PURE__ */ ((ClientStorageType2) => {
|
|
7024
6600
|
ClientStorageType2["LOCAL_STORAGE"] = "LocalStorage";
|
|
7025
6601
|
ClientStorageType2["SESSION_STORAGE"] = "SessionStorage";
|
|
@@ -7150,58 +6726,7 @@ class ClientStorageFactory {
|
|
|
7150
6726
|
}
|
|
7151
6727
|
}
|
|
7152
6728
|
_storage = new WeakMap();
|
|
7153
|
-
|
|
7154
|
-
this.message = e2;
|
|
7155
|
-
}
|
|
7156
|
-
e.prototype = new Error(), e.prototype.name = "InvalidCharacterError";
|
|
7157
|
-
var r = typeof window != "undefined" && window.atob && window.atob.bind(window) || function(r2) {
|
|
7158
|
-
var t2 = String(r2).replace(/=+$/, "");
|
|
7159
|
-
if (t2.length % 4 == 1)
|
|
7160
|
-
throw new e("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
7161
|
-
for (var n2, o2, a = 0, i = 0, c = ""; o2 = t2.charAt(i++); ~o2 && (n2 = a % 4 ? 64 * n2 + o2 : o2, a++ % 4) ? c += String.fromCharCode(255 & n2 >> (-2 * a & 6)) : 0)
|
|
7162
|
-
o2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o2);
|
|
7163
|
-
return c;
|
|
7164
|
-
};
|
|
7165
|
-
function t(e2) {
|
|
7166
|
-
var t2 = e2.replace(/-/g, "+").replace(/_/g, "/");
|
|
7167
|
-
switch (t2.length % 4) {
|
|
7168
|
-
case 0:
|
|
7169
|
-
break;
|
|
7170
|
-
case 2:
|
|
7171
|
-
t2 += "==";
|
|
7172
|
-
break;
|
|
7173
|
-
case 3:
|
|
7174
|
-
t2 += "=";
|
|
7175
|
-
break;
|
|
7176
|
-
default:
|
|
7177
|
-
throw "Illegal base64url string!";
|
|
7178
|
-
}
|
|
7179
|
-
try {
|
|
7180
|
-
return function(e3) {
|
|
7181
|
-
return decodeURIComponent(r(e3).replace(/(.)/g, function(e4, r2) {
|
|
7182
|
-
var t3 = r2.charCodeAt(0).toString(16).toUpperCase();
|
|
7183
|
-
return t3.length < 2 && (t3 = "0" + t3), "%" + t3;
|
|
7184
|
-
}));
|
|
7185
|
-
}(t2);
|
|
7186
|
-
} catch (e3) {
|
|
7187
|
-
return r(t2);
|
|
7188
|
-
}
|
|
7189
|
-
}
|
|
7190
|
-
function n(e2) {
|
|
7191
|
-
this.message = e2;
|
|
7192
|
-
}
|
|
7193
|
-
function o(e2, r2) {
|
|
7194
|
-
if (typeof e2 != "string")
|
|
7195
|
-
throw new n("Invalid token specified");
|
|
7196
|
-
var o2 = (r2 = r2 || {}).header === true ? 0 : 1;
|
|
7197
|
-
try {
|
|
7198
|
-
return JSON.parse(t(e2.split(".")[o2]));
|
|
7199
|
-
} catch (e3) {
|
|
7200
|
-
throw new n("Invalid token specified: " + e3.message);
|
|
7201
|
-
}
|
|
7202
|
-
}
|
|
7203
|
-
n.prototype = new Error(), n.prototype.name = "InvalidTokenError";
|
|
7204
|
-
const debug = Debug(`proc:${process.pid}:stsoauth2manager.ts`);
|
|
6729
|
+
const debug = Debug(`proc:${0}:stsoauth2manager.ts`);
|
|
7205
6730
|
class STSOAuth2Manager {
|
|
7206
6731
|
constructor(app, options) {
|
|
7207
6732
|
__privateAdd(this, _storageManager, void 0);
|
|
@@ -7379,7 +6904,7 @@ class STSOAuth2Manager {
|
|
|
7379
6904
|
UserDetails(state) {
|
|
7380
6905
|
if (state.sessionData) {
|
|
7381
6906
|
const id_token = state.sessionData;
|
|
7382
|
-
const decodedIdToken =
|
|
6907
|
+
const decodedIdToken = jwt_decode(id_token);
|
|
7383
6908
|
return decodedIdToken;
|
|
7384
6909
|
} else {
|
|
7385
6910
|
return null;
|
|
@@ -7447,7 +6972,7 @@ class STSOAuth2Manager {
|
|
|
7447
6972
|
__privateSet(this, _aic, app.config.globalProperties.$sts.aic.PrimaryPublishInstrumentController);
|
|
7448
6973
|
__privateSet(this, _router, app.config.globalProperties.$router);
|
|
7449
6974
|
__privateSet(this, _transactionStore, new ClientStorageFactory({ clientStorageType: ClientStorageType.SESSION_STORAGE }).GetStorage());
|
|
7450
|
-
__privateSet(this, _worker, new Worker("/assets/stsoauth2worker.
|
|
6975
|
+
__privateSet(this, _worker, new Worker("/assets/stsoauth2worker.14914136.js"));
|
|
7451
6976
|
__privateGet(this, _worker).onmessage = (data) => {
|
|
7452
6977
|
console.log(`this.#worker.onmessage = [${data}]`);
|
|
7453
6978
|
};
|