@zuplo/cli 7.8.20 → 7.8.22

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 (101) hide show
  1. package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
  2. package/node_modules/@zuplo/core/index.minified.js +1 -1
  3. package/node_modules/@zuplo/core/package.json +1 -1
  4. package/node_modules/@zuplo/graphql/package.json +1 -1
  5. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  6. package/node_modules/@zuplo/otel/out/esm/chunk-5PNQ7XJR.js +26 -0
  7. package/node_modules/@zuplo/otel/out/esm/chunk-5PNQ7XJR.js.map +1 -0
  8. package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
  9. package/node_modules/@zuplo/otel/package.json +1 -1
  10. package/node_modules/@zuplo/runtime/out/esm/{chunk-I5ENAL3B.js → chunk-OABXMALF.js} +97 -97
  11. package/node_modules/@zuplo/runtime/out/esm/chunk-OABXMALF.js.map +1 -0
  12. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  13. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  14. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  15. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  16. package/node_modules/@zuplo/runtime/out/types/index.d.ts +105 -0
  17. package/node_modules/@zuplo/runtime/package.json +1 -1
  18. package/node_modules/hono/dist/cjs/jsx/utils.js +1 -1
  19. package/node_modules/hono/dist/cjs/middleware/combine/index.js +3 -1
  20. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
  21. package/node_modules/hono/dist/jsx/utils.js +1 -1
  22. package/node_modules/hono/dist/middleware/combine/index.js +3 -1
  23. package/node_modules/hono/dist/middleware/etag/index.js +2 -2
  24. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  25. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +2 -1
  26. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +2 -1
  27. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +2 -1
  28. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +2 -1
  29. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +2 -1
  30. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +2 -1
  31. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +2 -1
  32. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +2 -1
  33. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +2 -1
  34. package/node_modules/hono/dist/types/client/types.d.ts +2 -1
  35. package/node_modules/hono/dist/types/context.d.ts +2 -1
  36. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +2 -1
  37. package/node_modules/hono/dist/types/helper/css/common.d.ts +2 -1
  38. package/node_modules/hono/dist/types/helper/css/index.d.ts +2 -1
  39. package/node_modules/hono/dist/types/helper/dev/index.d.ts +2 -1
  40. package/node_modules/hono/dist/types/helper/factory/index.d.ts +2 -1
  41. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +2 -1
  42. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +2 -1
  43. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +2 -1
  44. package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
  45. package/node_modules/hono/dist/types/hono-base.d.ts +2 -1
  46. package/node_modules/hono/dist/types/http-exception.d.ts +2 -1
  47. package/node_modules/hono/dist/types/jsx/base.d.ts +4 -3
  48. package/node_modules/hono/dist/types/jsx/context.d.ts +2 -1
  49. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +2 -1
  50. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -1
  51. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +2 -1
  52. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +2 -1
  53. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +2 -1
  54. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +2 -1
  55. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +2 -1
  56. package/node_modules/hono/dist/types/jsx/index.d.ts +2 -1
  57. package/node_modules/hono/dist/types/jsx/types.d.ts +2 -1
  58. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +2 -1
  59. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
  60. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +2 -1
  61. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +2 -1
  62. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +2 -1
  63. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +2 -1
  64. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +2 -1
  65. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +2 -1
  66. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +2 -1
  67. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -1
  68. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +2 -1
  69. package/node_modules/hono/dist/types/middleware/language/index.d.ts +2 -1
  70. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +2 -1
  71. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +2 -1
  72. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +2 -1
  73. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +2 -1
  74. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +2 -1
  75. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +2 -1
  76. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +2 -1
  77. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  78. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +2 -1
  79. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +2 -1
  80. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +2 -1
  81. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +2 -1
  82. package/node_modules/hono/dist/types/request.d.ts +2 -1
  83. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +2 -1
  84. package/node_modules/hono/dist/types/types.d.ts +2 -1
  85. package/node_modules/hono/dist/types/utils/body.d.ts +2 -1
  86. package/node_modules/hono/dist/types/utils/buffer.d.ts +2 -1
  87. package/node_modules/hono/dist/types/utils/cookie.d.ts +2 -1
  88. package/node_modules/hono/dist/types/utils/crypto.d.ts +2 -1
  89. package/node_modules/hono/dist/types/utils/filepath.d.ts +2 -1
  90. package/node_modules/hono/dist/types/utils/html.d.ts +2 -1
  91. package/node_modules/hono/dist/types/utils/mime.d.ts +2 -1
  92. package/node_modules/hono/dist/types/utils/types.d.ts +2 -1
  93. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  94. package/node_modules/hono/dist/types/validator/utils.d.ts +2 -1
  95. package/node_modules/hono/dist/types/validator/validator.d.ts +2 -1
  96. package/node_modules/hono/package.json +2 -2
  97. package/package.json +11 -11
  98. package/node_modules/@zuplo/otel/out/esm/chunk-KKABXDTK.js +0 -26
  99. package/node_modules/@zuplo/otel/out/esm/chunk-KKABXDTK.js.map +0 -1
  100. package/node_modules/@zuplo/runtime/out/esm/chunk-I5ENAL3B.js.map +0 -1
  101. /package/node_modules/@zuplo/runtime/out/esm/{chunk-I5ENAL3B.js.LEGAL.txt → chunk-OABXMALF.js.LEGAL.txt} +0 -0
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{E as p,J as c,M as u}from"../chunk-I5ENAL3B.js";import"../chunk-54HRCPVQ.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-6O4OZCO6.js";import{aa as i}from"../chunk-MWIJG5KC.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
25
+ import{E as p,J as c,M as u}from"../chunk-OABXMALF.js";import"../chunk-54HRCPVQ.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-6O4OZCO6.js";import{aa as i}from"../chunk-MWIJG5KC.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
26
26
  //# sourceMappingURL=index.js.map
@@ -874,6 +874,54 @@ export declare interface AIGatewayModelInfo {
874
874
  outputCostPerToken: number;
875
875
  }
876
876
 
877
+ /**
878
+ * Forces one model for every request, or supplies a default model when a
879
+ * request omits one, then stores that selection for the AI Gateway handler.
880
+ *
881
+ * An earlier policy's model selection is never overwritten, so a custom
882
+ * routing policy placed before this one stays authoritative.
883
+ *
884
+ * @title AI Gateway Model Override
885
+ * @beta
886
+ * @product ai-gateway
887
+ * @requiresAI
888
+ * @param request - The ZuploRequest
889
+ * @param context - The ZuploContext
890
+ * @param options - The policy options set in policies.json
891
+ * @param policyName - The name of the policy as set in policies.json
892
+ * @returns The request with model routing stored in context
893
+ * @example
894
+ * ```json
895
+ * {
896
+ * "models": {
897
+ * "completions": {
898
+ * "force": "openai/gpt-5"
899
+ * },
900
+ * "embeddings": {
901
+ * "default": "openai/text-embedding-3-small"
902
+ * }
903
+ * }
904
+ * }
905
+ * ```
906
+ */
907
+ export declare class AIGatewayModelOverrideInboundPolicy extends InboundPolicy<AIGatewayModelOverrideInboundPolicyOptions> {
908
+ #private;
909
+ static readonly policyType = "ai-gateway-model-override";
910
+ constructor(
911
+ options: AIGatewayModelOverrideInboundPolicyOptions,
912
+ policyName: string
913
+ );
914
+ handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest>;
915
+ }
916
+
917
+ /**
918
+ * Options for forcing one model or supplying a default model for each AI Gateway capability.
919
+ * @public
920
+ */
921
+ export declare interface AIGatewayModelOverrideInboundPolicyOptions {
922
+ models: Models_2;
923
+ }
924
+
877
925
  /**
878
926
  * Sets and reads the model routing selected for an AI Gateway request.
879
927
  *
@@ -4403,6 +4451,18 @@ declare type CompletionsModels =
4403
4451
  blockList: BlockedModels;
4404
4452
  };
4405
4453
 
4454
+ /**
4455
+ * Rule for chat completions, Responses, and Anthropic Messages requests.
4456
+ * @public
4457
+ */
4458
+ declare type CompletionsOverride =
4459
+ | {
4460
+ force: ForcedModel;
4461
+ }
4462
+ | {
4463
+ default: DefaultModel;
4464
+ };
4465
+
4406
4466
  /**
4407
4467
  * @public
4408
4468
  */
@@ -5246,6 +5306,18 @@ export declare interface DataLossPreventionOutboundPolicyOptions {
5246
5306
  */
5247
5307
  export declare const defaultGenerateHydrolixEntry: GenerateRequestLoggerEntry<HydrolixDefaultEntry>;
5248
5308
 
5309
+ /**
5310
+ * The model used only when a request does not select one.
5311
+ * @public
5312
+ */
5313
+ declare type DefaultModel = string;
5314
+
5315
+ /**
5316
+ * The model used only when a request does not select one.
5317
+ * @public
5318
+ */
5319
+ declare type DefaultModel1 = string;
5320
+
5249
5321
  /* Excluded from this release type: DevPortalRuntimeConfig */
5250
5322
 
5251
5323
  declare type DevPortalType = "legacy" | "zudoku";
@@ -5527,6 +5599,18 @@ declare type EmbeddingsModels =
5527
5599
  blockList: BlockedModels1;
5528
5600
  };
5529
5601
 
5602
+ /**
5603
+ * Rule for embedding requests.
5604
+ * @public
5605
+ */
5606
+ declare type EmbeddingsOverride =
5607
+ | {
5608
+ force: ForcedModel1;
5609
+ }
5610
+ | {
5611
+ default: DefaultModel1;
5612
+ };
5613
+
5530
5614
  /**
5531
5615
  * Enable accumulation and validation of streaming responses.
5532
5616
  * @public
@@ -5750,6 +5834,18 @@ export declare interface FirebaseJwtInboundPolicyOptions {
5750
5834
  */
5751
5835
  export declare function flattenMessageContent(content: unknown): string;
5752
5836
 
5837
+ /**
5838
+ * The model every request uses; a request-selected model is ignored.
5839
+ * @public
5840
+ */
5841
+ declare type ForcedModel = string;
5842
+
5843
+ /**
5844
+ * The model every request uses; a request-selected model is ignored.
5845
+ * @public
5846
+ */
5847
+ declare type ForcedModel1 = string;
5848
+
5753
5849
  /**
5754
5850
  * Converts form data in the incoming request to JSON.
5755
5851
  *
@@ -10872,6 +10968,15 @@ declare interface Models {
10872
10968
  embeddings?: EmbeddingsModels;
10873
10969
  }
10874
10970
 
10971
+ /**
10972
+ * Override rules grouped by AI Gateway capability.
10973
+ * @public
10974
+ */
10975
+ declare interface Models_2 {
10976
+ completions?: CompletionsOverride;
10977
+ embeddings?: EmbeddingsOverride;
10978
+ }
10979
+
10875
10980
  /**
10876
10981
  * Enables which model will be used based on the classifier results (`low`, `medium` and `high`). This configuration is applied only when `smartRoutingEnabled` is true and confidence score meets the `minConfidenceForRouting` threshold.
10877
10982
  * @public
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.8.20",
4
+ "version": "7.8.22",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -101,7 +101,7 @@ const styleObjectForEach = (style, fn) => {
101
101
  continue;
102
102
  }
103
103
  let value;
104
- if (typeof v === "number") value = !key.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/) ? `${v}px` : `${v}`;
104
+ if (typeof v === "number") value = !key.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?!.*gap)(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/) ? `${v}px` : `${v}`;
105
105
  else if (typeof v === "string") {
106
106
  if (hasUnsafeStyleValue(v)) continue;
107
107
  value = v;
@@ -40,13 +40,14 @@ const some = (...middleware) => {
40
40
  return next();
41
41
  };
42
42
  let lastError;
43
+ let response;
43
44
  for (const handler of middleware) try {
44
45
  const result = await handler(c, wrappedNext);
45
46
  if (result === true && !c.finalized) await wrappedNext();
46
47
  else if (result === false) {
47
48
  lastError = /* @__PURE__ */ new Error("No successful middleware found");
48
49
  continue;
49
- }
50
+ } else if (result && result !== true) response = result;
50
51
  lastError = void 0;
51
52
  break;
52
53
  } catch (error) {
@@ -54,6 +55,7 @@ const some = (...middleware) => {
54
55
  if (isNextCalled) break;
55
56
  }
56
57
  if (lastError) throw lastError;
58
+ return response;
57
59
  };
58
60
  };
59
61
  /**
@@ -49,7 +49,7 @@ function initializeGenerator(generator) {
49
49
  * ```
50
50
  */
51
51
  const etag = (options) => {
52
- const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS;
52
+ const retainedHeaders = new Set((options?.retainedHeaders ?? RETAINED_304_HEADERS).map((header) => header.toLowerCase()));
53
53
  const weak = options?.weak ?? false;
54
54
  const generator = initializeGenerator(options?.generateDigest);
55
55
  return async function etag(c, next) {
@@ -70,7 +70,7 @@ const etag = (options) => {
70
70
  statusText: "Not Modified",
71
71
  headers: { ETag: etag }
72
72
  });
73
- for (const key of Array.from(c.res.headers.keys())) if (retainedHeaders.indexOf(key.toLowerCase()) === -1) c.res.headers.delete(key);
73
+ for (const key of Array.from(c.res.headers.keys())) if (!retainedHeaders.has(key.toLowerCase())) c.res.headers.delete(key);
74
74
  } else c.res.headers.set("ETag", etag);
75
75
  };
76
76
  };
@@ -100,7 +100,7 @@ const styleObjectForEach = (style, fn) => {
100
100
  continue;
101
101
  }
102
102
  let value;
103
- if (typeof v === "number") value = !key.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/) ? `${v}px` : `${v}`;
103
+ if (typeof v === "number") value = !key.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?!.*gap)(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/) ? `${v}px` : `${v}`;
104
104
  else if (typeof v === "string") {
105
105
  if (hasUnsafeStyleValue(v)) continue;
106
106
  value = v;
@@ -39,13 +39,14 @@ const some = (...middleware) => {
39
39
  return next();
40
40
  };
41
41
  let lastError;
42
+ let response;
42
43
  for (const handler of middleware) try {
43
44
  const result = await handler(c, wrappedNext);
44
45
  if (result === true && !c.finalized) await wrappedNext();
45
46
  else if (result === false) {
46
47
  lastError = /* @__PURE__ */ new Error("No successful middleware found");
47
48
  continue;
48
- }
49
+ } else if (result && result !== true) response = result;
49
50
  lastError = void 0;
50
51
  break;
51
52
  } catch (error) {
@@ -53,6 +54,7 @@ const some = (...middleware) => {
53
54
  if (isNextCalled) break;
54
55
  }
55
56
  if (lastError) throw lastError;
57
+ return response;
56
58
  };
57
59
  };
58
60
  /**
@@ -48,7 +48,7 @@ function initializeGenerator(generator) {
48
48
  * ```
49
49
  */
50
50
  const etag = (options) => {
51
- const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS;
51
+ const retainedHeaders = new Set((options?.retainedHeaders ?? RETAINED_304_HEADERS).map((header) => header.toLowerCase()));
52
52
  const weak = options?.weak ?? false;
53
53
  const generator = initializeGenerator(options?.generateDigest);
54
54
  return async function etag(c, next) {
@@ -69,7 +69,7 @@ const etag = (options) => {
69
69
  statusText: "Not Modified",
70
70
  headers: { ETag: etag }
71
71
  });
72
- for (const key of Array.from(c.res.headers.keys())) if (retainedHeaders.indexOf(key.toLowerCase()) === -1) c.res.headers.delete(key);
72
+ for (const key of Array.from(c.res.headers.keys())) if (!retainedHeaders.has(key.toLowerCase())) c.res.headers.delete(key);
73
73
  } else c.res.headers.set("ETag", etag);
74
74
  };
75
75
  };
@@ -1,5 +1,5 @@
1
- import { parseAccept } from "../../utils/accept.js";
2
1
  import { getCookie, setCookie } from "../../helper/cookie/index.js";
2
+ import { parseAccept } from "../../utils/accept.js";
3
3
  //#region src/middleware/language/language.ts
4
4
  const DEFAULT_OPTIONS = {
5
5
  order: [
@@ -226,4 +226,5 @@ export declare const defaultIsContentTypeBinary: (contentType: string) => boolea
226
226
  * @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
227
227
  */
228
228
  export declare const isContentEncodingBinary: (contentEncoding: string | null) => boolean;
229
- //#endregion
229
+ //#endregion
230
+ export {};
@@ -179,4 +179,5 @@ export interface LatticeRequestContextV2 {
179
179
  x509SubjectCn?: string;
180
180
  };
181
181
  }
182
- //#endregion
182
+ //#endregion
183
+ export {};
@@ -50,4 +50,5 @@ export declare const websocket: BunWebSocketHandler<BunWebSocketData>;
50
50
  * @returns A function to create a Bun WebSocket handler.
51
51
  */
52
52
  export declare const createBunWebSocket: <T>() => CreateWebSocket<T>;
53
- //#endregion
53
+ //#endregion
54
+ export {};
@@ -41,4 +41,5 @@ export declare function handleMiddleware<E extends Env = {}, P extends string =
41
41
  * @deprecated `hono/cloudflare-pages` will be removed in v5. Cloudflare recommends Workers with static assets; use `hono` on Workers instead.
42
42
  */
43
43
  export declare const serveStatic: () => MiddlewareHandler;
44
- //#endregion
44
+ //#endregion
45
+ export {};
@@ -3,4 +3,5 @@ import { ServeStaticOptions } from "./serve-static.js";
3
3
  //#region src/adapter/cloudflare-workers/serve-static-module.d.ts
4
4
  declare const module: <E extends Env = Env>(options: Omit<ServeStaticOptions<E>, "namespace">) => MiddlewareHandler;
5
5
  //#endregion
6
- export { module as serveStatic };
6
+ export { module as serveStatic };
7
+ export {};
@@ -109,4 +109,5 @@ export declare const createBody: (method: string, requestBody: CloudFrontRequest
109
109
  * @deprecated `hono/lambda-edge` will be removed in v5. Install `@hono/lambda-edge` and import from there instead.
110
110
  */
111
111
  export declare const isContentTypeBinary: (contentType: string) => boolean;
112
- //#endregion
112
+ //#endregion
113
+ export {};
@@ -14,4 +14,5 @@ export type HandleOptions = {
14
14
  * @deprecated `hono/service-worker` will be removed in v5. Install `@hono/service-worker` and import from there instead.
15
15
  */
16
16
  export declare const handle: <E extends Env, S extends Schema, BasePath extends string>(app: Hono<E, S, BasePath>, opts?: HandleOptions) => Handler;
17
- //#endregion
17
+ //#endregion
18
+ export {};
@@ -22,4 +22,5 @@ import { HandleOptions, handle } from "./handler.js";
22
22
  */
23
23
  declare const fire: <E extends Env, S extends Schema, BasePath extends string>(app: Hono<E, S, BasePath>, options?: HandleOptions) => void;
24
24
  //#endregion
25
- export { fire, handle };
25
+ export { fire, handle };
26
+ export {};
@@ -13,4 +13,5 @@ export interface FetchEvent extends ExtendableEvent {
13
13
  readonly resultingClientId: string;
14
14
  respondWith(r: Response | PromiseLike<Response>): void;
15
15
  }
16
- //#endregion
16
+ //#endregion
17
+ export {};
@@ -200,4 +200,5 @@ type PickSchema<D, U extends StatusCode> = { [K in keyof D]: { [M in keyof D[K]]
200
200
  * ```
201
201
  */
202
202
  export type PickResponseByStatusCode<App, U extends StatusCode> = App extends Hono<infer E, infer _ extends Schema, infer B> ? PickSchema<ExtractSchema<App>, U> extends (infer S extends Schema) ? Hono$1<E, S, B> : never : never;
203
- //#endregion
203
+ //#endregion
204
+ export {};
@@ -455,4 +455,5 @@ export declare class Context<E extends Env = any, P extends string = any, I exte
455
455
  */
456
456
  notFound: () => ReturnType<NotFoundHandler>;
457
457
  }
458
- //#endregion
458
+ //#endregion
459
+ export {};
@@ -18,4 +18,5 @@ export declare const setCookie: (c: Context, name: string, value: string, opt?:
18
18
  export declare const generateSignedCookie: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<string>;
19
19
  export declare const setSignedCookie: (c: Context, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<void>;
20
20
  export declare const deleteCookie: (c: Context, name: string, opt?: CookieOptions) => string | undefined;
21
- //#endregion
21
+ //#endregion
22
+ export {};
@@ -57,4 +57,5 @@ type ViewTransitionType = {
57
57
  (): CssClassName;
58
58
  };
59
59
  export declare const viewTransitionCommon: ViewTransitionType;
60
- //#endregion
60
+ //#endregion
61
+ export {};
@@ -74,4 +74,5 @@ export declare const viewTransition: ViewTransitionType;
74
74
  */
75
75
  export declare const Style: StyleType;
76
76
  //#endregion
77
- export { type ClassNameSlug, type OnInvalidSlug, rawCssString };
77
+ export { type ClassNameSlug, type OnInvalidSlug, rawCssString };
78
+ export {};
@@ -14,4 +14,5 @@ interface RouteData {
14
14
  export declare const inspectRoutes: <E extends Env>(hono: Hono<E>) => RouteData[];
15
15
  export declare const showRoutes: <E extends Env>(hono: Hono<E>, opts?: ShowRoutesOptions) => void;
16
16
  export declare const getRouterName: <E extends Env>(app: Hono<E>) => string;
17
- //#endregion
17
+ //#endregion
18
+ export {};
@@ -31,4 +31,5 @@ export declare const createFactory: <E extends Env = Env, P extends string = str
31
31
  defaultAppOptions?: HonoOptions<E>;
32
32
  }) => Factory<E, P>;
33
33
  export declare const createMiddleware: <E extends Env = any, P extends string = string, I extends Input = {}, R extends HandlerResponse<any> | void = void>(middleware: MiddlewareHandler<E, P, I, R extends void ? Response : R>) => MiddlewareHandler<E, P, I, R extends void ? Response : R>;
34
- //#endregion
34
+ //#endregion
35
+ export {};
@@ -66,4 +66,5 @@ interface ProxyFetch {
66
66
  * ```
67
67
  */
68
68
  export declare const proxy: ProxyFetch;
69
- //#endregion
69
+ //#endregion
70
+ export {};
@@ -42,4 +42,5 @@ export declare const disableSSG: () => MiddlewareHandler;
42
42
  * The API might be changed.
43
43
  */
44
44
  export declare const onlySSG: () => MiddlewareHandler;
45
- //#endregion
45
+ //#endregion
46
+ export {};
@@ -14,4 +14,5 @@ interface FilterStaticGenerateRouteData {
14
14
  export declare const filterStaticGenerateRoutes: <E extends Env>(hono: Hono<E>) => FilterStaticGenerateRouteData[];
15
15
  export declare const isDynamicRoute: (path: string) => boolean;
16
16
  export declare const ensureWithinOutDir: (outDir: string, filePath: string) => void;
17
- //#endregion
17
+ //#endregion
18
+ export {};
@@ -6,4 +6,5 @@ import { Client, ClientRequestOptions } from "../../client/types.js";
6
6
  //#region src/helper/testing/index.d.ts
7
7
  type ExtractEnv<T> = T extends Hono<infer E, Schema, string> ? E : never;
8
8
  export declare const testClient: <T extends Hono<any, Schema, string>>(app: T, Env?: ExtractEnv<T>["Bindings"] | {}, executionCtx?: ExecutionContext, options?: Omit<ClientRequestOptions, "fetch">) => UnionToIntersection<Client<T, "http://localhost">>;
9
- //#endregion
9
+ //#endregion
10
+ export {};
@@ -215,4 +215,5 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
215
215
  fire: () => void;
216
216
  }
217
217
  //#endregion
218
- export { Hono as HonoBase };
218
+ export { Hono as HonoBase };
219
+ export {};
@@ -53,4 +53,5 @@ export declare class HTTPException extends Error {
53
53
  */
54
54
  getResponse(): Response;
55
55
  }
56
- //#endregion
56
+ //#endregion
57
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from "../utils/html.js";
2
2
  import { DOM_MEMO } from "./constants.js";
3
- import { IntrinsicElements, JSX as JSX$1 } from "./intrinsic-elements.js";
3
+ import { JSX as JSX$1 } from "./intrinsic-elements.js";
4
4
  import { Context } from "./context.js";
5
5
  //#region src/jsx/base.d.ts
6
6
  export type Props = Record<string, any>;
@@ -17,7 +17,7 @@ export declare namespace JSX {
17
17
  interface ElementChildrenAttribute {
18
18
  children: Child;
19
19
  }
20
- interface IntrinsicElements extends IntrinsicElements {
20
+ interface IntrinsicElements extends JSX$1.IntrinsicElements {
21
21
  [tagName: string]: Props;
22
22
  }
23
23
  interface IntrinsicAttributes {
@@ -59,4 +59,5 @@ export declare const Fragment: ({ children }: {
59
59
  export declare const isValidElement: (element: unknown) => element is JSXNode;
60
60
  export declare const cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Partial<Props>, ...children: Child[]) => T;
61
61
  export declare const reactAPICompatVersion = "19.0.0-hono-jsx";
62
- //#endregion
62
+ //#endregion
63
+ export {};
@@ -50,4 +50,5 @@ export declare const createContext: <T>(defaultValue: T) => Context<T>;
50
50
  * for the per-runtime isolation guarantees.
51
51
  */
52
52
  export declare const useContext: <T>(context: Context<T>) => T;
53
- //#endregion
53
+ //#endregion
54
+ export {};
@@ -26,4 +26,5 @@ declare const _default: {
26
26
  hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root;
27
27
  };
28
28
  //#endregion
29
- export { _default as default };
29
+ export { _default as default };
30
+ export {};
@@ -76,4 +76,5 @@ export declare const viewTransition: ViewTransitionType;
76
76
  */
77
77
  export declare const Style: FC<PropsWithChildren<void>>;
78
78
  //#endregion
79
- export { rawCssString };
79
+ export { rawCssString };
80
+ export {};
@@ -34,4 +34,5 @@ export declare const useOptimistic: <T, N>(state: T, updateState: (currentState:
34
34
  * @returns [T, (data: FormData) => void]
35
35
  */
36
36
  export declare const useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
37
- //#endregion
37
+ //#endregion
38
+ export {};
@@ -80,4 +80,5 @@ declare const _default: {
80
80
  createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
81
81
  };
82
82
  //#endregion
83
- export { type AnimationEvent, type CSSProperties, type Child, Children, type ClipboardEvent, type ComponentClass, type Context, type DOMAttributes, type DragEvent, ErrorBoundary, type Event, type FC, type FocusEvent, Fragment, Fragment as StrictMode, type InputEvent, type JSXNode, type KeyboardEvent, type MouseEvent, type PointerEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefObject, Suspense, type TouchEvent, type TransitionEvent, type WheelEvent, cloneElement, createContext, createElement, createElement as jsx, createPortal, createRef, _default as default, flushSync, forwardRef, isValidElement, memo, render, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useFormStatus, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
83
+ export { type AnimationEvent, type CSSProperties, type Child, Children, type ClipboardEvent, type ComponentClass, type Context, type DOMAttributes, type DragEvent, ErrorBoundary, type Event, type FC, type FocusEvent, Fragment, Fragment as StrictMode, type InputEvent, type JSXNode, type KeyboardEvent, type MouseEvent, type PointerEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefObject, Suspense, type TouchEvent, type TransitionEvent, type WheelEvent, cloneElement, createContext, createElement, createElement as jsx, createPortal, createRef, _default as default, flushSync, forwardRef, isValidElement, memo, render, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useFormStatus, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
84
+ export {};
@@ -51,4 +51,5 @@ export declare const renderNode: (node: NodeObject, container: Container) => voi
51
51
  export declare const render: (jsxNode: Child, container: Container) => void;
52
52
  export declare const flushSync: (callback: () => void) => void;
53
53
  export declare const createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
54
- //#endregion
54
+ //#endregion
55
+ export {};
@@ -104,4 +104,5 @@ declare const _default: {
104
104
  };
105
105
  };
106
106
  //#endregion
107
- export { _default as default, renderToReadableStream, renderToString, _default$1 as version };
107
+ export { _default as default, renderToReadableStream, renderToString, _default$1 as version };
108
+ export {};
@@ -43,4 +43,5 @@ export declare const forwardRef: <T, P = {}>(Component: (props: P, ref?: RefObje
43
43
  }) => JSX.Element);
44
44
  export declare const useImperativeHandle: <T>(ref: RefObject<T | null>, createHandle: () => T, deps: readonly unknown[]) => void;
45
45
  export declare const useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
46
- //#endregion
46
+ //#endregion
47
+ export {};
@@ -69,4 +69,5 @@ declare const _default: {
69
69
  };
70
70
  };
71
71
  //#endregion
72
- export { type AnimationEvent, type CSSProperties, type Child, Children, type ClipboardEvent, type ComponentClass, type Context, type DOMAttributes, type DragEvent, ErrorBoundary, type Event, type FC, type FocusEvent, Fragment, Fragment as StrictMode, type InputEvent, type JSX, type JSXNode, type KeyboardEvent, type MouseEvent, type PointerEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefObject, Suspense, type TouchEvent, type TransitionEvent, type WheelEvent, cloneElement, createContext, jsx as createElement, jsx, createRef, _default as default, forwardRef, isValidElement, memo, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
72
+ export { type AnimationEvent, type CSSProperties, type Child, Children, type ClipboardEvent, type ComponentClass, type Context, type DOMAttributes, type DragEvent, ErrorBoundary, type Event, type FC, type FocusEvent, Fragment, Fragment as StrictMode, type InputEvent, type JSX, type JSXNode, type KeyboardEvent, type MouseEvent, type PointerEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefObject, Suspense, type TouchEvent, type TransitionEvent, type WheelEvent, cloneElement, createContext, jsx as createElement, jsx, createRef, _default as default, forwardRef, isValidElement, memo, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
73
+ export {};
@@ -30,4 +30,5 @@ export type AnimationEvent = globalThis.AnimationEvent;
30
30
  export type TransitionEvent = globalThis.TransitionEvent;
31
31
  export type DragEvent = globalThis.DragEvent;
32
32
  //#endregion
33
- export type { Child, ComponentClass, Context, FC, JSXNode, ReactElement, ReactNode, RefObject };
33
+ export type { Child, ComponentClass, Context, FC, JSXNode, ReactElement, ReactNode, RefObject };
34
+ export {};
@@ -69,4 +69,5 @@ export declare const basicAuth: (options: BasicAuthOptions, ...users: {
69
69
  username: string;
70
70
  password: string;
71
71
  }[]) => MiddlewareHandler;
72
- //#endregion
72
+ //#endregion
73
+ export {};
@@ -86,4 +86,5 @@ type BearerAuthOptions<E extends Env = Env> = {
86
86
  * ```
87
87
  */
88
88
  export declare const bearerAuth: <E extends Env = Env>(options: BearerAuthOptions<E>) => MiddlewareHandler<E>;
89
- //#endregion
89
+ //#endregion
90
+ export {};
@@ -39,4 +39,5 @@ type BodyLimitOptions = {
39
39
  * ```
40
40
  */
41
41
  export declare const bodyLimit: (options: BodyLimitOptions) => MiddlewareHandler;
42
- //#endregion
42
+ //#endregion
43
+ export {};
@@ -81,4 +81,5 @@ export declare const every: (...middleware: (MiddlewareHandler | Condition)[]) =
81
81
  * ```
82
82
  */
83
83
  export declare const except: (condition: string | Condition | (string | Condition)[], ...middleware: MiddlewareHandler[]) => MiddlewareHandler;
84
- //#endregion
84
+ //#endregion
85
+ export {};
@@ -35,4 +35,5 @@ interface CompressionOptions {
35
35
  */
36
36
  export declare const compress: (options?: CompressionOptions) => MiddlewareHandler;
37
37
  //#endregion
38
- export { COMPRESSIBLE_CONTENT_TYPE_REGEX };
38
+ export { COMPRESSIBLE_CONTENT_TYPE_REGEX };
39
+ export {};
@@ -49,4 +49,5 @@ type CORSOptions = {
49
49
  * ```
50
50
  */
51
51
  export declare const cors: (options?: CORSOptions) => MiddlewareHandler;
52
- //#endregion
52
+ //#endregion
53
+ export {};