accessibility-checker 4.0.1 → 4.0.2

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.
Files changed (209) hide show
  1. package/bin/achecker.js +213 -262
  2. package/bin/achecker.js.map +1 -1
  3. package/cjs/bin/achecker.d.ts +2 -0
  4. package/cjs/bin/achecker.js +306 -0
  5. package/cjs/bin/achecker.js.map +1 -0
  6. package/cjs/index.d.ts +319 -0
  7. package/cjs/index.js +402 -0
  8. package/cjs/index.js.map +1 -0
  9. package/cjs/lib/ACBrowserManager.d.ts +22 -0
  10. package/cjs/lib/ACBrowserManager.js +172 -0
  11. package/cjs/lib/ACBrowserManager.js.map +1 -0
  12. package/cjs/lib/ACEngineManager.d.ts +19 -0
  13. package/cjs/lib/ACEngineManager.js +457 -0
  14. package/cjs/lib/ACEngineManager.js.map +1 -0
  15. package/cjs/lib/ACHelper.d.ts +2 -0
  16. package/cjs/lib/ACHelper.js +678 -0
  17. package/cjs/lib/ACHelper.js.map +1 -0
  18. package/cjs/lib/api/IChecker.d.ts +28 -0
  19. package/cjs/lib/api/IChecker.js +11 -0
  20. package/cjs/lib/api/IChecker.js.map +1 -0
  21. package/cjs/lib/api/IMapper.d.ts +37 -0
  22. package/cjs/lib/api/IMapper.js +18 -0
  23. package/cjs/lib/api/IMapper.js.map +1 -0
  24. package/cjs/lib/common/api-ext/Fetch.d.ts +17 -0
  25. package/cjs/lib/common/api-ext/Fetch.js +95 -0
  26. package/cjs/lib/common/api-ext/Fetch.js.map +1 -0
  27. package/cjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
  28. package/cjs/lib/common/api-ext/IAbstractAPI.js +18 -0
  29. package/cjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
  30. package/cjs/lib/common/config/ACConfigManager.d.ts +13 -0
  31. package/cjs/lib/common/config/ACConfigManager.js +483 -0
  32. package/cjs/lib/common/config/ACConfigManager.js.map +1 -0
  33. package/cjs/lib/common/config/ACConstants.d.ts +17 -0
  34. package/cjs/lib/common/config/ACConstants.js +111 -0
  35. package/cjs/lib/common/config/ACConstants.js.map +1 -0
  36. package/cjs/lib/common/config/IArchive.d.ts +37 -0
  37. package/cjs/lib/common/config/IArchive.js +18 -0
  38. package/cjs/lib/common/config/IArchive.js.map +1 -0
  39. package/cjs/lib/common/config/IConfig.d.ts +152 -0
  40. package/cjs/lib/common/config/IConfig.js +36 -0
  41. package/cjs/lib/common/config/IConfig.js.map +1 -0
  42. package/cjs/lib/common/engine/IBounds.d.ts +21 -0
  43. package/cjs/lib/common/engine/IBounds.js +18 -0
  44. package/cjs/lib/common/engine/IBounds.js.map +1 -0
  45. package/cjs/lib/common/engine/IChecker.d.ts +23 -0
  46. package/cjs/lib/common/engine/IChecker.js +18 -0
  47. package/cjs/lib/common/engine/IChecker.js.map +1 -0
  48. package/cjs/lib/common/engine/IEngine.d.ts +39 -0
  49. package/cjs/lib/common/engine/IEngine.js +18 -0
  50. package/cjs/lib/common/engine/IEngine.js.map +1 -0
  51. package/cjs/lib/common/engine/IGuideline.d.ts +53 -0
  52. package/cjs/lib/common/engine/IGuideline.js +37 -0
  53. package/cjs/lib/common/engine/IGuideline.js.map +1 -0
  54. package/cjs/lib/common/engine/IMapper.d.ts +32 -0
  55. package/cjs/lib/common/engine/IMapper.js +18 -0
  56. package/cjs/lib/common/engine/IMapper.js.map +1 -0
  57. package/cjs/lib/common/engine/IReport.d.ts +143 -0
  58. package/cjs/lib/common/engine/IReport.js +44 -0
  59. package/cjs/lib/common/engine/IReport.js.map +1 -0
  60. package/cjs/lib/common/engine/IRule.d.ts +100 -0
  61. package/cjs/lib/common/engine/IRule.js +87 -0
  62. package/cjs/lib/common/engine/IRule.js.map +1 -0
  63. package/cjs/lib/common/engine/IRuleset.d.ts +20 -0
  64. package/cjs/lib/common/engine/IRuleset.js +18 -0
  65. package/cjs/lib/common/engine/IRuleset.js.map +1 -0
  66. package/cjs/lib/common/report/ACReporterCSV.d.ts +28 -0
  67. package/cjs/lib/common/report/ACReporterCSV.js +75 -0
  68. package/cjs/lib/common/report/ACReporterCSV.js.map +1 -0
  69. package/cjs/lib/common/report/ACReporterHTML.d.ts +27 -0
  70. package/cjs/lib/common/report/ACReporterHTML.js +61 -0
  71. package/cjs/lib/common/report/ACReporterHTML.js.map +1 -0
  72. package/cjs/lib/common/report/ACReporterJSON.d.ts +36 -0
  73. package/cjs/lib/common/report/ACReporterJSON.js +109 -0
  74. package/cjs/lib/common/report/ACReporterJSON.js.map +1 -0
  75. package/cjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
  76. package/cjs/lib/common/report/ACReporterMetrics.js +135 -0
  77. package/cjs/lib/common/report/ACReporterMetrics.js.map +1 -0
  78. package/cjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
  79. package/cjs/lib/common/report/ACReporterXLSX.js +996 -0
  80. package/cjs/lib/common/report/ACReporterXLSX.js.map +1 -0
  81. package/cjs/lib/common/report/BaselineManager.d.ts +169 -0
  82. package/cjs/lib/common/report/BaselineManager.js +382 -0
  83. package/cjs/lib/common/report/BaselineManager.js.map +1 -0
  84. package/cjs/lib/common/report/ReporterManager.d.ts +79 -0
  85. package/cjs/lib/common/report/ReporterManager.js +469 -0
  86. package/cjs/lib/common/report/ReporterManager.js.map +1 -0
  87. package/cjs/lib/common/report/genReport.d.ts +1 -0
  88. package/cjs/lib/common/report/genReport.js +12 -0
  89. package/cjs/lib/common/report/genReport.js.map +1 -0
  90. package/cjs/package.json +3 -0
  91. package/index.js +21 -63
  92. package/index.js.map +1 -1
  93. package/lib/ACBrowserManager.js +138 -203
  94. package/lib/ACBrowserManager.js.map +1 -1
  95. package/lib/ACEngineManager.js +395 -402
  96. package/lib/ACEngineManager.js.map +1 -1
  97. package/lib/ACHelper.js +581 -642
  98. package/lib/ACHelper.js.map +1 -1
  99. package/lib/common/api-ext/Fetch.js +58 -78
  100. package/lib/common/api-ext/Fetch.js.map +1 -1
  101. package/lib/common/config/ACConfigManager.js +271 -281
  102. package/lib/common/config/ACConfigManager.js.map +1 -1
  103. package/lib/common/config/ACConstants.js +38 -4
  104. package/lib/common/config/ACConstants.js.map +1 -1
  105. package/lib/common/config/IConfig.d.ts +1 -1
  106. package/lib/common/report/ACReporterCSV.js +42 -77
  107. package/lib/common/report/ACReporterCSV.js.map +1 -1
  108. package/lib/common/report/ACReporterHTML.js +15 -48
  109. package/lib/common/report/ACReporterHTML.js.map +1 -1
  110. package/lib/common/report/ACReporterJSON.js +59 -94
  111. package/lib/common/report/ACReporterJSON.js.map +1 -1
  112. package/lib/common/report/ACReporterMetrics.js +45 -108
  113. package/lib/common/report/ACReporterMetrics.js.map +1 -1
  114. package/lib/common/report/ACReporterXLSX.js +282 -300
  115. package/lib/common/report/ACReporterXLSX.js.map +1 -1
  116. package/lib/common/report/BaselineManager.js +82 -56
  117. package/lib/common/report/BaselineManager.js.map +1 -1
  118. package/lib/common/report/ReporterManager.js +125 -190
  119. package/lib/common/report/ReporterManager.js.map +1 -1
  120. package/lib/common/report/genReport.js +2 -2
  121. package/mjs/bin/achecker.d.ts +2 -0
  122. package/mjs/bin/achecker.js +236 -0
  123. package/mjs/bin/achecker.js.map +1 -0
  124. package/mjs/index.d.ts +319 -0
  125. package/mjs/index.js +368 -0
  126. package/mjs/index.js.map +1 -0
  127. package/mjs/lib/ACBrowserManager.d.ts +22 -0
  128. package/mjs/lib/ACBrowserManager.js +121 -0
  129. package/mjs/lib/ACBrowserManager.js.map +1 -0
  130. package/mjs/lib/ACEngineManager.d.ts +19 -0
  131. package/mjs/lib/ACEngineManager.js +397 -0
  132. package/mjs/lib/ACEngineManager.js.map +1 -0
  133. package/mjs/lib/ACHelper.d.ts +2 -0
  134. package/mjs/lib/ACHelper.js +614 -0
  135. package/mjs/lib/ACHelper.js.map +1 -0
  136. package/mjs/lib/api/IChecker.d.ts +28 -0
  137. package/mjs/lib/api/IChecker.js +8 -0
  138. package/mjs/lib/api/IChecker.js.map +1 -0
  139. package/mjs/lib/api/IMapper.d.ts +37 -0
  140. package/mjs/lib/api/IMapper.js +17 -0
  141. package/mjs/lib/api/IMapper.js.map +1 -0
  142. package/mjs/lib/common/api-ext/Fetch.d.ts +17 -0
  143. package/mjs/lib/common/api-ext/Fetch.js +45 -0
  144. package/mjs/lib/common/api-ext/Fetch.js.map +1 -0
  145. package/mjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
  146. package/mjs/lib/common/api-ext/IAbstractAPI.js +17 -0
  147. package/mjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
  148. package/mjs/lib/common/config/ACConfigManager.d.ts +13 -0
  149. package/mjs/lib/common/config/ACConfigManager.js +421 -0
  150. package/mjs/lib/common/config/ACConfigManager.js.map +1 -0
  151. package/mjs/lib/common/config/ACConstants.d.ts +17 -0
  152. package/mjs/lib/common/config/ACConstants.js +75 -0
  153. package/mjs/lib/common/config/ACConstants.js.map +1 -0
  154. package/mjs/lib/common/config/IArchive.d.ts +37 -0
  155. package/mjs/lib/common/config/IArchive.js +17 -0
  156. package/mjs/lib/common/config/IArchive.js.map +1 -0
  157. package/mjs/lib/common/config/IConfig.d.ts +152 -0
  158. package/mjs/lib/common/config/IConfig.js +33 -0
  159. package/mjs/lib/common/config/IConfig.js.map +1 -0
  160. package/mjs/lib/common/engine/IBounds.d.ts +21 -0
  161. package/mjs/lib/common/engine/IBounds.js +17 -0
  162. package/mjs/lib/common/engine/IBounds.js.map +1 -0
  163. package/mjs/lib/common/engine/IChecker.d.ts +23 -0
  164. package/mjs/lib/common/engine/IChecker.js +17 -0
  165. package/mjs/lib/common/engine/IChecker.js.map +1 -0
  166. package/mjs/lib/common/engine/IEngine.d.ts +39 -0
  167. package/mjs/lib/common/engine/IEngine.js +17 -0
  168. package/mjs/lib/common/engine/IEngine.js.map +1 -0
  169. package/mjs/lib/common/engine/IGuideline.d.ts +53 -0
  170. package/mjs/lib/common/engine/IGuideline.js +34 -0
  171. package/mjs/lib/common/engine/IGuideline.js.map +1 -0
  172. package/mjs/lib/common/engine/IMapper.d.ts +32 -0
  173. package/mjs/lib/common/engine/IMapper.js +17 -0
  174. package/mjs/lib/common/engine/IMapper.js.map +1 -0
  175. package/mjs/lib/common/engine/IReport.d.ts +143 -0
  176. package/mjs/lib/common/engine/IReport.js +36 -0
  177. package/mjs/lib/common/engine/IReport.js.map +1 -0
  178. package/mjs/lib/common/engine/IRule.d.ts +100 -0
  179. package/mjs/lib/common/engine/IRule.js +79 -0
  180. package/mjs/lib/common/engine/IRule.js.map +1 -0
  181. package/mjs/lib/common/engine/IRuleset.d.ts +20 -0
  182. package/mjs/lib/common/engine/IRuleset.js +17 -0
  183. package/mjs/lib/common/engine/IRuleset.js.map +1 -0
  184. package/mjs/lib/common/report/ACReporterCSV.d.ts +28 -0
  185. package/mjs/lib/common/report/ACReporterCSV.js +60 -0
  186. package/mjs/lib/common/report/ACReporterCSV.js.map +1 -0
  187. package/mjs/lib/common/report/ACReporterHTML.d.ts +27 -0
  188. package/mjs/lib/common/report/ACReporterHTML.js +46 -0
  189. package/mjs/lib/common/report/ACReporterHTML.js.map +1 -0
  190. package/mjs/lib/common/report/ACReporterJSON.d.ts +36 -0
  191. package/mjs/lib/common/report/ACReporterJSON.js +94 -0
  192. package/mjs/lib/common/report/ACReporterJSON.js.map +1 -0
  193. package/mjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
  194. package/mjs/lib/common/report/ACReporterMetrics.js +122 -0
  195. package/mjs/lib/common/report/ACReporterMetrics.js.map +1 -0
  196. package/mjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
  197. package/mjs/lib/common/report/ACReporterXLSX.js +948 -0
  198. package/mjs/lib/common/report/ACReporterXLSX.js.map +1 -0
  199. package/mjs/lib/common/report/BaselineManager.d.ts +169 -0
  200. package/mjs/lib/common/report/BaselineManager.js +348 -0
  201. package/mjs/lib/common/report/BaselineManager.js.map +1 -0
  202. package/mjs/lib/common/report/ReporterManager.d.ts +79 -0
  203. package/mjs/lib/common/report/ReporterManager.js +469 -0
  204. package/mjs/lib/common/report/ReporterManager.js.map +1 -0
  205. package/mjs/lib/common/report/genReport.d.ts +1 -0
  206. package/mjs/lib/common/report/genReport.js +9 -0
  207. package/mjs/lib/common/report/genReport.js.map +1 -0
  208. package/mjs/package.json +3 -0
  209. package/package.json +10 -4
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { IConfigInternal } from "./IConfig.js";
17
+ export declare const ACConstants: IConfigInternal;
@@ -0,0 +1,75 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ /*******************************************************************************
17
+ * NAME: ACConstants.js
18
+ * DESCRIPTION: Stores all the constants that are used by karma-ibma.
19
+ *******************************************************************************/
20
+ // Load all the modules that are needed
21
+ import { tmpdir } from "os";
22
+ import * as pathLib from "path";
23
+ import { eRuleLevel } from "./IConfig.js";
24
+ // Used to specify all the constant
25
+ export const ACConstants = {
26
+ DEBUG: process.env.DEBUG === "true",
27
+ maxTabs: 1,
28
+ policies: ["IBM_Accessibility"],
29
+ // Specify the default rule pack server to use. (Where to pull the rules and engine from).
30
+ // - JSDelivr CDN
31
+ ruleServer: "https://cdn.jsdelivr.net/npm/accessibility-checker-engine",
32
+ // - IBM Cloud hosting
33
+ // ruleServer: "https://able.ibm.com/rules",
34
+ //Specify the rule set to be use.
35
+ ruleArchive: "latest",
36
+ // Specify default violation levels on which to fail the test.
37
+ // i.e. If specified violation then the testcase will only fail if
38
+ // a violation is found uring the scan.
39
+ failLevels: [eRuleLevel.violation, eRuleLevel.potentialviolation],
40
+ // Specify default violation levels which should be reported.
41
+ // i.e. If specified violation then in the report it would only contain
42
+ // results which are level of violation.
43
+ reportLevels: [eRuleLevel.violation, eRuleLevel.potentialviolation],
44
+ // Specify default value if screenshoot should be captured of the current page that is being scanned.
45
+ captureScreenshots: false,
46
+ outputFilenameTimestamp: true,
47
+ // Specify default value for which type should the results be outputted to
48
+ outputFormat: ["json"],
49
+ // Specify default location where the results should be saved
50
+ outputFolder: "results",
51
+ // Specify default location where the baselines should be saved
52
+ baselineFolder: "baselines",
53
+ // Default cache folder (for ace-node.js / archives.json)
54
+ cacheFolder: `${tmpdir()}/accessibility-checker/`,
55
+ // Specify default value for Which file extensions should be checked
56
+ extensions: ["html", "htm", "svg"],
57
+ // List of files to look for in that order, in the case even one is found we stop and load that as the config.
58
+ // Theses files will be checked for in the working directory:
59
+ // ./.achecker.yml
60
+ // ./.achecker.yaml
61
+ // ./achecker.js
62
+ // ./achecker.json
63
+ // ./.config/.achecker.yml
64
+ // ./.config/.achecker.yaml
65
+ // ./.config/achecker.js
66
+ // ./.config/achecker.json
67
+ // The node module, require will load js or json depending on which one is present, in the case
68
+ // both json and js are present it loads js first.
69
+ configFiles: [".achecker.yml", ".achecker.yaml", "achecker", "aceconfig", pathLib.join(".config", ".achecker.yml"), pathLib.join(".config", ".achecker.yaml"), pathLib.join(".config", "achecker"), pathLib.join(".config", "aceconfig")],
70
+ ignoreHTTPSErrors: false,
71
+ headless: "shell",
72
+ perfMetrics: true,
73
+ engineMode: "DEFAULT"
74
+ };
75
+ //# sourceMappingURL=ACConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ACConstants.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/config/ACConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;gFAcgF;AAEhF;;;iFAGiF;AAEjF,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,KAAK,OAAO,MAAM,MAAM,CAAC;AAChC,OAAO,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D,mCAAmC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAqB;IACzC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM;IACnC,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC,mBAAmB,CAAC;IAC/B,0FAA0F;IAC1F,iBAAiB;IACjB,UAAU,EAAE,2DAA2D;IACvE,sBAAsB;IACtB,4CAA4C;IAE5C,iCAAiC;IACjC,WAAW,EAAE,QAAQ;IAErB,8DAA8D;IAC9D,kEAAkE;IAClE,4CAA4C;IAC5C,UAAU,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAEjE,6DAA6D;IAC7D,uEAAuE;IACvE,6CAA6C;IAC7C,YAAY,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAEnE,qGAAqG;IACrG,kBAAkB,EAAE,KAAK;IAEzB,uBAAuB,EAAE,IAAI;IAE7B,0EAA0E;IAC1E,YAAY,EAAE,CAAE,MAAM,CAAE;IAExB,6DAA6D;IAC7D,YAAY,EAAE,SAAS;IAEvB,+DAA+D;IAC/D,cAAc,EAAE,WAAW;IAE3B,yDAAyD;IACzD,WAAW,EAAE,GAAG,MAAM,EAAE,yBAAyB;IAEjD,oEAAoE;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;IAElC,8GAA8G;IAC9G,6DAA6D;IAC7D,mBAAmB;IACnB,oBAAoB;IACpB,iBAAiB;IACjB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;IAC5B,yBAAyB;IACzB,2BAA2B;IAC3B,+FAA+F;IAC/F,kDAAkD;IAClD,WAAW,EAAE,CAAC,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEzO,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,SAAS;CACxB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /******************************************************************************
2
+ Copyright:: 2023- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export interface IArchive {
17
+ id: "latest" | "preview" | "versioned" | string;
18
+ name: string;
19
+ path: string;
20
+ policies: Array<{
21
+ id: string;
22
+ name: string;
23
+ description: string;
24
+ }>;
25
+ rulesets: {
26
+ [key: string]: Array<{
27
+ id: string;
28
+ name: string;
29
+ description: string;
30
+ }>;
31
+ };
32
+ version: string;
33
+ latest?: boolean;
34
+ sunset?: boolean;
35
+ helpPath: string;
36
+ enginePath: string;
37
+ }
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2023- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export {};
17
+ //# sourceMappingURL=IArchive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IArchive.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/config/IArchive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E"}
@@ -0,0 +1,152 @@
1
+ /******************************************************************************
2
+ Copyright:: 2023- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { IArchive } from "./IArchive.js";
17
+ export declare enum eAssertResult {
18
+ ERROR = -1,
19
+ PASS = 0,
20
+ BASELINE_MISMATCH = 1,
21
+ FAIL = 2
22
+ }
23
+ export declare enum eRuleLevel {
24
+ violation = "violation",
25
+ potentialviolation = "potentialviolation",
26
+ recommendation = "recommendation",
27
+ potentialrecommendation = "potentialrecommendation",
28
+ manual = "manual",
29
+ pass = "pass",
30
+ ignored = "ignored"
31
+ }
32
+ export interface IConfig {
33
+ /**
34
+ * (optional) Specify the rule archive
35
+ *
36
+ * Run `npx achecker archives` for a list of valid ruleArchive ids and policy ids
37
+ * Default: "latest"
38
+ */
39
+ ruleArchive?: "latest" | "preview" | "versioned" | string;
40
+ /**
41
+ * (optional) Specify one or many policies to scan.
42
+ *
43
+ * Run `npx achecker archives` for a list of valid ruleArchive ids and policy ids
44
+ * Default: ["IBM_Accessibility"]
45
+ */
46
+ policies?: Array<"IBM_Accessibility" | string>;
47
+ /**
48
+ * (optional) Specify one or many violation levels on which to fail the test
49
+ *
50
+ * i.e. If specified violation then the testcase will only fail if
51
+ * a violation is found during the scan.
52
+ * Default: ["violation", "review"]
53
+ */
54
+ failLevels?: eRuleLevel[];
55
+ /**
56
+ * (optional) Specify one or many violation levels which should be reported
57
+ *
58
+ * i.e. If specified violation then in the report it would only contain
59
+ * results which are level of violation.
60
+ * Default: ["violation", "review"]
61
+ */
62
+ reportLevels?: eRuleLevel[];
63
+ /**
64
+ * (optional) In which fornats should the results be output
65
+ * Default: ["json"]
66
+ */
67
+ outputFormat?: Array<"json" | "html" | "csv" | "disable" | "xlsx">;
68
+ /**
69
+ * (optional) Specify any labels that you would like associated to your scan
70
+ * Default: []
71
+ */
72
+ label?: string[];
73
+ /**
74
+ * (optional) Where the scan results should be saved.
75
+ * Default: "results"
76
+ */
77
+ outputFolder?: string;
78
+ /**
79
+ * (optional) Should the timestamp be included in the filename of the reports?
80
+ * Default: true
81
+ */
82
+ outputFilenameTimestamp?: boolean;
83
+ /**
84
+ * (optional) Where the baseline results should be loaded from
85
+ * Default: "baselines"
86
+ */
87
+ baselineFolder?: string;
88
+ /**
89
+ * (optional) Where the tool can read/write cached files (ace-node.js / archive.json)
90
+ * Default: `${os.tmpdir()}/accessibility-checker/`
91
+ */
92
+ cacheFolder?: string;
93
+ /**
94
+ * (optional) For tools that scan files, which extensions should we include
95
+ * Default: ["html", "htm", "svg"]
96
+ */
97
+ extensions?: string[];
98
+ }
99
+ export type IConfigInternal = IConfig & {
100
+ /**
101
+ * Run in debug mode
102
+ */
103
+ DEBUG?: boolean;
104
+ /**
105
+ * Spot to store parsed archive file
106
+ */
107
+ ruleArchiveSet?: IArchive[];
108
+ /**
109
+ * Label to expose to reports
110
+ */
111
+ ruleArchiveLabel?: string;
112
+ /**
113
+ * (optional) Rule server to pull the rules from and to use for help
114
+ * Default: "https://able.ibm.com/rules"
115
+ */
116
+ ruleServer?: string;
117
+ /**
118
+ * Path to the rule pack
119
+ */
120
+ rulePack?: string;
121
+ /**
122
+ * Path within the archive
123
+ */
124
+ ruleArchivePath?: string;
125
+ /**
126
+ * Version number of the selected archive
127
+ */
128
+ ruleArchiveVersion?: string;
129
+ /**
130
+ * (optional) If the tool allows, should we capture screenshots
131
+ */
132
+ captureScreenshots?: boolean;
133
+ /**
134
+ * (optional) If the tool allows, should we run headless
135
+ */
136
+ headless?: "shell" | boolean;
137
+ /**
138
+ * (optional) If the tool allows, set the maximum number of tabs to open
139
+ */
140
+ maxTabs?: number;
141
+ /**
142
+ * Configuration filenames to try loading
143
+ */
144
+ configFiles?: string[];
145
+ toolID?: string;
146
+ toolName?: string;
147
+ toolVersion?: string;
148
+ scanID?: string;
149
+ ignoreHTTPSErrors: boolean;
150
+ perfMetrics: boolean;
151
+ engineMode: "DEFAULT" | "REMOTE" | "INJECT";
152
+ };
@@ -0,0 +1,33 @@
1
+ /******************************************************************************
2
+ Copyright:: 2023- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export var eAssertResult;
17
+ (function (eAssertResult) {
18
+ eAssertResult[eAssertResult["ERROR"] = -1] = "ERROR";
19
+ eAssertResult[eAssertResult["PASS"] = 0] = "PASS";
20
+ eAssertResult[eAssertResult["BASELINE_MISMATCH"] = 1] = "BASELINE_MISMATCH";
21
+ eAssertResult[eAssertResult["FAIL"] = 2] = "FAIL";
22
+ })(eAssertResult || (eAssertResult = {}));
23
+ export var eRuleLevel;
24
+ (function (eRuleLevel) {
25
+ eRuleLevel["violation"] = "violation";
26
+ eRuleLevel["potentialviolation"] = "potentialviolation";
27
+ eRuleLevel["recommendation"] = "recommendation";
28
+ eRuleLevel["potentialrecommendation"] = "potentialrecommendation";
29
+ eRuleLevel["manual"] = "manual";
30
+ eRuleLevel["pass"] = "pass";
31
+ eRuleLevel["ignored"] = "ignored";
32
+ })(eRuleLevel || (eRuleLevel = {}));
33
+ //# sourceMappingURL=IConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfig.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/config/IConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E;AAI/E,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,oDAAU,CAAA;IACV,iDAAQ,CAAA;IACR,2EAAqB,CAAA;IACrB,iDAAQ,CAAA;AACZ,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAGD,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,qCAAuB,CAAA;IACvB,uDAAyC,CAAA;IACzC,+CAAiC,CAAA;IACjC,iEAAmD,CAAA;IACnD,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;AACvB,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
@@ -0,0 +1,21 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export type Bounds = {
17
+ left: number;
18
+ top: number;
19
+ width: number;
20
+ height: number;
21
+ };
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export {};
17
+ //# sourceMappingURL=IBounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBounds.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IBounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E"}
@@ -0,0 +1,23 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { Guideline } from "./IGuideline.js";
17
+ import { IEngineReport } from "./IReport.js";
18
+ export interface IChecker {
19
+ addGuideline(guideline: Guideline): any;
20
+ getGuidelines(): Guideline[];
21
+ getGuidelineIds(): string[];
22
+ check(node: Node | Document, guidelineIds?: string | string[]): Promise<IEngineReport>;
23
+ }
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export {};
17
+ //# sourceMappingURL=IChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IChecker.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IChecker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E"}
@@ -0,0 +1,39 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { Rule } from "./IRule.js";
17
+ export interface IEngine {
18
+ /**
19
+ * Perform a scan on a document or subtree
20
+ * @param rulesetIds Array of ruleset ids of rulesets to use for this scan
21
+ * @param root Document or subtree to scan
22
+ */
23
+ run(root: Document | Node, options?: {}): Promise<Report>;
24
+ enableRules(ruleIds: string[]): any;
25
+ getRule(ruleId: string): Rule;
26
+ getRulesIds(): string[];
27
+ getMessage(ruleId: string, ruleIdx: number | string, msgArgs?: string[]): string;
28
+ getHelp(ruleId: string, ruleIdx: number | string): string;
29
+ addRules(rule: Rule[]): any;
30
+ addRule(rule: Rule): any;
31
+ addNlsMap(map: NlsMap): any;
32
+ addHelpMap(map: NlsMap): any;
33
+ }
34
+ export type NlsMap = {
35
+ [key: string]: string[];
36
+ };
37
+ export type HelpMap = {
38
+ [key: string]: string[];
39
+ };
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export {};
17
+ //# sourceMappingURL=IEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEngine.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E"}
@@ -0,0 +1,53 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { eRulePolicy } from "./IRule.js";
17
+ export declare enum eToolkitLevel {
18
+ LEVEL_ONE = "1",
19
+ LEVEL_TWO = "2",
20
+ LEVEL_THREE = "3",
21
+ LEVEL_FOUR = "4"
22
+ }
23
+ export declare enum eGuidelineCategory {
24
+ ACCESSIBILITY = "Accessibility",
25
+ DESIGN = "Design",
26
+ OTHER = "Other"
27
+ }
28
+ export declare enum eGuidelineType {
29
+ DEFAULT = "default",
30
+ EXTENSION = "extension"
31
+ }
32
+ export type Checkpoint = {
33
+ num: string;
34
+ scId?: string;
35
+ name: string;
36
+ wcagLevel: string;
37
+ summary: string;
38
+ rules?: Array<{
39
+ id: string;
40
+ reasonCodes?: string[];
41
+ level: eRulePolicy;
42
+ toolkitLevel: eToolkitLevel;
43
+ enabled?: boolean;
44
+ }>;
45
+ };
46
+ export type Guideline = {
47
+ id: string;
48
+ name: string;
49
+ category: eGuidelineCategory;
50
+ description: string;
51
+ type?: eGuidelineType;
52
+ checkpoints: Array<Checkpoint>;
53
+ };
@@ -0,0 +1,34 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export var eToolkitLevel;
17
+ (function (eToolkitLevel) {
18
+ eToolkitLevel["LEVEL_ONE"] = "1";
19
+ eToolkitLevel["LEVEL_TWO"] = "2";
20
+ eToolkitLevel["LEVEL_THREE"] = "3";
21
+ eToolkitLevel["LEVEL_FOUR"] = "4";
22
+ })(eToolkitLevel || (eToolkitLevel = {}));
23
+ export var eGuidelineCategory;
24
+ (function (eGuidelineCategory) {
25
+ eGuidelineCategory["ACCESSIBILITY"] = "Accessibility";
26
+ eGuidelineCategory["DESIGN"] = "Design";
27
+ eGuidelineCategory["OTHER"] = "Other";
28
+ })(eGuidelineCategory || (eGuidelineCategory = {}));
29
+ export var eGuidelineType;
30
+ (function (eGuidelineType) {
31
+ eGuidelineType["DEFAULT"] = "default";
32
+ eGuidelineType["EXTENSION"] = "extension";
33
+ })(eGuidelineType || (eGuidelineType = {}));
34
+ //# sourceMappingURL=IGuideline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGuideline.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IGuideline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E;AAI/E,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,iCAAgB,CAAA;AACpB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,qDAA+B,CAAA;IAC/B,uCAAiB,CAAA;IACjB,qCAAe,CAAA;AACnB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;AAC3B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB"}
@@ -0,0 +1,32 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ import { Bounds } from "./IBounds.js";
17
+ export type IMapResult = {
18
+ node: Node;
19
+ namespace: string;
20
+ role: string;
21
+ rolePath: string;
22
+ attributes: {
23
+ [key: string]: string;
24
+ };
25
+ bounds?: Bounds;
26
+ };
27
+ export interface IMapper {
28
+ reset(node: Node): void;
29
+ openScope(node: Node): IMapResult[];
30
+ closeScope(node: Node): IMapResult[];
31
+ getNamespace(): string;
32
+ }
@@ -0,0 +1,17 @@
1
+ /******************************************************************************
2
+ Copyright:: 2020- IBM, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ *****************************************************************************/
16
+ export {};
17
+ //# sourceMappingURL=IMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMapper.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E"}