milieu-cli 0.3.2 → 0.4.0
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 +177 -76
- package/dist/bridges/context/agents-json.d.ts +0 -1
- package/dist/bridges/context/agents-json.js +21 -12
- package/dist/bridges/context/auth-clarity.d.ts +0 -1
- package/dist/bridges/context/auth-clarity.js +11 -9
- package/dist/bridges/context/auth-legibility.d.ts +2 -2
- package/dist/bridges/context/auth-legibility.js +67 -60
- package/dist/bridges/context/index.d.ts +1 -2
- package/dist/bridges/context/index.js +19 -40
- package/dist/bridges/context/oauth-metadata.d.ts +14 -0
- package/dist/bridges/context/oauth-metadata.js +127 -0
- package/dist/bridges/context/probe.d.ts +33 -0
- package/dist/bridges/context/probe.js +157 -0
- package/dist/bridges/context/rate-limits.d.ts +5 -2
- package/dist/bridges/context/rate-limits.js +27 -51
- package/dist/bridges/context/tos-contact.d.ts +13 -4
- package/dist/bridges/context/tos-contact.js +108 -46
- package/dist/bridges/context/versioning.d.ts +1 -2
- package/dist/bridges/context/versioning.js +42 -7
- package/dist/bridges/index.d.ts +0 -1
- package/dist/bridges/index.js +0 -1
- package/dist/bridges/reachability/crawler-policy.d.ts +30 -10
- package/dist/bridges/reachability/crawler-policy.js +41 -56
- package/dist/bridges/reachability/http-status.d.ts +3 -2
- package/dist/bridges/reachability/http-status.js +18 -3
- package/dist/bridges/reachability/https-check.d.ts +2 -2
- package/dist/bridges/reachability/https-check.js +6 -3
- package/dist/bridges/reachability/index.d.ts +1 -2
- package/dist/bridges/reachability/index.js +34 -43
- package/dist/bridges/reachability/meta-robots.d.ts +0 -13
- package/dist/bridges/reachability/meta-robots.js +89 -101
- package/dist/bridges/reachability/robots-parser.d.ts +7 -7
- package/dist/bridges/reachability/robots-parser.js +65 -15
- package/dist/bridges/reachability/robots-txt.d.ts +4 -2
- package/dist/bridges/reachability/robots-txt.js +33 -60
- package/dist/bridges/schema/descriptions.d.ts +2 -2
- package/dist/bridges/schema/descriptions.js +79 -44
- package/dist/bridges/schema/error-schemas.d.ts +2 -2
- package/dist/bridges/schema/error-schemas.js +31 -18
- package/dist/bridges/schema/index.d.ts +2 -2
- package/dist/bridges/schema/index.js +48 -30
- package/dist/bridges/schema/oas-types.d.ts +65 -26
- package/dist/bridges/schema/oas-types.js +37 -7
- package/dist/bridges/schema/operation-ids.d.ts +2 -2
- package/dist/bridges/schema/operation-ids.js +2 -3
- package/dist/bridges/schema/required-fields.d.ts +2 -2
- package/dist/bridges/schema/required-fields.js +12 -10
- package/dist/bridges/schema/schema-sources.d.ts +19 -0
- package/dist/bridges/schema/schema-sources.js +182 -0
- package/dist/bridges/schema/schema-types.d.ts +2 -2
- package/dist/bridges/schema/schema-types.js +20 -21
- package/dist/bridges/separation/api-presence.d.ts +3 -15
- package/dist/bridges/separation/api-presence.js +34 -85
- package/dist/bridges/separation/developer-docs.d.ts +6 -18
- package/dist/bridges/separation/developer-docs.js +100 -99
- package/dist/bridges/separation/docs-discovery.d.ts +28 -0
- package/dist/bridges/separation/docs-discovery.js +95 -0
- package/dist/bridges/separation/evidence-summary.d.ts +2 -0
- package/dist/bridges/separation/evidence-summary.js +67 -0
- package/dist/bridges/separation/index.d.ts +2 -19
- package/dist/bridges/separation/index.js +35 -39
- package/dist/bridges/separation/published-routes.d.ts +69 -0
- package/dist/bridges/separation/published-routes.js +271 -0
- package/dist/bridges/separation/sdk-references.d.ts +8 -3
- package/dist/bridges/separation/sdk-references.js +86 -61
- package/dist/bridges/separation/webhook-support.d.ts +3 -23
- package/dist/bridges/separation/webhook-support.js +61 -162
- package/dist/bridges/standards/a2a-agent-card.d.ts +0 -1
- package/dist/bridges/standards/a2a-agent-card.js +24 -9
- package/dist/bridges/standards/graphql.d.ts +3 -4
- package/dist/bridges/standards/graphql.js +70 -66
- package/dist/bridges/standards/index.d.ts +1 -2
- package/dist/bridges/standards/index.js +57 -47
- package/dist/bridges/standards/json-ld.d.ts +25 -11
- package/dist/bridges/standards/json-ld.js +114 -56
- package/dist/bridges/standards/llms-txt.d.ts +4 -2
- package/dist/bridges/standards/llms-txt.js +46 -32
- package/dist/bridges/standards/markdown-negotiation.d.ts +4 -1
- package/dist/bridges/standards/markdown-negotiation.js +16 -11
- package/dist/bridges/standards/mcp.d.ts +3 -12
- package/dist/bridges/standards/mcp.js +89 -132
- package/dist/bridges/standards/openapi.d.ts +7 -15
- package/dist/bridges/standards/openapi.js +657 -207
- package/dist/bridges/standards/probe-evidence.d.ts +30 -0
- package/dist/bridges/standards/probe-evidence.js +90 -0
- package/dist/bridges/standards/schema-org.d.ts +15 -9
- package/dist/bridges/standards/schema-org.js +38 -64
- package/dist/bridges/standards/sitemap.d.ts +2 -3
- package/dist/bridges/standards/sitemap.js +161 -169
- package/dist/bridges/standards/well-known.d.ts +3 -7
- package/dist/bridges/standards/well-known.js +28 -12
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +107 -22
- package/dist/cli/journey-commands.d.ts +3 -0
- package/dist/cli/journey-commands.js +35 -0
- package/dist/cli/read-report.d.ts +2 -0
- package/dist/cli/read-report.js +11 -0
- package/dist/core/bridge-output.d.ts +11 -0
- package/dist/core/bridge-output.js +86 -0
- package/dist/core/bridge-session.d.ts +28 -0
- package/dist/core/bridge-session.js +58 -0
- package/dist/core/bridge-worker.d.ts +1 -0
- package/dist/core/bridge-worker.js +66 -0
- package/dist/core/diff.d.ts +79 -0
- package/dist/core/diff.js +499 -0
- package/dist/core/explanations.d.ts +1 -3
- package/dist/core/explanations.js +36 -59
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +2 -3
- package/dist/core/scan-options.d.ts +0 -1
- package/dist/core/scan-options.js +14 -6
- package/dist/core/scan.d.ts +0 -1
- package/dist/core/scan.js +91 -41
- package/dist/core/scoring.d.ts +6 -0
- package/dist/core/scoring.js +27 -0
- package/dist/core/types.d.ts +97 -61
- package/dist/core/types.js +9 -3
- package/dist/core/validate-report.d.ts +5 -0
- package/dist/core/validate-report.js +95 -0
- package/dist/core/version.d.ts +0 -1
- package/dist/core/version.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/journey/body-worker.d.ts +27 -0
- package/dist/journey/body-worker.js +140 -0
- package/dist/journey/case.d.ts +74 -0
- package/dist/journey/case.js +187 -0
- package/dist/journey/cli.d.ts +14 -0
- package/dist/journey/cli.js +226 -0
- package/dist/journey/compare.d.ts +43 -0
- package/dist/journey/compare.js +83 -0
- package/dist/journey/contracts.d.ts +143 -0
- package/dist/journey/contracts.js +37 -0
- package/dist/journey/decision.d.ts +72 -0
- package/dist/journey/decision.js +121 -0
- package/dist/journey/demo.d.ts +36 -0
- package/dist/journey/demo.js +137 -0
- package/dist/journey/document.d.ts +8 -0
- package/dist/journey/document.js +113 -0
- package/dist/journey/excerpt.d.ts +6 -0
- package/dist/journey/excerpt.js +54 -0
- package/dist/journey/name-guidance.d.ts +2 -0
- package/dist/journey/name-guidance.js +41 -0
- package/dist/journey/providers.d.ts +34 -0
- package/dist/journey/providers.js +197 -0
- package/dist/journey/report-validation.d.ts +3 -0
- package/dist/journey/report-validation.js +457 -0
- package/dist/journey/runner.d.ts +12 -0
- package/dist/journey/runner.js +321 -0
- package/dist/journey/scope.d.ts +8 -0
- package/dist/journey/scope.js +50 -0
- package/dist/journey/transport.d.ts +3 -0
- package/dist/journey/transport.js +45 -0
- package/dist/journey/verify.d.ts +21 -0
- package/dist/journey/verify.js +213 -0
- package/dist/render/colors.d.ts +6 -7
- package/dist/render/colors.js +16 -25
- package/dist/render/discovery-guidance.d.ts +3 -0
- package/dist/render/discovery-guidance.js +66 -0
- package/dist/render/format-bridge.d.ts +1 -2
- package/dist/render/format-bridge.js +22 -17
- package/dist/render/format-diff.d.ts +2 -0
- package/dist/render/format-diff.js +169 -0
- package/dist/render/format-scan.d.ts +0 -1
- package/dist/render/format-scan.js +6 -4
- package/dist/render/format-verbose.d.ts +0 -1
- package/dist/render/format-verbose.js +7 -4
- package/dist/render/index.d.ts +0 -1
- package/dist/render/index.js +1 -2
- package/dist/render/oauth-observations.d.ts +4 -0
- package/dist/render/oauth-observations.js +27 -0
- package/dist/render/progress-bar.d.ts +1 -2
- package/dist/render/progress-bar.js +8 -6
- package/dist/render/robots-inventory.d.ts +3 -0
- package/dist/render/robots-inventory.js +38 -0
- package/dist/render/symbols.d.ts +4 -10
- package/dist/render/symbols.js +15 -17
- package/dist/render/terminal-text.d.ts +1 -3
- package/dist/render/terminal-text.js +1 -5
- package/dist/utils/analysis-worker-entry.d.ts +3 -0
- package/dist/utils/analysis-worker-entry.js +12 -0
- package/dist/utils/analysis-worker.d.ts +12 -0
- package/dist/utils/analysis-worker.js +54 -0
- package/dist/utils/html.d.ts +39 -0
- package/dist/utils/html.js +261 -0
- package/dist/utils/http-client.d.ts +24 -17
- package/dist/utils/http-client.js +166 -200
- package/dist/utils/http-types.d.ts +43 -0
- package/dist/utils/http-types.js +11 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/package-registry.d.ts +11 -0
- package/dist/utils/package-registry.js +69 -0
- package/dist/utils/read-json-file.d.ts +3 -0
- package/dist/utils/read-json-file.js +41 -0
- package/dist/utils/record.d.ts +1 -0
- package/dist/utils/record.js +3 -0
- package/dist/utils/response-body.d.ts +7 -0
- package/dist/utils/response-body.js +71 -0
- package/dist/utils/ssrf.d.ts +11 -15
- package/dist/utils/ssrf.js +80 -44
- package/dist/utils/terminal-text.d.ts +2 -0
- package/dist/utils/terminal-text.js +4 -0
- package/dist/utils/url.d.ts +29 -1
- package/dist/utils/url.js +147 -17
- package/docs/examples/onboarding/account-claim.json +25 -0
- package/docs/examples/onboarding/pages/account-claim.html +3 -0
- package/docs/examples/onboarding/pages/production-activation.html +3 -0
- package/docs/examples/onboarding/pages/test-credential.html +3 -0
- package/docs/examples/onboarding/production-activation.json +25 -0
- package/docs/examples/onboarding/test-credential.json +25 -0
- package/docs/journey-qualification.md +46 -0
- package/docs/journeys.md +83 -0
- package/package.json +28 -8
- package/dist/bridges/context/agents-json.d.ts.map +0 -1
- package/dist/bridges/context/agents-json.js.map +0 -1
- package/dist/bridges/context/auth-clarity.d.ts.map +0 -1
- package/dist/bridges/context/auth-clarity.js.map +0 -1
- package/dist/bridges/context/auth-legibility.d.ts.map +0 -1
- package/dist/bridges/context/auth-legibility.js.map +0 -1
- package/dist/bridges/context/index.d.ts.map +0 -1
- package/dist/bridges/context/index.js.map +0 -1
- package/dist/bridges/context/rate-limits.d.ts.map +0 -1
- package/dist/bridges/context/rate-limits.js.map +0 -1
- package/dist/bridges/context/tos-contact.d.ts.map +0 -1
- package/dist/bridges/context/tos-contact.js.map +0 -1
- package/dist/bridges/context/versioning.d.ts.map +0 -1
- package/dist/bridges/context/versioning.js.map +0 -1
- package/dist/bridges/index.d.ts.map +0 -1
- package/dist/bridges/index.js.map +0 -1
- package/dist/bridges/reachability/crawler-policy.d.ts.map +0 -1
- package/dist/bridges/reachability/crawler-policy.js.map +0 -1
- package/dist/bridges/reachability/http-status.d.ts.map +0 -1
- package/dist/bridges/reachability/http-status.js.map +0 -1
- package/dist/bridges/reachability/https-check.d.ts.map +0 -1
- package/dist/bridges/reachability/https-check.js.map +0 -1
- package/dist/bridges/reachability/index.d.ts.map +0 -1
- package/dist/bridges/reachability/index.js.map +0 -1
- package/dist/bridges/reachability/meta-robots.d.ts.map +0 -1
- package/dist/bridges/reachability/meta-robots.js.map +0 -1
- package/dist/bridges/reachability/robots-parser.d.ts.map +0 -1
- package/dist/bridges/reachability/robots-parser.js.map +0 -1
- package/dist/bridges/reachability/robots-txt.d.ts.map +0 -1
- package/dist/bridges/reachability/robots-txt.js.map +0 -1
- package/dist/bridges/schema/descriptions.d.ts.map +0 -1
- package/dist/bridges/schema/descriptions.js.map +0 -1
- package/dist/bridges/schema/error-schemas.d.ts.map +0 -1
- package/dist/bridges/schema/error-schemas.js.map +0 -1
- package/dist/bridges/schema/index.d.ts.map +0 -1
- package/dist/bridges/schema/index.js.map +0 -1
- package/dist/bridges/schema/oas-types.d.ts.map +0 -1
- package/dist/bridges/schema/oas-types.js.map +0 -1
- package/dist/bridges/schema/operation-ids.d.ts.map +0 -1
- package/dist/bridges/schema/operation-ids.js.map +0 -1
- package/dist/bridges/schema/required-fields.d.ts.map +0 -1
- package/dist/bridges/schema/required-fields.js.map +0 -1
- package/dist/bridges/schema/schema-types.d.ts.map +0 -1
- package/dist/bridges/schema/schema-types.js.map +0 -1
- package/dist/bridges/separation/api-presence.d.ts.map +0 -1
- package/dist/bridges/separation/api-presence.js.map +0 -1
- package/dist/bridges/separation/developer-docs.d.ts.map +0 -1
- package/dist/bridges/separation/developer-docs.js.map +0 -1
- package/dist/bridges/separation/index.d.ts.map +0 -1
- package/dist/bridges/separation/index.js.map +0 -1
- package/dist/bridges/separation/sdk-references.d.ts.map +0 -1
- package/dist/bridges/separation/sdk-references.js.map +0 -1
- package/dist/bridges/separation/webhook-support.d.ts.map +0 -1
- package/dist/bridges/separation/webhook-support.js.map +0 -1
- package/dist/bridges/standards/a2a-agent-card.d.ts.map +0 -1
- package/dist/bridges/standards/a2a-agent-card.js.map +0 -1
- package/dist/bridges/standards/graphql.d.ts.map +0 -1
- package/dist/bridges/standards/graphql.js.map +0 -1
- package/dist/bridges/standards/index.d.ts.map +0 -1
- package/dist/bridges/standards/index.js.map +0 -1
- package/dist/bridges/standards/json-ld.d.ts.map +0 -1
- package/dist/bridges/standards/json-ld.js.map +0 -1
- package/dist/bridges/standards/llms-txt.d.ts.map +0 -1
- package/dist/bridges/standards/llms-txt.js.map +0 -1
- package/dist/bridges/standards/markdown-negotiation.d.ts.map +0 -1
- package/dist/bridges/standards/markdown-negotiation.js.map +0 -1
- package/dist/bridges/standards/mcp.d.ts.map +0 -1
- package/dist/bridges/standards/mcp.js.map +0 -1
- package/dist/bridges/standards/openapi.d.ts.map +0 -1
- package/dist/bridges/standards/openapi.js.map +0 -1
- package/dist/bridges/standards/schema-org.d.ts.map +0 -1
- package/dist/bridges/standards/schema-org.js.map +0 -1
- package/dist/bridges/standards/sitemap.d.ts.map +0 -1
- package/dist/bridges/standards/sitemap.js.map +0 -1
- package/dist/bridges/standards/well-known.d.ts.map +0 -1
- package/dist/bridges/standards/well-known.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/core/explanations.d.ts.map +0 -1
- package/dist/core/explanations.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/scan-options.d.ts.map +0 -1
- package/dist/core/scan-options.js.map +0 -1
- package/dist/core/scan.d.ts.map +0 -1
- package/dist/core/scan.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/render/colors.d.ts.map +0 -1
- package/dist/render/colors.js.map +0 -1
- package/dist/render/format-bridge.d.ts.map +0 -1
- package/dist/render/format-bridge.js.map +0 -1
- package/dist/render/format-scan.d.ts.map +0 -1
- package/dist/render/format-scan.js.map +0 -1
- package/dist/render/format-verbose.d.ts.map +0 -1
- package/dist/render/format-verbose.js.map +0 -1
- package/dist/render/index.d.ts.map +0 -1
- package/dist/render/index.js.map +0 -1
- package/dist/render/progress-bar.d.ts.map +0 -1
- package/dist/render/progress-bar.js.map +0 -1
- package/dist/render/symbols.d.ts.map +0 -1
- package/dist/render/symbols.js.map +0 -1
- package/dist/render/terminal-text.d.ts.map +0 -1
- package/dist/render/terminal-text.js.map +0 -1
- package/dist/utils/http-client.d.ts.map +0 -1
- package/dist/utils/http-client.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/ssrf.d.ts.map +0 -1
- package/dist/utils/ssrf.js.map +0 -1
- package/dist/utils/url.d.ts.map +0 -1
- package/dist/utils/url.js.map +0 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { isHtmlMediaType, isMarkdownMediaType, mediaType } from "../../utils/http-types.js";
|
|
2
|
+
import { looksLikeHtml, parseHtml } from "../../utils/html.js";
|
|
3
|
+
import { documentBase, parseReference } from "../../utils/url.js";
|
|
4
|
+
/** Well-known paths for developer documentation */
|
|
5
|
+
export const DOC_PATHS = [
|
|
6
|
+
"/docs",
|
|
7
|
+
"/developers",
|
|
8
|
+
"/developer",
|
|
9
|
+
"/api/docs",
|
|
10
|
+
"/documentation",
|
|
11
|
+
];
|
|
12
|
+
export function docPathMatches(url, path) {
|
|
13
|
+
return (url.pathname.toLowerCase() + "/").includes(path + "/");
|
|
14
|
+
}
|
|
15
|
+
export function isDeveloperDocsLink(url) {
|
|
16
|
+
return /^(?:docs|developers?)\.[^.]+\./i.test(url.hostname) || DOC_PATHS.some(path => docPathMatches(url, path));
|
|
17
|
+
}
|
|
18
|
+
export function relatedHost(url, site) {
|
|
19
|
+
const domain = site.hostname.replace(/^www\./i, "");
|
|
20
|
+
return url.hostname === domain || url.hostname.endsWith("." + domain);
|
|
21
|
+
}
|
|
22
|
+
// A clipped URL names a different resource, so a longer one is counted but left out of a stored sample.
|
|
23
|
+
export const MAX_RECORDED_URL = 2048;
|
|
24
|
+
const MAX_RECORDED_URLS = 100;
|
|
25
|
+
// Keeps the sum of Bridge 3's samples well inside the worker's 2 MiB report limit.
|
|
26
|
+
const MAX_RECORDED_CHARS = 32_768;
|
|
27
|
+
/** Report fields for a deduplicated inventory: a bounded sample under `field`, its total, and a flag when cut. */
|
|
28
|
+
export function urlSample(field, urls) {
|
|
29
|
+
const sample = [];
|
|
30
|
+
let total = 0;
|
|
31
|
+
let chars = 0;
|
|
32
|
+
for (const url of urls) {
|
|
33
|
+
total++;
|
|
34
|
+
if (sample.length < MAX_RECORDED_URLS && url.length <= MAX_RECORDED_URL && chars + url.length <= MAX_RECORDED_CHARS) {
|
|
35
|
+
sample.push(url);
|
|
36
|
+
chars += url.length;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { [field]: sample, [field + "Total"]: total, ...(sample.length < total && { [field + "Truncated"]: true }) };
|
|
40
|
+
}
|
|
41
|
+
// Only body-only callers need a base for resolving relative links.
|
|
42
|
+
export function sourceDocument(source) {
|
|
43
|
+
return source.document ?? readDocument(source.content, source.url ?? "https://source.invalid/");
|
|
44
|
+
}
|
|
45
|
+
export function isMarkdownSource(source) {
|
|
46
|
+
return source.markdown ?? !/<(?:!--|[a-z][\w:-]*(?:[\s/>]))/i.test(source.content);
|
|
47
|
+
}
|
|
48
|
+
export function markdownLinks(text) {
|
|
49
|
+
return text.matchAll(/\[([^\[\]\r\n]{0,512})\]\([ \t]{0,32}<?([^()<>\s]{1,2048})>?[ \t]{0,32}\)/g);
|
|
50
|
+
}
|
|
51
|
+
export function safeUrl(url) {
|
|
52
|
+
return (url.protocol === "https:" || url.protocol === "http:") && !url.search && !url.username && !url.password;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* What the resolved links of one document may hold, each counted as its length plus the 300 bytes a URL takes. A
|
|
56
|
+
* relative link under a base or page URL near the length limit resolves to that length: 15,000 of them, 300 KB of
|
|
57
|
+
* markup, once held 120 MB.
|
|
58
|
+
*/
|
|
59
|
+
const DOC_LINKS_SIZE = 2 * 1024 * 1024;
|
|
60
|
+
/** The homepage's links are the ones the report counts, and its body may be five times a docs page's. */
|
|
61
|
+
export const HOME_LINKS_SIZE = 8 * DOC_LINKS_SIZE;
|
|
62
|
+
export function readDocument(body, documentUrl, linksSize = DOC_LINKS_SIZE) {
|
|
63
|
+
const document = parseHtml(body);
|
|
64
|
+
const nodes = [...document.childNodes].reverse().map(node => ({ node, heading: false, form: false, anchor: false }));
|
|
65
|
+
const hrefs = new Set();
|
|
66
|
+
const alternates = new Set();
|
|
67
|
+
const headings = [];
|
|
68
|
+
const visible = [];
|
|
69
|
+
let passwordForm = false;
|
|
70
|
+
let hasForm = false;
|
|
71
|
+
const webhookSignals = new Set();
|
|
72
|
+
let base;
|
|
73
|
+
while (nodes.length) {
|
|
74
|
+
const { node, heading, form, anchor } = nodes.pop();
|
|
75
|
+
if (node.nodeName === "#text" && "value" in node) {
|
|
76
|
+
if (/webhook/i.test(node.value)) {
|
|
77
|
+
if (anchor)
|
|
78
|
+
webhookSignals.add("webhook link text");
|
|
79
|
+
if (heading)
|
|
80
|
+
webhookSignals.add("webhook heading");
|
|
81
|
+
}
|
|
82
|
+
if (heading)
|
|
83
|
+
headings.push(node.value);
|
|
84
|
+
else
|
|
85
|
+
visible.push(node.value);
|
|
86
|
+
}
|
|
87
|
+
if (!("tagName" in node))
|
|
88
|
+
continue;
|
|
89
|
+
const tag = node.tagName;
|
|
90
|
+
if (node.namespaceURI !== "http://www.w3.org/1999/xhtml" ||
|
|
91
|
+
["template", "script", "style", "noscript"].includes(tag) || node.attrs.some(a => a.name === "hidden"))
|
|
92
|
+
continue;
|
|
93
|
+
const attr = (name) => node.attrs.find(a => a.name === name)?.value;
|
|
94
|
+
const href = attr("href");
|
|
95
|
+
if (tag === "base" && href !== undefined && base === undefined)
|
|
96
|
+
base = documentBase(href, documentUrl);
|
|
97
|
+
if (tag === "a" && href) {
|
|
98
|
+
hrefs.add(href);
|
|
99
|
+
if (/webhook/i.test(href))
|
|
100
|
+
webhookSignals.add("webhook link");
|
|
101
|
+
}
|
|
102
|
+
if (tag === "link" && href && attr("rel")?.toLowerCase().split(/\s+/).includes("hub")) {
|
|
103
|
+
webhookSignals.add("websub hub");
|
|
104
|
+
}
|
|
105
|
+
if (tag === "link" && href !== undefined && attr("rel")?.toLowerCase().split(/\s+/).includes("alternate") &&
|
|
106
|
+
isMarkdownMediaType(attr("type")?.split(";")[0].trim().toLowerCase() ?? ""))
|
|
107
|
+
alternates.add(href);
|
|
108
|
+
if (tag === "form")
|
|
109
|
+
hasForm = true;
|
|
110
|
+
if (form && tag === "input" && attr("type")?.toLowerCase() === "password")
|
|
111
|
+
passwordForm = true;
|
|
112
|
+
for (let i = node.childNodes.length - 1; i >= 0; --i) {
|
|
113
|
+
nodes.push({ node: node.childNodes[i], heading: heading || /^(title|h[1-6])$/.test(tag), form: form || tag === "form", anchor: anchor || tag === "a" });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
let room = linksSize;
|
|
117
|
+
function resolve(raw) {
|
|
118
|
+
const urls = new Map();
|
|
119
|
+
for (const href of raw) {
|
|
120
|
+
// Under a base the scan cannot use (null), only an absolute link resolves.
|
|
121
|
+
const url = parseReference(href, base === null ? undefined : base ?? documentUrl);
|
|
122
|
+
if (!url || !["http:", "https:"].includes(url.protocol))
|
|
123
|
+
continue;
|
|
124
|
+
url.hash = "";
|
|
125
|
+
if (urls.has(url.href))
|
|
126
|
+
continue;
|
|
127
|
+
if ((room -= url.href.length + 300) < 0)
|
|
128
|
+
break;
|
|
129
|
+
urls.set(url.href, url);
|
|
130
|
+
}
|
|
131
|
+
return [...urls.values()];
|
|
132
|
+
}
|
|
133
|
+
const markdownAlternates = resolve(alternates);
|
|
134
|
+
const links = resolve(hrefs);
|
|
135
|
+
// linksCut: a link was left out, so a check that finds nothing among those kept has not measured a miss.
|
|
136
|
+
return { links, markdownAlternates, linksCut: room < 0, headings: headings.join(" "), text: visible.join(" "), webhookSignals, passwordForm, hasForm };
|
|
137
|
+
}
|
|
138
|
+
export function htmlLinks(body, documentUrl) {
|
|
139
|
+
return readDocument(body, documentUrl).links;
|
|
140
|
+
}
|
|
141
|
+
function cleanFetch(response) {
|
|
142
|
+
return [...response.redirects, response.url].every(raw => safeUrl(new URL(raw)));
|
|
143
|
+
}
|
|
144
|
+
export function completeRepresentation(response) {
|
|
145
|
+
return response.status >= 200 && response.status < 300 && response.status !== 206 &&
|
|
146
|
+
!response.bodyIncomplete && response.headers["content-range"] === undefined;
|
|
147
|
+
}
|
|
148
|
+
function isCompleteHtml(response) {
|
|
149
|
+
return completeRepresentation(response) && isHtmlMediaType(mediaType(response.headers));
|
|
150
|
+
}
|
|
151
|
+
const DOC_HEADING = /\b(?:documentation|docs|api reference|developer (?:guide|portal)|quick[ -]?start|getting started|integration guide)\b/i;
|
|
152
|
+
function hasDocContent(text) {
|
|
153
|
+
return /\b(?:API|endpoints?|SDK|install|curl|integration|authentication|OpenAPI)\b/i.test(text) ||
|
|
154
|
+
/\b(?:GET|POST|PUT|PATCH|DELETE|HEAD)\s+\//.test(text);
|
|
155
|
+
}
|
|
156
|
+
export function classifyDoc(doc, homeUrl, homeBody, ownHomepage = false) {
|
|
157
|
+
const response = doc.response;
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
const code = response.response?.status ?? response.error.statusCode;
|
|
160
|
+
return response.error.kind === "http_error" && (code === 404 || code === 410) ? "absent" : "incomplete";
|
|
161
|
+
}
|
|
162
|
+
if (!completeRepresentation(response) || !cleanFetch(response))
|
|
163
|
+
return "incomplete";
|
|
164
|
+
const url = new URL(response.url);
|
|
165
|
+
const home = homeUrl && URL.parse(homeUrl);
|
|
166
|
+
if (!ownHomepage && ((home && url.origin === home.origin && url.pathname === home.pathname) ||
|
|
167
|
+
(homeBody?.trim() && homeBody.trim() === response.body.trim())))
|
|
168
|
+
return "homepage-fallback";
|
|
169
|
+
const type = mediaType(response.headers);
|
|
170
|
+
if (isMarkdownMediaType(type) && !looksLikeHtml(response.body)) {
|
|
171
|
+
const lines = response.body.split(/\r?\n/);
|
|
172
|
+
const heading = lines.some(line => /^#{1,3}\s/.test(line) && DOC_HEADING.test(line));
|
|
173
|
+
const content = lines.filter(line => !/^\s*#/.test(line)).join(" ");
|
|
174
|
+
return heading && hasDocContent(content) ? "verified" : "unverified";
|
|
175
|
+
}
|
|
176
|
+
if (!isHtmlMediaType(type))
|
|
177
|
+
return "unverified";
|
|
178
|
+
const parsed = doc.document ??= readDocument(response.body, response.url);
|
|
179
|
+
if (parsed.passwordForm || (parsed.hasForm && /\/(?:sign[-_]?in|log[-_]?in)(?:\/|$)/i.test(url.pathname) &&
|
|
180
|
+
/\b(?:sign in|log in|login)\b/i.test(parsed.text)))
|
|
181
|
+
return "login-interstitial";
|
|
182
|
+
return DOC_HEADING.test(parsed.headings) && hasDocContent(parsed.text) ? "verified" : "unverified";
|
|
183
|
+
}
|
|
184
|
+
export function docFetchFor(link, docs) {
|
|
185
|
+
return docs.find(({ requestedUrl, response }) => requestedUrl === link.href ||
|
|
186
|
+
(response.ok && (response.url === link.href || response.redirects.includes(link.href))));
|
|
187
|
+
}
|
|
188
|
+
export function linkedDocWasFetched(sources, homepage) {
|
|
189
|
+
return isCompleteHtml(homepage) && cleanFetch(homepage) && sources.homeLinks.some(link => {
|
|
190
|
+
if (!isDeveloperDocsLink(link) || !safeUrl(link))
|
|
191
|
+
return false;
|
|
192
|
+
const doc = docFetchFor(link, sources.docs);
|
|
193
|
+
return !!doc && (doc.state ?? classifyDoc(doc, homepage.url, homepage.body)) === "verified";
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/** Entry paths from the homepage, homepage-linked docs, and a catalog used to verify this contract. */
|
|
197
|
+
export function contractRoutes(spec, verifiedUrls, homepage, sources) {
|
|
198
|
+
const documentUrl = spec?.data?.documentUrl;
|
|
199
|
+
if (spec?.status !== "pass" || typeof documentUrl !== "string" || spec.data?.documentHasQuery ||
|
|
200
|
+
!verifiedUrls.includes(documentUrl))
|
|
201
|
+
return { capabilities: [], complete: false, catalogVerified: false };
|
|
202
|
+
const routes = new Map();
|
|
203
|
+
const published = spec.data?.catalogRoute;
|
|
204
|
+
if (spec.data?.source === "api-catalog" && typeof published?.source === "string" &&
|
|
205
|
+
typeof published.target === "string" && verifiedUrls.includes(published.target)) {
|
|
206
|
+
routes.set(published.source + "\n" + published.target, { source: published.source, target: published.target });
|
|
207
|
+
}
|
|
208
|
+
const catalogVerified = routes.size > 0;
|
|
209
|
+
// A route left out of the stored inventory makes it incomplete, so milieu diff cannot read it as removed.
|
|
210
|
+
const stored = () => [...routes.values()].filter(route => route.source.length <= MAX_RECORDED_URL && route.target.length <= MAX_RECORDED_URL);
|
|
211
|
+
// A hit at a guessed path proves the contract exists, but supplies no published route.
|
|
212
|
+
const capability = { id: "openapi-description", label: "Discover the OpenAPI contract", routes: stored() };
|
|
213
|
+
if (!homepage || !sources || !cleanFetch(homepage) || !isCompleteHtml(homepage)) {
|
|
214
|
+
return { capabilities: [capability], complete: false, catalogVerified };
|
|
215
|
+
}
|
|
216
|
+
// A route could be among the links an inventory left out.
|
|
217
|
+
let complete = !sources.homeDocument?.linksCut;
|
|
218
|
+
const targets = new Set(verifiedUrls);
|
|
219
|
+
function inspectLinks(source, links) {
|
|
220
|
+
for (const link of links) {
|
|
221
|
+
const target = link.origin + link.pathname;
|
|
222
|
+
if (!targets.has(target))
|
|
223
|
+
continue;
|
|
224
|
+
if (!safeUrl(link)) {
|
|
225
|
+
complete = false;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
routes.set(source + "\n" + target, { source, target });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const homeSource = new URL(homepage.url);
|
|
232
|
+
inspectLinks(homeSource.origin + homeSource.pathname, sources.homeLinks);
|
|
233
|
+
const readDocs = new Set();
|
|
234
|
+
for (const link of sources.homeLinks) {
|
|
235
|
+
if (!isDeveloperDocsLink(link) || targets.has(link.origin + link.pathname))
|
|
236
|
+
continue;
|
|
237
|
+
const doc = docFetchFor(link, sources.docs);
|
|
238
|
+
if (!doc || !safeUrl(link)) {
|
|
239
|
+
complete = false;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (!doc.response.ok) {
|
|
243
|
+
const status = doc.response.response?.status ?? doc.response.error.statusCode;
|
|
244
|
+
const final = URL.parse(doc.response.error.url);
|
|
245
|
+
if (doc.response.error.kind !== "http_error" || !final || !safeUrl(final) ||
|
|
246
|
+
(status !== 404 && status !== 410))
|
|
247
|
+
complete = false;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (!cleanFetch(doc.response) || !isCompleteHtml(doc.response)) {
|
|
251
|
+
complete = false;
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const state = doc.state ?? classifyDoc(doc, homepage.url, homepage.body);
|
|
255
|
+
if (state !== "verified") {
|
|
256
|
+
if (state === "incomplete" || state === "unverified")
|
|
257
|
+
complete = false;
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (readDocs.has(doc.response.url))
|
|
261
|
+
continue;
|
|
262
|
+
readDocs.add(doc.response.url);
|
|
263
|
+
const source = new URL(doc.response.url);
|
|
264
|
+
const document = doc.document ?? readDocument(doc.response.body, source.href);
|
|
265
|
+
if (document.linksCut)
|
|
266
|
+
complete = false;
|
|
267
|
+
inspectLinks(source.origin + source.pathname, document.links);
|
|
268
|
+
}
|
|
269
|
+
capability.routes = stored();
|
|
270
|
+
return { capabilities: [capability], complete: complete && capability.routes.length === routes.size, catalogVerified };
|
|
271
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { Check,
|
|
1
|
+
import type { Check, HttpSuccess } from "../../core/types.js";
|
|
2
|
+
import { type DiscoverySource, type PublishedSources } from "./published-routes.js";
|
|
3
|
+
export { linkedRegistry } from "../../utils/package-registry.js";
|
|
4
|
+
interface PageInputs {
|
|
5
|
+
homepage?: HttpSuccess;
|
|
6
|
+
docs?: PublishedSources;
|
|
7
|
+
}
|
|
2
8
|
/**
|
|
3
9
|
* Detect SDK/package references across multiple content sources.
|
|
4
10
|
*
|
|
@@ -8,5 +14,4 @@ import type { Check, ContentSource } from "../../core/types.js";
|
|
|
8
14
|
*
|
|
9
15
|
* Pure function -- no HTTP calls.
|
|
10
16
|
*/
|
|
11
|
-
export declare function checkSdkReferences(sources:
|
|
12
|
-
//# sourceMappingURL=sdk-references.d.ts.map
|
|
17
|
+
export declare function checkSdkReferences(sources: DiscoverySource[], inputs?: PageInputs): Check;
|
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { linkedRegistry, REGISTRY_PATTERNS } from "../../utils/package-registry.js";
|
|
2
|
+
import { parseReference } from "../../utils/url.js";
|
|
3
|
+
import { isHtmlMediaType, mediaType } from "../../utils/http-types.js";
|
|
4
|
+
import { classifyDoc, htmlLinks, sourceDocument, isMarkdownSource, urlSample } from "./published-routes.js";
|
|
5
|
+
export { linkedRegistry } from "../../utils/package-registry.js";
|
|
6
|
+
function collectPackageLinks(sources, inputs) {
|
|
7
|
+
const links = new Set();
|
|
8
|
+
const pages = new Set();
|
|
9
|
+
const linkedRegistries = new Set();
|
|
10
|
+
let complete = Boolean(inputs?.homepage && inputs.docs);
|
|
11
|
+
function collect(urls) {
|
|
12
|
+
for (const url of urls) {
|
|
13
|
+
const registry = linkedRegistry(url);
|
|
14
|
+
if (!registry)
|
|
15
|
+
continue;
|
|
16
|
+
linkedRegistries.add(registry);
|
|
17
|
+
links.add(url.origin + url.pathname);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function inspect(response, knownLinks) {
|
|
21
|
+
const url = new URL(response.url);
|
|
22
|
+
if (url.username || url.password || url.search) {
|
|
23
|
+
complete = false;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const contentType = mediaType(response.headers);
|
|
27
|
+
if (!isHtmlMediaType(contentType)) {
|
|
28
|
+
complete = false;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (response.bodyIncomplete || response.status === 206 || response.headers["content-range"])
|
|
32
|
+
complete = false;
|
|
33
|
+
const source = url.origin + url.pathname;
|
|
34
|
+
if (!pages.has(source))
|
|
35
|
+
collect(knownLinks ?? htmlLinks(response.body, url.href));
|
|
36
|
+
pages.add(source);
|
|
37
|
+
}
|
|
38
|
+
if (inputs) {
|
|
39
|
+
if (inputs.homepage)
|
|
40
|
+
inspect(inputs.homepage, inputs.docs?.homeLinks);
|
|
41
|
+
// A registry link could be among the links an inventory left out.
|
|
42
|
+
if (inputs.docs?.homeDocument?.linksCut)
|
|
43
|
+
complete = false;
|
|
44
|
+
for (const doc of inputs.docs?.docs ?? []) {
|
|
45
|
+
const state = doc.state ?? classifyDoc(doc, inputs.homepage?.url, inputs.homepage?.body);
|
|
46
|
+
if (state === "verified" && doc.response.ok)
|
|
47
|
+
inspect(doc.response, doc.document?.links);
|
|
48
|
+
if (state === "incomplete" || state === "unverified" || (state === "verified" && doc.document?.linksCut))
|
|
49
|
+
complete = false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// Standalone callers may have only the page body. Absolute hrefs still have a destination.
|
|
54
|
+
for (const source of sources) {
|
|
55
|
+
if (!isMarkdownSource(source))
|
|
56
|
+
collect(sourceDocument(source).links);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const packageLinks = urlSample("packageLinks", [...links].sort());
|
|
60
|
+
// milieu diff reads an incomplete inventory as inconclusive, which a cut sample is.
|
|
61
|
+
const evidence = { ...packageLinks, packageLinkPages: [...pages].sort(),
|
|
62
|
+
packageLinksComplete: complete && packageLinks.packageLinksTruncated !== true };
|
|
63
|
+
return { evidence, linkedRegistries };
|
|
64
|
+
}
|
|
48
65
|
/**
|
|
49
66
|
* Detect SDK/package references across multiple content sources.
|
|
50
67
|
*
|
|
@@ -54,31 +71,40 @@ const REGISTRY_PATTERNS = [
|
|
|
54
71
|
*
|
|
55
72
|
* Pure function -- no HTTP calls.
|
|
56
73
|
*/
|
|
57
|
-
export function checkSdkReferences(sources) {
|
|
74
|
+
export function checkSdkReferences(sources, inputs) {
|
|
58
75
|
const id = "sdk_references";
|
|
59
76
|
const label = "SDK/Package References";
|
|
60
77
|
const detected = [];
|
|
61
78
|
const detectedSources = [];
|
|
62
|
-
|
|
79
|
+
const { evidence, linkedRegistries } = collectPackageLinks(sources, inputs);
|
|
80
|
+
for (const source of sources) {
|
|
81
|
+
const doc = isMarkdownSource(source) ? undefined : sourceDocument(source);
|
|
82
|
+
const visible = doc?.text ?? source.content;
|
|
83
|
+
const references = new Set(doc?.links.map(linkedRegistry));
|
|
84
|
+
for (const [raw] of visible.matchAll(/https?:\/\/[^\s<>"'`)\]]+/gi)) {
|
|
85
|
+
const url = parseReference(raw);
|
|
86
|
+
if (url)
|
|
87
|
+
references.add(linkedRegistry(url));
|
|
88
|
+
}
|
|
63
89
|
for (const registry of REGISTRY_PATTERNS) {
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
if (matched) {
|
|
70
|
-
detected.push(registry.name);
|
|
71
|
-
if (!detectedSources.includes(source))
|
|
72
|
-
detectedSources.push(source);
|
|
90
|
+
if (references.has(registry.name) || registry.installPattern?.test(visible)) {
|
|
91
|
+
if (!detected.includes(registry.name))
|
|
92
|
+
detected.push(registry.name);
|
|
93
|
+
if (!detectedSources.includes(source.source))
|
|
94
|
+
detectedSources.push(source.source);
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
97
|
}
|
|
98
|
+
for (const registry of linkedRegistries) {
|
|
99
|
+
if (!detected.includes(registry))
|
|
100
|
+
detected.push(registry);
|
|
101
|
+
}
|
|
76
102
|
if (detected.length === 0) {
|
|
77
103
|
return {
|
|
78
104
|
id,
|
|
79
105
|
label,
|
|
80
106
|
status: "fail",
|
|
81
|
-
detail: "No SDK/package references found",
|
|
107
|
+
detail: "No SDK/package references found", data: evidence,
|
|
82
108
|
};
|
|
83
109
|
}
|
|
84
110
|
const sourceAttr = detectedSources.length > 0 ? ` in ${detectedSources.join(", ")}` : "";
|
|
@@ -87,7 +113,6 @@ export function checkSdkReferences(sources) {
|
|
|
87
113
|
label,
|
|
88
114
|
status: "pass",
|
|
89
115
|
detail: `SDK references detected${sourceAttr}: ${detected.join(", ")}`,
|
|
90
|
-
data: { registries: detected, sources: detectedSources },
|
|
116
|
+
data: { registries: detected, sources: detectedSources, ...evidence },
|
|
91
117
|
};
|
|
92
118
|
}
|
|
93
|
-
//# sourceMappingURL=sdk-references.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Check
|
|
1
|
+
import type { Check } from "../../core/types.js";
|
|
2
|
+
import { type DiscoverySource } from "./published-routes.js";
|
|
2
3
|
/** Structured signals passed from upstream bridges */
|
|
3
4
|
export interface WebhookDetectionOptions {
|
|
4
5
|
/** HTTP response headers from the homepage (for WebSub rel="hub") */
|
|
@@ -8,25 +9,4 @@ export interface WebhookDetectionOptions {
|
|
|
8
9
|
/** OpenAPI 3.0+ `callbacks` detected in any spec operation */
|
|
9
10
|
openApiHasCallbacks?: boolean;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
* Detect webhook support signals using tiered detection:
|
|
13
|
-
*
|
|
14
|
-
* **Tier 1 (high confidence):** Structured specs
|
|
15
|
-
* - OpenAPI 3.1+ `webhooks` key
|
|
16
|
-
* - OpenAPI 3.0+ `callbacks` in operations
|
|
17
|
-
* - WebSub `rel="hub"` in HTML `<link>` or HTTP Link header
|
|
18
|
-
*
|
|
19
|
-
* **Tier 2 (medium confidence):** Standard-compliant behavioral signals
|
|
20
|
-
* - Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature)
|
|
21
|
-
* - Standard Webhooks secret prefix (whsec_)
|
|
22
|
-
* - CloudEvents webhook headers (WebHook-Request-Origin, WebHook-Allowed-Origin)
|
|
23
|
-
*
|
|
24
|
-
* **Tier 3 (low confidence):** Keyword heuristics
|
|
25
|
-
* - HTML links, headings, and link text containing "webhook"
|
|
26
|
-
* - Markdown links and headings containing "webhook"
|
|
27
|
-
* - URL paths containing "webhook" in JSON/JS structured data
|
|
28
|
-
*
|
|
29
|
-
* Pure function — no HTTP calls.
|
|
30
|
-
*/
|
|
31
|
-
export declare function checkWebhookSupport(sources: ContentSource[], options?: WebhookDetectionOptions): Check;
|
|
32
|
-
//# sourceMappingURL=webhook-support.d.ts.map
|
|
12
|
+
export declare function checkWebhookSupport(sources: DiscoverySource[], options?: WebhookDetectionOptions): Check;
|