@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.
- package/dist/cjs/bazaar/index.js +7 -7
- package/dist/cjs/bazaar/index.js.map +1 -1
- package/dist/cjs/index.js +14 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/offer-receipt/index.js +7 -6
- package/dist/cjs/offer-receipt/index.js.map +1 -1
- package/dist/esm/bazaar/index.mjs +1 -1
- package/dist/esm/{chunk-4IPDE3NS.mjs → chunk-KGCTTHJT.mjs} +8 -8
- package/dist/esm/chunk-KGCTTHJT.mjs.map +1 -0
- package/dist/esm/{chunk-TIVMC3ZS.mjs → chunk-XF6JJU4V.mjs} +8 -7
- package/dist/esm/{chunk-TIVMC3ZS.mjs.map → chunk-XF6JJU4V.mjs.map} +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/offer-receipt/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/esm/chunk-4IPDE3NS.mjs.map +0 -1
package/dist/cjs/bazaar/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|