@holmdigital/engine 3.3.13 → 4.0.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 +13 -0
- package/dist/{chunk-UWT7ZJVZ.mjs → chunk-6NKLALDW.mjs} +238 -77
- package/dist/{chunk-W2H46SI5.mjs → chunk-M6ATPKNB.mjs} +5 -2
- package/dist/cli/index.js +291 -92
- package/dist/cli/index.mjs +54 -12
- package/dist/cli/templates/de.json +2 -2
- package/dist/cli/templates/en-au.json +1 -0
- package/dist/index.d.mts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +239 -83
- package/dist/index.mjs +1 -1
- package/dist/{plain-report-7MFB3JGF.mjs → plain-report-4MJZKEGX.mjs} +1 -1
- package/dist/templates/de.json +2 -2
- package/dist/templates/en-au.json +1 -0
- package/package.json +3 -3
package/dist/cli/index.mjs
CHANGED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PseudoAutomationEngine,
|
|
4
4
|
RegulatoryScanner,
|
|
5
|
+
chromeLaunchArgs,
|
|
6
|
+
explainLaunchFailure,
|
|
5
7
|
generateBadgeMarkdown,
|
|
6
8
|
generateBadgeUrl,
|
|
7
9
|
generateStatement,
|
|
8
10
|
generateStatementContent,
|
|
9
11
|
getEngineVersion,
|
|
10
12
|
isBadgeWithheldByRobustness
|
|
11
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-6NKLALDW.mjs";
|
|
12
14
|
import {
|
|
13
15
|
groupReportsByRule,
|
|
14
16
|
impactBreakdown,
|
|
15
17
|
isPlainLanguageSupported,
|
|
16
18
|
klarsprakLegalLine,
|
|
17
19
|
languageDisplayName
|
|
18
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-M6ATPKNB.mjs";
|
|
19
21
|
import {
|
|
20
22
|
getCurrentLang,
|
|
21
23
|
setLanguage,
|
|
@@ -865,11 +867,16 @@ ${renderNoScriptSection(result)}
|
|
|
865
867
|
|
|
866
868
|
// src/reporting/pdf-generator.ts
|
|
867
869
|
import puppeteer from "puppeteer";
|
|
868
|
-
async function generatePDF(htmlContent, outputPath) {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
870
|
+
async function generatePDF(htmlContent, outputPath, policy = {}) {
|
|
871
|
+
let browser;
|
|
872
|
+
try {
|
|
873
|
+
browser = await puppeteer.launch({
|
|
874
|
+
headless: true,
|
|
875
|
+
args: chromeLaunchArgs(policy)
|
|
876
|
+
});
|
|
877
|
+
} catch (e) {
|
|
878
|
+
throw explainLaunchFailure(e, policy);
|
|
879
|
+
}
|
|
873
880
|
try {
|
|
874
881
|
const page = await browser.newPage();
|
|
875
882
|
await page.setContent(htmlContent, {
|
|
@@ -911,6 +918,25 @@ function parseHydrationWait(raw) {
|
|
|
911
918
|
}
|
|
912
919
|
return ms;
|
|
913
920
|
}
|
|
921
|
+
var REVIEW_METHODS = ["self-assessment", "external-review", "no-review"];
|
|
922
|
+
var isReviewMethod = (value) => REVIEW_METHODS.includes(value);
|
|
923
|
+
function parseReviewOptions(rawMethod, rawReviewer) {
|
|
924
|
+
if (rawMethod === void 0 || rawMethod === null) return {};
|
|
925
|
+
const method = String(rawMethod).trim();
|
|
926
|
+
if (!isReviewMethod(method)) {
|
|
927
|
+
throw new InvalidOptionError(
|
|
928
|
+
`Invalid --review-method value '${String(rawMethod)}'. Expected one of: ${REVIEW_METHODS.join(", ")}.`
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
if (method !== "external-review") return { reviewMethod: method };
|
|
932
|
+
const name = typeof rawReviewer === "string" ? rawReviewer.trim() : "";
|
|
933
|
+
if (name === "") {
|
|
934
|
+
throw new InvalidOptionError(
|
|
935
|
+
`--review-method external-review requires --reviewer <name> (or "reviewer" in the config file): the organisation that performed the review, e.g. --reviewer "Example Audit AB". Use self-assessment (the default) if the statement is based on your own testing, such as this scan.`
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
return { reviewMethod: method, reviewer: { name } };
|
|
939
|
+
}
|
|
914
940
|
|
|
915
941
|
// src/cli/url-guard.ts
|
|
916
942
|
var ALLOWED_SCAN_PROTOCOLS = ["http:", "https:"];
|
|
@@ -1050,13 +1076,18 @@ function renderNoScriptAdvisory(noScript) {
|
|
|
1050
1076
|
}
|
|
1051
1077
|
var program = new Command();
|
|
1052
1078
|
program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version(getEngineVersion());
|
|
1053
|
-
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--junit <path>", "Generate JUnit XML report").option("--pdf <path>", "Generate PDF report to path").option("--statement <path>", "Generate accessibility statement HTML to path").option("--format <type>", "Output format for statement (html, md)", "html").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold (critical, high, medium, low)").option("--api-key <key>", "API key for HolmDigital Cloud").option("--cloud-url <url>", "Cloud API URL").option("--invalid-https-cert", "Allow scanning on pages with invalid https certificate").option("--email <email>", "Contact email for accessibility statement").option("--phone <number>", "Contact phone number for accessibility statement").option("--org <name>", "Organization name for accessibility statement").option("--response-time <time>", "Expected response time for accessibility statement").option("--country <code>", "Country code for accessibility statement enforcement body").option("--sector <type>", "Sector type: public (WAD) or private (EAA)", "public").option("--publish-date <date>", "Publish date for the website (YYYY-MM-DD)").option("--light", "Light scan: fast score-only mode (skips HTML validation and detailed legal mapping)").option("--audience <mode>", "Output audience: developer (default) or plain", "developer").option("--plain", "Alias for --audience plain (klarspr\xE5ksl\xE4ge for non-technical recipients)").option("--noscript-check", "Robustness probe: measure how much content is available without JavaScript. Advisory only, never affects the compliance score.").option("--wait-for-hydration <ms>", `Milliseconds to wait after network idle so client-rendered SPAs finish hydrating before axe runs (default 2500, 0 disables, max ${MAX_HYDRATION_WAIT_MS})`).action(async (url, cliOptions) => {
|
|
1079
|
+
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)").option("--ci", "Run in CI/CD mode (exit code 1 on critical failures)").option("--generate-tests", "Generate Pseudo-Automation tests").option("--json", "Output as JSON").option("--junit <path>", "Generate JUnit XML report").option("--pdf <path>", "Generate PDF report to path").option("--statement <path>", "Generate accessibility statement HTML to path").option("--format <type>", "Output format for statement (html, md)", "html").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold (critical, high, medium, low)").option("--api-key <key>", "API key for HolmDigital Cloud").option("--cloud-url <url>", "Cloud API URL").option("--invalid-https-cert", "Allow scanning on pages with invalid https certificate").option("--allow-private-hosts", "Allow private and internal addresses such as localhost, 10.x and 192.168.x (blocked by default, for the page and every request it makes)").option("--no-sandbox", "Disable the Chrome sandbox. Only for pages you trust; needed when running as root or where user namespaces are restricted").option("--email <email>", "Contact email for accessibility statement").option("--phone <number>", "Contact phone number for accessibility statement").option("--org <name>", "Organization name for accessibility statement").option("--response-time <time>", "Expected response time for accessibility statement").option("--country <code>", "Country code for accessibility statement enforcement body").option("--sector <type>", "Sector type: public (WAD) or private (EAA)", "public").option("--publish-date <date>", "Publish date for the website (YYYY-MM-DD)").option("--review-method <method>", "How the statement assessment was made: self-assessment (default), external-review (requires --reviewer) or no-review").option("--reviewer <name>", "Organisation that performed the external review, named in the statement (used with --review-method external-review)").option("--light", "Light scan: fast score-only mode (skips HTML validation and detailed legal mapping)").option("--audience <mode>", "Output audience: developer (default) or plain", "developer").option("--plain", "Alias for --audience plain (klarspr\xE5ksl\xE4ge for non-technical recipients)").option("--noscript-check", "Robustness probe: measure how much content is available without JavaScript. Advisory only, never affects the compliance score.").option("--wait-for-hydration <ms>", `Milliseconds to wait after network idle so client-rendered SPAs finish hydrating before axe runs (default 2500, 0 disables, max ${MAX_HYDRATION_WAIT_MS})`).action(async (url, cliOptions) => {
|
|
1054
1080
|
const explorer = cosmiconfig("a11y");
|
|
1055
1081
|
const configResult = await explorer.search();
|
|
1056
1082
|
const fileConfig = configResult ? configResult.config : {};
|
|
1057
1083
|
let waitForHydrationMs;
|
|
1084
|
+
let review = {};
|
|
1058
1085
|
try {
|
|
1059
1086
|
waitForHydrationMs = cliOptions.waitForHydration !== void 0 ? parseHydrationWait(cliOptions.waitForHydration) : fileConfig.waitForHydrationMs !== void 0 ? parseHydrationWait(String(fileConfig.waitForHydrationMs)) : void 0;
|
|
1087
|
+
review = parseReviewOptions(
|
|
1088
|
+
cliOptions.reviewMethod || fileConfig.reviewMethod,
|
|
1089
|
+
cliOptions.reviewer || fileConfig.reviewer
|
|
1090
|
+
);
|
|
1060
1091
|
} catch (e) {
|
|
1061
1092
|
if (e instanceof InvalidOptionError) {
|
|
1062
1093
|
console.error(chalk.red(e.message));
|
|
@@ -1079,6 +1110,11 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1079
1110
|
apiKey: cliOptions.apiKey || fileConfig.apiKey,
|
|
1080
1111
|
cloudUrl: cliOptions.cloudUrl || fileConfig.cloudUrl || "https://cloud.holmdigital.se",
|
|
1081
1112
|
invalidHttpsCert: cliOptions.invalidHttpsCert ?? fileConfig.invalidHttpsCert ?? false,
|
|
1113
|
+
// Intern #53 steg 2: spärren och sandboxen är på som standard.
|
|
1114
|
+
allowPrivateHosts: cliOptions.allowPrivateHosts ?? fileConfig.allowPrivateHosts ?? false,
|
|
1115
|
+
// Commander sätter sandbox: true som standard för en --no-sandbox-flagga,
|
|
1116
|
+
// så CLI-värdet kan bara säga nej. Config-filen får också säga nej.
|
|
1117
|
+
sandbox: cliOptions.sandbox === false ? false : fileConfig.sandbox !== false,
|
|
1082
1118
|
// Metadata for accessibility statement
|
|
1083
1119
|
email: cliOptions.email || fileConfig.email,
|
|
1084
1120
|
phone: cliOptions.phone || fileConfig.phone,
|
|
@@ -1087,6 +1123,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1087
1123
|
country: cliOptions.country || fileConfig.country,
|
|
1088
1124
|
sector: cliOptions.sector || fileConfig.sector || "public",
|
|
1089
1125
|
publishDate: cliOptions.publishDate || fileConfig.publishDate,
|
|
1126
|
+
reviewMethod: review.reviewMethod,
|
|
1127
|
+
reviewer: review.reviewer,
|
|
1090
1128
|
light: cliOptions.light ?? fileConfig.light ?? false,
|
|
1091
1129
|
plain: cliOptions.plain ?? fileConfig.plain ?? false,
|
|
1092
1130
|
// Commander camelCase:ar --noscript-check till noscriptCheck.
|
|
@@ -1136,6 +1174,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1136
1174
|
silent: options.json || options.light,
|
|
1137
1175
|
severityThreshold: options.threshold,
|
|
1138
1176
|
invalidHttpsCert: options.invalidHttpsCert,
|
|
1177
|
+
allowPrivateHosts: options.allowPrivateHosts,
|
|
1178
|
+
sandbox: options.sandbox,
|
|
1139
1179
|
light: options.light,
|
|
1140
1180
|
noScriptCheck: options.noScriptCheck,
|
|
1141
1181
|
waitForHydrationMs: options.waitForHydrationMs
|
|
@@ -1146,7 +1186,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1146
1186
|
if (options.pdf) {
|
|
1147
1187
|
if (spinner) spinner.start(t("cli.generating_pdf"));
|
|
1148
1188
|
const html = options.audience === "plain" ? generateReportHTML(result, options.sector, "plain", plainFallbackFrom) : generateReportHTML(result, options.sector);
|
|
1149
|
-
await generatePDF(html, options.pdf);
|
|
1189
|
+
await generatePDF(html, options.pdf, { sandbox: options.sandbox });
|
|
1150
1190
|
if (spinner) spinner.succeed(t("cli.pdf_saved", { path: options.pdf }));
|
|
1151
1191
|
}
|
|
1152
1192
|
if (options.statement && result.complianceStatus === "INCONCLUSIVE") {
|
|
@@ -1161,7 +1201,9 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1161
1201
|
responseTime: options.responseTime,
|
|
1162
1202
|
country: options.country,
|
|
1163
1203
|
sector: options.sector,
|
|
1164
|
-
publishDate: options.publishDate
|
|
1204
|
+
publishDate: options.publishDate,
|
|
1205
|
+
reviewMethod: options.reviewMethod,
|
|
1206
|
+
reviewer: options.reviewer
|
|
1165
1207
|
};
|
|
1166
1208
|
if (options.statement.toLowerCase().endsWith(".pdf")) {
|
|
1167
1209
|
const htmlContent = await generateStatementContent(result, options.lang, "html", metadata);
|
|
@@ -1211,7 +1253,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1211
1253
|
console.log(JSON.stringify(result, null, 2));
|
|
1212
1254
|
} else if (result.complianceStatus === "INCONCLUSIVE") {
|
|
1213
1255
|
if (options.audience === "plain") {
|
|
1214
|
-
const { renderPlainReport } = await import("../plain-report-
|
|
1256
|
+
const { renderPlainReport } = await import("../plain-report-4MJZKEGX.mjs");
|
|
1215
1257
|
renderPlainReport(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom, options.sector);
|
|
1216
1258
|
} else {
|
|
1217
1259
|
console.log("");
|
|
@@ -1243,7 +1285,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1243
1285
|
console.log(chalk.gray(`
|
|
1244
1286
|
Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
|
|
1245
1287
|
} else if (options.audience === "plain") {
|
|
1246
|
-
const { renderPlainReport } = await import("../plain-report-
|
|
1288
|
+
const { renderPlainReport } = await import("../plain-report-4MJZKEGX.mjs");
|
|
1247
1289
|
renderPlainReport(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom, options.sector);
|
|
1248
1290
|
} else {
|
|
1249
1291
|
const violations = violationsOf(result.reports);
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
{
|
|
21
21
|
"id": "enforcement",
|
|
22
22
|
"title": "Durchsetzungsverfahren",
|
|
23
|
-
"content": "Die {<enforcement_body>} ist für die Überwachung der
|
|
23
|
+
"content": "Die {<enforcement_body>} ist für die Überwachung der Einhaltung von {<national_law>} zuständig. Wenn Sie auf unsere Benachrichtigungen oder Anfragen keine zufriedenstellende Antwort erhalten haben, können Sie sich an {<enforcement_body>} wenden.\n\nSie können auch eine Beschwerde bei {<enforcement_body>} einreichen, wenn Sie der Meinung sind, dass unsere Einschätzung einer unverhältnismäßigen Belastung überprüft werden sollte, wenn Sie Mängel in unserer Barrierefreiheitserklärung feststellen oder wenn Sie der Meinung sind, dass wir Ihren Antrag auf barrierefreie Bereitstellung von Inhalten nicht korrekt bearbeitet haben."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"id": "technical",
|
|
27
27
|
"title": "Technische Informationen zur Barrierefreiheit der Website",
|
|
28
|
-
"content": "{Diese Website ist vollständig mit
|
|
28
|
+
"content": "{Diese Website ist vollständig mit {<national_law>} vereinbar./Diese Website ist wegen der folgenden Unvereinbarkeiten teilweise mit {<national_law>} vereinbar./Diese Website ist nicht mit {<national_law>} vereinbar.}"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"id": "testing",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"id": "dta-policy",
|
|
32
|
+
"sectors": ["public"],
|
|
32
33
|
"title": "Australian Government digital policy",
|
|
33
34
|
"content": "Federal government agencies are subject to the Digital Transformation Agency (DTA) Digital Experience Policy, which has included the Digital Inclusion Standard since 1 January 2025 for new services and 1 July 2025 for existing services. The Digital Inclusion Standard requires Commonwealth agencies to meet WCAG 2.2 Level AA.\n\nThis statement was prepared in accordance with best practice guidance from the DTA and the Australian Human Rights Commission (AHRC)."
|
|
34
35
|
},
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EnrichedReport, ConvergenceRule, RegulatoryReport
|
|
2
|
-
|
|
1
|
+
import { EnrichedReport, ConvergenceRule, RegulatoryReport } from '@holmdigital/standards';
|
|
2
|
+
export { resolveNationalLawReference } from '@holmdigital/standards';
|
|
3
|
+
import { Page, Browser } from 'puppeteer';
|
|
3
4
|
|
|
4
5
|
interface ValidationResult {
|
|
5
6
|
valid: boolean;
|
|
@@ -35,6 +36,7 @@ interface NoScriptProbeOptions {
|
|
|
35
36
|
height: number;
|
|
36
37
|
};
|
|
37
38
|
timeout?: number;
|
|
39
|
+
preparePage?: (page: Page) => Promise<void>;
|
|
38
40
|
}
|
|
39
41
|
interface NoScriptProbeMeasurement {
|
|
40
42
|
textLength: number;
|
|
@@ -65,6 +67,8 @@ interface ScannerOptions {
|
|
|
65
67
|
light?: boolean;
|
|
66
68
|
waitForHydrationMs?: number;
|
|
67
69
|
noScriptCheck?: boolean;
|
|
70
|
+
allowPrivateHosts?: boolean;
|
|
71
|
+
sandbox?: boolean;
|
|
68
72
|
}
|
|
69
73
|
interface ScanMetadata {
|
|
70
74
|
engineVersion: string;
|
|
@@ -74,6 +78,7 @@ interface ScanMetadata {
|
|
|
74
78
|
pageTitle?: string;
|
|
75
79
|
pageLanguage?: string;
|
|
76
80
|
interstitialSuspected?: boolean;
|
|
81
|
+
blockedPrivateRequests?: number;
|
|
77
82
|
}
|
|
78
83
|
interface ScanResult {
|
|
79
84
|
url: string;
|
|
@@ -101,6 +106,7 @@ interface ScanResult {
|
|
|
101
106
|
}
|
|
102
107
|
declare class RegulatoryScanner {
|
|
103
108
|
private browser;
|
|
109
|
+
private blockedRequests;
|
|
104
110
|
private options;
|
|
105
111
|
private htmlValidator;
|
|
106
112
|
constructor(options: ScannerOptions);
|
|
@@ -254,9 +260,14 @@ interface StatementMetadata {
|
|
|
254
260
|
country?: string;
|
|
255
261
|
sector?: 'public' | 'private';
|
|
256
262
|
publishDate?: string | Date;
|
|
263
|
+
reviewMethod?: 'self-assessment' | 'external-review' | 'no-review';
|
|
264
|
+
reviewer?: {
|
|
265
|
+
name: string;
|
|
266
|
+
url?: string;
|
|
267
|
+
};
|
|
257
268
|
}
|
|
258
|
-
|
|
269
|
+
|
|
259
270
|
declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
|
|
260
271
|
declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
|
|
261
272
|
|
|
262
|
-
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript,
|
|
273
|
+
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EnrichedReport, ConvergenceRule, RegulatoryReport
|
|
2
|
-
|
|
1
|
+
import { EnrichedReport, ConvergenceRule, RegulatoryReport } from '@holmdigital/standards';
|
|
2
|
+
export { resolveNationalLawReference } from '@holmdigital/standards';
|
|
3
|
+
import { Page, Browser } from 'puppeteer';
|
|
3
4
|
|
|
4
5
|
interface ValidationResult {
|
|
5
6
|
valid: boolean;
|
|
@@ -35,6 +36,7 @@ interface NoScriptProbeOptions {
|
|
|
35
36
|
height: number;
|
|
36
37
|
};
|
|
37
38
|
timeout?: number;
|
|
39
|
+
preparePage?: (page: Page) => Promise<void>;
|
|
38
40
|
}
|
|
39
41
|
interface NoScriptProbeMeasurement {
|
|
40
42
|
textLength: number;
|
|
@@ -65,6 +67,8 @@ interface ScannerOptions {
|
|
|
65
67
|
light?: boolean;
|
|
66
68
|
waitForHydrationMs?: number;
|
|
67
69
|
noScriptCheck?: boolean;
|
|
70
|
+
allowPrivateHosts?: boolean;
|
|
71
|
+
sandbox?: boolean;
|
|
68
72
|
}
|
|
69
73
|
interface ScanMetadata {
|
|
70
74
|
engineVersion: string;
|
|
@@ -74,6 +78,7 @@ interface ScanMetadata {
|
|
|
74
78
|
pageTitle?: string;
|
|
75
79
|
pageLanguage?: string;
|
|
76
80
|
interstitialSuspected?: boolean;
|
|
81
|
+
blockedPrivateRequests?: number;
|
|
77
82
|
}
|
|
78
83
|
interface ScanResult {
|
|
79
84
|
url: string;
|
|
@@ -101,6 +106,7 @@ interface ScanResult {
|
|
|
101
106
|
}
|
|
102
107
|
declare class RegulatoryScanner {
|
|
103
108
|
private browser;
|
|
109
|
+
private blockedRequests;
|
|
104
110
|
private options;
|
|
105
111
|
private htmlValidator;
|
|
106
112
|
constructor(options: ScannerOptions);
|
|
@@ -254,9 +260,14 @@ interface StatementMetadata {
|
|
|
254
260
|
country?: string;
|
|
255
261
|
sector?: 'public' | 'private';
|
|
256
262
|
publishDate?: string | Date;
|
|
263
|
+
reviewMethod?: 'self-assessment' | 'external-review' | 'no-review';
|
|
264
|
+
reviewer?: {
|
|
265
|
+
name: string;
|
|
266
|
+
url?: string;
|
|
267
|
+
};
|
|
257
268
|
}
|
|
258
|
-
|
|
269
|
+
|
|
259
270
|
declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
|
|
260
271
|
declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
|
|
261
272
|
|
|
262
|
-
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript,
|
|
273
|
+
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|