@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.
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/dependabot.yml +42 -2
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/ci.yml +6 -1
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/LICENSE +1 -1
- package/node_modules/@fastify/fast-json-stringify-compiler/README.md +1 -1
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.gitattributes +2 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/LICENSE +22 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/README.md +742 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-cmp-branch.js +116 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +339 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench-thread.js +33 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/benchmark/bench.js +391 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/build/build-schema-validator.js +26 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/eslint.config.js +9 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/examples/example.js +81 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/examples/server.js +42 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/index.js +1308 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/location.js +24 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/merge-schemas.js +9 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/schema-validator.js +1134 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/serializer.js +141 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/standalone.js +34 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/lib/validator.js +96 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/package.json +89 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/additionalProperties.test.js +332 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/allof.test.js +751 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/any.test.js +231 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/anyof.test.js +812 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/array.test.js +688 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/asNumber.test.js +13 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/basic.test.js +400 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/bigint.test.js +76 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/clean-cache.test.js +47 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/const.test.js +314 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/date.test.js +639 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/debug-mode.test.js +130 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/defaults.test.js +376 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/enum.test.js +37 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/fix-604.test.js +25 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/fixtures/.keep +0 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/if-then-else.test.js +540 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/inferType.test.js +92 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/infinity.test.js +55 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/integer.test.js +194 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/invalidSchema.test.js +38 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-479.test.js +57 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-793.test.js +107 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-794.test.js +177 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/README.md +10 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4/required.json +54 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4.test.js +12 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6/required.json +70 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6.test.js +12 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7/required.json +70 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7.test.js +12 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/json-schema-test-suite/util.js +31 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/missing-values.test.js +88 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/multi-type-serializer.test.js +19 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/nestedObjects.test.js +63 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/nullable.test.js +543 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/oneof.test.js +510 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/patternProperties.test.js +168 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/recursion.test.js +245 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/ref.json +12 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/ref.test.js +2077 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/regex.test.js +32 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/required.test.js +204 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/requiresAjv.test.js +50 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize.test.js +141 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize2.test.js +18 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize3.test.js +17 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize4.test.js +16 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize5.test.js +16 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize6.test.js +22 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/sanitize7.test.js +68 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/side-effect.test.js +196 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/standalone-mode.test.js +219 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/string.test.js +84 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/surrogate.test.js +67 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/toJSON.test.js +203 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/typebox.test.js +36 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/typesArray.test.js +550 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/unknownFormats.test.js +27 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/test/webpack.test.js +50 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/types/index.d.ts +219 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/node_modules/fast-json-stringify/types/index.tst.ts +259 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/package.json +6 -11
- package/node_modules/@fastify/fast-json-stringify-compiler/types/{index.test-d.ts → index.tst.ts} +34 -32
- package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/utf8/index.js +29 -18
- package/node_modules/@protobufjs/utf8/package.json +2 -2
- package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-5CYWMN74.js → chunk-MJWTZPC2.js} +90 -90
- package/node_modules/@zuplo/runtime/out/esm/chunk-MJWTZPC2.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +154 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -1
- package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -1
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +1 -1
- package/node_modules/hono/dist/cjs/utils/body.js +12 -4
- package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
- package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
- package/node_modules/hono/dist/middleware/serve-static/index.js +1 -1
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
- package/node_modules/hono/dist/utils/body.js +12 -4
- package/node_modules/hono/dist/utils/buffer.js +2 -1
- package/node_modules/hono/dist/validator/validator.js +3 -3
- package/node_modules/hono/package.json +8 -7
- package/package.json +6 -6
- package/node_modules/@fastify/fast-json-stringify-compiler/.eslintrc +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js.map +0 -1
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
- /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
|
*
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
27
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
27
28
|
const contentType = headers.get("Content-Type");
|
|
28
|
-
|
|
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
|
|
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
|
-
|
|
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) =>
|
|
31
|
+
* app.get('/', async (c) => c.text(getMessage()))
|
|
32
32
|
*
|
|
33
33
|
* const getMessage = () => {
|
|
34
34
|
* return getContext<Env>().var.message
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
// src/utils/body.ts
|
|
2
|
-
import {
|
|
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
|
|
6
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
6
7
|
const contentType = headers.get("Content-Type");
|
|
7
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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": "
|
|
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.
|
|
688
|
+
"undici": "^6.27.0",
|
|
688
689
|
"vite-plugin-fastly-js-compute": "^0.4.2",
|
|
689
|
-
"vitest": "^4.1.
|
|
690
|
-
"wrangler": "4.
|
|
691
|
-
"ws": "^8.
|
|
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.
|
|
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.
|
|
30
|
+
"@zuplo/core": "6.71.25",
|
|
31
31
|
"@zuplo/editor": "1.0.20821740935",
|
|
32
|
-
"@zuplo/openapi-tools": "6.71.
|
|
33
|
-
"@zuplo/runtime": "6.71.
|
|
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.
|
|
65
|
-
"@zuplo/otel": "6.71.
|
|
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"}
|