equalweb-sdk 1.0.2 → 1.1.1
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 +111 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -124,8 +124,20 @@ await client.audit.audit(["doc1", "doc2"]);
|
|
|
124
124
|
// Quick check (no remediation)
|
|
125
125
|
await client.audit.check(["doc1", "doc2"]);
|
|
126
126
|
|
|
127
|
-
//
|
|
128
|
-
await client.audit.
|
|
127
|
+
// Quick check, then delete the stored file (report and score are kept)
|
|
128
|
+
await client.audit.check(["doc1"], { deleteFileAfterCheck: true });
|
|
129
|
+
|
|
130
|
+
// Full audit with advanced options
|
|
131
|
+
await client.audit.audit(["doc1", "doc2"], {
|
|
132
|
+
addSignature: true,
|
|
133
|
+
fixContrast: true,
|
|
134
|
+
autoRemove: 30,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Custom audit type with options
|
|
138
|
+
await client.audit.process(["doc1"], "ocr", {
|
|
139
|
+
deleteAfterAudit: true,
|
|
140
|
+
});
|
|
129
141
|
```
|
|
130
142
|
|
|
131
143
|
### Reports
|
|
@@ -166,6 +178,33 @@ const xlsx = await client.downloads.audited("reportID", "xlsx");
|
|
|
166
178
|
const zip = await client.downloads.zipped(["id1", "id2", "id3"]);
|
|
167
179
|
```
|
|
168
180
|
|
|
181
|
+
### Convert
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
// Convert PDF to HTML
|
|
185
|
+
await client.convert.html(["doc1", "doc2"]);
|
|
186
|
+
|
|
187
|
+
// With options
|
|
188
|
+
await client.convert.html(["doc1"], { autoConvert: true, auditHtml: true });
|
|
189
|
+
|
|
190
|
+
// With site key
|
|
191
|
+
await client.convert.html(["doc1"], {}, "my-site-key");
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Manual Remediation
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
// Cancel manual remediation
|
|
198
|
+
await client.manual.cancel(["doc1", "doc2"]);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Settings
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
// Update PDF settings for a site
|
|
205
|
+
await client.settings.update("my-site-key", { autoConvert: true });
|
|
206
|
+
```
|
|
207
|
+
|
|
169
208
|
## Error Handling
|
|
170
209
|
|
|
171
210
|
```typescript
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ interface EqualWebConfig {
|
|
|
4
4
|
timeout?: number;
|
|
5
5
|
}
|
|
6
6
|
type DocumentStatus = "done" | "pending" | "processing" | string;
|
|
7
|
-
type AuditType = "audit" | "check";
|
|
7
|
+
type AuditType = "audit" | "tag" | "ocr" | "check" | "manual" | "sign";
|
|
8
8
|
type ReportType = "audited" | "original" | "both";
|
|
9
9
|
type DownloadFileType = "pdf" | "xlsx";
|
|
10
10
|
interface BalanceResponse {
|
|
@@ -16,6 +16,14 @@ interface Document {
|
|
|
16
16
|
group: number | null;
|
|
17
17
|
archived: boolean;
|
|
18
18
|
reportID: string;
|
|
19
|
+
/** Client-system id linked at upload time, null when not set */
|
|
20
|
+
externalID: string | null;
|
|
21
|
+
/** Accessibility score of the uploaded document, null until checked */
|
|
22
|
+
originalScore: number | null;
|
|
23
|
+
/** Accessibility score of the remediated document, null until audited */
|
|
24
|
+
auditedScore: number | null;
|
|
25
|
+
/** Client metadata attached at upload time, null when not set */
|
|
26
|
+
metadata: Record<string, unknown> | null;
|
|
19
27
|
status: DocumentStatus;
|
|
20
28
|
}
|
|
21
29
|
interface GetDocumentsParams {
|
|
@@ -23,13 +31,43 @@ interface GetDocumentsParams {
|
|
|
23
31
|
archived?: boolean;
|
|
24
32
|
type?: string;
|
|
25
33
|
}
|
|
34
|
+
/** Opt-in pagination: passing page switches the response to an envelope */
|
|
35
|
+
interface GetDocumentsPagedParams extends GetDocumentsParams {
|
|
36
|
+
page: number;
|
|
37
|
+
/** 1-200, defaults to 50 */
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
}
|
|
40
|
+
interface PagedDocumentsResponse {
|
|
41
|
+
results: Document[];
|
|
42
|
+
total: number;
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
totalPages: number;
|
|
46
|
+
}
|
|
26
47
|
interface DocumentStatusResponse {
|
|
27
48
|
status: DocumentStatus;
|
|
49
|
+
id?: string;
|
|
50
|
+
externalID?: string | null;
|
|
51
|
+
originalScore?: number | null;
|
|
52
|
+
auditedScore?: number | null;
|
|
53
|
+
metadata?: Record<string, unknown> | null;
|
|
54
|
+
}
|
|
55
|
+
interface UploadOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Your system's id for this document (1-100 chars: letters, digits,
|
|
58
|
+
* - _ . :). Afterwards every endpoint that takes a reportID also accepts
|
|
59
|
+
* this externalID. A taken externalID rejects the upload with 409.
|
|
60
|
+
*/
|
|
61
|
+
externalID?: string;
|
|
62
|
+
/** Metadata to store on the document (JSON object, max 8KB) */
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
28
64
|
}
|
|
29
65
|
interface UploadResponse {
|
|
30
66
|
id: string;
|
|
31
67
|
createdAt: string;
|
|
32
68
|
numberOfPages: number;
|
|
69
|
+
externalID?: string;
|
|
70
|
+
metadata?: Record<string, unknown>;
|
|
33
71
|
}
|
|
34
72
|
interface DeleteDocumentsParams {
|
|
35
73
|
files: string[];
|
|
@@ -66,7 +104,19 @@ interface RenameGroupParams {
|
|
|
66
104
|
interface RenameGroupResponse {
|
|
67
105
|
results: "ok";
|
|
68
106
|
}
|
|
69
|
-
interface
|
|
107
|
+
interface AuditDocumentsOptions {
|
|
108
|
+
engine?: string;
|
|
109
|
+
addSignature?: boolean;
|
|
110
|
+
fixContrast?: boolean;
|
|
111
|
+
autoRemove?: number;
|
|
112
|
+
deleteAfterAudit?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* For `check` runs only: delete the stored file once the check finishes.
|
|
115
|
+
* The report and score are kept. Per-request only — there is no saved default.
|
|
116
|
+
*/
|
|
117
|
+
deleteFileAfterCheck?: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface AuditDocumentsParams extends AuditDocumentsOptions {
|
|
70
120
|
files: string[];
|
|
71
121
|
type?: AuditType;
|
|
72
122
|
}
|
|
@@ -124,6 +174,26 @@ interface DownloadFileParams {
|
|
|
124
174
|
interface DownloadZippedParams {
|
|
125
175
|
files: string[];
|
|
126
176
|
}
|
|
177
|
+
interface ConvertHtmlParams {
|
|
178
|
+
files: string[];
|
|
179
|
+
autoConvert?: boolean;
|
|
180
|
+
auditHtml?: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface ConvertHtmlResponse {
|
|
183
|
+
results: "ok";
|
|
184
|
+
}
|
|
185
|
+
interface CancelManualParams {
|
|
186
|
+
files: string[];
|
|
187
|
+
}
|
|
188
|
+
interface CancelManualResponse {
|
|
189
|
+
data: "ok";
|
|
190
|
+
}
|
|
191
|
+
interface PdfSettingsParams {
|
|
192
|
+
autoConvert: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface PdfSettingsResponse {
|
|
195
|
+
results: "ok";
|
|
196
|
+
}
|
|
127
197
|
interface EqualWebErrorResponse {
|
|
128
198
|
error?: string;
|
|
129
199
|
message?: string;
|
|
@@ -180,13 +250,18 @@ declare class DocumentsApi {
|
|
|
180
250
|
constructor(client: HttpClient);
|
|
181
251
|
/**
|
|
182
252
|
* Get all documents
|
|
183
|
-
* @param params - Optional filters for groupID, archived status, and
|
|
184
|
-
*
|
|
253
|
+
* @param params - Optional filters for groupID, archived status, and
|
|
254
|
+
* document type. Passing `page` (and optionally `pageSize`) opts in to
|
|
255
|
+
* pagination and switches the return value to a paged envelope; without it
|
|
256
|
+
* the full array is returned as before.
|
|
257
|
+
* @returns Array of documents, or a paged envelope when `page` is passed
|
|
185
258
|
*/
|
|
186
259
|
getAll(params?: GetDocumentsParams): Promise<Document[]>;
|
|
260
|
+
getAll(params: GetDocumentsPagedParams): Promise<PagedDocumentsResponse>;
|
|
187
261
|
/**
|
|
188
262
|
* Get the status of a specific document
|
|
189
|
-
* @param reportID - The report ID of the document
|
|
263
|
+
* @param reportID - The report ID of the document, or the externalID your
|
|
264
|
+
* system linked at upload time
|
|
190
265
|
* @returns The document status
|
|
191
266
|
*/
|
|
192
267
|
getStatus(reportID: string): Promise<string>;
|
|
@@ -195,9 +270,12 @@ declare class DocumentsApi {
|
|
|
195
270
|
* Supported formats: PDF, XLSX, DOCX, PPTX
|
|
196
271
|
* @param file - The file to upload (File, Blob, ArrayBuffer, or Uint8Array)
|
|
197
272
|
* @param filename - Optional filename (required if file is an ArrayBuffer or Uint8Array)
|
|
273
|
+
* @param options - Optional externalID (links the doc to your own system;
|
|
274
|
+
* rejected with 409 if already in use) and metadata (JSON object stored on
|
|
275
|
+
* the document, max 8KB)
|
|
198
276
|
* @returns Upload response with document ID and metadata
|
|
199
277
|
*/
|
|
200
|
-
upload(file: File | Blob | ArrayBuffer | Uint8Array, filename?: string): Promise<UploadResponse>;
|
|
278
|
+
upload(file: File | Blob | ArrayBuffer | Uint8Array, filename?: string, options?: UploadOptions): Promise<UploadResponse>;
|
|
201
279
|
/**
|
|
202
280
|
* Delete multiple documents
|
|
203
281
|
* @param files - Array of document IDs to delete
|
|
@@ -256,22 +334,26 @@ declare class AuditApi {
|
|
|
256
334
|
* Start a full audit on documents
|
|
257
335
|
* This performs accessibility remediation and generates detailed reports
|
|
258
336
|
* @param files - Array of document IDs to audit
|
|
337
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
259
338
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
260
339
|
*/
|
|
261
|
-
audit(files: string[]): Promise<AuditDocumentsResponse>;
|
|
340
|
+
audit(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
262
341
|
/**
|
|
263
342
|
* Perform a quick check on documents without full remediation
|
|
264
343
|
* @param files - Array of document IDs to check
|
|
344
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit, deleteFileAfterCheck)
|
|
265
345
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
266
346
|
*/
|
|
267
|
-
check(files: string[]): Promise<AuditDocumentsResponse>;
|
|
347
|
+
check(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
268
348
|
/**
|
|
269
349
|
* Start an audit with custom type
|
|
270
350
|
* @param files - Array of document IDs to process
|
|
271
|
-
* @param type - Type of audit: "audit"
|
|
351
|
+
* @param type - Type of audit: "audit", "tag", "ocr", "check", "manual", or "sign"
|
|
352
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
272
353
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
273
354
|
*/
|
|
274
|
-
process(files: string[], type: AuditType): Promise<AuditDocumentsResponse>;
|
|
355
|
+
process(files: string[], type: AuditType, options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
356
|
+
private validateOptions;
|
|
275
357
|
}
|
|
276
358
|
|
|
277
359
|
declare class ReportsApi {
|
|
@@ -343,6 +425,42 @@ declare class DownloadsApi {
|
|
|
343
425
|
zipped(files: string[]): Promise<Blob>;
|
|
344
426
|
}
|
|
345
427
|
|
|
428
|
+
declare class ConvertApi {
|
|
429
|
+
private readonly client;
|
|
430
|
+
constructor(client: HttpClient);
|
|
431
|
+
/**
|
|
432
|
+
* Convert PDF documents to HTML
|
|
433
|
+
* @param files - Array of document IDs to convert
|
|
434
|
+
* @param options - Optional conversion settings
|
|
435
|
+
* @param sitekey - Optional site key for site-specific conversion
|
|
436
|
+
* @returns Result of the operation
|
|
437
|
+
*/
|
|
438
|
+
html(files: string[], options?: Omit<ConvertHtmlParams, "files">, sitekey?: string): Promise<ConvertHtmlResponse>;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare class ManualApi {
|
|
442
|
+
private readonly client;
|
|
443
|
+
constructor(client: HttpClient);
|
|
444
|
+
/**
|
|
445
|
+
* Cancel manual remediation for documents
|
|
446
|
+
* @param files - Array of document IDs to cancel manual remediation for
|
|
447
|
+
* @returns Result of the operation
|
|
448
|
+
*/
|
|
449
|
+
cancel(files: string[]): Promise<CancelManualResponse>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare class SettingsApi {
|
|
453
|
+
private readonly client;
|
|
454
|
+
constructor(client: HttpClient);
|
|
455
|
+
/**
|
|
456
|
+
* Update PDF settings for a site
|
|
457
|
+
* @param siteKey - The site key to update settings for
|
|
458
|
+
* @param params - Settings to update
|
|
459
|
+
* @returns Result of the operation
|
|
460
|
+
*/
|
|
461
|
+
update(siteKey: string, params: PdfSettingsParams): Promise<PdfSettingsResponse>;
|
|
462
|
+
}
|
|
463
|
+
|
|
346
464
|
declare class EqualWeb {
|
|
347
465
|
private readonly client;
|
|
348
466
|
readonly info: InfoApi;
|
|
@@ -351,6 +469,9 @@ declare class EqualWeb {
|
|
|
351
469
|
readonly audit: AuditApi;
|
|
352
470
|
readonly reports: ReportsApi;
|
|
353
471
|
readonly downloads: DownloadsApi;
|
|
472
|
+
readonly convert: ConvertApi;
|
|
473
|
+
readonly manual: ManualApi;
|
|
474
|
+
readonly settings: SettingsApi;
|
|
354
475
|
/**
|
|
355
476
|
* Create a new EqualWeb API client
|
|
356
477
|
* @param config - Configuration object with API key and optional settings
|
|
@@ -378,4 +499,4 @@ declare class EqualWeb {
|
|
|
378
499
|
constructor(config: EqualWebConfig);
|
|
379
500
|
}
|
|
380
501
|
|
|
381
|
-
export { type ArchiveDocumentsParams, type ArchiveDocumentsResponse, AuditApi, type AuditDocumentsParams, type AuditDocumentsResponse, type AuditType, type AuditedReport, AuthenticationError, type BalanceResponse, type DeleteDocumentsParams, type DeleteDocumentsResponse, type DetailedReport, type Document, type DocumentGroup, type DocumentStatus, type DocumentStatusResponse, DocumentsApi, type DownloadFileParams, type DownloadFileType, type DownloadZippedParams, DownloadsApi, EqualWeb, type EqualWebConfig, EqualWebError, type EqualWebErrorResponse, type GetDocumentsParams, type GetReportParams, type GroupDocumentsParams, type GroupDocumentsResponse, GroupsApi, InfoApi, type OriginalReport, RateLimitError, type RenameGroupParams, type RenameGroupResponse, type ReportCustomData, type ReportResponse, type ReportRule, type ReportSummary, type ReportType, ReportsApi, type UploadResponse };
|
|
502
|
+
export { type ArchiveDocumentsParams, type ArchiveDocumentsResponse, AuditApi, type AuditDocumentsOptions, type AuditDocumentsParams, type AuditDocumentsResponse, type AuditType, type AuditedReport, AuthenticationError, type BalanceResponse, type CancelManualParams, type CancelManualResponse, ConvertApi, type ConvertHtmlParams, type ConvertHtmlResponse, type DeleteDocumentsParams, type DeleteDocumentsResponse, type DetailedReport, type Document, type DocumentGroup, type DocumentStatus, type DocumentStatusResponse, DocumentsApi, type DownloadFileParams, type DownloadFileType, type DownloadZippedParams, DownloadsApi, EqualWeb, type EqualWebConfig, EqualWebError, type EqualWebErrorResponse, type GetDocumentsParams, type GetReportParams, type GroupDocumentsParams, type GroupDocumentsResponse, GroupsApi, InfoApi, ManualApi, type OriginalReport, type PdfSettingsParams, type PdfSettingsResponse, RateLimitError, type RenameGroupParams, type RenameGroupResponse, type ReportCustomData, type ReportResponse, type ReportRule, type ReportSummary, type ReportType, ReportsApi, SettingsApi, type UploadResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface EqualWebConfig {
|
|
|
4
4
|
timeout?: number;
|
|
5
5
|
}
|
|
6
6
|
type DocumentStatus = "done" | "pending" | "processing" | string;
|
|
7
|
-
type AuditType = "audit" | "check";
|
|
7
|
+
type AuditType = "audit" | "tag" | "ocr" | "check" | "manual" | "sign";
|
|
8
8
|
type ReportType = "audited" | "original" | "both";
|
|
9
9
|
type DownloadFileType = "pdf" | "xlsx";
|
|
10
10
|
interface BalanceResponse {
|
|
@@ -16,6 +16,14 @@ interface Document {
|
|
|
16
16
|
group: number | null;
|
|
17
17
|
archived: boolean;
|
|
18
18
|
reportID: string;
|
|
19
|
+
/** Client-system id linked at upload time, null when not set */
|
|
20
|
+
externalID: string | null;
|
|
21
|
+
/** Accessibility score of the uploaded document, null until checked */
|
|
22
|
+
originalScore: number | null;
|
|
23
|
+
/** Accessibility score of the remediated document, null until audited */
|
|
24
|
+
auditedScore: number | null;
|
|
25
|
+
/** Client metadata attached at upload time, null when not set */
|
|
26
|
+
metadata: Record<string, unknown> | null;
|
|
19
27
|
status: DocumentStatus;
|
|
20
28
|
}
|
|
21
29
|
interface GetDocumentsParams {
|
|
@@ -23,13 +31,43 @@ interface GetDocumentsParams {
|
|
|
23
31
|
archived?: boolean;
|
|
24
32
|
type?: string;
|
|
25
33
|
}
|
|
34
|
+
/** Opt-in pagination: passing page switches the response to an envelope */
|
|
35
|
+
interface GetDocumentsPagedParams extends GetDocumentsParams {
|
|
36
|
+
page: number;
|
|
37
|
+
/** 1-200, defaults to 50 */
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
}
|
|
40
|
+
interface PagedDocumentsResponse {
|
|
41
|
+
results: Document[];
|
|
42
|
+
total: number;
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
totalPages: number;
|
|
46
|
+
}
|
|
26
47
|
interface DocumentStatusResponse {
|
|
27
48
|
status: DocumentStatus;
|
|
49
|
+
id?: string;
|
|
50
|
+
externalID?: string | null;
|
|
51
|
+
originalScore?: number | null;
|
|
52
|
+
auditedScore?: number | null;
|
|
53
|
+
metadata?: Record<string, unknown> | null;
|
|
54
|
+
}
|
|
55
|
+
interface UploadOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Your system's id for this document (1-100 chars: letters, digits,
|
|
58
|
+
* - _ . :). Afterwards every endpoint that takes a reportID also accepts
|
|
59
|
+
* this externalID. A taken externalID rejects the upload with 409.
|
|
60
|
+
*/
|
|
61
|
+
externalID?: string;
|
|
62
|
+
/** Metadata to store on the document (JSON object, max 8KB) */
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
28
64
|
}
|
|
29
65
|
interface UploadResponse {
|
|
30
66
|
id: string;
|
|
31
67
|
createdAt: string;
|
|
32
68
|
numberOfPages: number;
|
|
69
|
+
externalID?: string;
|
|
70
|
+
metadata?: Record<string, unknown>;
|
|
33
71
|
}
|
|
34
72
|
interface DeleteDocumentsParams {
|
|
35
73
|
files: string[];
|
|
@@ -66,7 +104,19 @@ interface RenameGroupParams {
|
|
|
66
104
|
interface RenameGroupResponse {
|
|
67
105
|
results: "ok";
|
|
68
106
|
}
|
|
69
|
-
interface
|
|
107
|
+
interface AuditDocumentsOptions {
|
|
108
|
+
engine?: string;
|
|
109
|
+
addSignature?: boolean;
|
|
110
|
+
fixContrast?: boolean;
|
|
111
|
+
autoRemove?: number;
|
|
112
|
+
deleteAfterAudit?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* For `check` runs only: delete the stored file once the check finishes.
|
|
115
|
+
* The report and score are kept. Per-request only — there is no saved default.
|
|
116
|
+
*/
|
|
117
|
+
deleteFileAfterCheck?: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface AuditDocumentsParams extends AuditDocumentsOptions {
|
|
70
120
|
files: string[];
|
|
71
121
|
type?: AuditType;
|
|
72
122
|
}
|
|
@@ -124,6 +174,26 @@ interface DownloadFileParams {
|
|
|
124
174
|
interface DownloadZippedParams {
|
|
125
175
|
files: string[];
|
|
126
176
|
}
|
|
177
|
+
interface ConvertHtmlParams {
|
|
178
|
+
files: string[];
|
|
179
|
+
autoConvert?: boolean;
|
|
180
|
+
auditHtml?: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface ConvertHtmlResponse {
|
|
183
|
+
results: "ok";
|
|
184
|
+
}
|
|
185
|
+
interface CancelManualParams {
|
|
186
|
+
files: string[];
|
|
187
|
+
}
|
|
188
|
+
interface CancelManualResponse {
|
|
189
|
+
data: "ok";
|
|
190
|
+
}
|
|
191
|
+
interface PdfSettingsParams {
|
|
192
|
+
autoConvert: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface PdfSettingsResponse {
|
|
195
|
+
results: "ok";
|
|
196
|
+
}
|
|
127
197
|
interface EqualWebErrorResponse {
|
|
128
198
|
error?: string;
|
|
129
199
|
message?: string;
|
|
@@ -180,13 +250,18 @@ declare class DocumentsApi {
|
|
|
180
250
|
constructor(client: HttpClient);
|
|
181
251
|
/**
|
|
182
252
|
* Get all documents
|
|
183
|
-
* @param params - Optional filters for groupID, archived status, and
|
|
184
|
-
*
|
|
253
|
+
* @param params - Optional filters for groupID, archived status, and
|
|
254
|
+
* document type. Passing `page` (and optionally `pageSize`) opts in to
|
|
255
|
+
* pagination and switches the return value to a paged envelope; without it
|
|
256
|
+
* the full array is returned as before.
|
|
257
|
+
* @returns Array of documents, or a paged envelope when `page` is passed
|
|
185
258
|
*/
|
|
186
259
|
getAll(params?: GetDocumentsParams): Promise<Document[]>;
|
|
260
|
+
getAll(params: GetDocumentsPagedParams): Promise<PagedDocumentsResponse>;
|
|
187
261
|
/**
|
|
188
262
|
* Get the status of a specific document
|
|
189
|
-
* @param reportID - The report ID of the document
|
|
263
|
+
* @param reportID - The report ID of the document, or the externalID your
|
|
264
|
+
* system linked at upload time
|
|
190
265
|
* @returns The document status
|
|
191
266
|
*/
|
|
192
267
|
getStatus(reportID: string): Promise<string>;
|
|
@@ -195,9 +270,12 @@ declare class DocumentsApi {
|
|
|
195
270
|
* Supported formats: PDF, XLSX, DOCX, PPTX
|
|
196
271
|
* @param file - The file to upload (File, Blob, ArrayBuffer, or Uint8Array)
|
|
197
272
|
* @param filename - Optional filename (required if file is an ArrayBuffer or Uint8Array)
|
|
273
|
+
* @param options - Optional externalID (links the doc to your own system;
|
|
274
|
+
* rejected with 409 if already in use) and metadata (JSON object stored on
|
|
275
|
+
* the document, max 8KB)
|
|
198
276
|
* @returns Upload response with document ID and metadata
|
|
199
277
|
*/
|
|
200
|
-
upload(file: File | Blob | ArrayBuffer | Uint8Array, filename?: string): Promise<UploadResponse>;
|
|
278
|
+
upload(file: File | Blob | ArrayBuffer | Uint8Array, filename?: string, options?: UploadOptions): Promise<UploadResponse>;
|
|
201
279
|
/**
|
|
202
280
|
* Delete multiple documents
|
|
203
281
|
* @param files - Array of document IDs to delete
|
|
@@ -256,22 +334,26 @@ declare class AuditApi {
|
|
|
256
334
|
* Start a full audit on documents
|
|
257
335
|
* This performs accessibility remediation and generates detailed reports
|
|
258
336
|
* @param files - Array of document IDs to audit
|
|
337
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
259
338
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
260
339
|
*/
|
|
261
|
-
audit(files: string[]): Promise<AuditDocumentsResponse>;
|
|
340
|
+
audit(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
262
341
|
/**
|
|
263
342
|
* Perform a quick check on documents without full remediation
|
|
264
343
|
* @param files - Array of document IDs to check
|
|
344
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit, deleteFileAfterCheck)
|
|
265
345
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
266
346
|
*/
|
|
267
|
-
check(files: string[]): Promise<AuditDocumentsResponse>;
|
|
347
|
+
check(files: string[], options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
268
348
|
/**
|
|
269
349
|
* Start an audit with custom type
|
|
270
350
|
* @param files - Array of document IDs to process
|
|
271
|
-
* @param type - Type of audit: "audit"
|
|
351
|
+
* @param type - Type of audit: "audit", "tag", "ocr", "check", "manual", or "sign"
|
|
352
|
+
* @param options - Optional audit settings (engine, addSignature, fixContrast, autoRemove, deleteAfterAudit)
|
|
272
353
|
* @returns Result of the operation (202 Accepted - processing is async)
|
|
273
354
|
*/
|
|
274
|
-
process(files: string[], type: AuditType): Promise<AuditDocumentsResponse>;
|
|
355
|
+
process(files: string[], type: AuditType, options?: AuditDocumentsOptions): Promise<AuditDocumentsResponse>;
|
|
356
|
+
private validateOptions;
|
|
275
357
|
}
|
|
276
358
|
|
|
277
359
|
declare class ReportsApi {
|
|
@@ -343,6 +425,42 @@ declare class DownloadsApi {
|
|
|
343
425
|
zipped(files: string[]): Promise<Blob>;
|
|
344
426
|
}
|
|
345
427
|
|
|
428
|
+
declare class ConvertApi {
|
|
429
|
+
private readonly client;
|
|
430
|
+
constructor(client: HttpClient);
|
|
431
|
+
/**
|
|
432
|
+
* Convert PDF documents to HTML
|
|
433
|
+
* @param files - Array of document IDs to convert
|
|
434
|
+
* @param options - Optional conversion settings
|
|
435
|
+
* @param sitekey - Optional site key for site-specific conversion
|
|
436
|
+
* @returns Result of the operation
|
|
437
|
+
*/
|
|
438
|
+
html(files: string[], options?: Omit<ConvertHtmlParams, "files">, sitekey?: string): Promise<ConvertHtmlResponse>;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare class ManualApi {
|
|
442
|
+
private readonly client;
|
|
443
|
+
constructor(client: HttpClient);
|
|
444
|
+
/**
|
|
445
|
+
* Cancel manual remediation for documents
|
|
446
|
+
* @param files - Array of document IDs to cancel manual remediation for
|
|
447
|
+
* @returns Result of the operation
|
|
448
|
+
*/
|
|
449
|
+
cancel(files: string[]): Promise<CancelManualResponse>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare class SettingsApi {
|
|
453
|
+
private readonly client;
|
|
454
|
+
constructor(client: HttpClient);
|
|
455
|
+
/**
|
|
456
|
+
* Update PDF settings for a site
|
|
457
|
+
* @param siteKey - The site key to update settings for
|
|
458
|
+
* @param params - Settings to update
|
|
459
|
+
* @returns Result of the operation
|
|
460
|
+
*/
|
|
461
|
+
update(siteKey: string, params: PdfSettingsParams): Promise<PdfSettingsResponse>;
|
|
462
|
+
}
|
|
463
|
+
|
|
346
464
|
declare class EqualWeb {
|
|
347
465
|
private readonly client;
|
|
348
466
|
readonly info: InfoApi;
|
|
@@ -351,6 +469,9 @@ declare class EqualWeb {
|
|
|
351
469
|
readonly audit: AuditApi;
|
|
352
470
|
readonly reports: ReportsApi;
|
|
353
471
|
readonly downloads: DownloadsApi;
|
|
472
|
+
readonly convert: ConvertApi;
|
|
473
|
+
readonly manual: ManualApi;
|
|
474
|
+
readonly settings: SettingsApi;
|
|
354
475
|
/**
|
|
355
476
|
* Create a new EqualWeb API client
|
|
356
477
|
* @param config - Configuration object with API key and optional settings
|
|
@@ -378,4 +499,4 @@ declare class EqualWeb {
|
|
|
378
499
|
constructor(config: EqualWebConfig);
|
|
379
500
|
}
|
|
380
501
|
|
|
381
|
-
export { type ArchiveDocumentsParams, type ArchiveDocumentsResponse, AuditApi, type AuditDocumentsParams, type AuditDocumentsResponse, type AuditType, type AuditedReport, AuthenticationError, type BalanceResponse, type DeleteDocumentsParams, type DeleteDocumentsResponse, type DetailedReport, type Document, type DocumentGroup, type DocumentStatus, type DocumentStatusResponse, DocumentsApi, type DownloadFileParams, type DownloadFileType, type DownloadZippedParams, DownloadsApi, EqualWeb, type EqualWebConfig, EqualWebError, type EqualWebErrorResponse, type GetDocumentsParams, type GetReportParams, type GroupDocumentsParams, type GroupDocumentsResponse, GroupsApi, InfoApi, type OriginalReport, RateLimitError, type RenameGroupParams, type RenameGroupResponse, type ReportCustomData, type ReportResponse, type ReportRule, type ReportSummary, type ReportType, ReportsApi, type UploadResponse };
|
|
502
|
+
export { type ArchiveDocumentsParams, type ArchiveDocumentsResponse, AuditApi, type AuditDocumentsOptions, type AuditDocumentsParams, type AuditDocumentsResponse, type AuditType, type AuditedReport, AuthenticationError, type BalanceResponse, type CancelManualParams, type CancelManualResponse, ConvertApi, type ConvertHtmlParams, type ConvertHtmlResponse, type DeleteDocumentsParams, type DeleteDocumentsResponse, type DetailedReport, type Document, type DocumentGroup, type DocumentStatus, type DocumentStatusResponse, DocumentsApi, type DownloadFileParams, type DownloadFileType, type DownloadZippedParams, DownloadsApi, EqualWeb, type EqualWebConfig, EqualWebError, type EqualWebErrorResponse, type GetDocumentsParams, type GetReportParams, type GroupDocumentsParams, type GroupDocumentsResponse, GroupsApi, InfoApi, ManualApi, type OriginalReport, type PdfSettingsParams, type PdfSettingsResponse, RateLimitError, type RenameGroupParams, type RenameGroupResponse, type ReportCustomData, type ReportResponse, type ReportRule, type ReportSummary, type ReportType, ReportsApi, SettingsApi, type UploadResponse };
|