@simulacrum/auth0-simulator 0.11.0 → 0.11.1
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/index.cjs +114 -209
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -209
- package/dist/index.js.map +1 -1
- package/package.json +11 -4
package/dist/index.js
CHANGED
|
@@ -65,8 +65,7 @@ const convertToObj = (arrayOfObjects, key$1 = "id") => arrayOfObjects.reduce((fi
|
|
|
65
65
|
}, {});
|
|
66
66
|
const convertInitialStateToStoreState = (initialState) => {
|
|
67
67
|
if (!initialState) return void 0;
|
|
68
|
-
|
|
69
|
-
return storeObject;
|
|
68
|
+
return { users: convertToObj(initialState.users, "id") };
|
|
70
69
|
};
|
|
71
70
|
|
|
72
71
|
//#endregion
|
|
@@ -74,12 +73,11 @@ const convertInitialStateToStoreState = (initialState) => {
|
|
|
74
73
|
const inputSchema = (initialState, extendedSchema) => ({ slice: slice$3 }) => {
|
|
75
74
|
const storeInitialState = convertInitialStateToStoreState(initialState);
|
|
76
75
|
const extended = extendedSchema ? extendedSchema({ slice: slice$3 }) : {};
|
|
77
|
-
|
|
76
|
+
return {
|
|
78
77
|
sessions: slice$3.table(),
|
|
79
78
|
users: slice$3.table({ ...!storeInitialState ? { initialState: { [defaultUser.id]: defaultUser } } : { initialState: storeInitialState.users } }),
|
|
80
79
|
...extended
|
|
81
80
|
};
|
|
82
|
-
return slices;
|
|
83
81
|
};
|
|
84
82
|
const inputActions = (args) => {
|
|
85
83
|
return {};
|
|
@@ -178,8 +176,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
|
|
|
178
176
|
function depd(namespace) {
|
|
179
177
|
if (!namespace) throw new TypeError("argument namespace is required");
|
|
180
178
|
var stack = getStack();
|
|
181
|
-
var
|
|
182
|
-
var file = site[0];
|
|
179
|
+
var file = callSiteLocation(stack[1])[0];
|
|
183
180
|
function deprecate$3(message) {
|
|
184
181
|
log$1.call(deprecate$3, message);
|
|
185
182
|
}
|
|
@@ -204,8 +201,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
|
|
|
204
201
|
* @private
|
|
205
202
|
*/
|
|
206
203
|
function eehaslisteners(emitter, type) {
|
|
207
|
-
|
|
208
|
-
return count > 0;
|
|
204
|
+
return (typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type)) > 0;
|
|
209
205
|
}
|
|
210
206
|
/**
|
|
211
207
|
* Determine if namespace is ignored.
|
|
@@ -264,8 +260,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
|
|
|
264
260
|
process.emit("deprecation", err);
|
|
265
261
|
return;
|
|
266
262
|
}
|
|
267
|
-
var
|
|
268
|
-
var output = format$4.call(this, msg, caller, stack.slice(i$6));
|
|
263
|
+
var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller, stack.slice(i$6));
|
|
269
264
|
process.stderr.write(output + "\n", "utf8");
|
|
270
265
|
}
|
|
271
266
|
/**
|
|
@@ -302,8 +297,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
|
|
|
302
297
|
* Format deprecation message without color.
|
|
303
298
|
*/
|
|
304
299
|
function formatPlain(msg, caller, stack) {
|
|
305
|
-
var
|
|
306
|
-
var formatted = timestamp + " " + this._namespace + " deprecated " + msg;
|
|
300
|
+
var formatted = (/* @__PURE__ */ new Date()).toUTCString() + " " + this._namespace + " deprecated " + msg;
|
|
307
301
|
if (this._traced) {
|
|
308
302
|
for (var i$6 = 0; i$6 < stack.length; i$6++) formatted += "\n at " + stack[i$6].toString();
|
|
309
303
|
return formatted;
|
|
@@ -359,8 +353,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
|
|
|
359
353
|
var stack = getStack();
|
|
360
354
|
var site = callSiteLocation(stack[1]);
|
|
361
355
|
site.name = fn.name;
|
|
362
|
-
|
|
363
|
-
return deprecatedfn;
|
|
356
|
+
return new Function("fn", "log", "deprecate", "message", "site", "\"use strict\"\nreturn function (" + args + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn, log$1, this, message, site);
|
|
364
357
|
}
|
|
365
358
|
/**
|
|
366
359
|
* Wrap property in a deprecation message.
|
|
@@ -904,8 +897,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/ms/index.js":
|
|
|
904
897
|
var match$1 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
905
898
|
if (!match$1) return;
|
|
906
899
|
var n = parseFloat(match$1[1]);
|
|
907
|
-
|
|
908
|
-
switch (type) {
|
|
900
|
+
switch ((match$1[2] || "ms").toLowerCase()) {
|
|
909
901
|
case "years":
|
|
910
902
|
case "year":
|
|
911
903
|
case "yrs":
|
|
@@ -937,7 +929,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/ms/index.js":
|
|
|
937
929
|
case "msecs":
|
|
938
930
|
case "msec":
|
|
939
931
|
case "ms": return n;
|
|
940
|
-
default: return
|
|
932
|
+
default: return;
|
|
941
933
|
}
|
|
942
934
|
}
|
|
943
935
|
/**
|
|
@@ -1040,8 +1032,7 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/
|
|
|
1040
1032
|
if (!debug$11.enabled) return;
|
|
1041
1033
|
const self = debug$11;
|
|
1042
1034
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
1043
|
-
|
|
1044
|
-
self.diff = ms$1;
|
|
1035
|
+
self.diff = curr - (prevTime || curr);
|
|
1045
1036
|
self.prev = prevTime;
|
|
1046
1037
|
self.curr = curr;
|
|
1047
1038
|
prevTime = curr;
|
|
@@ -1061,8 +1052,7 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/
|
|
|
1061
1052
|
return match$1;
|
|
1062
1053
|
});
|
|
1063
1054
|
createDebug.formatArgs.call(self, args);
|
|
1064
|
-
|
|
1065
|
-
logFn.apply(self, args);
|
|
1055
|
+
(self.log || createDebug.log).apply(self, args);
|
|
1066
1056
|
}
|
|
1067
1057
|
debug$11.namespace = namespace;
|
|
1068
1058
|
debug$11.useColors = createDebug.useColors();
|
|
@@ -1797,7 +1787,6 @@ var require_on_finished = /* @__PURE__ */ __commonJS({ "../../node_modules/on-fi
|
|
|
1797
1787
|
var socket = msg.socket;
|
|
1798
1788
|
if (typeof msg.finished === "boolean") return Boolean(msg.finished || socket && !socket.writable);
|
|
1799
1789
|
if (typeof msg.complete === "boolean") return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable);
|
|
1800
|
-
return void 0;
|
|
1801
1790
|
}
|
|
1802
1791
|
/**
|
|
1803
1792
|
* Attach a finished listener to the message.
|
|
@@ -1988,8 +1977,7 @@ var require_bytes = /* @__PURE__ */ __commonJS({ "../../node_modules/bytes/index
|
|
|
1988
1977
|
else if (mag >= map.mb) unit = "MB";
|
|
1989
1978
|
else if (mag >= map.kb) unit = "KB";
|
|
1990
1979
|
else unit = "B";
|
|
1991
|
-
var
|
|
1992
|
-
var str = val.toFixed(decimalPlaces);
|
|
1980
|
+
var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces);
|
|
1993
1981
|
if (!fixedDecimals) str = str.replace(formatDecimalsRegExp, "$1");
|
|
1994
1982
|
if (thousandsSeparator) str = str.split(".").map(function(s$1, i$6) {
|
|
1995
1983
|
return i$6 === 0 ? s$1.replace(formatThousandsRegExp, thousandsSeparator) : s$1;
|
|
@@ -27654,8 +27642,7 @@ var require_mime_types = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-t
|
|
|
27654
27642
|
*/
|
|
27655
27643
|
function populateMaps(extensions, types) {
|
|
27656
27644
|
Object.keys(db).forEach(function forEachMimeType(type) {
|
|
27657
|
-
var
|
|
27658
|
-
var exts = mime$5.extensions;
|
|
27645
|
+
var exts = db[type].extensions;
|
|
27659
27646
|
if (!exts || !exts.length) return;
|
|
27660
27647
|
extensions[type] = exts;
|
|
27661
27648
|
for (var i$6 = 0; i$6 < exts.length; i$6++) {
|
|
@@ -27972,7 +27959,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/body-pars
|
|
|
27972
27959
|
try {
|
|
27973
27960
|
return (contentType$1.parse(req$2).parameters.charset || "").toLowerCase();
|
|
27974
27961
|
} catch {
|
|
27975
|
-
return
|
|
27962
|
+
return;
|
|
27976
27963
|
}
|
|
27977
27964
|
}
|
|
27978
27965
|
/**
|
|
@@ -28299,12 +28286,9 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
|
|
|
28299
28286
|
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
|
|
28300
28287
|
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
|
|
28301
28288
|
var setForEach = hasSet && Set.prototype.forEach;
|
|
28302
|
-
var
|
|
28303
|
-
var
|
|
28304
|
-
var
|
|
28305
|
-
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
28306
|
-
var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
|
|
28307
|
-
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
28289
|
+
var weakMapHas = typeof WeakMap === "function" && WeakMap.prototype ? WeakMap.prototype.has : null;
|
|
28290
|
+
var weakSetHas = typeof WeakSet === "function" && WeakSet.prototype ? WeakSet.prototype.has : null;
|
|
28291
|
+
var weakRefDeref = typeof WeakRef === "function" && WeakRef.prototype ? WeakRef.prototype.deref : null;
|
|
28308
28292
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
28309
28293
|
var objectToString = Object.prototype.toString;
|
|
28310
28294
|
var functionToString = Function.prototype.toString;
|
|
@@ -28455,8 +28439,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
|
|
|
28455
28439
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
28456
28440
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
28457
28441
|
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
|
|
28458
|
-
var
|
|
28459
|
-
var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
28442
|
+
var tag = (isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "") + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
28460
28443
|
if (ys.length === 0) return tag + "{}";
|
|
28461
28444
|
if (indent) return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
28462
28445
|
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
@@ -28699,7 +28682,7 @@ var require_side_channel_list = /* @__PURE__ */ __commonJS({ "../../node_modules
|
|
|
28699
28682
|
};
|
|
28700
28683
|
/** @type {import('./list.d.ts').listGet} */
|
|
28701
28684
|
var listGet = function(objects, key$1) {
|
|
28702
|
-
if (!objects) return
|
|
28685
|
+
if (!objects) return;
|
|
28703
28686
|
var node = listGetNode(objects, key$1);
|
|
28704
28687
|
return node && node.value;
|
|
28705
28688
|
};
|
|
@@ -29247,8 +29230,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
|
|
|
29247
29230
|
if (getProto) try {
|
|
29248
29231
|
null.error;
|
|
29249
29232
|
} catch (e) {
|
|
29250
|
-
|
|
29251
|
-
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
29233
|
+
INTRINSICS["%Error.prototype%"] = getProto(getProto(e));
|
|
29252
29234
|
}
|
|
29253
29235
|
var doEval = function doEval$1(name) {
|
|
29254
29236
|
var value;
|
|
@@ -29421,7 +29403,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
|
|
|
29421
29403
|
else if (value != null) {
|
|
29422
29404
|
if (!(part in value)) {
|
|
29423
29405
|
if (!allowMissing) throw new $TypeError$3("base intrinsic for " + name + " exists, but the property is not available.");
|
|
29424
|
-
return
|
|
29406
|
+
return;
|
|
29425
29407
|
}
|
|
29426
29408
|
if ($gOPD && i$6 + 1 >= parts.length) {
|
|
29427
29409
|
var desc$1 = $gOPD(value, part);
|
|
@@ -29525,7 +29507,7 @@ var require_side_channel_weakmap = /* @__PURE__ */ __commonJS({ "../../node_modu
|
|
|
29525
29507
|
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
29526
29508
|
var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
|
|
29527
29509
|
/** @type {import('.')} */
|
|
29528
|
-
module.exports = $WeakMap ? function getSideChannelWeakMap
|
|
29510
|
+
module.exports = $WeakMap ? function getSideChannelWeakMap() {
|
|
29529
29511
|
/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
|
|
29530
29512
|
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
29531
29513
|
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
@@ -29577,8 +29559,7 @@ var require_side_channel = /* @__PURE__ */ __commonJS({ "../../node_modules/side
|
|
|
29577
29559
|
var inspect = require_object_inspect();
|
|
29578
29560
|
var getSideChannelList = require_side_channel_list();
|
|
29579
29561
|
var getSideChannelMap = require_side_channel_map();
|
|
29580
|
-
var
|
|
29581
|
-
var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
|
|
29562
|
+
var makeChannel = require_side_channel_weakmap() || getSideChannelMap || getSideChannelList;
|
|
29582
29563
|
/** @type {import('.')} */
|
|
29583
29564
|
module.exports = function getSideChannel$1() {
|
|
29584
29565
|
/** @typedef {ReturnType<typeof getSideChannel>} Channel */
|
|
@@ -30129,9 +30110,8 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/qs/lib/pars
|
|
|
30129
30110
|
var charset$1 = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
|
|
30130
30111
|
var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
|
|
30131
30112
|
if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
30132
|
-
var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
30133
30113
|
return {
|
|
30134
|
-
allowDots,
|
|
30114
|
+
allowDots: typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots,
|
|
30135
30115
|
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
30136
30116
|
allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
30137
30117
|
allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
|
|
@@ -30510,7 +30490,7 @@ var require_parseurl = /* @__PURE__ */ __commonJS({ "../../node_modules/parseurl
|
|
|
30510
30490
|
*/
|
|
30511
30491
|
function parseurl(req$2) {
|
|
30512
30492
|
var url$2 = req$2.url;
|
|
30513
|
-
if (url$2 === void 0) return
|
|
30493
|
+
if (url$2 === void 0) return;
|
|
30514
30494
|
var parsed = req$2._parsedUrl;
|
|
30515
30495
|
if (fresh$3(url$2, parsed)) return parsed;
|
|
30516
30496
|
parsed = fastparse(url$2);
|
|
@@ -30776,8 +30756,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
|
|
|
30776
30756
|
* @private
|
|
30777
30757
|
*/
|
|
30778
30758
|
function createHtmlDocument$2(message) {
|
|
30779
|
-
|
|
30780
|
-
return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + body + "</pre>\n</body>\n</html>\n";
|
|
30759
|
+
return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + escapeHtml$3(message).replaceAll("\n", "<br>").replaceAll(" ", " ") + "</pre>\n</body>\n</html>\n";
|
|
30781
30760
|
}
|
|
30782
30761
|
/**
|
|
30783
30762
|
* Module exports.
|
|
@@ -30832,7 +30811,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
|
|
|
30832
30811
|
* @private
|
|
30833
30812
|
*/
|
|
30834
30813
|
function getErrorHeaders(err) {
|
|
30835
|
-
if (!err.headers || typeof err.headers !== "object") return
|
|
30814
|
+
if (!err.headers || typeof err.headers !== "object") return;
|
|
30836
30815
|
return { ...err.headers };
|
|
30837
30816
|
}
|
|
30838
30817
|
/**
|
|
@@ -30862,7 +30841,6 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
|
|
|
30862
30841
|
function getErrorStatusCode(err) {
|
|
30863
30842
|
if (typeof err.status === "number" && err.status >= 400 && err.status < 600) return err.status;
|
|
30864
30843
|
if (typeof err.statusCode === "number" && err.statusCode >= 400 && err.statusCode < 600) return err.statusCode;
|
|
30865
|
-
return void 0;
|
|
30866
30844
|
}
|
|
30867
30845
|
/**
|
|
30868
30846
|
* Get resource name for the request.
|
|
@@ -31059,7 +31037,7 @@ var require_view = /* @__PURE__ */ __commonJS({ "../../node_modules/express/lib/
|
|
|
31059
31037
|
try {
|
|
31060
31038
|
return fs$2.statSync(path$4);
|
|
31061
31039
|
} catch (e) {
|
|
31062
|
-
return
|
|
31040
|
+
return;
|
|
31063
31041
|
}
|
|
31064
31042
|
}
|
|
31065
31043
|
}) });
|
|
@@ -31093,8 +31071,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/etag/index.j
|
|
|
31093
31071
|
function entitytag(entity) {
|
|
31094
31072
|
if (entity.length === 0) return "\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"";
|
|
31095
31073
|
var hash = crypto$1.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
|
|
31096
|
-
|
|
31097
|
-
return "\"" + len.toString(16) + "-" + hash + "\"";
|
|
31074
|
+
return "\"" + (typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length).toString(16) + "-" + hash + "\"";
|
|
31098
31075
|
}
|
|
31099
31076
|
/**
|
|
31100
31077
|
* Create a simple ETag.
|
|
@@ -31133,8 +31110,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/etag/index.j
|
|
|
31133
31110
|
*/
|
|
31134
31111
|
function stattag(stat) {
|
|
31135
31112
|
var mtime = stat.mtime.getTime().toString(16);
|
|
31136
|
-
|
|
31137
|
-
return "\"" + size + "-" + mtime + "\"";
|
|
31113
|
+
return "\"" + stat.size.toString(16) + "-" + mtime + "\"";
|
|
31138
31114
|
}
|
|
31139
31115
|
}) });
|
|
31140
31116
|
|
|
@@ -31156,9 +31132,7 @@ var require_forwarded = /* @__PURE__ */ __commonJS({ "../../node_modules/forward
|
|
|
31156
31132
|
function forwarded$1(req$2) {
|
|
31157
31133
|
if (!req$2) throw new TypeError("argument req is required");
|
|
31158
31134
|
var proxyAddrs = parse$5(req$2.headers["x-forwarded-for"] || "");
|
|
31159
|
-
|
|
31160
|
-
var addrs = [socketAddr].concat(proxyAddrs);
|
|
31161
|
-
return addrs;
|
|
31135
|
+
return [getSocketAddr(req$2)].concat(proxyAddrs);
|
|
31162
31136
|
}
|
|
31163
31137
|
/**
|
|
31164
31138
|
* Get the socket address for a request.
|
|
@@ -31201,9 +31175,7 @@ var require_forwarded = /* @__PURE__ */ __commonJS({ "../../node_modules/forward
|
|
|
31201
31175
|
//#region ../../node_modules/ipaddr.js/lib/ipaddr.js
|
|
31202
31176
|
var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/lib/ipaddr.js": ((exports, module) => {
|
|
31203
31177
|
(function() {
|
|
31204
|
-
var expandIPv6, ipaddr$1, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;
|
|
31205
|
-
ipaddr$1 = {};
|
|
31206
|
-
root = this;
|
|
31178
|
+
var expandIPv6, ipaddr$1 = {}, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root = this, zoneIndex;
|
|
31207
31179
|
if (typeof module !== "undefined" && module !== null && module.exports) module.exports = ipaddr$1;
|
|
31208
31180
|
else root["ipaddr"] = ipaddr$1;
|
|
31209
31181
|
matchCIDR = function(first$2, second, partSize, cidrBits) {
|
|
@@ -31365,8 +31337,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31365
31337
|
return ipaddr$1.IPv6.parse("::ffff:" + this.toString());
|
|
31366
31338
|
};
|
|
31367
31339
|
IPv4.prototype.prefixLengthFromSubnetMask = function() {
|
|
31368
|
-
var cidr, i$6, k, octet, stop, zeros, zerotable
|
|
31369
|
-
zerotable = {
|
|
31340
|
+
var cidr, i$6, k, octet, stop, zeros, zerotable = {
|
|
31370
31341
|
0: 8,
|
|
31371
31342
|
128: 7,
|
|
31372
31343
|
192: 6,
|
|
@@ -31398,15 +31369,12 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31398
31369
|
longValue: new RegExp("^" + ipv4Part + "$", "i")
|
|
31399
31370
|
};
|
|
31400
31371
|
ipaddr$1.IPv4.parser = function(string) {
|
|
31401
|
-
var match$1, parseIntAuto
|
|
31402
|
-
parseIntAuto = function(string$1) {
|
|
31372
|
+
var match$1, parseIntAuto = function(string$1) {
|
|
31403
31373
|
if (string$1[0] === "0" && string$1[1] !== "x") return parseInt(string$1, 8);
|
|
31404
31374
|
else return parseInt(string$1);
|
|
31405
|
-
};
|
|
31375
|
+
}, part, shift, value;
|
|
31406
31376
|
if (match$1 = string.match(ipv4Regexes.fourOctet)) return (function() {
|
|
31407
|
-
var k, len, ref, results;
|
|
31408
|
-
ref = match$1.slice(1, 6);
|
|
31409
|
-
results = [];
|
|
31377
|
+
var k, len, ref = match$1.slice(1, 6), results = [];
|
|
31410
31378
|
for (k = 0, len = ref.length; k < len; k++) {
|
|
31411
31379
|
part = ref[k];
|
|
31412
31380
|
results.push(parseIntAuto(part));
|
|
@@ -31417,8 +31385,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31417
31385
|
value = parseIntAuto(match$1[1]);
|
|
31418
31386
|
if (value > 4294967295 || value < 0) throw new Error("ipaddr: address outside defined range");
|
|
31419
31387
|
return (function() {
|
|
31420
|
-
var k, results;
|
|
31421
|
-
results = [];
|
|
31388
|
+
var k, results = [];
|
|
31422
31389
|
for (shift = k = 0; k <= 24; shift = k += 8) results.push(value >> shift & 255);
|
|
31423
31390
|
return results;
|
|
31424
31391
|
})().reverse();
|
|
@@ -31446,9 +31413,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31446
31413
|
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
|
|
31447
31414
|
};
|
|
31448
31415
|
IPv6.prototype.toRFC5952String = function() {
|
|
31449
|
-
var bestMatchIndex, bestMatchLength, match$1, regex, string;
|
|
31450
|
-
regex = /((^|:)(0(:|$)){2,})/g;
|
|
31451
|
-
string = this.toNormalizedString();
|
|
31416
|
+
var bestMatchIndex, bestMatchLength, match$1, regex = /((^|:)(0(:|$)){2,})/g, string = this.toNormalizedString();
|
|
31452
31417
|
bestMatchIndex = 0;
|
|
31453
31418
|
bestMatchLength = -1;
|
|
31454
31419
|
while (match$1 = regex.exec(string)) if (match$1[0].length > bestMatchLength) {
|
|
@@ -31459,9 +31424,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31459
31424
|
return string.substring(0, bestMatchIndex) + "::" + string.substring(bestMatchIndex + bestMatchLength);
|
|
31460
31425
|
};
|
|
31461
31426
|
IPv6.prototype.toByteArray = function() {
|
|
31462
|
-
var bytes$3, k, len, part, ref;
|
|
31463
|
-
bytes$3 = [];
|
|
31464
|
-
ref = this.parts;
|
|
31427
|
+
var bytes$3 = [], k, len, part, ref = this.parts;
|
|
31465
31428
|
for (k = 0, len = ref.length; k < len; k++) {
|
|
31466
31429
|
part = ref[k];
|
|
31467
31430
|
bytes$3.push(part >> 8);
|
|
@@ -31470,34 +31433,26 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31470
31433
|
return bytes$3;
|
|
31471
31434
|
};
|
|
31472
31435
|
IPv6.prototype.toNormalizedString = function() {
|
|
31473
|
-
var addr
|
|
31474
|
-
|
|
31475
|
-
var k, len, ref, results;
|
|
31476
|
-
ref = this.parts;
|
|
31477
|
-
results = [];
|
|
31436
|
+
var addr = (function() {
|
|
31437
|
+
var k, len, ref = this.parts, results = [];
|
|
31478
31438
|
for (k = 0, len = ref.length; k < len; k++) {
|
|
31479
31439
|
part = ref[k];
|
|
31480
31440
|
results.push(part.toString(16));
|
|
31481
31441
|
}
|
|
31482
31442
|
return results;
|
|
31483
|
-
}).call(this).join(":");
|
|
31484
|
-
suffix = "";
|
|
31443
|
+
}).call(this).join(":"), part, suffix = "";
|
|
31485
31444
|
if (this.zoneId) suffix = "%" + this.zoneId;
|
|
31486
31445
|
return addr + suffix;
|
|
31487
31446
|
};
|
|
31488
31447
|
IPv6.prototype.toFixedLengthString = function() {
|
|
31489
|
-
var addr
|
|
31490
|
-
|
|
31491
|
-
var k, len, ref, results;
|
|
31492
|
-
ref = this.parts;
|
|
31493
|
-
results = [];
|
|
31448
|
+
var addr = (function() {
|
|
31449
|
+
var k, len, ref = this.parts, results = [];
|
|
31494
31450
|
for (k = 0, len = ref.length; k < len; k++) {
|
|
31495
31451
|
part = ref[k];
|
|
31496
31452
|
results.push(part.toString(16).padStart(4, "0"));
|
|
31497
31453
|
}
|
|
31498
31454
|
return results;
|
|
31499
|
-
}).call(this).join(":");
|
|
31500
|
-
suffix = "";
|
|
31455
|
+
}).call(this).join(":"), part, suffix = "";
|
|
31501
31456
|
if (this.zoneId) suffix = "%" + this.zoneId;
|
|
31502
31457
|
return addr + suffix;
|
|
31503
31458
|
};
|
|
@@ -31637,8 +31592,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31637
31592
|
]);
|
|
31638
31593
|
};
|
|
31639
31594
|
IPv6.prototype.prefixLengthFromSubnetMask = function() {
|
|
31640
|
-
var cidr, i$6, k, part, stop, zeros, zerotable
|
|
31641
|
-
zerotable = {
|
|
31595
|
+
var cidr, i$6, k, part, stop, zeros, zerotable = {
|
|
31642
31596
|
0: 16,
|
|
31643
31597
|
32768: 15,
|
|
31644
31598
|
49152: 14,
|
|
@@ -31700,9 +31654,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31700
31654
|
if (string[0] === ":") string = string.slice(1);
|
|
31701
31655
|
if (string[string.length - 1] === ":") string = string.slice(0, -1);
|
|
31702
31656
|
parts = (function() {
|
|
31703
|
-
var k, len, ref, results;
|
|
31704
|
-
ref = string.split(":");
|
|
31705
|
-
results = [];
|
|
31657
|
+
var k, len, ref = string.split(":"), results = [];
|
|
31706
31658
|
for (k = 0, len = ref.length; k < len; k++) {
|
|
31707
31659
|
part = ref[k];
|
|
31708
31660
|
results.push(parseInt(part, 16));
|
|
@@ -31745,12 +31697,10 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31745
31697
|
return this.parser(string) !== null;
|
|
31746
31698
|
};
|
|
31747
31699
|
ipaddr$1.IPv4.isValid = function(string) {
|
|
31748
|
-
var e;
|
|
31749
31700
|
try {
|
|
31750
31701
|
new this(this.parser(string));
|
|
31751
31702
|
return true;
|
|
31752
31703
|
} catch (error1) {
|
|
31753
|
-
e = error1;
|
|
31754
31704
|
return false;
|
|
31755
31705
|
}
|
|
31756
31706
|
};
|
|
@@ -31759,26 +31709,23 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31759
31709
|
else return false;
|
|
31760
31710
|
};
|
|
31761
31711
|
ipaddr$1.IPv6.isValid = function(string) {
|
|
31762
|
-
var addr
|
|
31712
|
+
var addr;
|
|
31763
31713
|
if (typeof string === "string" && string.indexOf(":") === -1) return false;
|
|
31764
31714
|
try {
|
|
31765
31715
|
addr = this.parser(string);
|
|
31766
31716
|
new this(addr.parts, addr.zoneId);
|
|
31767
31717
|
return true;
|
|
31768
31718
|
} catch (error1) {
|
|
31769
|
-
e = error1;
|
|
31770
31719
|
return false;
|
|
31771
31720
|
}
|
|
31772
31721
|
};
|
|
31773
31722
|
ipaddr$1.IPv4.parse = function(string) {
|
|
31774
|
-
var parts;
|
|
31775
|
-
parts = this.parser(string);
|
|
31723
|
+
var parts = this.parser(string);
|
|
31776
31724
|
if (parts === null) throw new Error("ipaddr: string is not formatted like ip address");
|
|
31777
31725
|
return new this(parts);
|
|
31778
31726
|
};
|
|
31779
31727
|
ipaddr$1.IPv6.parse = function(string) {
|
|
31780
|
-
var addr;
|
|
31781
|
-
addr = this.parser(string);
|
|
31728
|
+
var addr = this.parser(string);
|
|
31782
31729
|
if (addr.parts === null) throw new Error("ipaddr: string is not formatted like ip address");
|
|
31783
31730
|
return new this(addr.parts, addr.zoneId);
|
|
31784
31731
|
};
|
|
@@ -31816,7 +31763,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31816
31763
|
return new this(octets);
|
|
31817
31764
|
};
|
|
31818
31765
|
ipaddr$1.IPv4.broadcastAddressFromCIDR = function(string) {
|
|
31819
|
-
var cidr,
|
|
31766
|
+
var cidr, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
31820
31767
|
try {
|
|
31821
31768
|
cidr = this.parseCIDR(string);
|
|
31822
31769
|
ipInterfaceOctets = cidr[0].toByteArray();
|
|
@@ -31829,12 +31776,11 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31829
31776
|
}
|
|
31830
31777
|
return new this(octets);
|
|
31831
31778
|
} catch (error1) {
|
|
31832
|
-
error = error1;
|
|
31833
31779
|
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
31834
31780
|
}
|
|
31835
31781
|
};
|
|
31836
31782
|
ipaddr$1.IPv4.networkAddressFromCIDR = function(string) {
|
|
31837
|
-
var cidr,
|
|
31783
|
+
var cidr, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
31838
31784
|
try {
|
|
31839
31785
|
cidr = this.parseCIDR(string);
|
|
31840
31786
|
ipInterfaceOctets = cidr[0].toByteArray();
|
|
@@ -31847,7 +31793,6 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31847
31793
|
}
|
|
31848
31794
|
return new this(octets);
|
|
31849
31795
|
} catch (error1) {
|
|
31850
|
-
error = error1;
|
|
31851
31796
|
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
31852
31797
|
}
|
|
31853
31798
|
};
|
|
@@ -31874,29 +31819,24 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
|
|
|
31874
31819
|
else throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
|
|
31875
31820
|
};
|
|
31876
31821
|
ipaddr$1.parseCIDR = function(string) {
|
|
31877
|
-
var e;
|
|
31878
31822
|
try {
|
|
31879
31823
|
return ipaddr$1.IPv6.parseCIDR(string);
|
|
31880
31824
|
} catch (error1) {
|
|
31881
|
-
e = error1;
|
|
31882
31825
|
try {
|
|
31883
31826
|
return ipaddr$1.IPv4.parseCIDR(string);
|
|
31884
31827
|
} catch (error1$1) {
|
|
31885
|
-
e = error1$1;
|
|
31886
31828
|
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
|
|
31887
31829
|
}
|
|
31888
31830
|
}
|
|
31889
31831
|
};
|
|
31890
31832
|
ipaddr$1.fromByteArray = function(bytes$3) {
|
|
31891
|
-
var length;
|
|
31892
|
-
length = bytes$3.length;
|
|
31833
|
+
var length = bytes$3.length;
|
|
31893
31834
|
if (length === 4) return new ipaddr$1.IPv4(bytes$3);
|
|
31894
31835
|
else if (length === 16) return new ipaddr$1.IPv6(bytes$3);
|
|
31895
31836
|
else throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
|
|
31896
31837
|
};
|
|
31897
31838
|
ipaddr$1.process = function(string) {
|
|
31898
|
-
var addr;
|
|
31899
|
-
addr = this.parse(string);
|
|
31839
|
+
var addr = this.parse(string);
|
|
31900
31840
|
if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) return addr.toIPv4Address();
|
|
31901
31841
|
else return addr;
|
|
31902
31842
|
};
|
|
@@ -32029,8 +31969,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
|
|
|
32029
31969
|
*/
|
|
32030
31970
|
function parseNetmask(netmask) {
|
|
32031
31971
|
var ip = parseip(netmask);
|
|
32032
|
-
|
|
32033
|
-
return kind === "ipv4" ? ip.prefixLengthFromSubnetMask() : null;
|
|
31972
|
+
return ip.kind() === "ipv4" ? ip.prefixLengthFromSubnetMask() : null;
|
|
32034
31973
|
}
|
|
32035
31974
|
/**
|
|
32036
31975
|
* Determine address of proxied request.
|
|
@@ -32043,8 +31982,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
|
|
|
32043
31982
|
if (!req$2) throw new TypeError("req argument is required");
|
|
32044
31983
|
if (!trust) throw new TypeError("trust argument is required");
|
|
32045
31984
|
var addrs = alladdrs(req$2, trust);
|
|
32046
|
-
|
|
32047
|
-
return addr;
|
|
31985
|
+
return addrs[addrs.length - 1];
|
|
32048
31986
|
}
|
|
32049
31987
|
/**
|
|
32050
31988
|
* Static trust function to trust nothing.
|
|
@@ -32096,8 +32034,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
|
|
|
32096
32034
|
return function trust(addr) {
|
|
32097
32035
|
if (!isip(addr)) return false;
|
|
32098
32036
|
var ip = parseip(addr);
|
|
32099
|
-
|
|
32100
|
-
if (kind !== subnetkind) {
|
|
32037
|
+
if (ip.kind() !== subnetkind) {
|
|
32101
32038
|
if (subnetisipv4 && !ip.isIPv4MappedAddress()) return false;
|
|
32102
32039
|
ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress();
|
|
32103
32040
|
}
|
|
@@ -32365,8 +32302,7 @@ var require_once = /* @__PURE__ */ __commonJS({ "../../node_modules/once/once.js
|
|
|
32365
32302
|
f.called = true;
|
|
32366
32303
|
return f.value = fn.apply(this, arguments);
|
|
32367
32304
|
};
|
|
32368
|
-
|
|
32369
|
-
f.onceError = name + " shouldn't be called more than once";
|
|
32305
|
+
f.onceError = (fn.name || "Function wrapped with `once`") + " shouldn't be called more than once";
|
|
32370
32306
|
f.called = false;
|
|
32371
32307
|
return f;
|
|
32372
32308
|
}
|
|
@@ -32386,7 +32322,6 @@ var require_is_promise = /* @__PURE__ */ __commonJS({ "../../node_modules/is-pro
|
|
|
32386
32322
|
//#region ../../node_modules/path-to-regexp/dist/index.js
|
|
32387
32323
|
var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-regexp/dist/index.js": ((exports) => {
|
|
32388
32324
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32389
|
-
exports.PathError = exports.TokenData = void 0;
|
|
32390
32325
|
exports.parse = parse$4;
|
|
32391
32326
|
exports.compile = compile;
|
|
32392
32327
|
exports.match = match;
|
|
@@ -32639,9 +32574,8 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
|
|
|
32639
32574
|
let pattern = `^(?:${sources.join("|")})`;
|
|
32640
32575
|
if (trailing) pattern += `(?:${escape$1(delimiter)}$)?`;
|
|
32641
32576
|
pattern += end ? "$" : `(?=${escape$1(delimiter)}|$)`;
|
|
32642
|
-
const regexp = new RegExp(pattern, flags);
|
|
32643
32577
|
return {
|
|
32644
|
-
regexp,
|
|
32578
|
+
regexp: new RegExp(pattern, flags),
|
|
32645
32579
|
keys
|
|
32646
32580
|
};
|
|
32647
32581
|
}
|
|
@@ -32707,8 +32641,7 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
|
|
|
32707
32641
|
let value = "";
|
|
32708
32642
|
let i$6 = 0;
|
|
32709
32643
|
function name(value$1) {
|
|
32710
|
-
|
|
32711
|
-
return isSafe ? value$1 : JSON.stringify(value$1);
|
|
32644
|
+
return isNameSafe(value$1) && isNextNameSafe(tokens[i$6]) ? value$1 : JSON.stringify(value$1);
|
|
32712
32645
|
}
|
|
32713
32646
|
while (i$6 < tokens.length) {
|
|
32714
32647
|
const token = tokens[i$6++];
|
|
@@ -32799,8 +32732,7 @@ var require_layer = /* @__PURE__ */ __commonJS({ "../../node_modules/router/lib/
|
|
|
32799
32732
|
if (!match$1) return false;
|
|
32800
32733
|
const params = {};
|
|
32801
32734
|
for (let i$6 = 1; i$6 < match$1.length; i$6++) {
|
|
32802
|
-
const
|
|
32803
|
-
const prop = key$1.name;
|
|
32735
|
+
const prop = keys[i$6 - 1].name;
|
|
32804
32736
|
const val = decodeParam(match$1[i$6]);
|
|
32805
32737
|
if (val !== void 0) params[prop] = val;
|
|
32806
32738
|
}
|
|
@@ -33368,7 +33300,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
|
|
|
33368
33300
|
try {
|
|
33369
33301
|
return parseUrl$1(req$2).pathname;
|
|
33370
33302
|
} catch (err) {
|
|
33371
|
-
return
|
|
33303
|
+
return;
|
|
33372
33304
|
}
|
|
33373
33305
|
}
|
|
33374
33306
|
/**
|
|
@@ -33378,7 +33310,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
|
|
|
33378
33310
|
* @private
|
|
33379
33311
|
*/
|
|
33380
33312
|
function getProtohost(url$2) {
|
|
33381
|
-
if (typeof url$2 !== "string" || url$2.length === 0 || url$2[0] === "/") return
|
|
33313
|
+
if (typeof url$2 !== "string" || url$2.length === 0 || url$2[0] === "/") return;
|
|
33382
33314
|
const searchIndex = url$2.indexOf("?");
|
|
33383
33315
|
const pathLength = searchIndex !== -1 ? searchIndex : url$2.length;
|
|
33384
33316
|
const fqdnIndex = url$2.substring(0, pathLength).indexOf("://");
|
|
@@ -33924,8 +33856,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
|
|
|
33924
33856
|
if (renderOptions.cache == null) renderOptions.cache = this.enabled("view cache");
|
|
33925
33857
|
if (renderOptions.cache) view = cache[name];
|
|
33926
33858
|
if (!view) {
|
|
33927
|
-
|
|
33928
|
-
view = new View$2(name, {
|
|
33859
|
+
view = new (this.get("view"))(name, {
|
|
33929
33860
|
defaultEngine: this.get("view engine"),
|
|
33930
33861
|
root: this.get("views"),
|
|
33931
33862
|
engines
|
|
@@ -34702,8 +34633,7 @@ var require_accepts = /* @__PURE__ */ __commonJS({ "../../node_modules/accepts/i
|
|
|
34702
34633
|
if (!types || types.length === 0) return this.negotiator.mediaTypes();
|
|
34703
34634
|
if (!this.headers.accept) return types[0];
|
|
34704
34635
|
var mimes = types.map(extToMime);
|
|
34705
|
-
var
|
|
34706
|
-
var first$2 = accepts$1[0];
|
|
34636
|
+
var first$2 = this.negotiator.mediaTypes(mimes.filter(validMime))[0];
|
|
34707
34637
|
return first$2 ? types[mimes.indexOf(first$2)] : false;
|
|
34708
34638
|
};
|
|
34709
34639
|
/**
|
|
@@ -34831,8 +34761,7 @@ var require_fresh = /* @__PURE__ */ __commonJS({ "../../node_modules/fresh/index
|
|
|
34831
34761
|
}
|
|
34832
34762
|
if (modifiedSince) {
|
|
34833
34763
|
var lastModified = resHeaders["last-modified"];
|
|
34834
|
-
|
|
34835
|
-
if (modifiedStale) return false;
|
|
34764
|
+
if (!lastModified || !(parseHttpDate$1(lastModified) <= parseHttpDate$1(modifiedSince))) return false;
|
|
34836
34765
|
}
|
|
34837
34766
|
return true;
|
|
34838
34767
|
}
|
|
@@ -35207,8 +35136,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
|
|
|
35207
35136
|
*/
|
|
35208
35137
|
defineGetter(req$1, "protocol", function protocol() {
|
|
35209
35138
|
var proto$1 = this.connection.encrypted ? "https" : "http";
|
|
35210
|
-
|
|
35211
|
-
if (!trust(this.connection.remoteAddress, 0)) return proto$1;
|
|
35139
|
+
if (!this.app.get("trust proxy fn")(this.connection.remoteAddress, 0)) return proto$1;
|
|
35212
35140
|
var header = this.get("X-Forwarded-Proto") || proto$1;
|
|
35213
35141
|
var index = header.indexOf(",");
|
|
35214
35142
|
return index !== -1 ? header.substring(0, index).trim() : header.trim();
|
|
@@ -35272,8 +35200,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
|
|
|
35272
35200
|
var hostname = this.hostname;
|
|
35273
35201
|
if (!hostname) return [];
|
|
35274
35202
|
var offset = this.app.get("subdomain offset");
|
|
35275
|
-
|
|
35276
|
-
return subdomains$1.slice(offset);
|
|
35203
|
+
return (!isIP(hostname) ? hostname.split(".").reverse() : [hostname]).slice(offset);
|
|
35277
35204
|
});
|
|
35278
35205
|
/**
|
|
35279
35206
|
* Short-hand for `url.parse(req.url).pathname`.
|
|
@@ -35355,8 +35282,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
|
|
|
35355
35282
|
* @public
|
|
35356
35283
|
*/
|
|
35357
35284
|
defineGetter(req$1, "xhr", function xhr() {
|
|
35358
|
-
|
|
35359
|
-
return val.toLowerCase() === "xmlhttprequest";
|
|
35285
|
+
return (this.get("X-Requested-With") || "").toLowerCase() === "xmlhttprequest";
|
|
35360
35286
|
});
|
|
35361
35287
|
/**
|
|
35362
35288
|
* Helper function for creating a getter on an object.
|
|
@@ -35690,8 +35616,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
|
|
|
35690
35616
|
* @private
|
|
35691
35617
|
*/
|
|
35692
35618
|
function qstring(val) {
|
|
35693
|
-
|
|
35694
|
-
return "\"" + str.replace(QUOTE_REGEXP, "\\$1") + "\"";
|
|
35619
|
+
return "\"" + String(val).replace(QUOTE_REGEXP, "\\$1") + "\"";
|
|
35695
35620
|
}
|
|
35696
35621
|
/**
|
|
35697
35622
|
* Encode a Unicode string for HTTP (RFC 5987).
|
|
@@ -35702,8 +35627,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
|
|
|
35702
35627
|
*/
|
|
35703
35628
|
function ustring(val) {
|
|
35704
35629
|
var str = String(val);
|
|
35705
|
-
|
|
35706
|
-
return "UTF-8''" + encoded;
|
|
35630
|
+
return "UTF-8''" + encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode);
|
|
35707
35631
|
}
|
|
35708
35632
|
/**
|
|
35709
35633
|
* Class for parsed Content-Disposition header for v8 optimization
|
|
@@ -35929,38 +35853,32 @@ var require_cookie = /* @__PURE__ */ __commonJS({ "../../node_modules/cookie/ind
|
|
|
35929
35853
|
if (opt.httpOnly) str += "; HttpOnly";
|
|
35930
35854
|
if (opt.secure) str += "; Secure";
|
|
35931
35855
|
if (opt.partitioned) str += "; Partitioned";
|
|
35932
|
-
if (opt.priority) {
|
|
35933
|
-
|
|
35934
|
-
|
|
35935
|
-
|
|
35936
|
-
|
|
35937
|
-
|
|
35938
|
-
|
|
35939
|
-
|
|
35940
|
-
|
|
35941
|
-
|
|
35942
|
-
|
|
35943
|
-
break;
|
|
35944
|
-
default: throw new TypeError("option priority is invalid");
|
|
35945
|
-
}
|
|
35856
|
+
if (opt.priority) switch (typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority) {
|
|
35857
|
+
case "low":
|
|
35858
|
+
str += "; Priority=Low";
|
|
35859
|
+
break;
|
|
35860
|
+
case "medium":
|
|
35861
|
+
str += "; Priority=Medium";
|
|
35862
|
+
break;
|
|
35863
|
+
case "high":
|
|
35864
|
+
str += "; Priority=High";
|
|
35865
|
+
break;
|
|
35866
|
+
default: throw new TypeError("option priority is invalid");
|
|
35946
35867
|
}
|
|
35947
|
-
if (opt.sameSite) {
|
|
35948
|
-
|
|
35949
|
-
|
|
35950
|
-
|
|
35951
|
-
|
|
35952
|
-
|
|
35953
|
-
|
|
35954
|
-
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
35958
|
-
|
|
35959
|
-
|
|
35960
|
-
|
|
35961
|
-
break;
|
|
35962
|
-
default: throw new TypeError("option sameSite is invalid");
|
|
35963
|
-
}
|
|
35868
|
+
if (opt.sameSite) switch (typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite) {
|
|
35869
|
+
case true:
|
|
35870
|
+
str += "; SameSite=Strict";
|
|
35871
|
+
break;
|
|
35872
|
+
case "lax":
|
|
35873
|
+
str += "; SameSite=Lax";
|
|
35874
|
+
break;
|
|
35875
|
+
case "strict":
|
|
35876
|
+
str += "; SameSite=Strict";
|
|
35877
|
+
break;
|
|
35878
|
+
case "none":
|
|
35879
|
+
str += "; SameSite=None";
|
|
35880
|
+
break;
|
|
35881
|
+
default: throw new TypeError("option sameSite is invalid");
|
|
35964
35882
|
}
|
|
35965
35883
|
return str;
|
|
35966
35884
|
}
|
|
@@ -36614,8 +36532,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
|
|
|
36614
36532
|
* @private
|
|
36615
36533
|
*/
|
|
36616
36534
|
function hasListeners(emitter, type) {
|
|
36617
|
-
|
|
36618
|
-
return count > 0;
|
|
36535
|
+
return (typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type)) > 0;
|
|
36619
36536
|
}
|
|
36620
36537
|
/**
|
|
36621
36538
|
* Normalize the index option into an array.
|
|
@@ -37717,10 +37634,9 @@ var require_object_assign = /* @__PURE__ */ __commonJS({ "../../node_modules/obj
|
|
|
37717
37634
|
if (Object.getOwnPropertyNames(test1)[0] === "5") return false;
|
|
37718
37635
|
var test2 = {};
|
|
37719
37636
|
for (var i$6 = 0; i$6 < 10; i$6++) test2["_" + String.fromCharCode(i$6)] = i$6;
|
|
37720
|
-
|
|
37637
|
+
if (Object.getOwnPropertyNames(test2).map(function(n) {
|
|
37721
37638
|
return test2[n];
|
|
37722
|
-
});
|
|
37723
|
-
if (order2.join("") !== "0123456789") return false;
|
|
37639
|
+
}).join("") !== "0123456789") return false;
|
|
37724
37640
|
var test3 = {};
|
|
37725
37641
|
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
37726
37642
|
test3[letter] = letter;
|
|
@@ -37858,8 +37774,8 @@ var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/cors/lib/inde
|
|
|
37858
37774
|
}
|
|
37859
37775
|
}
|
|
37860
37776
|
function cors$1(options, req$2, res$2, next) {
|
|
37861
|
-
var headers = []
|
|
37862
|
-
if (method === "OPTIONS") {
|
|
37777
|
+
var headers = [];
|
|
37778
|
+
if ((req$2.method && req$2.method.toUpperCase && req$2.method.toUpperCase()) === "OPTIONS") {
|
|
37863
37779
|
headers.push(configureOrigin(options, req$2));
|
|
37864
37780
|
headers.push(configureCredentials(options, req$2));
|
|
37865
37781
|
headers.push(configureMethods(options, req$2));
|
|
@@ -37951,8 +37867,7 @@ const createSession = () => {
|
|
|
37951
37867
|
//#region src/middleware/error-handling.ts
|
|
37952
37868
|
function defaultErrorHandler(error, _req, res$2, next) {
|
|
37953
37869
|
if (res$2.headersSent) return next(error);
|
|
37954
|
-
|
|
37955
|
-
if (error?.message?.startsWith(assertCondition)) {
|
|
37870
|
+
if (error?.message?.startsWith("Assert condition failed: ")) {
|
|
37956
37871
|
let errorCode = 500;
|
|
37957
37872
|
let errorResponse = error.message;
|
|
37958
37873
|
if (error.message.includes("::")) {
|
|
@@ -38072,8 +37987,7 @@ const createWebMessageHandler = () => function(req$2, res$2) {
|
|
|
38072
37987
|
//#endregion
|
|
38073
37988
|
//#region src/handlers/utils.ts
|
|
38074
37989
|
const createPersonQuery = (store) => (predicate) => {
|
|
38075
|
-
|
|
38076
|
-
return users.find(predicate);
|
|
37990
|
+
return store.schema.users.selectTableAsList(store.store.getState()).find(predicate);
|
|
38077
37991
|
};
|
|
38078
37992
|
const deriveScope = ({ scopeConfig, clientID, audience }) => {
|
|
38079
37993
|
if (typeof scopeConfig === "string") return scopeConfig;
|
|
@@ -38267,17 +38181,15 @@ const extensionlessFileName = (fileName) => fileName.indexOf(".") === -1 ? fileN
|
|
|
38267
38181
|
//#endregion
|
|
38268
38182
|
//#region src/rules/parse-rules-files.ts
|
|
38269
38183
|
function parseRulesFiles(rulesPath) {
|
|
38270
|
-
|
|
38271
|
-
return ruleFiles.map((r) => {
|
|
38184
|
+
return fs.readdirSync(rulesPath).filter((f) => path.extname(f) === ".js").map((r) => {
|
|
38272
38185
|
let filename = path.join(rulesPath, r);
|
|
38273
38186
|
let jsonFile = `${extensionlessFileName(filename)}.json`;
|
|
38274
38187
|
assert(!!jsonFile, `no corresponding rule file for ${r}`);
|
|
38275
38188
|
let rawRule = fs.readFileSync(jsonFile, "utf8");
|
|
38276
38189
|
let { enabled, order = 0, stage = "login_success" } = JSON.parse(rawRule);
|
|
38277
|
-
if (!enabled) return
|
|
38278
|
-
let code = fs.readFileSync(filename, { encoding: "utf-8" });
|
|
38190
|
+
if (!enabled) return;
|
|
38279
38191
|
return {
|
|
38280
|
-
code,
|
|
38192
|
+
code: fs.readFileSync(filename, { encoding: "utf-8" }),
|
|
38281
38193
|
filename,
|
|
38282
38194
|
order,
|
|
38283
38195
|
stage
|
|
@@ -38312,7 +38224,7 @@ async function runRule(user, context, rule) {
|
|
|
38312
38224
|
assert(typeof rule !== "undefined", "undefined rule");
|
|
38313
38225
|
let { code, filename } = rule;
|
|
38314
38226
|
console.debug(`executing rule ${path.basename(filename)}`);
|
|
38315
|
-
|
|
38227
|
+
new vm.Script(`
|
|
38316
38228
|
(async function(exports) {
|
|
38317
38229
|
try {
|
|
38318
38230
|
await (${code})(__simulator.user, __simulator.context, resolve);
|
|
@@ -38321,8 +38233,7 @@ async function runRule(user, context, rule) {
|
|
|
38321
38233
|
reject();
|
|
38322
38234
|
}
|
|
38323
38235
|
})(module.exports)
|
|
38324
|
-
`)
|
|
38325
|
-
script.runInContext(vmContext, {
|
|
38236
|
+
`).runInContext(vmContext, {
|
|
38326
38237
|
filename,
|
|
38327
38238
|
displayErrors: true,
|
|
38328
38239
|
timeout: 2e4
|
|
@@ -38380,8 +38291,7 @@ const createTokens = async ({ body, iss, clientID, audience, rulesDirectory, sco
|
|
|
38380
38291
|
else if (grant_type === "refresh_token") {
|
|
38381
38292
|
let { refresh_token: refreshTokenValue } = body;
|
|
38382
38293
|
let refreshToken = JSON.parse(decode(refreshTokenValue));
|
|
38383
|
-
|
|
38384
|
-
user = findUser((person) => person.id === refreshToken.user.id);
|
|
38294
|
+
user = createPersonQuery(simulationStore)((person) => person.id === refreshToken.user.id);
|
|
38385
38295
|
nonce = refreshToken.nonce;
|
|
38386
38296
|
assert(!!nonce, `400::No nonce in request`);
|
|
38387
38297
|
} else {
|
|
@@ -38409,8 +38319,7 @@ const createTokens = async ({ body, iss, clientID, audience, rulesDirectory, sco
|
|
|
38409
38319
|
},
|
|
38410
38320
|
idToken: idTokenData
|
|
38411
38321
|
};
|
|
38412
|
-
|
|
38413
|
-
await rulesRunner(userData, context);
|
|
38322
|
+
await createRulesRunner(rulesDirectory)(userData, context);
|
|
38414
38323
|
return {
|
|
38415
38324
|
access_token: createJsonWebToken({
|
|
38416
38325
|
...accessToken,
|
|
@@ -38586,8 +38495,7 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
|
|
|
38586
38495
|
assert(!!username, "no username in /usernamepassword/login");
|
|
38587
38496
|
assert(!!nonce, "no nonce in /usernamepassword/login");
|
|
38588
38497
|
assert(!!req$2.session, "no session");
|
|
38589
|
-
|
|
38590
|
-
if (!user) {
|
|
38498
|
+
if (!personQuery((person) => person.email?.toLowerCase() === username.toLowerCase() && person.password === password)) {
|
|
38591
38499
|
let query = req$2.query;
|
|
38592
38500
|
let responseClientId = query.client_id ?? clientID;
|
|
38593
38501
|
let responseAudience = query.audience ?? audience;
|
|
@@ -38619,8 +38527,7 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
|
|
|
38619
38527
|
wctx
|
|
38620
38528
|
} });
|
|
38621
38529
|
let { redirect_uri, nonce } = wctx;
|
|
38622
|
-
const
|
|
38623
|
-
const { username } = session ?? {};
|
|
38530
|
+
const { username } = simulationStore.schema.sessions.selectById(simulationStore.store.getState(), { id: nonce }) ?? {};
|
|
38624
38531
|
let encodedNonce = encode(`${nonce}:${username}`);
|
|
38625
38532
|
let qs$2 = stringify({
|
|
38626
38533
|
code: encodedNonce,
|
|
@@ -38665,10 +38572,8 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
|
|
|
38665
38572
|
},
|
|
38666
38573
|
["/userinfo"]: function(req$2, res$2) {
|
|
38667
38574
|
let token = null;
|
|
38668
|
-
if (req$2.headers.authorization)
|
|
38669
|
-
|
|
38670
|
-
token = authorizationHeader?.split(" ")?.[1];
|
|
38671
|
-
} else token = req$2?.query?.access_token;
|
|
38575
|
+
if (req$2.headers.authorization) token = req$2.headers.authorization?.split(" ")?.[1];
|
|
38576
|
+
else token = req$2?.query?.access_token;
|
|
38672
38577
|
assert(!!token, "no authorization header or access_token");
|
|
38673
38578
|
let { sub } = decode$1(token, { json: true });
|
|
38674
38579
|
let user = personQuery((person) => {
|