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,143 @@
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 { eRuleLevel } from "../config/IConfig.js";
17
+ import { Guideline, eGuidelineCategory } from "./IGuideline.js";
18
+ import { Issue, eRulePolicy as eRulePolicyNew, eRuleConfidence as eRuleConfidenceNew } from "./IRule.js";
19
+ import { Bounds as BoundsNew } from "./IBounds.js";
20
+ /**
21
+ * @deprecated See ./IRule
22
+ */
23
+ export { eRuleConfidence } from "./IRule";
24
+ /**
25
+ * @deprecated See ./IRule
26
+ */
27
+ export { eRulePolicy } from "./IRule";
28
+ /**
29
+ * @deprecated See ./IGuideline
30
+ */
31
+ export { eToolkitLevel } from "./IGuideline";
32
+ /**
33
+ * @deprecated See ./IGuideline::eGuidelineCategory
34
+ */
35
+ export { eGuidelineCategory as eRuleCategory } from "./IGuideline";
36
+ /**
37
+ * @deprecated See ./IGuideline::eGuidelineType
38
+ */
39
+ export { eGuidelineType as eRuleType } from "./IGuideline";
40
+ /**
41
+ * @deprecated See ./IBounds
42
+ */
43
+ export type Bounds = BoundsNew;
44
+ /**
45
+ * @deprecated See ./IGuidline
46
+ */
47
+ export type IRuleset = Guideline;
48
+ export type IEngineReport = {
49
+ results: Issue[];
50
+ numExecuted: number;
51
+ ruleTime: number;
52
+ totalTime?: number;
53
+ screenshot?: string;
54
+ nls?: {
55
+ [ruleId: string]: {
56
+ [reasonId: string]: string;
57
+ };
58
+ };
59
+ summary?: {
60
+ counts?: EngineSummaryCounts;
61
+ };
62
+ };
63
+ export type IEngineResult = Issue;
64
+ export type IBaselineResult = IEngineResult & {
65
+ ignored: boolean;
66
+ help: string;
67
+ level: eRuleLevel;
68
+ };
69
+ export type EngineSummaryCounts = {
70
+ violation: number;
71
+ potentialviolation: number;
72
+ recommendation: number;
73
+ potentialrecommendation: number;
74
+ manual: number;
75
+ pass: number;
76
+ };
77
+ export type SummaryCounts = {
78
+ violation: number;
79
+ potentialviolation: number;
80
+ recommendation: number;
81
+ potentialrecommendation: number;
82
+ manual: number;
83
+ pass: number;
84
+ ignored: number;
85
+ elements: number;
86
+ elementsViolation: number;
87
+ elementsViolationReview: number;
88
+ };
89
+ export type IBaselineReport = {
90
+ results: IBaselineResult[];
91
+ numExecuted: number;
92
+ nls: {
93
+ [ruleId: string]: {
94
+ [reasonId: string]: string;
95
+ };
96
+ };
97
+ summary: {
98
+ counts: SummaryCounts;
99
+ scanTime: number;
100
+ ruleArchive: string;
101
+ policies: string[];
102
+ reportLevels: string[];
103
+ startScan: number;
104
+ URL: string;
105
+ };
106
+ scanID: string;
107
+ toolID: string;
108
+ label: string;
109
+ };
110
+ export type CompressedReport = [
111
+ number,
112
+ string,
113
+ string,
114
+ string,
115
+ string,
116
+ number,
117
+ number,
118
+ string,
119
+ string[],
120
+ string[],
121
+ CompressedIssue[],
122
+ SummaryCounts
123
+ ];
124
+ export type CompressedIssue = [
125
+ // results
126
+ eGuidelineCategory | undefined,
127
+ string,
128
+ [
129
+ eRulePolicyNew,
130
+ eRuleConfidenceNew
131
+ ],
132
+ // value
133
+ number | string | undefined,
134
+ string[],
135
+ {
136
+ [ns: string]: string;
137
+ },
138
+ number,
139
+ string,
140
+ string,
141
+ boolean,
142
+ string
143
+ ];
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /******************************************************************************
3
+ Copyright:: 2020- IBM, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ *****************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.eRuleType = exports.eRuleCategory = exports.eToolkitLevel = exports.eRulePolicy = exports.eRuleConfidence = void 0;
19
+ /**
20
+ * @deprecated See ./IRule
21
+ */
22
+ var IRule_1 = require("./IRule");
23
+ Object.defineProperty(exports, "eRuleConfidence", { enumerable: true, get: function () { return IRule_1.eRuleConfidence; } });
24
+ /**
25
+ * @deprecated See ./IRule
26
+ */
27
+ var IRule_2 = require("./IRule");
28
+ Object.defineProperty(exports, "eRulePolicy", { enumerable: true, get: function () { return IRule_2.eRulePolicy; } });
29
+ /**
30
+ * @deprecated See ./IGuideline
31
+ */
32
+ var IGuideline_1 = require("./IGuideline");
33
+ Object.defineProperty(exports, "eToolkitLevel", { enumerable: true, get: function () { return IGuideline_1.eToolkitLevel; } });
34
+ /**
35
+ * @deprecated See ./IGuideline::eGuidelineCategory
36
+ */
37
+ var IGuideline_2 = require("./IGuideline");
38
+ Object.defineProperty(exports, "eRuleCategory", { enumerable: true, get: function () { return IGuideline_2.eGuidelineCategory; } });
39
+ /**
40
+ * @deprecated See ./IGuideline::eGuidelineType
41
+ */
42
+ var IGuideline_3 = require("./IGuideline");
43
+ Object.defineProperty(exports, "eRuleType", { enumerable: true, get: function () { return IGuideline_3.eGuidelineType; } });
44
+ //# sourceMappingURL=IReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IReport.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IReport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;+EAc+E;;;AAO/E;;GAEG;AACH,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AAExB;;GAEG;AACH,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AAEpB;;GAEG;AACH,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAEtB;;GAEG;AACH,2CAAmE;AAA1D,2GAAA,kBAAkB,OAAiB;AAE5C;;GAEG;AACH,2CAA2D;AAAlD,uGAAA,cAAc,OAAa"}
@@ -0,0 +1,100 @@
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 { eGuidelineCategory } from "./IGuideline.js";
17
+ import { IMapResult } from "./IMapper.js";
18
+ import { eToolkitLevel as eToolkitLevelNew } from "./IGuideline.js";
19
+ import { Bounds } from "./IBounds.js";
20
+ export declare enum eRuleConfidence {
21
+ PASS = "PASS",
22
+ FAIL = "FAIL",
23
+ POTENTIAL = "POTENTIAL",
24
+ MANUAL = "MANUAL"
25
+ }
26
+ export declare enum eRulePolicy {
27
+ VIOLATION = "VIOLATION",
28
+ RECOMMENDATION = "RECOMMENDATION",
29
+ INFORMATION = "INFORMATION"
30
+ }
31
+ export declare function RulePass(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
32
+ export declare function RuleRender(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
33
+ export declare function RuleFail(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
34
+ export declare function RulePotential(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
35
+ export declare function RuleManual(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
36
+ export type RuleResult = {
37
+ value: [eRulePolicy, eRuleConfidence];
38
+ reasonId?: number | string;
39
+ messageArgs?: string[];
40
+ apiArgs?: any[];
41
+ };
42
+ export type Issue = RuleResult & {
43
+ ruleId: string;
44
+ node: Node;
45
+ category?: eGuidelineCategory;
46
+ path: {
47
+ [ns: string]: string;
48
+ };
49
+ ruleTime: number;
50
+ message: string;
51
+ bounds?: Bounds;
52
+ snippet: string;
53
+ level?: string;
54
+ };
55
+ export type RuleContextHierarchy = {
56
+ [namespace: string]: IMapResult[];
57
+ };
58
+ export type RuleContext = {
59
+ [namespace: string]: IMapResult;
60
+ };
61
+ export type Rule = {
62
+ id: string;
63
+ rulesets: Array<{
64
+ id: string | string[];
65
+ num: string | string[];
66
+ level: eRulePolicy;
67
+ toolkitLevel: eToolkitLevelNew;
68
+ reasonCodes?: string[];
69
+ }>;
70
+ refactor?: {
71
+ [oldRuleId: string]: {
72
+ [oldReasonCode: string]: string;
73
+ };
74
+ };
75
+ messages: {
76
+ [locale: string]: {
77
+ [reasonId: string]: string;
78
+ };
79
+ };
80
+ help: {
81
+ [locale: string]: {
82
+ [reasonId: string]: string;
83
+ };
84
+ };
85
+ /**
86
+ * How this rule maps to ACT rules, if any (https://act-rules.github.io/rules/)
87
+ *
88
+ * string: For a single rule mapping that matches exactly to the rule (Pass -> pass, Potential -> cantTell, Fail -> fail, unlisted => inapplicable)
89
+ * Array<>: Custom mapping of rule to ACT results
90
+ */
91
+ act?: string | string[] | Array<string | {
92
+ [actRuleId: string]: {
93
+ [reasonId: string]: "pass" | "fail" | "cantTell" | "inapplicable";
94
+ };
95
+ }>;
96
+ context: string;
97
+ dependencies?: string[];
98
+ run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy) => RuleResult | RuleResult[] | null;
99
+ enabled?: boolean;
100
+ };
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ /******************************************************************************
3
+ Copyright:: 2020- IBM, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ *****************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.eRulePolicy = exports.eRuleConfidence = void 0;
19
+ exports.RulePass = RulePass;
20
+ exports.RuleRender = RuleRender;
21
+ exports.RuleFail = RuleFail;
22
+ exports.RulePotential = RulePotential;
23
+ exports.RuleManual = RuleManual;
24
+ var eRuleConfidence;
25
+ (function (eRuleConfidence) {
26
+ eRuleConfidence["PASS"] = "PASS";
27
+ eRuleConfidence["FAIL"] = "FAIL";
28
+ eRuleConfidence["POTENTIAL"] = "POTENTIAL";
29
+ eRuleConfidence["MANUAL"] = "MANUAL";
30
+ })(eRuleConfidence || (exports.eRuleConfidence = eRuleConfidence = {}));
31
+ var eRulePolicy;
32
+ (function (eRulePolicy) {
33
+ eRulePolicy["VIOLATION"] = "VIOLATION";
34
+ eRulePolicy["RECOMMENDATION"] = "RECOMMENDATION";
35
+ eRulePolicy["INFORMATION"] = "INFORMATION";
36
+ })(eRulePolicy || (exports.eRulePolicy = eRulePolicy = {}));
37
+ function RulePass(reasonId, messageArgs, apiArgs) {
38
+ if (typeof reasonId === "undefined" || reasonId === null)
39
+ throw new Error("Reason ID must be defined");
40
+ return {
41
+ value: [eRulePolicy.INFORMATION, eRuleConfidence.PASS],
42
+ reasonId: reasonId,
43
+ messageArgs: messageArgs || [],
44
+ apiArgs: apiArgs || []
45
+ };
46
+ }
47
+ function RuleRender(reasonId, messageArgs, apiArgs) {
48
+ if (typeof reasonId === "undefined" || reasonId === null)
49
+ throw new Error("Reason ID must be defined");
50
+ return {
51
+ value: [eRulePolicy.INFORMATION, eRuleConfidence.PASS],
52
+ reasonId: 0,
53
+ messageArgs: messageArgs || [],
54
+ apiArgs: apiArgs || []
55
+ };
56
+ }
57
+ function RuleFail(reasonId, messageArgs, apiArgs) {
58
+ if (typeof reasonId === "undefined" || reasonId === null)
59
+ throw new Error("Reason ID must be defined");
60
+ return {
61
+ value: [eRulePolicy.INFORMATION, eRuleConfidence.FAIL],
62
+ reasonId: reasonId,
63
+ messageArgs: messageArgs || [],
64
+ apiArgs: apiArgs || []
65
+ };
66
+ }
67
+ function RulePotential(reasonId, messageArgs, apiArgs) {
68
+ if (typeof reasonId === "undefined" || reasonId === null)
69
+ throw new Error("Reason ID must be defined");
70
+ return {
71
+ value: [eRulePolicy.INFORMATION, eRuleConfidence.POTENTIAL],
72
+ reasonId: reasonId,
73
+ messageArgs: messageArgs || [],
74
+ apiArgs: apiArgs || []
75
+ };
76
+ }
77
+ function RuleManual(reasonId, messageArgs, apiArgs) {
78
+ if (typeof reasonId === "undefined" || reasonId === null)
79
+ throw new Error("Reason ID must be defined");
80
+ return {
81
+ value: [eRulePolicy.INFORMATION, eRuleConfidence.MANUAL],
82
+ reasonId: reasonId,
83
+ messageArgs: messageArgs || [],
84
+ apiArgs: apiArgs || []
85
+ };
86
+ }
87
+ //# sourceMappingURL=IRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRule.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IRule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;+EAc+E;;;AAoB/E,4BAQC;AAED,gCAQC;AACD,4BAQC;AAED,sCAQC;AAED,gCAQC;AA5DD,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;AACrB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,sCAAuB,CAAA;IACvB,gDAAiC,CAAA;IACjC,0CAA2B,CAAA;AAC/B,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,SAAgB,QAAQ,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IACzF,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,SAAgB,UAAU,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC3F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AACD,SAAgB,QAAQ,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IACzF,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,SAAgB,aAAa,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC9F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,SAAS,CAAC;QAC3D,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,SAAgB,UAAU,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC3F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC;QACxD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC"}
@@ -0,0 +1,20 @@
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 { Guideline } from "./IGuideline.js";
17
+ /**
18
+ * @deprecated
19
+ */
20
+ export type IRuleset = Guideline;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /******************************************************************************
3
+ Copyright:: 2023- IBM, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ *****************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=IRuleset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRuleset.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IRuleset.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;8EAc8E"}
@@ -0,0 +1,28 @@
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 "../config/IConfig.js";
17
+ import { Guideline } from "../engine/IGuideline.js";
18
+ import { CompressedReport } from "../engine/IReport.js";
19
+ import { GenSummReturn, IReporter } from "./ReporterManager.js";
20
+ export declare class ACReporterCSV implements IReporter {
21
+ name(): string;
22
+ private static toCSV;
23
+ generateReport(_reportData: any): {
24
+ reportPath: string;
25
+ report: string;
26
+ } | void;
27
+ generateSummary(config: IConfigInternal, _rulesets: Guideline[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
28
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /******************************************************************************
3
+ Copyright:: 2020- IBM, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ *****************************************************************************/
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.ACReporterCSV = void 0;
28
+ const ReporterManager_js_1 = require("./ReporterManager.js");
29
+ class ACReporterCSV {
30
+ name() {
31
+ return "csv";
32
+ }
33
+ generateReport(_reportData) {
34
+ }
35
+ generateSummary(config, _rulesets, endReport, compressedReports) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ let toCSV = ACReporterCSV.toCSV;
38
+ let resultStr = `Label,Level,RuleId,Message,Xpath,Help\n`;
39
+ let startScan = 0;
40
+ for (const compressedReport of compressedReports) {
41
+ let reportStored = ReporterManager_js_1.ReporterManager.uncompressReport(compressedReport);
42
+ if (startScan === 0) {
43
+ startScan = reportStored.engineReport.summary.startScan;
44
+ }
45
+ let report = reportStored.engineReport;
46
+ for (const result of report.results) {
47
+ resultStr += `${toCSV(reportStored.label)},${toCSV(result.level)},${toCSV(result.ruleId)},${toCSV(result.message)},${toCSV(result.path.dom)},${toCSV(result.help)}\n`;
48
+ }
49
+ }
50
+ let startScanD = new Date(startScan);
51
+ let reportFilename = `results_${startScanD.toISOString().replace(/:/g, "-")}.csv`;
52
+ if (config.outputFilenameTimestamp === false) {
53
+ reportFilename = `results.csv`;
54
+ }
55
+ return {
56
+ summaryPath: reportFilename,
57
+ summary: resultStr
58
+ };
59
+ });
60
+ }
61
+ }
62
+ exports.ACReporterCSV = ACReporterCSV;
63
+ ACReporterCSV.toCSV = function (str) {
64
+ if (str === null) {
65
+ return '"null"';
66
+ }
67
+ else if (!str || str.length == 0) {
68
+ return '""';
69
+ }
70
+ else {
71
+ str = str.replace(/"/g, '""');
72
+ return `"${str}"`;
73
+ }
74
+ };
75
+ //# sourceMappingURL=ACReporterCSV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ACReporterCSV.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterCSV.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;;;;;;;;;;AAKhF,6DAAiF;AAEjF,MAAa,aAAa;IACf,IAAI;QACP,OAAO,KAAK,CAAC;IACjB,CAAC;IAYM,cAAc,CAAC,WAAW;IACjC,CAAC;IACY,eAAe,CAAC,MAAuB,EAAE,SAAsB,EAAE,SAAiB,EAAE,iBAAqC;;YAClI,IAAI,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;YAChC,IAAI,SAAS,GAAG,yCAAyC,CAAC;YAC1D,IAAI,SAAS,GAAG,CAAC,CAAC;YAClB,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;gBAC/C,IAAI,YAAY,GAAG,oCAAe,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;gBACtE,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;oBAClB,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC;gBAC5D,CAAC;gBACD,IAAI,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC;gBACvC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClC,SAAS,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAA;gBACzK,CAAC;YACL,CAAC;YACD,IAAI,UAAU,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,cAAc,GAAG,WAAW,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAC,GAAG,CAAC,MAAM,CAAC;YACjF,IAAI,MAAM,CAAC,uBAAuB,KAAK,KAAK,EAAE,CAAC;gBAC3C,cAAc,GAAG,aAAa,CAAC;YACnC,CAAC;YACD,OAAO;gBACH,WAAW,EAAE,cAAc;gBAC3B,OAAO,EAAE,SAAS;aACrB,CAAA;QACL,CAAC;KAAA;;AAxCL,sCAyCC;AArCkB,mBAAK,GAAG,UAAS,GAAG;IAC/B,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,QAAQ,CAAC;IACpB,CAAC;SAAM,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;SAAM,CAAC;QACJ,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,GAAG,GAAG,CAAC;IACtB,CAAC;AACL,CAAC,CAAA"}
@@ -0,0 +1,27 @@
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 "../config/IConfig.js";
17
+ import { Guideline } from "../engine/IGuideline.js";
18
+ import { CompressedReport } from "../engine/IReport.js";
19
+ import { GenSummReturn, IReporter, IReporterStored } from "./ReporterManager.js";
20
+ export declare class ACReporterHTML implements IReporter {
21
+ name(): string;
22
+ generateReport(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
23
+ reportPath: string;
24
+ report: string;
25
+ } | void;
26
+ generateSummary(_config: IConfigInternal, rulesets: Guideline[], _endReport: number, _summaryData: CompressedReport[]): Promise<GenSummReturn>;
27
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /******************************************************************************
3
+ Copyright:: 2020- IBM, Inc
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ *****************************************************************************/
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.ACReporterHTML = void 0;
28
+ const genReport_js_1 = require("./genReport.js");
29
+ class ACReporterHTML {
30
+ name() {
31
+ return "html";
32
+ }
33
+ generateReport(config, rulesets, storedReport) {
34
+ let cloneReport = JSON.parse(JSON.stringify(storedReport.engineReport));
35
+ let outReport = {
36
+ report: {
37
+ timestamp: storedReport.startScan,
38
+ nls: cloneReport.nls,
39
+ results: cloneReport.results.filter((issue) => issue.value[1] !== "PASS"),
40
+ passUniqueElements: Array.from(new Set(cloneReport.results.map(result => result.path.dom))),
41
+ counts: {
42
+ total: {
43
+ All: 0
44
+ }
45
+ }
46
+ },
47
+ rulesets: rulesets,
48
+ tabURL: storedReport.url
49
+ };
50
+ return {
51
+ reportPath: `${storedReport.label.replace(/[:?&=]/g, "_")}.html`,
52
+ report: (0, genReport_js_1.genReport)(outReport)
53
+ };
54
+ }
55
+ generateSummary(_config, rulesets, _endReport, _summaryData) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ });
58
+ }
59
+ }
60
+ exports.ACReporterHTML = ACReporterHTML;
61
+ //# sourceMappingURL=ACReporterHTML.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ACReporterHTML.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterHTML.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;;;;;;;;;;AAMhF,iDAA2C;AAE3C,MAAa,cAAc;IAChB,IAAI;QACP,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,cAAc,CAAC,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QAC/F,IAAI,WAAW,GAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QAEzF,IAAI,SAAS,GAAG;YACZ,MAAM,EAAE;gBACJ,SAAS,EAAE,YAAY,CAAC,SAAS;gBACjC,GAAG,EAAE,WAAW,CAAC,GAAG;gBACpB,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;gBAC9E,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3F,MAAM,EAAE;oBACJ,KAAK,EAAE;wBACH,GAAG,EAAE,CAAC;qBACT;iBACJ;aACJ;YACD,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,YAAY,CAAC,GAAG;SAC3B,CAAA;QAED,OAAO;YACH,UAAU,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAC,GAAG,CAAC,OAAO;YAC/D,MAAM,EAAE,IAAA,wBAAS,EAAC,SAAS,CAAC;SAC/B,CAAC;IACN,CAAC;IACY,eAAe,CAAC,OAAwB,EAAE,QAAqB,EAAE,UAAkB,EAAE,YAAgC;;QAClI,CAAC;KAAA;CACJ;AA/BD,wCA+BC"}
@@ -0,0 +1,36 @@
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 "../config/IConfig.js";
17
+ import { Guideline } from "../engine/IGuideline.js";
18
+ import { CompressedReport } from "../engine/IReport.js";
19
+ import { GenSummReturn, IReporter, IReporterStored } from "./ReporterManager.js";
20
+ export declare class ACReporterJSON implements IReporter {
21
+ name(): string;
22
+ generateReport(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
23
+ reportPath: string;
24
+ report: string;
25
+ } | void;
26
+ generateSummary(config: IConfigInternal, _rulesets: Guideline[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
27
+ static generateReportSummary(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
28
+ counts: import("../engine/IReport.js").SummaryCounts;
29
+ scanTime: any;
30
+ ruleArchive: string;
31
+ policies: string[];
32
+ reportLevels: import("../config/IConfig.js").eRuleLevel[];
33
+ startScan: number;
34
+ URL: string;
35
+ };
36
+ }