@agentcash/discovery 1.1.1 → 1.1.2
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/cli.cjs +25 -8
- package/dist/cli.js +25 -8
- package/dist/index.cjs +22 -6
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +22 -6
- package/dist/schemas.cjs +1 -1
- package/dist/schemas.d.cts +18 -90
- package/dist/schemas.d.ts +18 -90
- package/dist/schemas.js +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -13807,7 +13807,7 @@ config(en_default());
|
|
|
13807
13807
|
|
|
13808
13808
|
// src/schemas.ts
|
|
13809
13809
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13810
|
-
pricingMode: external_exports.
|
|
13810
|
+
pricingMode: external_exports.string(),
|
|
13811
13811
|
price: external_exports.string().optional(),
|
|
13812
13812
|
minPrice: external_exports.string().optional(),
|
|
13813
13813
|
maxPrice: external_exports.string().optional(),
|
|
@@ -13929,7 +13929,11 @@ var DEFAULT_MISSING_METHOD = "POST";
|
|
|
13929
13929
|
// src/core/lib/url.ts
|
|
13930
13930
|
function ensureProtocol(target) {
|
|
13931
13931
|
const trimmed = target.trim();
|
|
13932
|
-
|
|
13932
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
13933
|
+
const host = trimmed.split("/")[0] ?? "";
|
|
13934
|
+
const hostname3 = host.split(":")[0] ?? "";
|
|
13935
|
+
const isLocal = hostname3 === "localhost" || hostname3 === "127.0.0.1" || hostname3 === "::1";
|
|
13936
|
+
return `${isLocal ? "http" : "https"}://${trimmed}`;
|
|
13933
13937
|
}
|
|
13934
13938
|
function normalizeOrigin(target) {
|
|
13935
13939
|
const url2 = new URL(ensureProtocol(target));
|
|
@@ -13971,7 +13975,7 @@ function fetchSafe(url2, init) {
|
|
|
13971
13975
|
}
|
|
13972
13976
|
|
|
13973
13977
|
// src/mmm-enabled.ts
|
|
13974
|
-
var isMmmEnabled = () => "1.1.
|
|
13978
|
+
var isMmmEnabled = () => "1.1.2".includes("-mmm");
|
|
13975
13979
|
|
|
13976
13980
|
// src/core/source/openapi/index.ts
|
|
13977
13981
|
var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
@@ -13981,7 +13985,6 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
|
13981
13985
|
const operation = pathItem[httpMethod.toLowerCase()];
|
|
13982
13986
|
if (!operation) continue;
|
|
13983
13987
|
const authMode = inferAuthMode(operation, doc.security, doc.components?.securitySchemes) ?? void 0;
|
|
13984
|
-
if (!authMode) continue;
|
|
13985
13988
|
const p = operation["x-payment-info"];
|
|
13986
13989
|
const protocols = (p?.protocols ?? []).filter(
|
|
13987
13990
|
(proto) => proto !== "mpp" || isMmmEnabled()
|
|
@@ -14083,7 +14086,9 @@ function getWellKnown(origin, headers, signal) {
|
|
|
14083
14086
|
function formatPrice(pricing) {
|
|
14084
14087
|
if (pricing.pricingMode === "fixed") return `$${pricing.price}`;
|
|
14085
14088
|
if (pricing.pricingMode === "range") return `$${pricing.minPrice}-$${pricing.maxPrice}`;
|
|
14086
|
-
|
|
14089
|
+
if (pricing.pricingMode === "quote")
|
|
14090
|
+
return pricing.maxPrice ? `up to $${pricing.maxPrice}` : "quote";
|
|
14091
|
+
return `unknown pricing mode: ${pricing.pricingMode}`;
|
|
14087
14092
|
}
|
|
14088
14093
|
function checkL2ForOpenAPI(openApi) {
|
|
14089
14094
|
const routes = openApi.routes.map((route) => ({
|
|
@@ -14091,7 +14096,7 @@ function checkL2ForOpenAPI(openApi) {
|
|
|
14091
14096
|
method: route.method,
|
|
14092
14097
|
summary: route.summary ?? `${route.method} ${route.path}`,
|
|
14093
14098
|
...route.authMode ? { authMode: route.authMode } : {},
|
|
14094
|
-
...route.pricing ? { price: formatPrice(route.pricing) } : {},
|
|
14099
|
+
...route.pricing ? { price: formatPrice(route.pricing), pricingMode: route.pricing.pricingMode } : {},
|
|
14095
14100
|
...route.protocols?.length ? { protocols: route.protocols } : {}
|
|
14096
14101
|
}));
|
|
14097
14102
|
return {
|
|
@@ -14139,6 +14144,7 @@ var AUDIT_CODES = {
|
|
|
14139
14144
|
L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING",
|
|
14140
14145
|
L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES",
|
|
14141
14146
|
L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID",
|
|
14147
|
+
L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN",
|
|
14142
14148
|
L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID",
|
|
14143
14149
|
// ─── L3 endpoint advisory checks ─────────────────────────────────────────────
|
|
14144
14150
|
L3_NOT_FOUND: "L3_NOT_FOUND",
|
|
@@ -14189,6 +14195,7 @@ function getWarningsForWellKnown(wellKnown) {
|
|
|
14189
14195
|
}
|
|
14190
14196
|
|
|
14191
14197
|
// src/audit/warnings/l2.ts
|
|
14198
|
+
var KNOWN_PRICING_MODES = /* @__PURE__ */ new Set(["fixed", "range", "quote"]);
|
|
14192
14199
|
var ROUTE_COUNT_HIGH = 40;
|
|
14193
14200
|
function getWarningsForL2(l2) {
|
|
14194
14201
|
const warnings = [];
|
|
@@ -14228,6 +14235,15 @@ function getWarningsForL2(l2) {
|
|
|
14228
14235
|
path: route.path
|
|
14229
14236
|
});
|
|
14230
14237
|
}
|
|
14238
|
+
if (route.pricingMode && !KNOWN_PRICING_MODES.has(route.pricingMode)) {
|
|
14239
|
+
warnings.push({
|
|
14240
|
+
code: AUDIT_CODES.L2_PRICING_MODE_UNKNOWN,
|
|
14241
|
+
severity: "warn",
|
|
14242
|
+
message: `Route ${loc} has unrecognized pricingMode "${route.pricingMode}".`,
|
|
14243
|
+
hint: `Expected one of: ${[...KNOWN_PRICING_MODES].join(", ")}.`,
|
|
14244
|
+
path: route.path
|
|
14245
|
+
});
|
|
14246
|
+
}
|
|
14231
14247
|
if (route.authMode === "paid") {
|
|
14232
14248
|
if (!route.price) {
|
|
14233
14249
|
warnings.push({
|
|
@@ -15324,7 +15340,7 @@ function parseArgs(args) {
|
|
|
15324
15340
|
else positional.push(arg);
|
|
15325
15341
|
}
|
|
15326
15342
|
const [first, second] = positional;
|
|
15327
|
-
if (first &&
|
|
15343
|
+
if (first && first !== "discover" && first !== "check") {
|
|
15328
15344
|
return { command: "discover", target: first, flags };
|
|
15329
15345
|
}
|
|
15330
15346
|
return { command: first ?? null, target: second ?? null, flags };
|
|
@@ -15483,7 +15499,8 @@ async function getL3Warnings(url2) {
|
|
|
15483
15499
|
}
|
|
15484
15500
|
return result.advisories.flatMap((a) => getWarningsForL3(a));
|
|
15485
15501
|
}
|
|
15486
|
-
async function runCheck(
|
|
15502
|
+
async function runCheck(rawUrl, flags) {
|
|
15503
|
+
const url2 = ensureProtocol(rawUrl);
|
|
15487
15504
|
if (!flags.json) console.log(`
|
|
15488
15505
|
Checking ${url2}...
|
|
15489
15506
|
`);
|
package/dist/cli.js
CHANGED
|
@@ -13777,7 +13777,7 @@ config(en_default());
|
|
|
13777
13777
|
|
|
13778
13778
|
// src/schemas.ts
|
|
13779
13779
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13780
|
-
pricingMode: external_exports.
|
|
13780
|
+
pricingMode: external_exports.string(),
|
|
13781
13781
|
price: external_exports.string().optional(),
|
|
13782
13782
|
minPrice: external_exports.string().optional(),
|
|
13783
13783
|
maxPrice: external_exports.string().optional(),
|
|
@@ -13899,7 +13899,11 @@ var DEFAULT_MISSING_METHOD = "POST";
|
|
|
13899
13899
|
// src/core/lib/url.ts
|
|
13900
13900
|
function ensureProtocol(target) {
|
|
13901
13901
|
const trimmed = target.trim();
|
|
13902
|
-
|
|
13902
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
13903
|
+
const host = trimmed.split("/")[0] ?? "";
|
|
13904
|
+
const hostname3 = host.split(":")[0] ?? "";
|
|
13905
|
+
const isLocal = hostname3 === "localhost" || hostname3 === "127.0.0.1" || hostname3 === "::1";
|
|
13906
|
+
return `${isLocal ? "http" : "https"}://${trimmed}`;
|
|
13903
13907
|
}
|
|
13904
13908
|
function normalizeOrigin(target) {
|
|
13905
13909
|
const url2 = new URL(ensureProtocol(target));
|
|
@@ -13941,7 +13945,7 @@ function fetchSafe(url2, init) {
|
|
|
13941
13945
|
}
|
|
13942
13946
|
|
|
13943
13947
|
// src/mmm-enabled.ts
|
|
13944
|
-
var isMmmEnabled = () => "1.1.
|
|
13948
|
+
var isMmmEnabled = () => "1.1.2".includes("-mmm");
|
|
13945
13949
|
|
|
13946
13950
|
// src/core/source/openapi/index.ts
|
|
13947
13951
|
var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
@@ -13951,7 +13955,6 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
|
13951
13955
|
const operation = pathItem[httpMethod.toLowerCase()];
|
|
13952
13956
|
if (!operation) continue;
|
|
13953
13957
|
const authMode = inferAuthMode(operation, doc.security, doc.components?.securitySchemes) ?? void 0;
|
|
13954
|
-
if (!authMode) continue;
|
|
13955
13958
|
const p = operation["x-payment-info"];
|
|
13956
13959
|
const protocols = (p?.protocols ?? []).filter(
|
|
13957
13960
|
(proto) => proto !== "mpp" || isMmmEnabled()
|
|
@@ -14053,7 +14056,9 @@ function getWellKnown(origin, headers, signal) {
|
|
|
14053
14056
|
function formatPrice(pricing) {
|
|
14054
14057
|
if (pricing.pricingMode === "fixed") return `$${pricing.price}`;
|
|
14055
14058
|
if (pricing.pricingMode === "range") return `$${pricing.minPrice}-$${pricing.maxPrice}`;
|
|
14056
|
-
|
|
14059
|
+
if (pricing.pricingMode === "quote")
|
|
14060
|
+
return pricing.maxPrice ? `up to $${pricing.maxPrice}` : "quote";
|
|
14061
|
+
return `unknown pricing mode: ${pricing.pricingMode}`;
|
|
14057
14062
|
}
|
|
14058
14063
|
function checkL2ForOpenAPI(openApi) {
|
|
14059
14064
|
const routes = openApi.routes.map((route) => ({
|
|
@@ -14061,7 +14066,7 @@ function checkL2ForOpenAPI(openApi) {
|
|
|
14061
14066
|
method: route.method,
|
|
14062
14067
|
summary: route.summary ?? `${route.method} ${route.path}`,
|
|
14063
14068
|
...route.authMode ? { authMode: route.authMode } : {},
|
|
14064
|
-
...route.pricing ? { price: formatPrice(route.pricing) } : {},
|
|
14069
|
+
...route.pricing ? { price: formatPrice(route.pricing), pricingMode: route.pricing.pricingMode } : {},
|
|
14065
14070
|
...route.protocols?.length ? { protocols: route.protocols } : {}
|
|
14066
14071
|
}));
|
|
14067
14072
|
return {
|
|
@@ -14109,6 +14114,7 @@ var AUDIT_CODES = {
|
|
|
14109
14114
|
L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING",
|
|
14110
14115
|
L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES",
|
|
14111
14116
|
L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID",
|
|
14117
|
+
L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN",
|
|
14112
14118
|
L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID",
|
|
14113
14119
|
// ─── L3 endpoint advisory checks ─────────────────────────────────────────────
|
|
14114
14120
|
L3_NOT_FOUND: "L3_NOT_FOUND",
|
|
@@ -14159,6 +14165,7 @@ function getWarningsForWellKnown(wellKnown) {
|
|
|
14159
14165
|
}
|
|
14160
14166
|
|
|
14161
14167
|
// src/audit/warnings/l2.ts
|
|
14168
|
+
var KNOWN_PRICING_MODES = /* @__PURE__ */ new Set(["fixed", "range", "quote"]);
|
|
14162
14169
|
var ROUTE_COUNT_HIGH = 40;
|
|
14163
14170
|
function getWarningsForL2(l2) {
|
|
14164
14171
|
const warnings = [];
|
|
@@ -14198,6 +14205,15 @@ function getWarningsForL2(l2) {
|
|
|
14198
14205
|
path: route.path
|
|
14199
14206
|
});
|
|
14200
14207
|
}
|
|
14208
|
+
if (route.pricingMode && !KNOWN_PRICING_MODES.has(route.pricingMode)) {
|
|
14209
|
+
warnings.push({
|
|
14210
|
+
code: AUDIT_CODES.L2_PRICING_MODE_UNKNOWN,
|
|
14211
|
+
severity: "warn",
|
|
14212
|
+
message: `Route ${loc} has unrecognized pricingMode "${route.pricingMode}".`,
|
|
14213
|
+
hint: `Expected one of: ${[...KNOWN_PRICING_MODES].join(", ")}.`,
|
|
14214
|
+
path: route.path
|
|
14215
|
+
});
|
|
14216
|
+
}
|
|
14201
14217
|
if (route.authMode === "paid") {
|
|
14202
14218
|
if (!route.price) {
|
|
14203
14219
|
warnings.push({
|
|
@@ -15294,7 +15310,7 @@ function parseArgs(args) {
|
|
|
15294
15310
|
else positional.push(arg);
|
|
15295
15311
|
}
|
|
15296
15312
|
const [first, second] = positional;
|
|
15297
|
-
if (first &&
|
|
15313
|
+
if (first && first !== "discover" && first !== "check") {
|
|
15298
15314
|
return { command: "discover", target: first, flags };
|
|
15299
15315
|
}
|
|
15300
15316
|
return { command: first ?? null, target: second ?? null, flags };
|
|
@@ -15453,7 +15469,8 @@ async function getL3Warnings(url2) {
|
|
|
15453
15469
|
}
|
|
15454
15470
|
return result.advisories.flatMap((a) => getWarningsForL3(a));
|
|
15455
15471
|
}
|
|
15456
|
-
async function runCheck(
|
|
15472
|
+
async function runCheck(rawUrl, flags) {
|
|
15473
|
+
const url2 = ensureProtocol(rawUrl);
|
|
15457
15474
|
if (!flags.json) console.log(`
|
|
15458
15475
|
Checking ${url2}...
|
|
15459
15476
|
`);
|
package/dist/index.cjs
CHANGED
|
@@ -13830,7 +13830,7 @@ config(en_default());
|
|
|
13830
13830
|
|
|
13831
13831
|
// src/schemas.ts
|
|
13832
13832
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13833
|
-
pricingMode: external_exports.
|
|
13833
|
+
pricingMode: external_exports.string(),
|
|
13834
13834
|
price: external_exports.string().optional(),
|
|
13835
13835
|
minPrice: external_exports.string().optional(),
|
|
13836
13836
|
maxPrice: external_exports.string().optional(),
|
|
@@ -13952,7 +13952,11 @@ var DEFAULT_MISSING_METHOD = "POST";
|
|
|
13952
13952
|
// src/core/lib/url.ts
|
|
13953
13953
|
function ensureProtocol(target) {
|
|
13954
13954
|
const trimmed = target.trim();
|
|
13955
|
-
|
|
13955
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
13956
|
+
const host = trimmed.split("/")[0] ?? "";
|
|
13957
|
+
const hostname3 = host.split(":")[0] ?? "";
|
|
13958
|
+
const isLocal = hostname3 === "localhost" || hostname3 === "127.0.0.1" || hostname3 === "::1";
|
|
13959
|
+
return `${isLocal ? "http" : "https"}://${trimmed}`;
|
|
13956
13960
|
}
|
|
13957
13961
|
function normalizeOrigin(target) {
|
|
13958
13962
|
const url2 = new URL(ensureProtocol(target));
|
|
@@ -13994,7 +13998,7 @@ function fetchSafe(url2, init) {
|
|
|
13994
13998
|
}
|
|
13995
13999
|
|
|
13996
14000
|
// src/mmm-enabled.ts
|
|
13997
|
-
var isMmmEnabled = () => "1.1.
|
|
14001
|
+
var isMmmEnabled = () => "1.1.2".includes("-mmm");
|
|
13998
14002
|
|
|
13999
14003
|
// src/core/source/openapi/index.ts
|
|
14000
14004
|
var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
@@ -14004,7 +14008,6 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
|
14004
14008
|
const operation = pathItem[httpMethod.toLowerCase()];
|
|
14005
14009
|
if (!operation) continue;
|
|
14006
14010
|
const authMode = inferAuthMode(operation, doc.security, doc.components?.securitySchemes) ?? void 0;
|
|
14007
|
-
if (!authMode) continue;
|
|
14008
14011
|
const p = operation["x-payment-info"];
|
|
14009
14012
|
const protocols = (p?.protocols ?? []).filter(
|
|
14010
14013
|
(proto) => proto !== "mpp" || isMmmEnabled()
|
|
@@ -14106,7 +14109,9 @@ function getWellKnown(origin, headers, signal) {
|
|
|
14106
14109
|
function formatPrice(pricing) {
|
|
14107
14110
|
if (pricing.pricingMode === "fixed") return `$${pricing.price}`;
|
|
14108
14111
|
if (pricing.pricingMode === "range") return `$${pricing.minPrice}-$${pricing.maxPrice}`;
|
|
14109
|
-
|
|
14112
|
+
if (pricing.pricingMode === "quote")
|
|
14113
|
+
return pricing.maxPrice ? `up to $${pricing.maxPrice}` : "quote";
|
|
14114
|
+
return `unknown pricing mode: ${pricing.pricingMode}`;
|
|
14110
14115
|
}
|
|
14111
14116
|
function checkL2ForOpenAPI(openApi) {
|
|
14112
14117
|
const routes = openApi.routes.map((route) => ({
|
|
@@ -14114,7 +14119,7 @@ function checkL2ForOpenAPI(openApi) {
|
|
|
14114
14119
|
method: route.method,
|
|
14115
14120
|
summary: route.summary ?? `${route.method} ${route.path}`,
|
|
14116
14121
|
...route.authMode ? { authMode: route.authMode } : {},
|
|
14117
|
-
...route.pricing ? { price: formatPrice(route.pricing) } : {},
|
|
14122
|
+
...route.pricing ? { price: formatPrice(route.pricing), pricingMode: route.pricing.pricingMode } : {},
|
|
14118
14123
|
...route.protocols?.length ? { protocols: route.protocols } : {}
|
|
14119
14124
|
}));
|
|
14120
14125
|
return {
|
|
@@ -15101,6 +15106,7 @@ var AUDIT_CODES = {
|
|
|
15101
15106
|
L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING",
|
|
15102
15107
|
L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES",
|
|
15103
15108
|
L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID",
|
|
15109
|
+
L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN",
|
|
15104
15110
|
L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID",
|
|
15105
15111
|
// ─── L3 endpoint advisory checks ─────────────────────────────────────────────
|
|
15106
15112
|
L3_NOT_FOUND: "L3_NOT_FOUND",
|
|
@@ -15442,6 +15448,7 @@ function getWarningsForWellKnown(wellKnown) {
|
|
|
15442
15448
|
}
|
|
15443
15449
|
|
|
15444
15450
|
// src/audit/warnings/l2.ts
|
|
15451
|
+
var KNOWN_PRICING_MODES = /* @__PURE__ */ new Set(["fixed", "range", "quote"]);
|
|
15445
15452
|
var ROUTE_COUNT_HIGH = 40;
|
|
15446
15453
|
function getWarningsForL2(l2) {
|
|
15447
15454
|
const warnings = [];
|
|
@@ -15481,6 +15488,15 @@ function getWarningsForL2(l2) {
|
|
|
15481
15488
|
path: route.path
|
|
15482
15489
|
});
|
|
15483
15490
|
}
|
|
15491
|
+
if (route.pricingMode && !KNOWN_PRICING_MODES.has(route.pricingMode)) {
|
|
15492
|
+
warnings.push({
|
|
15493
|
+
code: AUDIT_CODES.L2_PRICING_MODE_UNKNOWN,
|
|
15494
|
+
severity: "warn",
|
|
15495
|
+
message: `Route ${loc} has unrecognized pricingMode "${route.pricingMode}".`,
|
|
15496
|
+
hint: `Expected one of: ${[...KNOWN_PRICING_MODES].join(", ")}.`,
|
|
15497
|
+
path: route.path
|
|
15498
|
+
});
|
|
15499
|
+
}
|
|
15484
15500
|
if (route.authMode === "paid") {
|
|
15485
15501
|
if (!route.price) {
|
|
15486
15502
|
warnings.push({
|
package/dist/index.d.cts
CHANGED
|
@@ -59,7 +59,7 @@ interface X402V2PaymentOption {
|
|
|
59
59
|
type X402PaymentOption = X402V1PaymentOption | X402V2PaymentOption;
|
|
60
60
|
type PaymentOption = X402PaymentOption | MppPaymentOption;
|
|
61
61
|
interface PricingHint {
|
|
62
|
-
pricingMode: PricingMode;
|
|
62
|
+
pricingMode: PricingMode | string;
|
|
63
63
|
price?: string;
|
|
64
64
|
minPrice?: string;
|
|
65
65
|
maxPrice?: string;
|
|
@@ -116,6 +116,7 @@ interface L2Route {
|
|
|
116
116
|
summary: string;
|
|
117
117
|
authMode?: AuthMode;
|
|
118
118
|
price?: string;
|
|
119
|
+
pricingMode?: string;
|
|
119
120
|
protocols?: string[];
|
|
120
121
|
}
|
|
121
122
|
interface L3Result {
|
|
@@ -344,6 +345,7 @@ declare const AUDIT_CODES: {
|
|
|
344
345
|
readonly L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING";
|
|
345
346
|
readonly L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES";
|
|
346
347
|
readonly L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID";
|
|
348
|
+
readonly L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN";
|
|
347
349
|
readonly L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID";
|
|
348
350
|
readonly L3_NOT_FOUND: "L3_NOT_FOUND";
|
|
349
351
|
readonly L3_INPUT_SCHEMA_MISSING: "L3_INPUT_SCHEMA_MISSING";
|
package/dist/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ interface X402V2PaymentOption {
|
|
|
59
59
|
type X402PaymentOption = X402V1PaymentOption | X402V2PaymentOption;
|
|
60
60
|
type PaymentOption = X402PaymentOption | MppPaymentOption;
|
|
61
61
|
interface PricingHint {
|
|
62
|
-
pricingMode: PricingMode;
|
|
62
|
+
pricingMode: PricingMode | string;
|
|
63
63
|
price?: string;
|
|
64
64
|
minPrice?: string;
|
|
65
65
|
maxPrice?: string;
|
|
@@ -116,6 +116,7 @@ interface L2Route {
|
|
|
116
116
|
summary: string;
|
|
117
117
|
authMode?: AuthMode;
|
|
118
118
|
price?: string;
|
|
119
|
+
pricingMode?: string;
|
|
119
120
|
protocols?: string[];
|
|
120
121
|
}
|
|
121
122
|
interface L3Result {
|
|
@@ -344,6 +345,7 @@ declare const AUDIT_CODES: {
|
|
|
344
345
|
readonly L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING";
|
|
345
346
|
readonly L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES";
|
|
346
347
|
readonly L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID";
|
|
348
|
+
readonly L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN";
|
|
347
349
|
readonly L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID";
|
|
348
350
|
readonly L3_NOT_FOUND: "L3_NOT_FOUND";
|
|
349
351
|
readonly L3_INPUT_SCHEMA_MISSING: "L3_INPUT_SCHEMA_MISSING";
|
package/dist/index.js
CHANGED
|
@@ -13777,7 +13777,7 @@ config(en_default());
|
|
|
13777
13777
|
|
|
13778
13778
|
// src/schemas.ts
|
|
13779
13779
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13780
|
-
pricingMode: external_exports.
|
|
13780
|
+
pricingMode: external_exports.string(),
|
|
13781
13781
|
price: external_exports.string().optional(),
|
|
13782
13782
|
minPrice: external_exports.string().optional(),
|
|
13783
13783
|
maxPrice: external_exports.string().optional(),
|
|
@@ -13899,7 +13899,11 @@ var DEFAULT_MISSING_METHOD = "POST";
|
|
|
13899
13899
|
// src/core/lib/url.ts
|
|
13900
13900
|
function ensureProtocol(target) {
|
|
13901
13901
|
const trimmed = target.trim();
|
|
13902
|
-
|
|
13902
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
13903
|
+
const host = trimmed.split("/")[0] ?? "";
|
|
13904
|
+
const hostname3 = host.split(":")[0] ?? "";
|
|
13905
|
+
const isLocal = hostname3 === "localhost" || hostname3 === "127.0.0.1" || hostname3 === "::1";
|
|
13906
|
+
return `${isLocal ? "http" : "https"}://${trimmed}`;
|
|
13903
13907
|
}
|
|
13904
13908
|
function normalizeOrigin(target) {
|
|
13905
13909
|
const url2 = new URL(ensureProtocol(target));
|
|
@@ -13941,7 +13945,7 @@ function fetchSafe(url2, init) {
|
|
|
13941
13945
|
}
|
|
13942
13946
|
|
|
13943
13947
|
// src/mmm-enabled.ts
|
|
13944
|
-
var isMmmEnabled = () => "1.1.
|
|
13948
|
+
var isMmmEnabled = () => "1.1.2".includes("-mmm");
|
|
13945
13949
|
|
|
13946
13950
|
// src/core/source/openapi/index.ts
|
|
13947
13951
|
var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
@@ -13951,7 +13955,6 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
|
13951
13955
|
const operation = pathItem[httpMethod.toLowerCase()];
|
|
13952
13956
|
if (!operation) continue;
|
|
13953
13957
|
const authMode = inferAuthMode(operation, doc.security, doc.components?.securitySchemes) ?? void 0;
|
|
13954
|
-
if (!authMode) continue;
|
|
13955
13958
|
const p = operation["x-payment-info"];
|
|
13956
13959
|
const protocols = (p?.protocols ?? []).filter(
|
|
13957
13960
|
(proto) => proto !== "mpp" || isMmmEnabled()
|
|
@@ -14053,7 +14056,9 @@ function getWellKnown(origin, headers, signal) {
|
|
|
14053
14056
|
function formatPrice(pricing) {
|
|
14054
14057
|
if (pricing.pricingMode === "fixed") return `$${pricing.price}`;
|
|
14055
14058
|
if (pricing.pricingMode === "range") return `$${pricing.minPrice}-$${pricing.maxPrice}`;
|
|
14056
|
-
|
|
14059
|
+
if (pricing.pricingMode === "quote")
|
|
14060
|
+
return pricing.maxPrice ? `up to $${pricing.maxPrice}` : "quote";
|
|
14061
|
+
return `unknown pricing mode: ${pricing.pricingMode}`;
|
|
14057
14062
|
}
|
|
14058
14063
|
function checkL2ForOpenAPI(openApi) {
|
|
14059
14064
|
const routes = openApi.routes.map((route) => ({
|
|
@@ -14061,7 +14066,7 @@ function checkL2ForOpenAPI(openApi) {
|
|
|
14061
14066
|
method: route.method,
|
|
14062
14067
|
summary: route.summary ?? `${route.method} ${route.path}`,
|
|
14063
14068
|
...route.authMode ? { authMode: route.authMode } : {},
|
|
14064
|
-
...route.pricing ? { price: formatPrice(route.pricing) } : {},
|
|
14069
|
+
...route.pricing ? { price: formatPrice(route.pricing), pricingMode: route.pricing.pricingMode } : {},
|
|
14065
14070
|
...route.protocols?.length ? { protocols: route.protocols } : {}
|
|
14066
14071
|
}));
|
|
14067
14072
|
return {
|
|
@@ -15048,6 +15053,7 @@ var AUDIT_CODES = {
|
|
|
15048
15053
|
L2_AUTH_MODE_MISSING: "L2_AUTH_MODE_MISSING",
|
|
15049
15054
|
L2_NO_PAID_ROUTES: "L2_NO_PAID_ROUTES",
|
|
15050
15055
|
L2_PRICE_MISSING_ON_PAID: "L2_PRICE_MISSING_ON_PAID",
|
|
15056
|
+
L2_PRICING_MODE_UNKNOWN: "L2_PRICING_MODE_UNKNOWN",
|
|
15051
15057
|
L2_PROTOCOLS_MISSING_ON_PAID: "L2_PROTOCOLS_MISSING_ON_PAID",
|
|
15052
15058
|
// ─── L3 endpoint advisory checks ─────────────────────────────────────────────
|
|
15053
15059
|
L3_NOT_FOUND: "L3_NOT_FOUND",
|
|
@@ -15389,6 +15395,7 @@ function getWarningsForWellKnown(wellKnown) {
|
|
|
15389
15395
|
}
|
|
15390
15396
|
|
|
15391
15397
|
// src/audit/warnings/l2.ts
|
|
15398
|
+
var KNOWN_PRICING_MODES = /* @__PURE__ */ new Set(["fixed", "range", "quote"]);
|
|
15392
15399
|
var ROUTE_COUNT_HIGH = 40;
|
|
15393
15400
|
function getWarningsForL2(l2) {
|
|
15394
15401
|
const warnings = [];
|
|
@@ -15428,6 +15435,15 @@ function getWarningsForL2(l2) {
|
|
|
15428
15435
|
path: route.path
|
|
15429
15436
|
});
|
|
15430
15437
|
}
|
|
15438
|
+
if (route.pricingMode && !KNOWN_PRICING_MODES.has(route.pricingMode)) {
|
|
15439
|
+
warnings.push({
|
|
15440
|
+
code: AUDIT_CODES.L2_PRICING_MODE_UNKNOWN,
|
|
15441
|
+
severity: "warn",
|
|
15442
|
+
message: `Route ${loc} has unrecognized pricingMode "${route.pricingMode}".`,
|
|
15443
|
+
hint: `Expected one of: ${[...KNOWN_PRICING_MODES].join(", ")}.`,
|
|
15444
|
+
path: route.path
|
|
15445
|
+
});
|
|
15446
|
+
}
|
|
15431
15447
|
if (route.authMode === "paid") {
|
|
15432
15448
|
if (!route.price) {
|
|
15433
15449
|
warnings.push({
|
package/dist/schemas.cjs
CHANGED
|
@@ -13799,7 +13799,7 @@ config(en_default());
|
|
|
13799
13799
|
|
|
13800
13800
|
// src/schemas.ts
|
|
13801
13801
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13802
|
-
pricingMode: external_exports.
|
|
13802
|
+
pricingMode: external_exports.string(),
|
|
13803
13803
|
price: external_exports.string().optional(),
|
|
13804
13804
|
minPrice: external_exports.string().optional(),
|
|
13805
13805
|
maxPrice: external_exports.string().optional(),
|
package/dist/schemas.d.cts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
declare const OpenApiPaymentInfoSchema: z.ZodObject<{
|
|
4
|
-
pricingMode: z.
|
|
5
|
-
fixed: "fixed";
|
|
6
|
-
range: "range";
|
|
7
|
-
quote: "quote";
|
|
8
|
-
}>;
|
|
4
|
+
pricingMode: z.ZodString;
|
|
9
5
|
price: z.ZodOptional<z.ZodString>;
|
|
10
6
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
11
7
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -31,11 +27,7 @@ declare const OpenApiOperationSchema: z.ZodObject<{
|
|
|
31
27
|
}, z.core.$strip>>;
|
|
32
28
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
33
29
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
34
|
-
pricingMode: z.
|
|
35
|
-
fixed: "fixed";
|
|
36
|
-
range: "range";
|
|
37
|
-
quote: "quote";
|
|
38
|
-
}>;
|
|
30
|
+
pricingMode: z.ZodString;
|
|
39
31
|
price: z.ZodOptional<z.ZodString>;
|
|
40
32
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
41
33
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -63,11 +55,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
63
55
|
}, z.core.$strip>>;
|
|
64
56
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
57
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
66
|
-
pricingMode: z.
|
|
67
|
-
fixed: "fixed";
|
|
68
|
-
range: "range";
|
|
69
|
-
quote: "quote";
|
|
70
|
-
}>;
|
|
58
|
+
pricingMode: z.ZodString;
|
|
71
59
|
price: z.ZodOptional<z.ZodString>;
|
|
72
60
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
73
61
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -94,11 +82,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
94
82
|
}, z.core.$strip>>;
|
|
95
83
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
96
84
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
97
|
-
pricingMode: z.
|
|
98
|
-
fixed: "fixed";
|
|
99
|
-
range: "range";
|
|
100
|
-
quote: "quote";
|
|
101
|
-
}>;
|
|
85
|
+
pricingMode: z.ZodString;
|
|
102
86
|
price: z.ZodOptional<z.ZodString>;
|
|
103
87
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
104
88
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -125,11 +109,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
125
109
|
}, z.core.$strip>>;
|
|
126
110
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
127
111
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
128
|
-
pricingMode: z.
|
|
129
|
-
fixed: "fixed";
|
|
130
|
-
range: "range";
|
|
131
|
-
quote: "quote";
|
|
132
|
-
}>;
|
|
112
|
+
pricingMode: z.ZodString;
|
|
133
113
|
price: z.ZodOptional<z.ZodString>;
|
|
134
114
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
135
115
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -156,11 +136,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
156
136
|
}, z.core.$strip>>;
|
|
157
137
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
138
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
159
|
-
pricingMode: z.
|
|
160
|
-
fixed: "fixed";
|
|
161
|
-
range: "range";
|
|
162
|
-
quote: "quote";
|
|
163
|
-
}>;
|
|
139
|
+
pricingMode: z.ZodString;
|
|
164
140
|
price: z.ZodOptional<z.ZodString>;
|
|
165
141
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
166
142
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -187,11 +163,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
187
163
|
}, z.core.$strip>>;
|
|
188
164
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
189
165
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
190
|
-
pricingMode: z.
|
|
191
|
-
fixed: "fixed";
|
|
192
|
-
range: "range";
|
|
193
|
-
quote: "quote";
|
|
194
|
-
}>;
|
|
166
|
+
pricingMode: z.ZodString;
|
|
195
167
|
price: z.ZodOptional<z.ZodString>;
|
|
196
168
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
197
169
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -218,11 +190,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
218
190
|
}, z.core.$strip>>;
|
|
219
191
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
220
192
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
221
|
-
pricingMode: z.
|
|
222
|
-
fixed: "fixed";
|
|
223
|
-
range: "range";
|
|
224
|
-
quote: "quote";
|
|
225
|
-
}>;
|
|
193
|
+
pricingMode: z.ZodString;
|
|
226
194
|
price: z.ZodOptional<z.ZodString>;
|
|
227
195
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
228
196
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -249,11 +217,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
249
217
|
}, z.core.$strip>>;
|
|
250
218
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
251
219
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
252
|
-
pricingMode: z.
|
|
253
|
-
fixed: "fixed";
|
|
254
|
-
range: "range";
|
|
255
|
-
quote: "quote";
|
|
256
|
-
}>;
|
|
220
|
+
pricingMode: z.ZodString;
|
|
257
221
|
price: z.ZodOptional<z.ZodString>;
|
|
258
222
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
259
223
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -280,11 +244,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
280
244
|
}, z.core.$strip>>;
|
|
281
245
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
282
246
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
283
|
-
pricingMode: z.
|
|
284
|
-
fixed: "fixed";
|
|
285
|
-
range: "range";
|
|
286
|
-
quote: "quote";
|
|
287
|
-
}>;
|
|
247
|
+
pricingMode: z.ZodString;
|
|
288
248
|
price: z.ZodOptional<z.ZodString>;
|
|
289
249
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
290
250
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -332,11 +292,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
332
292
|
}, z.core.$strip>>;
|
|
333
293
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
334
294
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
335
|
-
pricingMode: z.
|
|
336
|
-
fixed: "fixed";
|
|
337
|
-
range: "range";
|
|
338
|
-
quote: "quote";
|
|
339
|
-
}>;
|
|
295
|
+
pricingMode: z.ZodString;
|
|
340
296
|
price: z.ZodOptional<z.ZodString>;
|
|
341
297
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
342
298
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -363,11 +319,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
363
319
|
}, z.core.$strip>>;
|
|
364
320
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
365
321
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
366
|
-
pricingMode: z.
|
|
367
|
-
fixed: "fixed";
|
|
368
|
-
range: "range";
|
|
369
|
-
quote: "quote";
|
|
370
|
-
}>;
|
|
322
|
+
pricingMode: z.ZodString;
|
|
371
323
|
price: z.ZodOptional<z.ZodString>;
|
|
372
324
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
373
325
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -394,11 +346,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
394
346
|
}, z.core.$strip>>;
|
|
395
347
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
396
348
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
397
|
-
pricingMode: z.
|
|
398
|
-
fixed: "fixed";
|
|
399
|
-
range: "range";
|
|
400
|
-
quote: "quote";
|
|
401
|
-
}>;
|
|
349
|
+
pricingMode: z.ZodString;
|
|
402
350
|
price: z.ZodOptional<z.ZodString>;
|
|
403
351
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
404
352
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -425,11 +373,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
425
373
|
}, z.core.$strip>>;
|
|
426
374
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
427
375
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
428
|
-
pricingMode: z.
|
|
429
|
-
fixed: "fixed";
|
|
430
|
-
range: "range";
|
|
431
|
-
quote: "quote";
|
|
432
|
-
}>;
|
|
376
|
+
pricingMode: z.ZodString;
|
|
433
377
|
price: z.ZodOptional<z.ZodString>;
|
|
434
378
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
435
379
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -456,11 +400,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
456
400
|
}, z.core.$strip>>;
|
|
457
401
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
458
402
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
459
|
-
pricingMode: z.
|
|
460
|
-
fixed: "fixed";
|
|
461
|
-
range: "range";
|
|
462
|
-
quote: "quote";
|
|
463
|
-
}>;
|
|
403
|
+
pricingMode: z.ZodString;
|
|
464
404
|
price: z.ZodOptional<z.ZodString>;
|
|
465
405
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
466
406
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -487,11 +427,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
487
427
|
}, z.core.$strip>>;
|
|
488
428
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
489
429
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
490
|
-
pricingMode: z.
|
|
491
|
-
fixed: "fixed";
|
|
492
|
-
range: "range";
|
|
493
|
-
quote: "quote";
|
|
494
|
-
}>;
|
|
430
|
+
pricingMode: z.ZodString;
|
|
495
431
|
price: z.ZodOptional<z.ZodString>;
|
|
496
432
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
497
433
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -518,11 +454,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
518
454
|
}, z.core.$strip>>;
|
|
519
455
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
520
456
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
521
|
-
pricingMode: z.
|
|
522
|
-
fixed: "fixed";
|
|
523
|
-
range: "range";
|
|
524
|
-
quote: "quote";
|
|
525
|
-
}>;
|
|
457
|
+
pricingMode: z.ZodString;
|
|
526
458
|
price: z.ZodOptional<z.ZodString>;
|
|
527
459
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
528
460
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -549,11 +481,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
549
481
|
}, z.core.$strip>>;
|
|
550
482
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
551
483
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
552
|
-
pricingMode: z.
|
|
553
|
-
fixed: "fixed";
|
|
554
|
-
range: "range";
|
|
555
|
-
quote: "quote";
|
|
556
|
-
}>;
|
|
484
|
+
pricingMode: z.ZodString;
|
|
557
485
|
price: z.ZodOptional<z.ZodString>;
|
|
558
486
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
559
487
|
maxPrice: z.ZodOptional<z.ZodString>;
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
declare const OpenApiPaymentInfoSchema: z.ZodObject<{
|
|
4
|
-
pricingMode: z.
|
|
5
|
-
fixed: "fixed";
|
|
6
|
-
range: "range";
|
|
7
|
-
quote: "quote";
|
|
8
|
-
}>;
|
|
4
|
+
pricingMode: z.ZodString;
|
|
9
5
|
price: z.ZodOptional<z.ZodString>;
|
|
10
6
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
11
7
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -31,11 +27,7 @@ declare const OpenApiOperationSchema: z.ZodObject<{
|
|
|
31
27
|
}, z.core.$strip>>;
|
|
32
28
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
33
29
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
34
|
-
pricingMode: z.
|
|
35
|
-
fixed: "fixed";
|
|
36
|
-
range: "range";
|
|
37
|
-
quote: "quote";
|
|
38
|
-
}>;
|
|
30
|
+
pricingMode: z.ZodString;
|
|
39
31
|
price: z.ZodOptional<z.ZodString>;
|
|
40
32
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
41
33
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -63,11 +55,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
63
55
|
}, z.core.$strip>>;
|
|
64
56
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
57
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
66
|
-
pricingMode: z.
|
|
67
|
-
fixed: "fixed";
|
|
68
|
-
range: "range";
|
|
69
|
-
quote: "quote";
|
|
70
|
-
}>;
|
|
58
|
+
pricingMode: z.ZodString;
|
|
71
59
|
price: z.ZodOptional<z.ZodString>;
|
|
72
60
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
73
61
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -94,11 +82,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
94
82
|
}, z.core.$strip>>;
|
|
95
83
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
96
84
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
97
|
-
pricingMode: z.
|
|
98
|
-
fixed: "fixed";
|
|
99
|
-
range: "range";
|
|
100
|
-
quote: "quote";
|
|
101
|
-
}>;
|
|
85
|
+
pricingMode: z.ZodString;
|
|
102
86
|
price: z.ZodOptional<z.ZodString>;
|
|
103
87
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
104
88
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -125,11 +109,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
125
109
|
}, z.core.$strip>>;
|
|
126
110
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
127
111
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
128
|
-
pricingMode: z.
|
|
129
|
-
fixed: "fixed";
|
|
130
|
-
range: "range";
|
|
131
|
-
quote: "quote";
|
|
132
|
-
}>;
|
|
112
|
+
pricingMode: z.ZodString;
|
|
133
113
|
price: z.ZodOptional<z.ZodString>;
|
|
134
114
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
135
115
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -156,11 +136,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
156
136
|
}, z.core.$strip>>;
|
|
157
137
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
138
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
159
|
-
pricingMode: z.
|
|
160
|
-
fixed: "fixed";
|
|
161
|
-
range: "range";
|
|
162
|
-
quote: "quote";
|
|
163
|
-
}>;
|
|
139
|
+
pricingMode: z.ZodString;
|
|
164
140
|
price: z.ZodOptional<z.ZodString>;
|
|
165
141
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
166
142
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -187,11 +163,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
187
163
|
}, z.core.$strip>>;
|
|
188
164
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
189
165
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
190
|
-
pricingMode: z.
|
|
191
|
-
fixed: "fixed";
|
|
192
|
-
range: "range";
|
|
193
|
-
quote: "quote";
|
|
194
|
-
}>;
|
|
166
|
+
pricingMode: z.ZodString;
|
|
195
167
|
price: z.ZodOptional<z.ZodString>;
|
|
196
168
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
197
169
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -218,11 +190,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
218
190
|
}, z.core.$strip>>;
|
|
219
191
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
220
192
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
221
|
-
pricingMode: z.
|
|
222
|
-
fixed: "fixed";
|
|
223
|
-
range: "range";
|
|
224
|
-
quote: "quote";
|
|
225
|
-
}>;
|
|
193
|
+
pricingMode: z.ZodString;
|
|
226
194
|
price: z.ZodOptional<z.ZodString>;
|
|
227
195
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
228
196
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -249,11 +217,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
249
217
|
}, z.core.$strip>>;
|
|
250
218
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
251
219
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
252
|
-
pricingMode: z.
|
|
253
|
-
fixed: "fixed";
|
|
254
|
-
range: "range";
|
|
255
|
-
quote: "quote";
|
|
256
|
-
}>;
|
|
220
|
+
pricingMode: z.ZodString;
|
|
257
221
|
price: z.ZodOptional<z.ZodString>;
|
|
258
222
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
259
223
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -280,11 +244,7 @@ declare const OpenApiPathItemSchema: z.ZodObject<{
|
|
|
280
244
|
}, z.core.$strip>>;
|
|
281
245
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
282
246
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
283
|
-
pricingMode: z.
|
|
284
|
-
fixed: "fixed";
|
|
285
|
-
range: "range";
|
|
286
|
-
quote: "quote";
|
|
287
|
-
}>;
|
|
247
|
+
pricingMode: z.ZodString;
|
|
288
248
|
price: z.ZodOptional<z.ZodString>;
|
|
289
249
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
290
250
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -332,11 +292,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
332
292
|
}, z.core.$strip>>;
|
|
333
293
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
334
294
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
335
|
-
pricingMode: z.
|
|
336
|
-
fixed: "fixed";
|
|
337
|
-
range: "range";
|
|
338
|
-
quote: "quote";
|
|
339
|
-
}>;
|
|
295
|
+
pricingMode: z.ZodString;
|
|
340
296
|
price: z.ZodOptional<z.ZodString>;
|
|
341
297
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
342
298
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -363,11 +319,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
363
319
|
}, z.core.$strip>>;
|
|
364
320
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
365
321
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
366
|
-
pricingMode: z.
|
|
367
|
-
fixed: "fixed";
|
|
368
|
-
range: "range";
|
|
369
|
-
quote: "quote";
|
|
370
|
-
}>;
|
|
322
|
+
pricingMode: z.ZodString;
|
|
371
323
|
price: z.ZodOptional<z.ZodString>;
|
|
372
324
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
373
325
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -394,11 +346,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
394
346
|
}, z.core.$strip>>;
|
|
395
347
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
396
348
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
397
|
-
pricingMode: z.
|
|
398
|
-
fixed: "fixed";
|
|
399
|
-
range: "range";
|
|
400
|
-
quote: "quote";
|
|
401
|
-
}>;
|
|
349
|
+
pricingMode: z.ZodString;
|
|
402
350
|
price: z.ZodOptional<z.ZodString>;
|
|
403
351
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
404
352
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -425,11 +373,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
425
373
|
}, z.core.$strip>>;
|
|
426
374
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
427
375
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
428
|
-
pricingMode: z.
|
|
429
|
-
fixed: "fixed";
|
|
430
|
-
range: "range";
|
|
431
|
-
quote: "quote";
|
|
432
|
-
}>;
|
|
376
|
+
pricingMode: z.ZodString;
|
|
433
377
|
price: z.ZodOptional<z.ZodString>;
|
|
434
378
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
435
379
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -456,11 +400,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
456
400
|
}, z.core.$strip>>;
|
|
457
401
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
458
402
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
459
|
-
pricingMode: z.
|
|
460
|
-
fixed: "fixed";
|
|
461
|
-
range: "range";
|
|
462
|
-
quote: "quote";
|
|
463
|
-
}>;
|
|
403
|
+
pricingMode: z.ZodString;
|
|
464
404
|
price: z.ZodOptional<z.ZodString>;
|
|
465
405
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
466
406
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -487,11 +427,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
487
427
|
}, z.core.$strip>>;
|
|
488
428
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
489
429
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
490
|
-
pricingMode: z.
|
|
491
|
-
fixed: "fixed";
|
|
492
|
-
range: "range";
|
|
493
|
-
quote: "quote";
|
|
494
|
-
}>;
|
|
430
|
+
pricingMode: z.ZodString;
|
|
495
431
|
price: z.ZodOptional<z.ZodString>;
|
|
496
432
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
497
433
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -518,11 +454,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
518
454
|
}, z.core.$strip>>;
|
|
519
455
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
520
456
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
521
|
-
pricingMode: z.
|
|
522
|
-
fixed: "fixed";
|
|
523
|
-
range: "range";
|
|
524
|
-
quote: "quote";
|
|
525
|
-
}>;
|
|
457
|
+
pricingMode: z.ZodString;
|
|
526
458
|
price: z.ZodOptional<z.ZodString>;
|
|
527
459
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
528
460
|
maxPrice: z.ZodOptional<z.ZodString>;
|
|
@@ -549,11 +481,7 @@ declare const OpenApiDocSchema: z.ZodObject<{
|
|
|
549
481
|
}, z.core.$strip>>;
|
|
550
482
|
responses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
551
483
|
'x-payment-info': z.ZodOptional<z.ZodObject<{
|
|
552
|
-
pricingMode: z.
|
|
553
|
-
fixed: "fixed";
|
|
554
|
-
range: "range";
|
|
555
|
-
quote: "quote";
|
|
556
|
-
}>;
|
|
484
|
+
pricingMode: z.ZodString;
|
|
557
485
|
price: z.ZodOptional<z.ZodString>;
|
|
558
486
|
minPrice: z.ZodOptional<z.ZodString>;
|
|
559
487
|
maxPrice: z.ZodOptional<z.ZodString>;
|
package/dist/schemas.js
CHANGED
|
@@ -13774,7 +13774,7 @@ config(en_default());
|
|
|
13774
13774
|
|
|
13775
13775
|
// src/schemas.ts
|
|
13776
13776
|
var OpenApiPaymentInfoSchema = external_exports.object({
|
|
13777
|
-
pricingMode: external_exports.
|
|
13777
|
+
pricingMode: external_exports.string(),
|
|
13778
13778
|
price: external_exports.string().optional(),
|
|
13779
13779
|
minPrice: external_exports.string().optional(),
|
|
13780
13780
|
maxPrice: external_exports.string().optional(),
|