@a11ied/contracts 0.0.0-placeholder → 0.1.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.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/index.d.ts +5345 -0
- package/dist/index.js +1651 -0
- package/package.json +42 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,1651 @@
|
|
|
1
|
+
// src/schemas/core.ts
|
|
2
|
+
import { z as z6 } from "zod";
|
|
3
|
+
|
|
4
|
+
// src/schemas/browser.ts
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
var browserAutomationCandidateSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
label: z.string(),
|
|
9
|
+
source: z.enum(["system", "playwright"]),
|
|
10
|
+
launchMode: z.enum(["channel", "executable-path", "playwright-bundled"]),
|
|
11
|
+
location: z.string().optional()
|
|
12
|
+
});
|
|
13
|
+
var browserAutomationPolicySchema = z.object({
|
|
14
|
+
policyName: z.literal("system-browser-first"),
|
|
15
|
+
installCommand: z.string(),
|
|
16
|
+
preferredCandidate: browserAutomationCandidateSchema.optional(),
|
|
17
|
+
candidates: z.array(browserAutomationCandidateSchema)
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/schemas/driver-focus.ts
|
|
21
|
+
import { z as z3 } from "zod";
|
|
22
|
+
|
|
23
|
+
// src/schemas/platform.ts
|
|
24
|
+
import { z as z2 } from "zod";
|
|
25
|
+
var platformSchema = z2.enum(["voiceover", "nvda", "virtual"]);
|
|
26
|
+
|
|
27
|
+
// src/schemas/driver-focus.ts
|
|
28
|
+
var nativeInputPolicySchema = z3.enum([
|
|
29
|
+
"guarded",
|
|
30
|
+
"require-binding",
|
|
31
|
+
"development"
|
|
32
|
+
]);
|
|
33
|
+
var driverFocusMatchSchema = z3.enum(["contains", "exact"]);
|
|
34
|
+
var driverFocusTargetFieldsSchema = z3.object({
|
|
35
|
+
appName: z3.string().min(1).optional(),
|
|
36
|
+
bundleId: z3.string().min(1).optional(),
|
|
37
|
+
processName: z3.string().min(1).optional(),
|
|
38
|
+
pid: z3.number().int().positive().optional(),
|
|
39
|
+
windowTitle: z3.string().min(1).optional(),
|
|
40
|
+
match: driverFocusMatchSchema.optional()
|
|
41
|
+
});
|
|
42
|
+
var driverFocusTargetRefinement = (value, context) => {
|
|
43
|
+
if (!value.appName && !value.bundleId && !value.processName && !value.pid && !value.windowTitle) {
|
|
44
|
+
context.addIssue({
|
|
45
|
+
code: z3.ZodIssueCode.custom,
|
|
46
|
+
message: "Provide at least one focus identifier."
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var driverFocusTargetSchema = driverFocusTargetFieldsSchema.superRefine(
|
|
51
|
+
driverFocusTargetRefinement
|
|
52
|
+
);
|
|
53
|
+
var driverFocusStatusSchema = z3.enum([
|
|
54
|
+
"focused",
|
|
55
|
+
"not-found",
|
|
56
|
+
"skipped",
|
|
57
|
+
"failed"
|
|
58
|
+
]);
|
|
59
|
+
var driverFocusResultSchema = z3.object({
|
|
60
|
+
status: driverFocusStatusSchema,
|
|
61
|
+
target: driverFocusTargetSchema,
|
|
62
|
+
platform: platformSchema,
|
|
63
|
+
details: z3.array(z3.string()).optional()
|
|
64
|
+
});
|
|
65
|
+
var driverObservationSchema = z3.discriminatedUnion("status", [
|
|
66
|
+
z3.object({
|
|
67
|
+
status: z3.literal("observed"),
|
|
68
|
+
source: z3.string().min(1)
|
|
69
|
+
}),
|
|
70
|
+
z3.object({
|
|
71
|
+
status: z3.enum(["unavailable", "unsupported"]),
|
|
72
|
+
source: z3.string().min(1),
|
|
73
|
+
reason: z3.string().min(1),
|
|
74
|
+
code: z3.string().min(1).optional()
|
|
75
|
+
})
|
|
76
|
+
]);
|
|
77
|
+
var driverObservationsSchema = z3.object({
|
|
78
|
+
keyboardFocus: driverObservationSchema,
|
|
79
|
+
readerCursorIdentity: driverObservationSchema,
|
|
80
|
+
targetIdentity: driverObservationSchema
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/schemas/driver-navigation.ts
|
|
84
|
+
import { z as z4 } from "zod";
|
|
85
|
+
var MIN_HEADING_LEVEL = 1;
|
|
86
|
+
var MAX_HEADING_LEVEL = 6;
|
|
87
|
+
var driverNavigationKindSchema = z4.enum([
|
|
88
|
+
"item",
|
|
89
|
+
"heading",
|
|
90
|
+
"link",
|
|
91
|
+
"landmark",
|
|
92
|
+
"control",
|
|
93
|
+
"button",
|
|
94
|
+
"table",
|
|
95
|
+
"list",
|
|
96
|
+
"graphic",
|
|
97
|
+
"region",
|
|
98
|
+
"form-field"
|
|
99
|
+
]);
|
|
100
|
+
var driverNavigationDirectionSchema = z4.enum(["next", "previous"]);
|
|
101
|
+
var driverNavigatePayloadSchema = z4.object({
|
|
102
|
+
kind: driverNavigationKindSchema.default("item"),
|
|
103
|
+
/** Heading level 1 to 6; only meaningful with kind `heading`. */
|
|
104
|
+
level: z4.number().int().min(MIN_HEADING_LEVEL).max(MAX_HEADING_LEVEL).optional(),
|
|
105
|
+
/** How many times to repeat the move. Defaults to 1. */
|
|
106
|
+
times: z4.number().int().min(1).optional()
|
|
107
|
+
});
|
|
108
|
+
var driverNavigateRequestSchema = driverNavigatePayloadSchema.extend({
|
|
109
|
+
direction: driverNavigationDirectionSchema
|
|
110
|
+
});
|
|
111
|
+
var driverCurrentItemSchema = z4.object({
|
|
112
|
+
role: z4.string().optional(),
|
|
113
|
+
name: z4.string().optional(),
|
|
114
|
+
value: z4.string().optional(),
|
|
115
|
+
states: z4.array(z4.string()),
|
|
116
|
+
/** Heading level when the item is a heading. */
|
|
117
|
+
level: z4.number().int().optional(),
|
|
118
|
+
phrase: z4.string().optional(),
|
|
119
|
+
itemText: z4.string().optional(),
|
|
120
|
+
source: z4.string()
|
|
121
|
+
});
|
|
122
|
+
var driverFindPayloadSchema = z4.object({ text: z4.string().min(1) });
|
|
123
|
+
var driverTableMoveSchema = z4.enum([
|
|
124
|
+
"next-cell",
|
|
125
|
+
"previous-cell",
|
|
126
|
+
"next-row",
|
|
127
|
+
"previous-row",
|
|
128
|
+
"next-column",
|
|
129
|
+
"previous-column",
|
|
130
|
+
"row-header",
|
|
131
|
+
"column-header"
|
|
132
|
+
]);
|
|
133
|
+
var driverTablePayloadSchema = z4.object({ move: driverTableMoveSchema });
|
|
134
|
+
var DEFAULT_ELEMENTS_MAX = 200;
|
|
135
|
+
var DEFAULT_READ_ALL_MAX = 500;
|
|
136
|
+
var DEFAULT_GOTO_MAX = 500;
|
|
137
|
+
var driverElementsPayloadSchema = z4.object({
|
|
138
|
+
kind: driverNavigationKindSchema.exclude(["item"]),
|
|
139
|
+
max: z4.number().int().min(1).default(DEFAULT_ELEMENTS_MAX)
|
|
140
|
+
});
|
|
141
|
+
var driverReadAllPayloadSchema = z4.object({
|
|
142
|
+
max: z4.number().int().min(1).default(DEFAULT_READ_ALL_MAX)
|
|
143
|
+
});
|
|
144
|
+
var driverGotoPayloadSchema = z4.object({
|
|
145
|
+
role: z4.string().min(1).optional(),
|
|
146
|
+
name: z4.string().min(1).optional(),
|
|
147
|
+
max: z4.number().int().min(1).default(DEFAULT_GOTO_MAX)
|
|
148
|
+
}).refine((payload) => payload.role !== void 0 || payload.name !== void 0, {
|
|
149
|
+
message: "Provide a role, a name, or both."
|
|
150
|
+
});
|
|
151
|
+
var DEFAULT_WAIT_TIMEOUT_MS = 5e3;
|
|
152
|
+
var DEFAULT_WAIT_PAUSE_MS = 500;
|
|
153
|
+
var driverWaitPayloadSchema = z4.object({
|
|
154
|
+
for: z4.string().min(1).optional(),
|
|
155
|
+
since: z4.string().min(1).optional(),
|
|
156
|
+
/** Fixed pause when `for` is absent. */
|
|
157
|
+
ms: z4.number().int().nonnegative().optional(),
|
|
158
|
+
timeoutMs: z4.number().int().positive().default(DEFAULT_WAIT_TIMEOUT_MS)
|
|
159
|
+
});
|
|
160
|
+
var driverScreenshotPayloadSchema = z4.object({ path: z4.string().min(1) });
|
|
161
|
+
var driverLoopItemSchema = z4.object({
|
|
162
|
+
index: z4.number().int().positive(),
|
|
163
|
+
phrase: z4.string(),
|
|
164
|
+
role: z4.string().optional(),
|
|
165
|
+
name: z4.string().optional(),
|
|
166
|
+
level: z4.number().int().optional()
|
|
167
|
+
});
|
|
168
|
+
var driverLoopStopSchema = z4.enum(["end", "cap", "match", "time", "stalled"]);
|
|
169
|
+
var driverNavigationActionRequestSchemas = [
|
|
170
|
+
z4.object({
|
|
171
|
+
action: z4.literal("next"),
|
|
172
|
+
payload: driverNavigatePayloadSchema.optional()
|
|
173
|
+
}),
|
|
174
|
+
z4.object({
|
|
175
|
+
action: z4.literal("previous"),
|
|
176
|
+
payload: driverNavigatePayloadSchema.optional()
|
|
177
|
+
}),
|
|
178
|
+
z4.object({ action: z4.literal("find"), payload: driverFindPayloadSchema }),
|
|
179
|
+
z4.object({ action: z4.literal("table"), payload: driverTablePayloadSchema }),
|
|
180
|
+
z4.object({ action: z4.literal("elements"), payload: driverElementsPayloadSchema }),
|
|
181
|
+
z4.object({ action: z4.literal("read-all"), payload: driverReadAllPayloadSchema }),
|
|
182
|
+
z4.object({ action: z4.literal("goto"), payload: driverGotoPayloadSchema }),
|
|
183
|
+
z4.object({ action: z4.literal("wait"), payload: driverWaitPayloadSchema }),
|
|
184
|
+
z4.object({ action: z4.literal("screenshot"), payload: driverScreenshotPayloadSchema })
|
|
185
|
+
];
|
|
186
|
+
|
|
187
|
+
// src/schemas/driver-transcript.ts
|
|
188
|
+
import { z as z5 } from "zod";
|
|
189
|
+
var DEFAULT_DRIVER_TRANSCRIPT_LIMIT = 200;
|
|
190
|
+
var MAX_DRIVER_TRANSCRIPT_LIMIT = 1e3;
|
|
191
|
+
var driverTranscriptPayloadSchema = z5.object({
|
|
192
|
+
since: z5.string().min(1).optional().describe("Entries after the last matching checkpoint."),
|
|
193
|
+
tail: z5.number().int().nonnegative().optional().describe("Last N phrases, including intervening checkpoints."),
|
|
194
|
+
afterIndex: z5.number().int().min(-1).optional().describe(
|
|
195
|
+
"Entries after this session transcript index; -1 starts at the beginning."
|
|
196
|
+
),
|
|
197
|
+
limit: z5.number().int().positive().max(MAX_DRIVER_TRANSCRIPT_LIMIT).optional().describe("Maximum entries, including checkpoints.")
|
|
198
|
+
});
|
|
199
|
+
var driverTranscriptWindowSchema = z5.object({
|
|
200
|
+
totalEntries: z5.number().int().nonnegative(),
|
|
201
|
+
selectedEntries: z5.number().int().nonnegative(),
|
|
202
|
+
returnedEntries: z5.number().int().nonnegative(),
|
|
203
|
+
omittedEntries: z5.number().int().nonnegative(),
|
|
204
|
+
complete: z5.boolean(),
|
|
205
|
+
hasMore: z5.boolean(),
|
|
206
|
+
nextAfterIndex: z5.number().int().min(-1),
|
|
207
|
+
latestIndex: z5.number().int().min(-1),
|
|
208
|
+
rawLogsIncluded: z5.literal(false)
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// src/schemas/core.ts
|
|
212
|
+
var targetSchema = z6.object({
|
|
213
|
+
id: z6.string(),
|
|
214
|
+
platform: platformSchema,
|
|
215
|
+
os: z6.string(),
|
|
216
|
+
status: z6.enum(["ready", "requires-setup", "unsupported"]),
|
|
217
|
+
notes: z6.array(z6.string())
|
|
218
|
+
});
|
|
219
|
+
var doctorCheckStatusSchema = z6.enum(["pass", "warn", "fail"]);
|
|
220
|
+
var doctorCheckSchema = z6.object({
|
|
221
|
+
id: z6.string(),
|
|
222
|
+
label: z6.string(),
|
|
223
|
+
status: doctorCheckStatusSchema,
|
|
224
|
+
detail: z6.string().optional(),
|
|
225
|
+
action: z6.string().optional(),
|
|
226
|
+
actionLabel: z6.string().optional()
|
|
227
|
+
});
|
|
228
|
+
var doctorTargetSchema = targetSchema.extend({
|
|
229
|
+
summary: z6.string(),
|
|
230
|
+
checks: z6.array(doctorCheckSchema)
|
|
231
|
+
});
|
|
232
|
+
var doctorActionSchema = z6.object({
|
|
233
|
+
label: z6.string(),
|
|
234
|
+
command: z6.string(),
|
|
235
|
+
required: z6.boolean()
|
|
236
|
+
});
|
|
237
|
+
var doctorHostSchema = z6.object({
|
|
238
|
+
platform: z6.string(),
|
|
239
|
+
osName: z6.string(),
|
|
240
|
+
release: z6.string(),
|
|
241
|
+
arch: z6.string()
|
|
242
|
+
});
|
|
243
|
+
var doctorRequestSchema = z6.object({
|
|
244
|
+
task: z6.enum(["all", "scan", "reader", "audit"]).default("all"),
|
|
245
|
+
target: platformSchema.optional(),
|
|
246
|
+
recording: z6.boolean().default(false)
|
|
247
|
+
}).refine(
|
|
248
|
+
(request) => !request.recording || (request.task === "reader" || request.task === "audit") && request.target !== "virtual",
|
|
249
|
+
{
|
|
250
|
+
message: "Recording requires task reader or audit with a real reader.",
|
|
251
|
+
path: ["recording"]
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
var doctorReportSchema = z6.object({
|
|
255
|
+
request: doctorRequestSchema.optional(),
|
|
256
|
+
browserVersion: z6.string().optional(),
|
|
257
|
+
readerVersions: z6.partialRecord(platformSchema, z6.string()).optional(),
|
|
258
|
+
ready: z6.boolean(),
|
|
259
|
+
host: doctorHostSchema,
|
|
260
|
+
packageVersion: z6.string(),
|
|
261
|
+
nodeVersion: z6.string(),
|
|
262
|
+
npmVersion: z6.string(),
|
|
263
|
+
browserAutomation: browserAutomationPolicySchema,
|
|
264
|
+
targets: z6.array(doctorTargetSchema),
|
|
265
|
+
actions: z6.array(doctorActionSchema)
|
|
266
|
+
});
|
|
267
|
+
var cliCommandSchema = z6.object({
|
|
268
|
+
name: z6.string(),
|
|
269
|
+
summary: z6.string(),
|
|
270
|
+
maturity: z6.enum(["planned", "scaffolded", "ready"])
|
|
271
|
+
});
|
|
272
|
+
var cliCommandFamilySchema = z6.enum([
|
|
273
|
+
"wcag",
|
|
274
|
+
"pattern",
|
|
275
|
+
"search",
|
|
276
|
+
"sr",
|
|
277
|
+
"talkback",
|
|
278
|
+
"axe",
|
|
279
|
+
"tree",
|
|
280
|
+
"check",
|
|
281
|
+
"capture",
|
|
282
|
+
"audit",
|
|
283
|
+
"doctor",
|
|
284
|
+
"setup",
|
|
285
|
+
"mcp"
|
|
286
|
+
]);
|
|
287
|
+
var wcagVersionSchema = z6.enum(["2.1", "2.2"]);
|
|
288
|
+
var wcagLevelSchema = z6.enum(["A", "AA", "AAA"]);
|
|
289
|
+
var cliCommandDescriptorSchema = z6.object({
|
|
290
|
+
family: cliCommandFamilySchema,
|
|
291
|
+
subcommand: z6.string(),
|
|
292
|
+
version: z6.string(),
|
|
293
|
+
wcagVersion: wcagVersionSchema.optional()
|
|
294
|
+
});
|
|
295
|
+
var cliMessageSchema = z6.object({
|
|
296
|
+
code: z6.string(),
|
|
297
|
+
message: z6.string(),
|
|
298
|
+
details: z6.record(z6.string(), z6.unknown()).optional()
|
|
299
|
+
});
|
|
300
|
+
var cliEnvelopeMetaSchema = z6.object({
|
|
301
|
+
schemaVersion: z6.literal("1"),
|
|
302
|
+
startedAt: z6.string().datetime(),
|
|
303
|
+
completedAt: z6.string().datetime(),
|
|
304
|
+
durationMs: z6.number().int().nonnegative()
|
|
305
|
+
});
|
|
306
|
+
var cliOutputEnvelopeSchema = z6.object({
|
|
307
|
+
ok: z6.boolean(),
|
|
308
|
+
command: cliCommandDescriptorSchema,
|
|
309
|
+
target: z6.record(z6.string(), z6.unknown()).nullish(),
|
|
310
|
+
result: z6.record(z6.string(), z6.unknown()).nullish(),
|
|
311
|
+
warnings: z6.array(cliMessageSchema),
|
|
312
|
+
errors: z6.array(cliMessageSchema),
|
|
313
|
+
meta: cliEnvelopeMetaSchema
|
|
314
|
+
});
|
|
315
|
+
var cliExitCodes = {
|
|
316
|
+
success: 0,
|
|
317
|
+
usage: 2,
|
|
318
|
+
environment: 3,
|
|
319
|
+
assertion: 4,
|
|
320
|
+
internal: 5
|
|
321
|
+
};
|
|
322
|
+
var cliExitCodeSchema = z6.union([
|
|
323
|
+
z6.literal(cliExitCodes.success),
|
|
324
|
+
z6.literal(cliExitCodes.usage),
|
|
325
|
+
z6.literal(cliExitCodes.environment),
|
|
326
|
+
z6.literal(cliExitCodes.assertion),
|
|
327
|
+
z6.literal(cliExitCodes.internal)
|
|
328
|
+
]);
|
|
329
|
+
var portableDriverVerbSchema = z6.enum([
|
|
330
|
+
"next",
|
|
331
|
+
"previous",
|
|
332
|
+
"interact",
|
|
333
|
+
"stop-interacting",
|
|
334
|
+
"activate",
|
|
335
|
+
"top",
|
|
336
|
+
"bottom",
|
|
337
|
+
"escape"
|
|
338
|
+
]);
|
|
339
|
+
var driverActionNameSchema = z6.enum([
|
|
340
|
+
"start",
|
|
341
|
+
"status",
|
|
342
|
+
"stop",
|
|
343
|
+
"attach-document",
|
|
344
|
+
"focus",
|
|
345
|
+
...portableDriverVerbSchema.options,
|
|
346
|
+
"press",
|
|
347
|
+
"type",
|
|
348
|
+
"perform",
|
|
349
|
+
"read",
|
|
350
|
+
"transcript",
|
|
351
|
+
"checkpoint",
|
|
352
|
+
"title",
|
|
353
|
+
"find",
|
|
354
|
+
"table",
|
|
355
|
+
"elements",
|
|
356
|
+
"read-all",
|
|
357
|
+
"goto",
|
|
358
|
+
"wait",
|
|
359
|
+
"screenshot"
|
|
360
|
+
]);
|
|
361
|
+
var driverCapabilitySchema = driverActionNameSchema;
|
|
362
|
+
var driverModeSchema = z6.enum(["broker", "in-process"]);
|
|
363
|
+
var virtualEngineSchema = z6.enum(["browser", "jsdom"]);
|
|
364
|
+
var driverReadinessStatusSchema = z6.enum([
|
|
365
|
+
"ready",
|
|
366
|
+
"requires-setup",
|
|
367
|
+
"unsupported"
|
|
368
|
+
]);
|
|
369
|
+
var driverReadinessSchema = z6.object({
|
|
370
|
+
target: platformSchema,
|
|
371
|
+
status: driverReadinessStatusSchema,
|
|
372
|
+
summary: z6.string(),
|
|
373
|
+
details: z6.array(z6.string()),
|
|
374
|
+
setupCommand: z6.string().optional(),
|
|
375
|
+
debug: z6.record(z6.string(), z6.unknown()).optional()
|
|
376
|
+
});
|
|
377
|
+
var recordingFormatSchema = z6.enum(["mov", "mp4"]);
|
|
378
|
+
var recordingStatusSchema = z6.enum(["active", "completed", "failed"]);
|
|
379
|
+
var sessionRecordingSchema = z6.object({
|
|
380
|
+
path: z6.string().min(1),
|
|
381
|
+
format: recordingFormatSchema,
|
|
382
|
+
status: recordingStatusSchema,
|
|
383
|
+
startedAt: z6.string().datetime(),
|
|
384
|
+
stoppedAt: z6.string().datetime().optional()
|
|
385
|
+
});
|
|
386
|
+
var targetTypeSchema = z6.enum(["real", "simulated"]);
|
|
387
|
+
var accessibilityDriverSessionSchema = z6.object({
|
|
388
|
+
sessionId: z6.string().min(1),
|
|
389
|
+
target: platformSchema,
|
|
390
|
+
targetType: targetTypeSchema.default("simulated"),
|
|
391
|
+
startedAt: z6.string().datetime(),
|
|
392
|
+
capabilities: z6.array(driverCapabilitySchema),
|
|
393
|
+
logCursor: z6.number().int().nonnegative(),
|
|
394
|
+
brokerPid: z6.number().int().positive(),
|
|
395
|
+
socketPath: z6.string().min(1),
|
|
396
|
+
metadataFile: z6.string().min(1),
|
|
397
|
+
recording: sessionRecordingSchema.optional(),
|
|
398
|
+
/** The page the session opened, updated by attach-document. */
|
|
399
|
+
url: z6.string().optional(),
|
|
400
|
+
/** The app or browser window the session opened, used by a bare focus action. */
|
|
401
|
+
app: driverFocusTargetFieldsSchema.optional(),
|
|
402
|
+
browser: z6.string().min(1).optional(),
|
|
403
|
+
nativeInput: nativeInputPolicySchema.optional(),
|
|
404
|
+
idleTimeoutMinutes: z6.number().nonnegative().optional(),
|
|
405
|
+
/** The engine a virtual session runs in; absent for VoiceOver and NVDA. */
|
|
406
|
+
engine: virtualEngineSchema.optional()
|
|
407
|
+
});
|
|
408
|
+
var driverCheckpointSchema = z6.object({
|
|
409
|
+
label: z6.string(),
|
|
410
|
+
createdAt: z6.string().datetime()
|
|
411
|
+
});
|
|
412
|
+
var driverTranscriptEntrySchema = z6.object({
|
|
413
|
+
index: z6.number().int().nonnegative(),
|
|
414
|
+
at: z6.string().datetime(),
|
|
415
|
+
phrase: z6.string(),
|
|
416
|
+
itemText: z6.string().optional(),
|
|
417
|
+
checkpoint: z6.string().optional()
|
|
418
|
+
});
|
|
419
|
+
var driverTranscriptSchema = z6.object({
|
|
420
|
+
sessionId: z6.string().min(1).optional(),
|
|
421
|
+
target: platformSchema,
|
|
422
|
+
url: z6.string().optional(),
|
|
423
|
+
startedAt: z6.string().datetime(),
|
|
424
|
+
exportedAt: z6.string().datetime(),
|
|
425
|
+
entries: z6.array(driverTranscriptEntrySchema),
|
|
426
|
+
window: driverTranscriptWindowSchema.optional()
|
|
427
|
+
});
|
|
428
|
+
var driverTranscriptFormatSchema = z6.enum(["json", "md"]);
|
|
429
|
+
var axFocusedElementSchema = z6.object({
|
|
430
|
+
role: z6.string().optional(),
|
|
431
|
+
subrole: z6.string().optional(),
|
|
432
|
+
title: z6.string().optional(),
|
|
433
|
+
description: z6.string().optional(),
|
|
434
|
+
value: z6.string().optional(),
|
|
435
|
+
enabled: z6.boolean().optional()
|
|
436
|
+
});
|
|
437
|
+
var driverStateSnapshotSchema = z6.object({
|
|
438
|
+
observedAt: z6.string().datetime().optional(),
|
|
439
|
+
foreground: driverFocusTargetFieldsSchema.optional(),
|
|
440
|
+
lastSpokenPhrase: z6.string().nullish(),
|
|
441
|
+
currentItemText: z6.string().nullish(),
|
|
442
|
+
spokenPhraseLog: z6.array(z6.string()),
|
|
443
|
+
itemTextLog: z6.array(z6.string()),
|
|
444
|
+
logCursor: z6.number().int().nonnegative(),
|
|
445
|
+
checkpoints: z6.array(driverCheckpointSchema),
|
|
446
|
+
transcript: z6.array(driverTranscriptEntrySchema).default([]),
|
|
447
|
+
transcriptWindow: driverTranscriptWindowSchema.optional(),
|
|
448
|
+
axFocusedElement: axFocusedElementSchema.optional(),
|
|
449
|
+
currentItem: driverCurrentItemSchema.optional(),
|
|
450
|
+
observations: driverObservationsSchema.optional()
|
|
451
|
+
});
|
|
452
|
+
var driverActionResultSchema = z6.object({
|
|
453
|
+
session: accessibilityDriverSessionSchema,
|
|
454
|
+
action: driverActionNameSchema,
|
|
455
|
+
state: driverStateSnapshotSchema,
|
|
456
|
+
details: z6.record(z6.string(), z6.unknown()).optional(),
|
|
457
|
+
actionDurationMs: z6.number().nonnegative().optional()
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// src/schemas/driver-actions.ts
|
|
461
|
+
import { z as z7 } from "zod";
|
|
462
|
+
var driverPressPayloadSchema = z7.object({
|
|
463
|
+
keys: z7.array(z7.string().min(1)).min(1)
|
|
464
|
+
});
|
|
465
|
+
var driverTypePayloadSchema = z7.object({ text: z7.string() });
|
|
466
|
+
var driverPerformPayloadSchema = z7.object({
|
|
467
|
+
command: z7.string().min(1),
|
|
468
|
+
commandSet: z7.string().optional()
|
|
469
|
+
});
|
|
470
|
+
var driverCheckpointPayloadSchema = z7.object({ label: z7.string().min(1) });
|
|
471
|
+
var payloadFreeActionSchema = z7.enum([
|
|
472
|
+
...portableDriverVerbSchema.exclude(["next", "previous"]).options,
|
|
473
|
+
"read",
|
|
474
|
+
"title"
|
|
475
|
+
]);
|
|
476
|
+
var driverActionRequestSchema = z7.discriminatedUnion("action", [
|
|
477
|
+
z7.object({ action: payloadFreeActionSchema }),
|
|
478
|
+
z7.object({
|
|
479
|
+
action: z7.literal("transcript"),
|
|
480
|
+
payload: driverTranscriptPayloadSchema.optional()
|
|
481
|
+
}),
|
|
482
|
+
...driverNavigationActionRequestSchemas,
|
|
483
|
+
z7.object({ action: z7.literal("press"), payload: driverPressPayloadSchema }),
|
|
484
|
+
z7.object({ action: z7.literal("type"), payload: driverTypePayloadSchema }),
|
|
485
|
+
z7.object({ action: z7.literal("perform"), payload: driverPerformPayloadSchema }),
|
|
486
|
+
z7.object({ action: z7.literal("checkpoint"), payload: driverCheckpointPayloadSchema }),
|
|
487
|
+
z7.object({ action: z7.literal("focus"), payload: driverFocusTargetSchema.optional() })
|
|
488
|
+
]);
|
|
489
|
+
|
|
490
|
+
// src/schemas/driver-batch.ts
|
|
491
|
+
import { z as z8 } from "zod";
|
|
492
|
+
var driverBatchExpectStepSchema = z8.object({
|
|
493
|
+
action: z8.literal("expect"),
|
|
494
|
+
payload: z8.object({
|
|
495
|
+
match: z8.string().min(1),
|
|
496
|
+
since: z8.string().min(1).optional(),
|
|
497
|
+
not: z8.boolean().optional()
|
|
498
|
+
})
|
|
499
|
+
});
|
|
500
|
+
var driverBatchStepSchema = z8.union([
|
|
501
|
+
driverActionRequestSchema,
|
|
502
|
+
driverBatchExpectStepSchema
|
|
503
|
+
]);
|
|
504
|
+
|
|
505
|
+
// src/schemas/wcag.ts
|
|
506
|
+
import { z as z12 } from "zod";
|
|
507
|
+
|
|
508
|
+
// src/schemas/helpers.ts
|
|
509
|
+
import { z as z9 } from "zod";
|
|
510
|
+
var fourWayAutomationCountSchema = z9.object({
|
|
511
|
+
automated: z9.number().int().nonnegative(),
|
|
512
|
+
hybrid: z9.number().int().nonnegative(),
|
|
513
|
+
manual: z9.number().int().nonnegative(),
|
|
514
|
+
unknown: z9.number().int().nonnegative()
|
|
515
|
+
});
|
|
516
|
+
var techniqueReferenceSchema = z9.object({
|
|
517
|
+
key: z9.string(),
|
|
518
|
+
id: z9.string().optional(),
|
|
519
|
+
title: z9.string(),
|
|
520
|
+
technology: z9.string().optional(),
|
|
521
|
+
kind: z9.enum(["sufficient", "advisory", "failure"]),
|
|
522
|
+
url: z9.string().url().optional()
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// src/schemas/assessment.ts
|
|
526
|
+
import { z as z11 } from "zod";
|
|
527
|
+
|
|
528
|
+
// src/schemas/criterion.ts
|
|
529
|
+
import { z as z10 } from "zod";
|
|
530
|
+
var criterionIdSchema = z10.string().regex(/^\d+\.\d+\.\d+$/);
|
|
531
|
+
var criterionSlugSchema = z10.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
532
|
+
var criterionLookupKeySchema = z10.union([criterionIdSchema, criterionSlugSchema]);
|
|
533
|
+
|
|
534
|
+
// src/schemas/assessment.ts
|
|
535
|
+
var assessmentScopeSchema = z11.enum(["site", "journey", "state"]);
|
|
536
|
+
var procedureCoverageSchema = z11.object({
|
|
537
|
+
definedCriterionIds: z11.array(criterionIdSchema),
|
|
538
|
+
gapCriterionIds: z11.array(criterionIdSchema)
|
|
539
|
+
});
|
|
540
|
+
var assessmentProcedureSchema = z11.object({
|
|
541
|
+
procedureId: z11.string().min(1),
|
|
542
|
+
criterionId: criterionIdSchema,
|
|
543
|
+
title: z11.string().min(1),
|
|
544
|
+
scope: assessmentScopeSchema,
|
|
545
|
+
applicability: z11.string().min(1),
|
|
546
|
+
actions: z11.array(z11.string().min(1)).min(1),
|
|
547
|
+
evaluation: z11.object({
|
|
548
|
+
passed: z11.string().min(1),
|
|
549
|
+
failed: z11.string().min(1),
|
|
550
|
+
inapplicable: z11.string().min(1),
|
|
551
|
+
cantTell: z11.string().min(1)
|
|
552
|
+
}),
|
|
553
|
+
limitations: z11.array(z11.string().min(1)).min(1),
|
|
554
|
+
sources: z11.array(
|
|
555
|
+
z11.object({
|
|
556
|
+
kind: z11.enum(["normative", "informative"]),
|
|
557
|
+
url: z11.string().url()
|
|
558
|
+
})
|
|
559
|
+
).min(1)
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// src/schemas/wcag.ts
|
|
563
|
+
var axeImpactSchema = z12.enum(["minor", "moderate", "serious", "critical"]).nullish();
|
|
564
|
+
var axeNodeResultSchema = z12.object({
|
|
565
|
+
target: z12.array(z12.string()),
|
|
566
|
+
html: z12.string(),
|
|
567
|
+
failureSummary: z12.string().nullish()
|
|
568
|
+
});
|
|
569
|
+
var axeRuleResultSchema = z12.object({
|
|
570
|
+
id: z12.string(),
|
|
571
|
+
impact: axeImpactSchema,
|
|
572
|
+
description: z12.string(),
|
|
573
|
+
help: z12.string(),
|
|
574
|
+
helpUrl: z12.string().url(),
|
|
575
|
+
tags: z12.array(z12.string()),
|
|
576
|
+
nodes: z12.array(axeNodeResultSchema)
|
|
577
|
+
});
|
|
578
|
+
var axeSelectionSchema = z12.discriminatedUnion("kind", [
|
|
579
|
+
z12.object({
|
|
580
|
+
kind: z12.literal("all"),
|
|
581
|
+
resolvedRuleIds: z12.array(z12.string())
|
|
582
|
+
}),
|
|
583
|
+
z12.object({
|
|
584
|
+
kind: z12.literal("criterion"),
|
|
585
|
+
criterion: criterionLookupKeySchema,
|
|
586
|
+
resolvedRuleIds: z12.array(z12.string())
|
|
587
|
+
}),
|
|
588
|
+
z12.object({
|
|
589
|
+
kind: z12.literal("level"),
|
|
590
|
+
level: wcagLevelSchema,
|
|
591
|
+
resolvedRuleIds: z12.array(z12.string())
|
|
592
|
+
}),
|
|
593
|
+
z12.object({
|
|
594
|
+
kind: z12.literal("rule"),
|
|
595
|
+
ruleIds: z12.array(z12.string())
|
|
596
|
+
})
|
|
597
|
+
]);
|
|
598
|
+
var axeRunResultSchema = z12.object({
|
|
599
|
+
url: z12.string().min(1),
|
|
600
|
+
wcagVersion: wcagVersionSchema,
|
|
601
|
+
selection: axeSelectionSchema,
|
|
602
|
+
ruleIds: z12.array(z12.string()),
|
|
603
|
+
violations: z12.array(axeRuleResultSchema),
|
|
604
|
+
passes: z12.array(axeRuleResultSchema),
|
|
605
|
+
incomplete: z12.array(axeRuleResultSchema),
|
|
606
|
+
inapplicable: z12.array(axeRuleResultSchema),
|
|
607
|
+
warnings: z12.array(z12.string()).optional()
|
|
608
|
+
});
|
|
609
|
+
var axeFailOnImpactSchema = z12.enum(["minor", "moderate", "serious", "critical"]);
|
|
610
|
+
var axeBaselineSchema = z12.object({
|
|
611
|
+
acceptedFindings: z12.array(z12.string())
|
|
612
|
+
});
|
|
613
|
+
var axeVerdictFindingSchema = z12.object({
|
|
614
|
+
ruleId: z12.string(),
|
|
615
|
+
impact: axeImpactSchema,
|
|
616
|
+
target: z12.array(z12.string())
|
|
617
|
+
});
|
|
618
|
+
var axeVerdictSchema = z12.object({
|
|
619
|
+
failOn: axeFailOnImpactSchema,
|
|
620
|
+
passed: z12.boolean(),
|
|
621
|
+
totalViolationNodes: z12.number().int().nonnegative(),
|
|
622
|
+
baselinedCount: z12.number().int().nonnegative(),
|
|
623
|
+
failingFindings: z12.array(axeVerdictFindingSchema)
|
|
624
|
+
});
|
|
625
|
+
var testMethodSchema = z12.enum(["automated", "hybrid", "manual", "unknown"]);
|
|
626
|
+
var preferredEvidenceModeSchema = z12.enum([
|
|
627
|
+
"automated",
|
|
628
|
+
"hybrid",
|
|
629
|
+
"manual",
|
|
630
|
+
"unknown"
|
|
631
|
+
]);
|
|
632
|
+
var relevanceSchema = z12.enum([
|
|
633
|
+
"relevant",
|
|
634
|
+
"not-detected",
|
|
635
|
+
"out-of-scope",
|
|
636
|
+
"unknown"
|
|
637
|
+
]);
|
|
638
|
+
var normalizedTechniqueSchema = techniqueReferenceSchema.extend({
|
|
639
|
+
groupTitle: z12.string().optional(),
|
|
640
|
+
groupNote: z12.string().optional(),
|
|
641
|
+
suffix: z12.string().optional(),
|
|
642
|
+
relatedKeys: z12.array(z12.string()),
|
|
643
|
+
isSynthetic: z12.boolean()
|
|
644
|
+
});
|
|
645
|
+
var normalizedCriterionSchema = z12.object({
|
|
646
|
+
id: z12.string(),
|
|
647
|
+
slug: z12.string(),
|
|
648
|
+
title: z12.string(),
|
|
649
|
+
summary: z12.string(),
|
|
650
|
+
level: wcagLevelSchema,
|
|
651
|
+
wcagVersion: wcagVersionSchema,
|
|
652
|
+
normativeText: z12.string(),
|
|
653
|
+
understandingUrl: z12.string().url(),
|
|
654
|
+
versions: z12.array(z12.string()),
|
|
655
|
+
altIds: z12.array(z12.string()),
|
|
656
|
+
details: z12.array(z12.string()),
|
|
657
|
+
tags: z12.array(z12.string()),
|
|
658
|
+
principle: z12.object({
|
|
659
|
+
id: z12.string(),
|
|
660
|
+
number: z12.string(),
|
|
661
|
+
title: z12.string()
|
|
662
|
+
}),
|
|
663
|
+
guideline: z12.object({
|
|
664
|
+
id: z12.string(),
|
|
665
|
+
number: z12.string(),
|
|
666
|
+
title: z12.string()
|
|
667
|
+
}),
|
|
668
|
+
techniques: z12.array(normalizedTechniqueSchema),
|
|
669
|
+
advisoryTechniques: z12.array(normalizedTechniqueSchema),
|
|
670
|
+
failures: z12.array(normalizedTechniqueSchema)
|
|
671
|
+
});
|
|
672
|
+
var normalizedCriteriaArtifactSchema = z12.object({
|
|
673
|
+
version: wcagVersionSchema,
|
|
674
|
+
criteria: z12.record(z12.string(), normalizedCriterionSchema)
|
|
675
|
+
});
|
|
676
|
+
var LEVEL_A = "A";
|
|
677
|
+
var criteriaByLevelArtifactSchema = z12.object({
|
|
678
|
+
version: wcagVersionSchema,
|
|
679
|
+
levels: z12.object({
|
|
680
|
+
[LEVEL_A]: z12.array(z12.string()),
|
|
681
|
+
AA: z12.array(z12.string()),
|
|
682
|
+
AAA: z12.array(z12.string())
|
|
683
|
+
})
|
|
684
|
+
});
|
|
685
|
+
var slugIndexArtifactSchema = z12.object({
|
|
686
|
+
version: wcagVersionSchema,
|
|
687
|
+
slugs: z12.record(z12.string(), z12.string())
|
|
688
|
+
});
|
|
689
|
+
var techniqueIndexEntrySchema = techniqueReferenceSchema.extend({
|
|
690
|
+
criterionIds: z12.array(z12.string())
|
|
691
|
+
});
|
|
692
|
+
var techniqueIndexArtifactSchema = z12.object({
|
|
693
|
+
version: wcagVersionSchema,
|
|
694
|
+
techniques: z12.record(z12.string(), techniqueIndexEntrySchema)
|
|
695
|
+
});
|
|
696
|
+
var failureIndexArtifactSchema = z12.object({
|
|
697
|
+
version: wcagVersionSchema,
|
|
698
|
+
failures: z12.record(z12.string(), techniqueIndexEntrySchema)
|
|
699
|
+
});
|
|
700
|
+
var axeRuleIndexEntrySchema = z12.object({
|
|
701
|
+
ruleId: z12.string(),
|
|
702
|
+
tags: z12.array(z12.string()),
|
|
703
|
+
actIds: z12.array(z12.string()),
|
|
704
|
+
criterionIds: z12.array(z12.string())
|
|
705
|
+
});
|
|
706
|
+
var axeRuleIndexArtifactSchema = z12.object({
|
|
707
|
+
version: wcagVersionSchema,
|
|
708
|
+
rules: z12.record(z12.string(), axeRuleIndexEntrySchema)
|
|
709
|
+
});
|
|
710
|
+
var actRuleStatusSchema = z12.enum(["published", "proposed", "deprecated"]);
|
|
711
|
+
var actRuleIndexEntrySchema = z12.object({
|
|
712
|
+
ruleId: z12.string(),
|
|
713
|
+
title: z12.string().min(1),
|
|
714
|
+
url: z12.string().url(),
|
|
715
|
+
status: actRuleStatusSchema,
|
|
716
|
+
criterionIds: z12.array(z12.string())
|
|
717
|
+
});
|
|
718
|
+
var actRuleIndexArtifactSchema = z12.object({
|
|
719
|
+
version: wcagVersionSchema,
|
|
720
|
+
rules: z12.record(z12.string(), actRuleIndexEntrySchema)
|
|
721
|
+
});
|
|
722
|
+
var criterionTestMethodSchema = z12.object({
|
|
723
|
+
criterionId: z12.string(),
|
|
724
|
+
method: testMethodSchema,
|
|
725
|
+
axeRuleIds: z12.array(z12.string()),
|
|
726
|
+
actRuleIds: z12.array(z12.string()),
|
|
727
|
+
sourceAttribution: z12.array(z12.string()),
|
|
728
|
+
notes: z12.array(z12.string()),
|
|
729
|
+
updatedAt: z12.string().datetime()
|
|
730
|
+
});
|
|
731
|
+
var testMethodArtifactSchema = z12.object({
|
|
732
|
+
version: wcagVersionSchema,
|
|
733
|
+
testMethods: z12.record(z12.string(), criterionTestMethodSchema)
|
|
734
|
+
});
|
|
735
|
+
var evidenceStrategySchema = z12.object({
|
|
736
|
+
criterionId: z12.string(),
|
|
737
|
+
preferredEvidenceMode: preferredEvidenceModeSchema,
|
|
738
|
+
procedureIds: z12.array(z12.string()),
|
|
739
|
+
requiresRealTarget: z12.boolean(),
|
|
740
|
+
notes: z12.array(z12.string()),
|
|
741
|
+
procedures: z12.array(assessmentProcedureSchema).default([]),
|
|
742
|
+
coverageGap: z12.string().min(1).optional()
|
|
743
|
+
});
|
|
744
|
+
var strategyArtifactSchema = z12.object({
|
|
745
|
+
version: wcagVersionSchema,
|
|
746
|
+
strategies: z12.record(z12.string(), evidenceStrategySchema)
|
|
747
|
+
});
|
|
748
|
+
var testMethodSummaryBucketSchema = fourWayAutomationCountSchema.extend({
|
|
749
|
+
criteria: z12.number().int().nonnegative()
|
|
750
|
+
});
|
|
751
|
+
var testMethodSummaryArtifactSchema = z12.object({
|
|
752
|
+
version: wcagVersionSchema,
|
|
753
|
+
procedureCoverage: procedureCoverageSchema.optional(),
|
|
754
|
+
updatedAt: z12.string().datetime(),
|
|
755
|
+
totals: testMethodSummaryBucketSchema,
|
|
756
|
+
byLevel: z12.object({
|
|
757
|
+
[LEVEL_A]: testMethodSummaryBucketSchema,
|
|
758
|
+
AA: testMethodSummaryBucketSchema,
|
|
759
|
+
AAA: testMethodSummaryBucketSchema
|
|
760
|
+
}),
|
|
761
|
+
ruleSources: z12.object({
|
|
762
|
+
criteriaWithAxe: z12.number().int().nonnegative(),
|
|
763
|
+
criteriaWithAct: z12.number().int().nonnegative(),
|
|
764
|
+
criteriaWithBoth: z12.number().int().nonnegative()
|
|
765
|
+
}),
|
|
766
|
+
representativeCriterionIds: z12.object({
|
|
767
|
+
automated: z12.array(z12.string()),
|
|
768
|
+
hybrid: z12.array(z12.string()),
|
|
769
|
+
manual: z12.array(z12.string()),
|
|
770
|
+
unknown: z12.array(z12.string())
|
|
771
|
+
})
|
|
772
|
+
});
|
|
773
|
+
var w3cDocumentSourceSchema = z12.object({
|
|
774
|
+
title: z12.string().min(1),
|
|
775
|
+
url: z12.string().url(),
|
|
776
|
+
status: z12.string().min(1)
|
|
777
|
+
});
|
|
778
|
+
var w3cDocumentProvenanceSchema = w3cDocumentSourceSchema.extend({
|
|
779
|
+
sourceSha256: z12.string().min(1),
|
|
780
|
+
syncedAt: z12.string().datetime(),
|
|
781
|
+
etag: z12.string().optional()
|
|
782
|
+
});
|
|
783
|
+
var w3cDocumentMetaSchema = w3cDocumentProvenanceSchema.extend({
|
|
784
|
+
bodyHash: z12.string().min(1)
|
|
785
|
+
});
|
|
786
|
+
var understandingDocumentEntrySchema = w3cDocumentMetaSchema.extend({
|
|
787
|
+
slug: z12.string(),
|
|
788
|
+
criterionId: criterionIdSchema
|
|
789
|
+
});
|
|
790
|
+
var understandingArtifactSchema = z12.object({
|
|
791
|
+
version: wcagVersionSchema,
|
|
792
|
+
documents: z12.record(z12.string(), understandingDocumentEntrySchema)
|
|
793
|
+
});
|
|
794
|
+
var techniqueBodyEntrySchema = w3cDocumentMetaSchema.extend({
|
|
795
|
+
id: z12.string()
|
|
796
|
+
});
|
|
797
|
+
var techniqueBodyArtifactSchema = z12.object({
|
|
798
|
+
version: wcagVersionSchema,
|
|
799
|
+
bodies: z12.record(z12.string(), techniqueBodyEntrySchema)
|
|
800
|
+
});
|
|
801
|
+
var documentContentStoreSchema = z12.record(z12.string(), z12.string().min(1));
|
|
802
|
+
|
|
803
|
+
// src/schemas/mobile.ts
|
|
804
|
+
import { z as z13 } from "zod";
|
|
805
|
+
var mobileGuidanceStateSchema = z13.enum(["guidance", "placeholder"]);
|
|
806
|
+
var mobileGuidanceEntrySchema = w3cDocumentProvenanceSchema.extend({
|
|
807
|
+
criterionId: criterionIdSchema,
|
|
808
|
+
state: mobileGuidanceStateSchema,
|
|
809
|
+
guidance: z13.string(),
|
|
810
|
+
notes: z13.array(z13.string()),
|
|
811
|
+
examples: z13.array(z13.string()),
|
|
812
|
+
wcag2ictUrl: z13.string().url(),
|
|
813
|
+
/** The open issue tracking the missing guidance, on a `placeholder` entry. */
|
|
814
|
+
openIssueUrl: z13.string().url().optional()
|
|
815
|
+
});
|
|
816
|
+
var mobileGuidanceArtifactSchema = z13.object({
|
|
817
|
+
document: w3cDocumentSourceSchema,
|
|
818
|
+
criteria: z13.record(z13.string(), mobileGuidanceEntrySchema)
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
// src/schemas/apg.ts
|
|
822
|
+
import { z as z14 } from "zod";
|
|
823
|
+
var apgAttributeValueSchema = z14.object({
|
|
824
|
+
raw: z14.string().min(1),
|
|
825
|
+
name: z14.string().min(1),
|
|
826
|
+
value: z14.string().optional(),
|
|
827
|
+
isIdRef: z14.boolean()
|
|
828
|
+
});
|
|
829
|
+
var apgKeyboardRowSchema = z14.object({
|
|
830
|
+
testId: z14.string().optional(),
|
|
831
|
+
keyGroups: z14.array(z14.array(z14.string().min(1)).min(1)).min(1),
|
|
832
|
+
description: z14.array(z14.string())
|
|
833
|
+
});
|
|
834
|
+
var apgAttributeRowSchema = z14.object({
|
|
835
|
+
testId: z14.string().optional(),
|
|
836
|
+
role: z14.string().optional(),
|
|
837
|
+
attribute: apgAttributeValueSchema.optional(),
|
|
838
|
+
element: z14.string(),
|
|
839
|
+
usage: z14.string()
|
|
840
|
+
});
|
|
841
|
+
var apgKeyboardTableSchema = z14.object({
|
|
842
|
+
name: z14.string(),
|
|
843
|
+
rows: z14.array(apgKeyboardRowSchema)
|
|
844
|
+
});
|
|
845
|
+
var apgAttributeTableSchema = z14.object({
|
|
846
|
+
name: z14.string(),
|
|
847
|
+
rows: z14.array(apgAttributeRowSchema)
|
|
848
|
+
});
|
|
849
|
+
var apgExampleSchema = z14.object({
|
|
850
|
+
id: z14.string().min(1),
|
|
851
|
+
patternId: z14.string().min(1),
|
|
852
|
+
title: z14.string().min(1),
|
|
853
|
+
pageUrl: z14.string().url(),
|
|
854
|
+
sourceUrl: z14.string().url(),
|
|
855
|
+
experimental: z14.boolean(),
|
|
856
|
+
keyboardTables: z14.array(apgKeyboardTableSchema),
|
|
857
|
+
attributeTables: z14.array(apgAttributeTableSchema)
|
|
858
|
+
});
|
|
859
|
+
var apgPatternSectionSchema = z14.object({
|
|
860
|
+
/** The section's id on the page, such as `keyboard_interaction`. */
|
|
861
|
+
id: z14.string().min(1),
|
|
862
|
+
title: z14.string().min(1),
|
|
863
|
+
markdown: z14.string()
|
|
864
|
+
});
|
|
865
|
+
var apgPatternSchema = z14.object({
|
|
866
|
+
id: z14.string().min(1),
|
|
867
|
+
title: z14.string().min(1),
|
|
868
|
+
pageUrl: z14.string().url(),
|
|
869
|
+
/** The page's own text, in page order. Empty when the page could not be read. */
|
|
870
|
+
sections: z14.array(apgPatternSectionSchema),
|
|
871
|
+
exampleIds: z14.array(z14.string().min(1))
|
|
872
|
+
});
|
|
873
|
+
var apgPatternsArtifactSchema = z14.object({
|
|
874
|
+
document: w3cDocumentSourceSchema,
|
|
875
|
+
patterns: z14.record(z14.string(), apgPatternSchema),
|
|
876
|
+
examples: z14.record(z14.string(), apgExampleSchema),
|
|
877
|
+
roleIndex: z14.record(z14.string(), z14.array(z14.string())),
|
|
878
|
+
attributeIndex: z14.record(z14.string(), z14.array(z14.string()))
|
|
879
|
+
});
|
|
880
|
+
var searchResultKindSchema = z14.enum([
|
|
881
|
+
"criterion",
|
|
882
|
+
"technique",
|
|
883
|
+
"failure",
|
|
884
|
+
"axe-rule",
|
|
885
|
+
"pattern",
|
|
886
|
+
"example"
|
|
887
|
+
]);
|
|
888
|
+
var unifiedSearchRowSchema = z14.object({
|
|
889
|
+
kind: searchResultKindSchema,
|
|
890
|
+
id: z14.string().min(1),
|
|
891
|
+
title: z14.string().min(1),
|
|
892
|
+
score: z14.number(),
|
|
893
|
+
/** Where the match was found, such as a criterion level or a pattern id. */
|
|
894
|
+
context: z14.string().optional(),
|
|
895
|
+
/** The text that matched, so a reader can see why the row is here. */
|
|
896
|
+
matchedOn: z14.string().optional()
|
|
897
|
+
});
|
|
898
|
+
var unifiedSearchResultSchema = z14.object({
|
|
899
|
+
query: z14.string(),
|
|
900
|
+
rows: z14.array(unifiedSearchRowSchema)
|
|
901
|
+
});
|
|
902
|
+
var apgLookupKindSchema = z14.enum(["pattern", "example"]);
|
|
903
|
+
var apgLookupKeySchema = z14.object({
|
|
904
|
+
kind: apgLookupKindSchema,
|
|
905
|
+
id: z14.string().min(1)
|
|
906
|
+
});
|
|
907
|
+
var apgPatternShowResultSchema = z14.object({
|
|
908
|
+
document: w3cDocumentSourceSchema,
|
|
909
|
+
pattern: apgPatternSchema,
|
|
910
|
+
examples: z14.array(apgExampleSchema)
|
|
911
|
+
});
|
|
912
|
+
var apgExampleShowResultSchema = z14.object({
|
|
913
|
+
document: w3cDocumentSourceSchema,
|
|
914
|
+
example: apgExampleSchema,
|
|
915
|
+
pattern: apgPatternSchema
|
|
916
|
+
});
|
|
917
|
+
var apgLookupResultSchema = z14.discriminatedUnion("kind", [
|
|
918
|
+
apgPatternShowResultSchema.extend({ kind: z14.literal("pattern") }),
|
|
919
|
+
apgExampleShowResultSchema.extend({ kind: z14.literal("example") })
|
|
920
|
+
]);
|
|
921
|
+
var apgPatternSummarySchema = z14.object({
|
|
922
|
+
id: z14.string().min(1),
|
|
923
|
+
title: z14.string().min(1),
|
|
924
|
+
pageUrl: z14.string().url(),
|
|
925
|
+
exampleCount: z14.number().int().nonnegative()
|
|
926
|
+
});
|
|
927
|
+
var apgPatternListResultSchema = z14.object({
|
|
928
|
+
document: w3cDocumentSourceSchema,
|
|
929
|
+
patterns: z14.array(apgPatternSummarySchema)
|
|
930
|
+
});
|
|
931
|
+
var apgFindResultSchema = z14.object({
|
|
932
|
+
document: w3cDocumentSourceSchema,
|
|
933
|
+
key: z14.string().min(1),
|
|
934
|
+
kind: z14.enum(["role", "attribute"]),
|
|
935
|
+
examples: z14.array(
|
|
936
|
+
z14.object({
|
|
937
|
+
id: z14.string().min(1),
|
|
938
|
+
patternId: z14.string().min(1),
|
|
939
|
+
title: z14.string().min(1),
|
|
940
|
+
pageUrl: z14.string().url()
|
|
941
|
+
})
|
|
942
|
+
)
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
// src/schemas/apg-check.ts
|
|
946
|
+
import { z as z16 } from "zod";
|
|
947
|
+
|
|
948
|
+
// src/schemas/evidence.ts
|
|
949
|
+
import { z as z15 } from "zod";
|
|
950
|
+
var evidenceOutcomeSchema = z15.enum([
|
|
951
|
+
"passed",
|
|
952
|
+
"failed",
|
|
953
|
+
"cantTell",
|
|
954
|
+
"inapplicable"
|
|
955
|
+
]);
|
|
956
|
+
var evidenceModeSchema = z15.enum(["manual", "semiAutomatic"]);
|
|
957
|
+
var EVIDENCE_NOTE_MAX_LENGTH = 2e3;
|
|
958
|
+
var mediaInventorySchema = z15.object({
|
|
959
|
+
url: z15.string().min(1),
|
|
960
|
+
video: z15.number().int().nonnegative(),
|
|
961
|
+
audio: z15.number().int().nonnegative(),
|
|
962
|
+
embeds: z15.number().int().nonnegative(),
|
|
963
|
+
mediaPlays: z15.number().int().nonnegative(),
|
|
964
|
+
audioContexts: z15.number().int().nonnegative(),
|
|
965
|
+
uninspectedTrees: z15.number().int().nonnegative(),
|
|
966
|
+
method: z15.string().trim().min(1)
|
|
967
|
+
});
|
|
968
|
+
var evidenceTestSchema = z15.object({
|
|
969
|
+
exampleId: z15.string().min(1),
|
|
970
|
+
rowKey: z15.string().min(1)
|
|
971
|
+
});
|
|
972
|
+
var evidenceRecordSchema = z15.object({
|
|
973
|
+
subject: z15.string().min(1),
|
|
974
|
+
test: evidenceTestSchema,
|
|
975
|
+
outcome: evidenceOutcomeSchema,
|
|
976
|
+
mode: evidenceModeSchema,
|
|
977
|
+
/** The selector of the widget the judgment is about. */
|
|
978
|
+
pointer: z15.string().min(1).optional(),
|
|
979
|
+
note: z15.string().max(EVIDENCE_NOTE_MAX_LENGTH).optional(),
|
|
980
|
+
/** Who or what recorded it, such as an agent name or a person's initials. */
|
|
981
|
+
assertedBy: z15.string().min(1).optional(),
|
|
982
|
+
recordedAt: z15.string().min(1),
|
|
983
|
+
/**
|
|
984
|
+
* A hash of the page's accessibility tree when the judgment was made. The tree is used
|
|
985
|
+
* rather than the raw markup because a CSRF token or a timestamp changes the markup on
|
|
986
|
+
* every load, which would report every page as changed.
|
|
987
|
+
*/
|
|
988
|
+
subjectHash: z15.string().min(1).optional()
|
|
989
|
+
});
|
|
990
|
+
var evidenceRecordResultSchema = z15.object({
|
|
991
|
+
record: evidenceRecordSchema,
|
|
992
|
+
file: z15.string().min(1)
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// src/schemas/apg-check.ts
|
|
996
|
+
var apgCheckRowStatusSchema = z16.enum([
|
|
997
|
+
"changed",
|
|
998
|
+
"no-observable-effect",
|
|
999
|
+
"not-testable"
|
|
1000
|
+
]);
|
|
1001
|
+
var apgAttributeCheckStatusSchema = z16.enum([
|
|
1002
|
+
"present",
|
|
1003
|
+
"absent",
|
|
1004
|
+
"broken-reference",
|
|
1005
|
+
"not-testable"
|
|
1006
|
+
]);
|
|
1007
|
+
var apgObservedChangeSchema = z16.enum([
|
|
1008
|
+
"focus",
|
|
1009
|
+
"ariaAttributes",
|
|
1010
|
+
"accessibilityTree"
|
|
1011
|
+
]);
|
|
1012
|
+
var apgProbeKindSchema = z16.enum(["initial", "nudged"]);
|
|
1013
|
+
var recordedJudgmentSchema = z16.object({
|
|
1014
|
+
outcome: evidenceOutcomeSchema,
|
|
1015
|
+
note: z16.string().optional(),
|
|
1016
|
+
assertedBy: z16.string().optional(),
|
|
1017
|
+
recordedAt: z16.string().min(1),
|
|
1018
|
+
stale: z16.boolean()
|
|
1019
|
+
});
|
|
1020
|
+
var apgKeyboardCheckRowSchema = z16.object({
|
|
1021
|
+
testId: z16.string().optional(),
|
|
1022
|
+
rowKey: z16.string().min(1),
|
|
1023
|
+
keys: z16.array(z16.string().min(1)),
|
|
1024
|
+
chord: z16.string().optional(),
|
|
1025
|
+
description: z16.array(z16.string()),
|
|
1026
|
+
status: apgCheckRowStatusSchema,
|
|
1027
|
+
/** Why a row could not be pressed, on a `not-testable` row. */
|
|
1028
|
+
reason: z16.string().optional(),
|
|
1029
|
+
focusedElement: z16.string().optional(),
|
|
1030
|
+
observedChanges: z16.array(apgObservedChangeSchema),
|
|
1031
|
+
decidedBy: apgProbeKindSchema.optional(),
|
|
1032
|
+
/**
|
|
1033
|
+
* What the tool is willing to record about this row. A key that changed nothing is
|
|
1034
|
+
* `failed`; a key that changed something is `cantTell`, because whether it was the
|
|
1035
|
+
* documented behavior is a judgment; a key that cannot be pressed gets nothing at all,
|
|
1036
|
+
* since not recording a result already means untested. Never `inapplicable`: only a
|
|
1037
|
+
* person or an agent decides that.
|
|
1038
|
+
*/
|
|
1039
|
+
outcome: evidenceOutcomeSchema.optional(),
|
|
1040
|
+
/** A judgment already recorded for this row, replayed from the evidence store. */
|
|
1041
|
+
recorded: recordedJudgmentSchema.optional()
|
|
1042
|
+
});
|
|
1043
|
+
var apgAttributeCheckRowSchema = z16.object({
|
|
1044
|
+
testId: z16.string().optional(),
|
|
1045
|
+
rowKey: z16.string().min(1),
|
|
1046
|
+
attribute: z16.string().optional(),
|
|
1047
|
+
role: z16.string().optional(),
|
|
1048
|
+
element: z16.string(),
|
|
1049
|
+
usage: z16.string(),
|
|
1050
|
+
status: apgAttributeCheckStatusSchema,
|
|
1051
|
+
reason: z16.string().optional(),
|
|
1052
|
+
/** The value found on the page, when the attribute is present. */
|
|
1053
|
+
observedValue: z16.string().optional(),
|
|
1054
|
+
outcome: evidenceOutcomeSchema.optional(),
|
|
1055
|
+
recorded: recordedJudgmentSchema.optional()
|
|
1056
|
+
});
|
|
1057
|
+
var apgApplicabilityHintSchema = z16.object({
|
|
1058
|
+
attribute: z16.string().min(1),
|
|
1059
|
+
relatedRowKeys: z16.array(z16.string())
|
|
1060
|
+
});
|
|
1061
|
+
var apgCheckResultSchema = z16.object({
|
|
1062
|
+
document: w3cDocumentSourceSchema,
|
|
1063
|
+
exampleId: z16.string().min(1),
|
|
1064
|
+
patternId: z16.string().min(1),
|
|
1065
|
+
pageUrl: z16.string().url(),
|
|
1066
|
+
title: z16.string().min(1),
|
|
1067
|
+
subject: z16.string().min(1),
|
|
1068
|
+
selector: z16.string().min(1),
|
|
1069
|
+
tableName: z16.string(),
|
|
1070
|
+
keyboardRows: z16.array(apgKeyboardCheckRowSchema),
|
|
1071
|
+
attributeRows: z16.array(apgAttributeCheckRowSchema),
|
|
1072
|
+
applicabilityHints: z16.array(apgApplicabilityHintSchema),
|
|
1073
|
+
/** Keyboard tables this run did not probe, because each documents a different state. */
|
|
1074
|
+
unprobedTables: z16.array(z16.string())
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
// src/schemas/query.ts
|
|
1078
|
+
import { z as z17 } from "zod";
|
|
1079
|
+
var pageSignalCategorySchema = z17.enum([
|
|
1080
|
+
"auth",
|
|
1081
|
+
"dialog",
|
|
1082
|
+
"drag-and-drop",
|
|
1083
|
+
"form",
|
|
1084
|
+
"heading",
|
|
1085
|
+
"help",
|
|
1086
|
+
"landmark",
|
|
1087
|
+
"live-region",
|
|
1088
|
+
"media",
|
|
1089
|
+
"menu",
|
|
1090
|
+
"overlay",
|
|
1091
|
+
"repeated-form",
|
|
1092
|
+
"tablist",
|
|
1093
|
+
"validation",
|
|
1094
|
+
"widget"
|
|
1095
|
+
]);
|
|
1096
|
+
var pageSignalSourceSchema = z17.enum([
|
|
1097
|
+
"dom",
|
|
1098
|
+
"a11y-tree",
|
|
1099
|
+
"metadata",
|
|
1100
|
+
"quickref-tag",
|
|
1101
|
+
"user-hint"
|
|
1102
|
+
]);
|
|
1103
|
+
var pageElementSchema = z17.object({
|
|
1104
|
+
xpath: z17.string(),
|
|
1105
|
+
tag: z17.string(),
|
|
1106
|
+
snippet: z17.string()
|
|
1107
|
+
});
|
|
1108
|
+
var pageSignalSchema = z17.object({
|
|
1109
|
+
category: pageSignalCategorySchema,
|
|
1110
|
+
source: pageSignalSourceSchema,
|
|
1111
|
+
value: z17.string(),
|
|
1112
|
+
confidence: z17.enum(["high", "medium", "low"]),
|
|
1113
|
+
elements: z17.array(pageElementSchema).optional()
|
|
1114
|
+
});
|
|
1115
|
+
var documentTargetKindSchema = z17.enum(["url", "file", "stdin", "html", "app"]);
|
|
1116
|
+
var targetReferenceSchema = z17.object({
|
|
1117
|
+
kind: documentTargetKindSchema,
|
|
1118
|
+
value: z17.string()
|
|
1119
|
+
});
|
|
1120
|
+
var pageScanSchema = z17.object({
|
|
1121
|
+
target: targetReferenceSchema,
|
|
1122
|
+
signals: z17.array(pageSignalSchema),
|
|
1123
|
+
metadata: z17.record(z17.string(), z17.string()),
|
|
1124
|
+
userHints: z17.array(z17.string())
|
|
1125
|
+
});
|
|
1126
|
+
var criterionRelevanceSchema = z17.object({
|
|
1127
|
+
criterionId: criterionIdSchema,
|
|
1128
|
+
title: z17.string(),
|
|
1129
|
+
state: relevanceSchema,
|
|
1130
|
+
reasons: z17.array(z17.string()),
|
|
1131
|
+
matchedSignalCategories: z17.array(pageSignalCategorySchema),
|
|
1132
|
+
matchedTags: z17.array(z17.string()),
|
|
1133
|
+
elements: z17.array(pageElementSchema)
|
|
1134
|
+
});
|
|
1135
|
+
var relevanceMatrixSchema = z17.object({
|
|
1136
|
+
version: wcagVersionSchema,
|
|
1137
|
+
target: targetReferenceSchema,
|
|
1138
|
+
assessments: z17.record(z17.string(), criterionRelevanceSchema)
|
|
1139
|
+
});
|
|
1140
|
+
var criterionRelevanceLookupResultSchema = z17.object({
|
|
1141
|
+
lookupKey: criterionLookupKeySchema,
|
|
1142
|
+
version: wcagVersionSchema,
|
|
1143
|
+
target: targetReferenceSchema,
|
|
1144
|
+
criterion: normalizedCriterionSchema,
|
|
1145
|
+
assessment: criterionRelevanceSchema
|
|
1146
|
+
});
|
|
1147
|
+
var searchMatchFieldSchema = z17.enum([
|
|
1148
|
+
"title",
|
|
1149
|
+
"summary",
|
|
1150
|
+
"normativeText",
|
|
1151
|
+
"details",
|
|
1152
|
+
"technique",
|
|
1153
|
+
"failure",
|
|
1154
|
+
"tag",
|
|
1155
|
+
"guideline",
|
|
1156
|
+
"principle"
|
|
1157
|
+
]);
|
|
1158
|
+
var criterionSearchMatchSchema = z17.object({
|
|
1159
|
+
field: searchMatchFieldSchema,
|
|
1160
|
+
text: z17.string(),
|
|
1161
|
+
score: z17.number().nonnegative()
|
|
1162
|
+
});
|
|
1163
|
+
var criterionSearchResultSchema = z17.object({
|
|
1164
|
+
criterionId: criterionIdSchema,
|
|
1165
|
+
slug: criterionSlugSchema,
|
|
1166
|
+
title: z17.string(),
|
|
1167
|
+
level: wcagLevelSchema,
|
|
1168
|
+
wcagVersion: wcagVersionSchema,
|
|
1169
|
+
score: z17.number().nonnegative(),
|
|
1170
|
+
matches: z17.array(criterionSearchMatchSchema)
|
|
1171
|
+
});
|
|
1172
|
+
var criterionSearchResponseSchema = z17.object({
|
|
1173
|
+
query: z17.string(),
|
|
1174
|
+
results: z17.array(criterionSearchResultSchema)
|
|
1175
|
+
});
|
|
1176
|
+
var criterionLookupResultSchema = z17.object({
|
|
1177
|
+
lookupKey: criterionLookupKeySchema,
|
|
1178
|
+
criterion: normalizedCriterionSchema
|
|
1179
|
+
});
|
|
1180
|
+
var criteriaByLevelResultSchema = z17.object({
|
|
1181
|
+
version: wcagVersionSchema,
|
|
1182
|
+
level: wcagLevelSchema,
|
|
1183
|
+
criteria: z17.array(normalizedCriterionSchema)
|
|
1184
|
+
});
|
|
1185
|
+
var quickrefTagLookupResultSchema = z17.object({
|
|
1186
|
+
lookupKey: criterionLookupKeySchema,
|
|
1187
|
+
criterionId: criterionIdSchema,
|
|
1188
|
+
tags: z17.array(z17.string())
|
|
1189
|
+
});
|
|
1190
|
+
var testMethodLookupResultSchema = z17.object({
|
|
1191
|
+
lookupKey: criterionLookupKeySchema,
|
|
1192
|
+
criterion: normalizedCriterionSchema,
|
|
1193
|
+
testMethod: criterionTestMethodSchema,
|
|
1194
|
+
strategy: evidenceStrategySchema,
|
|
1195
|
+
/** The named form of `coverage.actRuleIds`, in the same order. */
|
|
1196
|
+
actRules: z17.array(actRuleIndexEntrySchema)
|
|
1197
|
+
});
|
|
1198
|
+
var criterionShowResultSchema = testMethodLookupResultSchema.extend({
|
|
1199
|
+
/** The In Brief or Intent opening of the Understanding document, when one was synced. */
|
|
1200
|
+
understandingExcerpt: z17.string().optional(),
|
|
1201
|
+
/**
|
|
1202
|
+
* Names the document the excerpt was copied from. The W3C Document License requires
|
|
1203
|
+
* the copyright notice, a link, and the document's status on every copy, and printing
|
|
1204
|
+
* the excerpt in a terminal is a copy.
|
|
1205
|
+
*/
|
|
1206
|
+
understandingSource: w3cDocumentSourceSchema.optional(),
|
|
1207
|
+
/**
|
|
1208
|
+
* What WCAG2Mobile says about this criterion, when it has published guidance for it.
|
|
1209
|
+
* The entry carries its own title, url, and status for the same attribution reason.
|
|
1210
|
+
*/
|
|
1211
|
+
mobileGuidance: mobileGuidanceEntrySchema.optional()
|
|
1212
|
+
});
|
|
1213
|
+
var wcagLookupResultSchema = z17.object({
|
|
1214
|
+
lookupKey: criterionLookupKeySchema,
|
|
1215
|
+
criterion: normalizedCriterionSchema,
|
|
1216
|
+
testMethod: criterionTestMethodSchema.optional(),
|
|
1217
|
+
strategy: evidenceStrategySchema.optional()
|
|
1218
|
+
});
|
|
1219
|
+
var axeRuleLookupResultSchema = z17.object({
|
|
1220
|
+
ruleId: z17.string(),
|
|
1221
|
+
rule: axeRuleIndexEntrySchema,
|
|
1222
|
+
description: z17.string().optional(),
|
|
1223
|
+
help: z17.string().optional(),
|
|
1224
|
+
helpUrl: z17.string().url().optional(),
|
|
1225
|
+
criteria: z17.array(normalizedCriterionSchema),
|
|
1226
|
+
/** The named form of `rule.actIds`, in the same order. */
|
|
1227
|
+
actRules: z17.array(actRuleIndexEntrySchema)
|
|
1228
|
+
});
|
|
1229
|
+
var techniqueLookupResultSchema = z17.object({
|
|
1230
|
+
lookupKey: z17.string(),
|
|
1231
|
+
technique: techniqueIndexEntrySchema,
|
|
1232
|
+
criteria: z17.array(normalizedCriterionSchema),
|
|
1233
|
+
document: techniqueBodyEntrySchema.optional(),
|
|
1234
|
+
body: z17.string().optional()
|
|
1235
|
+
});
|
|
1236
|
+
var understandingLookupResultSchema = z17.object({
|
|
1237
|
+
lookupKey: criterionLookupKeySchema,
|
|
1238
|
+
criterion: normalizedCriterionSchema,
|
|
1239
|
+
document: understandingDocumentEntrySchema,
|
|
1240
|
+
body: z17.string()
|
|
1241
|
+
});
|
|
1242
|
+
var notFoundErrorSchema = z17.object({
|
|
1243
|
+
type: z17.literal("not-found"),
|
|
1244
|
+
message: z17.string(),
|
|
1245
|
+
lookupKey: z17.string()
|
|
1246
|
+
});
|
|
1247
|
+
var validationErrorSchema = z17.object({
|
|
1248
|
+
type: z17.literal("validation-error"),
|
|
1249
|
+
message: z17.string(),
|
|
1250
|
+
field: z17.string(),
|
|
1251
|
+
value: z17.string(),
|
|
1252
|
+
supportedVersions: z17.array(wcagVersionSchema).optional(),
|
|
1253
|
+
supportedLevels: z17.array(wcagLevelSchema).optional()
|
|
1254
|
+
});
|
|
1255
|
+
var engineQueryErrorSchema = z17.union([
|
|
1256
|
+
notFoundErrorSchema,
|
|
1257
|
+
validationErrorSchema
|
|
1258
|
+
]);
|
|
1259
|
+
|
|
1260
|
+
// src/schemas/earl.ts
|
|
1261
|
+
import { z as z18 } from "zod";
|
|
1262
|
+
var earlOutcomeSchema = z18.enum([
|
|
1263
|
+
"passed",
|
|
1264
|
+
"failed",
|
|
1265
|
+
"cantTell",
|
|
1266
|
+
"inapplicable",
|
|
1267
|
+
"untested"
|
|
1268
|
+
]);
|
|
1269
|
+
var earlModeSchema = z18.enum(["automatic", "semiAutomatic", "manual"]);
|
|
1270
|
+
var earlProcedureSchema = z18.object({
|
|
1271
|
+
title: z18.string().min(1),
|
|
1272
|
+
url: z18.string().url().optional(),
|
|
1273
|
+
criterionSlugs: z18.array(z18.string()).optional()
|
|
1274
|
+
});
|
|
1275
|
+
var earlAssertionInputSchema = z18.object({
|
|
1276
|
+
subject: z18.string().min(1),
|
|
1277
|
+
outcome: earlOutcomeSchema,
|
|
1278
|
+
mode: earlModeSchema.optional(),
|
|
1279
|
+
procedure: earlProcedureSchema.optional(),
|
|
1280
|
+
pointer: z18.string().optional(),
|
|
1281
|
+
info: z18.string().optional()
|
|
1282
|
+
});
|
|
1283
|
+
var earlAssertorSchema = z18.object({
|
|
1284
|
+
name: z18.string().min(1),
|
|
1285
|
+
url: z18.string().url(),
|
|
1286
|
+
revision: z18.string().min(1)
|
|
1287
|
+
});
|
|
1288
|
+
var earlProfileSchema = z18.enum(["act", "report"]);
|
|
1289
|
+
var earlSubjectSchema = z18.object({
|
|
1290
|
+
"@type": z18.tuple([z18.literal("earl:TestSubject"), z18.literal("sch:WebPage")]),
|
|
1291
|
+
source: z18.string().min(1)
|
|
1292
|
+
});
|
|
1293
|
+
var earlTestCaseSchema = z18.object({
|
|
1294
|
+
"@type": z18.literal("TestCase"),
|
|
1295
|
+
title: z18.string().min(1),
|
|
1296
|
+
"@id": z18.string().url().optional(),
|
|
1297
|
+
/** Omitted for a test case that is not part of a success criterion. */
|
|
1298
|
+
isPartOf: z18.array(z18.string()).optional()
|
|
1299
|
+
});
|
|
1300
|
+
var earlResultSchema = z18.object({
|
|
1301
|
+
"@type": z18.literal("TestResult"),
|
|
1302
|
+
outcome: z18.string().min(1),
|
|
1303
|
+
pointer: z18.string().optional(),
|
|
1304
|
+
info: z18.string().optional()
|
|
1305
|
+
});
|
|
1306
|
+
var earlAssertionSchema = z18.object({
|
|
1307
|
+
"@type": z18.literal("Assertion"),
|
|
1308
|
+
mode: z18.string().min(1).optional(),
|
|
1309
|
+
subject: earlSubjectSchema,
|
|
1310
|
+
assertedBy: z18.string().min(1),
|
|
1311
|
+
result: earlResultSchema,
|
|
1312
|
+
test: earlTestCaseSchema.optional()
|
|
1313
|
+
});
|
|
1314
|
+
var earlReportSchema = z18.object({
|
|
1315
|
+
"@context": z18.string().url(),
|
|
1316
|
+
"@graph": z18.array(earlAssertionSchema)
|
|
1317
|
+
});
|
|
1318
|
+
|
|
1319
|
+
// src/schemas/discovery.ts
|
|
1320
|
+
import { z as z19 } from "zod";
|
|
1321
|
+
var auditProfileSchema = z19.object({
|
|
1322
|
+
wcagVersion: wcagVersionSchema,
|
|
1323
|
+
level: wcagLevelSchema
|
|
1324
|
+
});
|
|
1325
|
+
var HTTP_MAX_STATUS = 599;
|
|
1326
|
+
var HTTP_MIN_STATUS = 100;
|
|
1327
|
+
var pageDiscoveryMethodSchema = z19.enum([
|
|
1328
|
+
"sitemap",
|
|
1329
|
+
"crawl",
|
|
1330
|
+
"manual",
|
|
1331
|
+
"error-probe"
|
|
1332
|
+
]);
|
|
1333
|
+
var pageDiscoveryStatusSchema = z19.enum(["pending", "resolved", "error"]);
|
|
1334
|
+
var pageAuditStatusSchema = z19.enum([
|
|
1335
|
+
"not-tested",
|
|
1336
|
+
"in-progress",
|
|
1337
|
+
"audited",
|
|
1338
|
+
"skipped-duplicate",
|
|
1339
|
+
"error"
|
|
1340
|
+
]);
|
|
1341
|
+
var violationCountsSchema = z19.object({
|
|
1342
|
+
minor: z19.number().int().nonnegative(),
|
|
1343
|
+
moderate: z19.number().int().nonnegative(),
|
|
1344
|
+
serious: z19.number().int().nonnegative(),
|
|
1345
|
+
critical: z19.number().int().nonnegative()
|
|
1346
|
+
});
|
|
1347
|
+
var pageRecordSchema = z19.object({
|
|
1348
|
+
pageId: z19.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
1349
|
+
url: z19.string().url(),
|
|
1350
|
+
finalUrl: z19.string().url(),
|
|
1351
|
+
canonicalUrl: z19.string().url().optional(),
|
|
1352
|
+
status: z19.union([
|
|
1353
|
+
z19.number().int().min(HTTP_MIN_STATUS).max(HTTP_MAX_STATUS),
|
|
1354
|
+
z19.literal("error")
|
|
1355
|
+
]),
|
|
1356
|
+
discoveredVia: pageDiscoveryMethodSchema,
|
|
1357
|
+
title: z19.string().optional(),
|
|
1358
|
+
headingSample: z19.string().optional(),
|
|
1359
|
+
links: z19.array(z19.string().url()).optional(),
|
|
1360
|
+
templateId: z19.string().min(1).optional(),
|
|
1361
|
+
isDuplicateOf: z19.string().min(1).optional(),
|
|
1362
|
+
requiresAuth: z19.boolean(),
|
|
1363
|
+
hasDestructiveActions: z19.boolean(),
|
|
1364
|
+
discoveryStatus: pageDiscoveryStatusSchema,
|
|
1365
|
+
auditStatus: pageAuditStatusSchema,
|
|
1366
|
+
error: z19.object({ code: z19.string().min(1), message: z19.string().min(1) }).optional(),
|
|
1367
|
+
htmlArtifactPath: z19.string().min(1).optional(),
|
|
1368
|
+
accessibilityTreeArtifactPath: z19.string().min(1).optional(),
|
|
1369
|
+
auditedAt: z19.string().datetime().optional(),
|
|
1370
|
+
violationCounts: violationCountsSchema.optional()
|
|
1371
|
+
});
|
|
1372
|
+
var auditScopeSchema = z19.enum(["page", "section", "site"]);
|
|
1373
|
+
var siteInventorySchema = z19.object({
|
|
1374
|
+
version: z19.literal("1"),
|
|
1375
|
+
startUrl: z19.string().url(),
|
|
1376
|
+
generatedAt: z19.string().datetime(),
|
|
1377
|
+
run: z19.object({
|
|
1378
|
+
runId: z19.string().min(1),
|
|
1379
|
+
assessmentFile: z19.string().min(1).optional(),
|
|
1380
|
+
profile: auditProfileSchema.optional(),
|
|
1381
|
+
originKey: z19.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
1382
|
+
phase: z19.enum([
|
|
1383
|
+
"discovering",
|
|
1384
|
+
"template-review",
|
|
1385
|
+
"auditing",
|
|
1386
|
+
"report-building",
|
|
1387
|
+
"complete"
|
|
1388
|
+
]),
|
|
1389
|
+
startedAt: z19.string().datetime(),
|
|
1390
|
+
updatedAt: z19.string().datetime(),
|
|
1391
|
+
scope: auditScopeSchema,
|
|
1392
|
+
sectionPath: z19.string().optional(),
|
|
1393
|
+
optionsChosen: z19.object({
|
|
1394
|
+
auditMode: z19.enum(["full", "sampled"]).optional(),
|
|
1395
|
+
probeErrorPages: z19.boolean(),
|
|
1396
|
+
parallelAutomatedAudit: z19.boolean(),
|
|
1397
|
+
capturePageArtifacts: z19.boolean(),
|
|
1398
|
+
evidenceFile: z19.string().min(1).optional(),
|
|
1399
|
+
selectedPageIds: z19.array(z19.string().min(1)).optional(),
|
|
1400
|
+
include: z19.array(z19.string()).optional(),
|
|
1401
|
+
exclude: z19.array(z19.string()).optional(),
|
|
1402
|
+
sitemapOnly: z19.boolean().optional(),
|
|
1403
|
+
sitemapUrl: z19.string().url().optional()
|
|
1404
|
+
})
|
|
1405
|
+
}),
|
|
1406
|
+
discovery: z19.object({
|
|
1407
|
+
complete: z19.boolean(),
|
|
1408
|
+
truncatedReason: z19.string().min(1).optional(),
|
|
1409
|
+
maxPages: z19.number().int().positive(),
|
|
1410
|
+
maxSitemaps: z19.number().int().positive(),
|
|
1411
|
+
sources: z19.array(z19.string().url()),
|
|
1412
|
+
failures: z19.array(z19.object({ source: z19.string(), message: z19.string().min(1) })),
|
|
1413
|
+
pendingUrls: z19.array(z19.string().url()).default([])
|
|
1414
|
+
}),
|
|
1415
|
+
pages: z19.array(pageRecordSchema),
|
|
1416
|
+
templates: z19.array(
|
|
1417
|
+
z19.object({
|
|
1418
|
+
templateId: z19.string().min(1),
|
|
1419
|
+
representativePageId: z19.string().min(1),
|
|
1420
|
+
memberPageIds: z19.array(z19.string().min(1))
|
|
1421
|
+
})
|
|
1422
|
+
)
|
|
1423
|
+
}).superRefine((inventory, context) => {
|
|
1424
|
+
const ids = /* @__PURE__ */ new Set();
|
|
1425
|
+
for (const page of inventory.pages) {
|
|
1426
|
+
if (ids.has(page.pageId)) {
|
|
1427
|
+
context.addIssue({
|
|
1428
|
+
code: "custom",
|
|
1429
|
+
message: `Duplicate page ID: ${page.pageId}`,
|
|
1430
|
+
path: ["pages"]
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
ids.add(page.pageId);
|
|
1434
|
+
}
|
|
1435
|
+
for (const page of inventory.pages) {
|
|
1436
|
+
if (page.isDuplicateOf && (page.isDuplicateOf === page.pageId || !ids.has(page.isDuplicateOf))) {
|
|
1437
|
+
context.addIssue({
|
|
1438
|
+
code: "custom",
|
|
1439
|
+
message: `Invalid duplicate reference: ${page.pageId}`,
|
|
1440
|
+
path: ["pages"]
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
export {
|
|
1446
|
+
DEFAULT_DRIVER_TRANSCRIPT_LIMIT,
|
|
1447
|
+
DEFAULT_ELEMENTS_MAX,
|
|
1448
|
+
DEFAULT_GOTO_MAX,
|
|
1449
|
+
DEFAULT_READ_ALL_MAX,
|
|
1450
|
+
DEFAULT_WAIT_PAUSE_MS,
|
|
1451
|
+
DEFAULT_WAIT_TIMEOUT_MS,
|
|
1452
|
+
EVIDENCE_NOTE_MAX_LENGTH,
|
|
1453
|
+
MAX_DRIVER_TRANSCRIPT_LIMIT,
|
|
1454
|
+
accessibilityDriverSessionSchema,
|
|
1455
|
+
actRuleIndexArtifactSchema,
|
|
1456
|
+
actRuleIndexEntrySchema,
|
|
1457
|
+
actRuleStatusSchema,
|
|
1458
|
+
apgApplicabilityHintSchema,
|
|
1459
|
+
apgAttributeCheckRowSchema,
|
|
1460
|
+
apgAttributeCheckStatusSchema,
|
|
1461
|
+
apgAttributeRowSchema,
|
|
1462
|
+
apgAttributeTableSchema,
|
|
1463
|
+
apgAttributeValueSchema,
|
|
1464
|
+
apgCheckResultSchema,
|
|
1465
|
+
apgCheckRowStatusSchema,
|
|
1466
|
+
apgExampleSchema,
|
|
1467
|
+
apgExampleShowResultSchema,
|
|
1468
|
+
apgFindResultSchema,
|
|
1469
|
+
apgKeyboardCheckRowSchema,
|
|
1470
|
+
apgKeyboardRowSchema,
|
|
1471
|
+
apgKeyboardTableSchema,
|
|
1472
|
+
apgLookupKeySchema,
|
|
1473
|
+
apgLookupKindSchema,
|
|
1474
|
+
apgLookupResultSchema,
|
|
1475
|
+
apgObservedChangeSchema,
|
|
1476
|
+
apgPatternListResultSchema,
|
|
1477
|
+
apgPatternSchema,
|
|
1478
|
+
apgPatternSectionSchema,
|
|
1479
|
+
apgPatternShowResultSchema,
|
|
1480
|
+
apgPatternSummarySchema,
|
|
1481
|
+
apgPatternsArtifactSchema,
|
|
1482
|
+
apgProbeKindSchema,
|
|
1483
|
+
assessmentProcedureSchema,
|
|
1484
|
+
assessmentScopeSchema,
|
|
1485
|
+
auditScopeSchema,
|
|
1486
|
+
axFocusedElementSchema,
|
|
1487
|
+
axeBaselineSchema,
|
|
1488
|
+
axeFailOnImpactSchema,
|
|
1489
|
+
axeImpactSchema,
|
|
1490
|
+
axeNodeResultSchema,
|
|
1491
|
+
axeRuleIndexArtifactSchema,
|
|
1492
|
+
axeRuleIndexEntrySchema,
|
|
1493
|
+
axeRuleLookupResultSchema,
|
|
1494
|
+
axeRuleResultSchema,
|
|
1495
|
+
axeRunResultSchema,
|
|
1496
|
+
axeSelectionSchema,
|
|
1497
|
+
axeVerdictFindingSchema,
|
|
1498
|
+
axeVerdictSchema,
|
|
1499
|
+
browserAutomationCandidateSchema,
|
|
1500
|
+
browserAutomationPolicySchema,
|
|
1501
|
+
cliCommandDescriptorSchema,
|
|
1502
|
+
cliCommandFamilySchema,
|
|
1503
|
+
cliCommandSchema,
|
|
1504
|
+
cliEnvelopeMetaSchema,
|
|
1505
|
+
cliExitCodeSchema,
|
|
1506
|
+
cliExitCodes,
|
|
1507
|
+
cliMessageSchema,
|
|
1508
|
+
cliOutputEnvelopeSchema,
|
|
1509
|
+
criteriaByLevelArtifactSchema,
|
|
1510
|
+
criteriaByLevelResultSchema,
|
|
1511
|
+
criterionIdSchema,
|
|
1512
|
+
criterionLookupKeySchema,
|
|
1513
|
+
criterionLookupResultSchema,
|
|
1514
|
+
criterionRelevanceLookupResultSchema,
|
|
1515
|
+
criterionRelevanceSchema,
|
|
1516
|
+
criterionSearchMatchSchema,
|
|
1517
|
+
criterionSearchResponseSchema,
|
|
1518
|
+
criterionSearchResultSchema,
|
|
1519
|
+
criterionShowResultSchema,
|
|
1520
|
+
criterionSlugSchema,
|
|
1521
|
+
criterionTestMethodSchema,
|
|
1522
|
+
doctorActionSchema,
|
|
1523
|
+
doctorCheckSchema,
|
|
1524
|
+
doctorCheckStatusSchema,
|
|
1525
|
+
doctorHostSchema,
|
|
1526
|
+
doctorReportSchema,
|
|
1527
|
+
doctorRequestSchema,
|
|
1528
|
+
doctorTargetSchema,
|
|
1529
|
+
documentContentStoreSchema,
|
|
1530
|
+
documentTargetKindSchema,
|
|
1531
|
+
driverActionNameSchema,
|
|
1532
|
+
driverActionRequestSchema,
|
|
1533
|
+
driverActionResultSchema,
|
|
1534
|
+
driverBatchExpectStepSchema,
|
|
1535
|
+
driverBatchStepSchema,
|
|
1536
|
+
driverCapabilitySchema,
|
|
1537
|
+
driverCheckpointPayloadSchema,
|
|
1538
|
+
driverCheckpointSchema,
|
|
1539
|
+
driverCurrentItemSchema,
|
|
1540
|
+
driverElementsPayloadSchema,
|
|
1541
|
+
driverFindPayloadSchema,
|
|
1542
|
+
driverFocusMatchSchema,
|
|
1543
|
+
driverFocusResultSchema,
|
|
1544
|
+
driverFocusStatusSchema,
|
|
1545
|
+
driverFocusTargetFieldsSchema,
|
|
1546
|
+
driverFocusTargetRefinement,
|
|
1547
|
+
driverFocusTargetSchema,
|
|
1548
|
+
driverGotoPayloadSchema,
|
|
1549
|
+
driverLoopItemSchema,
|
|
1550
|
+
driverLoopStopSchema,
|
|
1551
|
+
driverModeSchema,
|
|
1552
|
+
driverNavigatePayloadSchema,
|
|
1553
|
+
driverNavigateRequestSchema,
|
|
1554
|
+
driverNavigationActionRequestSchemas,
|
|
1555
|
+
driverNavigationDirectionSchema,
|
|
1556
|
+
driverNavigationKindSchema,
|
|
1557
|
+
driverObservationSchema,
|
|
1558
|
+
driverObservationsSchema,
|
|
1559
|
+
driverPerformPayloadSchema,
|
|
1560
|
+
driverPressPayloadSchema,
|
|
1561
|
+
driverReadAllPayloadSchema,
|
|
1562
|
+
driverReadinessSchema,
|
|
1563
|
+
driverReadinessStatusSchema,
|
|
1564
|
+
driverScreenshotPayloadSchema,
|
|
1565
|
+
driverStateSnapshotSchema,
|
|
1566
|
+
driverTableMoveSchema,
|
|
1567
|
+
driverTablePayloadSchema,
|
|
1568
|
+
driverTranscriptEntrySchema,
|
|
1569
|
+
driverTranscriptFormatSchema,
|
|
1570
|
+
driverTranscriptPayloadSchema,
|
|
1571
|
+
driverTranscriptSchema,
|
|
1572
|
+
driverTranscriptWindowSchema,
|
|
1573
|
+
driverTypePayloadSchema,
|
|
1574
|
+
driverWaitPayloadSchema,
|
|
1575
|
+
earlAssertionInputSchema,
|
|
1576
|
+
earlAssertionSchema,
|
|
1577
|
+
earlAssertorSchema,
|
|
1578
|
+
earlModeSchema,
|
|
1579
|
+
earlOutcomeSchema,
|
|
1580
|
+
earlProcedureSchema,
|
|
1581
|
+
earlProfileSchema,
|
|
1582
|
+
earlReportSchema,
|
|
1583
|
+
engineQueryErrorSchema,
|
|
1584
|
+
evidenceModeSchema,
|
|
1585
|
+
evidenceOutcomeSchema,
|
|
1586
|
+
evidenceRecordResultSchema,
|
|
1587
|
+
evidenceRecordSchema,
|
|
1588
|
+
evidenceStrategySchema,
|
|
1589
|
+
evidenceTestSchema,
|
|
1590
|
+
failureIndexArtifactSchema,
|
|
1591
|
+
mediaInventorySchema,
|
|
1592
|
+
mobileGuidanceArtifactSchema,
|
|
1593
|
+
mobileGuidanceEntrySchema,
|
|
1594
|
+
mobileGuidanceStateSchema,
|
|
1595
|
+
nativeInputPolicySchema,
|
|
1596
|
+
normalizedCriteriaArtifactSchema,
|
|
1597
|
+
normalizedCriterionSchema,
|
|
1598
|
+
normalizedTechniqueSchema,
|
|
1599
|
+
notFoundErrorSchema,
|
|
1600
|
+
pageAuditStatusSchema,
|
|
1601
|
+
pageDiscoveryMethodSchema,
|
|
1602
|
+
pageDiscoveryStatusSchema,
|
|
1603
|
+
pageElementSchema,
|
|
1604
|
+
pageRecordSchema,
|
|
1605
|
+
pageScanSchema,
|
|
1606
|
+
pageSignalCategorySchema,
|
|
1607
|
+
pageSignalSchema,
|
|
1608
|
+
pageSignalSourceSchema,
|
|
1609
|
+
platformSchema,
|
|
1610
|
+
portableDriverVerbSchema,
|
|
1611
|
+
preferredEvidenceModeSchema,
|
|
1612
|
+
procedureCoverageSchema,
|
|
1613
|
+
quickrefTagLookupResultSchema,
|
|
1614
|
+
recordedJudgmentSchema,
|
|
1615
|
+
recordingFormatSchema,
|
|
1616
|
+
recordingStatusSchema,
|
|
1617
|
+
relevanceMatrixSchema,
|
|
1618
|
+
relevanceSchema,
|
|
1619
|
+
searchMatchFieldSchema,
|
|
1620
|
+
searchResultKindSchema,
|
|
1621
|
+
sessionRecordingSchema,
|
|
1622
|
+
siteInventorySchema,
|
|
1623
|
+
slugIndexArtifactSchema,
|
|
1624
|
+
strategyArtifactSchema,
|
|
1625
|
+
targetReferenceSchema,
|
|
1626
|
+
targetSchema,
|
|
1627
|
+
targetTypeSchema,
|
|
1628
|
+
techniqueBodyArtifactSchema,
|
|
1629
|
+
techniqueBodyEntrySchema,
|
|
1630
|
+
techniqueIndexArtifactSchema,
|
|
1631
|
+
techniqueIndexEntrySchema,
|
|
1632
|
+
techniqueLookupResultSchema,
|
|
1633
|
+
testMethodArtifactSchema,
|
|
1634
|
+
testMethodLookupResultSchema,
|
|
1635
|
+
testMethodSchema,
|
|
1636
|
+
testMethodSummaryArtifactSchema,
|
|
1637
|
+
understandingArtifactSchema,
|
|
1638
|
+
understandingDocumentEntrySchema,
|
|
1639
|
+
understandingLookupResultSchema,
|
|
1640
|
+
unifiedSearchResultSchema,
|
|
1641
|
+
unifiedSearchRowSchema,
|
|
1642
|
+
validationErrorSchema,
|
|
1643
|
+
violationCountsSchema,
|
|
1644
|
+
virtualEngineSchema,
|
|
1645
|
+
w3cDocumentMetaSchema,
|
|
1646
|
+
w3cDocumentProvenanceSchema,
|
|
1647
|
+
w3cDocumentSourceSchema,
|
|
1648
|
+
wcagLevelSchema,
|
|
1649
|
+
wcagLookupResultSchema,
|
|
1650
|
+
wcagVersionSchema
|
|
1651
|
+
};
|