@retab/node 1.0.78 → 1.0.79
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/api/documents/client.d.ts +1 -1
- package/dist/api/documents/client.js +1 -1
- package/dist/api/edit/client.d.ts +1 -1
- package/dist/api/edit/client.js +1 -1
- package/dist/api/edit/templates/client.d.ts +3 -3
- package/dist/api/edit/templates/client.d.ts.map +1 -1
- package/dist/api/edit/templates/client.js +3 -3
- package/dist/generated_types.d.ts +3 -3
- package/dist/generated_types.js +1 -1
- package/dist/types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
20
20
|
* - When `template_id` is provided: Uses pre-defined form fields from the template (PDF only)
|
|
21
21
|
*
|
|
22
22
|
* @param params - EditRequest containing:
|
|
23
|
-
* -
|
|
23
|
+
* - instructions: Natural language instructions for filling (required)
|
|
24
24
|
* - document: MIMEData object, file path, Buffer, or Readable stream (optional, mutually exclusive with template_id)
|
|
25
25
|
* - model: LLM model for inference (default: "retab-small")
|
|
26
26
|
* - template_id: Template ID to use for filling with pre-defined form fields (optional, mutually exclusive with document)
|
|
@@ -63,7 +63,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
63
63
|
* - When `template_id` is provided: Uses pre-defined form fields from the template (PDF only)
|
|
64
64
|
*
|
|
65
65
|
* @param params - EditRequest containing:
|
|
66
|
-
* -
|
|
66
|
+
* - instructions: Natural language instructions for filling (required)
|
|
67
67
|
* - document: MIMEData object, file path, Buffer, or Readable stream (optional, mutually exclusive with template_id)
|
|
68
68
|
* - model: LLM model for inference (default: "retab-small")
|
|
69
69
|
* - template_id: Template ID to use for filling with pre-defined form fields (optional, mutually exclusive with document)
|
|
@@ -22,7 +22,7 @@ export default class APIEdit extends CompositionClient {
|
|
|
22
22
|
* - XLSX/XLS: Native editing for spreadsheets
|
|
23
23
|
*
|
|
24
24
|
* @param params - EditRequest containing:
|
|
25
|
-
* -
|
|
25
|
+
* - instructions: Natural language instructions for filling (required)
|
|
26
26
|
* - document: MIMEData object, file path, Buffer, or Readable stream (optional, mutually exclusive with template_id)
|
|
27
27
|
* - model: LLM model for inference (default: "retab-small")
|
|
28
28
|
* - template_id: Template ID to use for filling with pre-defined form fields (optional, mutually exclusive with document)
|
package/dist/api/edit/client.js
CHANGED
|
@@ -24,7 +24,7 @@ export default class APIEdit extends CompositionClient {
|
|
|
24
24
|
* - XLSX/XLS: Native editing for spreadsheets
|
|
25
25
|
*
|
|
26
26
|
* @param params - EditRequest containing:
|
|
27
|
-
* -
|
|
27
|
+
* - instructions: Natural language instructions for filling (required)
|
|
28
28
|
* - document: MIMEData object, file path, Buffer, or Readable stream (optional, mutually exclusive with template_id)
|
|
29
29
|
* - model: LLM model for inference (default: "retab-small")
|
|
30
30
|
* - template_id: Template ID to use for filling with pre-defined form fields (optional, mutually exclusive with document)
|
|
@@ -109,16 +109,16 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
109
109
|
*
|
|
110
110
|
* @param params - Fill request containing:
|
|
111
111
|
* - template_id: The template ID to use for filling
|
|
112
|
-
* -
|
|
112
|
+
* - instructions: Instructions describing how to fill the form fields
|
|
113
113
|
* - model: LLM model for inference (default: "retab-small")
|
|
114
114
|
* @param options - Optional request options
|
|
115
115
|
* @returns EditResponse containing:
|
|
116
116
|
* - form_data: List of form fields with filled values
|
|
117
117
|
* - filled_document: The filled PDF document as MIMEData
|
|
118
118
|
*/
|
|
119
|
-
fill({ template_id,
|
|
119
|
+
fill({ template_id, instructions, model, }: {
|
|
120
120
|
template_id: string;
|
|
121
|
-
|
|
121
|
+
instructions: string;
|
|
122
122
|
model?: string;
|
|
123
123
|
}, options?: RequestOptions): Promise<EditResponse>;
|
|
124
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/api/edit/templates/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,i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,YAAY,CAAC;IAaxB;;;;;;;;;;;;;;;;;;OAkBG;IACG,QAAQ,CACV,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,uBAAuB,CAAC;IAUnC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,IAAI,CACN,EACI,WAAW,EACX,YAAY,EACZ,KAAqB,GACxB,EAAE;QACC,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,EACD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,YAAY,CAAC;CAc3B"}
|
|
@@ -172,20 +172,20 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
172
172
|
*
|
|
173
173
|
* @param params - Fill request containing:
|
|
174
174
|
* - template_id: The template ID to use for filling
|
|
175
|
-
* -
|
|
175
|
+
* - instructions: Instructions describing how to fill the form fields
|
|
176
176
|
* - model: LLM model for inference (default: "retab-small")
|
|
177
177
|
* @param options - Optional request options
|
|
178
178
|
* @returns EditResponse containing:
|
|
179
179
|
* - form_data: List of form fields with filled values
|
|
180
180
|
* - filled_document: The filled PDF document as MIMEData
|
|
181
181
|
*/
|
|
182
|
-
async fill({ template_id,
|
|
182
|
+
async fill({ template_id, instructions, model = "retab-small", }, options) {
|
|
183
183
|
return this._fetchJson(ZEditResponse, {
|
|
184
184
|
url: "/v1/edit/templates/fill",
|
|
185
185
|
method: "POST",
|
|
186
186
|
body: {
|
|
187
187
|
template_id,
|
|
188
|
-
|
|
188
|
+
instructions,
|
|
189
189
|
model,
|
|
190
190
|
...(options?.body || {}),
|
|
191
191
|
},
|
|
@@ -17820,18 +17820,18 @@ export declare const ZEditRequest: z.ZodLazy<z.ZodObject<{
|
|
|
17820
17820
|
url: string;
|
|
17821
17821
|
}>>>>;
|
|
17822
17822
|
model: z.ZodDefault<z.ZodString>;
|
|
17823
|
-
|
|
17823
|
+
instructions: z.ZodString;
|
|
17824
17824
|
template_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17825
17825
|
}, "strip", z.ZodTypeAny, {
|
|
17826
17826
|
model: string;
|
|
17827
|
-
|
|
17827
|
+
instructions: string;
|
|
17828
17828
|
document?: {
|
|
17829
17829
|
filename: string;
|
|
17830
17830
|
url: string;
|
|
17831
17831
|
} | null | undefined;
|
|
17832
17832
|
template_id?: string | null | undefined;
|
|
17833
17833
|
}, {
|
|
17834
|
-
|
|
17834
|
+
instructions: string;
|
|
17835
17835
|
model?: string | undefined;
|
|
17836
17836
|
document?: {
|
|
17837
17837
|
filename: string;
|
package/dist/generated_types.js
CHANGED
|
@@ -586,7 +586,7 @@ export const ZBaseFormField = z.lazy(() => (z.object({
|
|
|
586
586
|
export const ZEditRequest = z.lazy(() => (z.object({
|
|
587
587
|
document: ZMIMEData.nullable().optional(),
|
|
588
588
|
model: z.string().default("retab-small"),
|
|
589
|
-
|
|
589
|
+
instructions: z.string(),
|
|
590
590
|
template_id: z.string().nullable().optional(),
|
|
591
591
|
})));
|
|
592
592
|
export const ZEditResponse = z.lazy(() => (z.object({
|
package/dist/types.d.ts
CHANGED
|
@@ -599,15 +599,15 @@ export declare const ZEditRequest: z.ZodObject<{
|
|
|
599
599
|
url: string;
|
|
600
600
|
}>>>;
|
|
601
601
|
model: z.ZodDefault<z.ZodString>;
|
|
602
|
-
|
|
602
|
+
instructions: z.ZodString;
|
|
603
603
|
template_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
604
604
|
}, "strip", z.ZodTypeAny, {
|
|
605
605
|
model: string;
|
|
606
|
-
|
|
606
|
+
instructions: string;
|
|
607
607
|
document?: any;
|
|
608
608
|
template_id?: string | null | undefined;
|
|
609
609
|
}, {
|
|
610
|
-
|
|
610
|
+
instructions: string;
|
|
611
611
|
model?: string | undefined;
|
|
612
612
|
document?: string | Buffer<ArrayBufferLike> | Readable | {
|
|
613
613
|
filename: string;
|