equalweb-sdk 1.0.2 → 1.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/README.md +41 -2
- package/dist/index.d.mts +132 -11
- package/dist/index.d.ts +132 -11
- package/dist/index.js +110 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -22,14 +22,17 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AuditApi: () => AuditApi,
|
|
24
24
|
AuthenticationError: () => AuthenticationError,
|
|
25
|
+
ConvertApi: () => ConvertApi,
|
|
25
26
|
DocumentsApi: () => DocumentsApi,
|
|
26
27
|
DownloadsApi: () => DownloadsApi,
|
|
27
28
|
EqualWeb: () => EqualWeb,
|
|
28
29
|
EqualWebError: () => EqualWebError,
|
|
29
30
|
GroupsApi: () => GroupsApi,
|
|
30
31
|
InfoApi: () => InfoApi,
|
|
32
|
+
ManualApi: () => ManualApi,
|
|
31
33
|
RateLimitError: () => RateLimitError,
|
|
32
|
-
ReportsApi: () => ReportsApi
|
|
34
|
+
ReportsApi: () => ReportsApi,
|
|
35
|
+
SettingsApi: () => SettingsApi
|
|
33
36
|
});
|
|
34
37
|
module.exports = __toCommonJS(index_exports);
|
|
35
38
|
|
|
@@ -204,21 +207,20 @@ var DocumentsApi = class {
|
|
|
204
207
|
constructor(client) {
|
|
205
208
|
this.client = client;
|
|
206
209
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Get all documents
|
|
209
|
-
* @param params - Optional filters for groupID, archived status, and document type
|
|
210
|
-
* @returns Array of documents
|
|
211
|
-
*/
|
|
212
210
|
async getAll(params) {
|
|
211
|
+
const paged = params;
|
|
213
212
|
return this.client.get("docs", {
|
|
214
213
|
groupID: params?.groupID,
|
|
215
214
|
archived: params?.archived,
|
|
216
|
-
type: params?.type
|
|
215
|
+
type: params?.type,
|
|
216
|
+
page: paged?.page !== void 0 ? String(paged.page) : void 0,
|
|
217
|
+
pageSize: paged?.pageSize !== void 0 ? String(paged.pageSize) : void 0
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
/**
|
|
220
221
|
* Get the status of a specific document
|
|
221
|
-
* @param reportID - The report ID of the document
|
|
222
|
+
* @param reportID - The report ID of the document, or the externalID your
|
|
223
|
+
* system linked at upload time
|
|
222
224
|
* @returns The document status
|
|
223
225
|
*/
|
|
224
226
|
async getStatus(reportID) {
|
|
@@ -233,9 +235,12 @@ var DocumentsApi = class {
|
|
|
233
235
|
* Supported formats: PDF, XLSX, DOCX, PPTX
|
|
234
236
|
* @param file - The file to upload (File, Blob, ArrayBuffer, or Uint8Array)
|
|
235
237
|
* @param filename - Optional filename (required if file is an ArrayBuffer or Uint8Array)
|
|
238
|
+
* @param options - Optional externalID (links the doc to your own system;
|
|
239
|
+
* rejected with 409 if already in use) and metadata (JSON object stored on
|
|
240
|
+
* the document, max 8KB)
|
|
236
241
|
* @returns Upload response with document ID and metadata
|
|
237
242
|
*/
|
|
238
|
-
async upload(file, filename) {
|
|
243
|
+
async upload(file, filename, options) {
|
|
239
244
|
if (!file) {
|
|
240
245
|
throw new Error("file cannot be null or undefined");
|
|
241
246
|
}
|
|
@@ -260,6 +265,12 @@ var DocumentsApi = class {
|
|
|
260
265
|
} else {
|
|
261
266
|
formData.append("file", file);
|
|
262
267
|
}
|
|
268
|
+
if (options?.metadata) {
|
|
269
|
+
formData.append("metadata", JSON.stringify(options.metadata));
|
|
270
|
+
}
|
|
271
|
+
if (options?.externalID) {
|
|
272
|
+
formData.append("externalID", options.externalID);
|
|
273
|
+
}
|
|
263
274
|
return this.client.put("docs/upload", formData, true);
|
|
264
275
|
}
|
|
265
276
|
/**
|
|
@@ -371,43 +382,56 @@ var AuditApi = class {
|
|
|
371
382
|
* Start a full audit on documents
|
|
372
383
|
* This performs accessibility remediation and generates detailed reports
|
|
373
384
|
* @param files - Array of document IDs to audit
|
|
385
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
374
386
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
375
387
|
*/
|
|
376
|
-
async audit(files) {
|
|
388
|
+
async audit(files, options) {
|
|
377
389
|
if (!files || files.length === 0) {
|
|
378
390
|
throw new Error("files array cannot be empty");
|
|
379
391
|
}
|
|
380
|
-
|
|
392
|
+
this.validateOptions(options);
|
|
393
|
+
const params = { files, type: "audit", ...options };
|
|
381
394
|
return this.client.post("docs/audit", params);
|
|
382
395
|
}
|
|
383
396
|
/**
|
|
384
397
|
* Perform a quick check on documents without full remediation
|
|
385
398
|
* @param files - Array of document IDs to check
|
|
399
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit, deleteFileAfterCheck)
|
|
386
400
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
387
401
|
*/
|
|
388
|
-
async check(files) {
|
|
402
|
+
async check(files, options) {
|
|
389
403
|
if (!files || files.length === 0) {
|
|
390
404
|
throw new Error("files array cannot be empty");
|
|
391
405
|
}
|
|
392
|
-
|
|
406
|
+
this.validateOptions(options);
|
|
407
|
+
const params = { files, type: "check", ...options };
|
|
393
408
|
return this.client.post("docs/audit", params);
|
|
394
409
|
}
|
|
395
410
|
/**
|
|
396
411
|
* Start an audit with custom type
|
|
397
412
|
* @param files - Array of document IDs to process
|
|
398
|
-
* @param type - Type of audit: "audit"
|
|
413
|
+
* @param type - Type of audit: "audit", "tag", "ocr", "check", "manual", or "sign"
|
|
414
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
399
415
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
400
416
|
*/
|
|
401
|
-
async process(files, type) {
|
|
417
|
+
async process(files, type, options) {
|
|
402
418
|
if (!files || files.length === 0) {
|
|
403
419
|
throw new Error("files array cannot be empty");
|
|
404
420
|
}
|
|
405
421
|
if (!type || type.trim().length === 0) {
|
|
406
422
|
throw new Error("type cannot be empty");
|
|
407
423
|
}
|
|
408
|
-
|
|
424
|
+
this.validateOptions(options);
|
|
425
|
+
const params = { files, type, ...options };
|
|
409
426
|
return this.client.post("docs/audit", params);
|
|
410
427
|
}
|
|
428
|
+
validateOptions(options) {
|
|
429
|
+
if (options?.autoRemove !== void 0) {
|
|
430
|
+
if (!Number.isInteger(options.autoRemove) || options.autoRemove < 1 || options.autoRemove > 365) {
|
|
431
|
+
throw new Error("autoRemove must be an integer between 1 and 365");
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
411
435
|
};
|
|
412
436
|
|
|
413
437
|
// src/api/reports.ts
|
|
@@ -509,6 +533,66 @@ var DownloadsApi = class {
|
|
|
509
533
|
}
|
|
510
534
|
};
|
|
511
535
|
|
|
536
|
+
// src/api/convert.ts
|
|
537
|
+
var ConvertApi = class {
|
|
538
|
+
constructor(client) {
|
|
539
|
+
this.client = client;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Convert PDF documents to HTML
|
|
543
|
+
* @param files - Array of document IDs to convert
|
|
544
|
+
* @param options - Optional conversion settings
|
|
545
|
+
* @param sitekey - Optional site key for site-specific conversion
|
|
546
|
+
* @returns Result of the operation
|
|
547
|
+
*/
|
|
548
|
+
async html(files, options, sitekey) {
|
|
549
|
+
if (!files || files.length === 0) {
|
|
550
|
+
throw new Error("files array cannot be empty");
|
|
551
|
+
}
|
|
552
|
+
const path = sitekey ? `docs/convert/html/${sitekey}` : "docs/convert/html";
|
|
553
|
+
const body = { files, ...options };
|
|
554
|
+
return this.client.post(path, body);
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
// src/api/manual.ts
|
|
559
|
+
var ManualApi = class {
|
|
560
|
+
constructor(client) {
|
|
561
|
+
this.client = client;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Cancel manual remediation for documents
|
|
565
|
+
* @param files - Array of document IDs to cancel manual remediation for
|
|
566
|
+
* @returns Result of the operation
|
|
567
|
+
*/
|
|
568
|
+
async cancel(files) {
|
|
569
|
+
if (!files || files.length === 0) {
|
|
570
|
+
throw new Error("files array cannot be empty");
|
|
571
|
+
}
|
|
572
|
+
const params = { files };
|
|
573
|
+
return this.client.post("docs/manual/cancel", params);
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// src/api/settings.ts
|
|
578
|
+
var SettingsApi = class {
|
|
579
|
+
constructor(client) {
|
|
580
|
+
this.client = client;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Update PDF settings for a site
|
|
584
|
+
* @param siteKey - The site key to update settings for
|
|
585
|
+
* @param params - Settings to update
|
|
586
|
+
* @returns Result of the operation
|
|
587
|
+
*/
|
|
588
|
+
async update(siteKey, params) {
|
|
589
|
+
if (!siteKey || siteKey.trim().length === 0) {
|
|
590
|
+
throw new Error("siteKey is required and cannot be empty");
|
|
591
|
+
}
|
|
592
|
+
return this.client.post(`docs/settings/${siteKey}`, params);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
|
|
512
596
|
// src/equalweb.ts
|
|
513
597
|
var EqualWeb = class {
|
|
514
598
|
client;
|
|
@@ -518,6 +602,9 @@ var EqualWeb = class {
|
|
|
518
602
|
audit;
|
|
519
603
|
reports;
|
|
520
604
|
downloads;
|
|
605
|
+
convert;
|
|
606
|
+
manual;
|
|
607
|
+
settings;
|
|
521
608
|
/**
|
|
522
609
|
* Create a new EqualWeb API client
|
|
523
610
|
* @param config - Configuration object with API key and optional settings
|
|
@@ -550,19 +637,25 @@ var EqualWeb = class {
|
|
|
550
637
|
this.audit = new AuditApi(this.client);
|
|
551
638
|
this.reports = new ReportsApi(this.client);
|
|
552
639
|
this.downloads = new DownloadsApi(this.client);
|
|
640
|
+
this.convert = new ConvertApi(this.client);
|
|
641
|
+
this.manual = new ManualApi(this.client);
|
|
642
|
+
this.settings = new SettingsApi(this.client);
|
|
553
643
|
}
|
|
554
644
|
};
|
|
555
645
|
// Annotate the CommonJS export names for ESM import in node:
|
|
556
646
|
0 && (module.exports = {
|
|
557
647
|
AuditApi,
|
|
558
648
|
AuthenticationError,
|
|
649
|
+
ConvertApi,
|
|
559
650
|
DocumentsApi,
|
|
560
651
|
DownloadsApi,
|
|
561
652
|
EqualWeb,
|
|
562
653
|
EqualWebError,
|
|
563
654
|
GroupsApi,
|
|
564
655
|
InfoApi,
|
|
656
|
+
ManualApi,
|
|
565
657
|
RateLimitError,
|
|
566
|
-
ReportsApi
|
|
658
|
+
ReportsApi,
|
|
659
|
+
SettingsApi
|
|
567
660
|
});
|
|
568
661
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../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":["// Main client\r\nexport { EqualWeb } from \"./equalweb\";\r\n\r\n// Types\r\nexport type {\r\n // Config\r\n EqualWebConfig,\r\n\r\n // Common\r\n DocumentStatus,\r\n AuditType,\r\n ReportType,\r\n DownloadFileType,\r\n\r\n // Info\r\n BalanceResponse,\r\n\r\n // Documents\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\r\n // Groups\r\n DocumentGroup,\r\n GroupDocumentsParams,\r\n GroupDocumentsResponse,\r\n RenameGroupParams,\r\n RenameGroupResponse,\r\n\r\n // Audit\r\n AuditDocumentsParams,\r\n AuditDocumentsResponse,\r\n\r\n // Reports\r\n ReportRule,\r\n ReportSummary,\r\n DetailedReport,\r\n ReportCustomData,\r\n AuditedReport,\r\n OriginalReport,\r\n GetReportParams,\r\n ReportResponse,\r\n\r\n // Downloads\r\n DownloadFileParams,\r\n DownloadZippedParams,\r\n\r\n // Errors\r\n EqualWebErrorResponse,\r\n} from \"./types\";\r\n\r\n// Error classes\r\nexport { EqualWebError, RateLimitError, AuthenticationError } from \"./types\";\r\n\r\n// API classes (for advanced usage)\r\nexport { InfoApi } from \"./api/info\";\r\nexport { DocumentsApi } from \"./api/documents\";\r\nexport { GroupsApi } from \"./api/groups\";\r\nexport { AuditApi } from \"./api/audit\";\r\nexport { ReportsApi } from \"./api/reports\";\r\nexport { DownloadsApi } from \"./api/downloads\";\r\n","// ============================================================================\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqMO,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;AAChD,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AACF;AAEO,IAAM,sBAAN,cAAkC,cAAc;AAAA,EACrD,YAAY,UAAkB,8BAA8B;AAC1D,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AAAA,EACd;AACF;;;ACxNA,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AAWjB,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,QAAwB;AAClC,QAAI,CAAC,OAAO,UAAU,OAAO,OAAO,KAAK,EAAE,WAAW,GAAG;AACvD,YAAM,IAAI,MAAM,yCAAyC;AAAA,IAC3D;AAEA,QAAI,OAAO,YAAY,UAAa,OAAO,UAAU,GAAG;AACtD,YAAM,IAAI,MAAM,mCAAmC;AAAA,IACrD;AAEA,QAAI,OAAO,SAAS;AAClB,UAAI;AACF,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KAAK,KAAK,UAAU,EAAE,UAAU,OAAO,KAAK,CAAC;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,SAAS,UAAkB,OAAyB,OAAsB;AAC9E,WAAO,KAAK,KAAK,UAAU,EAAE,UAAU,MAAM,KAAK,CAAC;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,OAAgC;AAC3C,UAAM,SAA+B,EAAE,MAAM;AAC7C,WAAO,KAAK,OAAO,SAAS,wBAAwB,MAAM;AAAA,EAC5D;AACF;;;AC5CO,IAAM,WAAN,MAAe;AAAA,EACH;AAAA,EAED;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BhB,YAAY,QAAwB;AAClC,SAAK,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":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../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/api/convert.ts","../src/api/manual.ts","../src/api/settings.ts","../src/equalweb.ts"],"sourcesContent":["// Main client\nexport { EqualWeb } from \"./equalweb\";\n\n// Types\nexport type {\n // Config\n EqualWebConfig,\n\n // Common\n DocumentStatus,\n AuditType,\n ReportType,\n DownloadFileType,\n\n // Info\n BalanceResponse,\n\n // Documents\n Document,\n GetDocumentsParams,\n DocumentStatusResponse,\n UploadResponse,\n DeleteDocumentsParams,\n DeleteDocumentsResponse,\n ArchiveDocumentsParams,\n ArchiveDocumentsResponse,\n\n // Groups\n DocumentGroup,\n GroupDocumentsParams,\n GroupDocumentsResponse,\n RenameGroupParams,\n RenameGroupResponse,\n\n // Audit\n AuditDocumentsOptions,\n AuditDocumentsParams,\n AuditDocumentsResponse,\n\n // Reports\n ReportRule,\n ReportSummary,\n DetailedReport,\n ReportCustomData,\n AuditedReport,\n OriginalReport,\n GetReportParams,\n ReportResponse,\n\n // Downloads\n DownloadFileParams,\n DownloadZippedParams,\n\n // Convert HTML\n ConvertHtmlParams,\n ConvertHtmlResponse,\n\n // Manual Remediation\n CancelManualParams,\n CancelManualResponse,\n\n // PDF Settings\n PdfSettingsParams,\n PdfSettingsResponse,\n\n // Errors\n EqualWebErrorResponse,\n} from \"./types\";\n\n// Error classes\nexport { EqualWebError, RateLimitError, AuthenticationError } from \"./types\";\n\n// API classes (for advanced usage)\nexport { InfoApi } from \"./api/info\";\nexport { DocumentsApi } from \"./api/documents\";\nexport { GroupsApi } from \"./api/groups\";\nexport { AuditApi } from \"./api/audit\";\nexport { ReportsApi } from \"./api/reports\";\nexport { DownloadsApi } from \"./api/downloads\";\nexport { ConvertApi } from \"./api/convert\";\nexport { ManualApi } from \"./api/manual\";\nexport { SettingsApi } from \"./api/settings\";\n","// ============================================================================\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\" | \"tag\" | \"ocr\" | \"check\" | \"manual\" | \"sign\";\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 /** Client-system id linked at upload time, null when not set */\r\n externalID: string | null;\r\n /** Accessibility score of the uploaded document, null until checked */\r\n originalScore: number | null;\r\n /** Accessibility score of the remediated document, null until audited */\r\n auditedScore: number | null;\r\n /** Client metadata attached at upload time, null when not set */\r\n metadata: Record<string, unknown> | null;\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\n/** Opt-in pagination: passing page switches the response to an envelope */\r\nexport interface GetDocumentsPagedParams extends GetDocumentsParams {\r\n page: number;\r\n /** 1-200, defaults to 50 */\r\n pageSize?: number;\r\n}\r\n\r\nexport interface PagedDocumentsResponse {\r\n results: Document[];\r\n total: number;\r\n page: number;\r\n pageSize: number;\r\n totalPages: number;\r\n}\r\n\r\nexport interface DocumentStatusResponse {\r\n status: DocumentStatus;\r\n id?: string;\r\n externalID?: string | null;\r\n originalScore?: number | null;\r\n auditedScore?: number | null;\r\n metadata?: Record<string, unknown> | null;\r\n}\r\n\r\nexport interface UploadOptions {\r\n /**\r\n * Your system's id for this document (1-100 chars: letters, digits,\r\n * - _ . :). Afterwards every endpoint that takes a reportID also accepts\r\n * this externalID. A taken externalID rejects the upload with 409.\r\n */\r\n externalID?: string;\r\n /** Metadata to store on the document (JSON object, max 8KB) */\r\n metadata?: Record<string, unknown>;\r\n}\r\n\r\nexport interface UploadResponse {\r\n id: string;\r\n createdAt: string;\r\n numberOfPages: number;\r\n externalID?: string;\r\n metadata?: Record<string, unknown>;\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 AuditDocumentsOptions {\r\n engine?: string;\r\n addSignature?: boolean;\r\n fixContrast?: boolean;\r\n autoRemove?: number;\r\n deleteAfterAudit?: boolean;\r\n /**\r\n * For `check` runs only: delete the stored file once the check finishes.\r\n * The report and score are kept. Per-request only — there is no saved default.\r\n */\r\n deleteFileAfterCheck?: boolean;\r\n}\r\n\r\nexport interface AuditDocumentsParams extends AuditDocumentsOptions {\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// Convert HTML Types\r\n// ============================================================================\r\n\r\nexport interface ConvertHtmlParams {\r\n files: string[];\r\n autoConvert?: boolean;\r\n auditHtml?: boolean;\r\n}\r\n\r\nexport interface ConvertHtmlResponse {\r\n results: \"ok\";\r\n}\r\n\r\n// ============================================================================\r\n// Manual Remediation Types\r\n// ============================================================================\r\n\r\nexport interface CancelManualParams {\r\n files: string[];\r\n}\r\n\r\nexport interface CancelManualResponse {\r\n data: \"ok\";\r\n}\r\n\r\n// ============================================================================\r\n// PDF Settings Types\r\n// ============================================================================\r\n\r\nexport interface PdfSettingsParams {\r\n autoConvert: boolean;\r\n}\r\n\r\nexport interface PdfSettingsResponse {\r\n results: \"ok\";\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 GetDocumentsPagedParams,\r\n PagedDocumentsResponse,\r\n DocumentStatusResponse,\r\n UploadOptions,\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\r\n * document type. Passing `page` (and optionally `pageSize`) opts in to\r\n * pagination and switches the return value to a paged envelope; without it\r\n * the full array is returned as before.\r\n * @returns Array of documents, or a paged envelope when `page` is passed\r\n */\r\n async getAll(params?: GetDocumentsParams): Promise<Document[]>;\r\n async getAll(params: GetDocumentsPagedParams): Promise<PagedDocumentsResponse>;\r\n async getAll(\r\n params?: GetDocumentsParams | GetDocumentsPagedParams\r\n ): Promise<Document[] | PagedDocumentsResponse> {\r\n const paged = params as GetDocumentsPagedParams | undefined;\r\n return this.client.get<Document[] | PagedDocumentsResponse>(\"docs\", {\r\n groupID: params?.groupID,\r\n archived: params?.archived,\r\n type: params?.type,\r\n page: paged?.page !== undefined ? String(paged.page) : undefined,\r\n pageSize: paged?.pageSize !== undefined ? String(paged.pageSize) : undefined,\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, or the externalID your\r\n * system linked at upload time\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 * @param options - Optional externalID (links the doc to your own system;\r\n * rejected with 409 if already in use) and metadata (JSON object stored on\r\n * the document, max 8KB)\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 options?: UploadOptions\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 if (options?.metadata) {\r\n formData.append(\"metadata\", JSON.stringify(options.metadata));\r\n }\r\n\r\n // Per-document field — travels in the form data next to the file.\r\n if (options?.externalID) {\r\n formData.append(\"externalID\", options.externalID);\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\";\nimport { AuditDocumentsOptions, AuditDocumentsParams, AuditDocumentsResponse, AuditType } from \"../types\";\n\nexport class AuditApi {\n constructor(private readonly client: HttpClient) {}\n\n /**\n * Start a full audit on documents\n * This performs accessibility remediation and generates detailed reports\n * @param files - Array of document IDs to audit\n * @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)\n * @returns Result of the operation (202 Accepted - processing is async)\n */\n async audit(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse> {\n if (!files || files.length === 0) {\n throw new Error(\"files array cannot be empty\");\n }\n this.validateOptions(options);\n const params: AuditDocumentsParams = { files, type: \"audit\", ...options };\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\n }\n\n /**\n * Perform a quick check on documents without full remediation\n * @param files - Array of document IDs to check\n * @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit, deleteFileAfterCheck)\n * @returns Result of the operation (202 Accepted - processing is async)\n */\n async check(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse> {\n if (!files || files.length === 0) {\n throw new Error(\"files array cannot be empty\");\n }\n this.validateOptions(options);\n const params: AuditDocumentsParams = { files, type: \"check\", ...options };\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\n }\n\n /**\n * Start an audit with custom type\n * @param files - Array of document IDs to process\n * @param type - Type of audit: \"audit\", \"tag\", \"ocr\", \"check\", \"manual\", or \"sign\"\n * @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)\n * @returns Result of the operation (202 Accepted - processing is async)\n */\n async process(files: string[], type: AuditType, options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse> {\n if (!files || files.length === 0) {\n throw new Error(\"files array cannot be empty\");\n }\n if (!type || type.trim().length === 0) {\n throw new Error(\"type cannot be empty\");\n }\n this.validateOptions(options);\n const params: AuditDocumentsParams = { files, type, ...options };\n return this.client.post<AuditDocumentsResponse>(\"docs/audit\", params);\n }\n\n private validateOptions(options?: AuditDocumentsOptions): void {\n if (options?.autoRemove !== undefined) {\n if (!Number.isInteger(options.autoRemove) || options.autoRemove < 1 || options.autoRemove > 365) {\n throw new Error(\"autoRemove must be an integer between 1 and 365\");\n }\n }\n }\n}\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\";\nimport { ConvertHtmlParams, ConvertHtmlResponse } from \"../types\";\n\nexport class ConvertApi {\n constructor(private readonly client: HttpClient) {}\n\n /**\n * Convert PDF documents to HTML\n * @param files - Array of document IDs to convert\n * @param options - Optional conversion settings\n * @param sitekey - Optional site key for site-specific conversion\n * @returns Result of the operation\n */\n async html(\n files: string[],\n options?: Omit<ConvertHtmlParams, \"files\">,\n sitekey?: string\n ): Promise<ConvertHtmlResponse> {\n if (!files || files.length === 0) {\n throw new Error(\"files array cannot be empty\");\n }\n const path = sitekey ? `docs/convert/html/${sitekey}` : \"docs/convert/html\";\n const body: ConvertHtmlParams = { files, ...options };\n return this.client.post<ConvertHtmlResponse>(path, body);\n }\n}\n","import { HttpClient } from \"../client\";\nimport { CancelManualParams, CancelManualResponse } from \"../types\";\n\nexport class ManualApi {\n constructor(private readonly client: HttpClient) {}\n\n /**\n * Cancel manual remediation for documents\n * @param files - Array of document IDs to cancel manual remediation for\n * @returns Result of the operation\n */\n async cancel(files: string[]): Promise<CancelManualResponse> {\n if (!files || files.length === 0) {\n throw new Error(\"files array cannot be empty\");\n }\n const params: CancelManualParams = { files };\n return this.client.post<CancelManualResponse>(\"docs/manual/cancel\", params);\n }\n}\n","import { HttpClient } from \"../client\";\nimport { PdfSettingsParams, PdfSettingsResponse } from \"../types\";\n\nexport class SettingsApi {\n constructor(private readonly client: HttpClient) {}\n\n /**\n * Update PDF settings for a site\n * @param siteKey - The site key to update settings for\n * @param params - Settings to update\n * @returns Result of the operation\n */\n async update(siteKey: string, params: PdfSettingsParams): Promise<PdfSettingsResponse> {\n if (!siteKey || siteKey.trim().length === 0) {\n throw new Error(\"siteKey is required and cannot be empty\");\n }\n return this.client.post<PdfSettingsResponse>(`docs/settings/${siteKey}`, params);\n }\n}\n","import { HttpClient } from \"./client\";\nimport { InfoApi, DocumentsApi, GroupsApi, AuditApi, ReportsApi, DownloadsApi, ConvertApi, ManualApi, SettingsApi } from \"./api\";\nimport { EqualWebConfig } from \"./types\";\n\nexport class EqualWeb {\n private readonly client: HttpClient;\n\n public readonly info: InfoApi;\n public readonly documents: DocumentsApi;\n public readonly groups: GroupsApi;\n public readonly audit: AuditApi;\n public readonly reports: ReportsApi;\n public readonly downloads: DownloadsApi;\n public readonly convert: ConvertApi;\n public readonly manual: ManualApi;\n public readonly settings: SettingsApi;\n\n /**\n * Create a new EqualWeb API client\n * @param config - Configuration object with API key and optional settings\n * @example\n * ```typescript\n * const client = new EqualWeb({ apiKey: 'your-api-key' });\n *\n * // Get credit balance\n * const balance = await client.info.getBalance();\n *\n * // Upload a document\n * const file = new File([...], 'document.pdf');\n * const upload = await client.documents.upload(file);\n *\n * // Start an audit\n * await client.audit.audit([upload.id]);\n *\n * // Check status\n * const status = await client.documents.getStatus(upload.id);\n *\n * // Download the audited file\n * const blob = await client.downloads.audited(upload.id);\n * ```\n */\n constructor(config: EqualWebConfig) {\n this.client = new HttpClient(config);\n\n this.info = new InfoApi(this.client);\n this.documents = new DocumentsApi(this.client);\n this.groups = new GroupsApi(this.client);\n this.audit = new AuditApi(this.client);\n this.reports = new ReportsApi(this.client);\n this.downloads = new DownloadsApi(this.client);\n this.convert = new ConvertApi(this.client);\n this.manual = new ManualApi(this.client);\n this.settings = new SettingsApi(this.client);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiSO,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;AAChD,UAAM,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