@holmdigital/engine 1.4.8 → 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 CHANGED
@@ -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
@@ -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
  }
package/dist/cli/index.js CHANGED
@@ -499,6 +499,7 @@ var RegulatoryScanner = class {
499
499
  standard: "dos-lagen",
500
500
  // Default till striktaste
501
501
  silent: false,
502
+ invalidHttpsCert: false,
502
503
  ...options
503
504
  };
504
505
  this.htmlValidator = new HtmlValidator();
@@ -591,8 +592,9 @@ var RegulatoryScanner = class {
591
592
  args: [
592
593
  "--no-sandbox",
593
594
  "--disable-setuid-sandbox",
594
- "--disable-blink-features=AutomationControlled"
595
+ "--disable-blink-features=AutomationControlled",
595
596
  // Gömmer att det är en robot
597
+ ...this.options.invalidHttpsCert ? ["--ignore-certificate-errors", "--allow-insecure-localhost"] : []
596
598
  ]
597
599
  });
598
600
  }
@@ -1145,7 +1147,7 @@ function isValidUrl(urlString) {
1145
1147
  }
1146
1148
  var program = new import_commander.Command();
1147
1149
  program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
1148
- 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) => {
1149
1151
  setLanguage(options.lang);
1150
1152
  if (!isValidUrl(url)) {
1151
1153
  console.error(import_chalk.default.red(`Error: Invalid URL format '${url}'`));
@@ -1175,7 +1177,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
1175
1177
  viewport,
1176
1178
  silent: options.json,
1177
1179
  // Suppress debug output for JSON mode
1178
- severityThreshold: options.threshold
1180
+ severityThreshold: options.threshold,
1181
+ invalidHttpsCert: options.invalidHttpsCert
1179
1182
  });
1180
1183
  if (spinner) spinner.text = t("cli.analyzing");
1181
1184
  const result = await scanner.scan();
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  PseudoAutomationEngine,
4
4
  RegulatoryScanner
5
- } from "../chunk-GKQRHFIT.mjs";
5
+ } from "../chunk-WZSPSYDS.mjs";
6
6
  import {
7
7
  getCurrentLang,
8
8
  setLanguage,
@@ -362,7 +362,7 @@ function isValidUrl(urlString) {
362
362
  }
363
363
  var program = new Command();
364
364
  program.name("hd-a11y-scan").description("HolmDigital Regulatory Scanner").version("0.1.0");
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").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) => {
366
366
  setLanguage(options.lang);
367
367
  if (!isValidUrl(url)) {
368
368
  console.error(chalk.red(`Error: Invalid URL format '${url}'`));
@@ -392,7 +392,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
392
392
  viewport,
393
393
  silent: options.json,
394
394
  // Suppress debug output for JSON mode
395
- severityThreshold: options.threshold
395
+ severityThreshold: options.threshold,
396
+ invalidHttpsCert: options.invalidHttpsCert
396
397
  });
397
398
  if (spinner) spinner.text = t("cli.analyzing");
398
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;
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;
package/dist/index.js CHANGED
@@ -506,6 +506,7 @@ var RegulatoryScanner = class {
506
506
  standard: "dos-lagen",
507
507
  // Default till striktaste
508
508
  silent: false,
509
+ invalidHttpsCert: false,
509
510
  ...options
510
511
  };
511
512
  this.htmlValidator = new HtmlValidator();
@@ -598,8 +599,9 @@ var RegulatoryScanner = class {
598
599
  args: [
599
600
  "--no-sandbox",
600
601
  "--disable-setuid-sandbox",
601
- "--disable-blink-features=AutomationControlled"
602
+ "--disable-blink-features=AutomationControlled",
602
603
  // Gömmer att det är en robot
604
+ ...this.options.invalidHttpsCert ? ["--ignore-certificate-errors", "--allow-insecure-localhost"] : []
603
605
  ]
604
606
  });
605
607
  }
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  PseudoAutomationEngine,
3
3
  RegulatoryScanner,
4
4
  VirtualDOMBuilder
5
- } from "./chunk-GKQRHFIT.mjs";
5
+ } from "./chunk-WZSPSYDS.mjs";
6
6
  import {
7
7
  getCurrentLang,
8
8
  setLanguage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",