equalweb-sdk 1.0.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/README.md +227 -0
- package/dist/index.d.mts +381 -0
- package/dist/index.d.ts +381 -0
- package/dist/index.js +568 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +532 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +52 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
var EqualWebError = class extends Error {
|
|
3
|
+
statusCode;
|
|
4
|
+
response;
|
|
5
|
+
constructor(message, statusCode, response) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "EqualWebError";
|
|
8
|
+
this.statusCode = statusCode;
|
|
9
|
+
this.response = response;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var RateLimitError = class extends EqualWebError {
|
|
13
|
+
retryAfter;
|
|
14
|
+
constructor(message, retryAfter) {
|
|
15
|
+
super(message, 429);
|
|
16
|
+
this.name = "RateLimitError";
|
|
17
|
+
this.retryAfter = retryAfter;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var AuthenticationError = class extends EqualWebError {
|
|
21
|
+
constructor(message = "Invalid or missing API key") {
|
|
22
|
+
super(message, 401);
|
|
23
|
+
this.name = "AuthenticationError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/client.ts
|
|
28
|
+
var DEFAULT_BASE_URL = "https://login.equalweb.com/api/v2";
|
|
29
|
+
var DEFAULT_TIMEOUT = 3e4;
|
|
30
|
+
var HttpClient = class {
|
|
31
|
+
apiKey;
|
|
32
|
+
baseUrl;
|
|
33
|
+
timeout;
|
|
34
|
+
constructor(config) {
|
|
35
|
+
if (!config.apiKey || config.apiKey.trim().length === 0) {
|
|
36
|
+
throw new Error("API key is required and cannot be empty");
|
|
37
|
+
}
|
|
38
|
+
if (config.timeout !== void 0 && config.timeout < 0) {
|
|
39
|
+
throw new Error("timeout must be a positive number");
|
|
40
|
+
}
|
|
41
|
+
if (config.baseUrl) {
|
|
42
|
+
try {
|
|
43
|
+
new URL(config.baseUrl);
|
|
44
|
+
} catch {
|
|
45
|
+
throw new Error("baseUrl must be a valid URL");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
this.apiKey = config.apiKey;
|
|
49
|
+
this.baseUrl = config.baseUrl?.replace(/\/$/, "") ?? DEFAULT_BASE_URL;
|
|
50
|
+
this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
|
|
51
|
+
}
|
|
52
|
+
async request(options) {
|
|
53
|
+
const { method, path, query, body, isFormData, responseType = "json" } = options;
|
|
54
|
+
const url = new URL(path, this.baseUrl + "/");
|
|
55
|
+
if (query) {
|
|
56
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
57
|
+
if (value !== void 0) {
|
|
58
|
+
url.searchParams.set(key, String(value));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const headers = {
|
|
63
|
+
"x-a11y-api-key": this.apiKey
|
|
64
|
+
};
|
|
65
|
+
if (!isFormData && body) {
|
|
66
|
+
headers["Content-Type"] = "application/json";
|
|
67
|
+
}
|
|
68
|
+
const controller = new AbortController();
|
|
69
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch(url.toString(), {
|
|
72
|
+
method,
|
|
73
|
+
headers,
|
|
74
|
+
body: isFormData ? body : body ? JSON.stringify(body) : void 0,
|
|
75
|
+
signal: controller.signal
|
|
76
|
+
});
|
|
77
|
+
clearTimeout(timeoutId);
|
|
78
|
+
if (!response.ok) {
|
|
79
|
+
await this.handleErrorResponse(response);
|
|
80
|
+
}
|
|
81
|
+
if (responseType === "blob") {
|
|
82
|
+
return response.blob();
|
|
83
|
+
}
|
|
84
|
+
const text = await response.text();
|
|
85
|
+
if (!text) {
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
return JSON.parse(text);
|
|
90
|
+
} catch (parseError) {
|
|
91
|
+
const preview = text.length > 100 ? text.substring(0, 100) + "..." : text;
|
|
92
|
+
throw new EqualWebError(`Failed to parse JSON response: ${preview}`, 0);
|
|
93
|
+
}
|
|
94
|
+
} catch (error) {
|
|
95
|
+
clearTimeout(timeoutId);
|
|
96
|
+
if (error instanceof EqualWebError) {
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
if (error instanceof Error) {
|
|
100
|
+
if (error.name === "AbortError") {
|
|
101
|
+
throw new EqualWebError("Request timeout", 408);
|
|
102
|
+
}
|
|
103
|
+
throw new EqualWebError(error.message, 0);
|
|
104
|
+
}
|
|
105
|
+
throw new EqualWebError("Unknown error occurred", 0);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async handleErrorResponse(response) {
|
|
109
|
+
let errorData;
|
|
110
|
+
try {
|
|
111
|
+
const text = await response.text();
|
|
112
|
+
if (text) {
|
|
113
|
+
errorData = JSON.parse(text);
|
|
114
|
+
}
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
const message = errorData?.error ?? errorData?.message ?? response.statusText;
|
|
118
|
+
switch (response.status) {
|
|
119
|
+
case 401:
|
|
120
|
+
throw new AuthenticationError(message);
|
|
121
|
+
case 429: {
|
|
122
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
123
|
+
throw new RateLimitError(
|
|
124
|
+
message || "Rate limit exceeded",
|
|
125
|
+
retryAfter ? parseInt(retryAfter, 10) : void 0
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
default:
|
|
129
|
+
throw new EqualWebError(message, response.status, errorData);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
get(path, query) {
|
|
133
|
+
return this.request({ method: "GET", path, query });
|
|
134
|
+
}
|
|
135
|
+
post(path, body) {
|
|
136
|
+
return this.request({ method: "POST", path, body });
|
|
137
|
+
}
|
|
138
|
+
put(path, body, isFormData = false) {
|
|
139
|
+
return this.request({ method: "PUT", path, body, isFormData });
|
|
140
|
+
}
|
|
141
|
+
delete(path, body) {
|
|
142
|
+
return this.request({ method: "DELETE", path, body });
|
|
143
|
+
}
|
|
144
|
+
getBlob(path, query) {
|
|
145
|
+
return this.request({ method: "GET", path, query, responseType: "blob" });
|
|
146
|
+
}
|
|
147
|
+
postBlob(path, body) {
|
|
148
|
+
return this.request({ method: "POST", path, body, responseType: "blob" });
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// src/api/info.ts
|
|
153
|
+
var InfoApi = class {
|
|
154
|
+
constructor(client) {
|
|
155
|
+
this.client = client;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the current credit balance for your account
|
|
159
|
+
* @returns The current credit balance
|
|
160
|
+
*/
|
|
161
|
+
async getBalance() {
|
|
162
|
+
const response = await this.client.get("info/balance");
|
|
163
|
+
return response.results;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// src/api/documents.ts
|
|
168
|
+
var DocumentsApi = class {
|
|
169
|
+
constructor(client) {
|
|
170
|
+
this.client = client;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get all documents
|
|
174
|
+
* @param params - Optional filters for groupID, archived status, and document type
|
|
175
|
+
* @returns Array of documents
|
|
176
|
+
*/
|
|
177
|
+
async getAll(params) {
|
|
178
|
+
return this.client.get("docs", {
|
|
179
|
+
groupID: params?.groupID,
|
|
180
|
+
archived: params?.archived,
|
|
181
|
+
type: params?.type
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get the status of a specific document
|
|
186
|
+
* @param reportID - The report ID of the document
|
|
187
|
+
* @returns The document status
|
|
188
|
+
*/
|
|
189
|
+
async getStatus(reportID) {
|
|
190
|
+
if (!reportID || reportID.trim().length === 0) {
|
|
191
|
+
throw new Error("reportID cannot be empty");
|
|
192
|
+
}
|
|
193
|
+
const response = await this.client.get(`docs/status/${reportID}`);
|
|
194
|
+
return response.status;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Upload a document for processing
|
|
198
|
+
* Supported formats: PDF, XLSX, DOCX, PPTX
|
|
199
|
+
* @param file - The file to upload (File, Blob, ArrayBuffer, or Uint8Array)
|
|
200
|
+
* @param filename - Optional filename (required if file is an ArrayBuffer or Uint8Array)
|
|
201
|
+
* @returns Upload response with document ID and metadata
|
|
202
|
+
*/
|
|
203
|
+
async upload(file, filename) {
|
|
204
|
+
if (!file) {
|
|
205
|
+
throw new Error("file cannot be null or undefined");
|
|
206
|
+
}
|
|
207
|
+
let sizeInBytes = 0;
|
|
208
|
+
if (file instanceof ArrayBuffer) {
|
|
209
|
+
sizeInBytes = file.byteLength;
|
|
210
|
+
} else if (file instanceof Uint8Array) {
|
|
211
|
+
sizeInBytes = file.byteLength;
|
|
212
|
+
} else if (file instanceof Blob) {
|
|
213
|
+
sizeInBytes = file.size;
|
|
214
|
+
}
|
|
215
|
+
if (sizeInBytes === 0) {
|
|
216
|
+
throw new Error("file is empty");
|
|
217
|
+
}
|
|
218
|
+
const formData = new FormData();
|
|
219
|
+
if (file instanceof ArrayBuffer || file instanceof Uint8Array) {
|
|
220
|
+
const blob = new Blob([file]);
|
|
221
|
+
formData.append("file", blob, filename ?? "document.pdf");
|
|
222
|
+
} else if (file instanceof Blob) {
|
|
223
|
+
const defaultFilename = file?.name ?? "document.pdf";
|
|
224
|
+
formData.append("file", file, filename ?? defaultFilename);
|
|
225
|
+
} else {
|
|
226
|
+
formData.append("file", file);
|
|
227
|
+
}
|
|
228
|
+
return this.client.put("docs/upload", formData, true);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Delete multiple documents
|
|
232
|
+
* @param files - Array of document IDs to delete
|
|
233
|
+
* @returns Results indicating success/failure for each document
|
|
234
|
+
*/
|
|
235
|
+
async delete(files) {
|
|
236
|
+
if (!files || files.length === 0) {
|
|
237
|
+
throw new Error("files array cannot be empty");
|
|
238
|
+
}
|
|
239
|
+
const params = { files };
|
|
240
|
+
return this.client.delete("docs", params);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Archive documents
|
|
244
|
+
* @param files - Array of document IDs to archive
|
|
245
|
+
* @returns Result of the operation
|
|
246
|
+
*/
|
|
247
|
+
async archive(files) {
|
|
248
|
+
if (!files || files.length === 0) {
|
|
249
|
+
throw new Error("files array cannot be empty");
|
|
250
|
+
}
|
|
251
|
+
const params = { files, archive: true };
|
|
252
|
+
return this.client.post("docs/archive", params);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Restore archived documents
|
|
256
|
+
* @param files - Array of document IDs to restore
|
|
257
|
+
* @returns Result of the operation
|
|
258
|
+
*/
|
|
259
|
+
async restore(files) {
|
|
260
|
+
if (!files || files.length === 0) {
|
|
261
|
+
throw new Error("files array cannot be empty");
|
|
262
|
+
}
|
|
263
|
+
const params = { files, archive: false };
|
|
264
|
+
return this.client.post("docs/archive", params);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/api/groups.ts
|
|
269
|
+
var GroupsApi = class {
|
|
270
|
+
constructor(client) {
|
|
271
|
+
this.client = client;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get all document groups
|
|
275
|
+
* @returns Array of document groups
|
|
276
|
+
*/
|
|
277
|
+
async getAll() {
|
|
278
|
+
return this.client.get("docs/groups");
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Add documents to a new group
|
|
282
|
+
* @param files - Array of document IDs to group
|
|
283
|
+
* @param groupName - Name of the new group to create
|
|
284
|
+
* @returns Result of the operation
|
|
285
|
+
*/
|
|
286
|
+
async createGroup(files, groupName) {
|
|
287
|
+
if (!files || files.length === 0) {
|
|
288
|
+
throw new Error("files array cannot be empty");
|
|
289
|
+
}
|
|
290
|
+
if (!groupName || groupName.trim().length === 0) {
|
|
291
|
+
throw new Error("groupName cannot be empty");
|
|
292
|
+
}
|
|
293
|
+
const params = { files, newGroup: groupName };
|
|
294
|
+
return this.client.post("docs/group", params);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Add documents to an existing group
|
|
298
|
+
* @param files - Array of document IDs to group
|
|
299
|
+
* @param groupID - ID of the existing group
|
|
300
|
+
* @returns Result of the operation
|
|
301
|
+
*/
|
|
302
|
+
async addToGroup(files, groupID) {
|
|
303
|
+
if (!files || files.length === 0) {
|
|
304
|
+
throw new Error("files array cannot be empty");
|
|
305
|
+
}
|
|
306
|
+
if (!groupID || groupID.trim().length === 0) {
|
|
307
|
+
throw new Error("groupID cannot be empty");
|
|
308
|
+
}
|
|
309
|
+
const params = { files, selectedGroup: groupID };
|
|
310
|
+
return this.client.post("docs/group", params);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Rename a document group
|
|
314
|
+
* @param groupID - ID of the group to rename
|
|
315
|
+
* @param groupName - New name for the group
|
|
316
|
+
* @returns Result of the operation
|
|
317
|
+
*/
|
|
318
|
+
async rename(groupID, groupName) {
|
|
319
|
+
if (!groupID || groupID.trim().length === 0) {
|
|
320
|
+
throw new Error("groupID cannot be empty");
|
|
321
|
+
}
|
|
322
|
+
if (!groupName || groupName.trim().length === 0) {
|
|
323
|
+
throw new Error("groupName cannot be empty");
|
|
324
|
+
}
|
|
325
|
+
const params = { groupID, groupName };
|
|
326
|
+
return this.client.post("group-name", params);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// src/api/audit.ts
|
|
331
|
+
var AuditApi = class {
|
|
332
|
+
constructor(client) {
|
|
333
|
+
this.client = client;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Start a full audit on documents
|
|
337
|
+
* This performs accessibility remediation and generates detailed reports
|
|
338
|
+
* @param files - Array of document IDs to audit
|
|
339
|
+
* @returns Result of the operation (202 Accepted - processing is async)
|
|
340
|
+
*/
|
|
341
|
+
async audit(files) {
|
|
342
|
+
if (!files || files.length === 0) {
|
|
343
|
+
throw new Error("files array cannot be empty");
|
|
344
|
+
}
|
|
345
|
+
const params = { files, type: "audit" };
|
|
346
|
+
return this.client.post("docs/audit", params);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Perform a quick check on documents without full remediation
|
|
350
|
+
* @param files - Array of document IDs to check
|
|
351
|
+
* @returns Result of the operation (202 Accepted - processing is async)
|
|
352
|
+
*/
|
|
353
|
+
async check(files) {
|
|
354
|
+
if (!files || files.length === 0) {
|
|
355
|
+
throw new Error("files array cannot be empty");
|
|
356
|
+
}
|
|
357
|
+
const params = { files, type: "check" };
|
|
358
|
+
return this.client.post("docs/audit", params);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Start an audit with custom type
|
|
362
|
+
* @param files - Array of document IDs to process
|
|
363
|
+
* @param type - Type of audit: "audit" for full audit, "check" for quick check
|
|
364
|
+
* @returns Result of the operation (202 Accepted - processing is async)
|
|
365
|
+
*/
|
|
366
|
+
async process(files, type) {
|
|
367
|
+
if (!files || files.length === 0) {
|
|
368
|
+
throw new Error("files array cannot be empty");
|
|
369
|
+
}
|
|
370
|
+
if (!type || type.trim().length === 0) {
|
|
371
|
+
throw new Error("type cannot be empty");
|
|
372
|
+
}
|
|
373
|
+
const params = { files, type };
|
|
374
|
+
return this.client.post("docs/audit", params);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// src/api/reports.ts
|
|
379
|
+
var REPORTS_BASE_URL = "https://login.equalweb.com/reports/pdf";
|
|
380
|
+
var ReportsApi = class {
|
|
381
|
+
constructor(client) {
|
|
382
|
+
this.client = client;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Get the JSON report for a document
|
|
386
|
+
* @param reportID - The report ID
|
|
387
|
+
* @param type - Which report to retrieve: "audited", "original", or "both"
|
|
388
|
+
* @returns The report data
|
|
389
|
+
*/
|
|
390
|
+
async get(reportID, type = "audited") {
|
|
391
|
+
const params = { type };
|
|
392
|
+
return this.client.get(`docs/report/${reportID}`, {
|
|
393
|
+
type: params.type
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Get the audited report for a document
|
|
398
|
+
* @param reportID - The report ID
|
|
399
|
+
* @returns The audited report data
|
|
400
|
+
*/
|
|
401
|
+
async getAudited(reportID) {
|
|
402
|
+
return this.get(reportID, "audited");
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Get the original report for a document
|
|
406
|
+
* @param reportID - The report ID
|
|
407
|
+
* @returns The original report data
|
|
408
|
+
*/
|
|
409
|
+
async getOriginal(reportID) {
|
|
410
|
+
return this.get(reportID, "original");
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Get both audited and original reports for a document
|
|
414
|
+
* @param reportID - The report ID
|
|
415
|
+
* @returns Both report data
|
|
416
|
+
*/
|
|
417
|
+
async getBoth(reportID) {
|
|
418
|
+
return this.get(reportID, "both");
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Get the URL to view the report in a browser
|
|
422
|
+
* Note: This URL does not require authentication
|
|
423
|
+
* @param reportID - The report ID
|
|
424
|
+
* @returns The browser-viewable URL
|
|
425
|
+
*/
|
|
426
|
+
getBrowserUrl(reportID) {
|
|
427
|
+
return `${REPORTS_BASE_URL}/${reportID}`;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
// src/api/downloads.ts
|
|
432
|
+
var DownloadsApi = class {
|
|
433
|
+
constructor(client) {
|
|
434
|
+
this.client = client;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Download a single document file
|
|
438
|
+
* @param reportID - The report ID of the document
|
|
439
|
+
* @param options - Download options (original file, file type)
|
|
440
|
+
* @returns The file as a Blob
|
|
441
|
+
*/
|
|
442
|
+
async file(reportID, options) {
|
|
443
|
+
return this.client.getBlob(`docs/download/file/${reportID}`, {
|
|
444
|
+
original: options?.original,
|
|
445
|
+
type: options?.type
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Download the audited/processed version of a document
|
|
450
|
+
* @param reportID - The report ID of the document
|
|
451
|
+
* @param type - File type to download (pdf or xlsx)
|
|
452
|
+
* @returns The processed file as a Blob
|
|
453
|
+
*/
|
|
454
|
+
async audited(reportID, type = "pdf") {
|
|
455
|
+
return this.file(reportID, { original: false, type });
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Download the original version of a document
|
|
459
|
+
* @param reportID - The report ID of the document
|
|
460
|
+
* @param type - File type to download (pdf or xlsx)
|
|
461
|
+
* @returns The original file as a Blob
|
|
462
|
+
*/
|
|
463
|
+
async original(reportID, type = "pdf") {
|
|
464
|
+
return this.file(reportID, { original: true, type });
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Download multiple documents as a ZIP file
|
|
468
|
+
* @param files - Array of document IDs to include in the ZIP
|
|
469
|
+
* @returns The ZIP file as a Blob
|
|
470
|
+
*/
|
|
471
|
+
async zipped(files) {
|
|
472
|
+
const params = { files };
|
|
473
|
+
return this.client.postBlob("docs/download/zipped", params);
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
// src/equalweb.ts
|
|
478
|
+
var EqualWeb = class {
|
|
479
|
+
client;
|
|
480
|
+
info;
|
|
481
|
+
documents;
|
|
482
|
+
groups;
|
|
483
|
+
audit;
|
|
484
|
+
reports;
|
|
485
|
+
downloads;
|
|
486
|
+
/**
|
|
487
|
+
* Create a new EqualWeb API client
|
|
488
|
+
* @param config - Configuration object with API key and optional settings
|
|
489
|
+
* @example
|
|
490
|
+
* ```typescript
|
|
491
|
+
* const client = new EqualWeb({ apiKey: 'your-api-key' });
|
|
492
|
+
*
|
|
493
|
+
* // Get credit balance
|
|
494
|
+
* const balance = await client.info.getBalance();
|
|
495
|
+
*
|
|
496
|
+
* // Upload a document
|
|
497
|
+
* const file = new File([...], 'document.pdf');
|
|
498
|
+
* const upload = await client.documents.upload(file);
|
|
499
|
+
*
|
|
500
|
+
* // Start an audit
|
|
501
|
+
* await client.audit.audit([upload.id]);
|
|
502
|
+
*
|
|
503
|
+
* // Check status
|
|
504
|
+
* const status = await client.documents.getStatus(upload.id);
|
|
505
|
+
*
|
|
506
|
+
* // Download the audited file
|
|
507
|
+
* const blob = await client.downloads.audited(upload.id);
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
constructor(config) {
|
|
511
|
+
this.client = new HttpClient(config);
|
|
512
|
+
this.info = new InfoApi(this.client);
|
|
513
|
+
this.documents = new DocumentsApi(this.client);
|
|
514
|
+
this.groups = new GroupsApi(this.client);
|
|
515
|
+
this.audit = new AuditApi(this.client);
|
|
516
|
+
this.reports = new ReportsApi(this.client);
|
|
517
|
+
this.downloads = new DownloadsApi(this.client);
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
export {
|
|
521
|
+
AuditApi,
|
|
522
|
+
AuthenticationError,
|
|
523
|
+
DocumentsApi,
|
|
524
|
+
DownloadsApi,
|
|
525
|
+
EqualWeb,
|
|
526
|
+
EqualWebError,
|
|
527
|
+
GroupsApi,
|
|
528
|
+
InfoApi,
|
|
529
|
+
RateLimitError,
|
|
530
|
+
ReportsApi
|
|
531
|
+
};
|
|
532
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts","../src/client.ts","../src/api/info.ts","../src/api/documents.ts","../src/api/groups.ts","../src/api/audit.ts","../src/api/reports.ts","../src/api/downloads.ts","../src/equalweb.ts"],"sourcesContent":["// ============================================================================\r\n// Configuration Types\r\n// ============================================================================\r\n\r\nexport interface EqualWebConfig {\r\n apiKey: string;\r\n baseUrl?: string;\r\n timeout?: number;\r\n}\r\n\r\n// ============================================================================\r\n// Common Types\r\n// ============================================================================\r\n\r\nexport type DocumentStatus = \"done\" | \"pending\" | \"processing\" | string;\r\n\r\nexport type AuditType = \"audit\" | \"check\";\r\n\r\nexport type ReportType = \"audited\" | \"original\" | \"both\";\r\n\r\nexport type DownloadFileType = \"pdf\" | \"xlsx\";\r\n\r\n// ============================================================================\r\n// Info Types\r\n// ============================================================================\r\n\r\nexport interface BalanceResponse {\r\n results: number;\r\n}\r\n\r\n// ============================================================================\r\n// Document Types\r\n// ============================================================================\r\n\r\nexport interface Document {\r\n numberOfPages: number;\r\n createdAt: string;\r\n group: number | null;\r\n archived: boolean;\r\n reportID: string;\r\n status: DocumentStatus;\r\n}\r\n\r\nexport interface GetDocumentsParams {\r\n groupID?: string;\r\n archived?: boolean;\r\n type?: string;\r\n}\r\n\r\nexport interface DocumentStatusResponse {\r\n status: DocumentStatus;\r\n}\r\n\r\nexport interface UploadResponse {\r\n id: string;\r\n createdAt: string;\r\n numberOfPages: number;\r\n}\r\n\r\nexport interface DeleteDocumentsParams {\r\n files: string[];\r\n}\r\n\r\nexport interface DeleteDocumentsResponse {\r\n results: Record<string, boolean | { error: string }>;\r\n}\r\n\r\nexport interface ArchiveDocumentsParams {\r\n files: string[];\r\n archive?: boolean;\r\n}\r\n\r\nexport interface ArchiveDocumentsResponse {\r\n results: \"ok\";\r\n}\r\n\r\n// ============================================================================\r\n// Group Types\r\n// ============================================================================\r\n\r\nexport interface DocumentGroup {\r\n id: number;\r\n name: string;\r\n createdAt: string;\r\n}\r\n\r\nexport interface GroupDocumentsParams {\r\n files: string[];\r\n newGroup?: string;\r\n selectedGroup?: string;\r\n}\r\n\r\nexport interface GroupDocumentsResponse {\r\n results: \"ok\";\r\n}\r\n\r\nexport interface RenameGroupParams {\r\n groupID: string;\r\n groupName: string;\r\n}\r\n\r\nexport interface RenameGroupResponse {\r\n results: \"ok\";\r\n}\r\n\r\n// ============================================================================\r\n// Audit Types\r\n// ============================================================================\r\n\r\nexport interface AuditDocumentsParams {\r\n files: string[];\r\n type?: AuditType;\r\n}\r\n\r\nexport interface AuditDocumentsResponse {\r\n results: \"ok\";\r\n}\r\n\r\n// ============================================================================\r\n// Report Types\r\n// ============================================================================\r\n\r\nexport interface ReportRule {\r\n Rule: string;\r\n Status: \"Passed\" | \"Failed\" | \"Needs manual check\" | string;\r\n Description: string;\r\n}\r\n\r\nexport interface ReportSummary {\r\n \"Passed\"?: number;\r\n \"Failed\"?: number;\r\n \"Needs manual check\"?: number;\r\n Description?: string;\r\n}\r\n\r\nexport interface DetailedReport {\r\n Document?: ReportRule[];\r\n \"Page Content\"?: ReportRule[];\r\n Forms?: ReportRule[];\r\n \"Alternate Text\"?: ReportRule[];\r\n Tables?: ReportRule[];\r\n Lists?: ReportRule[];\r\n Headings?: ReportRule[];\r\n}\r\n\r\nexport interface ReportCustomData {\r\n fileName?: string;\r\n fileSize?: number;\r\n numberOfPages?: number;\r\n tags?: Record<string, number>;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport interface AuditedReport {\r\n Summary?: ReportSummary;\r\n \"Detailed Report\"?: DetailedReport;\r\n customData?: ReportCustomData;\r\n}\r\n\r\nexport interface OriginalReport {\r\n Summary?: ReportSummary;\r\n \"Detailed Report\"?: DetailedReport;\r\n customData?: ReportCustomData;\r\n}\r\n\r\nexport interface GetReportParams {\r\n type?: ReportType;\r\n}\r\n\r\nexport interface ReportResponse {\r\n original?: OriginalReport;\r\n audited?: AuditedReport;\r\n}\r\n\r\n// ============================================================================\r\n// Download Types\r\n// ============================================================================\r\n\r\nexport interface DownloadFileParams {\r\n original?: boolean;\r\n type?: DownloadFileType;\r\n}\r\n\r\nexport interface DownloadZippedParams {\r\n files: string[];\r\n}\r\n\r\n// ============================================================================\r\n// Error Types\r\n// ============================================================================\r\n\r\nexport interface EqualWebErrorResponse {\r\n error?: string;\r\n message?: string;\r\n statusCode?: number;\r\n}\r\n\r\nexport class EqualWebError extends Error {\r\n public readonly statusCode: number;\r\n public readonly response?: EqualWebErrorResponse;\r\n\r\n constructor(message: string, statusCode: number, response?: EqualWebErrorResponse) {\r\n super(message);\r\n this.name = \"EqualWebError\";\r\n this.statusCode = statusCode;\r\n this.response = response;\r\n }\r\n}\r\n\r\nexport class RateLimitError extends EqualWebError {\r\n public readonly retryAfter?: number;\r\n\r\n constructor(message: string, retryAfter?: number) {\r\n super(message, 429);\r\n this.name = \"RateLimitError\";\r\n this.retryAfter = retryAfter;\r\n }\r\n}\r\n\r\nexport class AuthenticationError extends EqualWebError {\r\n constructor(message: string = \"Invalid or missing API key\") {\r\n super(message, 401);\r\n this.name = \"AuthenticationError\";\r\n }\r\n}\r\n","import {\r\n EqualWebConfig,\r\n EqualWebError,\r\n EqualWebErrorResponse,\r\n RateLimitError,\r\n AuthenticationError,\r\n} from \"./types\";\r\n\r\nconst DEFAULT_BASE_URL = \"https://login.equalweb.com/api/v2\";\r\nconst DEFAULT_TIMEOUT = 30000;\r\n\r\nexport interface RequestOptions {\r\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\r\n path: string;\r\n query?: Record<string, string | boolean | undefined>;\r\n body?: unknown;\r\n isFormData?: boolean;\r\n responseType?: \"json\" | \"blob\";\r\n}\r\n\r\nexport class HttpClient {\r\n private readonly apiKey: string;\r\n private readonly baseUrl: string;\r\n private readonly timeout: number;\r\n\r\n constructor(config: EqualWebConfig) {\r\n if (!config.apiKey || config.apiKey.trim().length === 0) {\r\n throw new Error(\"API key is required and cannot be empty\");\r\n }\r\n\r\n if (config.timeout !== undefined && config.timeout < 0) {\r\n throw new Error(\"timeout must be a positive number\");\r\n }\r\n\r\n if (config.baseUrl) {\r\n try {\r\n new URL(config.baseUrl);\r\n } catch {\r\n throw new Error(\"baseUrl must be a valid URL\");\r\n }\r\n }\r\n\r\n this.apiKey = config.apiKey;\r\n this.baseUrl = config.baseUrl?.replace(/\\/$/, \"\") ?? DEFAULT_BASE_URL;\r\n this.timeout = config.timeout ?? DEFAULT_TIMEOUT;\r\n }\r\n\r\n async request<T>(options: RequestOptions): Promise<T> {\r\n const { method, path, query, body, isFormData, responseType = \"json\" } = options;\r\n\r\n const url = new URL(path, this.baseUrl + \"/\");\r\n\r\n if (query) {\r\n Object.entries(query).forEach(([key, value]) => {\r\n if (value !== undefined) {\r\n url.searchParams.set(key, String(value));\r\n }\r\n });\r\n }\r\n\r\n const headers: Record<string, string> = {\r\n \"x-a11y-api-key\": this.apiKey,\r\n };\r\n\r\n if (!isFormData && body) {\r\n headers[\"Content-Type\"] = \"application/json\";\r\n }\r\n\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\r\n\r\n try {\r\n const response = await fetch(url.toString(), {\r\n method,\r\n headers,\r\n body: isFormData ? (body as FormData) : body ? JSON.stringify(body) : undefined,\r\n signal: controller.signal,\r\n });\r\n\r\n clearTimeout(timeoutId);\r\n\r\n if (!response.ok) {\r\n await this.handleErrorResponse(response);\r\n }\r\n\r\n if (responseType === \"blob\") {\r\n return response.blob() as Promise<T>;\r\n }\r\n\r\n const text = await response.text();\r\n if (!text) {\r\n return {} as T;\r\n }\r\n\r\n try {\r\n return JSON.parse(text) as T;\r\n } catch (parseError) {\r\n const preview = text.length > 100 ? text.substring(0, 100) + \"...\" : text;\r\n throw new EqualWebError(`Failed to parse JSON response: ${preview}`, 0);\r\n }\r\n } catch (error) {\r\n clearTimeout(timeoutId);\r\n\r\n if (error instanceof EqualWebError) {\r\n throw error;\r\n }\r\n\r\n if (error instanceof Error) {\r\n if (error.name === \"AbortError\") {\r\n throw new EqualWebError(\"Request timeout\", 408);\r\n }\r\n throw new EqualWebError(error.message, 0);\r\n }\r\n\r\n throw new EqualWebError(\"Unknown error occurred\", 0);\r\n }\r\n }\r\n\r\n private async handleErrorResponse(response: Response): Promise<never> {\r\n let errorData: EqualWebErrorResponse | undefined;\r\n\r\n try {\r\n const text = await response.text();\r\n if (text) {\r\n errorData = JSON.parse(text);\r\n }\r\n } catch {\r\n // Response body is not JSON\r\n }\r\n\r\n const message = errorData?.error ?? errorData?.message ?? response.statusText;\r\n\r\n switch (response.status) {\r\n case 401:\r\n throw new AuthenticationError(message);\r\n case 429: {\r\n const retryAfter = response.headers.get(\"Retry-After\");\r\n throw new RateLimitError(\r\n message || \"Rate limit exceeded\",\r\n retryAfter ? parseInt(retryAfter, 10) : undefined\r\n );\r\n }\r\n default:\r\n throw new EqualWebError(message, response.status, errorData);\r\n }\r\n }\r\n\r\n get<T>(path: string, query?: Record<string, string | boolean | undefined>): Promise<T> {\r\n return this.request<T>({ method: \"GET\", path, query });\r\n }\r\n\r\n post<T>(path: string, body?: unknown): Promise<T> {\r\n return this.request<T>({ method: \"POST\", path, body });\r\n }\r\n\r\n put<T>(path: string, body?: unknown, isFormData = false): Promise<T> {\r\n return this.request<T>({ method: \"PUT\", path, body, isFormData });\r\n }\r\n\r\n delete<T>(path: string, body?: unknown): Promise<T> {\r\n return this.request<T>({ method: \"DELETE\", path, body });\r\n }\r\n\r\n getBlob(path: string, query?: Record<string, string | boolean | undefined>): Promise<Blob> {\r\n return this.request<Blob>({ method: \"GET\", path, query, responseType: \"blob\" });\r\n }\r\n\r\n postBlob(path: string, body?: unknown): Promise<Blob> {\r\n return this.request<Blob>({ method: \"POST\", path, body, responseType: \"blob\" });\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport { BalanceResponse } from \"../types\";\r\n\r\nexport class InfoApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Get the current credit balance for your account\r\n * @returns The current credit balance\r\n */\r\n async getBalance(): Promise<number> {\r\n const response = await this.client.get<BalanceResponse>(\"info/balance\");\r\n return response.results;\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport {\r\n Document,\r\n GetDocumentsParams,\r\n DocumentStatusResponse,\r\n UploadResponse,\r\n DeleteDocumentsParams,\r\n DeleteDocumentsResponse,\r\n ArchiveDocumentsParams,\r\n ArchiveDocumentsResponse,\r\n} from \"../types\";\r\n\r\nexport class DocumentsApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Get all documents\r\n * @param params - Optional filters for groupID, archived status, and document type\r\n * @returns Array of documents\r\n */\r\n async getAll(params?: GetDocumentsParams): Promise<Document[]> {\r\n return this.client.get<Document[]>(\"docs\", {\r\n groupID: params?.groupID,\r\n archived: params?.archived,\r\n type: params?.type,\r\n });\r\n }\r\n\r\n /**\r\n * Get the status of a specific document\r\n * @param reportID - The report ID of the document\r\n * @returns The document status\r\n */\r\n async getStatus(reportID: string): Promise<string> {\r\n if (!reportID || reportID.trim().length === 0) {\r\n throw new Error(\"reportID cannot be empty\");\r\n }\r\n const response = await this.client.get<DocumentStatusResponse>(`docs/status/${reportID}`);\r\n return response.status;\r\n }\r\n\r\n /**\r\n * Upload a document for processing\r\n * Supported formats: PDF, XLSX, DOCX, PPTX\r\n * @param file - The file to upload (File, Blob, ArrayBuffer, or Uint8Array)\r\n * @param filename - Optional filename (required if file is an ArrayBuffer or Uint8Array)\r\n * @returns Upload response with document ID and metadata\r\n */\r\n async upload(\r\n file: File | Blob | ArrayBuffer | Uint8Array,\r\n filename?: string\r\n ): Promise<UploadResponse> {\r\n if (!file) {\r\n throw new Error(\"file cannot be null or undefined\");\r\n }\r\n\r\n // Validate file size\r\n let sizeInBytes = 0;\r\n if (file instanceof ArrayBuffer) {\r\n sizeInBytes = file.byteLength;\r\n } else if (file instanceof Uint8Array) {\r\n sizeInBytes = file.byteLength;\r\n } else if (file instanceof Blob) {\r\n sizeInBytes = file.size;\r\n }\r\n\r\n if (sizeInBytes === 0) {\r\n throw new Error(\"file is empty\");\r\n }\r\n\r\n const formData = new FormData();\r\n\r\n if (file instanceof ArrayBuffer || file instanceof Uint8Array) {\r\n const blob = new Blob([file as BlobPart]);\r\n formData.append(\"file\", blob, filename ?? \"document.pdf\");\r\n } else if (file instanceof Blob) {\r\n // Use optional chaining for safer property access\r\n const defaultFilename = (file as any)?.name ?? \"document.pdf\";\r\n formData.append(\"file\", file, filename ?? defaultFilename);\r\n } else {\r\n formData.append(\"file\", file);\r\n }\r\n\r\n return this.client.put<UploadResponse>(\"docs/upload\", formData, true);\r\n }\r\n\r\n /**\r\n * Delete multiple documents\r\n * @param files - Array of document IDs to delete\r\n * @returns Results indicating success/failure for each document\r\n */\r\n async delete(files: string[]): Promise<DeleteDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n const params: DeleteDocumentsParams = { files };\r\n return this.client.delete<DeleteDocumentsResponse>(\"docs\", params);\r\n }\r\n\r\n /**\r\n * Archive documents\r\n * @param files - Array of document IDs to archive\r\n * @returns Result of the operation\r\n */\r\n async archive(files: string[]): Promise<ArchiveDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n const params: ArchiveDocumentsParams = { files, archive: true };\r\n return this.client.post<ArchiveDocumentsResponse>(\"docs/archive\", params);\r\n }\r\n\r\n /**\r\n * Restore archived documents\r\n * @param files - Array of document IDs to restore\r\n * @returns Result of the operation\r\n */\r\n async restore(files: string[]): Promise<ArchiveDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n const params: ArchiveDocumentsParams = { files, archive: false };\r\n return this.client.post<ArchiveDocumentsResponse>(\"docs/archive\", params);\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport {\r\n DocumentGroup,\r\n GroupDocumentsParams,\r\n GroupDocumentsResponse,\r\n RenameGroupParams,\r\n RenameGroupResponse,\r\n} from \"../types\";\r\n\r\nexport class GroupsApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Get all document groups\r\n * @returns Array of document groups\r\n */\r\n async getAll(): Promise<DocumentGroup[]> {\r\n return this.client.get<DocumentGroup[]>(\"docs/groups\");\r\n }\r\n\r\n /**\r\n * Add documents to a new group\r\n * @param files - Array of document IDs to group\r\n * @param groupName - Name of the new group to create\r\n * @returns Result of the operation\r\n */\r\n async createGroup(files: string[], groupName: string): Promise<GroupDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n if (!groupName || groupName.trim().length === 0) {\r\n throw new Error(\"groupName cannot be empty\");\r\n }\r\n const params: GroupDocumentsParams = { files, newGroup: groupName };\r\n return this.client.post<GroupDocumentsResponse>(\"docs/group\", params);\r\n }\r\n\r\n /**\r\n * Add documents to an existing group\r\n * @param files - Array of document IDs to group\r\n * @param groupID - ID of the existing group\r\n * @returns Result of the operation\r\n */\r\n async addToGroup(files: string[], groupID: string): Promise<GroupDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n if (!groupID || groupID.trim().length === 0) {\r\n throw new Error(\"groupID cannot be empty\");\r\n }\r\n const params: GroupDocumentsParams = { files, selectedGroup: groupID };\r\n return this.client.post<GroupDocumentsResponse>(\"docs/group\", params);\r\n }\r\n\r\n /**\r\n * Rename a document group\r\n * @param groupID - ID of the group to rename\r\n * @param groupName - New name for the group\r\n * @returns Result of the operation\r\n */\r\n async rename(groupID: string, groupName: string): Promise<RenameGroupResponse> {\r\n if (!groupID || groupID.trim().length === 0) {\r\n throw new Error(\"groupID cannot be empty\");\r\n }\r\n if (!groupName || groupName.trim().length === 0) {\r\n throw new Error(\"groupName cannot be empty\");\r\n }\r\n const params: RenameGroupParams = { groupID, groupName };\r\n return this.client.post<RenameGroupResponse>(\"group-name\", params);\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport { AuditDocumentsParams, AuditDocumentsResponse, AuditType } from \"../types\";\r\n\r\nexport class AuditApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Start a full audit on documents\r\n * This performs accessibility remediation and generates detailed reports\r\n * @param files - Array of document IDs to audit\r\n * @returns Result of the operation (202 Accepted - processing is async)\r\n */\r\n async audit(files: string[]): Promise<AuditDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n const params: AuditDocumentsParams = { files, type: \"audit\" };\r\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\r\n }\r\n\r\n /**\r\n * Perform a quick check on documents without full remediation\r\n * @param files - Array of document IDs to check\r\n * @returns Result of the operation (202 Accepted - processing is async)\r\n */\r\n async check(files: string[]): Promise<AuditDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n const params: AuditDocumentsParams = { files, type: \"check\" };\r\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\r\n }\r\n\r\n /**\r\n * Start an audit with custom type\r\n * @param files - Array of document IDs to process\r\n * @param type - Type of audit: \"audit\" for full audit, \"check\" for quick check\r\n * @returns Result of the operation (202 Accepted - processing is async)\r\n */\r\n async process(files: string[], type: AuditType): Promise<AuditDocumentsResponse> {\r\n if (!files || files.length === 0) {\r\n throw new Error(\"files array cannot be empty\");\r\n }\r\n if (!type || type.trim().length === 0) {\r\n throw new Error(\"type cannot be empty\");\r\n }\r\n const params: AuditDocumentsParams = { files, type };\r\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport { ReportResponse, ReportType, GetReportParams } from \"../types\";\r\n\r\nconst REPORTS_BASE_URL = \"https://login.equalweb.com/reports/pdf\";\r\n\r\nexport class ReportsApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Get the JSON report for a document\r\n * @param reportID - The report ID\r\n * @param type - Which report to retrieve: \"audited\", \"original\", or \"both\"\r\n * @returns The report data\r\n */\r\n async get(reportID: string, type: ReportType = \"audited\"): Promise<ReportResponse> {\r\n const params: GetReportParams = { type };\r\n return this.client.get<ReportResponse>(`docs/report/${reportID}`, {\r\n type: params.type,\r\n });\r\n }\r\n\r\n /**\r\n * Get the audited report for a document\r\n * @param reportID - The report ID\r\n * @returns The audited report data\r\n */\r\n async getAudited(reportID: string): Promise<ReportResponse> {\r\n return this.get(reportID, \"audited\");\r\n }\r\n\r\n /**\r\n * Get the original report for a document\r\n * @param reportID - The report ID\r\n * @returns The original report data\r\n */\r\n async getOriginal(reportID: string): Promise<ReportResponse> {\r\n return this.get(reportID, \"original\");\r\n }\r\n\r\n /**\r\n * Get both audited and original reports for a document\r\n * @param reportID - The report ID\r\n * @returns Both report data\r\n */\r\n async getBoth(reportID: string): Promise<ReportResponse> {\r\n return this.get(reportID, \"both\");\r\n }\r\n\r\n /**\r\n * Get the URL to view the report in a browser\r\n * Note: This URL does not require authentication\r\n * @param reportID - The report ID\r\n * @returns The browser-viewable URL\r\n */\r\n getBrowserUrl(reportID: string): string {\r\n return `${REPORTS_BASE_URL}/${reportID}`;\r\n }\r\n}\r\n","import { HttpClient } from \"../client\";\r\nimport { DownloadFileParams, DownloadZippedParams, DownloadFileType } from \"../types\";\r\n\r\nexport class DownloadsApi {\r\n constructor(private readonly client: HttpClient) {}\r\n\r\n /**\r\n * Download a single document file\r\n * @param reportID - The report ID of the document\r\n * @param options - Download options (original file, file type)\r\n * @returns The file as a Blob\r\n */\r\n async file(reportID: string, options?: DownloadFileParams): Promise<Blob> {\r\n return this.client.getBlob(`docs/download/file/${reportID}`, {\r\n original: options?.original,\r\n type: options?.type,\r\n });\r\n }\r\n\r\n /**\r\n * Download the audited/processed version of a document\r\n * @param reportID - The report ID of the document\r\n * @param type - File type to download (pdf or xlsx)\r\n * @returns The processed file as a Blob\r\n */\r\n async audited(reportID: string, type: DownloadFileType = \"pdf\"): Promise<Blob> {\r\n return this.file(reportID, { original: false, type });\r\n }\r\n\r\n /**\r\n * Download the original version of a document\r\n * @param reportID - The report ID of the document\r\n * @param type - File type to download (pdf or xlsx)\r\n * @returns The original file as a Blob\r\n */\r\n async original(reportID: string, type: DownloadFileType = \"pdf\"): Promise<Blob> {\r\n return this.file(reportID, { original: true, type });\r\n }\r\n\r\n /**\r\n * Download multiple documents as a ZIP file\r\n * @param files - Array of document IDs to include in the ZIP\r\n * @returns The ZIP file as a Blob\r\n */\r\n async zipped(files: string[]): Promise<Blob> {\r\n const params: DownloadZippedParams = { files };\r\n return this.client.postBlob(\"docs/download/zipped\", params);\r\n }\r\n}\r\n","import { HttpClient } from \"./client\";\r\nimport { InfoApi, DocumentsApi, GroupsApi, AuditApi, ReportsApi, DownloadsApi } from \"./api\";\r\nimport { EqualWebConfig } from \"./types\";\r\n\r\nexport class EqualWeb {\r\n private readonly client: HttpClient;\r\n\r\n public readonly info: InfoApi;\r\n public readonly documents: DocumentsApi;\r\n public readonly groups: GroupsApi;\r\n public readonly audit: AuditApi;\r\n public readonly reports: ReportsApi;\r\n public readonly downloads: DownloadsApi;\r\n\r\n /**\r\n * Create a new EqualWeb API client\r\n * @param config - Configuration object with API key and optional settings\r\n * @example\r\n * ```typescript\r\n * const client = new EqualWeb({ apiKey: 'your-api-key' });\r\n *\r\n * // Get credit balance\r\n * const balance = await client.info.getBalance();\r\n *\r\n * // Upload a document\r\n * const file = new File([...], 'document.pdf');\r\n * const upload = await client.documents.upload(file);\r\n *\r\n * // Start an audit\r\n * await client.audit.audit([upload.id]);\r\n *\r\n * // Check status\r\n * const status = await client.documents.getStatus(upload.id);\r\n *\r\n * // Download the audited file\r\n * const blob = await client.downloads.audited(upload.id);\r\n * ```\r\n */\r\n constructor(config: EqualWebConfig) {\r\n this.client = new HttpClient(config);\r\n\r\n this.info = new InfoApi(this.client);\r\n this.documents = new DocumentsApi(this.client);\r\n this.groups = new GroupsApi(this.client);\r\n this.audit = new AuditApi(this.client);\r\n this.reports = new ReportsApi(this.client);\r\n this.downloads = new DownloadsApi(this.client);\r\n }\r\n}\r\n"],"mappings":";AAqMO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EACvB;AAAA,EACA;AAAA,EAEhB,YAAY,SAAiB,YAAoB,UAAkC;AACjF,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AACF;AAEO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChC;AAAA,EAEhB,YAAY,SAAiB,YAAqB;AA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AK,SAAS,IAAI,WAAW,MAAM;AAEnC,SAAK,OAAO,IAAI,QAAQ,KAAK,MAAM;AACnC,SAAK,YAAY,IAAI,aAAa,KAAK,MAAM;AAC7C,SAAK,SAAS,IAAI,UAAU,KAAK,MAAM;AACvC,SAAK,QAAQ,IAAI,SAAS,KAAK,MAAM;AACrC,SAAK,UAAU,IAAI,WAAW,KAAK,MAAM;AACzC,SAAK,YAAY,IAAI,aAAa,KAAK,MAAM;AAAA,EAC/C;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "equalweb-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Official SDK for the EqualWeb V2 API - Accessibility as a Service platform.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"equalweb",
|
|
26
|
+
"accessibility",
|
|
27
|
+
"a11y",
|
|
28
|
+
"pdf",
|
|
29
|
+
"wcag",
|
|
30
|
+
"ada",
|
|
31
|
+
"remediation",
|
|
32
|
+
"audit"
|
|
33
|
+
],
|
|
34
|
+
"author": "EqualWeb Team <support@equalweb.com>",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://bitbucket.org/equalweb2022/equalweb-sdk.git"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://bitbucket.org/equalweb2022/equalweb-sdk/issues"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://bitbucket.org/equalweb2022/equalweb-sdk#readme",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^25.0.3",
|
|
46
|
+
"tsup": "^8.0.0",
|
|
47
|
+
"typescript": "^5.3.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
}
|
|
52
|
+
}
|