@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 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 inputSchema = routeEntry.bodySchema ? z.toJSONSchema(routeEntry.bodySchema, { target: "draft-2020-12" }) : routeEntry.querySchema ? z.toJSONSchema(routeEntry.querySchema, { target: "draft-2020-12" }) : void 0;
1486
- const outputSchema = routeEntry.outputSchema ? z.toJSONSchema(routeEntry.outputSchema, { target: "draft-2020-12" }) : void 0;
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 inputSchema = routeEntry.bodySchema ? z.toJSONSchema(routeEntry.bodySchema, { target: "draft-2020-12" }) : routeEntry.querySchema ? z.toJSONSchema(routeEntry.querySchema, { target: "draft-2020-12" }) : void 0;
1447
- const outputSchema = routeEntry.outputSchema ? z.toJSONSchema(routeEntry.outputSchema, { target: "draft-2020-12" }) : void 0;
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentcash/router",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "Unified route builder for Next.js App Router APIs with x402, MPP, SIWX, and API key auth",
5
5
  "type": "module",
6
6
  "exports": {