@bankofai/x402-extensions 1.0.0-beta.3 → 1.0.0-beta.4

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.
@@ -457,6 +457,7 @@ var bazaarResourceServerExtension = {
457
457
  // src/bazaar/facilitator.ts
458
458
  var import_node_url = require("url");
459
459
  var import__ = __toESM(require("ajv/dist/2020.js"));
460
+ var import_x402_core = require("@bankofai/x402-core");
460
461
 
461
462
  // src/bazaar/v1/facilitator.ts
462
463
  function hasV1OutputSchema(obj) {
@@ -798,9 +799,7 @@ function extractDiscoveryInfo(paymentPayload, paymentRequirements, validate = tr
798
799
  if (validate) {
799
800
  const result = validateDiscoveryExtension(extension);
800
801
  if (!result.valid) {
801
- console.warn(
802
- `V2 discovery extension validation failed: ${result.errors?.join(", ")}`
803
- );
802
+ import_x402_core.log.warn(`V2 discovery extension validation failed: ${result.errors?.join(", ")}`);
804
803
  } else {
805
804
  discoveryInfo = extension.info;
806
805
  }
@@ -808,7 +807,7 @@ function extractDiscoveryInfo(paymentPayload, paymentRequirements, validate = tr
808
807
  discoveryInfo = extension.info;
809
808
  }
810
809
  } catch (error) {
811
- console.warn(`V2 discovery extension extraction failed: ${error}`);
810
+ import_x402_core.log.warn(`V2 discovery extension extraction failed: ${error}`);
812
811
  }
813
812
  }
814
813
  }
@@ -882,6 +881,7 @@ function validateAndExtract(extension) {
882
881
  }
883
882
 
884
883
  // src/bazaar/startupValidation.ts
884
+ var import_x402_core2 = require("@bankofai/x402-core");
885
885
  var import_server = require("@bankofai/x402-core/server");
886
886
  var HTTP_VERB_RE = /^(GET|POST|PUT|PATCH|DELETE|HEAD)\b/i;
887
887
  function withSyntheticMethod(ext, pattern) {
@@ -902,7 +902,7 @@ function validateBazaarRouteExtensions(routes) {
902
902
  if (typeof bazaarExt === "object" && bazaarExt !== null && "info" in bazaarExt && "schema" in bazaarExt) {
903
903
  const specResult = validateDiscoveryExtensionSpec(bazaarExt);
904
904
  if (!specResult.valid) {
905
- console.warn(
905
+ import_x402_core2.log.warn(
906
906
  `x402: Route "${pattern}" has an invalid bazaar extension: ${specResult.errors?.join(", ")}`
907
907
  );
908
908
  continue;
@@ -912,12 +912,12 @@ function validateBazaarRouteExtensions(routes) {
912
912
  extForSchema
913
913
  );
914
914
  if (!schemaResult.valid) {
915
- console.warn(
915
+ import_x402_core2.log.warn(
916
916
  `x402: Route "${pattern}" has an invalid bazaar extension: ${schemaResult.errors?.join(", ")}`
917
917
  );
918
918
  }
919
919
  } else {
920
- console.warn(
920
+ import_x402_core2.log.warn(
921
921
  `x402: Route "${pattern}" declares a bazaar extension but it is malformed (expected an object with "info" and "schema" fields)`
922
922
  );
923
923
  }