@continuous-excellence/ze-great-dashboard-aws 0.31.52 → 0.31.54
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/lambda.mjs +145 -93
- package/package.json +1 -1
package/dist/lambda.mjs
CHANGED
|
@@ -16900,8 +16900,7 @@ var init_getUpdatedSystemClockOffset = __esm({
|
|
|
16900
16900
|
if (timeRequestSent !== void 0 && timeResponseReceived - timeRequestSent > 9e5) {
|
|
16901
16901
|
return currentSystemClockOffset;
|
|
16902
16902
|
}
|
|
16903
|
-
|
|
16904
|
-
return candidateSkew;
|
|
16903
|
+
return serverTime - timeResponseReceived;
|
|
16905
16904
|
};
|
|
16906
16905
|
}
|
|
16907
16906
|
});
|
|
@@ -18311,8 +18310,9 @@ var require_dist_cjs5 = __commonJS({
|
|
|
18311
18310
|
var getTransformedHeaders = (headers) => {
|
|
18312
18311
|
const transformedHeaders = {};
|
|
18313
18312
|
for (const name in headers) {
|
|
18314
|
-
if (!hasOwn2(headers, name))
|
|
18313
|
+
if (!hasOwn2(headers, name)) {
|
|
18315
18314
|
continue;
|
|
18315
|
+
}
|
|
18316
18316
|
const headerValues = headers[name];
|
|
18317
18317
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
18318
18318
|
}
|
|
@@ -18515,8 +18515,9 @@ var require_dist_cjs5 = __commonJS({
|
|
|
18515
18515
|
}
|
|
18516
18516
|
if (sockets && requests) {
|
|
18517
18517
|
for (const origin in sockets) {
|
|
18518
|
-
if (!hasOwn2(sockets, origin))
|
|
18518
|
+
if (!hasOwn2(sockets, origin)) {
|
|
18519
18519
|
continue;
|
|
18520
|
+
}
|
|
18520
18521
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
18521
18522
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
18522
18523
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -18680,11 +18681,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
18680
18681
|
updateHttpClientConfig(key, value) {
|
|
18681
18682
|
this.config = void 0;
|
|
18682
18683
|
this.configProvider = this.configProvider.then((config2) => {
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18684
|
+
switch (key) {
|
|
18685
|
+
case /* @__PURE__ */ Symbol.for("logger"):
|
|
18686
|
+
key = "logger";
|
|
18687
|
+
value = config2.logger ?? value;
|
|
18688
|
+
break;
|
|
18689
|
+
case /* @__PURE__ */ Symbol.for("@smithy/defaultSocketTimeout"):
|
|
18690
|
+
key = "defaultSocketTimeout";
|
|
18691
|
+
value = resolveDefaultSocketTimeout(config2) ?? value;
|
|
18692
|
+
break;
|
|
18688
18693
|
}
|
|
18689
18694
|
return {
|
|
18690
18695
|
...config2,
|
|
@@ -19124,6 +19129,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
19124
19129
|
updateHttpClientConfig(key, value) {
|
|
19125
19130
|
this.config = void 0;
|
|
19126
19131
|
this.configProvider = this.configProvider.then((config2) => {
|
|
19132
|
+
switch (key) {
|
|
19133
|
+
case /* @__PURE__ */ Symbol.for("@smithy/defaultSocketTimeout"):
|
|
19134
|
+
key = "defaultSocketTimeout";
|
|
19135
|
+
value = resolveDefaultSocketTimeout(config2) ?? value;
|
|
19136
|
+
break;
|
|
19137
|
+
}
|
|
19127
19138
|
return {
|
|
19128
19139
|
...config2,
|
|
19129
19140
|
[key]: value
|
|
@@ -19383,7 +19394,7 @@ var init_package = __esm({
|
|
|
19383
19394
|
"node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
19384
19395
|
package_default = {
|
|
19385
19396
|
name: "@aws-sdk/nested-clients",
|
|
19386
|
-
version: "3.997.
|
|
19397
|
+
version: "3.997.54",
|
|
19387
19398
|
description: "Nested clients for AWS SDK packages.",
|
|
19388
19399
|
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
|
|
19389
19400
|
license: "Apache-2.0",
|
|
@@ -19483,12 +19494,12 @@ var init_package = __esm({
|
|
|
19483
19494
|
"test:watch": "yarn g:vitest watch"
|
|
19484
19495
|
},
|
|
19485
19496
|
dependencies: {
|
|
19486
|
-
"@aws-sdk/core": "^3.979.
|
|
19487
|
-
"@aws-sdk/signature-v4-multi-region": "^3.996.
|
|
19497
|
+
"@aws-sdk/core": "^3.979.1",
|
|
19498
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.51",
|
|
19488
19499
|
"@aws-sdk/types": "^3.975.0",
|
|
19489
|
-
"@smithy/core": "^3.
|
|
19500
|
+
"@smithy/core": "^3.38.0",
|
|
19490
19501
|
"@smithy/fetch-http-handler": "^5.8.0",
|
|
19491
|
-
"@smithy/node-http-handler": "^4.
|
|
19502
|
+
"@smithy/node-http-handler": "^4.14.0",
|
|
19492
19503
|
"@smithy/types": "^4.19.0",
|
|
19493
19504
|
tslib: "^2.6.2"
|
|
19494
19505
|
},
|
|
@@ -27018,6 +27029,13 @@ var init_enums2 = __esm({
|
|
|
27018
27029
|
CONFLICT: "CONFLICT",
|
|
27019
27030
|
INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS",
|
|
27020
27031
|
INVALID_REQUEST: "INVALID_REQUEST",
|
|
27032
|
+
OAUTH_INVALID_GRANT: "invalid_grant",
|
|
27033
|
+
OAUTH_INVALID_REQUEST: "invalid_request",
|
|
27034
|
+
OAUTH_INVALID_SCOPE: "invalid_scope",
|
|
27035
|
+
OAUTH_INVALID_TARGET: "invalid_target",
|
|
27036
|
+
OAUTH_RATE_EXCEEDED: "rate_exceeded",
|
|
27037
|
+
OAUTH_SERVICE_UNAVAILABLE: "service_unavailable",
|
|
27038
|
+
OAUTH_UNSUPPORTED_GRANT_TYPE: "unsupported_grant_type",
|
|
27021
27039
|
RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND",
|
|
27022
27040
|
SERVER_ERROR: "server_error",
|
|
27023
27041
|
SERVICE_QUOTA_EXCEEDED: "SERVICE_QUOTA_EXCEEDED",
|
|
@@ -27921,7 +27939,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
27921
27939
|
Region: { type: "builtInParams", name: "region" },
|
|
27922
27940
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
27923
27941
|
};
|
|
27924
|
-
var version2 = "3.
|
|
27942
|
+
var version2 = "3.1160.0";
|
|
27925
27943
|
var packageInfo = {
|
|
27926
27944
|
version: version2
|
|
27927
27945
|
};
|
|
@@ -29712,7 +29730,7 @@ var require_dist_cjs17 = __commonJS({
|
|
|
29712
29730
|
Region: { type: "builtInParams", name: "region" },
|
|
29713
29731
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
29714
29732
|
};
|
|
29715
|
-
var version2 = "3.
|
|
29733
|
+
var version2 = "3.1160.0";
|
|
29716
29734
|
var packageInfo = {
|
|
29717
29735
|
version: version2
|
|
29718
29736
|
};
|
|
@@ -74223,6 +74241,15 @@ var getPathNoStrict = (request) => {
|
|
|
74223
74241
|
const result = getPath(request);
|
|
74224
74242
|
return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
|
|
74225
74243
|
};
|
|
74244
|
+
var stripPathPrefix = (rawPath, decodedPath, prefixLength) => {
|
|
74245
|
+
if (rawPath.at(-1) === "/" && decodedPath.at(-1) !== "/") rawPath = rawPath.slice(0, -1);
|
|
74246
|
+
let index = 0;
|
|
74247
|
+
for (let i6 = decodedPath.indexOf("/"); i6 !== -1 && i6 < prefixLength; i6 = decodedPath.indexOf("/", i6 + 1)) {
|
|
74248
|
+
index = rawPath.indexOf("/", index + 1);
|
|
74249
|
+
if (index === -1) return "/";
|
|
74250
|
+
}
|
|
74251
|
+
return rawPath.slice(index) || "/";
|
|
74252
|
+
};
|
|
74226
74253
|
var mergePath = (base, sub, ...rest) => {
|
|
74227
74254
|
if (rest.length) sub = mergePath(sub, ...rest);
|
|
74228
74255
|
return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
|
|
@@ -74803,7 +74830,7 @@ var Context = class {
|
|
|
74803
74830
|
* ```
|
|
74804
74831
|
*/
|
|
74805
74832
|
header = (name, value, options) => {
|
|
74806
|
-
if (this.finalized) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
74833
|
+
if (this.finalized && !this.#res.bodyUsed) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
74807
74834
|
const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
|
|
74808
74835
|
if (value === void 0) headers.delete(name);
|
|
74809
74836
|
else if (options?.append) headers.append(name, value);
|
|
@@ -75032,6 +75059,37 @@ var UnsupportedPathError = class extends Error {
|
|
|
75032
75059
|
// node_modules/hono/dist/utils/constants.js
|
|
75033
75060
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
75034
75061
|
|
|
75062
|
+
// node_modules/hono/dist/utils/mount.js
|
|
75063
|
+
var getPathPrefixLength = (c5, pathPrefix, routePath) => {
|
|
75064
|
+
if (!/[:*]/.test(pathPrefix)) return pathPrefix.length;
|
|
75065
|
+
const path = c5.req.path;
|
|
75066
|
+
const matchResult = c5.req[GET_MATCH_RESULT];
|
|
75067
|
+
const paramNames = /* @__PURE__ */ new Set();
|
|
75068
|
+
let length = 0;
|
|
75069
|
+
for (const part of splitRoutingPath(pathPrefix)) {
|
|
75070
|
+
const pattern = getPattern(part);
|
|
75071
|
+
if (pattern && pattern !== "*") {
|
|
75072
|
+
const name = pattern[1];
|
|
75073
|
+
if (paramNames.has(name)) throw new Error(`mount(): Duplicate path parameter "${name}" in "${routePath}".`);
|
|
75074
|
+
paramNames.add(name);
|
|
75075
|
+
}
|
|
75076
|
+
if (pattern && pattern !== "*" && pattern[2] !== true) {
|
|
75077
|
+
const value = matchResult.length === 2 ? matchResult[1][matchResult[0][c5.req.routeIndex][1][pattern[1]]] : matchResult[0][c5.req.routeIndex][1][pattern[1]];
|
|
75078
|
+
length += value.length + 1;
|
|
75079
|
+
} else if (pattern || part.endsWith("*")) {
|
|
75080
|
+
const end2 = path.indexOf("/", length + 1);
|
|
75081
|
+
length = end2 === -1 ? path.length : end2;
|
|
75082
|
+
} else length += part.length + 1;
|
|
75083
|
+
}
|
|
75084
|
+
return length;
|
|
75085
|
+
};
|
|
75086
|
+
var createMountedRequest = (c5, pathPrefix, routePath) => {
|
|
75087
|
+
if (/[^/]\*$/.test(routePath)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath}".`);
|
|
75088
|
+
const url2 = new URL(c5.req.raw.url);
|
|
75089
|
+
url2.pathname = stripPathPrefix(url2.pathname, c5.req.path, getPathPrefixLength(c5, pathPrefix, routePath));
|
|
75090
|
+
return new Request(url2, c5.req.raw);
|
|
75091
|
+
};
|
|
75092
|
+
|
|
75035
75093
|
// node_modules/hono/dist/hono-base.js
|
|
75036
75094
|
var notFoundHandler = (c5) => {
|
|
75037
75095
|
return c5.text("404 Not Found", 404);
|
|
@@ -75253,17 +75311,10 @@ var Hono = class Hono2 {
|
|
|
75253
75311
|
}
|
|
75254
75312
|
return [c5.env, executionContext];
|
|
75255
75313
|
};
|
|
75256
|
-
|
|
75257
|
-
|
|
75258
|
-
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
75259
|
-
return (request) => {
|
|
75260
|
-
const url2 = new URL(request.url);
|
|
75261
|
-
url2.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
75262
|
-
return new Request(url2, request);
|
|
75263
|
-
};
|
|
75264
|
-
})();
|
|
75314
|
+
const mergedPath = mergePath(this._basePath, path);
|
|
75315
|
+
const defaultReplaceRequest = (c5) => createMountedRequest(c5, mergedPath.replace(/\/$/, ""), mergePath(mergedPath, "*"));
|
|
75265
75316
|
const handler2 = async (c5, next) => {
|
|
75266
|
-
const res = await applicationHandler(replaceRequest(c5.req.raw), ...getOptions(c5));
|
|
75317
|
+
const res = await applicationHandler(replaceRequest ? replaceRequest(c5.req.raw) : defaultReplaceRequest(c5), ...getOptions(c5));
|
|
75267
75318
|
if (res) return res;
|
|
75268
75319
|
await next();
|
|
75269
75320
|
};
|
|
@@ -75395,14 +75446,15 @@ function match(method, path) {
|
|
|
75395
75446
|
|
|
75396
75447
|
// node_modules/hono/dist/router/reg-exp-router/node.js
|
|
75397
75448
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
75398
|
-
var
|
|
75449
|
+
var ONLY_WILDCARD_REG_EXP_STR = "[^]*";
|
|
75450
|
+
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/[^]*)";
|
|
75399
75451
|
var PATH_ERROR = /* @__PURE__ */ Symbol();
|
|
75400
75452
|
var regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
|
|
75401
75453
|
function compareKey(a5, b5) {
|
|
75402
75454
|
if (a5.length === 1) return b5.length === 1 ? a5 < b5 ? -1 : 1 : -1;
|
|
75403
75455
|
if (b5.length === 1) return 1;
|
|
75404
|
-
if (a5 === "
|
|
75405
|
-
else if (b5 === "
|
|
75456
|
+
if (a5 === "[^]*" || a5 === "(?:|/[^]*)") return b5 === "[^]*" ? -1 : 1;
|
|
75457
|
+
else if (b5 === "[^]*" || b5 === "(?:|/[^]*)") return -1;
|
|
75406
75458
|
if (a5 === "[^/]+") return 1;
|
|
75407
75459
|
else if (b5 === "[^/]+") return -1;
|
|
75408
75460
|
return a5.length === b5.length ? a5 < b5 ? -1 : 1 : b5.length - a5.length;
|
|
@@ -75411,14 +75463,14 @@ var Node = class Node2 {
|
|
|
75411
75463
|
#index;
|
|
75412
75464
|
#varIndex;
|
|
75413
75465
|
#children = createNullObject();
|
|
75414
|
-
insert(tokens, index, paramMap, context,
|
|
75466
|
+
insert(tokens, index, paramMap, context, keys) {
|
|
75415
75467
|
let node2 = this;
|
|
75416
75468
|
for (let i6 = 0, len = tokens.length; i6 < len; i6++) {
|
|
75417
75469
|
const token = tokens[i6];
|
|
75418
75470
|
const pattern = token.length === 1 ? token === "*" ? i6 === len - 1 ? [
|
|
75419
75471
|
"",
|
|
75420
75472
|
"",
|
|
75421
|
-
|
|
75473
|
+
ONLY_WILDCARD_REG_EXP_STR
|
|
75422
75474
|
] : [
|
|
75423
75475
|
"",
|
|
75424
75476
|
"",
|
|
@@ -75433,15 +75485,16 @@ var Node = class Node2 {
|
|
|
75433
75485
|
const name = pattern[1];
|
|
75434
75486
|
let regexpStr = pattern[2] || "[^/]+";
|
|
75435
75487
|
if (name && pattern[2]) {
|
|
75436
|
-
if (regexpStr
|
|
75488
|
+
if (new RegExp(regexpStr).test("")) throw PATH_ERROR;
|
|
75437
75489
|
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
|
|
75438
75490
|
if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
|
|
75439
75491
|
if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) throw PATH_ERROR;
|
|
75440
75492
|
}
|
|
75493
|
+
keys.push(regexpStr);
|
|
75441
75494
|
nextNode = node2.#children[regexpStr];
|
|
75442
75495
|
if (!nextNode) {
|
|
75443
|
-
if (regexpStr !== "
|
|
75444
|
-
for (const k5 in node2.#children) if ((regexpStr.length > 1 || k5.length > 1) && k5 !== "
|
|
75496
|
+
if (regexpStr !== "[^]*" && regexpStr !== "(?:|/[^]*)") {
|
|
75497
|
+
for (const k5 in node2.#children) if ((regexpStr.length > 1 || k5.length > 1) && k5 !== "[^]*" && k5 !== "(?:|/[^]*)") throw PATH_ERROR;
|
|
75445
75498
|
}
|
|
75446
75499
|
nextNode = node2.#children[regexpStr] = new Node2();
|
|
75447
75500
|
}
|
|
@@ -75450,16 +75503,17 @@ var Node = class Node2 {
|
|
|
75450
75503
|
paramMap.push([name, nextNode.#varIndex]);
|
|
75451
75504
|
}
|
|
75452
75505
|
} else {
|
|
75506
|
+
keys.push(token);
|
|
75453
75507
|
nextNode = node2.#children[token];
|
|
75454
75508
|
if (!nextNode) {
|
|
75455
|
-
for (const k5 in node2.#children) if (k5.length > 1 && k5 !== "
|
|
75509
|
+
for (const k5 in node2.#children) if (k5.length > 1 && k5 !== "[^]*" && k5 !== "(?:|/[^]*)") throw PATH_ERROR;
|
|
75456
75510
|
nextNode = node2.#children[token] = new Node2();
|
|
75457
75511
|
}
|
|
75458
75512
|
}
|
|
75459
75513
|
node2 = nextNode;
|
|
75460
75514
|
}
|
|
75461
75515
|
if (node2.#index !== void 0) throw PATH_ERROR;
|
|
75462
|
-
node2.#index =
|
|
75516
|
+
node2.#index = index;
|
|
75463
75517
|
}
|
|
75464
75518
|
buildRegExpStr() {
|
|
75465
75519
|
const strList = Object.keys(this.#children).sort(compareKey).map((k5) => {
|
|
@@ -75481,8 +75535,14 @@ var Trie = class {
|
|
|
75481
75535
|
#index = 0;
|
|
75482
75536
|
paths = createNullObject();
|
|
75483
75537
|
insert(path, isStatic) {
|
|
75538
|
+
const keys = [];
|
|
75484
75539
|
if (isStatic) {
|
|
75485
|
-
this.#root.insert(path.split(""),
|
|
75540
|
+
this.#root.insert(path.split(""), -1, [], this.#context, keys);
|
|
75541
|
+
this.paths[path] = [
|
|
75542
|
+
-1,
|
|
75543
|
+
[],
|
|
75544
|
+
keys
|
|
75545
|
+
];
|
|
75486
75546
|
return;
|
|
75487
75547
|
}
|
|
75488
75548
|
const paramAssoc = [];
|
|
@@ -75490,7 +75550,7 @@ var Trie = class {
|
|
|
75490
75550
|
let markedPath = path;
|
|
75491
75551
|
for (let i6 = 0; ; ) {
|
|
75492
75552
|
let replaced = false;
|
|
75493
|
-
markedPath = markedPath.replace(/\{[^}]+\}/g, (m3) => {
|
|
75553
|
+
markedPath = markedPath.replace(/\{(?:\{[\d,]+\}|[^}])+\}/g, (m3) => {
|
|
75494
75554
|
const mark = `@\\${i6}`;
|
|
75495
75555
|
groups[i6] = [mark, m3];
|
|
75496
75556
|
i6++;
|
|
@@ -75499,7 +75559,7 @@ var Trie = class {
|
|
|
75499
75559
|
});
|
|
75500
75560
|
if (!replaced) break;
|
|
75501
75561
|
}
|
|
75502
|
-
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./
|
|
75562
|
+
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./gs) || [];
|
|
75503
75563
|
for (let i6 = groups.length - 1; i6 >= 0; i6--) {
|
|
75504
75564
|
const [mark] = groups[i6];
|
|
75505
75565
|
for (let j5 = tokens.length - 1; j5 >= 0; j5--) if (tokens[j5].indexOf(mark) !== -1) {
|
|
@@ -75507,8 +75567,12 @@ var Trie = class {
|
|
|
75507
75567
|
break;
|
|
75508
75568
|
}
|
|
75509
75569
|
}
|
|
75510
|
-
this.#root.insert(tokens, this.#index, paramAssoc, this.#context,
|
|
75511
|
-
this.paths[path] = [
|
|
75570
|
+
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, keys);
|
|
75571
|
+
this.paths[path] = [
|
|
75572
|
+
this.#index++,
|
|
75573
|
+
paramAssoc,
|
|
75574
|
+
keys
|
|
75575
|
+
];
|
|
75512
75576
|
}
|
|
75513
75577
|
buildRegExp() {
|
|
75514
75578
|
let regexp = this.#root.buildRegExpStr();
|
|
@@ -75540,21 +75604,21 @@ var Trie = class {
|
|
|
75540
75604
|
};
|
|
75541
75605
|
|
|
75542
75606
|
// node_modules/hono/dist/router/reg-exp-router/router.js
|
|
75543
|
-
|
|
75544
|
-
|
|
75545
|
-
return
|
|
75607
|
+
function endsWithWildcard(keys) {
|
|
75608
|
+
const tail = keys[keys.length - 1];
|
|
75609
|
+
return tail === "[^]*" || tail === "(?:|/[^]*)";
|
|
75546
75610
|
}
|
|
75547
|
-
function
|
|
75548
|
-
|
|
75611
|
+
function covers(wildcard, target) {
|
|
75612
|
+
const last = wildcard.length - 1;
|
|
75613
|
+
for (let i6 = 0; i6 < last; i6++) if (wildcard[i6] !== target[i6]) return false;
|
|
75614
|
+
return wildcard[last] === "[^]*" || target.length === last || target[last] === "/";
|
|
75549
75615
|
}
|
|
75550
75616
|
var RegExpRouter = class {
|
|
75551
75617
|
name = "RegExpRouter";
|
|
75552
|
-
#
|
|
75553
|
-
#routes;
|
|
75618
|
+
#handlers;
|
|
75554
75619
|
#tries;
|
|
75555
75620
|
constructor() {
|
|
75556
|
-
this.#
|
|
75557
|
-
this.#routes = { ["ALL"]: createNullObject() };
|
|
75621
|
+
this.#handlers = { ["ALL"]: [] };
|
|
75558
75622
|
this.#tries = { ["ALL"]: new Trie() };
|
|
75559
75623
|
}
|
|
75560
75624
|
#insertPath(method, path) {
|
|
@@ -75565,65 +75629,53 @@ var RegExpRouter = class {
|
|
|
75565
75629
|
}
|
|
75566
75630
|
}
|
|
75567
75631
|
add(method, path, handler2) {
|
|
75568
|
-
const
|
|
75569
|
-
|
|
75570
|
-
|
|
75571
|
-
if (!
|
|
75572
|
-
|
|
75573
|
-
|
|
75574
|
-
|
|
75575
|
-
for (const p3 in handlerMap["ALL"]) {
|
|
75576
|
-
handlerMap[method][p3] = [...handlerMap["ALL"][p3]];
|
|
75577
|
-
this.#insertPath(method, p3);
|
|
75578
|
-
}
|
|
75579
|
-
}
|
|
75632
|
+
const handlers = this.#handlers;
|
|
75633
|
+
if (!handlers) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
75634
|
+
const tries = this.#tries;
|
|
75635
|
+
if (!handlers[method]) {
|
|
75636
|
+
tries[method] = new Trie();
|
|
75637
|
+
handlers[method] = [...handlers["ALL"]];
|
|
75638
|
+
for (const p3 in tries["ALL"].paths) this.#insertPath(method, p3);
|
|
75580
75639
|
}
|
|
75581
75640
|
if (path === "/*") path = "*";
|
|
75582
|
-
const methods = method === "ALL" ? Object.keys(
|
|
75583
|
-
if (/\*$/.test(path)) {
|
|
75584
|
-
const re = buildWildcardRegExp(path);
|
|
75585
|
-
for (const m3 of methods) if (!middleware[m3][path]) {
|
|
75586
|
-
this.#insertPath(m3, path);
|
|
75587
|
-
middleware[m3][path] = findMiddleware(middleware[m3], path) || findMiddleware(middleware["ALL"], path) || [];
|
|
75588
|
-
}
|
|
75589
|
-
for (const handlerMap of [middleware, routes]) for (const m3 of methods) for (const p3 in handlerMap[m3]) re.test(p3) && handlerMap[m3][p3].push([handler2, path]);
|
|
75590
|
-
return;
|
|
75591
|
-
}
|
|
75641
|
+
const methods = method === "ALL" ? Object.keys(handlers) : [method];
|
|
75592
75642
|
const paths = checkOptionalParameter(path) || [path];
|
|
75593
75643
|
for (const path2 of paths) for (const m3 of methods) {
|
|
75594
|
-
if (!
|
|
75595
|
-
|
|
75596
|
-
routes[m3][path2] = findMiddleware(middleware[m3], path2) || findMiddleware(middleware["ALL"], path2) || [];
|
|
75597
|
-
}
|
|
75598
|
-
routes[m3][path2].push([handler2, path2]);
|
|
75644
|
+
if (!tries[m3].paths[path2]) this.#insertPath(m3, path2);
|
|
75645
|
+
handlers[m3].push([handler2, path2]);
|
|
75599
75646
|
}
|
|
75600
75647
|
}
|
|
75601
75648
|
match = match;
|
|
75602
75649
|
buildAllMatchers() {
|
|
75603
75650
|
const matchers = createNullObject();
|
|
75604
|
-
for (const method of Object.keys(this.#
|
|
75605
|
-
this.#
|
|
75606
|
-
wildcardRegExpCache = createNullObject();
|
|
75651
|
+
for (const method of Object.keys(this.#handlers)) matchers[method] = this.#buildMatcher(method);
|
|
75652
|
+
this.#handlers = this.#tries = void 0;
|
|
75607
75653
|
return matchers;
|
|
75608
75654
|
}
|
|
75609
75655
|
#buildMatcher(method) {
|
|
75610
|
-
const
|
|
75611
|
-
const routes = this.#routes[method];
|
|
75656
|
+
const handlers = this.#handlers[method];
|
|
75612
75657
|
const trie = this.#tries[method];
|
|
75613
75658
|
const staticMap = createNullObject();
|
|
75614
75659
|
const handlerData = [];
|
|
75615
75660
|
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
75616
|
-
|
|
75617
|
-
|
|
75618
|
-
|
|
75619
|
-
|
|
75620
|
-
|
|
75621
|
-
continue;
|
|
75622
|
-
}
|
|
75623
|
-
handlerData[pathData[0]] = handlers.map(([h5, handlerPath]) => [h5, trie.paths[handlerPath][1].reduceRight((map4, [key], i6) => {
|
|
75624
|
-
map4[key] = paramReplacementMap[pathData[1][i6][1]];
|
|
75661
|
+
const own2 = createNullObject();
|
|
75662
|
+
const entries = handlers.map(([h5, p3], i6) => {
|
|
75663
|
+
(own2[p3] ??= []).push(i6);
|
|
75664
|
+
return [h5, trie.paths[p3][1].reduceRight((map4, [key, varIndex]) => {
|
|
75665
|
+
map4[key] = paramReplacementMap[varIndex];
|
|
75625
75666
|
return map4;
|
|
75626
|
-
}, createNullObject())]
|
|
75667
|
+
}, createNullObject())];
|
|
75668
|
+
});
|
|
75669
|
+
const wildcards = Object.keys(own2).filter((p3) => endsWithWildcard(trie.paths[p3][2]));
|
|
75670
|
+
for (const path in trie.paths) {
|
|
75671
|
+
const [index, , keys] = trie.paths[path];
|
|
75672
|
+
const indexes = [...own2[path]];
|
|
75673
|
+
for (const p3 of wildcards) if (p3 !== path && covers(trie.paths[p3][2], keys)) indexes.push(...own2[p3]);
|
|
75674
|
+
const data = indexes.sort((a5, b5) => a5 - b5).map((i6) => entries[i6]);
|
|
75675
|
+
if (index === -1) {
|
|
75676
|
+
const last = Math.max(-1, ...data.flatMap(([, map4]) => Object.values(map4)));
|
|
75677
|
+
staticMap[path] = [data, last === -1 ? emptyParam : path.match(regexp).slice(0, last + 1)];
|
|
75678
|
+
} else handlerData[index] = data;
|
|
75627
75679
|
}
|
|
75628
75680
|
return [
|
|
75629
75681
|
regexp,
|
package/package.json
CHANGED