@holmdigital/engine 1.4.7 → 1.4.9
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 +4 -1
- package/dist/{chunk-WUJZMECK.mjs → chunk-BKI2FFUX.mjs} +6 -0
- package/dist/{chunk-2JUTUKQY.mjs → chunk-WZSPSYDS.mjs} +5 -3
- package/dist/cli/index.js +26 -6
- package/dist/cli/index.mjs +19 -7
- package/dist/{i18n-IVBZL57L.mjs → i18n-M6ATDHUS.mjs} +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It handles the heavy lifting of:
|
|
|
24
24
|
- **Configurable Severity Threshold**: Fail CI only on critical/high issues (configurable).
|
|
25
25
|
- **Rich Metadata**: Includes scan duration, page title, language, and version info.
|
|
26
26
|
- **Pseudo-Automation**: Automatically generates Playwright/Puppeteer test scripts for manual verification steps.
|
|
27
|
-
- **PDF Reporting**: Generates beautiful, compliant PDF reports
|
|
27
|
+
- **PDF Reporting**: Generates beautiful, compliant PDF reports with severity-sorted violations, HTML error counts, and `@HolmDigital/engine` branding.
|
|
28
28
|
- **TypeScript**: Written in TypeScript with full type definitions included.
|
|
29
29
|
|
|
30
30
|
## Installation
|
|
@@ -49,9 +49,12 @@ npx hd-a11y-scan <url> [options]
|
|
|
49
49
|
| `--pdf <path>` | Generate a PDF report |
|
|
50
50
|
| `--viewport <size>` | Set viewport size (`mobile`, `tablet`, `desktop`, or custom `1024x768`) |
|
|
51
51
|
| `--generate-tests` | Generate Pseudo-Automation tests |
|
|
52
|
+
| `--invalid-https-cert` | Allow scanning sites with invalid/self-signed HTTPS certificates ⚠️ |
|
|
52
53
|
| `--api-key <key>` | API Key for HolmDigital Cloud |
|
|
53
54
|
| `--cloud-url <url>` | Custom URL for HolmDigital Cloud API |
|
|
54
55
|
|
|
56
|
+
> **⚠️ Security Note:** The `--invalid-https-cert` flag should only be used in trusted environments (local dev, staging). It disables certificate validation and is not recommended for production. *(Contributed by [@FerdiStro](https://github.com/FerdiStro))*
|
|
57
|
+
|
|
55
58
|
**Example:**
|
|
56
59
|
```bash
|
|
57
60
|
# Fail only on critical issues in CI
|
|
@@ -34,6 +34,7 @@ var en_default = {
|
|
|
34
34
|
critical_issues: "Critical Issues",
|
|
35
35
|
high_issues: "High Issues",
|
|
36
36
|
total_issues: "Total Issues",
|
|
37
|
+
html_errors: "HTML Errors",
|
|
37
38
|
detailed_violations: "Detailed Violations",
|
|
38
39
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
39
40
|
use: "Use",
|
|
@@ -70,6 +71,7 @@ var sv_default = {
|
|
|
70
71
|
critical_issues: "Kritiska fel",
|
|
71
72
|
high_issues: "Allvarliga fel",
|
|
72
73
|
total_issues: "Antal brister",
|
|
74
|
+
html_errors: "HTML-fel",
|
|
73
75
|
detailed_violations: "Detaljerade brister",
|
|
74
76
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
75
77
|
use: "Anv\xE4nd",
|
|
@@ -106,6 +108,7 @@ var de_default = {
|
|
|
106
108
|
critical_issues: "Kritische Probleme",
|
|
107
109
|
high_issues: "Hohe Probleme",
|
|
108
110
|
total_issues: "Gesamtprobleme",
|
|
111
|
+
html_errors: "HTML-Fehler",
|
|
109
112
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
110
113
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
111
114
|
use: "Verwenden",
|
|
@@ -142,6 +145,7 @@ var fr_default = {
|
|
|
142
145
|
critical_issues: "Probl\xE8mes Critiques",
|
|
143
146
|
high_issues: "Probl\xE8mes Importants",
|
|
144
147
|
total_issues: "Total des Probl\xE8mes",
|
|
148
|
+
html_errors: "Erreurs HTML",
|
|
145
149
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
146
150
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
147
151
|
use: "Utiliser",
|
|
@@ -178,6 +182,7 @@ var es_default = {
|
|
|
178
182
|
critical_issues: "Problemas Cr\xEDticos",
|
|
179
183
|
high_issues: "Problemas Altos",
|
|
180
184
|
total_issues: "Problemas Totales",
|
|
185
|
+
html_errors: "Errores HTML",
|
|
181
186
|
detailed_violations: "Violaciones Detalladas",
|
|
182
187
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
183
188
|
use: "Usar",
|
|
@@ -214,6 +219,7 @@ var nl_default = {
|
|
|
214
219
|
critical_issues: "Kritieke problemen",
|
|
215
220
|
high_issues: "Hoge prioriteit problemen",
|
|
216
221
|
total_issues: "Totaal aantal problemen",
|
|
222
|
+
html_errors: "HTML-fouten",
|
|
217
223
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
218
224
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
219
225
|
use: "Gebruik",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__require
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BKI2FFUX.mjs";
|
|
4
4
|
|
|
5
5
|
// src/core/virtual-dom.ts
|
|
6
6
|
var VirtualDOMBuilder = class {
|
|
@@ -144,6 +144,7 @@ var RegulatoryScanner = class {
|
|
|
144
144
|
standard: "dos-lagen",
|
|
145
145
|
// Default till striktaste
|
|
146
146
|
silent: false,
|
|
147
|
+
invalidHttpsCert: false,
|
|
147
148
|
...options
|
|
148
149
|
};
|
|
149
150
|
this.htmlValidator = new HtmlValidator();
|
|
@@ -236,8 +237,9 @@ var RegulatoryScanner = class {
|
|
|
236
237
|
args: [
|
|
237
238
|
"--no-sandbox",
|
|
238
239
|
"--disable-setuid-sandbox",
|
|
239
|
-
"--disable-blink-features=AutomationControlled"
|
|
240
|
+
"--disable-blink-features=AutomationControlled",
|
|
240
241
|
// Gömmer att det är en robot
|
|
242
|
+
...this.options.invalidHttpsCert ? ["--ignore-certificate-errors", "--allow-insecure-localhost"] : []
|
|
241
243
|
]
|
|
242
244
|
});
|
|
243
245
|
}
|
|
@@ -254,7 +256,7 @@ var RegulatoryScanner = class {
|
|
|
254
256
|
async enrichResults(axeResults) {
|
|
255
257
|
const reports = [];
|
|
256
258
|
const { searchRulesByTags, generateRegulatoryReport } = await import("@holmdigital/standards");
|
|
257
|
-
const { getCurrentLang } = await import("./i18n-
|
|
259
|
+
const { getCurrentLang } = await import("./i18n-M6ATDHUS.mjs");
|
|
258
260
|
const lang = getCurrentLang();
|
|
259
261
|
for (const violation of axeResults.violations) {
|
|
260
262
|
let report = generateRegulatoryReport(violation.id, lang);
|
package/dist/cli/index.js
CHANGED
|
@@ -62,6 +62,7 @@ var init_en = __esm({
|
|
|
62
62
|
critical_issues: "Critical Issues",
|
|
63
63
|
high_issues: "High Issues",
|
|
64
64
|
total_issues: "Total Issues",
|
|
65
|
+
html_errors: "HTML Errors",
|
|
65
66
|
detailed_violations: "Detailed Violations",
|
|
66
67
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
67
68
|
use: "Use",
|
|
@@ -103,6 +104,7 @@ var init_sv = __esm({
|
|
|
103
104
|
critical_issues: "Kritiska fel",
|
|
104
105
|
high_issues: "Allvarliga fel",
|
|
105
106
|
total_issues: "Antal brister",
|
|
107
|
+
html_errors: "HTML-fel",
|
|
106
108
|
detailed_violations: "Detaljerade brister",
|
|
107
109
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
108
110
|
use: "Anv\xE4nd",
|
|
@@ -144,6 +146,7 @@ var init_de = __esm({
|
|
|
144
146
|
critical_issues: "Kritische Probleme",
|
|
145
147
|
high_issues: "Hohe Probleme",
|
|
146
148
|
total_issues: "Gesamtprobleme",
|
|
149
|
+
html_errors: "HTML-Fehler",
|
|
147
150
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
148
151
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
149
152
|
use: "Verwenden",
|
|
@@ -185,6 +188,7 @@ var init_fr = __esm({
|
|
|
185
188
|
critical_issues: "Probl\xE8mes Critiques",
|
|
186
189
|
high_issues: "Probl\xE8mes Importants",
|
|
187
190
|
total_issues: "Total des Probl\xE8mes",
|
|
191
|
+
html_errors: "Erreurs HTML",
|
|
188
192
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
189
193
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
190
194
|
use: "Utiliser",
|
|
@@ -226,6 +230,7 @@ var init_es = __esm({
|
|
|
226
230
|
critical_issues: "Problemas Cr\xEDticos",
|
|
227
231
|
high_issues: "Problemas Altos",
|
|
228
232
|
total_issues: "Problemas Totales",
|
|
233
|
+
html_errors: "Errores HTML",
|
|
229
234
|
detailed_violations: "Violaciones Detalladas",
|
|
230
235
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
231
236
|
use: "Usar",
|
|
@@ -267,6 +272,7 @@ var init_nl = __esm({
|
|
|
267
272
|
critical_issues: "Kritieke problemen",
|
|
268
273
|
high_issues: "Hoge prioriteit problemen",
|
|
269
274
|
total_issues: "Totaal aantal problemen",
|
|
275
|
+
html_errors: "HTML-fouten",
|
|
270
276
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
271
277
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
272
278
|
use: "Gebruik",
|
|
@@ -493,6 +499,7 @@ var RegulatoryScanner = class {
|
|
|
493
499
|
standard: "dos-lagen",
|
|
494
500
|
// Default till striktaste
|
|
495
501
|
silent: false,
|
|
502
|
+
invalidHttpsCert: false,
|
|
496
503
|
...options
|
|
497
504
|
};
|
|
498
505
|
this.htmlValidator = new HtmlValidator();
|
|
@@ -585,8 +592,9 @@ var RegulatoryScanner = class {
|
|
|
585
592
|
args: [
|
|
586
593
|
"--no-sandbox",
|
|
587
594
|
"--disable-setuid-sandbox",
|
|
588
|
-
"--disable-blink-features=AutomationControlled"
|
|
595
|
+
"--disable-blink-features=AutomationControlled",
|
|
589
596
|
// Gömmer att det är en robot
|
|
597
|
+
...this.options.invalidHttpsCert ? ["--ignore-certificate-errors", "--allow-insecure-localhost"] : []
|
|
590
598
|
]
|
|
591
599
|
});
|
|
592
600
|
}
|
|
@@ -792,6 +800,7 @@ init_i18n();
|
|
|
792
800
|
function generateReportHTML(result) {
|
|
793
801
|
const criticalCount = result.stats.critical;
|
|
794
802
|
const highCount = result.stats.high;
|
|
803
|
+
const htmlErrorsCount = result.htmlValidation?.errors?.length ?? 0;
|
|
795
804
|
const scoreColor = result.score > 90 ? "#16a34a" : result.score > 70 ? "#eab308" : "#dc2626";
|
|
796
805
|
const formatDate = (dateString) => {
|
|
797
806
|
return new Date(dateString).toLocaleDateString(getCurrentLang() === "sv" ? "sv-SE" : "en-US", {
|
|
@@ -845,7 +854,7 @@ function generateReportHTML(result) {
|
|
|
845
854
|
}
|
|
846
855
|
.summary-grid {
|
|
847
856
|
display: grid;
|
|
848
|
-
grid-template-columns: repeat(
|
|
857
|
+
grid-template-columns: repeat(5, 1fr);
|
|
849
858
|
gap: 1.5rem;
|
|
850
859
|
margin-bottom: 3rem;
|
|
851
860
|
}
|
|
@@ -864,6 +873,7 @@ function generateReportHTML(result) {
|
|
|
864
873
|
color: #64748b;
|
|
865
874
|
margin-bottom: 0.5rem;
|
|
866
875
|
font-weight: 500;
|
|
876
|
+
min-height: 2.5rem;
|
|
867
877
|
}
|
|
868
878
|
.metric-value {
|
|
869
879
|
font-size: 2rem;
|
|
@@ -944,7 +954,7 @@ function generateReportHTML(result) {
|
|
|
944
954
|
</head>
|
|
945
955
|
<body>
|
|
946
956
|
<div class="header">
|
|
947
|
-
<div class="brand"
|
|
957
|
+
<div class="brand">@HolmDigital/<span>engine</span></div>
|
|
948
958
|
<div class="meta">
|
|
949
959
|
<div>${t("report.scan_target", { url: result.url })}</div>
|
|
950
960
|
<div>${t("report.generated", { date: formatDate(result.timestamp) })}</div>
|
|
@@ -968,11 +978,20 @@ function generateReportHTML(result) {
|
|
|
968
978
|
<div class="metric-label">${t("report.total_issues")}</div>
|
|
969
979
|
<div class="metric-value">${result.stats.total}</div>
|
|
970
980
|
</div>
|
|
981
|
+
<div class="card">
|
|
982
|
+
<div class="metric-label">${t("report.html_errors")}</div>
|
|
983
|
+
<div class="metric-value" style="color: ${htmlErrorsCount > 0 ? "#9333ea" : "#16a34a"};">${htmlErrorsCount}</div>
|
|
984
|
+
</div>
|
|
971
985
|
</div>
|
|
972
986
|
|
|
973
987
|
<div class="section-title">${t("report.detailed_violations")}</div>
|
|
974
988
|
|
|
975
|
-
${result.reports.
|
|
989
|
+
${[...result.reports].sort((a, b) => {
|
|
990
|
+
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
991
|
+
const aRisk = a.holmdigitalInsight.diggRisk.toLowerCase();
|
|
992
|
+
const bRisk = b.holmdigitalInsight.diggRisk.toLowerCase();
|
|
993
|
+
return (severityOrder[aRisk] ?? 4) - (severityOrder[bRisk] ?? 4);
|
|
994
|
+
}).map((report) => {
|
|
976
995
|
const riskClass = `badge-${report.holmdigitalInsight.diggRisk}`;
|
|
977
996
|
return `
|
|
978
997
|
<div class="violation-card">
|
|
@@ -1128,7 +1147,7 @@ function isValidUrl(urlString) {
|
|
|
1128
1147
|
}
|
|
1129
1148
|
var program = new import_commander.Command();
|
|
1130
1149
|
program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
|
|
1131
|
-
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").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("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold for compliance (critical, high, medium, low)", "high").option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
1150
|
+
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").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("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold for compliance (critical, high, medium, low)", "high").option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").option("--invalid-https-cert", "Allow scanning on pages with invalid https certificate").action(async (url, options) => {
|
|
1132
1151
|
setLanguage(options.lang);
|
|
1133
1152
|
if (!isValidUrl(url)) {
|
|
1134
1153
|
console.error(import_chalk.default.red(`Error: Invalid URL format '${url}'`));
|
|
@@ -1158,7 +1177,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
1158
1177
|
viewport,
|
|
1159
1178
|
silent: options.json,
|
|
1160
1179
|
// Suppress debug output for JSON mode
|
|
1161
|
-
severityThreshold: options.threshold
|
|
1180
|
+
severityThreshold: options.threshold,
|
|
1181
|
+
invalidHttpsCert: options.invalidHttpsCert
|
|
1162
1182
|
});
|
|
1163
1183
|
if (spinner) spinner.text = t("cli.analyzing");
|
|
1164
1184
|
const result = await scanner.scan();
|
package/dist/cli/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PseudoAutomationEngine,
|
|
4
4
|
RegulatoryScanner
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-WZSPSYDS.mjs";
|
|
6
6
|
import {
|
|
7
7
|
getCurrentLang,
|
|
8
8
|
setLanguage,
|
|
9
9
|
t
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-BKI2FFUX.mjs";
|
|
11
11
|
|
|
12
12
|
// src/cli/index.ts
|
|
13
13
|
import { Command } from "commander";
|
|
@@ -18,6 +18,7 @@ import ora from "ora";
|
|
|
18
18
|
function generateReportHTML(result) {
|
|
19
19
|
const criticalCount = result.stats.critical;
|
|
20
20
|
const highCount = result.stats.high;
|
|
21
|
+
const htmlErrorsCount = result.htmlValidation?.errors?.length ?? 0;
|
|
21
22
|
const scoreColor = result.score > 90 ? "#16a34a" : result.score > 70 ? "#eab308" : "#dc2626";
|
|
22
23
|
const formatDate = (dateString) => {
|
|
23
24
|
return new Date(dateString).toLocaleDateString(getCurrentLang() === "sv" ? "sv-SE" : "en-US", {
|
|
@@ -71,7 +72,7 @@ function generateReportHTML(result) {
|
|
|
71
72
|
}
|
|
72
73
|
.summary-grid {
|
|
73
74
|
display: grid;
|
|
74
|
-
grid-template-columns: repeat(
|
|
75
|
+
grid-template-columns: repeat(5, 1fr);
|
|
75
76
|
gap: 1.5rem;
|
|
76
77
|
margin-bottom: 3rem;
|
|
77
78
|
}
|
|
@@ -90,6 +91,7 @@ function generateReportHTML(result) {
|
|
|
90
91
|
color: #64748b;
|
|
91
92
|
margin-bottom: 0.5rem;
|
|
92
93
|
font-weight: 500;
|
|
94
|
+
min-height: 2.5rem;
|
|
93
95
|
}
|
|
94
96
|
.metric-value {
|
|
95
97
|
font-size: 2rem;
|
|
@@ -170,7 +172,7 @@ function generateReportHTML(result) {
|
|
|
170
172
|
</head>
|
|
171
173
|
<body>
|
|
172
174
|
<div class="header">
|
|
173
|
-
<div class="brand"
|
|
175
|
+
<div class="brand">@HolmDigital/<span>engine</span></div>
|
|
174
176
|
<div class="meta">
|
|
175
177
|
<div>${t("report.scan_target", { url: result.url })}</div>
|
|
176
178
|
<div>${t("report.generated", { date: formatDate(result.timestamp) })}</div>
|
|
@@ -194,11 +196,20 @@ function generateReportHTML(result) {
|
|
|
194
196
|
<div class="metric-label">${t("report.total_issues")}</div>
|
|
195
197
|
<div class="metric-value">${result.stats.total}</div>
|
|
196
198
|
</div>
|
|
199
|
+
<div class="card">
|
|
200
|
+
<div class="metric-label">${t("report.html_errors")}</div>
|
|
201
|
+
<div class="metric-value" style="color: ${htmlErrorsCount > 0 ? "#9333ea" : "#16a34a"};">${htmlErrorsCount}</div>
|
|
202
|
+
</div>
|
|
197
203
|
</div>
|
|
198
204
|
|
|
199
205
|
<div class="section-title">${t("report.detailed_violations")}</div>
|
|
200
206
|
|
|
201
|
-
${result.reports.
|
|
207
|
+
${[...result.reports].sort((a, b) => {
|
|
208
|
+
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
209
|
+
const aRisk = a.holmdigitalInsight.diggRisk.toLowerCase();
|
|
210
|
+
const bRisk = b.holmdigitalInsight.diggRisk.toLowerCase();
|
|
211
|
+
return (severityOrder[aRisk] ?? 4) - (severityOrder[bRisk] ?? 4);
|
|
212
|
+
}).map((report) => {
|
|
202
213
|
const riskClass = `badge-${report.holmdigitalInsight.diggRisk}`;
|
|
203
214
|
return `
|
|
204
215
|
<div class="violation-card">
|
|
@@ -351,7 +362,7 @@ function isValidUrl(urlString) {
|
|
|
351
362
|
}
|
|
352
363
|
var program = new Command();
|
|
353
364
|
program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
|
|
354
|
-
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").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("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold for compliance (critical, high, medium, low)", "high").option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").action(async (url, options) => {
|
|
365
|
+
program.argument("<url>", "URL to scan").option("--lang <code>", "Language code (en, sv)", "en").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("--pdf <path>", "Generate PDF report to path").option("--viewport <size>", 'Set viewport (e.g. "mobile", "desktop", "1024x768")').option("--threshold <level>", "Severity threshold for compliance (critical, high, medium, low)", "high").option("--api-key <key>", "API key for HolmDigital Cloud authentication").option("--cloud-url <url>", "Cloud API URL", "https://cloud.holmdigital.se").option("--invalid-https-cert", "Allow scanning on pages with invalid https certificate").action(async (url, options) => {
|
|
355
366
|
setLanguage(options.lang);
|
|
356
367
|
if (!isValidUrl(url)) {
|
|
357
368
|
console.error(chalk.red(`Error: Invalid URL format '${url}'`));
|
|
@@ -381,7 +392,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
381
392
|
viewport,
|
|
382
393
|
silent: options.json,
|
|
383
394
|
// Suppress debug output for JSON mode
|
|
384
|
-
severityThreshold: options.threshold
|
|
395
|
+
severityThreshold: options.threshold,
|
|
396
|
+
invalidHttpsCert: options.invalidHttpsCert
|
|
385
397
|
});
|
|
386
398
|
if (spinner) spinner.text = t("cli.analyzing");
|
|
387
399
|
const result = await scanner.scan();
|
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ interface ScannerOptions {
|
|
|
23
23
|
};
|
|
24
24
|
silent?: boolean;
|
|
25
25
|
severityThreshold?: 'critical' | 'high' | 'medium' | 'low';
|
|
26
|
+
invalidHttpsCert?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface ScanMetadata {
|
|
28
29
|
engineVersion: string;
|
|
@@ -123,6 +124,7 @@ var report = {
|
|
|
123
124
|
critical_issues: "Critical Issues",
|
|
124
125
|
high_issues: "High Issues",
|
|
125
126
|
total_issues: "Total Issues",
|
|
127
|
+
html_errors: "HTML Errors",
|
|
126
128
|
detailed_violations: "Detailed Violations",
|
|
127
129
|
prescriptive_fix: "💡 Prescriptive Fix",
|
|
128
130
|
use: "Use",
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface ScannerOptions {
|
|
|
23
23
|
};
|
|
24
24
|
silent?: boolean;
|
|
25
25
|
severityThreshold?: 'critical' | 'high' | 'medium' | 'low';
|
|
26
|
+
invalidHttpsCert?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface ScanMetadata {
|
|
28
29
|
engineVersion: string;
|
|
@@ -123,6 +124,7 @@ var report = {
|
|
|
123
124
|
critical_issues: "Critical Issues",
|
|
124
125
|
high_issues: "High Issues",
|
|
125
126
|
total_issues: "Total Issues",
|
|
127
|
+
html_errors: "HTML Errors",
|
|
126
128
|
detailed_violations: "Detailed Violations",
|
|
127
129
|
prescriptive_fix: "💡 Prescriptive Fix",
|
|
128
130
|
use: "Use",
|
package/dist/index.js
CHANGED
|
@@ -62,6 +62,7 @@ var init_en = __esm({
|
|
|
62
62
|
critical_issues: "Critical Issues",
|
|
63
63
|
high_issues: "High Issues",
|
|
64
64
|
total_issues: "Total Issues",
|
|
65
|
+
html_errors: "HTML Errors",
|
|
65
66
|
detailed_violations: "Detailed Violations",
|
|
66
67
|
prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
|
|
67
68
|
use: "Use",
|
|
@@ -103,6 +104,7 @@ var init_sv = __esm({
|
|
|
103
104
|
critical_issues: "Kritiska fel",
|
|
104
105
|
high_issues: "Allvarliga fel",
|
|
105
106
|
total_issues: "Antal brister",
|
|
107
|
+
html_errors: "HTML-fel",
|
|
106
108
|
detailed_violations: "Detaljerade brister",
|
|
107
109
|
prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
|
|
108
110
|
use: "Anv\xE4nd",
|
|
@@ -144,6 +146,7 @@ var init_de = __esm({
|
|
|
144
146
|
critical_issues: "Kritische Probleme",
|
|
145
147
|
high_issues: "Hohe Probleme",
|
|
146
148
|
total_issues: "Gesamtprobleme",
|
|
149
|
+
html_errors: "HTML-Fehler",
|
|
147
150
|
detailed_violations: "Detaillierte Verst\xF6\xDFe",
|
|
148
151
|
prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
|
|
149
152
|
use: "Verwenden",
|
|
@@ -185,6 +188,7 @@ var init_fr = __esm({
|
|
|
185
188
|
critical_issues: "Probl\xE8mes Critiques",
|
|
186
189
|
high_issues: "Probl\xE8mes Importants",
|
|
187
190
|
total_issues: "Total des Probl\xE8mes",
|
|
191
|
+
html_errors: "Erreurs HTML",
|
|
188
192
|
detailed_violations: "Violations D\xE9taill\xE9es",
|
|
189
193
|
prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
|
|
190
194
|
use: "Utiliser",
|
|
@@ -226,6 +230,7 @@ var init_es = __esm({
|
|
|
226
230
|
critical_issues: "Problemas Cr\xEDticos",
|
|
227
231
|
high_issues: "Problemas Altos",
|
|
228
232
|
total_issues: "Problemas Totales",
|
|
233
|
+
html_errors: "Errores HTML",
|
|
229
234
|
detailed_violations: "Violaciones Detalladas",
|
|
230
235
|
prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
|
|
231
236
|
use: "Usar",
|
|
@@ -267,6 +272,7 @@ var init_nl = __esm({
|
|
|
267
272
|
critical_issues: "Kritieke problemen",
|
|
268
273
|
high_issues: "Hoge prioriteit problemen",
|
|
269
274
|
total_issues: "Totaal aantal problemen",
|
|
275
|
+
html_errors: "HTML-fouten",
|
|
270
276
|
detailed_violations: "Gedetailleerde overtredingen",
|
|
271
277
|
prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
|
|
272
278
|
use: "Gebruik",
|
|
@@ -500,6 +506,7 @@ var RegulatoryScanner = class {
|
|
|
500
506
|
standard: "dos-lagen",
|
|
501
507
|
// Default till striktaste
|
|
502
508
|
silent: false,
|
|
509
|
+
invalidHttpsCert: false,
|
|
503
510
|
...options
|
|
504
511
|
};
|
|
505
512
|
this.htmlValidator = new HtmlValidator();
|
|
@@ -592,8 +599,9 @@ var RegulatoryScanner = class {
|
|
|
592
599
|
args: [
|
|
593
600
|
"--no-sandbox",
|
|
594
601
|
"--disable-setuid-sandbox",
|
|
595
|
-
"--disable-blink-features=AutomationControlled"
|
|
602
|
+
"--disable-blink-features=AutomationControlled",
|
|
596
603
|
// Gömmer att det är en robot
|
|
604
|
+
...this.options.invalidHttpsCert ? ["--ignore-certificate-errors", "--allow-insecure-localhost"] : []
|
|
597
605
|
]
|
|
598
606
|
});
|
|
599
607
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
PseudoAutomationEngine,
|
|
3
3
|
RegulatoryScanner,
|
|
4
4
|
VirtualDOMBuilder
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WZSPSYDS.mjs";
|
|
6
6
|
import {
|
|
7
7
|
getCurrentLang,
|
|
8
8
|
setLanguage,
|
|
9
9
|
t
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BKI2FFUX.mjs";
|
|
11
11
|
export {
|
|
12
12
|
PseudoAutomationEngine,
|
|
13
13
|
RegulatoryScanner,
|