@govtechsg/oobee 0.10.39 → 0.10.43
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/.github/workflows/docker-test.yml +1 -1
- package/README.md +2 -0
- package/REPORTS.md +431 -0
- package/package.json +3 -2
- package/src/cli.ts +2 -11
- package/src/constants/common.ts +68 -52
- package/src/constants/constants.ts +81 -1
- package/src/constants/oobeeAi.ts +6 -6
- package/src/constants/questions.ts +3 -2
- package/src/crawlers/commonCrawlerFunc.ts +45 -16
- package/src/crawlers/crawlDomain.ts +83 -102
- package/src/crawlers/crawlIntelligentSitemap.ts +21 -19
- package/src/crawlers/crawlSitemap.ts +121 -110
- package/src/crawlers/custom/findElementByCssSelector.ts +1 -1
- package/src/crawlers/custom/flagUnlabelledClickableElements.ts +593 -558
- package/src/crawlers/custom/xPathToCss.ts +10 -10
- package/src/crawlers/pdfScanFunc.ts +67 -26
- package/src/crawlers/runCustom.ts +1 -1
- package/src/index.ts +3 -4
- package/src/logs.ts +1 -1
- package/src/mergeAxeResults.ts +305 -242
- package/src/npmIndex.ts +12 -8
- package/src/screenshotFunc/htmlScreenshotFunc.ts +8 -20
- package/src/screenshotFunc/pdfScreenshotFunc.ts +34 -1
- package/src/types/text-readability.d.ts +3 -0
- package/src/types/types.ts +1 -1
- package/src/utils.ts +340 -50
- package/src/xPathToCss.ts +0 -186
- package/src/xPathToCssCypress.ts +0 -178
@@ -26,7 +26,7 @@ jobs:
|
|
26
26
|
- name: Run Node CLI command inside the Docker container
|
27
27
|
run: |
|
28
28
|
# Execute a webisite crawl
|
29
|
-
docker exec oobee-container npm run cli -- -u "${{ vars.OOBEE_SCAN_URL }}" -c 2 -p "${{ vars.OOBEE_SCAN_MAX_NUM_PAGES }}" -t "${{ vars.OOBEE_SCAN_MAX_CONCURRENCY }}" -k "${{ github.actor }}:${{ github.actor }}@users.noreply.github.com" -b chromium || true
|
29
|
+
docker exec oobee-container npm run cli -- -u "${{ vars.OOBEE_SCAN_URL }}" -c 2 -p "${{ vars.OOBEE_SCAN_MAX_NUM_PAGES }}" -t "${{ vars.OOBEE_SCAN_MAX_CONCURRENCY }}" -k "${{ github.actor }}:${{ github.actor }}@users.noreply.github.com" -b chromium -g yes || true
|
30
30
|
|
31
31
|
- name: Print errors
|
32
32
|
run: |
|
package/README.md
CHANGED
@@ -397,6 +397,8 @@ Examples:
|
|
397
397
|
> [ -d <device> | -w <viewport_width> ]
|
398
398
|
|
399
399
|
```
|
400
|
+
### Note on Windows PowerShell:
|
401
|
+
You need to run the command as `npm run cli -- --` (with the extra set of `--`) as PowerShell interprets arguments differently.
|
400
402
|
|
401
403
|
### Device Options
|
402
404
|
|
package/REPORTS.md
ADDED
@@ -0,0 +1,431 @@
|
|
1
|
+
# Accessibility Scan Reports Documentation
|
2
|
+
|
3
|
+
Various types of reports are provided to help you to identify, manage, and understand the scale of accessibility for each website.
|
4
|
+
|
5
|
+
In order to generate JSON reports, you need to parse the switch `-g yes` in Oobee CLI. For each of the JSON reports listed below, a compressed version with the file extension `json.gz.b64` is provided. See below for steps on uncompressing the compressed JSON files.
|
6
|
+
|
7
|
+
## HTML, CSV and Summary Reports
|
8
|
+
|
9
|
+
### report.html
|
10
|
+
An interactive HTML report that allows the user to interact and understand the different accessibility issues. Note that if the number of scan issues is large > 510 MB of JSON data, the individual accessibility issues will not be viewable in the report. Please refer to the report.csv for the detailed accessibility issues.
|
11
|
+
|
12
|
+
### summary.pdf
|
13
|
+
A short printable summary of the types and occurrences of accessibility issues found. It contains metadata of how many WCAG (Level A and AA) were violated.
|
14
|
+
|
15
|
+
### report.csv
|
16
|
+
This is the report which contains each individual accessibility issue found, across mustFix, goodToFix, and needsReview categories. It contains the same information as a regular report.html except the scan metadata (i.e. how the scan was set up to run). For scan metadata, please refer to scanData.csv.
|
17
|
+
|
18
|
+
This file contains detailed accessibility scan results, including issue details, affected pages, and recommendations.
|
19
|
+
|
20
|
+
#### CSV Structure
|
21
|
+
|
22
|
+
| Column Name | Description |
|
23
|
+
|----------------------|-------------|
|
24
|
+
| `customFlowLabel` | Label indicating the custom flow used for the scan. |
|
25
|
+
| `deviceChosen` | Type of device used during the scan (e.g., Desktop, Mobile). |
|
26
|
+
| `scanCompletedAt` | Timestamp indicating when the scan was completed (ISO 8601 format). |
|
27
|
+
| `severity` | Severity level of the issue (`mustFix`, `goodToFix`, `needsReview`, `error`). |
|
28
|
+
| `issueId` | Unique identifier for the issue found. |
|
29
|
+
| `issueDescription` | Description of the issue detected during the scan. |
|
30
|
+
| `wcagConformance` | WCAG guidelines that the issue relates to, comma-separated. |
|
31
|
+
| `url` | The URL of the affected page. |
|
32
|
+
| `pageTitle` | The title of the affected page. |
|
33
|
+
| `context` | HTML snippet or element associated with the issue. |
|
34
|
+
| `howToFix` | Suggested fix or recommendation to resolve the issue. |
|
35
|
+
| `axeImpact` | Impact severity as determined by Axe (e.g., `critical`, `serious`, `moderate`, `minor`). |
|
36
|
+
| `xpath` | XPath selector for locating the issue within the page. |
|
37
|
+
| `learnMore` | URL to additional documentation about the issue (masked for privacy). |
|
38
|
+
|
39
|
+
#### Example CSV
|
40
|
+
|
41
|
+
```csv
|
42
|
+
"customFlowLabel","deviceChosen","scanCompletedAt","severity","issueId","issueDescription","wcagConformance","url","pageTitle","context","howToFix","axeImpact","xpath","learnMore"
|
43
|
+
"Custom Flow","Desktop","2025-03-13T10:09:18.733Z","needsReview","aria-prohibited-attr","Elements must only use permitted ARIA attributes","wcag2a,wcag412","https://example.com/page1","Example Page 1","<a class=""nav-link"" aria-label=""Example Link"">Example<i class=""icon-chevron-down"" aria-hidden=""true""></i></a>","aria-label attribute is not well supported on an <a> with no valid role attribute.","serious","a[aria-label=""Example Link""]","https://dequeuniversity.com/rules/axe/4.10/aria-prohibited-attr"
|
44
|
+
"Custom Flow","Desktop","2025-03-13T10:09:18.733Z","error","error-pages-skipped","Page was skipped during the scan",,"https://example.com/file.pdf","Error",,,,,,
|
45
|
+
```
|
46
|
+
|
47
|
+
## scanItemsSummary.json
|
48
|
+
|
49
|
+
This file contains a summary of accessibility issues found in a scan, categorized into different levels of severity.
|
50
|
+
|
51
|
+
### Sample JSON
|
52
|
+
```json
|
53
|
+
{
|
54
|
+
"oobeeAppVersion": "<string>",
|
55
|
+
"mustFix": { "totalItems": <number>, "totalRuleIssues": <number> },
|
56
|
+
"goodToFix": { "totalItems": <number>, "totalRuleIssues": <number> },
|
57
|
+
"needsReview": { "totalItems": <number>, "totalRuleIssues": <number> },
|
58
|
+
"topTenPagesWithMostIssues": [
|
59
|
+
{
|
60
|
+
"url": "<string>",
|
61
|
+
"pageTitle": "<string>",
|
62
|
+
"totalIssues": <number>,
|
63
|
+
"totalOccurrences": <number>
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"wcagLinks": {},
|
67
|
+
"wcagPassPercentage": {
|
68
|
+
"passPercentageAA": "<string>",
|
69
|
+
"totalWcagChecksAA": <number>,
|
70
|
+
"totalWcagViolationsAA": <number>,
|
71
|
+
"passPercentageAAandAAA": "<string>",
|
72
|
+
"totalWcagChecksAAandAAA": <number>,
|
73
|
+
"totalWcagViolationsAAandAAA": <number>
|
74
|
+
},
|
75
|
+
"progressPercentage": {
|
76
|
+
"averageProgressPercentageAA": "<string>",
|
77
|
+
"averageProgressPercentageAAandAAA": "<string>"
|
78
|
+
},
|
79
|
+
"issuesPercentage": {
|
80
|
+
"avgTypesOfIssuesCountAtMustFix": "<number>",
|
81
|
+
"avgTypesOfIssuesCountAtGoodToFix": "<number>",
|
82
|
+
"avgTypesOfIssuesCountAtMustFixAndGoodToFix": "<number>",
|
83
|
+
"avgTypesOfIssuesPercentageOfTotalRulesAtMustFix": "<number>",
|
84
|
+
"avgTypesOfIssuesPercentageOfTotalRulesAtGoodToFix": "<number>",
|
85
|
+
"avgTypesOfIssuesPercentageOfTotalRulesAtMustFixAndGoodToFix": "<number>",
|
86
|
+
"totalRulesMustFix": <number>,
|
87
|
+
"totalRulesGoodToFix": <number>,
|
88
|
+
"totalRulesMustFixAndGoodToFix": <number>,
|
89
|
+
"pagesAffectedPerRule": {
|
90
|
+
"<string>": <number>
|
91
|
+
},
|
92
|
+
"pagesPercentageAffectedPerRule": {
|
93
|
+
"<string>": "<string>"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
"totalPagesScanned": <number>,
|
97
|
+
"totalPagesNotScanned": <number>,
|
98
|
+
"topTenIssues": [
|
99
|
+
{
|
100
|
+
"category": "<string>",
|
101
|
+
"ruleId": "<string>",
|
102
|
+
"description": "<string>",
|
103
|
+
"axeImpact": "<string>",
|
104
|
+
"conformance": ["<string>", "<string>"],
|
105
|
+
"totalItems": <number>
|
106
|
+
}
|
107
|
+
]
|
108
|
+
}
|
109
|
+
```
|
110
|
+
|
111
|
+
| Variable | Description |
|
112
|
+
|----------|-------------|
|
113
|
+
| `oobeeAppVersion` | Version of the Oobee application used for the scan. |
|
114
|
+
| `mustFix` | Summary of must-fix issues including `totalItems` and `totalRuleIssues`. |
|
115
|
+
| `goodToFix` | Summary of good-to-fix issues including `totalItems` and `totalRuleIssues`. |
|
116
|
+
| `needsReview` | Summary of needs-review issues including `totalItems` and `totalRuleIssues`. |
|
117
|
+
| `topTenPagesWithMostIssues` | List of the top ten pages with the most accessibility issues. |
|
118
|
+
| `url` | URL of the affected page. |
|
119
|
+
| `pageTitle` | Title of the affected page. |
|
120
|
+
| `totalIssues` | Total number of accessibility issues on the page. |
|
121
|
+
| `totalOccurrences` | Number of times these issues occurred. |
|
122
|
+
| `wcagLinks` | Mapping of WCAG guidelines to their documentation URLs. |
|
123
|
+
| `wcagPassPercentage` | Summary of WCAG compliance percentages. |
|
124
|
+
| `passPercentageAA` | Percentage of WCAG AA guidelines passed. |
|
125
|
+
| `totalWcagChecksAA` | Total WCAG AA checks performed. |
|
126
|
+
| `totalWcagViolationsAA` | Total WCAG AA violations found. |
|
127
|
+
| `passPercentageAAandAAA` | Percentage of WCAG AA and AAA guidelines passed. |
|
128
|
+
| `totalWcagChecksAAandAAA` | Total WCAG AA and AAA checks performed. |
|
129
|
+
| `totalWcagViolationsAAandAAA` | Total WCAG AA and AAA violations found. |
|
130
|
+
| `progressPercentage` | Summary of average progress percentages. |
|
131
|
+
| `averageProgressPercentageAA` | Average progress percentage for WCAG AA guidelines. |
|
132
|
+
| `averageProgressPercentageAAandAAA` | Average progress percentage for WCAG AA and AAA guidelines. |
|
133
|
+
| `issuesPercentage` | Detailed breakdown of issue percentages and counts. |
|
134
|
+
| `avgTypesOfIssuesCountAtMustFix` | Average count of issue types at "Must Fix" level. |
|
135
|
+
| `avgTypesOfIssuesCountAtGoodToFix` | Average count of issue types at "Good to Fix" level. |
|
136
|
+
| `avgTypesOfIssuesCountAtMustFixAndGoodToFix` | Average count of issue types at both "Must Fix" and "Good to Fix" levels per page. |
|
137
|
+
| `avgTypesOfIssuesPercentageOfTotalRulesAtMustFix` | Average percentage of total rules affected at "Must Fix" level per page. |
|
138
|
+
| `avgTypesOfIssuesPercentageOfTotalRulesAtGoodToFix` | Average percentage of total rules affected at "Good to Fix" level per page. |
|
139
|
+
| `avgTypesOfIssuesPercentageOfTotalRulesAtMustFixAndGoodToFix` | Average percentage of total rules affected at both "Must Fix" and "Good to Fix" levels per page. |
|
140
|
+
| `totalRulesMustFix` | Total number of rules categorized as "Must Fix". |
|
141
|
+
| `totalRulesGoodToFix` | Total number of rules categorized as "Good to Fix". |
|
142
|
+
| `totalRulesMustFixAndGoodToFix` | Total number of rules categorized as either "Must Fix" or "Good to Fix". |
|
143
|
+
| `pagesAffectedPerRule` | Number of pages affected by each rule (keyed by rule ID). |
|
144
|
+
| `pagesPercentageAffectedPerRule` | Percentage of pages affected by each rule (keyed by rule ID). |
|
145
|
+
| `totalPagesScanned` | Total number of pages scanned. |
|
146
|
+
| `totalPagesNotScanned` | Total number of pages not scanned. |
|
147
|
+
| `topTenIssues` | List of the ten most common accessibility issues. |
|
148
|
+
| `category` | Category of the issue (`mustFix`, `goodToFix`, `needsReview`). |
|
149
|
+
| `ruleId` | Identifier of the accessibility rule violated. |
|
150
|
+
| `description` | Description of the accessibility issue. |
|
151
|
+
| `axeImpact` | Severity impact as determined by Axe. |
|
152
|
+
| `conformance` | List of WCAG guidelines the rule conforms to. |
|
153
|
+
| `totalItems` | Number of times this issue was detected. |
|
154
|
+
|
155
|
+
|
156
|
+
## scanIssuesSummary.json
|
157
|
+
|
158
|
+
This file contains a summary of accessibility issues found in a scan, categorized into different levels of severity.
|
159
|
+
|
160
|
+
### Sample JSON
|
161
|
+
```json
|
162
|
+
{
|
163
|
+
"oobeeAppVersion": "<string>",
|
164
|
+
"mustFix": [],
|
165
|
+
"goodToFix": [
|
166
|
+
{
|
167
|
+
"rule": "<string>",
|
168
|
+
"description": "<string>",
|
169
|
+
"axeImpact": "<string>",
|
170
|
+
"helpUrl": "<string>",
|
171
|
+
"conformance": ["<string>", "<string>"],
|
172
|
+
"totalItems": <number>,
|
173
|
+
"pagesAffectedCount": <number>
|
174
|
+
}
|
175
|
+
],
|
176
|
+
"needsReview": [
|
177
|
+
],
|
178
|
+
"passed": [
|
179
|
+
],
|
180
|
+
}
|
181
|
+
```
|
182
|
+
|
183
|
+
| Variable | Description |
|
184
|
+
|----------|-------------|
|
185
|
+
| `oobeeAppVersion` | Version of the Oobee application used for the scan. |
|
186
|
+
| `mustFix` | Array of must-fix issues. |
|
187
|
+
| `goodToFix` | Array of good-to-fix issues. |
|
188
|
+
| `needsReview` | Array of issues requiring human review. |
|
189
|
+
| `passed` | Array of rules that were checked and passed. |
|
190
|
+
| `rule` | Unique identifier of the accessibility rule being checked. |
|
191
|
+
| `description` | Description of the accessibility issue. |
|
192
|
+
| `axeImpact` | Severity impact as determined by Axe. |
|
193
|
+
| `helpUrl` | URL with more information on the accessibility rule. |
|
194
|
+
| `conformance` | List of WCAG guidelines the rule conforms to. |
|
195
|
+
| `totalItems` | Number of times this issue was detected. |
|
196
|
+
| `pagesAffectedCount` | Number of pages where this issue was found. |
|
197
|
+
|
198
|
+
## scanPagesSummary.json
|
199
|
+
|
200
|
+
This file contains a summary of pages affected by accessibility issues.
|
201
|
+
|
202
|
+
### Sample JSON
|
203
|
+
```json
|
204
|
+
{
|
205
|
+
"oobeeAppVersion": "<string>",
|
206
|
+
"pagesAffected": [
|
207
|
+
{
|
208
|
+
"pageTitle": "<string>",
|
209
|
+
"url": "<string>",
|
210
|
+
"totalOccurrencesFailedIncludingNeedsReview": <number>,
|
211
|
+
"totalOccurrencesFailedExcludingNeedsReview": <number>,
|
212
|
+
"totalOccurrencesMustFix": <number>,
|
213
|
+
"totalOccurrencesGoodToFix": <number>,
|
214
|
+
"totalOccurrencesNeedsReview": <number>,
|
215
|
+
"totalOccurrencesPassed": <number>,
|
216
|
+
"typesOfIssuesExclusiveToNeedsReviewCount": <boolean>,
|
217
|
+
"typesOfIssuesCount": <number>,
|
218
|
+
"typesOfIssuesExcludingNeedsReviewCount": <number>,
|
219
|
+
"categoriesPresent": ["<string>", "<string>"],
|
220
|
+
"conformance": ["<string>", "<string>", "<string>"]
|
221
|
+
}
|
222
|
+
],
|
223
|
+
"pagesNotAffected": [
|
224
|
+
{
|
225
|
+
"pageTitle": "<string>",
|
226
|
+
"url": "<string>",
|
227
|
+
"totalOccurrencesFailedIncludingNeedsReview": <number>,
|
228
|
+
"totalOccurrencesFailedExcludingNeedsReview": <number>,
|
229
|
+
"totalOccurrencesMustFix": <number>,
|
230
|
+
"totalOccurrencesGoodToFix": <number>,
|
231
|
+
"totalOccurrencesNeedsReview": <number>,
|
232
|
+
"totalOccurrencesPassed": <number>,
|
233
|
+
"occurrencesExclusiveToNeedsReview": <boolean>,
|
234
|
+
"typesOfIssuesCount": <number>,
|
235
|
+
"typesOfIssuesExcludingNeedsReviewCount": <number>,
|
236
|
+
"categoriesPresent": ["<string>", "<string>"],
|
237
|
+
"conformance": ["<string>", "<string>", "<string>"],
|
238
|
+
}
|
239
|
+
],
|
240
|
+
"scannedPagesCount": <number>,
|
241
|
+
"pagesNotScanned": [
|
242
|
+
{
|
243
|
+
"url": "<string>",
|
244
|
+
"pageTitle": "<string>",
|
245
|
+
"actualUrl": "<string>",
|
246
|
+
"metadata": "<string>",
|
247
|
+
"httpStatusCode": number
|
248
|
+
},
|
249
|
+
],
|
250
|
+
"pagesNotScannedCount": <number>
|
251
|
+
}
|
252
|
+
```
|
253
|
+
|
254
|
+
| Variable | Description |
|
255
|
+
|----------|-------------|
|
256
|
+
| `oobeeAppVersion` | Version of the Oobee application used for the scan. |
|
257
|
+
| `pagesAffected` | Array of objects representing pages with accessibility issues. |
|
258
|
+
| `pageTitle` | Title of the affected page. |
|
259
|
+
| `url` | URL of the affected page. |
|
260
|
+
| `totalOccurrencesFailedIncludingNeedsReview` | Total number of failed checks, including needs-review issues. |
|
261
|
+
| `totalOccurrencesFailedExcludingNeedsReview` | Total number of failed checks, excluding needs-review issues. |
|
262
|
+
| `totalOccurrencesMustFix` | Number of must-fix occurrences of the rule. |
|
263
|
+
| `totalOccurrencesGoodToFix` | Number of good-to-fix occurrences of the rule. |
|
264
|
+
| `totalOccurrencesNeedsReview` | Number of occurrences requiring review. |
|
265
|
+
| `totalOccurrencesPassed` | Number of times the rule was checked and passed. |
|
266
|
+
| `typesOfIssuesExclusiveToNeedsReviewCount` | Number of unique needs-review issues found on the page. |
|
267
|
+
| `typesOfIssuesCount` | Number of unique issue types found on the page. |
|
268
|
+
| `typesOfIssuesExcludingNeedsReviewCount` | Number of unique issue types found on the page, excluding needs-review issues. |
|
269
|
+
| `categoriesPresent` | List of issue categories found on the page. |
|
270
|
+
| `conformance` | List of WCAG guidelines applicable to the issues found on the page. |
|
271
|
+
| `pagesNotAffected` | Array of pages that did not have any accessibility issues. |
|
272
|
+
| `scannedPagesCount` | Total number of pages scanned. |
|
273
|
+
| `pagesNotScanned` | Array of pages that were not scanned. |
|
274
|
+
| `pagesNotScannedCount` | Number of pages that were not scanned. |
|
275
|
+
|
276
|
+
|
277
|
+
## scanPagesDetail.json
|
278
|
+
|
279
|
+
This file contains a summary of accessibility issues found in a scan, categorized into different levels of severity.
|
280
|
+
|
281
|
+
### Sample JSON
|
282
|
+
|
283
|
+
```json
|
284
|
+
{
|
285
|
+
"oobeeAppVersion": "<string>",
|
286
|
+
"pagesAffected": [
|
287
|
+
{
|
288
|
+
"pageTitle": "<string>",
|
289
|
+
"url": "<string>",
|
290
|
+
"totalOccurrencesFailedIncludingNeedsReview": <number>,
|
291
|
+
"totalOccurrencesFailedExcludingNeedsReview": <number>,
|
292
|
+
"totalOccurrencesMustFix": <number>,
|
293
|
+
"totalOccurrencesGoodToFix": <number>,
|
294
|
+
"totalOccurrencesNeedsReview": <number>,
|
295
|
+
"totalOccurrencesPassed": <number>,
|
296
|
+
"occurrencesExclusiveToNeedsReview": <boolean>,
|
297
|
+
"typesOfIssuesCount": <number>,
|
298
|
+
"typesOfIssuesExcludingNeedsReviewCount": <number>,
|
299
|
+
"categoriesPresent": ["<string>", "<string>"],
|
300
|
+
"conformance": ["<string>", "<string>", "<string>"],
|
301
|
+
"typesOfIssues": [
|
302
|
+
{
|
303
|
+
"ruleId": "<string>",
|
304
|
+
"wagConformance": ["<string>", "<string>"],
|
305
|
+
"occurrencesMustFix": <number>,
|
306
|
+
"occurrencesGoodToFix": <number>,
|
307
|
+
"occurrencesNeedsReview": <number>,
|
308
|
+
"occurrencesPassed": <number>
|
309
|
+
}
|
310
|
+
]
|
311
|
+
}
|
312
|
+
],
|
313
|
+
"pagesNotAffected": [
|
314
|
+
{
|
315
|
+
"pageTitle": "<string>",
|
316
|
+
"url": "<string>",
|
317
|
+
"totalOccurrencesFailedIncludingNeedsReview": <number>,
|
318
|
+
"totalOccurrencesFailedExcludingNeedsReview": <number>,
|
319
|
+
"totalOccurrencesMustFix": <number>,
|
320
|
+
"totalOccurrencesGoodToFix": <number>,
|
321
|
+
"totalOccurrencesNeedsReview": <number>,
|
322
|
+
"totalOccurrencesPassed": <number>,
|
323
|
+
"occurrencesExclusiveToNeedsReview": <boolean>,
|
324
|
+
"typesOfIssuesCount": <number>,
|
325
|
+
"typesOfIssuesExcludingNeedsReviewCount": <number>,
|
326
|
+
"categoriesPresent": ["<string>", "<string>"],
|
327
|
+
"conformance": ["<string>", "<string>", "<string>"],
|
328
|
+
"typesOfIssues": [
|
329
|
+
{
|
330
|
+
"ruleId": "<string>",
|
331
|
+
"wagConformance": ["<string>", "<string>"],
|
332
|
+
"occurrencesMustFix": <number>,
|
333
|
+
"occurrencesGoodToFix": <number>,
|
334
|
+
"occurrencesNeedsReview": <number>,
|
335
|
+
"occurrencesPassed": <number>
|
336
|
+
}
|
337
|
+
]
|
338
|
+
}
|
339
|
+
],
|
340
|
+
"scannedPagesCount": <number>,
|
341
|
+
"pagesNotScanned": [
|
342
|
+
{
|
343
|
+
"url": "<string>",
|
344
|
+
"pageTitle": "<string>",
|
345
|
+
"actualUrl": "<string>",
|
346
|
+
"metadata": "<string>",
|
347
|
+
"httpStatusCode": number
|
348
|
+
},
|
349
|
+
],
|
350
|
+
"pagesNotScannedCount": <number>
|
351
|
+
}
|
352
|
+
```
|
353
|
+
|
354
|
+
## Manage Compressed JSON in Base64 Encoding
|
355
|
+
|
356
|
+
To deflate the .json.gz.b64, use the following with `pako` library installed:
|
357
|
+
```js
|
358
|
+
// Decompress the binary data using pako.inflate
|
359
|
+
const decompressedBytes = pako.inflate(compressedBytes);
|
360
|
+
|
361
|
+
// Decode the decompressed bytes into a UTF-8 string
|
362
|
+
const jsonString = new TextDecoder().decode(decompressedBytes);
|
363
|
+
|
364
|
+
// Parse and return the JSON object
|
365
|
+
return JSON.parse(jsonString);
|
366
|
+
```
|
367
|
+
|
368
|
+
## HTTP Status Codes Returned for Skipped Pages
|
369
|
+
In scanPagesSummary.json and scanPagesDetail,json, within each `pagesNotScanned`, the following HTTP and Metadata is stored to provide a reason why the apge could not be scanned.
|
370
|
+
|
371
|
+
| httpStatusCode | metadata |
|
372
|
+
|------|------------------------------------------------|
|
373
|
+
| 0 | Page Excluded |
|
374
|
+
| 1 | Not A Supported Document |
|
375
|
+
| 2 | Web Crawler Errored |
|
376
|
+
| 100 | 100 – Continue |
|
377
|
+
| 101 | 101 – Switching Protocols |
|
378
|
+
| 102 | 102 – Processing |
|
379
|
+
| 103 | 103 – Early Hints |
|
380
|
+
| 200 | 200 – However Page Could Not Be Scanned |
|
381
|
+
| 204 | 204 – No Content |
|
382
|
+
| 205 | 205 – Reset Content |
|
383
|
+
| 300 | 300 – Multiple Choices |
|
384
|
+
| 301 | 301 – Moved Permanently |
|
385
|
+
| 302 | 302 – Found |
|
386
|
+
| 303 | 303 – See Other |
|
387
|
+
| 304 | 304 – Not Modified |
|
388
|
+
| 305 | 305 – Use Proxy |
|
389
|
+
| 307 | 307 – Temporary Redirect |
|
390
|
+
| 308 | 308 – Permanent Redirect |
|
391
|
+
| 400 | 400 – Bad Request |
|
392
|
+
| 401 | 401 – Unauthorized |
|
393
|
+
| 402 | 402 – Payment Required |
|
394
|
+
| 403 | 403 – Forbidden |
|
395
|
+
| 404 | 404 – Not Found |
|
396
|
+
| 405 | 405 – Method Not Allowed |
|
397
|
+
| 406 | 406 – Not Acceptable |
|
398
|
+
| 407 | 407 – Proxy Authentication Required |
|
399
|
+
| 408 | 408 – Request Timeout |
|
400
|
+
| 409 | 409 – Conflict |
|
401
|
+
| 410 | 410 – Gone |
|
402
|
+
| 411 | 411 – Length Required |
|
403
|
+
| 412 | 412 – Precondition Failed |
|
404
|
+
| 413 | 413 – Payload Too Large |
|
405
|
+
| 414 | 414 – URI Too Long |
|
406
|
+
| 415 | 415 – Unsupported Media Type |
|
407
|
+
| 416 | 416 – Range Not Satisfiable |
|
408
|
+
| 417 | 417 – Expectation Failed |
|
409
|
+
| 418 | 418 – I’m a teapot |
|
410
|
+
| 421 | 421 – Misdirected Request |
|
411
|
+
| 422 | 422 – Unprocessable Content |
|
412
|
+
| 423 | 423 – Locked |
|
413
|
+
| 424 | 424 – Failed Dependency |
|
414
|
+
| 425 | 425 – Too Early |
|
415
|
+
| 426 | 426 – Upgrade Required |
|
416
|
+
| 428 | 428 – Precondition Required |
|
417
|
+
| 429 | 429 – Too Many Requests |
|
418
|
+
| 431 | 431 – Request Header Fields Too Large |
|
419
|
+
| 451 | 451 – Unavailable For Legal Reasons |
|
420
|
+
| 500 | 500 – Internal Server Error |
|
421
|
+
| 501 | 501 – Not Implemented |
|
422
|
+
| 502 | 502 – Bad Gateway |
|
423
|
+
| 503 | 503 – Service Unavailable |
|
424
|
+
| 504 | 504 – Gateway Timeout |
|
425
|
+
| 505 | 505 – HTTP Version Not Supported |
|
426
|
+
| 506 | 506 – Variant Also Negotiates |
|
427
|
+
| 507 | 507 – Insufficient Storage |
|
428
|
+
| 508 | 508 – Loop Detected |
|
429
|
+
| 510 | 510 – Not Extended |
|
430
|
+
| 511 | 511 – Network Authentication Required |
|
431
|
+
| 599 | Uncommon Response Code Received |
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@govtechsg/oobee",
|
3
3
|
"main": "dist/npmIndex.js",
|
4
|
-
"version": "0.10.
|
4
|
+
"version": "0.10.43",
|
5
5
|
"type": "module",
|
6
6
|
"author": "Government Technology Agency <info@tech.gov.sg>",
|
7
7
|
"dependencies": {
|
@@ -46,6 +46,7 @@
|
|
46
46
|
"@types/fs-extra": "^11.0.4",
|
47
47
|
"@types/inquirer": "^9.0.7",
|
48
48
|
"@types/lodash": "^4.17.7",
|
49
|
+
"@types/mime-types": "^2.1.4",
|
49
50
|
"@types/safe-regex": "^1.1.6",
|
50
51
|
"@types/validator": "^13.11.10",
|
51
52
|
"@types/which": "^3.0.4",
|
@@ -97,4 +98,4 @@
|
|
97
98
|
"url": "https://github.com/GovTechSG/oobee/issues"
|
98
99
|
},
|
99
100
|
"homepage": "https://github.com/GovTechSG/oobee#readme"
|
100
|
-
}
|
101
|
+
}
|
package/src/cli.ts
CHANGED
@@ -137,9 +137,6 @@ Usage: npm run cli -- -c <crawler> -d <device> -w <viewport> -u <url> OPTIONS`,
|
|
137
137
|
printMessage([`Invalid blacklistedPatternsFilename file path. ${err}`], messageOptions);
|
138
138
|
process.exit(1);
|
139
139
|
}
|
140
|
-
|
141
|
-
// eslint-disable-next-line no-unreachable
|
142
|
-
return null;
|
143
140
|
})
|
144
141
|
.coerce('i', option => {
|
145
142
|
const { choices } = cliOptions.i;
|
@@ -241,7 +238,7 @@ const scanInit = async (argvs: Answers): Promise<string> => {
|
|
241
238
|
clonedDataDir,
|
242
239
|
updatedArgvs.playwrightDeviceDetailsObject,
|
243
240
|
isCustomFlow,
|
244
|
-
updatedArgvs.header,
|
241
|
+
parseHeaders(updatedArgvs.header),
|
245
242
|
);
|
246
243
|
switch (res.status) {
|
247
244
|
case statuses.success.code: {
|
@@ -255,17 +252,14 @@ const scanInit = async (argvs: Answers): Promise<string> => {
|
|
255
252
|
case statuses.unauthorised.code: {
|
256
253
|
printMessage([statuses.unauthorised.message], messageOptions);
|
257
254
|
process.exit(res.status);
|
258
|
-
break;
|
259
255
|
}
|
260
256
|
case statuses.cannotBeResolved.code: {
|
261
257
|
printMessage([statuses.cannotBeResolved.message], messageOptions);
|
262
258
|
process.exit(res.status);
|
263
|
-
break;
|
264
259
|
}
|
265
260
|
case statuses.systemError.code: {
|
266
261
|
printMessage([statuses.systemError.message], messageOptions);
|
267
262
|
process.exit(res.status);
|
268
|
-
break;
|
269
263
|
}
|
270
264
|
case statuses.invalidUrl.code: {
|
271
265
|
if (
|
@@ -296,17 +290,14 @@ const scanInit = async (argvs: Answers): Promise<string> => {
|
|
296
290
|
case statuses.notASitemap.code: {
|
297
291
|
printMessage([statuses.notASitemap.message], messageOptions);
|
298
292
|
process.exit(res.status);
|
299
|
-
break;
|
300
293
|
}
|
301
294
|
case statuses.notALocalFile.code: {
|
302
295
|
printMessage([statuses.notALocalFile.message], messageOptions);
|
303
296
|
process.exit(res.status);
|
304
|
-
break;
|
305
297
|
}
|
306
298
|
case statuses.browserError.code: {
|
307
299
|
printMessage([statuses.browserError.message], messageOptions);
|
308
300
|
process.exit(res.status);
|
309
|
-
break;
|
310
301
|
}
|
311
302
|
default:
|
312
303
|
break;
|
@@ -362,7 +353,7 @@ const scanInit = async (argvs: Answers): Promise<string> => {
|
|
362
353
|
}
|
363
354
|
|
364
355
|
// Delete dataset and request queues
|
365
|
-
|
356
|
+
cleanUp(data.randomToken);
|
366
357
|
|
367
358
|
return getStoragePath(data.randomToken);
|
368
359
|
};
|