@retab/node 1.0.65 → 1.0.67
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/client.d.ts +2 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -0
- package/dist/api/extractions/client.d.ts +124 -0
- package/dist/api/extractions/client.d.ts.map +1 -0
- package/dist/api/extractions/client.js +188 -0
- package/dist/api/projects/client.d.ts +4 -3
- package/dist/api/projects/client.d.ts.map +1 -1
- package/dist/api/projects/client.js +9 -5
- package/dist/generated_types.d.ts +4705 -6678
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +300 -102
- package/dist/types.d.ts +17 -64
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -11
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -35,21 +35,8 @@ export type MIMEDataInput = z.input<typeof ZMIMEData>;
|
|
|
35
35
|
export declare const ZJSONSchema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodType<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeDef, z.ZodType<unknown, z.ZodTypeDef, unknown>>]>, Record<string, any>, string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
36
36
|
export type JSONSchemaInput = z.input<typeof ZJSONSchema>;
|
|
37
37
|
export type JSONSchema = z.output<(typeof ZJSONSchema)>;
|
|
38
|
-
export declare const ZDocumentExtractRequest: z.
|
|
39
|
-
document: z.
|
|
40
|
-
filename: z.ZodString;
|
|
41
|
-
url: z.ZodString;
|
|
42
|
-
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
filename: string;
|
|
44
|
-
url: string;
|
|
45
|
-
}, {
|
|
46
|
-
filename: string;
|
|
47
|
-
url: string;
|
|
48
|
-
}>>]>, any, string | Buffer<ArrayBufferLike> | Readable | {
|
|
49
|
-
filename: string;
|
|
50
|
-
url: string;
|
|
51
|
-
}>>;
|
|
52
|
-
documents: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
|
|
38
|
+
export declare const ZDocumentExtractRequest: z.ZodObject<{
|
|
39
|
+
document: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
|
|
53
40
|
filename: z.ZodString;
|
|
54
41
|
url: z.ZodString;
|
|
55
42
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -61,72 +48,50 @@ export declare const ZDocumentExtractRequest: z.ZodEffects<z.ZodObject<{
|
|
|
61
48
|
}>>]>, any, string | Buffer<ArrayBufferLike> | Readable | {
|
|
62
49
|
filename: string;
|
|
63
50
|
url: string;
|
|
64
|
-
}
|
|
51
|
+
}>;
|
|
65
52
|
json_schema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodType<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeDef, z.ZodType<unknown, z.ZodTypeDef, unknown>>]>, Record<string, any>, string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
53
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
54
|
image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
|
|
67
55
|
model: z.ZodString;
|
|
68
56
|
temperature: z.ZodDefault<z.ZodNumber>;
|
|
69
|
-
reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
|
|
57
|
+
reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
|
|
70
58
|
n_consensus: z.ZodDefault<z.ZodNumber>;
|
|
71
59
|
seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
60
|
store: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
-
need_validation: z.ZodDefault<z.ZodBoolean>;
|
|
74
61
|
modality: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"text">, z.ZodLiteral<"image">, z.ZodLiteral<"native">]>>;
|
|
75
62
|
parallel_ocr_keys: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
63
|
+
extraction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
64
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
metadata: Record<string, string>;
|
|
77
66
|
json_schema: Record<string, any>;
|
|
78
67
|
model: string;
|
|
79
68
|
temperature: number;
|
|
80
|
-
reasoning_effort: "low" | "high" | "minimal" | "medium" | null;
|
|
69
|
+
reasoning_effort: "low" | "high" | "none" | "minimal" | "medium" | null;
|
|
81
70
|
image_resolution_dpi: number;
|
|
82
71
|
n_consensus: number;
|
|
83
72
|
modality: "text" | "image" | "native";
|
|
84
|
-
documents: any[];
|
|
85
73
|
store: boolean;
|
|
86
|
-
need_validation: boolean;
|
|
87
74
|
parallel_ocr_keys?: Record<string, string> | null | undefined;
|
|
75
|
+
extraction_id?: string | null | undefined;
|
|
88
76
|
document?: any;
|
|
89
77
|
seed?: number | null | undefined;
|
|
90
78
|
}, {
|
|
91
79
|
json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
92
80
|
model: string;
|
|
93
|
-
|
|
94
|
-
reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
|
|
95
|
-
image_resolution_dpi?: number | undefined;
|
|
96
|
-
n_consensus?: number | undefined;
|
|
97
|
-
modality?: "text" | "image" | "native" | undefined;
|
|
98
|
-
parallel_ocr_keys?: Record<string, string> | null | undefined;
|
|
99
|
-
documents?: (string | Buffer<ArrayBufferLike> | Readable | {
|
|
100
|
-
filename: string;
|
|
101
|
-
url: string;
|
|
102
|
-
})[] | undefined;
|
|
103
|
-
document?: string | Buffer<ArrayBufferLike> | Readable | {
|
|
81
|
+
document: string | Buffer<ArrayBufferLike> | Readable | {
|
|
104
82
|
filename: string;
|
|
105
83
|
url: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
store?: boolean | undefined;
|
|
109
|
-
need_validation?: boolean | undefined;
|
|
110
|
-
}>, any, {
|
|
111
|
-
json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
112
|
-
model: string;
|
|
84
|
+
};
|
|
85
|
+
metadata?: Record<string, string> | undefined;
|
|
113
86
|
temperature?: number | undefined;
|
|
114
|
-
reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
|
|
87
|
+
reasoning_effort?: "low" | "high" | "none" | "minimal" | "medium" | null | undefined;
|
|
115
88
|
image_resolution_dpi?: number | undefined;
|
|
116
89
|
n_consensus?: number | undefined;
|
|
117
90
|
modality?: "text" | "image" | "native" | undefined;
|
|
118
91
|
parallel_ocr_keys?: Record<string, string> | null | undefined;
|
|
119
|
-
|
|
120
|
-
filename: string;
|
|
121
|
-
url: string;
|
|
122
|
-
})[] | undefined;
|
|
123
|
-
document?: string | Buffer<ArrayBufferLike> | Readable | {
|
|
124
|
-
filename: string;
|
|
125
|
-
url: string;
|
|
126
|
-
} | undefined;
|
|
92
|
+
extraction_id?: string | null | undefined;
|
|
127
93
|
seed?: number | null | undefined;
|
|
128
94
|
store?: boolean | undefined;
|
|
129
|
-
need_validation?: boolean | undefined;
|
|
130
95
|
}>;
|
|
131
96
|
export type DocumentExtractRequest = z.input<typeof ZDocumentExtractRequest>;
|
|
132
97
|
export declare const ZParseRequest: z.ZodObject<{
|
|
@@ -146,11 +111,9 @@ export declare const ZParseRequest: z.ZodObject<{
|
|
|
146
111
|
model: z.ZodDefault<z.ZodString>;
|
|
147
112
|
table_parsing_format: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"markdown">, z.ZodLiteral<"yaml">, z.ZodLiteral<"html">, z.ZodLiteral<"json">]>>;
|
|
148
113
|
image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
|
|
149
|
-
browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A1">, z.ZodLiteral<"A2">, z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
|
|
150
114
|
}, "strip", z.ZodTypeAny, {
|
|
151
115
|
model: string;
|
|
152
116
|
image_resolution_dpi: number;
|
|
153
|
-
browser_canvas: "A1" | "A2" | "A3" | "A4" | "A5";
|
|
154
117
|
table_parsing_format: "markdown" | "yaml" | "html" | "json";
|
|
155
118
|
document?: any;
|
|
156
119
|
}, {
|
|
@@ -160,7 +123,6 @@ export declare const ZParseRequest: z.ZodObject<{
|
|
|
160
123
|
};
|
|
161
124
|
model?: string | undefined;
|
|
162
125
|
image_resolution_dpi?: number | undefined;
|
|
163
|
-
browser_canvas?: "A1" | "A2" | "A3" | "A4" | "A5" | undefined;
|
|
164
126
|
table_parsing_format?: "markdown" | "yaml" | "html" | "json" | undefined;
|
|
165
127
|
}>;
|
|
166
128
|
export type ParseRequest = z.input<typeof ZParseRequest>;
|
|
@@ -179,12 +141,10 @@ export declare const ZDocumentCreateMessageRequest: z.ZodObject<{
|
|
|
179
141
|
url: string;
|
|
180
142
|
}>;
|
|
181
143
|
image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
|
|
182
|
-
browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A1">, z.ZodLiteral<"A2">, z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
|
|
183
144
|
model: z.ZodDefault<z.ZodString>;
|
|
184
145
|
}, "strip", z.ZodTypeAny, {
|
|
185
146
|
model: string;
|
|
186
147
|
image_resolution_dpi: number;
|
|
187
|
-
browser_canvas: "A1" | "A2" | "A3" | "A4" | "A5";
|
|
188
148
|
document?: any;
|
|
189
149
|
}, {
|
|
190
150
|
document: string | Buffer<ArrayBufferLike> | Readable | {
|
|
@@ -193,7 +153,6 @@ export declare const ZDocumentCreateMessageRequest: z.ZodObject<{
|
|
|
193
153
|
};
|
|
194
154
|
model?: string | undefined;
|
|
195
155
|
image_resolution_dpi?: number | undefined;
|
|
196
|
-
browser_canvas?: "A1" | "A2" | "A3" | "A4" | "A5" | undefined;
|
|
197
156
|
}>;
|
|
198
157
|
export type DocumentCreateMessageRequest = z.input<typeof ZDocumentCreateMessageRequest>;
|
|
199
158
|
export declare const ZDocumentCreateInputRequest: z.ZodObject<{
|
|
@@ -212,13 +171,11 @@ export declare const ZDocumentCreateInputRequest: z.ZodObject<{
|
|
|
212
171
|
}>;
|
|
213
172
|
json_schema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodType<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeDef, z.ZodType<unknown, z.ZodTypeDef, unknown>>]>, Record<string, any>, string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
214
173
|
image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
|
|
215
|
-
browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A1">, z.ZodLiteral<"A2">, z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
|
|
216
174
|
model: z.ZodDefault<z.ZodString>;
|
|
217
175
|
}, "strip", z.ZodTypeAny, {
|
|
218
176
|
json_schema: Record<string, any>;
|
|
219
177
|
model: string;
|
|
220
178
|
image_resolution_dpi: number;
|
|
221
|
-
browser_canvas: "A1" | "A2" | "A3" | "A4" | "A5";
|
|
222
179
|
document?: any;
|
|
223
180
|
}, {
|
|
224
181
|
json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
@@ -228,7 +185,6 @@ export declare const ZDocumentCreateInputRequest: z.ZodObject<{
|
|
|
228
185
|
};
|
|
229
186
|
model?: string | undefined;
|
|
230
187
|
image_resolution_dpi?: number | undefined;
|
|
231
|
-
browser_canvas?: "A1" | "A2" | "A3" | "A4" | "A5" | undefined;
|
|
232
188
|
}>;
|
|
233
189
|
export type DocumentCreateInputRequest = z.input<typeof ZDocumentCreateInputRequest>;
|
|
234
190
|
export declare const ZGenerateSchemaRequest: z.ZodObject<{
|
|
@@ -247,18 +203,16 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
|
|
|
247
203
|
}>, "many">;
|
|
248
204
|
model: z.ZodDefault<z.ZodString>;
|
|
249
205
|
temperature: z.ZodDefault<z.ZodNumber>;
|
|
250
|
-
reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
|
|
206
|
+
reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
|
|
251
207
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
208
|
image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
|
|
253
|
-
browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A1">, z.ZodLiteral<"A2">, z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
|
|
254
209
|
stream: z.ZodDefault<z.ZodBoolean>;
|
|
255
210
|
}, "strip", z.ZodTypeAny, {
|
|
256
211
|
stream: boolean;
|
|
257
212
|
model: string;
|
|
258
213
|
temperature: number;
|
|
259
|
-
reasoning_effort: "low" | "high" | "minimal" | "medium" | null;
|
|
214
|
+
reasoning_effort: "low" | "high" | "none" | "minimal" | "medium" | null;
|
|
260
215
|
image_resolution_dpi: number;
|
|
261
|
-
browser_canvas: "A1" | "A2" | "A3" | "A4" | "A5";
|
|
262
216
|
documents: any[];
|
|
263
217
|
instructions?: string | null | undefined;
|
|
264
218
|
}, {
|
|
@@ -269,9 +223,8 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
|
|
|
269
223
|
stream?: boolean | undefined;
|
|
270
224
|
model?: string | undefined;
|
|
271
225
|
temperature?: number | undefined;
|
|
272
|
-
reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
|
|
226
|
+
reasoning_effort?: "low" | "high" | "none" | "minimal" | "medium" | null | undefined;
|
|
273
227
|
image_resolution_dpi?: number | undefined;
|
|
274
|
-
browser_canvas?: "A1" | "A2" | "A3" | "A4" | "A5" | undefined;
|
|
275
228
|
instructions?: string | null | undefined;
|
|
276
229
|
}>;
|
|
277
230
|
export type GenerateSchemaRequest = z.input<typeof ZGenerateSchemaRequest>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrE,cAAc,mBAAmB,CAAC;AAClC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAMzB,wBAAgB,SAAS,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,CACzF,CAAC,CAAC,MAAM,CAAC,MAAM,C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AO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIzE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;GAKf,CAAC;AACL,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -66,19 +66,14 @@ export const ZJSONSchema = z.union([
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
export const ZDocumentExtractRequest = z.object({
|
|
69
|
-
// Keep everything except stream
|
|
70
|
-
...(({ stream, ...rest }) => rest)(generated.ZDocumentExtractRequest.schema.shape),
|
|
71
|
-
// Accept a single document
|
|
72
|
-
document: ZMIMEData
|
|
73
|
-
documents: z.array(ZMIMEData).default([]),
|
|
69
|
+
// Keep everything except stream and document from generated types
|
|
70
|
+
...(({ stream, document, metadata, ...rest }) => rest)(generated.ZDocumentExtractRequest.schema.shape),
|
|
71
|
+
// Accept a single document (required)
|
|
72
|
+
document: ZMIMEData,
|
|
74
73
|
// Normalize json_schema inputs (paths/zod instances)
|
|
75
74
|
json_schema: ZJSONSchema,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (document && (!documents || documents.length === 0)) {
|
|
79
|
-
return { ...rest, documents: [document] };
|
|
80
|
-
}
|
|
81
|
-
return { ...rest, documents: documents || [] };
|
|
75
|
+
// Make metadata optional with empty object default
|
|
76
|
+
metadata: z.record(z.string(), z.string()).default({}),
|
|
82
77
|
});
|
|
83
78
|
export const ZParseRequest = z.object({
|
|
84
79
|
...generated.ZParseRequest.schema.shape,
|