@agentcash/router 1.1.8 → 1.1.9
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/dist/index.cjs +12 -3
- package/dist/index.js +12 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1482,8 +1482,12 @@ async function build402(request, routeEntry, deps, meta, pluginCtx, bodyData) {
|
|
|
1482
1482
|
try {
|
|
1483
1483
|
const { z } = await import("zod");
|
|
1484
1484
|
const { declareDiscoveryExtension } = await import("@x402/extensions/bazaar");
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1485
|
+
const toJSON = (schema) => z.toJSONSchema(schema, {
|
|
1486
|
+
target: "draft-2020-12",
|
|
1487
|
+
unrepresentable: "any"
|
|
1488
|
+
});
|
|
1489
|
+
const inputSchema = routeEntry.bodySchema ? toJSON(routeEntry.bodySchema) : routeEntry.querySchema ? toJSON(routeEntry.querySchema) : void 0;
|
|
1490
|
+
const outputSchema = routeEntry.outputSchema ? toJSON(routeEntry.outputSchema) : void 0;
|
|
1487
1491
|
if (inputSchema) {
|
|
1488
1492
|
const config = {
|
|
1489
1493
|
bodyType: routeEntry.bodySchema ? "json" : void 0,
|
|
@@ -1492,7 +1496,12 @@ async function build402(request, routeEntry, deps, meta, pluginCtx, bodyData) {
|
|
|
1492
1496
|
if (outputSchema) config.output = { schema: outputSchema, example: {} };
|
|
1493
1497
|
extensions = declareDiscoveryExtension(config);
|
|
1494
1498
|
}
|
|
1495
|
-
} catch {
|
|
1499
|
+
} catch (err) {
|
|
1500
|
+
firePluginHook(deps.plugin, "onAlert", pluginCtx, {
|
|
1501
|
+
level: "warn",
|
|
1502
|
+
message: `Bazaar schema generation failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
1503
|
+
route: routeEntry.key
|
|
1504
|
+
});
|
|
1496
1505
|
}
|
|
1497
1506
|
if (routeEntry.siwxEnabled) {
|
|
1498
1507
|
try {
|
package/dist/index.js
CHANGED
|
@@ -1443,8 +1443,12 @@ async function build402(request, routeEntry, deps, meta, pluginCtx, bodyData) {
|
|
|
1443
1443
|
try {
|
|
1444
1444
|
const { z } = await import("zod");
|
|
1445
1445
|
const { declareDiscoveryExtension } = await import("@x402/extensions/bazaar");
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1446
|
+
const toJSON = (schema) => z.toJSONSchema(schema, {
|
|
1447
|
+
target: "draft-2020-12",
|
|
1448
|
+
unrepresentable: "any"
|
|
1449
|
+
});
|
|
1450
|
+
const inputSchema = routeEntry.bodySchema ? toJSON(routeEntry.bodySchema) : routeEntry.querySchema ? toJSON(routeEntry.querySchema) : void 0;
|
|
1451
|
+
const outputSchema = routeEntry.outputSchema ? toJSON(routeEntry.outputSchema) : void 0;
|
|
1448
1452
|
if (inputSchema) {
|
|
1449
1453
|
const config = {
|
|
1450
1454
|
bodyType: routeEntry.bodySchema ? "json" : void 0,
|
|
@@ -1453,7 +1457,12 @@ async function build402(request, routeEntry, deps, meta, pluginCtx, bodyData) {
|
|
|
1453
1457
|
if (outputSchema) config.output = { schema: outputSchema, example: {} };
|
|
1454
1458
|
extensions = declareDiscoveryExtension(config);
|
|
1455
1459
|
}
|
|
1456
|
-
} catch {
|
|
1460
|
+
} catch (err) {
|
|
1461
|
+
firePluginHook(deps.plugin, "onAlert", pluginCtx, {
|
|
1462
|
+
level: "warn",
|
|
1463
|
+
message: `Bazaar schema generation failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
1464
|
+
route: routeEntry.key
|
|
1465
|
+
});
|
|
1457
1466
|
}
|
|
1458
1467
|
if (routeEntry.siwxEnabled) {
|
|
1459
1468
|
try {
|