@zuplo/cli 7.4.5 → 7.4.6

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 (177) hide show
  1. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/remote.d.ts +4 -4
  2. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +3 -3
  3. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +8 -14
  4. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +8 -14
  5. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -15
  6. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +30 -8
  7. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +8 -4
  8. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +6 -13
  9. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/decrypt.js +19 -19
  10. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +27 -20
  11. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/embedded.js +15 -1
  12. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +11 -5
  13. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +45 -53
  14. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +82 -103
  15. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/sign.js +10 -9
  16. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/sign.js +2 -1
  17. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/verify.js +8 -7
  18. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +5 -3
  19. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +51 -21
  20. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/decrypt.js +7 -9
  21. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +21 -50
  22. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +8 -41
  23. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +21 -42
  24. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_key_pair.js +6 -2
  25. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +7 -6
  26. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/import.js +16 -12
  27. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +7 -2
  28. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +7 -15
  29. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/deflate.js +8 -0
  30. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/helpers.js +1 -1
  31. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +85 -28
  32. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +40 -12
  33. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_metadata.js +20 -0
  34. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +47 -36
  35. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +77 -45
  36. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +82 -47
  37. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +24 -9
  38. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +10 -4
  39. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_options.js +6 -0
  40. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/options.js +26 -0
  41. package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/type_checks.js +11 -13
  42. package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
  43. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +4 -4
  44. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +3 -3
  45. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +8 -14
  46. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +8 -14
  47. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -15
  48. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +30 -8
  49. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +8 -4
  50. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +6 -13
  51. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +19 -19
  52. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +27 -20
  53. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +15 -1
  54. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +11 -5
  55. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +45 -53
  56. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +82 -103
  57. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +10 -9
  58. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +2 -1
  59. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +8 -7
  60. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +5 -3
  61. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +51 -21
  62. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +7 -9
  63. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +21 -50
  64. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +8 -41
  65. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +21 -42
  66. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +6 -2
  67. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +7 -6
  68. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +16 -12
  69. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +7 -2
  70. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +7 -15
  71. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +8 -0
  72. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +1 -1
  73. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +85 -28
  74. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +40 -12
  75. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_metadata.js +20 -0
  76. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +47 -36
  77. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +77 -45
  78. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +82 -47
  79. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +24 -9
  80. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +10 -4
  81. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_options.js +6 -0
  82. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/options.js +26 -0
  83. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/type_checks.js +11 -13
  84. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
  85. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +12 -18
  86. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
  87. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +15 -47
  88. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +15 -47
  89. package/node_modules/@posthog/core/dist/types.d.ts +4 -1
  90. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  91. package/node_modules/@posthog/core/package.json +2 -2
  92. package/node_modules/@posthog/core/src/logs/index.spec.ts +77 -0
  93. package/node_modules/@posthog/core/src/logs/index.ts +1 -1
  94. package/node_modules/@posthog/core/src/posthog-core-stateless.ts +40 -65
  95. package/node_modules/@posthog/core/src/types.ts +3 -1
  96. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  97. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  98. package/node_modules/@posthog/types/dist/posthog-config.d.ts +20 -5
  99. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  100. package/node_modules/@posthog/types/package.json +1 -1
  101. package/node_modules/@posthog/types/src/index.ts +1 -0
  102. package/node_modules/@posthog/types/src/posthog-config.ts +21 -5
  103. package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
  104. package/node_modules/@zuplo/core/index.minified.js +1 -1
  105. package/node_modules/@zuplo/core/package.json +1 -1
  106. package/node_modules/@zuplo/graphql/package.json +1 -1
  107. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  108. package/node_modules/@zuplo/otel/package.json +1 -1
  109. package/node_modules/@zuplo/runtime/out/esm/{chunk-IZE65N7D.js → chunk-CUK3VROF.js} +2 -2
  110. package/node_modules/@zuplo/runtime/out/esm/{chunk-4CDML74A.js → chunk-K4TBJG47.js} +2 -2
  111. package/node_modules/@zuplo/runtime/out/esm/{chunk-4VE55TG3.js → chunk-S4EBLGSU.js} +2 -2
  112. package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js → chunk-XF3IIUDX.js} +4 -4
  113. package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js.map → chunk-XF3IIUDX.js.map} +1 -1
  114. package/node_modules/@zuplo/runtime/out/esm/chunk-ZPOD3IK4.js +403 -0
  115. package/node_modules/@zuplo/runtime/out/esm/chunk-ZPOD3IK4.js.map +1 -0
  116. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  117. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  118. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  119. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  120. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  121. package/node_modules/@zuplo/runtime/package.json +1 -1
  122. package/node_modules/fast-uri/index.js +201 -48
  123. package/node_modules/fast-uri/lib/schemes.js +9 -4
  124. package/node_modules/fast-uri/lib/utils.js +388 -91
  125. package/node_modules/fast-uri/package.json +1 -1
  126. package/node_modules/fast-uri/test/component-safe-serialization.test.js +105 -0
  127. package/node_modules/fast-uri/test/equal.test.js +31 -3
  128. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  129. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  130. package/node_modules/fast-uri/test/ipv6-validation.test.js +90 -0
  131. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  132. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  133. package/node_modules/fast-uri/test/parse.test.js +7 -3
  134. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  135. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  136. package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  137. package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  138. package/node_modules/fast-uri/test/security.test.js +75 -3
  139. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  140. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  141. package/node_modules/hono/dist/cjs/client/client.js +25 -11
  142. package/node_modules/hono/dist/cjs/client/utils.js +3 -0
  143. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  144. package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  145. package/node_modules/hono/dist/cjs/middleware/etag/index.js +1 -1
  146. package/node_modules/hono/dist/cjs/request.js +8 -4
  147. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
  148. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
  149. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
  150. package/node_modules/hono/dist/cjs/router/trie-router/node.js +4 -3
  151. package/node_modules/hono/dist/cjs/router/utils.js +27 -0
  152. package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
  153. package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
  154. package/node_modules/hono/dist/client/client.js +25 -11
  155. package/node_modules/hono/dist/client/utils.js +3 -0
  156. package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  157. package/node_modules/hono/dist/jsx/dom/render.js +2 -0
  158. package/node_modules/hono/dist/middleware/etag/index.js +1 -1
  159. package/node_modules/hono/dist/request.js +8 -4
  160. package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
  161. package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
  162. package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
  163. package/node_modules/hono/dist/router/trie-router/node.js +4 -3
  164. package/node_modules/hono/dist/router/utils.js +5 -0
  165. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
  166. package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  167. package/node_modules/hono/dist/utils/cookie.js +1 -1
  168. package/node_modules/hono/dist/utils/stream.js +7 -1
  169. package/node_modules/hono/package.json +1 -1
  170. package/package.json +11 -11
  171. package/node_modules/@zuplo/runtime/out/esm/chunk-4SX4HBWT.js +0 -409
  172. package/node_modules/@zuplo/runtime/out/esm/chunk-4SX4HBWT.js.map +0 -1
  173. /package/node_modules/@zuplo/runtime/out/esm/{chunk-IZE65N7D.js.map → chunk-CUK3VROF.js.map} +0 -0
  174. /package/node_modules/@zuplo/runtime/out/esm/{chunk-4CDML74A.js.map → chunk-K4TBJG47.js.map} +0 -0
  175. /package/node_modules/@zuplo/runtime/out/esm/{chunk-4VE55TG3.js.map → chunk-S4EBLGSU.js.map} +0 -0
  176. /package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js.LEGAL.txt → chunk-XF3IIUDX.js.LEGAL.txt} +0 -0
  177. /package/node_modules/@zuplo/runtime/out/esm/{chunk-4SX4HBWT.js.LEGAL.txt → chunk-ZPOD3IK4.js.LEGAL.txt} +0 -0
@@ -5,25 +5,25 @@ import {
5
5
  UnsupportedPathError
6
6
  } from "../../router.js";
7
7
  import { checkOptionalParameter } from "../../utils/url.js";
8
+ import { createNullObject } from "../utils.js";
8
9
  import { match, emptyParam } from "./matcher.js";
9
- import { PATH_ERROR } from "./node.js";
10
+ import {
11
+ LABEL_REG_EXP_STR,
12
+ ONLY_WILDCARD_REG_EXP_STR,
13
+ PATH_ERROR,
14
+ TAIL_WILDCARD_REG_EXP_STR
15
+ } from "./node.js";
10
16
  import { Trie } from "./trie.js";
11
- var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
17
+ var wildcardRegExpCache = createNullObject();
12
18
  function buildWildcardRegExp(path) {
13
19
  return wildcardRegExpCache[path] ??= new RegExp(
14
- path === "*" ? "" : `^${path.replace(
15
- /\/\*$|([.\\+*[^\]$()])/g,
16
- (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)"
20
+ `^${path.replace(
21
+ /\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,
22
+ (match2, metaChar) => metaChar ? `\\${metaChar}` : match2 === "/*" ? TAIL_WILDCARD_REG_EXP_STR : match2 === "*" ? ONLY_WILDCARD_REG_EXP_STR : `/:${LABEL_REG_EXP_STR}`
17
23
  )}$`
18
24
  );
19
25
  }
20
- function clearWildcardRegExpCache() {
21
- wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
22
- }
23
26
  function findMiddleware(middleware, path) {
24
- if (!middleware) {
25
- return void 0;
26
- }
27
27
  for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
28
28
  if (buildWildcardRegExp(k).test(path)) {
29
29
  return [...middleware[k]];
@@ -37,8 +37,8 @@ var RegExpRouter = class {
37
37
  #routes;
38
38
  #tries;
39
39
  constructor() {
40
- this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
41
- this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
40
+ this.#middleware = { [METHOD_NAME_ALL]: createNullObject() };
41
+ this.#routes = { [METHOD_NAME_ALL]: createNullObject() };
42
42
  this.#tries = { [METHOD_NAME_ALL]: new Trie() };
43
43
  }
44
44
  #insertPath(method, path) {
@@ -51,117 +51,86 @@ var RegExpRouter = class {
51
51
  add(method, path, handler) {
52
52
  const middleware = this.#middleware;
53
53
  const routes = this.#routes;
54
- if (!middleware || !routes) {
54
+ if (!middleware) {
55
55
  throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
56
56
  }
57
57
  if (!middleware[method]) {
58
58
  this.#tries[method] = new Trie();
59
- [middleware, routes].forEach((handlerMap) => {
60
- handlerMap[method] = /* @__PURE__ */ Object.create(null);
61
- Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
59
+ for (const handlerMap of [middleware, routes]) {
60
+ handlerMap[method] = createNullObject();
61
+ for (const p in handlerMap[METHOD_NAME_ALL]) {
62
62
  handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
63
63
  this.#insertPath(method, p);
64
- });
65
- });
64
+ }
65
+ }
66
66
  }
67
67
  if (path === "/*") {
68
68
  path = "*";
69
69
  }
70
- const paramCount = (path.match(/\/:/g) || []).length;
70
+ const methods = method === METHOD_NAME_ALL ? Object.keys(middleware) : [method];
71
71
  if (/\*$/.test(path)) {
72
72
  const re = buildWildcardRegExp(path);
73
- Object.keys(middleware).forEach((m) => {
74
- if ((method === METHOD_NAME_ALL || method === m) && !middleware[m][path]) {
73
+ for (const m of methods) {
74
+ if (!middleware[m][path]) {
75
75
  this.#insertPath(m, path);
76
76
  middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
77
77
  }
78
- });
79
- Object.keys(middleware).forEach((m) => {
80
- if (method === METHOD_NAME_ALL || method === m) {
81
- Object.keys(middleware[m]).forEach((p) => {
82
- re.test(p) && middleware[m][p].push([handler, paramCount]);
83
- });
84
- }
85
- });
86
- Object.keys(routes).forEach((m) => {
87
- if (method === METHOD_NAME_ALL || method === m) {
88
- Object.keys(routes[m]).forEach(
89
- (p) => re.test(p) && routes[m][p].push([handler, paramCount])
90
- );
78
+ }
79
+ for (const handlerMap of [middleware, routes]) {
80
+ for (const m of methods) {
81
+ for (const p in handlerMap[m]) {
82
+ re.test(p) && handlerMap[m][p].push([handler, path]);
83
+ }
91
84
  }
92
- });
85
+ }
93
86
  return;
94
87
  }
95
88
  const paths = checkOptionalParameter(path) || [path];
96
- for (let i = 0, len = paths.length; i < len; i++) {
97
- const path2 = paths[i];
98
- Object.keys(routes).forEach((m) => {
99
- if (method === METHOD_NAME_ALL || method === m) {
100
- if (!routes[m][path2]) {
101
- this.#insertPath(m, path2);
102
- routes[m][path2] = [
103
- ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
104
- ];
105
- }
106
- routes[m][path2].push([handler, paramCount - len + i + 1]);
89
+ for (const path2 of paths) {
90
+ for (const m of methods) {
91
+ if (!routes[m][path2]) {
92
+ this.#insertPath(m, path2);
93
+ routes[m][path2] = findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [];
107
94
  }
108
- });
95
+ routes[m][path2].push([handler, path2]);
96
+ }
109
97
  }
110
98
  }
111
99
  match = match;
112
100
  buildAllMatchers() {
113
- const matchers = /* @__PURE__ */ Object.create(null);
114
- Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => {
115
- matchers[method] ||= this.#buildMatcher(method);
116
- });
101
+ const matchers = createNullObject();
102
+ for (const method of Object.keys(this.#routes)) {
103
+ matchers[method] = this.#buildMatcher(method);
104
+ }
117
105
  this.#middleware = this.#routes = this.#tries = void 0;
118
- clearWildcardRegExpCache();
106
+ wildcardRegExpCache = createNullObject();
119
107
  return matchers;
120
108
  }
121
109
  #buildMatcher(method) {
122
110
  const middleware = this.#middleware[method];
123
111
  const routes = this.#routes[method];
124
112
  const trie = this.#tries[method];
125
- const staticMap = /* @__PURE__ */ Object.create(null);
113
+ const staticMap = createNullObject();
126
114
  const handlerData = [];
127
- [middleware, routes].forEach((r) => {
115
+ const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
116
+ for (const r of [middleware, routes]) {
128
117
  for (const path in r) {
129
118
  const handlers = r[path];
130
119
  const pathData = trie.paths[path];
131
120
  if (!pathData) {
132
- staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
133
- continue;
134
- }
135
- const paramAssoc = pathData[1];
136
- handlerData[pathData[0]] = handlers.map(([h, paramCount]) => {
137
- const paramIndexMap = /* @__PURE__ */ Object.create(null);
138
- paramCount -= 1;
139
- for (; paramCount >= 0; paramCount--) {
140
- const [key, value] = paramAssoc[paramCount];
141
- paramIndexMap[key] = value;
142
- }
143
- return [h, paramIndexMap];
144
- });
145
- }
146
- });
147
- const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
148
- for (let i = 0, len = handlerData.length; i < len; i++) {
149
- for (let j = 0, len2 = handlerData[i].length; j < len2; j++) {
150
- const map = handlerData[i][j]?.[1];
151
- if (!map) {
121
+ staticMap[path] = [handlers.map(([h]) => [h, createNullObject()]), emptyParam];
152
122
  continue;
153
123
  }
154
- const keys = Object.keys(map);
155
- for (let k = 0, len3 = keys.length; k < len3; k++) {
156
- map[keys[k]] = paramReplacementMap[map[keys[k]]];
157
- }
124
+ handlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [
125
+ h,
126
+ trie.paths[handlerPath][1].reduceRight((map, [key], i) => {
127
+ map[key] = paramReplacementMap[pathData[1][i][1]];
128
+ return map;
129
+ }, createNullObject())
130
+ ]);
158
131
  }
159
132
  }
160
- const handlerMap = [];
161
- for (const i in indexReplacementMap) {
162
- handlerMap[i] = handlerData[indexReplacementMap[i]];
163
- }
164
- return [regexp, handlerMap, staticMap];
133
+ return [regexp, indexReplacementMap.map((i) => handlerData[i]), staticMap];
165
134
  }
166
135
  };
167
136
  export {
@@ -1,11 +1,12 @@
1
1
  // src/router/reg-exp-router/trie.ts
2
+ import { createNullObject } from "../utils.js";
2
3
  import { Node } from "./node.js";
3
4
  var Trie = class {
4
5
  #context = { varIndex: 0 };
5
6
  #root = new Node();
6
7
  #index = 0;
7
8
  // dynamic path -> [handler index, param assoc]; static paths are not registered
8
- paths = /* @__PURE__ */ Object.create(null);
9
+ paths = createNullObject();
9
10
  insert(path, isStatic) {
10
11
  if (isStatic) {
11
12
  this.#root.insert(path.split(""), 0, [], this.#context, true);
@@ -1,11 +1,12 @@
1
1
  // src/router/trie-router/node.ts
2
2
  import { METHOD_NAME_ALL } from "../../router.js";
3
3
  import { getPattern, splitPath, splitRoutingPath } from "../../utils/url.js";
4
- var emptyParams = /* @__PURE__ */ Object.create(null);
4
+ import { createNullObject } from "../utils.js";
5
+ var emptyParams = createNullObject();
5
6
  var order = 0;
6
7
  var Node = class _Node {
7
8
  #methods = [];
8
- #children = /* @__PURE__ */ Object.create(null);
9
+ #children = createNullObject();
9
10
  #patterns = [];
10
11
  #pattern;
11
12
  #params = emptyParams;
@@ -42,7 +43,7 @@ var Node = class _Node {
42
43
  const m = node.#methods[i];
43
44
  const handlerSet = m[method] || m[METHOD_NAME_ALL];
44
45
  if (handlerSet) {
45
- handlerSet.params = /* @__PURE__ */ Object.create(null);
46
+ handlerSet.params = createNullObject();
46
47
  handlerSets.push(handlerSet);
47
48
  for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) {
48
49
  const key = handlerSet.possibleKeys[i2];
@@ -0,0 +1,5 @@
1
+ // src/router/utils.ts
2
+ var createNullObject = () => /* @__PURE__ */ Object.create(null);
3
+ export {
4
+ createNullObject
5
+ };
@@ -1,3 +1,6 @@
1
+ export declare const LABEL_REG_EXP_STR = "[^/]+";
2
+ export declare const ONLY_WILDCARD_REG_EXP_STR = ".*";
3
+ export declare const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
1
4
  export declare const PATH_ERROR: unique symbol;
2
5
  export type ParamAssocArray = [string, number][];
3
6
  export interface Context {
@@ -0,0 +1 @@
1
+ export declare const createNullObject: () => any;
@@ -77,7 +77,7 @@ var parseSigned = async (cookie, secret, name) => {
77
77
  const secretKey = await getCryptoKey(secret);
78
78
  for (const [key, value] of Object.entries(parse(cookie, name))) {
79
79
  const signatureStartPos = value.lastIndexOf(".");
80
- if (signatureStartPos < 1) {
80
+ if (signatureStartPos < 0) {
81
81
  continue;
82
82
  }
83
83
  const signedValue = value.substring(0, signatureStartPos);
@@ -75,7 +75,13 @@ var StreamingApi = class {
75
75
  abort() {
76
76
  if (!this.aborted) {
77
77
  this.aborted = true;
78
- this.abortSubscribers.forEach((subscriber) => subscriber());
78
+ this.abortSubscribers.forEach((subscriber) => {
79
+ try {
80
+ void Promise.resolve(subscriber()).catch(() => {
81
+ });
82
+ } catch {
83
+ }
84
+ });
79
85
  }
80
86
  }
81
87
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.13.3",
3
+ "version": "4.13.4",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "7.4.5",
3
+ "version": "7.4.6",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -28,10 +28,10 @@
28
28
  "@opentelemetry/api": "1.9.0",
29
29
  "@opentelemetry/api-logs": "0.220.0",
30
30
  "@swc/core": "1.10.18",
31
- "@zuplo/core": "7.4.5",
31
+ "@zuplo/core": "7.4.6",
32
32
  "@zuplo/editor": "1.0.31094607111",
33
- "@zuplo/openapi-tools": "7.4.5",
34
- "@zuplo/runtime": "7.4.5",
33
+ "@zuplo/openapi-tools": "7.4.6",
34
+ "@zuplo/runtime": "7.4.6",
35
35
  "chalk": "5.4.1",
36
36
  "chokidar": "3.5.3",
37
37
  "cookie": "1.0.2",
@@ -62,15 +62,15 @@
62
62
  "workerd": "1.20241230.0",
63
63
  "yargs": "17.7.2",
64
64
  "zod": "4.4.3",
65
- "@zuplo/graphql": "7.4.5",
66
- "@zuplo/otel": "7.4.5"
65
+ "@zuplo/graphql": "7.4.6",
66
+ "@zuplo/otel": "7.4.6"
67
67
  },
68
68
  "optionalDependencies": {
69
- "@zuplo/lint-darwin-arm64": "7.4.5",
70
- "@zuplo/lint-darwin-x64": "7.4.5",
71
- "@zuplo/lint-linux-x64": "7.4.5",
72
- "@zuplo/lint-linux-arm64": "7.4.5",
73
- "@zuplo/lint-win32-x64": "7.4.5"
69
+ "@zuplo/lint-darwin-arm64": "7.4.6",
70
+ "@zuplo/lint-darwin-x64": "7.4.6",
71
+ "@zuplo/lint-linux-x64": "7.4.6",
72
+ "@zuplo/lint-linux-arm64": "7.4.6",
73
+ "@zuplo/lint-win32-x64": "7.4.6"
74
74
  },
75
75
  "bundleDependencies": [
76
76
  "@inquirer/prompts",