@zuplo/cli 6.71.23 → 6.71.25

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 (128) hide show
  1. package/node_modules/@fastify/fast-json-stringify-compiler/.github/dependabot.yml +42 -2
  2. package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/ci.yml +6 -1
  3. package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/lock-threads.yml +19 -0
  4. package/node_modules/@fastify/fast-json-stringify-compiler/LICENSE +1 -1
  5. package/node_modules/@fastify/fast-json-stringify-compiler/README.md +1 -1
  6. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.gitattributes +2 -0
  7. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/dependabot.yml +13 -0
  8. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/workflows/ci.yml +33 -0
  9. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
  10. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/LICENSE +22 -0
  11. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/README.md +742 -0
  12. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-cmp-branch.js +116 -0
  13. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +339 -0
  14. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-thread.js +33 -0
  15. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench.js +391 -0
  16. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/build/build-schema-validator.js +26 -0
  17. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/eslint.config.js +9 -0
  18. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/examples/example.js +81 -0
  19. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/examples/server.js +42 -0
  20. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/index.js +1308 -0
  21. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/location.js +24 -0
  22. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/merge-schemas.js +9 -0
  23. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/schema-validator.js +1134 -0
  24. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/serializer.js +141 -0
  25. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/standalone.js +34 -0
  26. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/validator.js +96 -0
  27. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/package.json +89 -0
  28. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/additionalProperties.test.js +332 -0
  29. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/allof.test.js +751 -0
  30. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/any.test.js +231 -0
  31. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/anyof.test.js +812 -0
  32. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/array.test.js +688 -0
  33. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/asNumber.test.js +13 -0
  34. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/basic.test.js +400 -0
  35. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/bigint.test.js +76 -0
  36. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/clean-cache.test.js +47 -0
  37. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/const.test.js +314 -0
  38. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/date.test.js +639 -0
  39. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/debug-mode.test.js +130 -0
  40. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/defaults.test.js +376 -0
  41. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/enum.test.js +37 -0
  42. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/fix-604.test.js +25 -0
  43. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/fixtures/.keep +0 -0
  44. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/if-then-else.test.js +540 -0
  45. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/inferType.test.js +92 -0
  46. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/infinity.test.js +55 -0
  47. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/integer.test.js +194 -0
  48. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/invalidSchema.test.js +38 -0
  49. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-479.test.js +57 -0
  50. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-793.test.js +107 -0
  51. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-794.test.js +177 -0
  52. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
  53. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -0
  54. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/README.md +10 -0
  55. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4/required.json +54 -0
  56. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4.test.js +12 -0
  57. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6/required.json +70 -0
  58. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6.test.js +12 -0
  59. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7/required.json +70 -0
  60. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7.test.js +12 -0
  61. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/util.js +31 -0
  62. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/missing-values.test.js +88 -0
  63. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/multi-type-serializer.test.js +19 -0
  64. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/nestedObjects.test.js +63 -0
  65. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/nullable.test.js +543 -0
  66. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/oneof.test.js +510 -0
  67. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/patternProperties.test.js +168 -0
  68. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/recursion.test.js +245 -0
  69. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/ref.json +12 -0
  70. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/ref.test.js +2077 -0
  71. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/regex.test.js +32 -0
  72. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/required.test.js +204 -0
  73. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/requiresAjv.test.js +50 -0
  74. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize.test.js +141 -0
  75. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize2.test.js +18 -0
  76. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize3.test.js +17 -0
  77. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize4.test.js +16 -0
  78. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize5.test.js +16 -0
  79. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize6.test.js +22 -0
  80. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize7.test.js +68 -0
  81. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/side-effect.test.js +196 -0
  82. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/standalone-mode.test.js +219 -0
  83. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/string.test.js +84 -0
  84. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/surrogate.test.js +67 -0
  85. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/toJSON.test.js +203 -0
  86. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/typebox.test.js +36 -0
  87. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/typesArray.test.js +550 -0
  88. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/unknownFormats.test.js +27 -0
  89. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/webpack.test.js +50 -0
  90. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/types/index.d.ts +219 -0
  91. package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/types/index.tst.ts +259 -0
  92. package/node_modules/@fastify/fast-json-stringify-compiler/package.json +6 -11
  93. package/node_modules/@fastify/fast-json-stringify-compiler/types/{index.test-d.ts → index.tst.ts} +34 -32
  94. package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
  95. package/node_modules/@protobufjs/utf8/index.js +29 -18
  96. package/node_modules/@protobufjs/utf8/package.json +2 -2
  97. package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
  98. package/node_modules/@zuplo/core/package.json +1 -1
  99. package/node_modules/@zuplo/graphql/package.json +1 -1
  100. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  101. package/node_modules/@zuplo/otel/package.json +1 -1
  102. package/node_modules/@zuplo/runtime/out/esm/{chunk-5CYWMN74.js → chunk-MJWTZPC2.js} +90 -90
  103. package/node_modules/@zuplo/runtime/out/esm/chunk-MJWTZPC2.js.map +1 -0
  104. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  105. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  106. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  107. package/node_modules/@zuplo/runtime/out/types/index.d.ts +154 -0
  108. package/node_modules/@zuplo/runtime/package.json +1 -1
  109. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -1
  110. package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
  111. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -1
  112. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
  113. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +1 -1
  114. package/node_modules/hono/dist/cjs/utils/body.js +12 -4
  115. package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
  116. package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
  117. package/node_modules/hono/dist/middleware/serve-static/index.js +1 -1
  118. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
  119. package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
  120. package/node_modules/hono/dist/utils/body.js +12 -4
  121. package/node_modules/hono/dist/utils/buffer.js +2 -1
  122. package/node_modules/hono/dist/validator/validator.js +3 -3
  123. package/node_modules/hono/package.json +8 -7
  124. package/package.json +6 -6
  125. package/node_modules/@fastify/fast-json-stringify-compiler/.eslintrc +0 -1
  126. package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js.map +0 -1
  127. package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
  128. /package/node_modules/@zuplo/runtime/out/esm/{chunk-5CYWMN74.js.LEGAL.txt → chunk-MJWTZPC2.js.LEGAL.txt} +0 -0
@@ -1350,6 +1350,150 @@ declare interface AuditLogEntry {
1350
1350
  };
1351
1351
  }
1352
1352
 
1353
+ /**
1354
+ * A CloudEvent 1.0 audit log entry. Most fields are auto-populated by the
1355
+ * runtime; user code only supplies the type/subject/resources/data fields when
1356
+ * calling `AuditLogInboundPolicy.log()`.
1357
+ *
1358
+ * @public
1359
+ */
1360
+ export declare interface AuditLogEvent {
1361
+ specversion: "1.0";
1362
+ id: string;
1363
+ source: string;
1364
+ type: string;
1365
+ time: string;
1366
+ datacontenttype?: "application/json";
1367
+ subject?: string;
1368
+ bucketid: string;
1369
+ actorsub?: string;
1370
+ actortype?: "user" | "service" | "apikey" | "anonymous";
1371
+ actoremail?: string;
1372
+ actorconnection?: string;
1373
+ resources?: AuditLogResource[];
1374
+ requestid?: string;
1375
+ success?: boolean;
1376
+ httpmethod?: string;
1377
+ httpurl?: string;
1378
+ httpstatus?: number;
1379
+ ipaddress?: string;
1380
+ useragent?: string;
1381
+ country?: string;
1382
+ region?: string;
1383
+ city?: string;
1384
+ mcpserver?: string;
1385
+ mcpvirtualserver?: string;
1386
+ mcptool?: string;
1387
+ data?: Record<string, unknown>;
1388
+ extensions?: Record<string, unknown>;
1389
+ }
1390
+
1391
+ /**
1392
+ * Fields a caller may supply when emitting a custom audit event via
1393
+ * `AuditLogInboundPolicy.log()`. Everything else is filled in by the runtime
1394
+ * from the request context.
1395
+ *
1396
+ * @public
1397
+ */
1398
+ export declare interface AuditLogEventInput {
1399
+ type: string;
1400
+ subject?: string;
1401
+ resources?: AuditLogResource[];
1402
+ success?: boolean;
1403
+ data?: Record<string, unknown>;
1404
+ /**
1405
+ * Geolocation of the caller. When omitted, these default to the current
1406
+ * request's geo data (from the request context), so custom events carry the
1407
+ * same location information as the auto-emitted per-request event.
1408
+ */
1409
+ country?: string;
1410
+ region?: string;
1411
+ city?: string;
1412
+ /** Override the auto-derived actor (rare). */
1413
+ actor?: {
1414
+ sub?: string;
1415
+ type?: "user" | "service" | "apikey" | "anonymous";
1416
+ email?: string;
1417
+ connection?: string;
1418
+ };
1419
+ /** MCP-specific helpers. */
1420
+ mcp?: {
1421
+ server?: string;
1422
+ virtualServer?: string;
1423
+ tool?: string;
1424
+ };
1425
+ }
1426
+
1427
+ /**
1428
+ * Capture detailed logs of requests for auditing purposes. The policy emits
1429
+ * one structured CloudEvent per request, and user code can emit additional
1430
+ * events via the static `log()` method.
1431
+ *
1432
+ * @title Audit Logs
1433
+ * @product api-gateway
1434
+ * @public
1435
+ * @enterprise
1436
+ */
1437
+ export declare class AuditLogInboundPolicy extends InboundPolicy<AuditLogInboundPolicyOptions> {
1438
+ #private;
1439
+ static readonly policyType = "audit-logs";
1440
+ /**
1441
+ * Emit an audit event for the current request.
1442
+ *
1443
+ * Fields not provided are filled in from the request context (bucket id,
1444
+ * request id, time, actor, IP, user agent, etc).
1445
+ *
1446
+ * @param context - The current ZuploContext.
1447
+ * @param event - The event details to record.
1448
+ */
1449
+ static log(context: ZuploContext, event: AuditLogEventInput): void;
1450
+ constructor(options: AuditLogInboundPolicyOptions, policyName: string);
1451
+ handler(
1452
+ request: ZuploRequest,
1453
+ context: ZuploContext
1454
+ ): Promise<ZuploRequest | Response>;
1455
+ }
1456
+
1457
+ /**
1458
+ * The options for the Audit Log Inbound policy.
1459
+ * @public
1460
+ */
1461
+ export declare interface AuditLogInboundPolicyOptions {
1462
+ /**
1463
+ * Reverse-DNS prefix used for the auto-emitted request event type. Defaults to 'com.zuplo.api'.
1464
+ */
1465
+ eventTypeBase?: string;
1466
+ /**
1467
+ * Override the bucket id this policy emits events for. Defaults to the bucket id from the runtime environment.
1468
+ */
1469
+ bucketId?: string;
1470
+ /**
1471
+ * Fraction of requests to capture, between 0 (none) and 1 (all). Defaults to 1.
1472
+ */
1473
+ samplingRate?: number;
1474
+ /**
1475
+ * Controls which potentially-sensitive parts of each request are captured in the auto-emitted audit event. Disable fields to satisfy your own data-handling and PII policies. All are enabled by default.
1476
+ */
1477
+ include?: {
1478
+ /**
1479
+ * Include the request's query-string parameters in the logged URL. Disable if query strings may contain sensitive data.
1480
+ */
1481
+ queryParams?: boolean;
1482
+ /**
1483
+ * Include the authenticated user / actor identity (subject, email, connection).
1484
+ */
1485
+ user?: boolean;
1486
+ /**
1487
+ * Include the caller's IP address.
1488
+ */
1489
+ ipAddress?: boolean;
1490
+ /**
1491
+ * Include the caller's geolocation (country, region, city).
1492
+ */
1493
+ geolocation?: boolean;
1494
+ };
1495
+ }
1496
+
1353
1497
  /**
1354
1498
  * Configuration options for audit logging
1355
1499
  * @public
@@ -1394,6 +1538,16 @@ declare interface AuditLogRequestFilter {
1394
1538
  (request: ZuploRequest, context: ZuploContext): Promise<boolean>;
1395
1539
  }
1396
1540
 
1541
+ /**
1542
+ * A resource affected by an audit event.
1543
+ * @public
1544
+ */
1545
+ export declare interface AuditLogResource {
1546
+ type: string;
1547
+ id: string;
1548
+ metadata?: Record<string, unknown>;
1549
+ }
1550
+
1397
1551
  /**
1398
1552
  * Authenticate users using Auth0 issued JWT tokens.
1399
1553
  *
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.71.23",
4
+ "version": "6.71.25",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -334,7 +334,7 @@ var isProxyEventALB = (event) => {
334
334
  return false;
335
335
  };
336
336
  var isProxyEventV2 = (event) => {
337
- return Object.hasOwn(event, "rawPath");
337
+ return Object.hasOwn(event, "rawPath") && Object.hasOwn(event.requestContext ?? {}, "http");
338
338
  };
339
339
  var isLatticeEventV2 = (event) => {
340
340
  if (event.requestContext) {
@@ -24,7 +24,9 @@ var upgradeWebSocket = defineWebSocketHelper((c, events) => {
24
24
  data: {
25
25
  events,
26
26
  url: new URL(c.req.url),
27
- protocol: c.req.url
27
+ // The first requested subprotocol, exposed via WSContext.protocol to
28
+ // match the deno and cloudflare adapters.
29
+ protocol: c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim() ?? ""
28
30
  }
29
31
  });
30
32
  if (upgradeResult) {
@@ -364,7 +364,7 @@ const isProxyEventALB = (event) => {
364
364
  return false;
365
365
  };
366
366
  const isProxyEventV2 = (event) => {
367
- return Object.hasOwn(event, "rawPath");
367
+ return Object.hasOwn(event, "rawPath") && Object.hasOwn(event.requestContext ?? {}, "http");
368
368
  };
369
369
  const isLatticeEventV2 = (event) => {
370
370
  if (event.requestContext) {
@@ -48,7 +48,9 @@ const upgradeWebSocket = (0, import_websocket.defineWebSocketHelper)((c, events)
48
48
  data: {
49
49
  events,
50
50
  url: new URL(c.req.url),
51
- protocol: c.req.url
51
+ // The first requested subprotocol, exposed via WSContext.protocol to
52
+ // match the deno and cloudflare adapters.
53
+ protocol: c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim() ?? ""
52
54
  }
53
55
  });
54
56
  if (upgradeResult) {
@@ -65,7 +65,7 @@ const serveStatic = (options) => {
65
65
  if (content instanceof Response) {
66
66
  return c.newResponse(content.body, content);
67
67
  }
68
- if (content) {
68
+ if (content != null) {
69
69
  const mimeType = options.mimes && (0, import_mime.getMimeType)(path, options.mimes) || (0, import_mime.getMimeType)(path);
70
70
  c.header("Content-Type", mimeType || "application/octet-stream");
71
71
  if (options.precompressed && (!mimeType || import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
@@ -20,18 +20,26 @@ __export(body_exports, {
20
20
  parseBody: () => parseBody
21
21
  });
22
22
  module.exports = __toCommonJS(body_exports);
23
- var import_request = require("../request");
23
+ var import_buffer = require("./buffer");
24
+ const isRawRequest = (request) => "headers" in request;
24
25
  const parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
25
26
  const { all = false, dot = false } = options;
26
- const headers = request instanceof import_request.HonoRequest ? request.raw.headers : request.headers;
27
+ const headers = isRawRequest(request) ? request.headers : request.raw.headers;
27
28
  const contentType = headers.get("Content-Type");
28
- if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
29
+ const mediaType = contentType?.split(";")[0].trim().toLowerCase();
30
+ if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
29
31
  return parseFormData(request, { all, dot });
30
32
  }
31
33
  return {};
32
34
  };
33
35
  async function parseFormData(request, options) {
34
- const formData = await request.formData();
36
+ const headers = isRawRequest(request) ? request.headers : request.raw.headers;
37
+ const arrayBuffer = await request.arrayBuffer();
38
+ const formDataPromise = (0, import_buffer.bufferToFormData)(arrayBuffer, headers.get("Content-Type") || "");
39
+ if (!isRawRequest(request)) {
40
+ request.bodyCache.formData = formDataPromise;
41
+ }
42
+ const formData = await formDataPromise;
35
43
  if (formData) {
36
44
  return convertFormDataToBodyData(formData, options);
37
45
  }
@@ -88,7 +88,8 @@ const bufferToString = (buffer) => {
88
88
  const bufferToFormData = (arrayBuffer, contentType) => {
89
89
  const response = new Response(arrayBuffer, {
90
90
  headers: {
91
- "Content-Type": contentType
91
+ // Normalize the media type (case-insensitive) while keeping parameters like the boundary
92
+ "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase())
92
93
  }
93
94
  });
94
95
  return response.formData();
@@ -23,9 +23,9 @@ module.exports = __toCommonJS(validator_exports);
23
23
  var import_cookie = require("../helper/cookie");
24
24
  var import_http_exception = require("../http-exception");
25
25
  var import_buffer = require("../utils/buffer");
26
- const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
27
- const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/;
28
- const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
26
+ const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
27
+ const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i;
28
+ const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
29
29
  const validator = (target, validationFunc) => {
30
30
  return async (c, next) => {
31
31
  let value = {};
@@ -44,7 +44,7 @@ var serveStatic = (options) => {
44
44
  if (content instanceof Response) {
45
45
  return c.newResponse(content.body, content);
46
46
  }
47
- if (content) {
47
+ if (content != null) {
48
48
  const mimeType = options.mimes && getMimeType(path, options.mimes) || getMimeType(path);
49
49
  c.header("Content-Type", mimeType || "application/octet-stream");
50
50
  if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
@@ -24,11 +24,11 @@ import type { Env, MiddlewareHandler } from '../../types';
24
24
  * app.use(contextStorage())
25
25
  *
26
26
  * app.use(async (c, next) => {
27
- * c.set('message', 'Hono is hot!!)
27
+ * c.set('message', 'Hono is hot!!')
28
28
  * await next()
29
29
  * })
30
30
  *
31
- * app.get('/', async (c) => { c.text(getMessage()) })
31
+ * app.get('/', async (c) => c.text(getMessage()))
32
32
  *
33
33
  * const getMessage = () => {
34
34
  * return getContext<Env>().var.message
@@ -2,7 +2,7 @@
2
2
  * @module
3
3
  * Body utility.
4
4
  */
5
- import { HonoRequest } from '../request';
5
+ import type { HonoRequest } from '../request';
6
6
  type BodyDataValueDot = {
7
7
  [x: string]: string | File | BodyDataValueDot;
8
8
  };
@@ -1,16 +1,24 @@
1
1
  // src/utils/body.ts
2
- import { HonoRequest } from "../request.js";
2
+ import { bufferToFormData } from "./buffer.js";
3
+ var isRawRequest = (request) => "headers" in request;
3
4
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
4
5
  const { all = false, dot = false } = options;
5
- const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
6
+ const headers = isRawRequest(request) ? request.headers : request.raw.headers;
6
7
  const contentType = headers.get("Content-Type");
7
- if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
8
+ const mediaType = contentType?.split(";")[0].trim().toLowerCase();
9
+ if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
8
10
  return parseFormData(request, { all, dot });
9
11
  }
10
12
  return {};
11
13
  };
12
14
  async function parseFormData(request, options) {
13
- const formData = await request.formData();
15
+ const headers = isRawRequest(request) ? request.headers : request.raw.headers;
16
+ const arrayBuffer = await request.arrayBuffer();
17
+ const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || "");
18
+ if (!isRawRequest(request)) {
19
+ request.bodyCache.formData = formDataPromise;
20
+ }
21
+ const formData = await formDataPromise;
14
22
  if (formData) {
15
23
  return convertFormDataToBodyData(formData, options);
16
24
  }
@@ -64,7 +64,8 @@ var bufferToString = (buffer) => {
64
64
  var bufferToFormData = (arrayBuffer, contentType) => {
65
65
  const response = new Response(arrayBuffer, {
66
66
  headers: {
67
- "Content-Type": contentType
67
+ // Normalize the media type (case-insensitive) while keeping parameters like the boundary
68
+ "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase())
68
69
  }
69
70
  });
70
71
  return response.formData();
@@ -2,9 +2,9 @@
2
2
  import { getCookie } from "../helper/cookie/index.js";
3
3
  import { HTTPException } from "../http-exception.js";
4
4
  import { bufferToFormData } from "../utils/buffer.js";
5
- var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
6
- var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/;
7
- var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
5
+ var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
6
+ var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i;
7
+ var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
8
8
  var validator = (target, validationFunc) => {
9
9
  return async (c, next) => {
10
10
  let value = {};
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.12.27",
3
+ "version": "4.12.28",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/types/index.d.ts",
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "!dist/**/*.tsbuildinfo"
11
12
  ],
12
13
  "scripts": {
13
14
  "test": "tsc --noEmit && vitest --run",
@@ -678,17 +679,17 @@
678
679
  "eslint": "^9.39.3",
679
680
  "jsdom": "22.1.0",
680
681
  "msw": "^2.6.0",
681
- "np": "10.2.0",
682
+ "np": "11.2.1",
682
683
  "oxc-parser": "^0.96.0",
683
684
  "pkg-pr-new": "^0.0.53",
684
685
  "prettier": "3.7.4",
685
686
  "publint": "0.3.15",
686
687
  "typescript": "^5.9.2",
687
- "undici": "^6.21.3",
688
+ "undici": "^6.27.0",
688
689
  "vite-plugin-fastly-js-compute": "^0.4.2",
689
- "vitest": "^4.1.7",
690
- "wrangler": "4.12.0",
691
- "ws": "^8.18.0",
690
+ "vitest": "^4.1.9",
691
+ "wrangler": "4.107.0",
692
+ "ws": "^8.21.0",
692
693
  "zod": "^3.23.8"
693
694
  },
694
695
  "packageManager": "bun@1.2.20",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.71.23",
3
+ "version": "6.71.25",
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.71.23",
30
+ "@zuplo/core": "6.71.25",
31
31
  "@zuplo/editor": "1.0.20821740935",
32
- "@zuplo/openapi-tools": "6.71.23",
33
- "@zuplo/runtime": "6.71.23",
32
+ "@zuplo/openapi-tools": "6.71.25",
33
+ "@zuplo/runtime": "6.71.25",
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.71.23",
65
- "@zuplo/otel": "6.71.23"
64
+ "@zuplo/graphql": "6.71.25",
65
+ "@zuplo/otel": "6.71.25"
66
66
  },
67
67
  "bundleDependencies": [
68
68
  "@inquirer/prompts",
@@ -1 +0,0 @@
1
- {"extends": "standard"}