x402-surface-check 0.2.18 → 0.2.19
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/README.md +1 -1
- package/bin/x402-surface-check.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npx --yes x402-surface-check --endpoint --method POST --body '{"prompt":"price C
|
|
|
15
15
|
|
|
16
16
|
## What It Checks
|
|
17
17
|
|
|
18
|
-
- Manifest endpoint discovery from `items[]`, `endpoints[]`, `resources[]`, `x402Endpoints`, category arrays, resource strings, and OpenAPI paths
|
|
18
|
+
- Manifest endpoint discovery from `items[]`, `endpoints[]`, `resources[]`, `x402Endpoints`, category arrays, raw resource URL strings, method-prefixed resource strings, and OpenAPI paths
|
|
19
19
|
- Linked discovery documents via `discovery_url`, `discoveryUrl`, `resources_url`, `resourcesUrl`, or manifest-level OpenAPI links
|
|
20
20
|
- OpenAPI `servers[]` base-path preservation, so `/paths` are probed through the documented gateway rather than the domain root
|
|
21
21
|
- OpenAPI query/path examples, JSON request-body examples, nested request schemas, local `$ref` request schemas, and explicit direct-endpoint bodies for safer no-payment probes
|
|
@@ -394,8 +394,8 @@ function endpointEntries(document, sourceUrl, limit) {
|
|
|
394
394
|
for (const resource of document.resources ?? []) {
|
|
395
395
|
if (typeof resource === 'string') {
|
|
396
396
|
const match = resource.match(/^(GET|POST|PUT|PATCH|DELETE)\s+(\S+)/i)
|
|
397
|
-
|
|
398
|
-
const
|
|
397
|
+
const method = match?.[1] ?? 'GET'
|
|
398
|
+
const rawPath = match?.[2] ?? resource
|
|
399
399
|
const url = rawPath.startsWith('http')
|
|
400
400
|
? rawPath
|
|
401
401
|
: new URL(rawPath, document.baseUrl ?? sourceUrl).toString()
|