accessibility-checker 4.0.0 → 4.0.1
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/bin/achecker.js +262 -213
- package/bin/achecker.js.map +1 -1
- package/index.js +63 -21
- package/index.js.map +1 -1
- package/lib/ACBrowserManager.js +203 -138
- package/lib/ACBrowserManager.js.map +1 -1
- package/lib/ACEngineManager.js +402 -395
- package/lib/ACEngineManager.js.map +1 -1
- package/lib/ACHelper.js +642 -581
- package/lib/ACHelper.js.map +1 -1
- package/lib/common/api-ext/Fetch.js +78 -58
- package/lib/common/api-ext/Fetch.js.map +1 -1
- package/lib/common/config/ACConfigManager.d.ts +1 -1
- package/lib/common/config/ACConfigManager.js +295 -285
- package/lib/common/config/ACConfigManager.js.map +1 -1
- package/lib/common/config/ACConstants.js +4 -38
- package/lib/common/config/ACConstants.js.map +1 -1
- package/lib/common/config/IConfig.d.ts +1 -1
- package/lib/common/engine/IChecker.d.ts +2 -2
- package/lib/common/engine/IEngine.d.ts +1 -1
- package/lib/common/engine/IGuideline.d.ts +1 -1
- package/lib/common/engine/IMapper.d.ts +1 -1
- package/lib/common/engine/IReport.d.ts +4 -4
- package/lib/common/engine/IRule.d.ts +4 -4
- package/lib/common/engine/IRuleset.d.ts +1 -1
- package/lib/common/report/ACReporterCSV.js +77 -42
- package/lib/common/report/ACReporterCSV.js.map +1 -1
- package/lib/common/report/ACReporterHTML.js +48 -15
- package/lib/common/report/ACReporterHTML.js.map +1 -1
- package/lib/common/report/ACReporterJSON.js +94 -59
- package/lib/common/report/ACReporterJSON.js.map +1 -1
- package/lib/common/report/ACReporterMetrics.js +108 -45
- package/lib/common/report/ACReporterMetrics.js.map +1 -1
- package/lib/common/report/ACReporterXLSX.js +300 -282
- package/lib/common/report/ACReporterXLSX.js.map +1 -1
- package/lib/common/report/BaselineManager.js +56 -82
- package/lib/common/report/BaselineManager.js.map +1 -1
- package/lib/common/report/ReporterManager.js +190 -125
- package/lib/common/report/ReporterManager.js.map +1 -1
- package/lib/common/report/genReport.js +2 -2
- package/package.json +4 -10
- package/cjs/bin/achecker.d.ts +0 -2
- package/cjs/bin/achecker.js +0 -306
- package/cjs/bin/achecker.js.map +0 -1
- package/cjs/index.d.ts +0 -319
- package/cjs/index.js +0 -402
- package/cjs/index.js.map +0 -1
- package/cjs/lib/ACBrowserManager.d.ts +0 -22
- package/cjs/lib/ACBrowserManager.js +0 -172
- package/cjs/lib/ACBrowserManager.js.map +0 -1
- package/cjs/lib/ACEngineManager.d.ts +0 -19
- package/cjs/lib/ACEngineManager.js +0 -457
- package/cjs/lib/ACEngineManager.js.map +0 -1
- package/cjs/lib/ACHelper.d.ts +0 -2
- package/cjs/lib/ACHelper.js +0 -678
- package/cjs/lib/ACHelper.js.map +0 -1
- package/cjs/lib/api/IChecker.d.ts +0 -28
- package/cjs/lib/api/IChecker.js +0 -11
- package/cjs/lib/api/IChecker.js.map +0 -1
- package/cjs/lib/api/IMapper.d.ts +0 -37
- package/cjs/lib/api/IMapper.js +0 -18
- package/cjs/lib/api/IMapper.js.map +0 -1
- package/cjs/lib/common/api-ext/Fetch.d.ts +0 -17
- package/cjs/lib/common/api-ext/Fetch.js +0 -95
- package/cjs/lib/common/api-ext/Fetch.js.map +0 -1
- package/cjs/lib/common/api-ext/IAbstractAPI.d.ts +0 -33
- package/cjs/lib/common/api-ext/IAbstractAPI.js +0 -18
- package/cjs/lib/common/api-ext/IAbstractAPI.js.map +0 -1
- package/cjs/lib/common/config/ACConfigManager.d.ts +0 -13
- package/cjs/lib/common/config/ACConfigManager.js +0 -483
- package/cjs/lib/common/config/ACConfigManager.js.map +0 -1
- package/cjs/lib/common/config/ACConstants.d.ts +0 -17
- package/cjs/lib/common/config/ACConstants.js +0 -111
- package/cjs/lib/common/config/ACConstants.js.map +0 -1
- package/cjs/lib/common/config/IArchive.d.ts +0 -37
- package/cjs/lib/common/config/IArchive.js +0 -18
- package/cjs/lib/common/config/IArchive.js.map +0 -1
- package/cjs/lib/common/config/IConfig.d.ts +0 -152
- package/cjs/lib/common/config/IConfig.js +0 -36
- package/cjs/lib/common/config/IConfig.js.map +0 -1
- package/cjs/lib/common/engine/IBounds.d.ts +0 -21
- package/cjs/lib/common/engine/IBounds.js +0 -18
- package/cjs/lib/common/engine/IBounds.js.map +0 -1
- package/cjs/lib/common/engine/IChecker.d.ts +0 -23
- package/cjs/lib/common/engine/IChecker.js +0 -18
- package/cjs/lib/common/engine/IChecker.js.map +0 -1
- package/cjs/lib/common/engine/IEngine.d.ts +0 -39
- package/cjs/lib/common/engine/IEngine.js +0 -18
- package/cjs/lib/common/engine/IEngine.js.map +0 -1
- package/cjs/lib/common/engine/IGuideline.d.ts +0 -53
- package/cjs/lib/common/engine/IGuideline.js +0 -37
- package/cjs/lib/common/engine/IGuideline.js.map +0 -1
- package/cjs/lib/common/engine/IMapper.d.ts +0 -32
- package/cjs/lib/common/engine/IMapper.js +0 -18
- package/cjs/lib/common/engine/IMapper.js.map +0 -1
- package/cjs/lib/common/engine/IReport.d.ts +0 -143
- package/cjs/lib/common/engine/IReport.js +0 -44
- package/cjs/lib/common/engine/IReport.js.map +0 -1
- package/cjs/lib/common/engine/IRule.d.ts +0 -100
- package/cjs/lib/common/engine/IRule.js +0 -87
- package/cjs/lib/common/engine/IRule.js.map +0 -1
- package/cjs/lib/common/engine/IRuleset.d.ts +0 -20
- package/cjs/lib/common/engine/IRuleset.js +0 -18
- package/cjs/lib/common/engine/IRuleset.js.map +0 -1
- package/cjs/lib/common/report/ACReporterCSV.d.ts +0 -28
- package/cjs/lib/common/report/ACReporterCSV.js +0 -75
- package/cjs/lib/common/report/ACReporterCSV.js.map +0 -1
- package/cjs/lib/common/report/ACReporterHTML.d.ts +0 -27
- package/cjs/lib/common/report/ACReporterHTML.js +0 -61
- package/cjs/lib/common/report/ACReporterHTML.js.map +0 -1
- package/cjs/lib/common/report/ACReporterJSON.d.ts +0 -36
- package/cjs/lib/common/report/ACReporterJSON.js +0 -109
- package/cjs/lib/common/report/ACReporterJSON.js.map +0 -1
- package/cjs/lib/common/report/ACReporterMetrics.d.ts +0 -78
- package/cjs/lib/common/report/ACReporterMetrics.js +0 -135
- package/cjs/lib/common/report/ACReporterMetrics.js.map +0 -1
- package/cjs/lib/common/report/ACReporterXLSX.d.ts +0 -38
- package/cjs/lib/common/report/ACReporterXLSX.js +0 -996
- package/cjs/lib/common/report/ACReporterXLSX.js.map +0 -1
- package/cjs/lib/common/report/BaselineManager.d.ts +0 -169
- package/cjs/lib/common/report/BaselineManager.js +0 -382
- package/cjs/lib/common/report/BaselineManager.js.map +0 -1
- package/cjs/lib/common/report/ReporterManager.d.ts +0 -79
- package/cjs/lib/common/report/ReporterManager.js +0 -469
- package/cjs/lib/common/report/ReporterManager.js.map +0 -1
- package/cjs/lib/common/report/genReport.d.ts +0 -1
- package/cjs/lib/common/report/genReport.js +0 -12
- package/cjs/lib/common/report/genReport.js.map +0 -1
- package/cjs/package.json +0 -3
- package/mjs/bin/achecker.d.ts +0 -2
- package/mjs/bin/achecker.js +0 -236
- package/mjs/bin/achecker.js.map +0 -1
- package/mjs/index.d.ts +0 -319
- package/mjs/index.js +0 -368
- package/mjs/index.js.map +0 -1
- package/mjs/lib/ACBrowserManager.d.ts +0 -22
- package/mjs/lib/ACBrowserManager.js +0 -121
- package/mjs/lib/ACBrowserManager.js.map +0 -1
- package/mjs/lib/ACEngineManager.d.ts +0 -19
- package/mjs/lib/ACEngineManager.js +0 -397
- package/mjs/lib/ACEngineManager.js.map +0 -1
- package/mjs/lib/ACHelper.d.ts +0 -2
- package/mjs/lib/ACHelper.js +0 -614
- package/mjs/lib/ACHelper.js.map +0 -1
- package/mjs/lib/api/IChecker.d.ts +0 -28
- package/mjs/lib/api/IChecker.js +0 -8
- package/mjs/lib/api/IChecker.js.map +0 -1
- package/mjs/lib/api/IMapper.d.ts +0 -37
- package/mjs/lib/api/IMapper.js +0 -17
- package/mjs/lib/api/IMapper.js.map +0 -1
- package/mjs/lib/common/api-ext/Fetch.d.ts +0 -17
- package/mjs/lib/common/api-ext/Fetch.js +0 -45
- package/mjs/lib/common/api-ext/Fetch.js.map +0 -1
- package/mjs/lib/common/api-ext/IAbstractAPI.d.ts +0 -33
- package/mjs/lib/common/api-ext/IAbstractAPI.js +0 -17
- package/mjs/lib/common/api-ext/IAbstractAPI.js.map +0 -1
- package/mjs/lib/common/config/ACConfigManager.d.ts +0 -13
- package/mjs/lib/common/config/ACConfigManager.js +0 -421
- package/mjs/lib/common/config/ACConfigManager.js.map +0 -1
- package/mjs/lib/common/config/ACConstants.d.ts +0 -17
- package/mjs/lib/common/config/ACConstants.js +0 -75
- package/mjs/lib/common/config/ACConstants.js.map +0 -1
- package/mjs/lib/common/config/IArchive.d.ts +0 -37
- package/mjs/lib/common/config/IArchive.js +0 -17
- package/mjs/lib/common/config/IArchive.js.map +0 -1
- package/mjs/lib/common/config/IConfig.d.ts +0 -152
- package/mjs/lib/common/config/IConfig.js +0 -33
- package/mjs/lib/common/config/IConfig.js.map +0 -1
- package/mjs/lib/common/engine/IBounds.d.ts +0 -21
- package/mjs/lib/common/engine/IBounds.js +0 -17
- package/mjs/lib/common/engine/IBounds.js.map +0 -1
- package/mjs/lib/common/engine/IChecker.d.ts +0 -23
- package/mjs/lib/common/engine/IChecker.js +0 -17
- package/mjs/lib/common/engine/IChecker.js.map +0 -1
- package/mjs/lib/common/engine/IEngine.d.ts +0 -39
- package/mjs/lib/common/engine/IEngine.js +0 -17
- package/mjs/lib/common/engine/IEngine.js.map +0 -1
- package/mjs/lib/common/engine/IGuideline.d.ts +0 -53
- package/mjs/lib/common/engine/IGuideline.js +0 -34
- package/mjs/lib/common/engine/IGuideline.js.map +0 -1
- package/mjs/lib/common/engine/IMapper.d.ts +0 -32
- package/mjs/lib/common/engine/IMapper.js +0 -17
- package/mjs/lib/common/engine/IMapper.js.map +0 -1
- package/mjs/lib/common/engine/IReport.d.ts +0 -143
- package/mjs/lib/common/engine/IReport.js +0 -36
- package/mjs/lib/common/engine/IReport.js.map +0 -1
- package/mjs/lib/common/engine/IRule.d.ts +0 -100
- package/mjs/lib/common/engine/IRule.js +0 -79
- package/mjs/lib/common/engine/IRule.js.map +0 -1
- package/mjs/lib/common/engine/IRuleset.d.ts +0 -20
- package/mjs/lib/common/engine/IRuleset.js +0 -17
- package/mjs/lib/common/engine/IRuleset.js.map +0 -1
- package/mjs/lib/common/report/ACReporterCSV.d.ts +0 -28
- package/mjs/lib/common/report/ACReporterCSV.js +0 -60
- package/mjs/lib/common/report/ACReporterCSV.js.map +0 -1
- package/mjs/lib/common/report/ACReporterHTML.d.ts +0 -27
- package/mjs/lib/common/report/ACReporterHTML.js +0 -46
- package/mjs/lib/common/report/ACReporterHTML.js.map +0 -1
- package/mjs/lib/common/report/ACReporterJSON.d.ts +0 -36
- package/mjs/lib/common/report/ACReporterJSON.js +0 -94
- package/mjs/lib/common/report/ACReporterJSON.js.map +0 -1
- package/mjs/lib/common/report/ACReporterMetrics.d.ts +0 -78
- package/mjs/lib/common/report/ACReporterMetrics.js +0 -122
- package/mjs/lib/common/report/ACReporterMetrics.js.map +0 -1
- package/mjs/lib/common/report/ACReporterXLSX.d.ts +0 -38
- package/mjs/lib/common/report/ACReporterXLSX.js +0 -948
- package/mjs/lib/common/report/ACReporterXLSX.js.map +0 -1
- package/mjs/lib/common/report/BaselineManager.d.ts +0 -169
- package/mjs/lib/common/report/BaselineManager.js +0 -348
- package/mjs/lib/common/report/BaselineManager.js.map +0 -1
- package/mjs/lib/common/report/ReporterManager.d.ts +0 -79
- package/mjs/lib/common/report/ReporterManager.js +0 -469
- package/mjs/lib/common/report/ReporterManager.js.map +0 -1
- package/mjs/lib/common/report/genReport.d.ts +0 -1
- package/mjs/lib/common/report/genReport.js +0 -9
- package/mjs/lib/common/report/genReport.js.map +0 -1
- package/mjs/package.json +0 -3
|
@@ -23,77 +23,111 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
24
|
});
|
|
25
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["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
|
+
};
|
|
26
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
54
|
exports.ACReporterJSON = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return "json";
|
|
55
|
+
var ReporterManager_js_1 = require("./ReporterManager.js");
|
|
56
|
+
var ACReporterJSON = /** @class */ (function () {
|
|
57
|
+
function ACReporterJSON() {
|
|
32
58
|
}
|
|
33
|
-
|
|
34
|
-
|
|
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));
|
|
35
64
|
outReport.summary = ACReporterJSON.generateReportSummary(config, rulesets, storedReport);
|
|
36
65
|
delete outReport.totalTime;
|
|
37
66
|
outReport.scanID = config.scanID;
|
|
38
67
|
outReport.toolID = config.toolID;
|
|
39
68
|
outReport.label = storedReport.label;
|
|
40
69
|
return {
|
|
41
|
-
reportPath:
|
|
70
|
+
reportPath: "".concat(storedReport.label.replace(/[:?&=]/g, "_"), ".json"),
|
|
42
71
|
report: JSON.stringify(outReport, null, 4)
|
|
43
72
|
};
|
|
44
|
-
}
|
|
45
|
-
generateSummary(config, _rulesets, endReport, compressedReports) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
counts
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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, reportFilename;
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
if (compressedReports && compressedReports.length > 0) {
|
|
79
|
+
storedScan = ReporterManager_js_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_js_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
|
+
}
|
|
81
114
|
}
|
|
115
|
+
startScan = new Date(storedScan.engineReport.summary.startScan);
|
|
116
|
+
reportFilename = "summary_".concat(startScan.toISOString().replace(/:/g, "-"), ".json");
|
|
117
|
+
if (config.outputFilenameTimestamp === false) {
|
|
118
|
+
reportFilename = "summary.json";
|
|
119
|
+
}
|
|
120
|
+
return [2 /*return*/, {
|
|
121
|
+
summaryPath: reportFilename,
|
|
122
|
+
summary: JSON.stringify(retVal, null, 4)
|
|
123
|
+
}];
|
|
82
124
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (config.outputFilenameTimestamp === false) {
|
|
86
|
-
reportFilename = `summary.json`;
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
summaryPath: reportFilename,
|
|
90
|
-
summary: JSON.stringify(retVal, null, 4)
|
|
91
|
-
};
|
|
92
|
-
}
|
|
125
|
+
return [2 /*return*/];
|
|
126
|
+
});
|
|
93
127
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
128
|
+
};
|
|
129
|
+
ACReporterJSON.generateReportSummary = function (config, rulesets, storedReport) {
|
|
130
|
+
var engineReport = storedReport.engineReport, startScan = storedReport.startScan, url = storedReport.url;
|
|
97
131
|
return {
|
|
98
132
|
counts: engineReport.summary.counts,
|
|
99
133
|
scanTime: engineReport.totalTime,
|
|
@@ -103,7 +137,8 @@ class ACReporterJSON {
|
|
|
103
137
|
startScan: startScan,
|
|
104
138
|
URL: url
|
|
105
139
|
};
|
|
106
|
-
}
|
|
107
|
-
|
|
140
|
+
};
|
|
141
|
+
return ACReporterJSON;
|
|
142
|
+
}());
|
|
108
143
|
exports.ACReporterJSON = ACReporterJSON;
|
|
109
144
|
//# sourceMappingURL=ACReporterJSON.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ACReporterJSON.js","sourceRoot":"","sources":["../../../../src-ts/lib/common/report/ACReporterJSON.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF
|
|
1
|
+
{"version":3,"file":"ACReporterJSON.js","sourceRoot":"","sources":["../../../../src-ts/lib/common/report/ACReporterJSON.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKhF,2DAAkG;AAElG;IAAA;IAgFA,CAAC;IA/EU,6BAAI,GAAX;QACI,OAAO,MAAM,CAAC;IAClB,CAAC;IACM,uCAAc,GAArB,UAAsB,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QAC/F,IAAI,SAAS,GAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QACvF,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzF,OAAQ,SAAiB,CAAC,SAAS,CAAC;QACpC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAErC,OAAO;YACH,UAAU,EAAE,UAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAC,GAAG,CAAC,UAAO;YAC/D,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7C,CAAC;IACN,CAAC;IAEY,wCAAe,GAA5B,UAA6B,MAAuB,EAAE,SAAsB,EAAE,SAAiB,EAAE,iBAAqC;;;;gBAClI,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAChD,UAAU,GAAG,oCAAe,C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UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBAChE,cAAc,GAAG,kBAAW,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAC,GAAG,CAAC,UAAO,CAAC;oBACjF,IAAI,MAAM,CAAC,uBAAuB,KAAK,KAAK,EAAE,CAAC;wBAC3C,cAAc,GAAG,cAAc,CAAC;oBACpC,CAAC;oBACD,sBAAO;4BACH,WAAW,EAAE,cAAc;4BAC3B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBAC3C,EAAC;gBACN,CAAC;;;;KACJ;IAEa,oCAAqB,GAAnC,UAAoC,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QACvG,IAAA,YAAY,GAAqB,YAAY,aAAjC,EAAE,SAAS,GAAU,YAAY,UAAtB,EAAE,GAAG,GAAK,YAAY,IAAjB,CAAkB;QAEpD,OAAO;YACH,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM;YACnC,QAAQ,EAAG,YAAoB,CAAC,SAAS;YACzC,WAAW,EAAE,MAAM,CAAC,gBAAgB;YACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,SAAS,EAAE,SAAS;YACpB,GAAG,EAAE,GAAG;SACX,CAAA;IACL,CAAC;IACL,qBAAC;AAAD,CAAC,AAhFD,IAgFC;AAhFY,wCAAc"}
|
|
@@ -23,9 +23,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
24
|
});
|
|
25
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["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
|
+
};
|
|
26
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
54
|
exports.ACReporterMetrics = void 0;
|
|
28
|
-
|
|
55
|
+
var Fetch_js_1 = require("../api-ext/Fetch.js");
|
|
29
56
|
/*******************************************************************************
|
|
30
57
|
* NAME: ACMetricsLogger.js
|
|
31
58
|
* DESCRIPTION: Common Metrics logger object which can be shared between tools
|
|
@@ -43,11 +70,8 @@ const Fetch_js_1 = require("../api-ext/Fetch.js");
|
|
|
43
70
|
*
|
|
44
71
|
* @memberOf this
|
|
45
72
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return "metrics";
|
|
49
|
-
}
|
|
50
|
-
constructor(toolName, policies) {
|
|
73
|
+
var ACReporterMetrics = /** @class */ (function () {
|
|
74
|
+
function ACReporterMetrics(toolName, policies) {
|
|
51
75
|
this.metricsURLV2 = "https://able.ibm.com/tools";
|
|
52
76
|
this.scanTimesV1 = [];
|
|
53
77
|
this.scanTimesV2 = {};
|
|
@@ -55,6 +79,9 @@ class ACReporterMetrics {
|
|
|
55
79
|
// Init all the local object variables
|
|
56
80
|
this.toolName = toolName;
|
|
57
81
|
}
|
|
82
|
+
ACReporterMetrics.prototype.name = function () {
|
|
83
|
+
return "metrics";
|
|
84
|
+
};
|
|
58
85
|
/**
|
|
59
86
|
* This function is responsible for profiling the testcases and adding the scan time to the global
|
|
60
87
|
* array which will be sent to the metrics server to log the number of scans that were performed.
|
|
@@ -71,15 +98,15 @@ class ACReporterMetrics {
|
|
|
71
98
|
*
|
|
72
99
|
* @memberOf this
|
|
73
100
|
*/
|
|
74
|
-
generateReport(config, rulesets, storedReport) {
|
|
101
|
+
ACReporterMetrics.prototype.generateReport = function (config, rulesets, storedReport) {
|
|
75
102
|
if (!config.label || !config.label.includes("IBMa-Node-TeSt")) {
|
|
76
103
|
// URI encode the profile text provided
|
|
77
|
-
|
|
104
|
+
var profile = encodeURIComponent(storedReport.scanProfile);
|
|
78
105
|
// Add the time it took for the testcase to run to the global array, indexed by the profile
|
|
79
106
|
this.scanTimesV2[profile] = this.scanTimesV2[profile] || [];
|
|
80
107
|
this.scanTimesV2[profile].push(storedReport.engineReport.summary.scanTime);
|
|
81
108
|
}
|
|
82
|
-
}
|
|
109
|
+
};
|
|
83
110
|
;
|
|
84
111
|
/**
|
|
85
112
|
* This function is responsible for uploading scan results to the metrics server:
|
|
@@ -91,45 +118,81 @@ class ACReporterMetrics {
|
|
|
91
118
|
*
|
|
92
119
|
* @memberOf this
|
|
93
120
|
*/
|
|
94
|
-
generateSummary(config, rulesets, endReport, summaryData) {
|
|
95
|
-
return __awaiter(this, void 0, void 0, function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
ACReporterMetrics.prototype.generateSummary = function (config, rulesets, endReport, summaryData) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var numProfiles_1, accountId, _a, _b, _c, _i, profile, _loop_1, this_1, e_1;
|
|
124
|
+
return __generator(this, function (_d) {
|
|
125
|
+
switch (_d.label) {
|
|
126
|
+
case 0:
|
|
127
|
+
_d.trys.push([0, 6, , 7]);
|
|
128
|
+
numProfiles_1 = 0;
|
|
129
|
+
accountId = "";
|
|
130
|
+
_a = this.scanTimesV2;
|
|
131
|
+
_b = [];
|
|
132
|
+
for (_c in _a)
|
|
133
|
+
_b.push(_c);
|
|
134
|
+
_i = 0;
|
|
135
|
+
_d.label = 1;
|
|
136
|
+
case 1:
|
|
137
|
+
if (!(_i < _b.length)) return [3 /*break*/, 5];
|
|
138
|
+
_c = _b[_i];
|
|
139
|
+
if (!(_c in _a)) return [3 /*break*/, 4];
|
|
140
|
+
profile = _c;
|
|
141
|
+
_loop_1 = function () {
|
|
142
|
+
var subScanTimes, qs;
|
|
143
|
+
return __generator(this, function (_e) {
|
|
144
|
+
switch (_e.label) {
|
|
145
|
+
case 0:
|
|
146
|
+
subScanTimes = this_1.scanTimesV2[profile].splice(0, 150);
|
|
147
|
+
// Increment the num Profile
|
|
148
|
+
++numProfiles_1;
|
|
149
|
+
qs = "?t=" + this_1.toolName + "&tag=" + profile + "&a=" + accountId + "&pol=" + this_1.policies + "&st=";
|
|
150
|
+
subScanTimes.forEach(function (t) {
|
|
151
|
+
qs += t;
|
|
152
|
+
qs += ",";
|
|
153
|
+
});
|
|
154
|
+
qs = qs.substr(0, qs.length - 1);
|
|
155
|
+
// Dispatch the call to the metrics server
|
|
156
|
+
// Istanbul is not able to capture the coverate of functions call in a callback therefore we need to skip
|
|
157
|
+
/* istanbul ignore next */
|
|
158
|
+
return [4 /*yield*/, (0, Fetch_js_1.fetch_get)(this_1.metricsURLV2 + "/api/pub/meter/v2" + qs).then(function () {
|
|
159
|
+
}).catch(function (_err) {
|
|
160
|
+
}).finally(function () {
|
|
161
|
+
// Decrement the numProfiles to identify that scan has finished
|
|
162
|
+
--numProfiles_1;
|
|
163
|
+
})];
|
|
164
|
+
case 1:
|
|
165
|
+
// Dispatch the call to the metrics server
|
|
166
|
+
// Istanbul is not able to capture the coverate of functions call in a callback therefore we need to skip
|
|
167
|
+
/* istanbul ignore next */
|
|
168
|
+
_e.sent();
|
|
169
|
+
return [2 /*return*/];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
this_1 = this;
|
|
174
|
+
_d.label = 2;
|
|
175
|
+
case 2:
|
|
176
|
+
if (!(this.scanTimesV2[profile].length > 0)) return [3 /*break*/, 4];
|
|
177
|
+
return [5 /*yield**/, _loop_1()];
|
|
178
|
+
case 3:
|
|
179
|
+
_d.sent();
|
|
180
|
+
return [3 /*break*/, 2];
|
|
181
|
+
case 4:
|
|
182
|
+
_i++;
|
|
183
|
+
return [3 /*break*/, 1];
|
|
184
|
+
case 5: return [3 /*break*/, 7];
|
|
185
|
+
case 6:
|
|
186
|
+
e_1 = _d.sent();
|
|
187
|
+
return [3 /*break*/, 7];
|
|
188
|
+
case 7: return [2 /*return*/];
|
|
125
189
|
}
|
|
126
|
-
}
|
|
127
|
-
catch (e) {
|
|
128
|
-
}
|
|
190
|
+
});
|
|
129
191
|
});
|
|
130
|
-
}
|
|
192
|
+
};
|
|
131
193
|
;
|
|
132
|
-
|
|
194
|
+
return ACReporterMetrics;
|
|
195
|
+
}());
|
|
133
196
|
exports.ACReporterMetrics = ACReporterMetrics;
|
|
134
197
|
;
|
|
135
198
|
//# sourceMappingURL=ACReporterMetrics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ACReporterMetrics.js","sourceRoot":"","sources":["../../../../src-ts/lib/common/report/ACReporterMetrics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;+EAc+E
|
|
1
|
+
{"version":3,"file":"ACReporterMetrics.js","sourceRoot":"","sources":["../../../../src-ts/lib/common/report/ACReporterMetrics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;+EAc+E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/E,gDAAgD;AAMhD;;;;iFAIiF;AAEjF;;;;;;;;;;;GAWG;AACH;IAYI,2BAAY,QAAgB,EAAE,QAAkB;QAPhD,iBAAY,GAAW,4BAA4B,CAAC;QAEpD,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAEP,EAAE,CAAC;QAGH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEnC,sCAAsC;QACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAhBM,gCAAI,GAAX;QACI,OAAO,SAAS,CAAC;IACrB,CAAC;IAgBD;;;;;;;;;;;;;;;OAeG;IACI,0CAAc,GAArB,UAAsB,M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