@continuous-excellence/ze-great-dashboard-aws 0.31.66 → 0.31.67

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.
Files changed (2) hide show
  1. package/dist/lambda.mjs +76 -25
  2. package/package.json +1 -1
package/dist/lambda.mjs CHANGED
@@ -27232,7 +27232,8 @@ var require_dist_cjs11 = __commonJS({
27232
27232
  return requestHandler2?.metadata?.handlerProtocol === "h2";
27233
27233
  };
27234
27234
  const requestHandler = isH22(this.callerClientConfig?.requestHandler) ? void 0 : this.callerClientConfig?.requestHandler;
27235
- const region = this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION;
27235
+ const signInRegion = typeof freshToken.signInRegion === "string" && freshToken.signInRegion.length > 0 ? freshToken.signInRegion : void 0;
27236
+ const region = signInRegion ?? this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION;
27236
27237
  const client = new SigninClient2({
27237
27238
  credentials: {
27238
27239
  accessKeyId: "",
@@ -27242,7 +27243,8 @@ var require_dist_cjs11 = __commonJS({
27242
27243
  requestHandler,
27243
27244
  logger: logger2,
27244
27245
  userAgentAppId,
27245
- ...this.init?.clientConfig
27246
+ ...this.init?.clientConfig,
27247
+ ...signInRegion && { region: signInRegion }
27246
27248
  });
27247
27249
  this.createDPoPInterceptor(client.middlewareStack);
27248
27250
  const commandInput = {
@@ -28010,7 +28012,7 @@ var require_dist_cjs16 = __commonJS({
28010
28012
  Region: { type: "builtInParams", name: "region" },
28011
28013
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
28012
28014
  };
28013
- var version2 = "3.1165.0";
28015
+ var version2 = "3.1166.0";
28014
28016
  var packageInfo = {
28015
28017
  version: version2
28016
28018
  };
@@ -29802,7 +29804,7 @@ var require_dist_cjs17 = __commonJS({
29802
29804
  Region: { type: "builtInParams", name: "region" },
29803
29805
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
29804
29806
  };
29805
- var version2 = "3.1165.0";
29807
+ var version2 = "3.1166.0";
29806
29808
  var packageInfo = {
29807
29809
  version: version2
29808
29810
  };
@@ -74364,6 +74366,34 @@ function unsupportedPanelOperation(boardName, panel, source, error63) {
74364
74366
  );
74365
74367
  }
74366
74368
 
74369
+ // node_modules/hono/dist/http-exception.js
74370
+ var HTTPException = class extends Error {
74371
+ res;
74372
+ status;
74373
+ /**
74374
+ * Creates an instance of `HTTPException`.
74375
+ * @param status - HTTP status code for the exception. Defaults to 500.
74376
+ * @param options - Additional options for the exception.
74377
+ */
74378
+ constructor(status = 500, options) {
74379
+ super(options?.message, { cause: options?.cause });
74380
+ this.res = options?.res;
74381
+ this.status = status;
74382
+ }
74383
+ /**
74384
+ * Returns the response object associated with the exception.
74385
+ * If a response object is not provided, a new response is created with the error message and status code.
74386
+ * @returns The response object.
74387
+ */
74388
+ getResponse() {
74389
+ if (this.res) return new Response(this.res.body, {
74390
+ status: this.status,
74391
+ headers: this.res.headers
74392
+ });
74393
+ return new Response(this.message, { status: this.status });
74394
+ }
74395
+ };
74396
+
74367
74397
  // node_modules/hono/dist/request/constants.js
74368
74398
  var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
74369
74399
 
@@ -74442,8 +74472,8 @@ var splitPath = (path) => {
74442
74472
  if (paths[0] === "") paths.shift();
74443
74473
  return paths;
74444
74474
  };
74445
- var splitRoutingPath = (routePath) => {
74446
- const { groups, path } = extractGroupsFromPath(routePath);
74475
+ var splitRoutingPath = (routePath2) => {
74476
+ const { groups, path } = extractGroupsFromPath(routePath2);
74447
74477
  const paths = splitPath(path);
74448
74478
  return replaceGroupMarks(paths, groups);
74449
74479
  };
@@ -74508,7 +74538,7 @@ var tryDecode = (str, decoder2) => {
74508
74538
  });
74509
74539
  }
74510
74540
  };
74511
- var tryDecodeURI = (str) => tryDecode(str, decodeURI);
74541
+ var decodeURIWithPreservedPercent = (value) => decodeURI(value.includes("%25") ? value.replace(/%25/g, "%2525") : value);
74512
74542
  var getPath = (request) => {
74513
74543
  const url2 = request.url;
74514
74544
  const start = url2.indexOf("/", url2.indexOf(":") + 4);
@@ -74520,7 +74550,13 @@ var getPath = (request) => {
74520
74550
  const hashIndex = url2.indexOf("#", i6);
74521
74551
  const end2 = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
74522
74552
  const path = url2.slice(start, end2);
74523
- return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path);
74553
+ const decoded = tryDecode(path, decodeURIWithPreservedPercent);
74554
+ if (/%(?![0-9A-Fa-f]{2})/.test(path)) {
74555
+ const rewritten = new URL("http://localhost");
74556
+ rewritten.pathname = decoded.replace(/[\\\t\n\r]/g, encodeURIComponent);
74557
+ if (tryDecode(rewritten.pathname, decodeURIWithPreservedPercent) !== decoded) return tryDecode(path.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"), decodeURIWithPreservedPercent);
74558
+ }
74559
+ return decoded;
74524
74560
  } else if (charCode === 63 || charCode === 35) break;
74525
74561
  }
74526
74562
  return url2.slice(start, i6);
@@ -74529,15 +74565,6 @@ var getPathNoStrict = (request) => {
74529
74565
  const result = getPath(request);
74530
74566
  return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
74531
74567
  };
74532
- var stripPathPrefix = (rawPath, decodedPath, prefixLength) => {
74533
- if (rawPath.at(-1) === "/" && decodedPath.at(-1) !== "/") rawPath = rawPath.slice(0, -1);
74534
- let index = 0;
74535
- for (let i6 = decodedPath.indexOf("/"); i6 !== -1 && i6 < prefixLength; i6 = decodedPath.indexOf("/", i6 + 1)) {
74536
- index = rawPath.indexOf("/", index + 1);
74537
- if (index === -1) return "/";
74538
- }
74539
- return rawPath.slice(index) || "/";
74540
- };
74541
74568
  var mergePath = (base, sub, ...rest) => {
74542
74569
  if (rest.length) sub = mergePath(sub, ...rest);
74543
74570
  return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
@@ -75330,6 +75357,10 @@ var compose = (middleware, onError, onNotFound) => {
75330
75357
  };
75331
75358
  };
75332
75359
 
75360
+ // node_modules/hono/dist/helper/route/index.js
75361
+ var matchedRoutes = (c5) => c5.req[GET_MATCH_RESULT][0].map(([[, route]]) => route);
75362
+ var routePath = (c5, index) => matchedRoutes(c5).at(index ?? c5.req.routeIndex)?.path ?? "";
75363
+
75333
75364
  // node_modules/hono/dist/router.js
75334
75365
  var METHODS = [
75335
75366
  "get",
@@ -75348,17 +75379,23 @@ var UnsupportedPathError = class extends Error {
75348
75379
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
75349
75380
 
75350
75381
  // node_modules/hono/dist/utils/mount.js
75351
- var getPathPrefixLength = (c5, pathPrefix, routePath) => {
75382
+ var countTrailingSlashes = (path) => {
75383
+ let index = path.length;
75384
+ while (index > 0 && path.charCodeAt(index - 1) === 47) index--;
75385
+ return path.length - index;
75386
+ };
75387
+ var getPathPrefixLength = (c5, pathPrefix, routePath2) => {
75352
75388
  if (!/[:*]/.test(pathPrefix)) return pathPrefix.length;
75353
75389
  const path = c5.req.path;
75354
75390
  const matchResult = c5.req[GET_MATCH_RESULT];
75355
75391
  const paramNames = /* @__PURE__ */ new Set();
75356
75392
  let length = 0;
75357
75393
  for (const part of splitRoutingPath(pathPrefix)) {
75394
+ if (part[0] === ":" && part.endsWith("}?")) throw new Error(`mount(): Optional regular expression parameters are not supported in "${routePath2}".`);
75358
75395
  const pattern = getPattern(part);
75359
75396
  if (pattern && pattern !== "*") {
75360
75397
  const name = pattern[1];
75361
- if (paramNames.has(name)) throw new Error(`mount(): Duplicate path parameter "${name}" in "${routePath}".`);
75398
+ if (paramNames.has(name)) throw new Error(`mount(): Duplicate path parameter "${name}" in "${routePath2}".`);
75362
75399
  paramNames.add(name);
75363
75400
  }
75364
75401
  if (pattern && pattern !== "*" && pattern[2] !== true) {
@@ -75371,10 +75408,20 @@ var getPathPrefixLength = (c5, pathPrefix, routePath) => {
75371
75408
  }
75372
75409
  return length;
75373
75410
  };
75374
- var createMountedRequest = (c5, pathPrefix, routePath) => {
75375
- if (/[^/]\*$/.test(routePath)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath}".`);
75376
- const url2 = new URL(c5.req.raw.url);
75377
- url2.pathname = stripPathPrefix(url2.pathname, c5.req.path, getPathPrefixLength(c5, pathPrefix, routePath));
75411
+ var createMountedRequest = (c5, pathPrefix, routePath2) => {
75412
+ if (/[^/]\*$/.test(routePath2)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath2}".`);
75413
+ const prefixLength = getPathPrefixLength(c5, pathPrefix, routePath2);
75414
+ const path = c5.req.path.slice(prefixLength) || "/";
75415
+ if (prefixLength > c5.req.path.length || path[0] !== "/" || /\/(?:\.|%2e){1,2}(?:\/|$)/i.test(path)) throw new HTTPException(400, { message: "Invalid mounted path" });
75416
+ const rawUrl = c5.req.raw.url;
75417
+ if (/^[^/?#]*\/\/[^/?#\\]*[?#\\]/.test(rawUrl)) throw new HTTPException(400, { message: "Invalid mounted path" });
75418
+ const rawPathEnd = rawUrl.search(/[?#]/);
75419
+ const rawTrailingSlashes = countTrailingSlashes(rawPathEnd === -1 ? rawUrl : rawUrl.slice(0, rawPathEnd));
75420
+ if (rawTrailingSlashes > 1 && countTrailingSlashes(c5.req.path) === rawTrailingSlashes - 1) throw new HTTPException(400, { message: "Invalid mounted path" });
75421
+ const url2 = new URL(rawUrl);
75422
+ url2.pathname = path.replace(/[\\\t\n\r]/g, encodeURIComponent);
75423
+ if (path.includes("%")) {
75424
+ }
75378
75425
  return new Request(url2, c5.req.raw);
75379
75426
  };
75380
75427
 
@@ -75554,6 +75601,8 @@ var Hono = class Hono2 {
75554
75601
  * @param {Function} applicationHandler - other Request Handler
75555
75602
  * @param {MountOptions} [options] - options of `.mount()`
75556
75603
  * @returns {Hono} mounted Hono instance
75604
+ * @throws {Error} If automatic request rewriting encounters duplicate path parameter names or an optional regular expression parameter.
75605
+ * @throws {HTTPException} With status 400 if automatic request rewriting cannot safely preserve the routed path.
75557
75606
  *
75558
75607
  * @example
75559
75608
  * ```ts
@@ -75599,8 +75648,10 @@ var Hono = class Hono2 {
75599
75648
  }
75600
75649
  return [c5.env, executionContext];
75601
75650
  };
75602
- const mergedPath = mergePath(this._basePath, path);
75603
- const defaultReplaceRequest = (c5) => createMountedRequest(c5, mergedPath.replace(/\/$/, ""), mergePath(mergedPath, "*"));
75651
+ const defaultReplaceRequest = (c5) => {
75652
+ const mountedRoutePath = routePath(c5);
75653
+ return createMountedRequest(c5, mountedRoutePath.replace(/\/?\*$/, ""), mountedRoutePath);
75654
+ };
75604
75655
  const handler2 = async (c5, next) => {
75605
75656
  const res = await applicationHandler(replaceRequest ? replaceRequest(c5.req.raw) : defaultReplaceRequest(c5), ...getOptions(c5));
75606
75657
  if (res) return res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@continuous-excellence/ze-great-dashboard-aws",
3
- "version": "0.31.66",
3
+ "version": "0.31.67",
4
4
  "type": "module",
5
5
  "description": "AWS server runtime and CloudFormation deployment tooling for Ze Great Dashboard.",
6
6
  "keywords": [