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.
- package/bin/achecker.js +213 -262
- package/bin/achecker.js.map +1 -1
- package/cjs/bin/achecker.d.ts +2 -0
- package/cjs/bin/achecker.js +306 -0
- package/cjs/bin/achecker.js.map +1 -0
- package/cjs/index.d.ts +319 -0
- package/cjs/index.js +402 -0
- package/cjs/index.js.map +1 -0
- package/cjs/lib/ACBrowserManager.d.ts +22 -0
- package/cjs/lib/ACBrowserManager.js +172 -0
- package/cjs/lib/ACBrowserManager.js.map +1 -0
- package/cjs/lib/ACEngineManager.d.ts +19 -0
- package/cjs/lib/ACEngineManager.js +457 -0
- package/cjs/lib/ACEngineManager.js.map +1 -0
- package/cjs/lib/ACHelper.d.ts +2 -0
- package/cjs/lib/ACHelper.js +678 -0
- package/cjs/lib/ACHelper.js.map +1 -0
- package/cjs/lib/api/IChecker.d.ts +28 -0
- package/cjs/lib/api/IChecker.js +11 -0
- package/cjs/lib/api/IChecker.js.map +1 -0
- package/cjs/lib/api/IMapper.d.ts +37 -0
- package/cjs/lib/api/IMapper.js +18 -0
- package/cjs/lib/api/IMapper.js.map +1 -0
- package/cjs/lib/common/api-ext/Fetch.d.ts +17 -0
- package/cjs/lib/common/api-ext/Fetch.js +95 -0
- package/cjs/lib/common/api-ext/Fetch.js.map +1 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.js +18 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
- package/cjs/lib/common/config/ACConfigManager.d.ts +13 -0
- package/cjs/lib/common/config/ACConfigManager.js +483 -0
- package/cjs/lib/common/config/ACConfigManager.js.map +1 -0
- package/cjs/lib/common/config/ACConstants.d.ts +17 -0
- package/cjs/lib/common/config/ACConstants.js +111 -0
- package/cjs/lib/common/config/ACConstants.js.map +1 -0
- package/cjs/lib/common/config/IArchive.d.ts +37 -0
- package/cjs/lib/common/config/IArchive.js +18 -0
- package/cjs/lib/common/config/IArchive.js.map +1 -0
- package/cjs/lib/common/config/IConfig.d.ts +152 -0
- package/cjs/lib/common/config/IConfig.js +36 -0
- package/cjs/lib/common/config/IConfig.js.map +1 -0
- package/cjs/lib/common/engine/IBounds.d.ts +21 -0
- package/cjs/lib/common/engine/IBounds.js +18 -0
- package/cjs/lib/common/engine/IBounds.js.map +1 -0
- package/cjs/lib/common/engine/IChecker.d.ts +23 -0
- package/cjs/lib/common/engine/IChecker.js +18 -0
- package/cjs/lib/common/engine/IChecker.js.map +1 -0
- package/cjs/lib/common/engine/IEngine.d.ts +39 -0
- package/cjs/lib/common/engine/IEngine.js +18 -0
- package/cjs/lib/common/engine/IEngine.js.map +1 -0
- package/cjs/lib/common/engine/IGuideline.d.ts +53 -0
- package/cjs/lib/common/engine/IGuideline.js +37 -0
- package/cjs/lib/common/engine/IGuideline.js.map +1 -0
- package/cjs/lib/common/engine/IMapper.d.ts +32 -0
- package/cjs/lib/common/engine/IMapper.js +18 -0
- package/cjs/lib/common/engine/IMapper.js.map +1 -0
- package/cjs/lib/common/engine/IReport.d.ts +143 -0
- package/cjs/lib/common/engine/IReport.js +44 -0
- package/cjs/lib/common/engine/IReport.js.map +1 -0
- package/cjs/lib/common/engine/IRule.d.ts +100 -0
- package/cjs/lib/common/engine/IRule.js +87 -0
- package/cjs/lib/common/engine/IRule.js.map +1 -0
- package/cjs/lib/common/engine/IRuleset.d.ts +20 -0
- package/cjs/lib/common/engine/IRuleset.js +18 -0
- package/cjs/lib/common/engine/IRuleset.js.map +1 -0
- package/cjs/lib/common/report/ACReporterCSV.d.ts +28 -0
- package/cjs/lib/common/report/ACReporterCSV.js +75 -0
- package/cjs/lib/common/report/ACReporterCSV.js.map +1 -0
- package/cjs/lib/common/report/ACReporterHTML.d.ts +27 -0
- package/cjs/lib/common/report/ACReporterHTML.js +61 -0
- package/cjs/lib/common/report/ACReporterHTML.js.map +1 -0
- package/cjs/lib/common/report/ACReporterJSON.d.ts +36 -0
- package/cjs/lib/common/report/ACReporterJSON.js +109 -0
- package/cjs/lib/common/report/ACReporterJSON.js.map +1 -0
- package/cjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
- package/cjs/lib/common/report/ACReporterMetrics.js +135 -0
- package/cjs/lib/common/report/ACReporterMetrics.js.map +1 -0
- package/cjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
- package/cjs/lib/common/report/ACReporterXLSX.js +996 -0
- package/cjs/lib/common/report/ACReporterXLSX.js.map +1 -0
- package/cjs/lib/common/report/BaselineManager.d.ts +169 -0
- package/cjs/lib/common/report/BaselineManager.js +382 -0
- package/cjs/lib/common/report/BaselineManager.js.map +1 -0
- package/cjs/lib/common/report/ReporterManager.d.ts +79 -0
- package/cjs/lib/common/report/ReporterManager.js +469 -0
- package/cjs/lib/common/report/ReporterManager.js.map +1 -0
- package/cjs/lib/common/report/genReport.d.ts +1 -0
- package/cjs/lib/common/report/genReport.js +12 -0
- package/cjs/lib/common/report/genReport.js.map +1 -0
- package/cjs/package.json +3 -0
- package/index.js +21 -63
- package/index.js.map +1 -1
- package/lib/ACBrowserManager.js +138 -203
- package/lib/ACBrowserManager.js.map +1 -1
- package/lib/ACEngineManager.js +395 -402
- package/lib/ACEngineManager.js.map +1 -1
- package/lib/ACHelper.js +581 -642
- package/lib/ACHelper.js.map +1 -1
- package/lib/common/api-ext/Fetch.js +58 -78
- package/lib/common/api-ext/Fetch.js.map +1 -1
- package/lib/common/config/ACConfigManager.js +271 -281
- package/lib/common/config/ACConfigManager.js.map +1 -1
- package/lib/common/config/ACConstants.js +38 -4
- package/lib/common/config/ACConstants.js.map +1 -1
- package/lib/common/config/IConfig.d.ts +1 -1
- package/lib/common/report/ACReporterCSV.js +42 -77
- package/lib/common/report/ACReporterCSV.js.map +1 -1
- package/lib/common/report/ACReporterHTML.js +15 -48
- package/lib/common/report/ACReporterHTML.js.map +1 -1
- package/lib/common/report/ACReporterJSON.js +59 -94
- package/lib/common/report/ACReporterJSON.js.map +1 -1
- package/lib/common/report/ACReporterMetrics.js +45 -108
- package/lib/common/report/ACReporterMetrics.js.map +1 -1
- package/lib/common/report/ACReporterXLSX.js +282 -300
- package/lib/common/report/ACReporterXLSX.js.map +1 -1
- package/lib/common/report/BaselineManager.js +82 -56
- package/lib/common/report/BaselineManager.js.map +1 -1
- package/lib/common/report/ReporterManager.js +125 -190
- package/lib/common/report/ReporterManager.js.map +1 -1
- package/lib/common/report/genReport.js +2 -2
- package/mjs/bin/achecker.d.ts +2 -0
- package/mjs/bin/achecker.js +236 -0
- package/mjs/bin/achecker.js.map +1 -0
- package/mjs/index.d.ts +319 -0
- package/mjs/index.js +368 -0
- package/mjs/index.js.map +1 -0
- package/mjs/lib/ACBrowserManager.d.ts +22 -0
- package/mjs/lib/ACBrowserManager.js +121 -0
- package/mjs/lib/ACBrowserManager.js.map +1 -0
- package/mjs/lib/ACEngineManager.d.ts +19 -0
- package/mjs/lib/ACEngineManager.js +397 -0
- package/mjs/lib/ACEngineManager.js.map +1 -0
- package/mjs/lib/ACHelper.d.ts +2 -0
- package/mjs/lib/ACHelper.js +614 -0
- package/mjs/lib/ACHelper.js.map +1 -0
- package/mjs/lib/api/IChecker.d.ts +28 -0
- package/mjs/lib/api/IChecker.js +8 -0
- package/mjs/lib/api/IChecker.js.map +1 -0
- package/mjs/lib/api/IMapper.d.ts +37 -0
- package/mjs/lib/api/IMapper.js +17 -0
- package/mjs/lib/api/IMapper.js.map +1 -0
- package/mjs/lib/common/api-ext/Fetch.d.ts +17 -0
- package/mjs/lib/common/api-ext/Fetch.js +45 -0
- package/mjs/lib/common/api-ext/Fetch.js.map +1 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.js +17 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
- package/mjs/lib/common/config/ACConfigManager.d.ts +13 -0
- package/mjs/lib/common/config/ACConfigManager.js +421 -0
- package/mjs/lib/common/config/ACConfigManager.js.map +1 -0
- package/mjs/lib/common/config/ACConstants.d.ts +17 -0
- package/mjs/lib/common/config/ACConstants.js +75 -0
- package/mjs/lib/common/config/ACConstants.js.map +1 -0
- package/mjs/lib/common/config/IArchive.d.ts +37 -0
- package/mjs/lib/common/config/IArchive.js +17 -0
- package/mjs/lib/common/config/IArchive.js.map +1 -0
- package/mjs/lib/common/config/IConfig.d.ts +152 -0
- package/mjs/lib/common/config/IConfig.js +33 -0
- package/mjs/lib/common/config/IConfig.js.map +1 -0
- package/mjs/lib/common/engine/IBounds.d.ts +21 -0
- package/mjs/lib/common/engine/IBounds.js +17 -0
- package/mjs/lib/common/engine/IBounds.js.map +1 -0
- package/mjs/lib/common/engine/IChecker.d.ts +23 -0
- package/mjs/lib/common/engine/IChecker.js +17 -0
- package/mjs/lib/common/engine/IChecker.js.map +1 -0
- package/mjs/lib/common/engine/IEngine.d.ts +39 -0
- package/mjs/lib/common/engine/IEngine.js +17 -0
- package/mjs/lib/common/engine/IEngine.js.map +1 -0
- package/mjs/lib/common/engine/IGuideline.d.ts +53 -0
- package/mjs/lib/common/engine/IGuideline.js +34 -0
- package/mjs/lib/common/engine/IGuideline.js.map +1 -0
- package/mjs/lib/common/engine/IMapper.d.ts +32 -0
- package/mjs/lib/common/engine/IMapper.js +17 -0
- package/mjs/lib/common/engine/IMapper.js.map +1 -0
- package/mjs/lib/common/engine/IReport.d.ts +143 -0
- package/mjs/lib/common/engine/IReport.js +36 -0
- package/mjs/lib/common/engine/IReport.js.map +1 -0
- package/mjs/lib/common/engine/IRule.d.ts +100 -0
- package/mjs/lib/common/engine/IRule.js +79 -0
- package/mjs/lib/common/engine/IRule.js.map +1 -0
- package/mjs/lib/common/engine/IRuleset.d.ts +20 -0
- package/mjs/lib/common/engine/IRuleset.js +17 -0
- package/mjs/lib/common/engine/IRuleset.js.map +1 -0
- package/mjs/lib/common/report/ACReporterCSV.d.ts +28 -0
- package/mjs/lib/common/report/ACReporterCSV.js +60 -0
- package/mjs/lib/common/report/ACReporterCSV.js.map +1 -0
- package/mjs/lib/common/report/ACReporterHTML.d.ts +27 -0
- package/mjs/lib/common/report/ACReporterHTML.js +46 -0
- package/mjs/lib/common/report/ACReporterHTML.js.map +1 -0
- package/mjs/lib/common/report/ACReporterJSON.d.ts +36 -0
- package/mjs/lib/common/report/ACReporterJSON.js +94 -0
- package/mjs/lib/common/report/ACReporterJSON.js.map +1 -0
- package/mjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
- package/mjs/lib/common/report/ACReporterMetrics.js +122 -0
- package/mjs/lib/common/report/ACReporterMetrics.js.map +1 -0
- package/mjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
- package/mjs/lib/common/report/ACReporterXLSX.js +948 -0
- package/mjs/lib/common/report/ACReporterXLSX.js.map +1 -0
- package/mjs/lib/common/report/BaselineManager.d.ts +169 -0
- package/mjs/lib/common/report/BaselineManager.js +348 -0
- package/mjs/lib/common/report/BaselineManager.js.map +1 -0
- package/mjs/lib/common/report/ReporterManager.d.ts +79 -0
- package/mjs/lib/common/report/ReporterManager.js +469 -0
- package/mjs/lib/common/report/ReporterManager.js.map +1 -0
- package/mjs/lib/common/report/genReport.d.ts +1 -0
- package/mjs/lib/common/report/genReport.js +9 -0
- package/mjs/lib/common/report/genReport.js.map +1 -0
- package/mjs/package.json +3 -0
- package/package.json +10 -4
|
@@ -14,6 +14,39 @@
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*****************************************************************************/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
+
var ownKeys = function(o) {
|
|
35
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
+
var ar = [];
|
|
37
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
return ownKeys(o);
|
|
41
|
+
};
|
|
42
|
+
return function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
+
__setModuleDefault(result, mod);
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
17
50
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
51
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
52
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23,43 +56,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
56
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
57
|
});
|
|
25
58
|
};
|
|
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
|
-
};
|
|
53
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
60
|
exports.ACReporterXLSX = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
const IConfig_js_1 = require("../config/IConfig.js");
|
|
62
|
+
const IGuideline_js_1 = require("../engine/IGuideline.js");
|
|
63
|
+
const IRule_js_1 = require("../engine/IRule.js");
|
|
64
|
+
const ReporterManager_js_1 = require("./ReporterManager.js");
|
|
65
|
+
const ExcelJS = __importStar(require("exceljs"));
|
|
60
66
|
function dropDupes(arr) {
|
|
61
|
-
|
|
62
|
-
return arr.filter(
|
|
67
|
+
let dupes = {};
|
|
68
|
+
return arr.filter(item => {
|
|
63
69
|
if (item.toString() in dupes) {
|
|
64
70
|
return false;
|
|
65
71
|
}
|
|
@@ -68,111 +74,99 @@ function dropDupes(arr) {
|
|
|
68
74
|
}
|
|
69
75
|
});
|
|
70
76
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
ACReporterXLSX.prototype.name = function () {
|
|
77
|
+
class ACReporterXLSX {
|
|
78
|
+
name() {
|
|
75
79
|
return "xlsx";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
policyInfo[rule.id] = policyInfo[rule.id] || {
|
|
94
|
-
tkLevels: [],
|
|
95
|
-
cps: []
|
|
96
|
-
};
|
|
97
|
-
policyInfo[rule.id].tkLevels.push(rule.toolkitLevel);
|
|
98
|
-
policyInfo[rule.id].cps.push(cp);
|
|
99
|
-
}
|
|
80
|
+
}
|
|
81
|
+
generateReport(_reportData) {
|
|
82
|
+
}
|
|
83
|
+
generateSummary(config, rulesets, endReport, summaryData) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
let storedReport = ReporterManager_js_1.ReporterManager.uncompressReport(summaryData[0]);
|
|
86
|
+
let cfgRulesets = rulesets.filter(rs => config.policies.includes(rs.id));
|
|
87
|
+
let policyInfo = {};
|
|
88
|
+
for (const rs of cfgRulesets) {
|
|
89
|
+
for (const cp of rs.checkpoints) {
|
|
90
|
+
for (const rule of cp.rules) {
|
|
91
|
+
policyInfo[rule.id] = policyInfo[rule.id] || {
|
|
92
|
+
tkLevels: [],
|
|
93
|
+
cps: []
|
|
94
|
+
};
|
|
95
|
+
policyInfo[rule.id].tkLevels.push(rule.toolkitLevel);
|
|
96
|
+
policyInfo[rule.id].cps.push(cp);
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}];
|
|
128
|
-
});
|
|
99
|
+
}
|
|
100
|
+
for (const ruleId in policyInfo) {
|
|
101
|
+
policyInfo[ruleId].tkLevels = dropDupes(policyInfo[ruleId].tkLevels);
|
|
102
|
+
policyInfo[ruleId].tkLevels.sort();
|
|
103
|
+
}
|
|
104
|
+
// const buffer: any = await workbook.xlsx.writeBuffer();
|
|
105
|
+
let startScan = new Date(storedReport.engineReport.summary.startScan);
|
|
106
|
+
let reportFilename = `results_${startScan.toISOString().replace(/:/g, "-")}.xlsx`;
|
|
107
|
+
if (config.outputFilenameTimestamp === false) {
|
|
108
|
+
reportFilename = `results.xlsx`;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
summaryPath: reportFilename,
|
|
112
|
+
summary: (filename) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ filename, useStyles: true });
|
|
115
|
+
// const workbook = new ExcelJS.Workbook({ useStyles: true });
|
|
116
|
+
ACReporterXLSX.createOverviewSheet(config, summaryData, workbook);
|
|
117
|
+
ACReporterXLSX.createScanSummarySheet(config, summaryData, workbook);
|
|
118
|
+
ACReporterXLSX.createIssueSummarySheet(config, policyInfo, summaryData, workbook);
|
|
119
|
+
ACReporterXLSX.createIssuesSheet(config, policyInfo, summaryData, workbook);
|
|
120
|
+
ACReporterXLSX.createDefinitionsSheet(workbook);
|
|
121
|
+
workbook.commit();
|
|
122
|
+
})
|
|
123
|
+
};
|
|
129
124
|
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
125
|
+
}
|
|
126
|
+
static createOverviewSheet(config, compressedScans, workbook) {
|
|
127
|
+
let violations = 0;
|
|
128
|
+
let needsReviews = 0;
|
|
129
|
+
let recommendations = 0;
|
|
130
|
+
let archived = 0;
|
|
131
|
+
let totalIssues = 0;
|
|
132
|
+
let startScan = 0;
|
|
138
133
|
// BIG QUESTION: is report
|
|
139
134
|
// 1. for current scan (from menu)
|
|
140
135
|
// 2. all stored scans (from menu)
|
|
141
136
|
// 3. selected stored scans (from scan manager)
|
|
142
|
-
for (
|
|
143
|
-
|
|
144
|
-
var storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
|
|
137
|
+
for (const compressedScan of compressedScans) {
|
|
138
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
|
|
145
139
|
if (startScan === 0)
|
|
146
140
|
startScan = storedScan.engineReport.summary.startScan;
|
|
147
|
-
|
|
141
|
+
const counts = storedScan.engineReport.summary.counts;
|
|
148
142
|
violations += counts.violation;
|
|
149
143
|
needsReviews += counts.potentialviolation + counts.manual;
|
|
150
144
|
recommendations += counts.recommendation + counts.potentialrecommendation;
|
|
151
145
|
archived += counts.ignored;
|
|
152
146
|
}
|
|
153
147
|
totalIssues = violations + needsReviews + recommendations + archived;
|
|
154
|
-
|
|
148
|
+
const worksheet = workbook.addWorksheet("Overview");
|
|
155
149
|
// Report Title
|
|
156
150
|
worksheet.mergeCells('A1', "E1");
|
|
157
|
-
|
|
151
|
+
const titleRow = worksheet.getRow(1);
|
|
158
152
|
titleRow.height = 27;
|
|
159
|
-
|
|
153
|
+
const cellA1 = worksheet.getCell('A1');
|
|
160
154
|
cellA1.value = "Accessibility Scan Report";
|
|
161
155
|
cellA1.alignment = { vertical: "middle", horizontal: "left" };
|
|
162
156
|
cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
163
157
|
cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
164
158
|
// what are column widths - can't get it till you set it
|
|
165
|
-
|
|
159
|
+
const colWidthData = [
|
|
166
160
|
{ col: 'A', width: 15.1 },
|
|
167
161
|
{ col: 'B', width: 15.9 },
|
|
168
162
|
{ col: 'C', width: 16.23 },
|
|
169
163
|
{ col: 'D', width: 19.4 },
|
|
170
164
|
];
|
|
171
|
-
for (
|
|
165
|
+
for (let i = 0; i < 4; i++) {
|
|
172
166
|
worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
|
|
173
167
|
}
|
|
174
168
|
// note except for Report Date this is the same for all scans
|
|
175
|
-
|
|
169
|
+
const rowData = [
|
|
176
170
|
{ key1: 'Tool:', key2: 'IBM Equal Access Accessibility Checker' },
|
|
177
171
|
// {key1: 'Version:', key2: "chrome.runtime.getManifest().version"},
|
|
178
172
|
{ key1: 'Version:', key2: config.toolID },
|
|
@@ -184,9 +178,9 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
184
178
|
{ key1: 'Scans:', key2: "" + compressedScans.length }, // *** NEED TO FIX FOR selected
|
|
185
179
|
// { key1: 'Pages:', key2: "" }
|
|
186
180
|
];
|
|
187
|
-
for (
|
|
188
|
-
worksheet.mergeCells(
|
|
189
|
-
|
|
181
|
+
for (let idx = 0; idx < rowData.length; ++idx) {
|
|
182
|
+
worksheet.mergeCells(`B${idx + 2}`, `E${idx + 2}`);
|
|
183
|
+
let i = idx + 2;
|
|
190
184
|
worksheet.getRow(i).height = 12; // results in a row height of 16
|
|
191
185
|
worksheet.getRow(i).getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
192
186
|
worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
@@ -201,27 +195,27 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
201
195
|
}
|
|
202
196
|
// Summary Title
|
|
203
197
|
worksheet.mergeCells('A11', "E11");
|
|
204
|
-
|
|
198
|
+
const summaryRow = worksheet.getRow(11);
|
|
205
199
|
summaryRow.height = 27;
|
|
206
|
-
|
|
200
|
+
const cellA11 = worksheet.getCell('A11');
|
|
207
201
|
cellA11.value = "Summary";
|
|
208
202
|
cellA11.alignment = { vertical: "middle", horizontal: "left" };
|
|
209
203
|
cellA11.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
210
204
|
cellA11.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
211
205
|
// Scans info Headers
|
|
212
206
|
worksheet.getRow(12).height = 16; // actual height is
|
|
213
|
-
|
|
207
|
+
const cellA12 = worksheet.getCell('A12');
|
|
214
208
|
cellA12.value = "Total issues";
|
|
215
|
-
|
|
209
|
+
const cellB12 = worksheet.getCell('B12');
|
|
216
210
|
cellB12.value = "Violations";
|
|
217
|
-
|
|
211
|
+
const cellC12 = worksheet.getCell('C12');
|
|
218
212
|
cellC12.value = "Needs review";
|
|
219
|
-
|
|
213
|
+
const cellD12 = worksheet.getCell('D12');
|
|
220
214
|
cellD12.value = "Recommendations";
|
|
221
|
-
|
|
215
|
+
const cellE12 = worksheet.getCell('E12');
|
|
222
216
|
cellE12.value = "Archived";
|
|
223
|
-
|
|
224
|
-
for (
|
|
217
|
+
const cellObjects1 = [cellA12, cellB12, cellC12, cellD12, cellE12];
|
|
218
|
+
for (let i = 0; i < cellObjects1.length; i++) {
|
|
225
219
|
cellObjects1[i].alignment = { vertical: "middle", horizontal: "center" };
|
|
226
220
|
if (i == 1 || i == 2 || i == 3 || i === 4) {
|
|
227
221
|
cellObjects1[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
@@ -243,18 +237,18 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
243
237
|
cellD12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
|
|
244
238
|
// Scans info Values
|
|
245
239
|
worksheet.getRow(13).height = 27; // actual height is
|
|
246
|
-
|
|
240
|
+
const cellA13 = worksheet.getCell('A13');
|
|
247
241
|
cellA13.value = totalIssues;
|
|
248
|
-
|
|
242
|
+
const cellB13 = worksheet.getCell('B13');
|
|
249
243
|
cellB13.value = violations;
|
|
250
|
-
|
|
244
|
+
const cellC13 = worksheet.getCell('C13');
|
|
251
245
|
cellC13.value = needsReviews;
|
|
252
|
-
|
|
246
|
+
const cellD13 = worksheet.getCell('D13');
|
|
253
247
|
cellD13.value = recommendations;
|
|
254
|
-
|
|
248
|
+
const cellE13 = worksheet.getCell('E13');
|
|
255
249
|
cellE13.value = archived;
|
|
256
|
-
|
|
257
|
-
for (
|
|
250
|
+
const cellObjects2 = [cellA13, cellB13, cellC13, cellD13, cellE13];
|
|
251
|
+
for (let i = 0; i < cellObjects2.length; i++) {
|
|
258
252
|
cellObjects2[i].alignment = { vertical: "middle", horizontal: "center" };
|
|
259
253
|
cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
260
254
|
// cellObjects2[i].fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
|
|
@@ -265,12 +259,12 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
265
259
|
right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
|
|
266
260
|
};
|
|
267
261
|
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
262
|
+
}
|
|
263
|
+
static createScanSummarySheet(config, compressedScans, workbook) {
|
|
264
|
+
const worksheet = workbook.addWorksheet("Scan summary");
|
|
271
265
|
// Scans info Headers
|
|
272
266
|
worksheet.getRow(1).height = 39; // actual height is 52
|
|
273
|
-
|
|
267
|
+
const colWidthData = [
|
|
274
268
|
{ col: 'A', width: 27.0 },
|
|
275
269
|
{ col: 'B', width: 46.0 },
|
|
276
270
|
{ col: 'C', width: 20.17 },
|
|
@@ -281,17 +275,17 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
281
275
|
{ col: 'H', width: 17.17 },
|
|
282
276
|
{ col: 'I', width: 17.17 },
|
|
283
277
|
];
|
|
284
|
-
for (
|
|
278
|
+
for (let i = 0; i < 9; i++) {
|
|
285
279
|
worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
|
|
286
280
|
}
|
|
287
|
-
|
|
281
|
+
const cellA1 = worksheet.getCell('A1');
|
|
288
282
|
cellA1.value = "Page title";
|
|
289
|
-
|
|
283
|
+
const cellB1 = worksheet.getCell('B1');
|
|
290
284
|
cellB1.value = "Page url";
|
|
291
|
-
|
|
285
|
+
const cellC1 = worksheet.getCell('C1');
|
|
292
286
|
cellC1.value = "Scan label";
|
|
293
|
-
|
|
294
|
-
for (
|
|
287
|
+
const cellObjects1 = [cellA1, cellB1, cellC1];
|
|
288
|
+
for (let i = 0; i < cellObjects1.length; i++) {
|
|
295
289
|
cellObjects1[i].alignment = { vertical: "middle", horizontal: "left" };
|
|
296
290
|
cellObjects1[i].font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 12 };
|
|
297
291
|
cellObjects1[i].fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
@@ -302,20 +296,20 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
302
296
|
right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
|
|
303
297
|
};
|
|
304
298
|
}
|
|
305
|
-
|
|
299
|
+
const cellD1 = worksheet.getCell('D1');
|
|
306
300
|
cellD1.value = "Violations";
|
|
307
|
-
|
|
301
|
+
const cellE1 = worksheet.getCell('E1');
|
|
308
302
|
cellE1.value = "Needs review";
|
|
309
|
-
|
|
303
|
+
const cellF1 = worksheet.getCell('F1');
|
|
310
304
|
cellF1.value = "Recommendations";
|
|
311
|
-
|
|
305
|
+
const cellG1 = worksheet.getCell('G1');
|
|
312
306
|
cellG1.value = "Archived";
|
|
313
|
-
|
|
307
|
+
const cellH1 = worksheet.getCell('H1');
|
|
314
308
|
cellH1.value = "% elements without violations";
|
|
315
|
-
|
|
309
|
+
const cellI1 = worksheet.getCell('I1');
|
|
316
310
|
cellI1.value = "% elements without violations or items to review";
|
|
317
|
-
|
|
318
|
-
for (
|
|
311
|
+
const cellObjects2 = [cellD1, cellE1, cellF1, cellG1, cellH1, cellI1];
|
|
312
|
+
for (let i = 0; i < cellObjects2.length; i++) {
|
|
319
313
|
cellObjects2[i].alignment = { vertical: "middle", horizontal: "center", wrapText: true };
|
|
320
314
|
if (i == 0 || i == 1 || i == 2 || i == 3) {
|
|
321
315
|
cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
@@ -337,11 +331,10 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
337
331
|
cellG1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFFFFFFF' } };
|
|
338
332
|
cellH1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
|
|
339
333
|
cellI1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
|
|
340
|
-
for (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
var row = worksheet.addRow([
|
|
334
|
+
for (const compressedScan of compressedScans) {
|
|
335
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
|
|
336
|
+
let counts = storedScan.engineReport.summary.counts;
|
|
337
|
+
let row = worksheet.addRow([
|
|
345
338
|
storedScan.pageTitle,
|
|
346
339
|
storedScan.engineReport.summary.URL,
|
|
347
340
|
storedScan.label,
|
|
@@ -353,11 +346,11 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
353
346
|
(100 * (counts.elements - counts.elementsViolationReview) / counts.elements).toFixed(0),
|
|
354
347
|
]);
|
|
355
348
|
row.height = 37; // actual height is
|
|
356
|
-
for (
|
|
349
|
+
for (let i = 1; i < 4; i++) {
|
|
357
350
|
row.getCell(i).alignment = { vertical: "middle", horizontal: "left", wrapText: true };
|
|
358
351
|
row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: 12 };
|
|
359
352
|
}
|
|
360
|
-
for (
|
|
353
|
+
for (let i = 4; i < 10; i++) {
|
|
361
354
|
row.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
|
|
362
355
|
row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: 12 };
|
|
363
356
|
// row.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
|
|
@@ -371,13 +364,13 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
371
364
|
row.commit();
|
|
372
365
|
}
|
|
373
366
|
worksheet.commit();
|
|
374
|
-
}
|
|
375
|
-
|
|
367
|
+
}
|
|
368
|
+
static buildIssueSummaryLevel(worksheet, fillColor, title, levelCount, levelrowValues) {
|
|
376
369
|
// Level 1 Violation title
|
|
377
|
-
|
|
370
|
+
const level1ViolationRow = worksheet.addRow(["", 0]);
|
|
378
371
|
level1ViolationRow.height = 18; // target is 21
|
|
379
|
-
|
|
380
|
-
cellA6.value =
|
|
372
|
+
const cellA6 = level1ViolationRow.getCell(1);
|
|
373
|
+
cellA6.value = ` ${title}`;
|
|
381
374
|
cellA6.alignment = { vertical: "middle", horizontal: "left" };
|
|
382
375
|
cellA6.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
383
376
|
cellA6.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: fillColor } };
|
|
@@ -387,7 +380,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
387
380
|
bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
|
|
388
381
|
// right: {style:'thin', color: {argb: 'FFA6A6A6'}}
|
|
389
382
|
};
|
|
390
|
-
|
|
383
|
+
const cellB6 = level1ViolationRow.getCell(2);
|
|
391
384
|
cellB6.value = levelCount; // total level violations
|
|
392
385
|
cellB6.alignment = { vertical: "middle", horizontal: "right" };
|
|
393
386
|
cellB6.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
@@ -400,19 +393,18 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
400
393
|
};
|
|
401
394
|
// Level 1 Violation Rows
|
|
402
395
|
// build rows
|
|
403
|
-
|
|
396
|
+
let rowArray = [];
|
|
404
397
|
// let row:any =[];
|
|
405
|
-
for (
|
|
406
|
-
|
|
398
|
+
for (const property in levelrowValues) {
|
|
399
|
+
let row = [" " + `${property}`, parseInt(`${levelrowValues[property]}`)
|
|
407
400
|
];
|
|
408
401
|
rowArray.push(row);
|
|
409
402
|
}
|
|
410
403
|
// sort array according to count
|
|
411
|
-
rowArray.sort(
|
|
404
|
+
rowArray.sort((a, b) => (a[1] < b[1]) ? 1 : -1);
|
|
412
405
|
// add array of rows
|
|
413
|
-
for (
|
|
414
|
-
|
|
415
|
-
var row = worksheet.addRow(rowInfo);
|
|
406
|
+
for (const rowInfo of rowArray) {
|
|
407
|
+
const row = worksheet.addRow(rowInfo);
|
|
416
408
|
row.height = 14;
|
|
417
409
|
row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
|
|
418
410
|
row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
|
|
@@ -433,19 +425,19 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
433
425
|
};
|
|
434
426
|
row.commit();
|
|
435
427
|
}
|
|
436
|
-
}
|
|
437
|
-
|
|
428
|
+
}
|
|
429
|
+
static buildIssueSummaryTKLevel(worksheet, title, levelCounts, levelVrowValues, levelNRrowValues, levelRrowValues, levelArowValues) {
|
|
438
430
|
/////////////////////////////
|
|
439
431
|
// build Level title
|
|
440
432
|
/////////////////////////////
|
|
441
|
-
|
|
433
|
+
const level1Row = worksheet.addRow(["", 0]);
|
|
442
434
|
level1Row.height = 27; // actual is 36
|
|
443
|
-
|
|
435
|
+
const cellA5 = level1Row.getCell(1);
|
|
444
436
|
cellA5.value = title;
|
|
445
437
|
cellA5.alignment = { vertical: "middle", horizontal: "left" };
|
|
446
438
|
cellA5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
447
439
|
cellA5.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
448
|
-
|
|
440
|
+
const cellB5 = level1Row.getCell(2);
|
|
449
441
|
cellB5.value = levelCounts[0]; // total Level 1 issues
|
|
450
442
|
cellB5.alignment = { vertical: "middle", horizontal: "right" };
|
|
451
443
|
cellB5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
@@ -456,16 +448,16 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
456
448
|
if (levelCounts[4] > 0) {
|
|
457
449
|
ACReporterXLSX.buildIssueSummaryLevel(worksheet, "FFCCCCCC", "Archived", levelCounts[4], levelArowValues);
|
|
458
450
|
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
for (
|
|
467
|
-
|
|
468
|
-
|
|
451
|
+
}
|
|
452
|
+
static createIssueSummarySheet(config, policyInfo, compressedScans, workbook) {
|
|
453
|
+
let violations = 0;
|
|
454
|
+
let needsReviews = 0;
|
|
455
|
+
let recommendations = 0;
|
|
456
|
+
let archive = 0;
|
|
457
|
+
let totalIssues = 0;
|
|
458
|
+
for (let i = 0; i < compressedScans.length; i++) {
|
|
459
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScans[i]);
|
|
460
|
+
let counts = storedScan.engineReport.summary.counts;
|
|
469
461
|
violations += counts.violation;
|
|
470
462
|
needsReviews += counts.potentialviolation + counts.manual;
|
|
471
463
|
recommendations += counts.recommendation + counts.potentialrecommendation;
|
|
@@ -473,39 +465,37 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
473
465
|
}
|
|
474
466
|
totalIssues = violations + needsReviews + recommendations;
|
|
475
467
|
// counts
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
for (
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
for (var _a = 0, _b = scan.engineReport.results; _a < _b.length; _a++) {
|
|
500
|
-
var issue = _b[_a];
|
|
468
|
+
let level1Counts = [0, 0, 0, 0, 0]; // level 1 total issues, violations, needs reviews, recommendations
|
|
469
|
+
let level2Counts = [0, 0, 0, 0, 0];
|
|
470
|
+
let level3Counts = [0, 0, 0, 0, 0];
|
|
471
|
+
let level4Counts = [0, 0, 0, 0, 0];
|
|
472
|
+
let level1V = [];
|
|
473
|
+
let level2V = [];
|
|
474
|
+
let level3V = [];
|
|
475
|
+
let level4V = [];
|
|
476
|
+
let level1NR = [];
|
|
477
|
+
let level2NR = [];
|
|
478
|
+
let level3NR = [];
|
|
479
|
+
let level4NR = [];
|
|
480
|
+
let level1R = [];
|
|
481
|
+
let level2R = [];
|
|
482
|
+
let level3R = [];
|
|
483
|
+
let level4R = [];
|
|
484
|
+
let level1A = [];
|
|
485
|
+
let level2A = [];
|
|
486
|
+
let level3A = [];
|
|
487
|
+
let level4A = [];
|
|
488
|
+
for (const compressedScan of compressedScans) {
|
|
489
|
+
let scan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
|
|
490
|
+
for (const issue of scan.engineReport.results) {
|
|
501
491
|
if (!(issue.ruleId in policyInfo)) {
|
|
502
492
|
policyInfo[issue.ruleId] = {
|
|
503
493
|
tkLevels: [],
|
|
504
494
|
cps: []
|
|
505
495
|
};
|
|
506
496
|
}
|
|
507
|
-
|
|
508
|
-
|
|
497
|
+
let levelCounts, levelV, levelNR, levelR, levelA;
|
|
498
|
+
const issuePolicyInfo = policyInfo[issue.ruleId];
|
|
509
499
|
if (issuePolicyInfo.tkLevels.includes(IGuideline_js_1.eToolkitLevel.LEVEL_ONE)) {
|
|
510
500
|
levelCounts = level1Counts;
|
|
511
501
|
levelV = level1V;
|
|
@@ -556,38 +546,38 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
556
546
|
}
|
|
557
547
|
}
|
|
558
548
|
// @ts-ignore
|
|
559
|
-
|
|
549
|
+
let level1VrowValues = this.countDuplicatesInArray(level1V); // note this returns an object
|
|
560
550
|
// @ts-ignore
|
|
561
|
-
|
|
551
|
+
let level1NRrowValues = this.countDuplicatesInArray(level1NR);
|
|
562
552
|
// @ts-ignore
|
|
563
|
-
|
|
553
|
+
let level1RrowValues = this.countDuplicatesInArray(level1R);
|
|
564
554
|
// @ts-ignore
|
|
565
|
-
|
|
555
|
+
let level1ArowValues = this.countDuplicatesInArray(level1A);
|
|
566
556
|
// @ts-ignore
|
|
567
|
-
|
|
557
|
+
let level2VrowValues = this.countDuplicatesInArray(level2V); // note this returns an object
|
|
568
558
|
// @ts-ignore
|
|
569
|
-
|
|
559
|
+
let level2NRrowValues = this.countDuplicatesInArray(level2NR);
|
|
570
560
|
// @ts-ignore
|
|
571
|
-
|
|
561
|
+
let level2RrowValues = this.countDuplicatesInArray(level2R);
|
|
572
562
|
// @ts-ignore
|
|
573
|
-
|
|
563
|
+
let level2ArowValues = this.countDuplicatesInArray(level2A);
|
|
574
564
|
// @ts-ignore
|
|
575
|
-
|
|
565
|
+
let level3VrowValues = this.countDuplicatesInArray(level3V); // note this returns an object
|
|
576
566
|
// @ts-ignore
|
|
577
|
-
|
|
567
|
+
let level3NRrowValues = this.countDuplicatesInArray(level3NR);
|
|
578
568
|
// @ts-ignore
|
|
579
|
-
|
|
569
|
+
let level3RrowValues = this.countDuplicatesInArray(level3R);
|
|
580
570
|
// @ts-ignore
|
|
581
|
-
|
|
571
|
+
let level3ArowValues = this.countDuplicatesInArray(level3A);
|
|
582
572
|
// @ts-ignore
|
|
583
|
-
|
|
573
|
+
let level4VrowValues = this.countDuplicatesInArray(level4V); // note this returns an object
|
|
584
574
|
// @ts-ignore
|
|
585
|
-
|
|
575
|
+
let level4NRrowValues = this.countDuplicatesInArray(level4NR);
|
|
586
576
|
// @ts-ignore
|
|
587
|
-
|
|
577
|
+
let level4RrowValues = this.countDuplicatesInArray(level4R);
|
|
588
578
|
// @ts-ignore
|
|
589
|
-
|
|
590
|
-
|
|
579
|
+
let level4ArowValues = this.countDuplicatesInArray(level4A);
|
|
580
|
+
const worksheet = workbook.addWorksheet("Issue summary");
|
|
591
581
|
// Approach:
|
|
592
582
|
// 1. sort by levels
|
|
593
583
|
// 2. for each level sort by V, NR and R
|
|
@@ -595,47 +585,47 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
595
585
|
// 4. build the rows
|
|
596
586
|
// build Issue summary title
|
|
597
587
|
worksheet.mergeCells('A1', "B1");
|
|
598
|
-
|
|
588
|
+
const titleRow = worksheet.getRow(1);
|
|
599
589
|
titleRow.height = 27; // actual is 36
|
|
600
|
-
|
|
590
|
+
const cellA1 = worksheet.getCell('A1');
|
|
601
591
|
cellA1.value = "Issue summary";
|
|
602
592
|
cellA1.alignment = { vertical: "middle", horizontal: "left" };
|
|
603
593
|
cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
604
594
|
cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
605
|
-
|
|
595
|
+
const colWidthData = [
|
|
606
596
|
{ col: 'A', width: 155.51 }, // note .84 added to actual width
|
|
607
597
|
{ col: 'B', width: 21.16 },
|
|
608
598
|
];
|
|
609
|
-
for (
|
|
599
|
+
for (let i = 0; i < 2; i++) {
|
|
610
600
|
worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
|
|
611
601
|
}
|
|
612
602
|
// build Description title
|
|
613
603
|
worksheet.mergeCells('A2', "B2");
|
|
614
|
-
|
|
604
|
+
const descriptionRow = worksheet.getRow(2);
|
|
615
605
|
descriptionRow.height = 20.25; // actual is 27
|
|
616
|
-
|
|
606
|
+
const cellA2 = worksheet.getCell("A2");
|
|
617
607
|
cellA2.value = " In the IBM Equal Access Toolkit, issues are divided into three levels (1-3). Tackle the levels in order to address some of the most impactful issues first.";
|
|
618
608
|
cellA2.alignment = { vertical: "middle", horizontal: "left" };
|
|
619
609
|
cellA2.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
620
610
|
// cellA2.fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFCCC0DA'} };
|
|
621
611
|
// build Total issues found: title
|
|
622
612
|
// worksheet.mergeCells('A3', "B3");
|
|
623
|
-
|
|
613
|
+
const totalIssuesRow = worksheet.getRow(3);
|
|
624
614
|
totalIssuesRow.height = 27; // actual is 36
|
|
625
|
-
|
|
615
|
+
const cellA3 = worksheet.getCell("A3");
|
|
626
616
|
cellA3.value = "Total issues found:";
|
|
627
617
|
cellA3.alignment = { vertical: "middle", horizontal: "left" };
|
|
628
618
|
cellA3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
629
619
|
cellA3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
|
|
630
|
-
|
|
620
|
+
const cellB3 = worksheet.getCell("B3");
|
|
631
621
|
cellB3.value = totalIssues;
|
|
632
622
|
cellB3.alignment = { vertical: "middle", horizontal: "right" };
|
|
633
623
|
cellB3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
634
624
|
cellB3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
|
|
635
625
|
// build Number of issues title
|
|
636
|
-
|
|
626
|
+
const numberOfIssuesRow = worksheet.getRow(4);
|
|
637
627
|
numberOfIssuesRow.height = 20.25; // actual is 27
|
|
638
|
-
|
|
628
|
+
const cellA4 = worksheet.getCell("A4");
|
|
639
629
|
// no value
|
|
640
630
|
cellA4.alignment = { vertical: "middle", horizontal: "left" };
|
|
641
631
|
cellA4.border = {
|
|
@@ -644,7 +634,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
644
634
|
bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
|
|
645
635
|
right: { style: 'thin', color: { argb: 'FFFFFFFF' } }
|
|
646
636
|
};
|
|
647
|
-
|
|
637
|
+
const cellB4 = worksheet.getCell("B4");
|
|
648
638
|
cellB4.value = "Number of issues";
|
|
649
639
|
cellB4.alignment = { vertical: "middle", horizontal: "right" };
|
|
650
640
|
cellB4.font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
@@ -659,9 +649,9 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
659
649
|
ACReporterXLSX.buildIssueSummaryTKLevel(worksheet, "Level 3 - necessary to meet requirements", level3Counts, level3VrowValues, level3NRrowValues, level3RrowValues, level3ArowValues);
|
|
660
650
|
ACReporterXLSX.buildIssueSummaryTKLevel(worksheet, "Level 4 - further recommended improvements to accessibility", level4Counts, level4VrowValues, level4NRrowValues, level4RrowValues, level4ArowValues);
|
|
661
651
|
worksheet.commit();
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
652
|
+
}
|
|
653
|
+
static createIssuesSheet(config, policyInfo, compressedScans, workbook) {
|
|
654
|
+
const valueMap = {
|
|
665
655
|
"VIOLATION": {
|
|
666
656
|
"POTENTIAL": "Needs review",
|
|
667
657
|
"FAIL": "Violation",
|
|
@@ -681,40 +671,39 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
681
671
|
"MANUAL": "Recommendation"
|
|
682
672
|
}
|
|
683
673
|
};
|
|
684
|
-
|
|
674
|
+
const worksheet = workbook.addWorksheet("Issues");
|
|
685
675
|
// build rows
|
|
686
|
-
|
|
687
|
-
for (
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
var _loop_1 = function (item) {
|
|
676
|
+
let rowArray = [];
|
|
677
|
+
for (const compressedScan of compressedScans) {
|
|
678
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedScan);
|
|
679
|
+
for (const item of storedScan.engineReport.results) {
|
|
691
680
|
if (!(item.ruleId in policyInfo)) {
|
|
692
681
|
policyInfo[item.ruleId] = {
|
|
693
682
|
tkLevels: [],
|
|
694
683
|
cps: []
|
|
695
684
|
};
|
|
696
685
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
686
|
+
let polInfo = policyInfo[item.ruleId];
|
|
687
|
+
let cps = polInfo.cps.filter(cp => {
|
|
688
|
+
let ruleInfo = cp.rules.find(ruleInfo => ruleInfo.id === item.ruleId && (!ruleInfo.reasonCodes || ruleInfo.reasonCodes.includes("" + item.reasonId)));
|
|
700
689
|
return !!ruleInfo;
|
|
701
690
|
});
|
|
702
|
-
|
|
691
|
+
let wcagLevels = dropDupes(cps.map(cp => cp.wcagLevel));
|
|
703
692
|
wcagLevels.sort();
|
|
704
|
-
|
|
693
|
+
let cpStrs = dropDupes(cps.map(cp => `${cp.num} ${cp.name}`));
|
|
705
694
|
cpStrs.sort();
|
|
706
|
-
|
|
695
|
+
let row = [
|
|
707
696
|
storedScan.pageTitle,
|
|
708
697
|
storedScan.engineReport.summary.URL,
|
|
709
698
|
storedScan.label,
|
|
710
|
-
|
|
711
|
-
|
|
699
|
+
this.stringHash(item.ruleId + item.path.dom),
|
|
700
|
+
`${valueMap[item.value[0]][item.value[1]]}${item.ignored ? ` (Archived)` : ``}`,
|
|
712
701
|
polInfo.tkLevels.join(", "),
|
|
713
702
|
cpStrs.join("; "),
|
|
714
703
|
wcagLevels.join(", "),
|
|
715
704
|
item.ruleId,
|
|
716
705
|
item.message.substring(0, 32767), //max ength for MS Excel 32767 characters
|
|
717
|
-
|
|
706
|
+
this.get_element(item.snippet),
|
|
718
707
|
item.snippet.substring(0, 32767),
|
|
719
708
|
item.path.dom,
|
|
720
709
|
item.help
|
|
@@ -727,15 +716,10 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
727
716
|
// myStoredData[i][12], myStoredData[i][13]
|
|
728
717
|
// ];
|
|
729
718
|
rowArray.push(row);
|
|
730
|
-
};
|
|
731
|
-
var this_1 = this;
|
|
732
|
-
for (var _a = 0, _b = storedScan.engineReport.results; _a < _b.length; _a++) {
|
|
733
|
-
var item = _b[_a];
|
|
734
|
-
_loop_1(item);
|
|
735
719
|
}
|
|
736
720
|
}
|
|
737
721
|
// column widths
|
|
738
|
-
|
|
722
|
+
const colWidthData = [
|
|
739
723
|
{ col: 'A', width: 18.0, alignment: { vertical: "middle", horizontal: "left" } },
|
|
740
724
|
{ col: 'B', width: 20.5, alignment: { vertical: "middle", horizontal: "left" } },
|
|
741
725
|
{ col: 'C', width: 21.0, alignment: { vertical: "middle", horizontal: "center" } },
|
|
@@ -751,12 +735,12 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
751
735
|
{ col: 'M', width: 43.00, alignment: { vertical: "middle", horizontal: "left" } },
|
|
752
736
|
{ col: 'N', width: 17.17, alignment: { vertical: "middle", horizontal: "fill" } },
|
|
753
737
|
];
|
|
754
|
-
for (
|
|
738
|
+
for (let i = 0; i < 14; i++) {
|
|
755
739
|
worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
|
|
756
740
|
worksheet.getColumn(colWidthData[i].col).alignment = colWidthData[i].alignment;
|
|
757
741
|
}
|
|
758
742
|
// add table to a sheet
|
|
759
|
-
|
|
743
|
+
let headRow = worksheet.addRow([
|
|
760
744
|
"Page title",
|
|
761
745
|
"Page URL",
|
|
762
746
|
"Scan label",
|
|
@@ -774,7 +758,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
774
758
|
""
|
|
775
759
|
]);
|
|
776
760
|
// set font and alignment for the header cells
|
|
777
|
-
for (
|
|
761
|
+
for (let i = 1; i < 15; i++) {
|
|
778
762
|
headRow.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
|
|
779
763
|
headRow.getCell(i).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 12 };
|
|
780
764
|
headRow.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
@@ -788,11 +772,10 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
788
772
|
// height for header row
|
|
789
773
|
headRow.height = 24;
|
|
790
774
|
headRow.commit();
|
|
791
|
-
for (
|
|
792
|
-
|
|
793
|
-
var row = worksheet.addRow(rowInfo);
|
|
775
|
+
for (const rowInfo of rowArray) {
|
|
776
|
+
const row = worksheet.addRow(rowInfo);
|
|
794
777
|
row.height = 14;
|
|
795
|
-
for (
|
|
778
|
+
for (let j = 1; j <= 14; j++) {
|
|
796
779
|
row.getCell(j).border = {
|
|
797
780
|
top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
|
|
798
781
|
left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
|
|
@@ -802,7 +785,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
802
785
|
}
|
|
803
786
|
row.commit();
|
|
804
787
|
}
|
|
805
|
-
for (
|
|
788
|
+
for (const key in worksheet) {
|
|
806
789
|
if (typeof worksheet[key] === "function") {
|
|
807
790
|
console.log(key);
|
|
808
791
|
}
|
|
@@ -847,38 +830,38 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
847
830
|
// worksheet.getRow(i).commit();
|
|
848
831
|
// }
|
|
849
832
|
worksheet.commit();
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
833
|
+
}
|
|
834
|
+
static createDefinitionsSheet(workbook) {
|
|
835
|
+
const worksheet = workbook.addWorksheet("Definition of fields");
|
|
853
836
|
// "Definition of fields" title
|
|
854
837
|
worksheet.mergeCells('A1', "B1");
|
|
855
|
-
|
|
838
|
+
const titleRow = worksheet.getRow(1);
|
|
856
839
|
titleRow.height = 36; // actual is 48
|
|
857
840
|
titleRow.getCell(1).value = "Definition of fields";
|
|
858
841
|
titleRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
|
|
859
842
|
titleRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "20" };
|
|
860
843
|
titleRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
861
|
-
|
|
844
|
+
const colWidthData = [
|
|
862
845
|
{ col: 'A', width: '41.51' }, // note .84 added to actual width
|
|
863
846
|
{ col: 'B', width: '119.51' },
|
|
864
847
|
];
|
|
865
|
-
for (
|
|
848
|
+
for (let i = 0; i < 2; i++) {
|
|
866
849
|
worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
|
|
867
850
|
}
|
|
868
851
|
// blank row
|
|
869
852
|
worksheet.mergeCells('A2', "B2");
|
|
870
|
-
|
|
853
|
+
const blankRow = worksheet.getRow(2);
|
|
871
854
|
blankRow.height = 12; // actual is 16
|
|
872
855
|
// "Scan summary and Issue summary" title
|
|
873
856
|
worksheet.mergeCells('A3', "B3");
|
|
874
|
-
|
|
857
|
+
const summaryRow = worksheet.getRow(3);
|
|
875
858
|
summaryRow.height = 20; // actual is 26.75
|
|
876
859
|
summaryRow.getCell(1).value = "Scan summary and Issue summary";
|
|
877
860
|
summaryRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
|
|
878
861
|
summaryRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
879
862
|
summaryRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
880
863
|
// row 4 Field / Definition
|
|
881
|
-
|
|
864
|
+
const row4 = worksheet.getRow(4);
|
|
882
865
|
row4.height = 16; // actual is
|
|
883
866
|
row4.getCell(1).value = "Field";
|
|
884
867
|
row4.getCell(2).value = "Definition";
|
|
@@ -893,10 +876,10 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
893
876
|
};
|
|
894
877
|
// rows 5-13
|
|
895
878
|
// set row height for rows 5-13
|
|
896
|
-
for (
|
|
879
|
+
for (let i = 5; i < 14; i++) {
|
|
897
880
|
worksheet.getRow(i).height = 12; // results in a row height of 16
|
|
898
881
|
}
|
|
899
|
-
|
|
882
|
+
let rowData = [
|
|
900
883
|
{ key1: 'Page', key2: 'Identifies the page or html file that was scanned.' },
|
|
901
884
|
{ key1: 'Scan label', key2: 'Label for the scan. Default values can be edited in the Accessibility Checker before saving this report, or programmatically assigned in automated testing.' },
|
|
902
885
|
{ key1: 'Violations', key2: 'Accessibility failures that need to be corrected.' },
|
|
@@ -906,24 +889,24 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
906
889
|
{ key1: '% elements without violations or items to review', key2: 'Percentage of elements on the page that had no violations found and no items to review.' },
|
|
907
890
|
{ key1: 'Level 1,2,3', key2: 'Priority level defined by the IBM Equal Access Toolkit. See https://www.ibm.com/able/toolkit/plan/overview#pace-of-completion for details.' }
|
|
908
891
|
];
|
|
909
|
-
for (
|
|
892
|
+
for (let i = 5; i < rowData.length + 5; i++) {
|
|
910
893
|
worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
911
894
|
worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
|
|
912
895
|
}
|
|
913
|
-
for (
|
|
896
|
+
for (let i = 5; i < rowData.length + 5; i++) {
|
|
914
897
|
worksheet.getRow(i).getCell(1).value = rowData[i - 5].key1;
|
|
915
898
|
worksheet.getRow(i).getCell(2).value = rowData[i - 5].key2;
|
|
916
899
|
}
|
|
917
900
|
// "Scan summary and Issue summary" title
|
|
918
901
|
worksheet.mergeCells('A14', "B14");
|
|
919
|
-
|
|
902
|
+
const issuesRow = worksheet.getRow(14);
|
|
920
903
|
issuesRow.height = 20; // actual is 26.75
|
|
921
904
|
issuesRow.getCell(1).value = "Issues";
|
|
922
905
|
issuesRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
|
|
923
906
|
issuesRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: 16 };
|
|
924
907
|
issuesRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
|
|
925
908
|
// row 15 Field / Definition
|
|
926
|
-
|
|
909
|
+
const row15 = worksheet.getRow(15);
|
|
927
910
|
row15.height = 16; // actual is
|
|
928
911
|
row15.getCell(1).value = "Field";
|
|
929
912
|
row15.getCell(2).value = "Definition";
|
|
@@ -938,7 +921,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
938
921
|
};
|
|
939
922
|
// rows 16-28
|
|
940
923
|
// set row height for rows 16-28
|
|
941
|
-
for (
|
|
924
|
+
for (let i = 16; i < 29; i++) {
|
|
942
925
|
worksheet.getRow(i).height = 12; // results in a row height of 16
|
|
943
926
|
}
|
|
944
927
|
rowData = [];
|
|
@@ -957,20 +940,20 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
957
940
|
{ key1: 'Xpath', key2: 'Xpath of the HTML element where the issue is found.' },
|
|
958
941
|
{ key1: 'Help', key2: 'Link to a more detailed description of the issue and suggested solutions.' },
|
|
959
942
|
];
|
|
960
|
-
for (
|
|
943
|
+
for (let i = 16; i < 29; i++) {
|
|
961
944
|
worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: 12 };
|
|
962
945
|
worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
|
|
963
946
|
}
|
|
964
|
-
for (
|
|
947
|
+
for (let i = 16; i < 29; i++) {
|
|
965
948
|
worksheet.getRow(i).getCell(1).value = rowData[i - 16].key1;
|
|
966
949
|
worksheet.getRow(i).getCell(2).value = rowData[i - 16].key2;
|
|
967
950
|
}
|
|
968
951
|
worksheet.commit();
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
|
|
952
|
+
}
|
|
953
|
+
static countDuplicatesInArray(array) {
|
|
954
|
+
let count = {};
|
|
972
955
|
// let result = [];
|
|
973
|
-
array.forEach(
|
|
956
|
+
array.forEach(item => {
|
|
974
957
|
if (count[item]) {
|
|
975
958
|
//@ts-ignore
|
|
976
959
|
count[item] += 1;
|
|
@@ -980,25 +963,25 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
980
963
|
count[item] = 1;
|
|
981
964
|
});
|
|
982
965
|
return count;
|
|
983
|
-
}
|
|
984
|
-
|
|
966
|
+
}
|
|
967
|
+
static get_element(code) {
|
|
985
968
|
if (code) {
|
|
986
|
-
|
|
987
|
-
|
|
969
|
+
const ind_s = code.indexOf(' ');
|
|
970
|
+
const ind_br = code.indexOf('>');
|
|
988
971
|
return (ind_s > 0 && ind_s < ind_br) ? code.substring(1, ind_s) : code.substring(1, ind_br);
|
|
989
972
|
}
|
|
990
973
|
return '';
|
|
991
|
-
}
|
|
992
|
-
|
|
974
|
+
}
|
|
975
|
+
static format_date(timestamp) {
|
|
993
976
|
var date = new Date(timestamp);
|
|
994
977
|
return date.getFullYear() + '-' + ("00" + (date.getMonth() + 1)).slice(-2) + "-" +
|
|
995
978
|
("00" + date.getDate()).slice(-2) + "-" +
|
|
996
979
|
("00" + date.getHours()).slice(-2) + "-" +
|
|
997
980
|
("00" + date.getMinutes()).slice(-2) + "-" +
|
|
998
981
|
("00" + date.getSeconds()).slice(-2);
|
|
999
|
-
}
|
|
982
|
+
}
|
|
1000
983
|
// From https://github.com/darkskyapp/string-hash/blob/master/index.js
|
|
1001
|
-
|
|
984
|
+
static stringHash(str) {
|
|
1002
985
|
var hash = 5381, i = str.length;
|
|
1003
986
|
while (i) {
|
|
1004
987
|
hash = (hash * 33) ^ str.charCodeAt(--i);
|
|
@@ -1007,8 +990,7 @@ var ACReporterXLSX = /** @class */ (function () {
|
|
|
1007
990
|
* integers. Since we want the results to be always positive, convert the
|
|
1008
991
|
* signed int to an unsigned by doing an unsigned bitshift. */
|
|
1009
992
|
return hash >>> 0;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
}());
|
|
993
|
+
}
|
|
994
|
+
}
|
|
1013
995
|
exports.ACReporterXLSX = ACReporterXLSX;
|
|
1014
996
|
//# sourceMappingURL=ACReporterXLSX.js.map
|