conare 0.16.0 → 0.17.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/dist/index.d.ts +6 -3
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.17.0";
|
|
2
2
|
/** A metadata value: string, number, boolean or an array of strings. */
|
|
3
3
|
export type MetadataValue = string | number | boolean | string[];
|
|
4
4
|
export type Metadata = Record<string, MetadataValue>;
|
|
@@ -50,7 +50,9 @@ export interface FileUpload {
|
|
|
50
50
|
pages: number | null;
|
|
51
51
|
/** A workbook's sheets (null for a PDF). */
|
|
52
52
|
sheets: number | null;
|
|
53
|
-
/** PDF pages
|
|
53
|
+
/** PDF pages read by OCR because they had no text layer (scans, images); stored like the rest. */
|
|
54
|
+
pagesOcr: number;
|
|
55
|
+
/** PDF pages with no text even after OCR (blank, or OCR could not read them): not stored. */
|
|
54
56
|
pagesWithoutText: number[];
|
|
55
57
|
}
|
|
56
58
|
export interface Document {
|
|
@@ -206,7 +208,8 @@ export declare class Namespace {
|
|
|
206
208
|
* text layer (`<fileId>:page-3`) and Markdown tables per worksheet (`<fileId>:Sheet1-1`), each
|
|
207
209
|
* with `file`, `file_id`, `file_type` and `page` or `sheet` metadata. `fileId` defaults to the
|
|
208
210
|
* name in id characters; uploading the same one again replaces every document it made. Pages
|
|
209
|
-
* without a text layer (scans, images) are
|
|
211
|
+
* without a text layer (scans, images) are read by OCR and counted in `pagesOcr`; pages with no
|
|
212
|
+
* text even then are listed in `pagesWithoutText` and not stored.
|
|
210
213
|
*/
|
|
211
214
|
uploadFile(file: Blob | Uint8Array | ArrayBuffer, name: string, options?: RequestOptions & {
|
|
212
215
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// conare: TypeScript client for the Conare API. Zero dependencies; uses global fetch.
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.17.0";
|
|
3
3
|
const DEFAULT_BASE_URL = "https://api.conare.ai";
|
|
4
4
|
const BATCH_SIZE = 100;
|
|
5
5
|
// ---- Errors ----------------------------------------------------------------
|
|
@@ -216,7 +216,8 @@ export class Namespace {
|
|
|
216
216
|
* text layer (`<fileId>:page-3`) and Markdown tables per worksheet (`<fileId>:Sheet1-1`), each
|
|
217
217
|
* with `file`, `file_id`, `file_type` and `page` or `sheet` metadata. `fileId` defaults to the
|
|
218
218
|
* name in id characters; uploading the same one again replaces every document it made. Pages
|
|
219
|
-
* without a text layer (scans, images) are
|
|
219
|
+
* without a text layer (scans, images) are read by OCR and counted in `pagesOcr`; pages with no
|
|
220
|
+
* text even then are listed in `pagesWithoutText` and not stored.
|
|
220
221
|
*/
|
|
221
222
|
async uploadFile(file, name, options = {}) {
|
|
222
223
|
const query = new URLSearchParams({ name, ...(options.id ? { id: options.id } : {}) });
|
|
@@ -227,6 +228,7 @@ export class Namespace {
|
|
|
227
228
|
ids: body.ids,
|
|
228
229
|
pages: body.pages ?? null,
|
|
229
230
|
sheets: body.sheets ?? null,
|
|
231
|
+
pagesOcr: body.pages_ocr ?? 0,
|
|
230
232
|
pagesWithoutText: body.pages_without_text ?? [],
|
|
231
233
|
};
|
|
232
234
|
}
|