accessibility-checker 3.1.49 → 3.1.51
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 +75 -67
- package/bin/achecker.js +14 -17
- package/bin/achecker.js.map +1 -1
- package/index.d.ts +6 -4
- package/index.js +9 -8
- package/index.js.map +1 -1
- package/lib/ACBrowserManager.d.ts +2 -2
- package/lib/ACBrowserManager.js +2 -3
- package/lib/ACBrowserManager.js.map +1 -1
- package/lib/ACEngineManager.d.ts +1 -12
- package/lib/ACEngineManager.js +72 -40
- package/lib/ACEngineManager.js.map +1 -1
- package/lib/ACHelper.js +126 -137
- package/lib/ACHelper.js.map +1 -1
- package/lib/api/IChecker.d.ts +3 -114
- package/lib/api/IChecker.js +1 -1
- package/lib/api/IChecker.js.map +1 -1
- package/lib/common/api-ext/Fetch.d.ts +16 -0
- package/lib/common/api-ext/Fetch.js +83 -0
- package/lib/common/api-ext/Fetch.js.map +1 -0
- package/lib/common/api-ext/IAbstractAPI.d.ts +34 -0
- package/lib/common/api-ext/IAbstractAPI.js +18 -0
- package/lib/common/api-ext/IAbstractAPI.js.map +1 -0
- package/lib/common/config/ACConfigManager.d.ts +7 -0
- package/lib/{ACConfigManager.js → common/config/ACConfigManager.js} +28 -19
- package/lib/common/config/ACConfigManager.js.map +1 -0
- package/lib/{ACConstants.d.ts → common/config/ACConstants.d.ts} +2 -2
- package/lib/{ACConstants.js → common/config/ACConstants.js} +7 -5
- package/lib/common/config/ACConstants.js.map +1 -0
- package/lib/common/config/IArchive.d.ts +37 -0
- package/lib/{reporters/multiScanReportUtil.d.ts → common/config/IArchive.js} +4 -5
- package/lib/common/config/IArchive.js.map +1 -0
- package/lib/common/config/IConfig.d.ts +146 -0
- package/lib/common/config/IConfig.js +36 -0
- package/lib/common/config/IConfig.js.map +1 -0
- package/lib/common/report/ACReporterCSV.d.ts +27 -0
- package/lib/common/report/ACReporterCSV.js +105 -0
- package/lib/common/report/ACReporterCSV.js.map +1 -0
- package/lib/common/report/ACReporterHTML.d.ts +26 -0
- package/lib/common/report/ACReporterHTML.js +94 -0
- package/lib/common/report/ACReporterHTML.js.map +1 -0
- package/lib/common/report/ACReporterJSON.d.ts +46 -0
- package/lib/common/report/ACReporterJSON.js +140 -0
- package/lib/common/report/ACReporterJSON.js.map +1 -0
- package/lib/{log/ACMetricsLogger.d.ts → common/report/ACReporterMetrics.d.ts} +11 -6
- package/lib/{log/ACMetricsLogger.js → common/report/ACReporterMetrics.js} +85 -70
- package/lib/common/report/ACReporterMetrics.js.map +1 -0
- package/lib/common/report/ACReporterXLSX.d.ts +37 -0
- package/lib/common/report/ACReporterXLSX.js +1004 -0
- package/lib/common/report/ACReporterXLSX.js.map +1 -0
- package/lib/common/report/BaselineManager.d.ts +169 -0
- package/lib/common/report/BaselineManager.js +355 -0
- package/lib/common/report/BaselineManager.js.map +1 -0
- package/lib/common/report/ReporterManager.d.ts +79 -0
- package/lib/common/report/ReporterManager.js +552 -0
- package/lib/common/report/ReporterManager.js.map +1 -0
- package/lib/common/report/genReport.js.map +1 -0
- package/package.json +1 -1
- package/lib/ACConfigManager.d.ts +0 -7
- package/lib/ACConfigManager.js.map +0 -1
- package/lib/ACConstants.js.map +0 -1
- package/lib/ACReportManager.d.ts +0 -590
- package/lib/ACReportManager.js +0 -1201
- package/lib/ACReportManager.js.map +0 -1
- package/lib/api/IEngine.d.ts +0 -129
- package/lib/api/IEngine.js +0 -110
- package/lib/api/IEngine.js.map +0 -1
- package/lib/log/ACMetricsLogger.js.map +0 -1
- package/lib/reporters/ACReporterCSV.d.ts +0 -103
- package/lib/reporters/ACReporterCSV.js +0 -193
- package/lib/reporters/ACReporterCSV.js.map +0 -1
- package/lib/reporters/ACReporterHTML.d.ts +0 -114
- package/lib/reporters/ACReporterHTML.js +0 -360
- package/lib/reporters/ACReporterHTML.js.map +0 -1
- package/lib/reporters/ACReporterJSON.d.ts +0 -114
- package/lib/reporters/ACReporterJSON.js +0 -277
- package/lib/reporters/ACReporterJSON.js.map +0 -1
- package/lib/reporters/ACReporterXLSX.d.ts +0 -109
- package/lib/reporters/ACReporterXLSX.js +0 -405
- package/lib/reporters/ACReporterXLSX.js.map +0 -1
- package/lib/reporters/ReportUtil.d.ts +0 -33
- package/lib/reporters/ReportUtil.js +0 -65
- package/lib/reporters/ReportUtil.js.map +0 -1
- package/lib/reporters/genReport.js.map +0 -1
- package/lib/reporters/multiScanData.d.ts +0 -27
- package/lib/reporters/multiScanData.js +0 -190
- package/lib/reporters/multiScanData.js.map +0 -1
- package/lib/reporters/multiScanReport.d.ts +0 -25
- package/lib/reporters/multiScanReport.js +0 -1729
- package/lib/reporters/multiScanReport.js.map +0 -1
- package/lib/reporters/multiScanReportUtil.js +0 -49
- package/lib/reporters/multiScanReportUtil.js.map +0 -1
- /package/lib/{reporters → common/report}/genReport.d.ts +0 -0
- /package/lib/{reporters → common/report}/genReport.js +0 -0
|
@@ -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,146 @@
|
|
|
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";
|
|
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" | 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) Where the baseline results should be loaded from
|
|
80
|
+
* Default: "baselines"
|
|
81
|
+
*/
|
|
82
|
+
baselineFolder?: string;
|
|
83
|
+
/**
|
|
84
|
+
* (optional) Where the tool can read/write cached files (ace-node.js / archive.json)
|
|
85
|
+
* Default: `${os.tmpdir()}/accessibility-checker/`
|
|
86
|
+
*/
|
|
87
|
+
cacheFolder?: string;
|
|
88
|
+
/**
|
|
89
|
+
* (optional) For tools that scan files, which extensions should we include
|
|
90
|
+
* Default: ["html", "htm", "svg"]
|
|
91
|
+
*/
|
|
92
|
+
extensions?: string[];
|
|
93
|
+
}
|
|
94
|
+
export type IConfigInternal = IConfig & {
|
|
95
|
+
/**
|
|
96
|
+
* Run in debug mode
|
|
97
|
+
*/
|
|
98
|
+
DEBUG?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Spot to store parsed archive file
|
|
101
|
+
*/
|
|
102
|
+
ruleArchiveSet?: IArchive[];
|
|
103
|
+
/**
|
|
104
|
+
* Label to expose to reports
|
|
105
|
+
*/
|
|
106
|
+
ruleArchiveLabel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* (optional) Rule server to pull the rules from and to use for help
|
|
109
|
+
* Default: "https://able.ibm.com/rules"
|
|
110
|
+
*/
|
|
111
|
+
ruleServer?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Path to the rule pack
|
|
114
|
+
*/
|
|
115
|
+
rulePack?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Path within the archive
|
|
118
|
+
*/
|
|
119
|
+
ruleArchivePath?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Version number of the selected archive
|
|
122
|
+
*/
|
|
123
|
+
ruleArchiveVersion?: string;
|
|
124
|
+
/**
|
|
125
|
+
* (optional) If the tool allows, should we capture screenshots
|
|
126
|
+
*/
|
|
127
|
+
captureScreenshots?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* (optional) If the tool allows, should we run headless
|
|
130
|
+
*/
|
|
131
|
+
headless?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* (optional) If the tool allows, set the maximum number of tabs to open
|
|
134
|
+
*/
|
|
135
|
+
maxTabs?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Configuration filenames to try loading
|
|
138
|
+
*/
|
|
139
|
+
configFiles?: string[];
|
|
140
|
+
toolID?: string;
|
|
141
|
+
toolName?: string;
|
|
142
|
+
scanID?: string;
|
|
143
|
+
ignoreHTTPSErrors: boolean;
|
|
144
|
+
perfMetrics: boolean;
|
|
145
|
+
engineMode: "DEFAULT" | "REMOTE" | "INJECT";
|
|
146
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
exports.eRuleLevel = exports.eAssertResult = void 0;
|
|
19
|
+
var eAssertResult;
|
|
20
|
+
(function (eAssertResult) {
|
|
21
|
+
eAssertResult[eAssertResult["ERROR"] = -1] = "ERROR";
|
|
22
|
+
eAssertResult[eAssertResult["PASS"] = 0] = "PASS";
|
|
23
|
+
eAssertResult[eAssertResult["BASELINE_MISMATCH"] = 1] = "BASELINE_MISMATCH";
|
|
24
|
+
eAssertResult[eAssertResult["FAIL"] = 2] = "FAIL";
|
|
25
|
+
})(eAssertResult || (exports.eAssertResult = eAssertResult = {}));
|
|
26
|
+
var eRuleLevel;
|
|
27
|
+
(function (eRuleLevel) {
|
|
28
|
+
eRuleLevel["violation"] = "violation";
|
|
29
|
+
eRuleLevel["potentialviolation"] = "potentialviolation";
|
|
30
|
+
eRuleLevel["recommendation"] = "recommendation";
|
|
31
|
+
eRuleLevel["potentialrecommendation"] = "potentialrecommendation";
|
|
32
|
+
eRuleLevel["manual"] = "manual";
|
|
33
|
+
eRuleLevel["pass"] = "pass";
|
|
34
|
+
eRuleLevel["ignored"] = "ignored";
|
|
35
|
+
})(eRuleLevel || (exports.eRuleLevel = eRuleLevel = {}));
|
|
36
|
+
//# 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,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,oDAAU,CAAA;IACV,iDAAQ,CAAA;IACR,2EAAqB,CAAA;IACrB,iDAAQ,CAAA;AACZ,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAGD,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,0BAAV,UAAU,QAQrB"}
|
|
@@ -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";
|
|
17
|
+
import { CompressedReport, IRuleset } from "../engine/IReport";
|
|
18
|
+
import { GenSummReturn, IReporter } from "./ReporterManager";
|
|
19
|
+
export declare class ACReporterCSV implements IReporter {
|
|
20
|
+
name(): string;
|
|
21
|
+
private static toCSV;
|
|
22
|
+
generateReport(_reportData: any): {
|
|
23
|
+
reportPath: string;
|
|
24
|
+
report: string;
|
|
25
|
+
} | void;
|
|
26
|
+
generateSummary(config: IConfigInternal, _rulesets: IRuleset[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ACReporterCSV = void 0;
|
|
55
|
+
var ReporterManager_1 = require("./ReporterManager");
|
|
56
|
+
var ACReporterCSV = exports.ACReporterCSV = /** @class */ (function () {
|
|
57
|
+
function ACReporterCSV() {
|
|
58
|
+
}
|
|
59
|
+
ACReporterCSV.prototype.name = function () {
|
|
60
|
+
return "csv";
|
|
61
|
+
};
|
|
62
|
+
ACReporterCSV.prototype.generateReport = function (_reportData) {
|
|
63
|
+
};
|
|
64
|
+
ACReporterCSV.prototype.generateSummary = function (config, _rulesets, endReport, compressedReports) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var toCSV, resultStr, startScan, _i, compressedReports_1, compressedReport, reportStored, report, _a, _b, result, startScanD;
|
|
67
|
+
return __generator(this, function (_c) {
|
|
68
|
+
toCSV = ACReporterCSV.toCSV;
|
|
69
|
+
resultStr = "Label,Level,RuleId,Message,Xpath,Help\n";
|
|
70
|
+
startScan = 0;
|
|
71
|
+
for (_i = 0, compressedReports_1 = compressedReports; _i < compressedReports_1.length; _i++) {
|
|
72
|
+
compressedReport = compressedReports_1[_i];
|
|
73
|
+
reportStored = ReporterManager_1.ReporterManager.uncompressReport(compressedReport);
|
|
74
|
+
if (startScan === 0) {
|
|
75
|
+
startScan = reportStored.engineReport.summary.startScan;
|
|
76
|
+
}
|
|
77
|
+
report = reportStored.engineReport;
|
|
78
|
+
for (_a = 0, _b = report.results; _a < _b.length; _a++) {
|
|
79
|
+
result = _b[_a];
|
|
80
|
+
resultStr += "".concat(toCSV(reportStored.label), ",").concat(toCSV(result.level), ",").concat(toCSV(result.ruleId), ",").concat(toCSV(result.message), ",").concat(toCSV(result.path.dom), ",").concat(toCSV(result.help), "\n");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
startScanD = new Date(startScan);
|
|
84
|
+
return [2 /*return*/, {
|
|
85
|
+
summaryPath: "results_".concat(startScanD.toISOString(), ".csv"),
|
|
86
|
+
summary: resultStr
|
|
87
|
+
}];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
ACReporterCSV.toCSV = function (str) {
|
|
92
|
+
if (str === null) {
|
|
93
|
+
return '"null"';
|
|
94
|
+
}
|
|
95
|
+
else if (!str || str.length == 0) {
|
|
96
|
+
return '""';
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
str = str.replace(/"/g, '""');
|
|
100
|
+
return "\"".concat(str, "\"");
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return ACReporterCSV;
|
|
104
|
+
}());
|
|
105
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI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;QAC/B,IAAI,GAAG,KAAK,IAAI,EAAE;YACd,OAAO,QAAQ,CAAC;SACnB;aAAM,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,YAAI,GAAG,OAAG,CAAC;SACrB;IACL,CAAC,CAAA;IAwBL,oBAAC;CAAA,AArCD,IAqCC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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";
|
|
17
|
+
import { CompressedReport, IRuleset } from "../engine/IReport";
|
|
18
|
+
import { GenSummReturn, IReporter, IReporterStored } from "./ReporterManager";
|
|
19
|
+
export declare class ACReporterHTML implements IReporter {
|
|
20
|
+
name(): string;
|
|
21
|
+
generateReport(config: IConfigInternal, rulesets: IRuleset[], storedReport: IReporterStored): {
|
|
22
|
+
reportPath: string;
|
|
23
|
+
report: string;
|
|
24
|
+
} | void;
|
|
25
|
+
generateSummary(_config: IConfigInternal, rulesets: IRuleset[], _endReport: number, _summaryData: CompressedReport[]): Promise<GenSummReturn>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ACReporterHTML = void 0;
|
|
55
|
+
var genReport_1 = require("./genReport");
|
|
56
|
+
var ACReporterHTML = /** @class */ (function () {
|
|
57
|
+
function ACReporterHTML() {
|
|
58
|
+
}
|
|
59
|
+
ACReporterHTML.prototype.name = function () {
|
|
60
|
+
return "html";
|
|
61
|
+
};
|
|
62
|
+
ACReporterHTML.prototype.generateReport = function (config, rulesets, storedReport) {
|
|
63
|
+
var cloneReport = JSON.parse(JSON.stringify(storedReport.engineReport));
|
|
64
|
+
var outReport = {
|
|
65
|
+
report: {
|
|
66
|
+
timestamp: storedReport.startScan,
|
|
67
|
+
nls: cloneReport.nls,
|
|
68
|
+
results: cloneReport.results.filter(function (issue) { return issue.value[1] !== "PASS"; }),
|
|
69
|
+
passUniqueElements: Array.from(new Set(cloneReport.results.map(function (result) { return result.path.dom; }))),
|
|
70
|
+
counts: {
|
|
71
|
+
total: {
|
|
72
|
+
All: 0
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
rulesets: rulesets,
|
|
77
|
+
tabURL: storedReport.url
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
reportPath: "".concat(storedReport.label.replace(/[:?&=]/g, "_"), ".html"),
|
|
81
|
+
report: (0, genReport_1.genReport)(outReport)
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
ACReporterHTML.prototype.generateSummary = function (_config, rulesets, _endReport, _summaryData) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
return [2 /*return*/];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return ACReporterHTML;
|
|
92
|
+
}());
|
|
93
|
+
exports.ACReporterHTML = ACReporterHTML;
|
|
94
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKhF,yCAAwC;AAExC;IAAA;IA+BA,CAAC;IA9BU,6BAAI,GAAX;QACI,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,uCAAc,GAArB,UAAsB,MAAuB,EAAE,QAAoB,EAAE,YAA6B;QAC9F,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,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,EAAzB,CAAyB,CAAC;gBAC9E,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,IAAI,CAAC,GAAG,EAAf,CAAe,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,UAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAC,GAAG,CAAC,UAAO;YAC/D,MAAM,EAAE,IAAA,qBAAS,EAAC,SAAS,CAAC;SAC/B,CAAC;IACN,CAAC;IACY,wCAAe,GAA5B,UAA6B,OAAwB,EAAE,QAAoB,EAAE,UAAkB,EAAE,YAAgC;;;;;;KAChI;IACL,qBAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,wCAAc"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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";
|
|
17
|
+
import { CompressedReport, IRuleset } from "../engine/IReport";
|
|
18
|
+
import { GenSummReturn, IReporter, IReporterStored } from "./ReporterManager";
|
|
19
|
+
export declare class ACReporterJSON implements IReporter {
|
|
20
|
+
name(): string;
|
|
21
|
+
generateReport(config: IConfigInternal, rulesets: IRuleset[], storedReport: IReporterStored): {
|
|
22
|
+
reportPath: string;
|
|
23
|
+
report: string;
|
|
24
|
+
} | void;
|
|
25
|
+
generateSummary(config: IConfigInternal, _rulesets: IRuleset[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
|
|
26
|
+
static generateReportSummary(config: IConfigInternal, rulesets: IRuleset[], storedReport: IReporterStored): {
|
|
27
|
+
counts: {
|
|
28
|
+
violation: number;
|
|
29
|
+
potentialviolation: number;
|
|
30
|
+
recommendation: number;
|
|
31
|
+
potentialrecommendation: number;
|
|
32
|
+
manual: number;
|
|
33
|
+
pass: number;
|
|
34
|
+
ignored: number;
|
|
35
|
+
elements: number;
|
|
36
|
+
elementsViolation: number;
|
|
37
|
+
elementsViolationReview: number;
|
|
38
|
+
};
|
|
39
|
+
scanTime: any;
|
|
40
|
+
ruleArchive: string;
|
|
41
|
+
policies: string[];
|
|
42
|
+
reportLevels: import("../config/IConfig").eRuleLevel[];
|
|
43
|
+
startScan: number;
|
|
44
|
+
URL: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ACReporterJSON = void 0;
|
|
55
|
+
var ReporterManager_1 = require("./ReporterManager");
|
|
56
|
+
var ACReporterJSON = /** @class */ (function () {
|
|
57
|
+
function ACReporterJSON() {
|
|
58
|
+
}
|
|
59
|
+
ACReporterJSON.prototype.name = function () {
|
|
60
|
+
return "json";
|
|
61
|
+
};
|
|
62
|
+
ACReporterJSON.prototype.generateReport = function (config, rulesets, storedReport) {
|
|
63
|
+
var outReport = JSON.parse(JSON.stringify(storedReport.engineReport));
|
|
64
|
+
outReport.summary = ACReporterJSON.generateReportSummary(config, rulesets, storedReport);
|
|
65
|
+
delete outReport.totalTime;
|
|
66
|
+
outReport.scanID = config.scanID;
|
|
67
|
+
outReport.toolID = config.toolID;
|
|
68
|
+
outReport.label = storedReport.label;
|
|
69
|
+
return {
|
|
70
|
+
reportPath: "".concat(storedReport.label.replace(/[:?&=]/g, "_"), ".json"),
|
|
71
|
+
report: JSON.stringify(outReport, null, 4)
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
ACReporterJSON.prototype.generateSummary = function (config, _rulesets, endReport, compressedReports) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
+
var storedScan, retVal, _i, compressedReports_1, compressedReport, storedScan_1, counts, key, startScan;
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
if (compressedReports && compressedReports.length > 0) {
|
|
79
|
+
storedScan = ReporterManager_1.ReporterManager.uncompressReport(compressedReports[0]);
|
|
80
|
+
retVal = {
|
|
81
|
+
counts: {
|
|
82
|
+
ignored: 0,
|
|
83
|
+
violation: 0,
|
|
84
|
+
recommendation: 0,
|
|
85
|
+
pass: 0,
|
|
86
|
+
potentialviolation: 0,
|
|
87
|
+
potentialrecommendation: 0,
|
|
88
|
+
manual: 0,
|
|
89
|
+
elements: 0,
|
|
90
|
+
elementsViolation: 0,
|
|
91
|
+
elementsViolationReview: 0
|
|
92
|
+
},
|
|
93
|
+
startReport: storedScan.engineReport.summary.startScan,
|
|
94
|
+
endReport: endReport,
|
|
95
|
+
toolID: config.toolID,
|
|
96
|
+
policies: config.policies,
|
|
97
|
+
reportLevels: config.reportLevels,
|
|
98
|
+
labels: config.label,
|
|
99
|
+
failLevels: config.failLevels,
|
|
100
|
+
scanID: config.scanID,
|
|
101
|
+
pageScanSummary: []
|
|
102
|
+
};
|
|
103
|
+
for (_i = 0, compressedReports_1 = compressedReports; _i < compressedReports_1.length; _i++) {
|
|
104
|
+
compressedReport = compressedReports_1[_i];
|
|
105
|
+
storedScan_1 = ReporterManager_1.ReporterManager.uncompressReport(compressedReport);
|
|
106
|
+
counts = storedScan_1.engineReport.summary.counts;
|
|
107
|
+
retVal.pageScanSummary.push({
|
|
108
|
+
label: storedScan_1.label,
|
|
109
|
+
counts: counts
|
|
110
|
+
});
|
|
111
|
+
for (key in counts) {
|
|
112
|
+
retVal.counts[key] += counts[key];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
startScan = new Date(storedScan.engineReport.summary.startScan);
|
|
116
|
+
return [2 /*return*/, {
|
|
117
|
+
summaryPath: "summary_".concat(startScan.toISOString(), ".json"),
|
|
118
|
+
summary: JSON.stringify(retVal, null, 4)
|
|
119
|
+
}];
|
|
120
|
+
}
|
|
121
|
+
return [2 /*return*/];
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
ACReporterJSON.generateReportSummary = function (config, rulesets, storedReport) {
|
|
126
|
+
var engineReport = storedReport.engineReport, startScan = storedReport.startScan, url = storedReport.url;
|
|
127
|
+
return {
|
|
128
|
+
counts: engineReport.summary.counts,
|
|
129
|
+
scanTime: engineReport.totalTime,
|
|
130
|
+
ruleArchive: config.ruleArchiveLabel,
|
|
131
|
+
policies: config.policies,
|
|
132
|
+
reportLevels: config.reportLevels,
|
|
133
|
+
startScan: startScan,
|
|
134
|
+
URL: url
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
return ACReporterJSON;
|
|
138
|
+
}());
|
|
139
|
+
exports.ACReporterJSON = ACReporterJSON;
|
|
140
|
+
//# sourceMappingURL=ACReporterJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterJSON.js","sourceRoot":"","sources":["../../../../src-ts/lib/common/report/ACReporterJSON.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIhF,qDAA+F;AAE/F;IAAA;IA4EA,CAAC;IA3EU,6BAAI,GAAX;QACI,OAAO,MAAM,CAAC;IAClB,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