@retab/node 1.0.58 → 1.0.63

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/types.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { Readable } from "stream";
2
+ import * as generated from "./generated_types";
2
3
  import { ZFieldItem, ZRefObject, ZRowList } from "./generated_types";
3
4
  export * from "./generated_types";
4
5
  import * as z from "zod";
6
+ export * from "./schema_types";
5
7
  export declare function dataArray<Schema extends z.ZodType<any, any, any>>(schema: Schema): z.ZodType<z.output<Schema>[], z.ZodTypeDef, {
6
8
  data: z.input<Schema>[];
7
9
  }>;
@@ -35,8 +37,8 @@ export type MIMEDataInput = z.input<typeof ZMIMEData>;
35
37
  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
38
  export type JSONSchemaInput = z.input<typeof ZJSONSchema>;
37
39
  export type JSONSchema = z.output<(typeof ZJSONSchema)>;
38
- export declare const ZDocumentExtractRequest: z.ZodObject<{
39
- documents: 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<{
40
+ export declare const ZDocumentExtractRequest: z.ZodEffects<z.ZodObject<{
41
+ document: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
40
42
  filename: z.ZodString;
41
43
  url: z.ZodString;
42
44
  }, "strip", z.ZodTypeAny, {
@@ -48,11 +50,22 @@ export declare const ZDocumentExtractRequest: z.ZodObject<{
48
50
  }>>]>, any, string | {
49
51
  filename: string;
50
52
  url: string;
51
- } | Readable | Buffer<ArrayBufferLike>>, "many">;
53
+ } | Readable | Buffer<ArrayBufferLike>>>;
54
+ 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<{
55
+ filename: z.ZodString;
56
+ url: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ filename: string;
59
+ url: string;
60
+ }, {
61
+ filename: string;
62
+ url: string;
63
+ }>>]>, any, string | {
64
+ filename: string;
65
+ url: string;
66
+ } | Readable | Buffer<ArrayBufferLike>>, "many">>;
52
67
  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
- modality: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"text">, z.ZodLiteral<"image">, z.ZodLiteral<"native">, z.ZodLiteral<"image+text">]>>;
54
68
  image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
55
- browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
56
69
  model: z.ZodString;
57
70
  temperature: z.ZodDefault<z.ZodNumber>;
58
71
  reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
@@ -64,28 +77,47 @@ export declare const ZDocumentExtractRequest: z.ZodObject<{
64
77
  json_schema: Record<string, any>;
65
78
  model: string;
66
79
  temperature: number;
67
- modality: "text" | "image" | "native" | "image+text";
68
80
  reasoning_effort: "low" | "high" | "minimal" | "medium" | null;
69
81
  image_resolution_dpi: number;
70
- browser_canvas: "A3" | "A4" | "A5";
71
82
  n_consensus: number;
72
83
  documents: any[];
73
84
  store: boolean;
74
85
  need_validation: boolean;
86
+ document?: any;
75
87
  seed?: number | null | undefined;
76
88
  }, {
77
89
  json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
78
90
  model: string;
79
- documents: (string | {
91
+ temperature?: number | undefined;
92
+ reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
93
+ image_resolution_dpi?: number | undefined;
94
+ n_consensus?: number | undefined;
95
+ documents?: (string | {
80
96
  filename: string;
81
97
  url: string;
82
- } | Readable | Buffer<ArrayBufferLike>)[];
98
+ } | Readable | Buffer<ArrayBufferLike>)[] | undefined;
99
+ document?: string | {
100
+ filename: string;
101
+ url: string;
102
+ } | Readable | Buffer<ArrayBufferLike> | undefined;
103
+ seed?: number | null | undefined;
104
+ store?: boolean | undefined;
105
+ need_validation?: boolean | undefined;
106
+ }>, any, {
107
+ json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
108
+ model: string;
83
109
  temperature?: number | undefined;
84
- modality?: "text" | "image" | "native" | "image+text" | undefined;
85
110
  reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
86
111
  image_resolution_dpi?: number | undefined;
87
- browser_canvas?: "A3" | "A4" | "A5" | undefined;
88
112
  n_consensus?: number | undefined;
113
+ documents?: (string | {
114
+ filename: string;
115
+ url: string;
116
+ } | Readable | Buffer<ArrayBufferLike>)[] | undefined;
117
+ document?: string | {
118
+ filename: string;
119
+ url: string;
120
+ } | Readable | Buffer<ArrayBufferLike> | undefined;
89
121
  seed?: number | null | undefined;
90
122
  store?: boolean | undefined;
91
123
  need_validation?: boolean | undefined;
@@ -105,12 +137,12 @@ export declare const ZParseRequest: z.ZodObject<{
105
137
  filename: string;
106
138
  url: string;
107
139
  } | Readable | Buffer<ArrayBufferLike>>;
108
- model: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"gpt-4o">, z.ZodLiteral<"gpt-4o-mini">, z.ZodLiteral<"chatgpt-4o-latest">, z.ZodLiteral<"gpt-5">, z.ZodLiteral<"gpt-5-2025-08-07">, z.ZodLiteral<"gpt-5-mini">, z.ZodLiteral<"gpt-5-mini-2025-08-07">, z.ZodLiteral<"gpt-5-nano">, z.ZodLiteral<"gpt-5-nano-2025-08-07">, z.ZodLiteral<"gpt-4.1">, z.ZodLiteral<"gpt-4.1-mini">, z.ZodLiteral<"gpt-4.1-mini-2025-04-14">, z.ZodLiteral<"gpt-4.1-2025-04-14">, z.ZodLiteral<"gpt-4.1-nano">, z.ZodLiteral<"gpt-4.1-nano-2025-04-14">, z.ZodLiteral<"gpt-4o-2024-11-20">, z.ZodLiteral<"gpt-4o-2024-08-06">, z.ZodLiteral<"gpt-4o-2024-05-13">, z.ZodLiteral<"gpt-4o-mini-2024-07-18">, z.ZodLiteral<"o1">, z.ZodLiteral<"o1-2024-12-17">, z.ZodLiteral<"o3">, z.ZodLiteral<"o3-2025-04-16">, z.ZodLiteral<"o4-mini">, z.ZodLiteral<"o4-mini-2025-04-16">, z.ZodLiteral<"gpt-4o-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-audio-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-mini-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-mini-realtime-preview-2024-12-17">, z.ZodLiteral<"claude-3-5-sonnet-latest">, z.ZodLiteral<"claude-3-5-sonnet-20241022">, z.ZodLiteral<"claude-3-opus-20240229">, z.ZodLiteral<"claude-3-sonnet-20240229">, z.ZodLiteral<"claude-3-haiku-20240307">, z.ZodLiteral<"claude-opus-4.1">, z.ZodLiteral<"claude-opus-4">, z.ZodLiteral<"claude-sonnet-4">, z.ZodLiteral<"claude-sonnet-4-20250514">, z.ZodLiteral<"grok-3">, z.ZodLiteral<"grok-3-mini">, z.ZodLiteral<"gemini-2.5-pro">, z.ZodLiteral<"gemini-2.5-flash">, z.ZodLiteral<"gemini-2.5-pro-preview-06-05">, z.ZodLiteral<"gemini-2.5-pro-preview-05-06">, z.ZodLiteral<"gemini-2.5-pro-preview-03-25">, z.ZodLiteral<"gemini-2.5-flash-preview-05-20">, z.ZodLiteral<"gemini-2.5-flash-preview-04-17">, z.ZodLiteral<"gemini-2.5-flash-lite">, z.ZodLiteral<"gemini-2.5-pro-exp-03-25">, z.ZodLiteral<"gemini-2.0-flash-lite">, z.ZodLiteral<"gemini-2.0-flash">, z.ZodLiteral<"auto-large">, z.ZodLiteral<"auto-small">, z.ZodLiteral<"auto-micro">, z.ZodLiteral<"human">]>>;
140
+ model: z.ZodDefault<z.ZodString>;
109
141
  table_parsing_format: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"markdown">, z.ZodLiteral<"yaml">, z.ZodLiteral<"html">, z.ZodLiteral<"json">]>>;
110
142
  image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
111
143
  browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
112
144
  }, "strip", z.ZodTypeAny, {
113
- model: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human";
145
+ model: string;
114
146
  image_resolution_dpi: number;
115
147
  browser_canvas: "A3" | "A4" | "A5";
116
148
  table_parsing_format: "markdown" | "yaml" | "html" | "json";
@@ -120,7 +152,7 @@ export declare const ZParseRequest: z.ZodObject<{
120
152
  filename: string;
121
153
  url: string;
122
154
  } | Readable | Buffer<ArrayBufferLike>;
123
- model?: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human" | undefined;
155
+ model?: string | undefined;
124
156
  image_resolution_dpi?: number | undefined;
125
157
  browser_canvas?: "A3" | "A4" | "A5" | undefined;
126
158
  table_parsing_format?: "markdown" | "yaml" | "html" | "json" | undefined;
@@ -140,13 +172,11 @@ export declare const ZDocumentCreateMessageRequest: z.ZodObject<{
140
172
  filename: string;
141
173
  url: string;
142
174
  } | Readable | Buffer<ArrayBufferLike>>;
143
- modality: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"text">, z.ZodLiteral<"image">, z.ZodLiteral<"native">, z.ZodLiteral<"image+text">]>>;
144
175
  image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
145
176
  browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
146
- model: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"gpt-4o">, z.ZodLiteral<"gpt-4o-mini">, z.ZodLiteral<"chatgpt-4o-latest">, z.ZodLiteral<"gpt-5">, z.ZodLiteral<"gpt-5-2025-08-07">, z.ZodLiteral<"gpt-5-mini">, z.ZodLiteral<"gpt-5-mini-2025-08-07">, z.ZodLiteral<"gpt-5-nano">, z.ZodLiteral<"gpt-5-nano-2025-08-07">, z.ZodLiteral<"gpt-4.1">, z.ZodLiteral<"gpt-4.1-mini">, z.ZodLiteral<"gpt-4.1-mini-2025-04-14">, z.ZodLiteral<"gpt-4.1-2025-04-14">, z.ZodLiteral<"gpt-4.1-nano">, z.ZodLiteral<"gpt-4.1-nano-2025-04-14">, z.ZodLiteral<"gpt-4o-2024-11-20">, z.ZodLiteral<"gpt-4o-2024-08-06">, z.ZodLiteral<"gpt-4o-2024-05-13">, z.ZodLiteral<"gpt-4o-mini-2024-07-18">, z.ZodLiteral<"o1">, z.ZodLiteral<"o1-2024-12-17">, z.ZodLiteral<"o3">, z.ZodLiteral<"o3-2025-04-16">, z.ZodLiteral<"o4-mini">, z.ZodLiteral<"o4-mini-2025-04-16">, z.ZodLiteral<"gpt-4o-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-audio-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-mini-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-mini-realtime-preview-2024-12-17">, z.ZodLiteral<"claude-3-5-sonnet-latest">, z.ZodLiteral<"claude-3-5-sonnet-20241022">, z.ZodLiteral<"claude-3-opus-20240229">, z.ZodLiteral<"claude-3-sonnet-20240229">, z.ZodLiteral<"claude-3-haiku-20240307">, z.ZodLiteral<"claude-opus-4.1">, z.ZodLiteral<"claude-opus-4">, z.ZodLiteral<"claude-sonnet-4">, z.ZodLiteral<"claude-sonnet-4-20250514">, z.ZodLiteral<"grok-3">, z.ZodLiteral<"grok-3-mini">, z.ZodLiteral<"gemini-2.5-pro">, z.ZodLiteral<"gemini-2.5-flash">, z.ZodLiteral<"gemini-2.5-pro-preview-06-05">, z.ZodLiteral<"gemini-2.5-pro-preview-05-06">, z.ZodLiteral<"gemini-2.5-pro-preview-03-25">, z.ZodLiteral<"gemini-2.5-flash-preview-05-20">, z.ZodLiteral<"gemini-2.5-flash-preview-04-17">, z.ZodLiteral<"gemini-2.5-flash-lite">, z.ZodLiteral<"gemini-2.5-pro-exp-03-25">, z.ZodLiteral<"gemini-2.0-flash-lite">, z.ZodLiteral<"gemini-2.0-flash">, z.ZodLiteral<"auto-large">, z.ZodLiteral<"auto-small">, z.ZodLiteral<"auto-micro">, z.ZodLiteral<"human">]>>;
177
+ model: z.ZodDefault<z.ZodString>;
147
178
  }, "strip", z.ZodTypeAny, {
148
- model: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human";
149
- modality: "text" | "image" | "native" | "image+text";
179
+ model: string;
150
180
  image_resolution_dpi: number;
151
181
  browser_canvas: "A3" | "A4" | "A5";
152
182
  document?: any;
@@ -155,8 +185,7 @@ export declare const ZDocumentCreateMessageRequest: z.ZodObject<{
155
185
  filename: string;
156
186
  url: string;
157
187
  } | Readable | Buffer<ArrayBufferLike>;
158
- model?: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human" | undefined;
159
- modality?: "text" | "image" | "native" | "image+text" | undefined;
188
+ model?: string | undefined;
160
189
  image_resolution_dpi?: number | undefined;
161
190
  browser_canvas?: "A3" | "A4" | "A5" | undefined;
162
191
  }>;
@@ -176,14 +205,12 @@ export declare const ZDocumentCreateInputRequest: z.ZodObject<{
176
205
  url: string;
177
206
  } | Readable | Buffer<ArrayBufferLike>>;
178
207
  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>>;
179
- modality: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"text">, z.ZodLiteral<"image">, z.ZodLiteral<"native">, z.ZodLiteral<"image+text">]>>;
180
208
  image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
181
209
  browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
182
- model: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"gpt-4o">, z.ZodLiteral<"gpt-4o-mini">, z.ZodLiteral<"chatgpt-4o-latest">, z.ZodLiteral<"gpt-5">, z.ZodLiteral<"gpt-5-2025-08-07">, z.ZodLiteral<"gpt-5-mini">, z.ZodLiteral<"gpt-5-mini-2025-08-07">, z.ZodLiteral<"gpt-5-nano">, z.ZodLiteral<"gpt-5-nano-2025-08-07">, z.ZodLiteral<"gpt-4.1">, z.ZodLiteral<"gpt-4.1-mini">, z.ZodLiteral<"gpt-4.1-mini-2025-04-14">, z.ZodLiteral<"gpt-4.1-2025-04-14">, z.ZodLiteral<"gpt-4.1-nano">, z.ZodLiteral<"gpt-4.1-nano-2025-04-14">, z.ZodLiteral<"gpt-4o-2024-11-20">, z.ZodLiteral<"gpt-4o-2024-08-06">, z.ZodLiteral<"gpt-4o-2024-05-13">, z.ZodLiteral<"gpt-4o-mini-2024-07-18">, z.ZodLiteral<"o1">, z.ZodLiteral<"o1-2024-12-17">, z.ZodLiteral<"o3">, z.ZodLiteral<"o3-2025-04-16">, z.ZodLiteral<"o4-mini">, z.ZodLiteral<"o4-mini-2025-04-16">, z.ZodLiteral<"gpt-4o-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-audio-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-realtime-preview-2024-10-01">, z.ZodLiteral<"gpt-4o-mini-audio-preview-2024-12-17">, z.ZodLiteral<"gpt-4o-mini-realtime-preview-2024-12-17">, z.ZodLiteral<"claude-3-5-sonnet-latest">, z.ZodLiteral<"claude-3-5-sonnet-20241022">, z.ZodLiteral<"claude-3-opus-20240229">, z.ZodLiteral<"claude-3-sonnet-20240229">, z.ZodLiteral<"claude-3-haiku-20240307">, z.ZodLiteral<"claude-opus-4.1">, z.ZodLiteral<"claude-opus-4">, z.ZodLiteral<"claude-sonnet-4">, z.ZodLiteral<"claude-sonnet-4-20250514">, z.ZodLiteral<"grok-3">, z.ZodLiteral<"grok-3-mini">, z.ZodLiteral<"gemini-2.5-pro">, z.ZodLiteral<"gemini-2.5-flash">, z.ZodLiteral<"gemini-2.5-pro-preview-06-05">, z.ZodLiteral<"gemini-2.5-pro-preview-05-06">, z.ZodLiteral<"gemini-2.5-pro-preview-03-25">, z.ZodLiteral<"gemini-2.5-flash-preview-05-20">, z.ZodLiteral<"gemini-2.5-flash-preview-04-17">, z.ZodLiteral<"gemini-2.5-flash-lite">, z.ZodLiteral<"gemini-2.5-pro-exp-03-25">, z.ZodLiteral<"gemini-2.0-flash-lite">, z.ZodLiteral<"gemini-2.0-flash">, z.ZodLiteral<"auto-large">, z.ZodLiteral<"auto-small">, z.ZodLiteral<"auto-micro">, z.ZodLiteral<"human">]>>;
210
+ model: z.ZodDefault<z.ZodString>;
183
211
  }, "strip", z.ZodTypeAny, {
184
212
  json_schema: Record<string, any>;
185
- model: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human";
186
- modality: "text" | "image" | "native" | "image+text";
213
+ model: string;
187
214
  image_resolution_dpi: number;
188
215
  browser_canvas: "A3" | "A4" | "A5";
189
216
  document?: any;
@@ -193,8 +220,7 @@ export declare const ZDocumentCreateInputRequest: z.ZodObject<{
193
220
  filename: string;
194
221
  url: string;
195
222
  } | Readable | Buffer<ArrayBufferLike>;
196
- model?: "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "chatgpt-4o-latest" | "gpt-5" | "gpt-5-2025-08-07" | "gpt-5-mini-2025-08-07" | "gpt-5-nano" | "gpt-5-nano-2025-08-07" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-mini-2025-04-14" | "gpt-4.1-2025-04-14" | "gpt-4.1-nano" | "gpt-4.1-nano-2025-04-14" | "gpt-4o-2024-11-20" | "gpt-4o-2024-08-06" | "gpt-4o-2024-05-13" | "gpt-4o-mini-2024-07-18" | "o1" | "o1-2024-12-17" | "o3" | "o3-2025-04-16" | "o4-mini" | "o4-mini-2025-04-16" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-mini-audio-preview-2024-12-17" | "gpt-4o-mini-realtime-preview-2024-12-17" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-opus-4.1" | "claude-opus-4" | "claude-sonnet-4" | "claude-sonnet-4-20250514" | "grok-3" | "grok-3-mini" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-pro-preview-06-05" | "gemini-2.5-pro-preview-05-06" | "gemini-2.5-pro-preview-03-25" | "gemini-2.5-flash-preview-05-20" | "gemini-2.5-flash-preview-04-17" | "gemini-2.5-flash-lite" | "gemini-2.5-pro-exp-03-25" | "gemini-2.0-flash-lite" | "gemini-2.0-flash" | "auto-large" | "auto-small" | "auto-micro" | "human" | undefined;
197
- modality?: "text" | "image" | "native" | "image+text" | undefined;
223
+ model?: string | undefined;
198
224
  image_resolution_dpi?: number | undefined;
199
225
  browser_canvas?: "A3" | "A4" | "A5" | undefined;
200
226
  }>;
@@ -216,7 +242,6 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
216
242
  model: z.ZodDefault<z.ZodString>;
217
243
  temperature: z.ZodDefault<z.ZodNumber>;
218
244
  reasoning_effort: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"minimal">, z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>>>;
219
- modality: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"text">, z.ZodLiteral<"image">, z.ZodLiteral<"native">, z.ZodLiteral<"image+text">]>>;
220
245
  instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
246
  image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
222
247
  browser_canvas: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"A3">, z.ZodLiteral<"A4">, z.ZodLiteral<"A5">]>>;
@@ -225,7 +250,6 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
225
250
  stream: boolean;
226
251
  model: string;
227
252
  temperature: number;
228
- modality: "text" | "image" | "native" | "image+text";
229
253
  reasoning_effort: "low" | "high" | "minimal" | "medium" | null;
230
254
  image_resolution_dpi: number;
231
255
  browser_canvas: "A3" | "A4" | "A5";
@@ -239,7 +263,6 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
239
263
  stream?: boolean | undefined;
240
264
  model?: string | undefined;
241
265
  temperature?: number | undefined;
242
- modality?: "text" | "image" | "native" | "image+text" | undefined;
243
266
  reasoning_effort?: "low" | "high" | "minimal" | "medium" | null | undefined;
244
267
  image_resolution_dpi?: number | undefined;
245
268
  browser_canvas?: "A3" | "A4" | "A5" | undefined;
@@ -251,16 +274,34 @@ export declare const ZBaseProject: z.ZodObject<{
251
274
  id: z.ZodString;
252
275
  name: z.ZodDefault<z.ZodString>;
253
276
  updated_at: z.ZodString;
277
+ sheets_integration: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
278
+ sheet_id: z.ZodString;
279
+ spreadsheet_id: z.ZodString;
280
+ }, "strip", z.ZodTypeAny, {
281
+ sheet_id: string;
282
+ spreadsheet_id: string;
283
+ }, {
284
+ sheet_id: string;
285
+ spreadsheet_id: string;
286
+ }>>>>;
254
287
  }, "strip", z.ZodTypeAny, {
255
288
  id: string;
256
289
  json_schema: Record<string, any>;
257
290
  name: string;
258
291
  updated_at: string;
292
+ sheets_integration?: {
293
+ sheet_id: string;
294
+ spreadsheet_id: string;
295
+ } | null | undefined;
259
296
  }, {
260
297
  id: string;
261
298
  json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
262
299
  updated_at: string;
263
300
  name?: string | undefined;
301
+ sheets_integration?: {
302
+ sheet_id: string;
303
+ spreadsheet_id: string;
304
+ } | null | undefined;
264
305
  }>;
265
306
  export type BaseProjectInput = z.input<typeof ZBaseProject>;
266
307
  export type BaseProject = z.output<typeof ZBaseProject>;
@@ -296,36 +337,18 @@ export declare const ZDocumentItem: z.ZodObject<{
296
337
  field_locations: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
297
338
  agentic_field_locations: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
298
339
  consensus_details: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">>>;
299
- api_cost: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
300
- value: z.ZodNumber;
301
- currency: z.ZodDefault<z.ZodString>;
302
- }, "strip", z.ZodTypeAny, {
303
- value: number;
304
- currency: string;
305
- }, {
306
- value: number;
307
- currency?: string | undefined;
308
- }>>>>;
309
340
  }, "strip", z.ZodTypeAny, {
310
341
  extraction_id?: string | null | undefined;
311
342
  likelihoods?: Record<string, any> | null | undefined;
312
343
  field_locations?: Record<string, any> | null | undefined;
313
344
  agentic_field_locations?: Record<string, any> | null | undefined;
314
345
  consensus_details?: Record<string, any>[] | null | undefined;
315
- api_cost?: {
316
- value: number;
317
- currency: string;
318
- } | null | undefined;
319
346
  }, {
320
347
  extraction_id?: string | null | undefined;
321
348
  likelihoods?: Record<string, any> | null | undefined;
322
349
  field_locations?: Record<string, any> | null | undefined;
323
350
  agentic_field_locations?: Record<string, any> | null | undefined;
324
351
  consensus_details?: Record<string, any>[] | null | undefined;
325
- api_cost?: {
326
- value: number;
327
- currency?: string | undefined;
328
- } | null | undefined;
329
352
  }>>>>;
330
353
  playground_extraction: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
331
354
  playground_extraction_metadata: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
@@ -334,36 +357,18 @@ export declare const ZDocumentItem: z.ZodObject<{
334
357
  field_locations: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
335
358
  agentic_field_locations: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
336
359
  consensus_details: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">>>;
337
- api_cost: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
338
- value: z.ZodNumber;
339
- currency: z.ZodDefault<z.ZodString>;
340
- }, "strip", z.ZodTypeAny, {
341
- value: number;
342
- currency: string;
343
- }, {
344
- value: number;
345
- currency?: string | undefined;
346
- }>>>>;
347
360
  }, "strip", z.ZodTypeAny, {
348
361
  extraction_id?: string | null | undefined;
349
362
  likelihoods?: Record<string, any> | null | undefined;
350
363
  field_locations?: Record<string, any> | null | undefined;
351
364
  agentic_field_locations?: Record<string, any> | null | undefined;
352
365
  consensus_details?: Record<string, any>[] | null | undefined;
353
- api_cost?: {
354
- value: number;
355
- currency: string;
356
- } | null | undefined;
357
366
  }, {
358
367
  extraction_id?: string | null | undefined;
359
368
  likelihoods?: Record<string, any> | null | undefined;
360
369
  field_locations?: Record<string, any> | null | undefined;
361
370
  agentic_field_locations?: Record<string, any> | null | undefined;
362
371
  consensus_details?: Record<string, any>[] | null | undefined;
363
- api_cost?: {
364
- value: number;
365
- currency?: string | undefined;
366
- } | null | undefined;
367
372
  }>>>>;
368
373
  }, "strip", z.ZodTypeAny, {
369
374
  annotation: Record<string, any>;
@@ -375,10 +380,6 @@ export declare const ZDocumentItem: z.ZodObject<{
375
380
  field_locations?: Record<string, any> | null | undefined;
376
381
  agentic_field_locations?: Record<string, any> | null | undefined;
377
382
  consensus_details?: Record<string, any>[] | null | undefined;
378
- api_cost?: {
379
- value: number;
380
- currency: string;
381
- } | null | undefined;
382
383
  } | null | undefined;
383
384
  playground_extraction_metadata?: {
384
385
  extraction_id?: string | null | undefined;
@@ -386,10 +387,6 @@ export declare const ZDocumentItem: z.ZodObject<{
386
387
  field_locations?: Record<string, any> | null | undefined;
387
388
  agentic_field_locations?: Record<string, any> | null | undefined;
388
389
  consensus_details?: Record<string, any>[] | null | undefined;
389
- api_cost?: {
390
- value: number;
391
- currency: string;
392
- } | null | undefined;
393
390
  } | null | undefined;
394
391
  }, {
395
392
  mime_data: string | {
@@ -403,10 +400,6 @@ export declare const ZDocumentItem: z.ZodObject<{
403
400
  field_locations?: Record<string, any> | null | undefined;
404
401
  agentic_field_locations?: Record<string, any> | null | undefined;
405
402
  consensus_details?: Record<string, any>[] | null | undefined;
406
- api_cost?: {
407
- value: number;
408
- currency?: string | undefined;
409
- } | null | undefined;
410
403
  } | null | undefined;
411
404
  playground_extraction?: Record<string, any> | undefined;
412
405
  playground_extraction_metadata?: {
@@ -415,14 +408,11 @@ export declare const ZDocumentItem: z.ZodObject<{
415
408
  field_locations?: Record<string, any> | null | undefined;
416
409
  agentic_field_locations?: Record<string, any> | null | undefined;
417
410
  consensus_details?: Record<string, any>[] | null | undefined;
418
- api_cost?: {
419
- value: number;
420
- currency?: string | undefined;
421
- } | null | undefined;
422
411
  } | null | undefined;
423
412
  }>;
424
413
  export type DocumentItemInput = z.input<typeof ZDocumentItem>;
425
414
  export type DocumentItem = z.output<typeof ZDocumentItem>;
415
+ export declare const ZProjectLoose: z.ZodType<generated.Project>;
426
416
  export declare const ZModel: z.ZodLazy<z.ZodObject<{
427
417
  id: z.ZodString;
428
418
  created: z.ZodNumber;
@@ -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;AAKzB,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,CAAC,EAAE,EAClB,CAAC,CAAC,UAAU,EACZ;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;CAAE,CAC9B,CAEA;AAGD,MAAM,MAAM,MAAM,GAAG;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CA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C,CAAC;AAErF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAI1D,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAG5C,CAAC;AAEZ,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;GAKf,CAAC;AACL,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC"}
package/dist/types.js CHANGED
@@ -6,6 +6,7 @@ import * as z from "zod";
6
6
  import { inferFileInfo } from "./mime";
7
7
  import fs from "fs";
8
8
  import { zodToJsonSchema } from 'zod-to-json-schema';
9
+ export * from "./schema_types";
9
10
  export function dataArray(schema) {
10
11
  return z.object({ data: z.array(schema) }).transform((input) => input.data);
11
12
  }
@@ -65,9 +66,19 @@ export const ZJSONSchema = z.union([
65
66
  }
66
67
  });
67
68
  export const ZDocumentExtractRequest = z.object({
68
- ...(({ document, stream, ...rest }) => rest)(generated.ZDocumentExtractRequest.schema.shape),
69
- documents: z.array(ZMIMEData),
69
+ // Keep everything except stream; allow both document and documents on input
70
+ ...(({ stream, ...rest }) => rest)(generated.ZDocumentExtractRequest.schema.shape),
71
+ // Accept a single document and make documents optional with a default
72
+ document: ZMIMEData.optional(),
73
+ documents: z.array(ZMIMEData).default([]),
74
+ // Normalize json_schema inputs (paths/zod instances)
70
75
  json_schema: ZJSONSchema,
76
+ }).transform((input) => {
77
+ const { document, documents, ...rest } = input;
78
+ if (document && (!documents || documents.length === 0)) {
79
+ return { ...rest, documents: [document] };
80
+ }
81
+ return { ...rest, documents: documents || [] };
71
82
  });
72
83
  export const ZParseRequest = z.object({
73
84
  ...generated.ZParseRequest.schema.shape,
@@ -98,6 +109,11 @@ export const ZDocumentItem = z.object({
98
109
  ...generated.ZDocumentItem.schema.shape,
99
110
  mime_data: ZMIMEData,
100
111
  });
112
+ // Looser project schema to handle backends that omit arrays by default
113
+ export const ZProjectLoose = z.lazy(() => (generated.ZBaseProject.schema).merge(z.object({
114
+ documents: z.array(generated.ZProjectDocument).default([]),
115
+ iterations: z.array(generated.ZIteration).default([]),
116
+ })));
101
117
  export const ZModel = z.lazy(() => (z.object({
102
118
  id: z.string(),
103
119
  created: z.number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retab/node",
3
- "version": "1.0.58",
3
+ "version": "1.0.63",
4
4
  "description": "Retab official Node.js library",
5
5
  "main": "dist/index.js",
6
6
  "exports": {