@a11y-skills/audit 0.2.0 → 0.3.0

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.
@@ -6,7 +6,50 @@
6
6
  * (e.g. an issue creator that reads `*-result.json`). They are intentionally
7
7
  * permissive (no `additionalProperties: false`) so that additive changes to a
8
8
  * result shape do not break downstream validation.
9
+ *
10
+ * Every check shares the same envelope (`source` / `url` / `timestamp` / the
11
+ * four normalized buckets / `summary` / `details` / `disclaimer`); the common
12
+ * pieces live in `$defs` and each check schema defines its own `details`.
9
13
  */
14
+ // =============================================================================
15
+ // Shared $defs
16
+ // =============================================================================
17
+ const NORMALIZED_NODE_SCHEMA = {
18
+ type: 'object',
19
+ required: ['target', 'html', 'htmlTruncated', 'failureSummary'],
20
+ properties: {
21
+ target: { type: 'array', items: { type: 'string' } },
22
+ html: { type: 'string' },
23
+ htmlTruncated: { type: 'boolean' },
24
+ failureSummary: { type: 'string' },
25
+ },
26
+ };
27
+ const NORMALIZED_RULE_RESULT_SCHEMA = {
28
+ type: 'object',
29
+ required: ['id', 'impact', 'description', 'help', 'helpUrl', 'tags', 'nodes'],
30
+ properties: {
31
+ id: { type: 'string' },
32
+ impact: {
33
+ type: ['string', 'null'],
34
+ enum: ['critical', 'serious', 'moderate', 'minor', null],
35
+ },
36
+ description: { type: 'string' },
37
+ help: { type: 'string' },
38
+ helpUrl: { type: 'string' },
39
+ tags: { type: 'array', items: { type: 'string' } },
40
+ nodes: { type: 'array', items: { $ref: '#/$defs/normalizedNode' } },
41
+ },
42
+ };
43
+ const SUMMARY_SCHEMA = {
44
+ type: 'object',
45
+ required: ['violationCount', 'incompleteCount', 'passCount'],
46
+ properties: {
47
+ violationCount: { type: 'number' },
48
+ incompleteCount: { type: 'number' },
49
+ passCount: { type: 'number' },
50
+ checkedNodes: { type: 'number' },
51
+ },
52
+ };
10
53
  const DISCLAIMER_SCHEMA = {
11
54
  type: 'object',
12
55
  properties: {
@@ -16,342 +59,395 @@ const DISCLAIMER_SCHEMA = {
16
59
  moreInfo: { type: 'string' },
17
60
  },
18
61
  };
19
- export const AXE_AUDIT_RESULT_SCHEMA = {
20
- $schema: 'https://json-schema.org/draft/2020-12/schema',
21
- $id: 'https://masup9.github.io/a11y-audit/schemas/axe-audit-result.json',
22
- title: 'AxeAuditResult',
23
- type: 'object',
24
- required: [
25
- 'url',
26
- 'timestamp',
27
- 'violations',
28
- 'passes',
29
- 'incomplete',
30
- 'inapplicable',
31
- 'violationCount',
32
- ],
33
- properties: {
34
- url: { type: 'string' },
35
- timestamp: { type: 'string' },
36
- violations: {
37
- type: 'array',
38
- items: {
39
- type: 'object',
40
- required: ['id', 'description', 'help', 'helpUrl', 'tags', 'nodes'],
41
- properties: {
42
- id: { type: 'string' },
43
- impact: { type: ['string', 'null'] },
44
- description: { type: 'string' },
45
- help: { type: 'string' },
46
- helpUrl: { type: 'string' },
47
- tags: { type: 'array', items: { type: 'string' } },
48
- nodes: {
49
- type: 'array',
50
- items: {
51
- type: 'object',
52
- required: ['html', 'target'],
53
- properties: {
54
- html: { type: 'string' },
55
- target: { type: 'array', items: { type: 'string' } },
56
- failureSummary: { type: ['string', 'null'] },
57
- },
58
- },
59
- },
60
- },
61
- },
62
+ const COMMON_DEFS = {
63
+ normalizedNode: NORMALIZED_NODE_SCHEMA,
64
+ normalizedRuleResult: NORMALIZED_RULE_RESULT_SCHEMA,
65
+ summary: SUMMARY_SCHEMA,
66
+ disclaimer: DISCLAIMER_SCHEMA,
67
+ };
68
+ const RULE_ARRAY = {
69
+ type: 'array',
70
+ items: { $ref: '#/$defs/normalizedRuleResult' },
71
+ };
72
+ /** Build the envelope schema for one check, plugging in its details schema. */
73
+ function buildEnvelopeSchema(args) {
74
+ return {
75
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
76
+ $id: `https://masup9.github.io/a11y-audit/schemas/${args.id}.json`,
77
+ title: args.title,
78
+ type: 'object',
79
+ required: [
80
+ 'source',
81
+ 'url',
82
+ 'timestamp',
83
+ 'violations',
84
+ 'incomplete',
85
+ 'passes',
86
+ 'inapplicable',
87
+ 'summary',
88
+ 'details',
89
+ 'disclaimer',
90
+ ],
91
+ properties: {
92
+ source: { const: args.source },
93
+ url: { type: 'string' },
94
+ timestamp: { type: 'string' },
95
+ violations: RULE_ARRAY,
96
+ incomplete: RULE_ARRAY,
97
+ passes: RULE_ARRAY,
98
+ inapplicable: RULE_ARRAY,
99
+ summary: { $ref: '#/$defs/summary' },
100
+ details: args.details,
101
+ disclaimer: { $ref: '#/$defs/disclaimer' },
62
102
  },
63
- passes: { type: 'number' },
64
- incomplete: { type: 'number' },
65
- inapplicable: { type: 'number' },
66
- violationCount: { type: 'number' },
67
- disclaimer: DISCLAIMER_SCHEMA,
68
- },
103
+ $defs: COMMON_DEFS,
104
+ };
105
+ }
106
+ // =============================================================================
107
+ // Detail building blocks
108
+ // =============================================================================
109
+ const ELEMENT_EVIDENCE_PROPS = {
110
+ selector: { type: 'string' },
111
+ tagName: { type: 'string' },
112
+ html: { type: 'string' },
113
+ htmlTruncated: { type: 'boolean' },
69
114
  };
70
115
  const FOCUS_ELEMENT_REF_SCHEMA = {
71
116
  type: 'object',
72
- required: ['tag', 'name', 'selector'],
117
+ required: ['tag', 'name', 'selector', 'html', 'htmlTruncated'],
73
118
  properties: {
74
119
  tag: { type: 'string' },
75
120
  role: { type: ['string', 'null'] },
76
121
  name: { type: 'string' },
77
122
  selector: { type: 'string' },
123
+ html: { type: 'string' },
124
+ htmlTruncated: { type: 'boolean' },
78
125
  },
79
126
  };
80
- export const FOCUS_CHECK_RESULT_SCHEMA = {
81
- $schema: 'https://json-schema.org/draft/2020-12/schema',
82
- $id: 'https://masup9.github.io/a11y-audit/schemas/focus-check-result.json',
83
- title: 'FocusCheckResult',
84
- type: 'object',
85
- required: [
86
- 'url',
87
- 'totalFocusableElements',
88
- 'elementsWithFocusStyle',
89
- 'elementsWithoutFocusStyle',
90
- 'issues',
91
- 'onFocusViolations',
92
- 'focusObscuredIssues',
93
- 'elementsWithObscuredFocus',
94
- 'allElements',
95
- 'interrupted',
96
- 'screenshotPath',
97
- ],
98
- properties: {
99
- url: { type: 'string' },
100
- totalFocusableElements: { type: 'number' },
101
- elementsWithFocusStyle: { type: 'number' },
102
- elementsWithoutFocusStyle: { type: 'number' },
103
- issues: {
104
- type: 'array',
105
- items: {
106
- type: 'object',
107
- required: ['tag', 'name'],
108
- properties: {
109
- tag: { type: 'string' },
110
- role: { type: ['string', 'null'] },
111
- name: { type: 'string' },
112
- },
113
- },
127
+ // =============================================================================
128
+ // Check schemas
129
+ // =============================================================================
130
+ export const AXE_AUDIT_RESULT_SCHEMA = buildEnvelopeSchema({
131
+ id: 'axe-audit-result',
132
+ title: 'AxeAuditResult',
133
+ source: 'axe-audit',
134
+ details: {
135
+ type: 'object',
136
+ required: [
137
+ 'tagsRun',
138
+ 'rulesOverride',
139
+ 'violationRuleCount',
140
+ 'passRuleCount',
141
+ 'incompleteRuleCount',
142
+ 'inapplicableRuleCount',
143
+ ],
144
+ properties: {
145
+ tagsRun: { type: 'array', items: { type: 'string' } },
146
+ rulesOverride: { type: ['object', 'null'] },
147
+ violationRuleCount: { type: 'number' },
148
+ passRuleCount: { type: 'number' },
149
+ incompleteRuleCount: { type: 'number' },
150
+ inapplicableRuleCount: { type: 'number' },
114
151
  },
115
- onFocusViolations: {
116
- type: 'array',
117
- items: {
118
- type: 'object',
119
- required: ['element', 'fromUrl', 'toUrl', 'changeType'],
120
- properties: {
121
- element: FOCUS_ELEMENT_REF_SCHEMA,
122
- fromUrl: { type: 'string' },
123
- toUrl: { type: 'string' },
124
- changeType: {
125
- type: 'string',
126
- enum: ['navigation', 'new-window', 'dialog'],
152
+ },
153
+ });
154
+ export const FOCUS_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
155
+ id: 'focus-check-result',
156
+ title: 'FocusCheckResult',
157
+ source: 'focus-indicator-check',
158
+ details: {
159
+ type: 'object',
160
+ required: [
161
+ 'totalFocusableElements',
162
+ 'elementsWithFocusStyle',
163
+ 'elementsWithoutFocusStyle',
164
+ 'issues',
165
+ 'onFocusViolations',
166
+ 'focusObscuredIssues',
167
+ 'elementsWithObscuredFocus',
168
+ 'allElements',
169
+ 'interrupted',
170
+ 'screenshotPath',
171
+ ],
172
+ properties: {
173
+ totalFocusableElements: { type: 'number' },
174
+ elementsWithFocusStyle: { type: 'number' },
175
+ elementsWithoutFocusStyle: { type: 'number' },
176
+ issues: { type: 'array', items: FOCUS_ELEMENT_REF_SCHEMA },
177
+ onFocusViolations: {
178
+ type: 'array',
179
+ items: {
180
+ type: 'object',
181
+ required: ['element', 'fromUrl', 'toUrl', 'changeType'],
182
+ properties: {
183
+ element: FOCUS_ELEMENT_REF_SCHEMA,
184
+ fromUrl: { type: 'string' },
185
+ toUrl: { type: 'string' },
186
+ changeType: {
187
+ type: 'string',
188
+ enum: ['navigation', 'new-window', 'dialog'],
189
+ },
127
190
  },
128
191
  },
129
192
  },
130
- },
131
- focusObscuredIssues: {
132
- type: 'array',
133
- items: {
134
- type: 'object',
135
- required: ['element', 'elementRect', 'overlaps', 'obscuredRatio'],
136
- properties: {
137
- element: FOCUS_ELEMENT_REF_SCHEMA,
138
- elementRect: { type: 'object' },
139
- overlaps: { type: 'array', items: { type: 'object' } },
140
- obscuredRatio: { type: 'number' },
193
+ focusObscuredIssues: {
194
+ type: 'array',
195
+ items: {
196
+ type: 'object',
197
+ required: ['element', 'elementRect', 'overlaps', 'obscuredRatio'],
198
+ properties: {
199
+ element: FOCUS_ELEMENT_REF_SCHEMA,
200
+ elementRect: { type: 'object' },
201
+ overlaps: { type: 'array', items: { type: 'object' } },
202
+ obscuredRatio: { type: 'number' },
203
+ },
141
204
  },
142
205
  },
206
+ elementsWithObscuredFocus: { type: 'number' },
207
+ allElements: { type: 'array', items: { type: 'object' } },
208
+ interrupted: { type: 'boolean' },
209
+ interruptedAt: { type: 'number' },
210
+ screenshotPath: { type: 'string' },
143
211
  },
144
- elementsWithObscuredFocus: { type: 'number' },
145
- allElements: { type: 'array', items: { type: 'object' } },
146
- interrupted: { type: 'boolean' },
147
- interruptedAt: { type: 'number' },
148
- screenshotPath: { type: 'string' },
149
- disclaimer: DISCLAIMER_SCHEMA,
150
212
  },
151
- };
152
- export const REFLOW_CHECK_RESULT_SCHEMA = {
153
- $schema: 'https://json-schema.org/draft/2020-12/schema',
154
- $id: 'https://masup9.github.io/a11y-audit/schemas/reflow-check-result.json',
213
+ });
214
+ export const REFLOW_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
215
+ id: 'reflow-check-result',
155
216
  title: 'ReflowCheckResult',
156
- type: 'object',
157
- required: [
158
- 'url',
159
- 'viewport',
160
- 'hasHorizontalScroll',
161
- 'documentScrollWidth',
162
- 'documentClientWidth',
163
- 'overflowingElements',
164
- 'clippedTextElements',
165
- ],
166
- properties: {
167
- url: { type: 'string' },
168
- viewport: {
169
- type: 'object',
170
- required: ['width', 'height'],
171
- properties: {
172
- width: { type: 'number' },
173
- height: { type: 'number' },
174
- },
175
- },
176
- hasHorizontalScroll: { type: 'boolean' },
177
- documentScrollWidth: { type: 'number' },
178
- documentClientWidth: { type: 'number' },
179
- overflowingElements: {
180
- type: 'array',
181
- items: {
217
+ source: 'reflow-check',
218
+ details: {
219
+ type: 'object',
220
+ required: [
221
+ 'viewport',
222
+ 'hasHorizontalScroll',
223
+ 'documentScrollWidth',
224
+ 'documentClientWidth',
225
+ 'overflowingElements',
226
+ 'clippedTextElements',
227
+ ],
228
+ properties: {
229
+ viewport: {
182
230
  type: 'object',
183
- required: ['selector', 'tagName', 'rect', 'viewportWidth', 'reason'],
231
+ required: ['width', 'height'],
184
232
  properties: {
185
- selector: { type: 'string' },
186
- tagName: { type: 'string' },
187
- rect: { type: 'object' },
188
- viewportWidth: { type: 'number' },
189
- reason: {
190
- type: 'string',
191
- enum: ['overflow-right', 'overflow-left', 'clipped-text'],
233
+ width: { type: 'number' },
234
+ height: { type: 'number' },
235
+ },
236
+ },
237
+ hasHorizontalScroll: { type: 'boolean' },
238
+ documentScrollWidth: { type: 'number' },
239
+ documentClientWidth: { type: 'number' },
240
+ overflowingElements: {
241
+ type: 'array',
242
+ items: {
243
+ type: 'object',
244
+ required: [
245
+ 'selector',
246
+ 'tagName',
247
+ 'html',
248
+ 'htmlTruncated',
249
+ 'rect',
250
+ 'viewportWidth',
251
+ 'reason',
252
+ ],
253
+ properties: {
254
+ ...ELEMENT_EVIDENCE_PROPS,
255
+ rect: { type: 'object' },
256
+ viewportWidth: { type: 'number' },
257
+ reason: {
258
+ type: 'string',
259
+ enum: ['overflow-right', 'overflow-left', 'clipped-text'],
260
+ },
192
261
  },
193
262
  },
194
263
  },
264
+ clippedTextElements: { type: 'array', items: { type: 'object' } },
195
265
  },
196
- clippedTextElements: { type: 'array', items: { type: 'object' } },
197
- disclaimer: DISCLAIMER_SCHEMA,
198
266
  },
199
- };
200
- export const TARGET_SIZE_CHECK_RESULT_SCHEMA = {
201
- $schema: 'https://json-schema.org/draft/2020-12/schema',
202
- $id: 'https://masup9.github.io/a11y-audit/schemas/target-size-check-result.json',
267
+ });
268
+ export const TARGET_SIZE_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
269
+ id: 'target-size-check-result',
203
270
  title: 'TargetSizeCheckResult',
204
- type: 'object',
205
- required: [
206
- 'url',
207
- 'totalTargetsChecked',
208
- 'failAA',
209
- 'failAAAOnly',
210
- 'passedTargets',
211
- 'exceptedTargets',
212
- 'summary',
213
- ],
214
- properties: {
215
- url: { type: 'string' },
216
- totalTargetsChecked: { type: 'number' },
217
- failAA: { type: 'array', items: { type: 'object' } },
218
- failAAAOnly: { type: 'array', items: { type: 'object' } },
219
- passedTargets: { type: 'number' },
220
- exceptedTargets: { type: 'array', items: { type: 'object' } },
221
- summary: {
222
- type: 'object',
223
- required: [
224
- 'failAACount',
225
- 'failAAAOnlyCount',
226
- 'passCount',
227
- 'exceptedCount',
228
- ],
229
- properties: {
230
- failAACount: { type: 'number' },
231
- failAAAOnlyCount: { type: 'number' },
232
- passCount: { type: 'number' },
233
- exceptedCount: { type: 'number' },
271
+ source: 'target-size-check',
272
+ details: {
273
+ type: 'object',
274
+ required: [
275
+ 'totalTargetsChecked',
276
+ 'failAA',
277
+ 'failAAAOnly',
278
+ 'passedTargets',
279
+ 'exceptedTargets',
280
+ 'summary',
281
+ ],
282
+ properties: {
283
+ totalTargetsChecked: { type: 'number' },
284
+ failAA: {
285
+ type: 'array',
286
+ items: {
287
+ type: 'object',
288
+ required: [
289
+ 'selector',
290
+ 'tagName',
291
+ 'html',
292
+ 'htmlTruncated',
293
+ 'width',
294
+ 'height',
295
+ 'minDimension',
296
+ 'level',
297
+ 'exceptionAssessment',
298
+ ],
299
+ properties: {
300
+ ...ELEMENT_EVIDENCE_PROPS,
301
+ role: { type: ['string', 'null'] },
302
+ accessibleName: { type: ['string', 'null'] },
303
+ width: { type: 'number' },
304
+ height: { type: 'number' },
305
+ minDimension: { type: 'number' },
306
+ level: {
307
+ type: 'string',
308
+ enum: ['fail-aa', 'fail-aaa-only', 'pass'],
309
+ },
310
+ exception: { type: ['string', 'null'] },
311
+ exceptionDetails: { type: ['string', 'null'] },
312
+ exceptionAssessment: {
313
+ type: 'string',
314
+ enum: ['ruled-out', 'possible', 'not-assessed'],
315
+ },
316
+ href: { type: ['string', 'null'] },
317
+ },
318
+ },
319
+ },
320
+ failAAAOnly: { type: 'array', items: { type: 'object' } },
321
+ passedTargets: { type: 'number' },
322
+ exceptedTargets: { type: 'array', items: { type: 'object' } },
323
+ summary: {
324
+ type: 'object',
325
+ required: [
326
+ 'failAACount',
327
+ 'failAAAOnlyCount',
328
+ 'passCount',
329
+ 'exceptedCount',
330
+ ],
331
+ properties: {
332
+ failAACount: { type: 'number' },
333
+ failAAAOnlyCount: { type: 'number' },
334
+ passCount: { type: 'number' },
335
+ exceptedCount: { type: 'number' },
336
+ },
234
337
  },
235
338
  },
236
- disclaimer: DISCLAIMER_SCHEMA,
237
339
  },
238
- };
239
- export const TEXT_SPACING_CHECK_RESULT_SCHEMA = {
240
- $schema: 'https://json-schema.org/draft/2020-12/schema',
241
- $id: 'https://masup9.github.io/a11y-audit/schemas/text-spacing-check-result.json',
340
+ });
341
+ export const TEXT_SPACING_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
342
+ id: 'text-spacing-check-result',
242
343
  title: 'TextSpacingCheckResult',
243
- type: 'object',
244
- required: ['url', 'clippedElements', 'totalElementsChecked'],
245
- properties: {
246
- url: { type: 'string' },
247
- clippedElements: { type: 'array', items: { type: 'object' } },
248
- totalElementsChecked: { type: 'number' },
249
- disclaimer: DISCLAIMER_SCHEMA,
344
+ source: 'text-spacing-check',
345
+ details: {
346
+ type: 'object',
347
+ required: ['clippedElements', 'totalElementsChecked'],
348
+ properties: {
349
+ clippedElements: { type: 'array', items: { type: 'object' } },
350
+ totalElementsChecked: { type: 'number' },
351
+ },
250
352
  },
251
- };
252
- export const ZOOM_CHECK_RESULT_SCHEMA = {
253
- $schema: 'https://json-schema.org/draft/2020-12/schema',
254
- $id: 'https://masup9.github.io/a11y-audit/schemas/zoom-check-result.json',
353
+ });
354
+ export const ZOOM_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
355
+ id: 'zoom-check-result',
255
356
  title: 'ZoomCheckResult',
256
- type: 'object',
257
- required: [
258
- 'url',
259
- 'zoomFactor',
260
- 'viewport',
261
- 'hasHorizontalScroll',
262
- 'documentScrollWidth',
263
- 'documentClientWidth',
264
- 'clippedElements',
265
- ],
266
- properties: {
267
- url: { type: 'string' },
268
- zoomFactor: { type: 'number' },
269
- viewport: { type: 'object' },
270
- hasHorizontalScroll: { type: 'boolean' },
271
- documentScrollWidth: { type: 'number' },
272
- documentClientWidth: { type: 'number' },
273
- clippedElements: { type: 'array', items: { type: 'object' } },
274
- disclaimer: DISCLAIMER_SCHEMA,
357
+ source: 'zoom-200-check',
358
+ details: {
359
+ type: 'object',
360
+ required: [
361
+ 'zoomFactor',
362
+ 'viewport',
363
+ 'hasHorizontalScroll',
364
+ 'documentScrollWidth',
365
+ 'documentClientWidth',
366
+ 'clippedElements',
367
+ ],
368
+ properties: {
369
+ zoomFactor: { type: 'number' },
370
+ viewport: { type: 'object' },
371
+ hasHorizontalScroll: { type: 'boolean' },
372
+ documentScrollWidth: { type: 'number' },
373
+ documentClientWidth: { type: 'number' },
374
+ clippedElements: { type: 'array', items: { type: 'object' } },
375
+ },
275
376
  },
276
- };
277
- export const ORIENTATION_CHECK_RESULT_SCHEMA = {
278
- $schema: 'https://json-schema.org/draft/2020-12/schema',
279
- $id: 'https://masup9.github.io/a11y-audit/schemas/orientation-check-result.json',
377
+ });
378
+ export const ORIENTATION_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
379
+ id: 'orientation-check-result',
280
380
  title: 'OrientationCheckResult',
281
- type: 'object',
282
- required: ['url', 'portrait', 'landscape', 'hasOrientationLock', 'lockDetectedIn'],
283
- properties: {
284
- url: { type: 'string' },
285
- portrait: { type: 'object' },
286
- landscape: { type: 'object' },
287
- hasOrientationLock: { type: 'boolean' },
288
- lockDetectedIn: {
289
- type: 'string',
290
- enum: ['portrait', 'landscape', 'both', 'none'],
381
+ source: 'orientation-check',
382
+ details: {
383
+ type: 'object',
384
+ required: ['portrait', 'landscape', 'hasOrientationLock', 'lockDetectedIn'],
385
+ properties: {
386
+ portrait: { type: 'object' },
387
+ landscape: { type: 'object' },
388
+ hasOrientationLock: { type: 'boolean' },
389
+ lockDetectedIn: {
390
+ type: 'string',
391
+ enum: ['portrait', 'landscape', 'both', 'none'],
392
+ },
291
393
  },
292
- disclaimer: DISCLAIMER_SCHEMA,
293
394
  },
294
- };
295
- export const AUTOCOMPLETE_AUDIT_RESULT_SCHEMA = {
296
- $schema: 'https://json-schema.org/draft/2020-12/schema',
297
- $id: 'https://masup9.github.io/a11y-audit/schemas/autocomplete-audit-result.json',
395
+ });
396
+ export const AUTOCOMPLETE_AUDIT_RESULT_SCHEMA = buildEnvelopeSchema({
397
+ id: 'autocomplete-audit-result',
298
398
  title: 'AutocompleteAuditResult',
299
- type: 'object',
300
- required: [
301
- 'url',
302
- 'totalFieldsChecked',
303
- 'missingAutocomplete',
304
- 'invalidAutocomplete',
305
- ],
306
- properties: {
307
- url: { type: 'string' },
308
- totalFieldsChecked: { type: 'number' },
309
- missingAutocomplete: { type: 'array', items: { type: 'object' } },
310
- invalidAutocomplete: { type: 'array', items: { type: 'object' } },
311
- disclaimer: DISCLAIMER_SCHEMA,
399
+ source: 'autocomplete-audit',
400
+ details: {
401
+ type: 'object',
402
+ required: ['totalFieldsChecked', 'missingAutocomplete', 'invalidAutocomplete'],
403
+ properties: {
404
+ totalFieldsChecked: { type: 'number' },
405
+ missingAutocomplete: { type: 'array', items: { type: 'object' } },
406
+ invalidAutocomplete: { type: 'array', items: { type: 'object' } },
407
+ },
312
408
  },
313
- };
314
- export const TIME_LIMIT_DETECTOR_RESULT_SCHEMA = {
315
- $schema: 'https://json-schema.org/draft/2020-12/schema',
316
- $id: 'https://masup9.github.io/a11y-audit/schemas/time-limit-detector-result.json',
409
+ });
410
+ export const TIME_LIMIT_DETECTOR_RESULT_SCHEMA = buildEnvelopeSchema({
411
+ id: 'time-limit-detector-result',
317
412
  title: 'TimeLimitDetectorResult',
318
- type: 'object',
319
- required: ['url', 'metaRefresh', 'timers', 'countdownIndicators', 'hasTimeLimits'],
320
- properties: {
321
- url: { type: 'string' },
322
- metaRefresh: { type: 'array', items: { type: 'object' } },
323
- timers: { type: 'array', items: { type: 'object' } },
324
- countdownIndicators: { type: 'array', items: { type: 'object' } },
325
- hasTimeLimits: { type: 'boolean' },
326
- disclaimer: DISCLAIMER_SCHEMA,
413
+ source: 'time-limit-detector',
414
+ details: {
415
+ type: 'object',
416
+ required: ['metaRefresh', 'timers', 'countdownIndicators', 'hasTimeLimits'],
417
+ properties: {
418
+ metaRefresh: { type: 'array', items: { type: 'object' } },
419
+ timers: { type: 'array', items: { type: 'object' } },
420
+ countdownIndicators: { type: 'array', items: { type: 'object' } },
421
+ hasTimeLimits: { type: 'boolean' },
422
+ },
327
423
  },
328
- };
329
- export const AUTO_PLAY_DETECTION_RESULT_SCHEMA = {
330
- $schema: 'https://json-schema.org/draft/2020-12/schema',
331
- $id: 'https://masup9.github.io/a11y-audit/schemas/auto-play-detection-result.json',
424
+ });
425
+ export const AUTO_PLAY_DETECTION_RESULT_SCHEMA = buildEnvelopeSchema({
426
+ id: 'auto-play-detection-result',
332
427
  title: 'AutoPlayDetectionResult',
333
- type: 'object',
334
- required: [
335
- 'url',
336
- 'screenshotRecords',
337
- 'comparisons',
338
- 'hasAutoPlayContent',
339
- 'stopsWithin5Seconds',
340
- 'pauseControls',
341
- 'pauseVerification',
342
- 'recommendation',
343
- ],
344
- properties: {
345
- url: { type: 'string' },
346
- screenshotRecords: { type: 'array', items: { type: 'object' } },
347
- comparisons: { type: 'array', items: { type: 'object' } },
348
- hasAutoPlayContent: { type: 'boolean' },
349
- stopsWithin5Seconds: { type: 'boolean' },
350
- pauseControls: { type: 'object' },
351
- pauseVerification: { type: 'object' },
352
- recommendation: { type: 'string' },
428
+ source: 'auto-play-detection',
429
+ details: {
430
+ type: 'object',
431
+ required: [
432
+ 'screenshotRecords',
433
+ 'comparisons',
434
+ 'hasAutoPlayContent',
435
+ 'stopsWithin5Seconds',
436
+ 'pauseControls',
437
+ 'pauseVerification',
438
+ 'recommendation',
439
+ ],
440
+ properties: {
441
+ screenshotRecords: { type: 'array', items: { type: 'object' } },
442
+ comparisons: { type: 'array', items: { type: 'object' } },
443
+ hasAutoPlayContent: { type: 'boolean' },
444
+ stopsWithin5Seconds: { type: 'boolean' },
445
+ pauseControls: { type: 'object' },
446
+ pauseVerification: { type: 'object' },
447
+ recommendation: { type: 'string' },
448
+ },
353
449
  },
354
- };
450
+ });
355
451
  /** All result schemas keyed by check id. */
356
452
  export const RESULT_SCHEMAS = {
357
453
  'axe-audit': AXE_AUDIT_RESULT_SCHEMA,