@zuplo/cli 6.72.3 → 6.72.8

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 (117) hide show
  1. package/node_modules/@fastify/reply-from/.github/dependabot.yml +42 -2
  2. package/node_modules/@fastify/reply-from/README.md +3 -3
  3. package/node_modules/@fastify/reply-from/index.js +6 -1
  4. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.gitattributes +2 -0
  5. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/dependabot.yml +53 -0
  6. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/ci.yml +33 -0
  7. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/lock-threads.yml +19 -0
  8. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/LICENSE +21 -0
  9. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/README.md +188 -0
  10. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/eslint.config.js +6 -0
  11. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/index.js +67 -0
  12. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/getPluginName.js +25 -0
  13. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/toCamelCase.js +10 -0
  14. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/package.json +70 -0
  15. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/bundlers.test.js +110 -0
  16. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/checkVersion.test.js +67 -0
  17. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/composite.test.js +14 -0
  18. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/esm.mjs +11 -0
  19. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/index.test.js +11 -0
  20. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/extractPluginName.test.js +49 -0
  21. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/mu1tip1e.composite.test.js +15 -0
  22. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/test.js +396 -0
  23. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/toCamelCase.test.js +24 -0
  24. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-async.tst.ts +19 -0
  25. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-callback.tst.ts +19 -0
  26. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.d.ts +54 -0
  27. package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.tst.ts +249 -0
  28. package/node_modules/@fastify/reply-from/package.json +6 -7
  29. package/node_modules/@fastify/reply-from/test/incomplete-request.test.js +142 -0
  30. package/node_modules/@fastify/reply-from/types/index.tst.ts +123 -0
  31. package/node_modules/@posthog/core/dist/index.d.ts +1 -0
  32. package/node_modules/@posthog/core/dist/index.d.ts.map +1 -1
  33. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +35 -2
  34. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
  35. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +68 -56
  36. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +68 -56
  37. package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -1
  38. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  39. package/node_modules/@posthog/core/dist/posthog-core.js +1 -0
  40. package/node_modules/@posthog/core/dist/posthog-core.mjs +1 -0
  41. package/node_modules/@posthog/core/dist/types.d.ts +1 -0
  42. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  43. package/node_modules/@posthog/core/dist/types.js +1 -0
  44. package/node_modules/@posthog/core/dist/types.mjs +1 -0
  45. package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts +17 -0
  46. package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts.map +1 -1
  47. package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.js +18 -1
  48. package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs +9 -1
  49. package/node_modules/@posthog/core/dist/utils/type-utils.d.ts.map +1 -1
  50. package/node_modules/@posthog/core/package.json +2 -2
  51. package/node_modules/@posthog/core/src/index.ts +3 -0
  52. package/node_modules/@posthog/core/src/posthog-core-stateless.ts +135 -73
  53. package/node_modules/@posthog/core/src/posthog-core.ts +3 -2
  54. package/node_modules/@posthog/core/src/types.ts +5 -0
  55. package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.spec.ts +38 -1
  56. package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.ts +29 -0
  57. package/node_modules/@posthog/core/src/utils/type-utils.ts +0 -6
  58. package/node_modules/@posthog/types/LICENSE +2 -2
  59. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  60. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  61. package/node_modules/@posthog/types/dist/posthog-config.d.ts +32 -11
  62. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  63. package/node_modules/@posthog/types/package.json +1 -1
  64. package/node_modules/@posthog/types/src/index.ts +1 -0
  65. package/node_modules/@posthog/types/src/posthog-config.ts +34 -11
  66. package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
  67. package/node_modules/@zuplo/core/index.minified.js +1 -1
  68. package/node_modules/@zuplo/core/package.json +1 -1
  69. package/node_modules/@zuplo/graphql/package.json +1 -1
  70. package/node_modules/@zuplo/openapi-tools/dist/overlay.d.ts.map +1 -1
  71. package/node_modules/@zuplo/openapi-tools/dist/overlay.js +85 -1
  72. package/node_modules/@zuplo/openapi-tools/dist/overlay.js.map +1 -1
  73. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +82 -0
  74. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +1 -1
  75. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  76. package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js +26 -0
  77. package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js.map +1 -0
  78. package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
  79. package/node_modules/@zuplo/otel/package.json +1 -1
  80. package/node_modules/@zuplo/runtime/out/esm/{chunk-423FXHUV.js → chunk-HKSZ4V6H.js} +124 -124
  81. package/node_modules/@zuplo/runtime/out/esm/chunk-HKSZ4V6H.js.map +1 -0
  82. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  83. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  84. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  85. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  86. package/node_modules/@zuplo/runtime/out/types/index.d.ts +417 -141
  87. package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +9 -9
  88. package/node_modules/@zuplo/runtime/package.json +1 -1
  89. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -4
  90. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +12 -2
  91. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -4
  92. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +12 -2
  93. package/node_modules/hono/dist/cjs/client/client.js +10 -1
  94. package/node_modules/hono/dist/cjs/client/utils.js +1 -1
  95. package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
  96. package/node_modules/hono/dist/cjs/middleware/compress/index.js +2 -1
  97. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -1
  98. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +5 -3
  99. package/node_modules/hono/dist/cjs/router/trie-router/node.js +9 -0
  100. package/node_modules/hono/dist/client/client.js +10 -1
  101. package/node_modules/hono/dist/client/utils.js +1 -1
  102. package/node_modules/hono/dist/middleware/cache/index.js +1 -1
  103. package/node_modules/hono/dist/middleware/compress/index.js +2 -1
  104. package/node_modules/hono/dist/middleware/etag/index.js +2 -1
  105. package/node_modules/hono/dist/middleware/method-override/index.js +5 -3
  106. package/node_modules/hono/dist/router/trie-router/node.js +9 -0
  107. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +1 -1
  108. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +1 -1
  109. package/node_modules/hono/dist/types/middleware/language/language.d.ts +18 -0
  110. package/node_modules/hono/dist/types/utils/types.d.ts +1 -1
  111. package/node_modules/hono/package.json +4 -4
  112. package/package.json +6 -6
  113. package/node_modules/@fastify/reply-from/types/index.test-d.ts +0 -194
  114. package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js +0 -26
  115. package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js.map +0 -1
  116. package/node_modules/@zuplo/runtime/out/esm/chunk-423FXHUV.js.map +0 -1
  117. /package/node_modules/@zuplo/runtime/out/esm/{chunk-423FXHUV.js.LEGAL.txt → chunk-HKSZ4V6H.js.LEGAL.txt} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod/v4";
2
2
 
3
3
  /**
4
- * Optional per-caller access control. Defaults to mode 'allPublic' (no access control). Set mode to 'rolesAndGroups' to match the caller's role/group claims against each capability's markup (every capability must then set roles/groups or public: true), or 'function' to delegate to a custom resolver.
4
+ * Optional per-caller access control. Defaults to mode 'allPublic' (no access control). Set mode to 'rolesAndGroups' to match the caller's role/group claims against each capability's markup (a capability with no roles/groups/public markup is available to no one), or 'function' to delegate to a custom resolver.
5
5
  * @public
6
6
  */
7
7
  declare interface AccessControl {
@@ -128,9 +128,9 @@ declare interface BuildRouteConfiguration {
128
128
  * `roles`/`groups`, each allowing a dot-path such as `realm_access.roles`).
129
129
  * `request.user.data` is populated by whichever auth policy ran (JWT claims,
130
130
  * API-key metadata, etc.). A capability marked `public: true` is allowed for
131
- * everyone; otherwise the caller must match any listed role or group. In this
132
- * mode every capability must be classified (see {@link assertClassified}), so
133
- * nothing is public by omission.
131
+ * everyone; otherwise the caller must match any listed role or group. A
132
+ * capability with no roles/groups/public markup is available to no one until
133
+ * it is classified, so nothing is ever exposed by omission.
134
134
  *
135
135
  * @public
136
136
  */
@@ -3501,10 +3501,6 @@ export declare interface McpTokenExchangeInboundPolicyOptions {
3501
3501
  * Optional human-readable summary of the upstream, shown on the consent page.
3502
3502
  */
3503
3503
  summary?: string;
3504
- /**
3505
- * Optional override for the upstream's OAuth protected-resource metadata URL. Defaults from the route handler's rewritePattern.
3506
- */
3507
- protectedResourceMetadataUrl?: string;
3508
3504
  /**
3509
3505
  * Authentication mode. `user-oauth` performs per-user OAuth federation; `shared-oauth` uses a gateway-wide OAuth grant; `id-jag` exchanges the caller's identity assertion at the configured IdP for an ID-JAG (Identity Assertion JWT Authorization Grant, also known as Cross-App Access / XAA), then redeems it at the upstream Resource Authorization Server for an upstream access token.
3510
3506
  */
@@ -3513,6 +3509,10 @@ export declare interface McpTokenExchangeInboundPolicyOptions {
3513
3509
  * OAuth scopes to request from the upstream (for OAuth modes).
3514
3510
  */
3515
3511
  scopes?: string[];
3512
+ /**
3513
+ * Optional override for the upstream's OAuth protected-resource metadata URL. Defaults from the route handler's rewritePattern.
3514
+ */
3515
+ protectedResourceMetadataUrl?: string;
3516
3516
  /**
3517
3517
  * Delimiter used to join scopes in the OAuth authorization request. Defaults to a single space.
3518
3518
  */
@@ -4541,7 +4541,7 @@ declare interface PromptProjection {
4541
4541
  }
4542
4542
 
4543
4543
  /**
4544
- * Access control: mark this capability as available to all callers. In mode 'rolesAndGroups' every capability must set roles/groups OR public: true (not both) an unclassified capability is a configuration error, so nothing is ever exposed by omission.
4544
+ * Access control: mark this capability as available to all callers. In mode 'rolesAndGroups' a capability with no roles/groups/public markup is available to no one until it is classified, so nothing is ever exposed by omission. Combining public: true with roles/groups is a configuration error.
4545
4545
  * @public
4546
4546
  */
4547
4547
  declare type Public = boolean;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.72.3",
4
+ "version": "6.72.8",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -348,10 +348,7 @@ var defaultIsContentTypeBinary = (contentType) => {
348
348
  );
349
349
  };
350
350
  var isContentEncodingBinary = (contentEncoding) => {
351
- if (contentEncoding === null) {
352
- return false;
353
- }
354
- return /^(gzip|deflate|compress|br)/.test(contentEncoding);
351
+ return !!contentEncoding && !/^identity$/i.test(contentEncoding);
355
352
  };
356
353
  export {
357
354
  ALBProcessor,
@@ -15,21 +15,31 @@ var convertHeaders = (headers) => {
15
15
  var handle = (app) => {
16
16
  return async (event, ...args) => {
17
17
  const [context, callback] = args;
18
+ let callbackError = null;
19
+ let callbackResult;
18
20
  const res = await app.fetch(createRequest(event), {
19
21
  event,
20
22
  context,
21
23
  callback: (err, result) => {
24
+ if (!callbackError && !callbackResult) {
25
+ callbackError = err;
26
+ callbackResult = result;
27
+ }
22
28
  callback?.(err, result);
23
29
  },
24
30
  config: event.Records[0].cf.config,
25
31
  request: event.Records[0].cf.request,
26
32
  response: event.Records[0].cf.response
27
33
  });
28
- return createResult(res);
34
+ if (callbackError) {
35
+ throw callbackError;
36
+ }
37
+ return callbackResult ?? createResult(res);
29
38
  };
30
39
  };
31
40
  var createResult = async (res) => {
32
- const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "");
41
+ const contentEncoding = res.headers.get("content-encoding");
42
+ const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "") || !!contentEncoding && !/^identity$/i.test(contentEncoding);
33
43
  const body = isBase64Encoded ? encodeBase64(await res.arrayBuffer()) : await res.text();
34
44
  return {
35
45
  status: res.status.toString(),
@@ -378,10 +378,7 @@ const defaultIsContentTypeBinary = (contentType) => {
378
378
  );
379
379
  };
380
380
  const isContentEncodingBinary = (contentEncoding) => {
381
- if (contentEncoding === null) {
382
- return false;
383
- }
384
- return /^(gzip|deflate|compress|br)/.test(contentEncoding);
381
+ return !!contentEncoding && !/^identity$/i.test(contentEncoding);
385
382
  };
386
383
  // Annotate the CommonJS export names for ESM import in node:
387
384
  0 && (module.exports = {
@@ -48,21 +48,31 @@ const convertHeaders = (headers) => {
48
48
  const handle = (app) => {
49
49
  return async (event, ...args) => {
50
50
  const [context, callback] = args;
51
+ let callbackError = null;
52
+ let callbackResult;
51
53
  const res = await app.fetch(createRequest(event), {
52
54
  event,
53
55
  context,
54
56
  callback: (err, result) => {
57
+ if (!callbackError && !callbackResult) {
58
+ callbackError = err;
59
+ callbackResult = result;
60
+ }
55
61
  callback?.(err, result);
56
62
  },
57
63
  config: event.Records[0].cf.config,
58
64
  request: event.Records[0].cf.request,
59
65
  response: event.Records[0].cf.response
60
66
  });
61
- return createResult(res);
67
+ if (callbackError) {
68
+ throw callbackError;
69
+ }
70
+ return callbackResult ?? createResult(res);
62
71
  };
63
72
  };
64
73
  const createResult = async (res) => {
65
- const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "");
74
+ const contentEncoding = res.headers.get("content-encoding");
75
+ const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "") || !!contentEncoding && !/^identity$/i.test(contentEncoding);
66
76
  const body = isBase64Encoded ? (0, import_encode.encodeBase64)(await res.arrayBuffer()) : await res.text();
67
77
  return {
68
78
  status: res.status.toString(),
@@ -184,7 +184,16 @@ const hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
184
184
  });
185
185
  if (method) {
186
186
  options ??= {};
187
- const args = (0, import_utils.deepMerge)(options, { ...opts.args[1] });
187
+ const reqOptions = { ...opts.args[1] };
188
+ const baseHeaders = options.headers;
189
+ const reqHeaders = reqOptions.headers;
190
+ if (baseHeaders && reqHeaders) {
191
+ reqOptions.headers = async () => ({
192
+ ...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders,
193
+ ...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders
194
+ });
195
+ }
196
+ const args = (0, import_utils.deepMerge)(options, reqOptions);
188
197
  return req.fetch(opts.args[0], args);
189
198
  }
190
199
  return req;
@@ -36,7 +36,7 @@ const mergePath = (base, path) => {
36
36
  };
37
37
  const replaceUrlParam = (urlString, params) => {
38
38
  for (const [k, v] of Object.entries(params)) {
39
- const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??");
39
+ const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)");
40
40
  urlString = urlString.replace(reg, v ? `/${v}` : "");
41
41
  }
42
42
  return urlString;
@@ -55,7 +55,7 @@ const cache = (options) => {
55
55
  );
56
56
  const addHeader = (c, responseVary) => {
57
57
  if (cacheControlDirectives) {
58
- const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? [];
58
+ const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? [];
59
59
  for (const directive of cacheControlDirectives) {
60
60
  let [name, value] = directive.trim().split("=", 2);
61
61
  name = name.toLowerCase();
@@ -57,7 +57,8 @@ const compress = (options) => {
57
57
  return async function compress2(ctx, next) {
58
58
  await next();
59
59
  const contentLength = ctx.res.headers.get("Content-Length");
60
- if (ctx.res.headers.has("Content-Encoding") || // already encoded
60
+ if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes
61
+ ctx.res.headers.has("Content-Encoding") || // already encoded
61
62
  ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked
62
63
  ctx.req.method === "HEAD" || // HEAD request
63
64
  contentLength && Number(contentLength) < threshold || // content-length below threshold
@@ -70,7 +70,8 @@ const etag = (options) => {
70
70
  }
71
71
  etag3 = weak ? `W/"${hash}"` : `"${hash}"`;
72
72
  }
73
- if (etagMatches(etag3, ifNoneMatch)) {
73
+ const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD") && res.ok : etagMatches(etag3, ifNoneMatch);
74
+ if (matched) {
74
75
  c.res = new Response(null, {
75
76
  status: 304,
76
77
  statusText: "Not Modified",
@@ -80,11 +80,13 @@ const methodOverride = (options) => async function methodOverride2(c, next) {
80
80
  if (method) {
81
81
  const url = new URL(c.req.url);
82
82
  url.searchParams.delete(queryName);
83
- const request = new Request(url.toString(), {
83
+ const requestInit = {
84
84
  body: c.req.raw.body,
85
85
  headers: c.req.raw.headers,
86
- method
87
- });
86
+ method,
87
+ duplex: c.req.raw.body ? "half" : void 0
88
+ };
89
+ const request = new Request(url.toString(), requestInit);
88
90
  return app.fetch(request, c.env, getExecutionCtx(c));
89
91
  }
90
92
  }
@@ -155,6 +155,15 @@ class Node {
155
155
  if (m) {
156
156
  params[name] = m[0];
157
157
  this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
158
+ if (m[0].length === restPathString.length && child.#children["*"]) {
159
+ this.#pushHandlerSets(
160
+ handlerSets,
161
+ child.#children["*"],
162
+ method,
163
+ node.#params,
164
+ params
165
+ );
166
+ }
158
167
  if (hasChildren(child.#children)) {
159
168
  child.#params = params;
160
169
  const componentCount = m[0].match(/\//)?.length ?? 0;
@@ -170,7 +170,16 @@ var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
170
170
  });
171
171
  if (method) {
172
172
  options ??= {};
173
- const args = deepMerge(options, { ...opts.args[1] });
173
+ const reqOptions = { ...opts.args[1] };
174
+ const baseHeaders = options.headers;
175
+ const reqHeaders = reqOptions.headers;
176
+ if (baseHeaders && reqHeaders) {
177
+ reqOptions.headers = async () => ({
178
+ ...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders,
179
+ ...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders
180
+ });
181
+ }
182
+ const args = deepMerge(options, reqOptions);
174
183
  return req.fetch(opts.args[0], args);
175
184
  }
176
185
  return req;
@@ -8,7 +8,7 @@ var mergePath = (base, path) => {
8
8
  };
9
9
  var replaceUrlParam = (urlString, params) => {
10
10
  for (const [k, v] of Object.entries(params)) {
11
- const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??");
11
+ const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)");
12
12
  urlString = urlString.replace(reg, v ? `/${v}` : "");
13
13
  }
14
14
  return urlString;
@@ -34,7 +34,7 @@ var cache = (options) => {
34
34
  );
35
35
  const addHeader = (c, responseVary) => {
36
36
  if (cacheControlDirectives) {
37
- const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? [];
37
+ const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? [];
38
38
  for (const directive of cacheControlDirectives) {
39
39
  let [name, value] = directive.trim().split("=", 2);
40
40
  name = name.toLowerCase();
@@ -35,7 +35,8 @@ var compress = (options) => {
35
35
  return async function compress2(ctx, next) {
36
36
  await next();
37
37
  const contentLength = ctx.res.headers.get("Content-Length");
38
- if (ctx.res.headers.has("Content-Encoding") || // already encoded
38
+ if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes
39
+ ctx.res.headers.has("Content-Encoding") || // already encoded
39
40
  ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked
40
41
  ctx.req.method === "HEAD" || // HEAD request
41
42
  contentLength && Number(contentLength) < threshold || // content-length below threshold
@@ -48,7 +48,8 @@ var etag = (options) => {
48
48
  }
49
49
  etag3 = weak ? `W/"${hash}"` : `"${hash}"`;
50
50
  }
51
- if (etagMatches(etag3, ifNoneMatch)) {
51
+ const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD") && res.ok : etagMatches(etag3, ifNoneMatch);
52
+ if (matched) {
52
53
  c.res = new Response(null, {
53
54
  status: 304,
54
55
  statusText: "Not Modified",
@@ -59,11 +59,13 @@ var methodOverride = (options) => async function methodOverride2(c, next) {
59
59
  if (method) {
60
60
  const url = new URL(c.req.url);
61
61
  url.searchParams.delete(queryName);
62
- const request = new Request(url.toString(), {
62
+ const requestInit = {
63
63
  body: c.req.raw.body,
64
64
  headers: c.req.raw.headers,
65
- method
66
- });
65
+ method,
66
+ duplex: c.req.raw.body ? "half" : void 0
67
+ };
68
+ const request = new Request(url.toString(), requestInit);
67
69
  return app.fetch(request, c.env, getExecutionCtx(c));
68
70
  }
69
71
  }
@@ -134,6 +134,15 @@ var Node = class _Node {
134
134
  if (m) {
135
135
  params[name] = m[0];
136
136
  this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
137
+ if (m[0].length === restPathString.length && child.#children["*"]) {
138
+ this.#pushHandlerSets(
139
+ handlerSets,
140
+ child.#children["*"],
141
+ method,
142
+ node.#params,
143
+ params
144
+ );
145
+ }
137
146
  if (hasChildren(child.#children)) {
138
147
  child.#params = params;
139
148
  const componentCount = m[0].match(/\//)?.length ?? 0;
@@ -81,7 +81,7 @@ interface CloudFrontResult {
81
81
  body?: string;
82
82
  bodyEncoding?: 'text' | 'base64';
83
83
  }
84
- export declare const handle: (app: Hono<any>) => ((event: CloudFrontEdgeEvent, context?: CloudFrontContext, callback?: Callback) => Promise<CloudFrontResult>);
84
+ export declare const handle: (app: Hono<any>) => ((event: CloudFrontEdgeEvent, context?: CloudFrontContext, callback?: Callback) => Promise<CloudFrontResult | CloudFrontRequest>);
85
85
  export declare const createBody: (method: string, requestBody: CloudFrontRequest["body"]) => string | Uint8Array<ArrayBuffer> | undefined;
86
86
  export declare const isContentTypeBinary: (contentType: string) => boolean;
87
87
  export {};
@@ -31,7 +31,7 @@ export type WSReadyState = 0 | 1 | 2 | 3;
31
31
  * An argument for WSContext class
32
32
  */
33
33
  export interface WSContextInit<T = unknown> {
34
- send(data: string | ArrayBuffer | Uint8Array, options: SendOptions): void;
34
+ send(data: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options: SendOptions): void;
35
35
  close(code?: number, reason?: string): void;
36
36
  raw?: T;
37
37
  readyState: WSReadyState;
@@ -98,5 +98,23 @@ export declare function validateOptions(options: DetectorOptions): void;
98
98
  * Language detector middleware factory
99
99
  * @param userOptions Configuration options for the language detector
100
100
  * @returns Hono middleware function
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * type Variables = LanguageVariables
105
+ * const app = new Hono<{ Variables: Variables }>()
106
+ *
107
+ * app.use(
108
+ * languageDetector({
109
+ * supportedLanguages: ['en', 'ja'], // Must include fallback
110
+ * fallbackLanguage: 'en', // Required
111
+ * })
112
+ * )
113
+ *
114
+ * app.get('/', (c) => {
115
+ * const lang = c.get('language')
116
+ * return c.text(`Current language: ${lang}`)
117
+ * })
118
+ * ```
101
119
  */
102
120
  export declare const languageDetector: (userOptions: Partial<DetectorOptions>) => MiddlewareHandler;
@@ -42,7 +42,7 @@ export type JSONParsed<T, TError = bigint | ReadonlyArray<bigint>> = T extends {
42
42
  toJSON(): unknown;
43
43
  } ? {} : JSONParsed<J, TError> : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray<unknown> ? {
44
44
  [K in keyof T]: JSONParsed<InvalidToNull<T[K]>, TError>;
45
- } : T extends Set<unknown> | Map<unknown, unknown> | Record<string, never> ? {} : T extends object ? T[keyof T] extends TError ? never : {
45
+ } extends infer A ? A extends ReadonlyArray<unknown> ? A : JSONParsed<InvalidToNull<T[number]>, TError>[] : never : T extends Set<unknown> | Map<unknown, unknown> | Record<string, never> ? {} : T extends object ? T[keyof T] extends TError ? never : {
46
46
  [K in keyof OmitSymbolKeys<T> as IsInvalid<T[K]> extends true ? never : K]: boolean extends IsInvalid<T[K]> ? JSONParsed<T[K], TError> | undefined : JSONParsed<T[K], TError>;
47
47
  } : T extends unknown ? T extends TError ? never : JSONValue : never;
48
48
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.12.28",
3
+ "version": "4.12.30",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "!dist/**/*.tsbuildinfo"
12
12
  ],
13
13
  "scripts": {
14
- "test": "tsc --noEmit && vitest --run",
14
+ "test": "tsc -p tsconfig.spec.json && vitest --run",
15
15
  "test:watch": "vitest --watch",
16
16
  "test:deno": "deno test --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno && deno test --no-lock -c runtime-tests/deno-jsx/deno.precompile.json runtime-tests/deno-jsx && deno test --no-lock -c runtime-tests/deno-jsx/deno.react-jsx.json runtime-tests/deno-jsx",
17
17
  "test:bun": "bun test --jsx-import-source ../../src/jsx runtime-tests/bun/*",
@@ -666,7 +666,7 @@
666
666
  "nodejs"
667
667
  ],
668
668
  "devDependencies": {
669
- "@hono/eslint-config": "^2.1.0",
669
+ "@hono/eslint-config": "^2.1.1",
670
670
  "@hono/node-server": "^2.0.2",
671
671
  "@types/jsdom": "^21.1.7",
672
672
  "@types/node": "^24.3.0",
@@ -684,7 +684,7 @@
684
684
  "pkg-pr-new": "^0.0.53",
685
685
  "prettier": "3.7.4",
686
686
  "publint": "0.3.15",
687
- "typescript": "^5.9.2",
687
+ "typescript": "^6.0.3",
688
688
  "undici": "^6.27.0",
689
689
  "vite-plugin-fastly-js-compute": "^0.4.2",
690
690
  "vitest": "^4.1.9",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.72.3",
3
+ "version": "6.72.8",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -27,10 +27,10 @@
27
27
  "@opentelemetry/api": "1.9.0",
28
28
  "@opentelemetry/api-logs": "0.201.1",
29
29
  "@swc/core": "1.10.18",
30
- "@zuplo/core": "6.72.3",
30
+ "@zuplo/core": "6.72.8",
31
31
  "@zuplo/editor": "1.0.20821740935",
32
- "@zuplo/openapi-tools": "6.72.3",
33
- "@zuplo/runtime": "6.72.3",
32
+ "@zuplo/openapi-tools": "6.72.8",
33
+ "@zuplo/runtime": "6.72.8",
34
34
  "chalk": "5.4.1",
35
35
  "chokidar": "3.5.3",
36
36
  "cookie": "1.0.2",
@@ -61,8 +61,8 @@
61
61
  "workerd": "1.20241230.0",
62
62
  "yargs": "17.7.2",
63
63
  "zod": "3.25.76",
64
- "@zuplo/graphql": "6.72.3",
65
- "@zuplo/otel": "6.72.3"
64
+ "@zuplo/graphql": "6.72.8",
65
+ "@zuplo/otel": "6.72.8"
66
66
  },
67
67
  "bundleDependencies": [
68
68
  "@inquirer/prompts",