@retab/node 1.0.96 → 1.0.99
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 +39 -42
- package/dist/api/client.d.ts +4 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +4 -2
- package/dist/api/documents/client.d.ts +17 -11
- package/dist/api/documents/client.d.ts.map +1 -1
- package/dist/api/documents/client.js +85 -38
- package/dist/api/edit/agent/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 +1 -75
- package/dist/api/edit/templates/client.d.ts.map +1 -1
- package/dist/api/edit/templates/client.js +3 -130
- package/dist/api/evals/classify/client.d.ts +20 -0
- package/dist/api/evals/classify/client.d.ts.map +1 -0
- package/dist/api/evals/classify/client.js +25 -0
- package/dist/api/evals/client.d.ts +11 -0
- package/dist/api/evals/client.d.ts.map +1 -0
- package/dist/api/evals/client.js +12 -0
- package/dist/api/evals/extract/client.d.ts +287 -0
- package/dist/api/evals/extract/client.d.ts.map +1 -0
- package/dist/api/evals/extract/client.js +56 -0
- package/dist/api/evals/helpers.d.ts +30 -0
- package/dist/api/evals/helpers.d.ts.map +1 -0
- package/dist/api/evals/helpers.js +46 -0
- package/dist/api/evals/schemas.d.ts +6522 -0
- package/dist/api/evals/schemas.d.ts.map +1 -0
- package/dist/api/evals/schemas.js +219 -0
- package/dist/api/evals/split/client.d.ts +105 -0
- package/dist/api/evals/split/client.d.ts.map +1 -0
- package/dist/api/evals/split/client.js +28 -0
- package/dist/api/extractions/client.d.ts +3 -43
- package/dist/api/extractions/client.d.ts.map +1 -1
- package/dist/api/extractions/client.js +6 -67
- package/dist/api/files/client.d.ts +9 -1
- package/dist/api/files/client.d.ts.map +1 -1
- package/dist/api/files/client.js +11 -5
- package/dist/api/jobs/client.d.ts +12 -10
- package/dist/api/jobs/client.d.ts.map +1 -1
- package/dist/api/jobs/client.js +13 -17
- package/dist/api/models/client.d.ts +3 -10
- package/dist/api/models/client.d.ts.map +1 -1
- package/dist/api/models/client.js +9 -8
- package/dist/api/projects/client.d.ts +1640 -4
- package/dist/api/projects/client.d.ts.map +1 -1
- package/dist/api/projects/client.js +457 -28
- package/dist/api/schemas/client.d.ts +3 -0
- package/dist/api/schemas/client.d.ts.map +1 -1
- package/dist/api/schemas/client.js +1 -1
- package/dist/api/workflows/blocks/client.d.ts +67 -0
- package/dist/api/workflows/blocks/client.d.ts.map +1 -0
- package/dist/api/workflows/blocks/client.js +132 -0
- package/dist/api/workflows/client.d.ts +90 -2
- package/dist/api/workflows/client.d.ts.map +1 -1
- package/dist/api/workflows/client.js +153 -1
- package/dist/api/workflows/edges/client.d.ts +66 -0
- package/dist/api/workflows/edges/client.d.ts.map +1 -0
- package/dist/api/workflows/edges/client.js +120 -0
- package/dist/api/workflows/runs/client.d.ts +57 -113
- package/dist/api/workflows/runs/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/client.js +118 -119
- package/dist/api/workflows/runs/steps/client.d.ts +35 -13
- package/dist/api/workflows/runs/steps/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/steps/client.js +63 -15
- package/dist/client.d.ts +4 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +79 -5
- package/dist/generated_types.d.ts +7778 -2745
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +711 -70
- package/dist/mime.d.ts.map +1 -1
- package/dist/mime.js +11 -1
- package/dist/schema_types.d.ts +2 -2
- package/dist/schema_types.d.ts.map +1 -1
- package/dist/schema_types.js +2 -2
- package/dist/types.d.ts +655 -109
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +84 -14
- package/package.json +1 -1
package/dist/api/files/client.js
CHANGED
|
@@ -18,7 +18,10 @@ const ZFileLink = z.object({
|
|
|
18
18
|
const ZUploadFileResponse = z.object({
|
|
19
19
|
fileId: z.string(),
|
|
20
20
|
filename: z.string(),
|
|
21
|
-
})
|
|
21
|
+
}).transform((value) => ({
|
|
22
|
+
...value,
|
|
23
|
+
file_id: value.fileId,
|
|
24
|
+
}));
|
|
22
25
|
export default class APIFiles extends CompositionClient {
|
|
23
26
|
constructor(client) {
|
|
24
27
|
super(client);
|
|
@@ -26,7 +29,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
26
29
|
async upload(mimeData, options) {
|
|
27
30
|
const parsed = await ZMIMEData.parseAsync(mimeData);
|
|
28
31
|
return this._fetchJson(ZUploadFileResponse, {
|
|
29
|
-
url: "/
|
|
32
|
+
url: "/files/upload",
|
|
30
33
|
method: "POST",
|
|
31
34
|
body: { mimeData: parsed, ...(options?.body || {}) },
|
|
32
35
|
params: options?.params,
|
|
@@ -45,7 +48,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
45
48
|
};
|
|
46
49
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
47
50
|
return this._fetchJson(ZPaginatedList, {
|
|
48
|
-
url: "/
|
|
51
|
+
url: "/files",
|
|
49
52
|
method: "GET",
|
|
50
53
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
51
54
|
headers: options?.headers,
|
|
@@ -53,7 +56,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
53
56
|
}
|
|
54
57
|
async get(fileId, options) {
|
|
55
58
|
return this._fetchJson(ZFile, {
|
|
56
|
-
url: `/
|
|
59
|
+
url: `/files/${fileId}`,
|
|
57
60
|
method: "GET",
|
|
58
61
|
params: options?.params,
|
|
59
62
|
headers: options?.headers,
|
|
@@ -61,10 +64,13 @@ export default class APIFiles extends CompositionClient {
|
|
|
61
64
|
}
|
|
62
65
|
async getDownloadLink(fileId, options) {
|
|
63
66
|
return this._fetchJson(ZFileLink, {
|
|
64
|
-
url: `/
|
|
67
|
+
url: `/files/${fileId}/download-link`,
|
|
65
68
|
method: "GET",
|
|
66
69
|
params: options?.params,
|
|
67
70
|
headers: options?.headers,
|
|
68
71
|
});
|
|
69
72
|
}
|
|
73
|
+
async get_download_link(fileId, options) {
|
|
74
|
+
return this.getDownloadLink(fileId, options);
|
|
75
|
+
}
|
|
70
76
|
}
|
|
@@ -3,7 +3,7 @@ import * as z from "zod";
|
|
|
3
3
|
type JobStatus = "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
4
4
|
type JobListSource = "api" | "project" | "workflow";
|
|
5
5
|
type JobListOrder = "asc" | "desc";
|
|
6
|
-
type SupportedEndpoint =
|
|
6
|
+
type SupportedEndpoint = string;
|
|
7
7
|
declare const ZJobResponse: z.ZodObject<{
|
|
8
8
|
status_code: z.ZodNumber;
|
|
9
9
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -33,7 +33,7 @@ declare const ZJob: z.ZodObject<{
|
|
|
33
33
|
id: z.ZodString;
|
|
34
34
|
object: z.ZodLiteral<"job">;
|
|
35
35
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
36
|
-
endpoint: z.
|
|
36
|
+
endpoint: z.ZodString;
|
|
37
37
|
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
38
38
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
39
|
status_code: z.ZodNumber;
|
|
@@ -70,7 +70,7 @@ declare const ZJob: z.ZodObject<{
|
|
|
70
70
|
id: string;
|
|
71
71
|
organization_id: string;
|
|
72
72
|
created_at: number;
|
|
73
|
-
endpoint:
|
|
73
|
+
endpoint: string;
|
|
74
74
|
expires_at: number;
|
|
75
75
|
metadata?: Record<string, string> | null | undefined;
|
|
76
76
|
request?: Record<string, any> | null | undefined;
|
|
@@ -91,7 +91,7 @@ declare const ZJob: z.ZodObject<{
|
|
|
91
91
|
id: string;
|
|
92
92
|
organization_id: string;
|
|
93
93
|
created_at: number;
|
|
94
|
-
endpoint:
|
|
94
|
+
endpoint: string;
|
|
95
95
|
expires_at: number;
|
|
96
96
|
metadata?: Record<string, string> | null | undefined;
|
|
97
97
|
request?: Record<string, any> | null | undefined;
|
|
@@ -114,7 +114,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
114
114
|
id: z.ZodString;
|
|
115
115
|
object: z.ZodLiteral<"job">;
|
|
116
116
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
117
|
-
endpoint: z.
|
|
117
|
+
endpoint: z.ZodString;
|
|
118
118
|
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
119
119
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
120
120
|
status_code: z.ZodNumber;
|
|
@@ -151,7 +151,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
151
151
|
id: string;
|
|
152
152
|
organization_id: string;
|
|
153
153
|
created_at: number;
|
|
154
|
-
endpoint:
|
|
154
|
+
endpoint: string;
|
|
155
155
|
expires_at: number;
|
|
156
156
|
metadata?: Record<string, string> | null | undefined;
|
|
157
157
|
request?: Record<string, any> | null | undefined;
|
|
@@ -172,7 +172,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
172
172
|
id: string;
|
|
173
173
|
organization_id: string;
|
|
174
174
|
created_at: number;
|
|
175
|
-
endpoint:
|
|
175
|
+
endpoint: string;
|
|
176
176
|
expires_at: number;
|
|
177
177
|
metadata?: Record<string, string> | null | undefined;
|
|
178
178
|
request?: Record<string, any> | null | undefined;
|
|
@@ -199,7 +199,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
199
199
|
id: string;
|
|
200
200
|
organization_id: string;
|
|
201
201
|
created_at: number;
|
|
202
|
-
endpoint:
|
|
202
|
+
endpoint: string;
|
|
203
203
|
expires_at: number;
|
|
204
204
|
metadata?: Record<string, string> | null | undefined;
|
|
205
205
|
request?: Record<string, any> | null | undefined;
|
|
@@ -226,7 +226,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
226
226
|
id: string;
|
|
227
227
|
organization_id: string;
|
|
228
228
|
created_at: number;
|
|
229
|
-
endpoint:
|
|
229
|
+
endpoint: string;
|
|
230
230
|
expires_at: number;
|
|
231
231
|
metadata?: Record<string, string> | null | undefined;
|
|
232
232
|
request?: Record<string, any> | null | undefined;
|
|
@@ -262,7 +262,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
262
262
|
/**
|
|
263
263
|
* Create a new asynchronous job.
|
|
264
264
|
*
|
|
265
|
-
* @param endpoint - The API endpoint to call ("/
|
|
265
|
+
* @param endpoint - The API endpoint to call ("/documents/extract" or "/documents/parse")
|
|
266
266
|
* @param request - The full request body for the target endpoint
|
|
267
267
|
* @param metadata - Optional metadata (max 16 pairs; keys ≤64 chars, values ≤512 chars)
|
|
268
268
|
*/
|
|
@@ -279,10 +279,12 @@ export default class APIJobs extends CompositionClient {
|
|
|
279
279
|
* Retrieve a job by ID including full request and response payloads.
|
|
280
280
|
*/
|
|
281
281
|
retrieveFull(job_id: string, options?: RequestOptions): Promise<Job>;
|
|
282
|
+
retrieve_full(job_id: string, options?: RequestOptions): Promise<Job>;
|
|
282
283
|
/**
|
|
283
284
|
* Poll a job until terminal status, then fetch final payload once.
|
|
284
285
|
*/
|
|
285
286
|
waitForCompletion(job_id: string, options?: JobWaitForCompletionOptions): Promise<Job>;
|
|
287
|
+
wait_for_completion(job_id: string, options?: JobWaitForCompletionOptions): Promise<Job>;
|
|
286
288
|
/**
|
|
287
289
|
* Cancel a queued or in-progress job.
|
|
288
290
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/jobs/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,KAAK,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG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QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KACzB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;CAoC9D;AAED,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AAClH,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,CAAC"}
|
package/dist/api/jobs/client.js
CHANGED
|
@@ -16,17 +16,7 @@ const ZJob = z.object({
|
|
|
16
16
|
id: z.string(),
|
|
17
17
|
object: z.literal("job"),
|
|
18
18
|
status: z.enum(["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]),
|
|
19
|
-
endpoint: z.
|
|
20
|
-
"/v1/documents/extract",
|
|
21
|
-
"/v1/documents/parse",
|
|
22
|
-
"/v1/documents/split",
|
|
23
|
-
"/v1/documents/classify",
|
|
24
|
-
"/v1/schemas/generate",
|
|
25
|
-
"/v1/edit/agent/fill",
|
|
26
|
-
"/v1/edit/templates/fill",
|
|
27
|
-
"/v1/edit/templates/generate",
|
|
28
|
-
"/v1/projects/extract",
|
|
29
|
-
]),
|
|
19
|
+
endpoint: z.string(),
|
|
30
20
|
request: z.record(z.any()).nullable().optional(),
|
|
31
21
|
response: ZJobResponse.nullable().optional(),
|
|
32
22
|
error: ZJobError.nullable().optional(),
|
|
@@ -52,7 +42,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
52
42
|
/**
|
|
53
43
|
* Create a new asynchronous job.
|
|
54
44
|
*
|
|
55
|
-
* @param endpoint - The API endpoint to call ("/
|
|
45
|
+
* @param endpoint - The API endpoint to call ("/documents/extract" or "/documents/parse")
|
|
56
46
|
* @param request - The full request body for the target endpoint
|
|
57
47
|
* @param metadata - Optional metadata (max 16 pairs; keys ≤64 chars, values ≤512 chars)
|
|
58
48
|
*/
|
|
@@ -64,7 +54,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
64
54
|
if (metadata !== undefined)
|
|
65
55
|
body.metadata = metadata;
|
|
66
56
|
return this._fetchJson(ZJob, {
|
|
67
|
-
url: "/
|
|
57
|
+
url: "/jobs",
|
|
68
58
|
method: "POST",
|
|
69
59
|
body: { ...body, ...(options?.body || {}) },
|
|
70
60
|
params: options?.params,
|
|
@@ -83,7 +73,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
83
73
|
include_response,
|
|
84
74
|
};
|
|
85
75
|
return this._fetchJson(ZJob, {
|
|
86
|
-
url: `/
|
|
76
|
+
url: `/jobs/${job_id}`,
|
|
87
77
|
method: "GET",
|
|
88
78
|
params,
|
|
89
79
|
headers: options?.headers,
|
|
@@ -99,6 +89,9 @@ export default class APIJobs extends CompositionClient {
|
|
|
99
89
|
include_response: true,
|
|
100
90
|
});
|
|
101
91
|
}
|
|
92
|
+
async retrieve_full(job_id, options) {
|
|
93
|
+
return this.retrieveFull(job_id, options);
|
|
94
|
+
}
|
|
102
95
|
/**
|
|
103
96
|
* Poll a job until terminal status, then fetch final payload once.
|
|
104
97
|
*/
|
|
@@ -138,12 +131,15 @@ export default class APIJobs extends CompositionClient {
|
|
|
138
131
|
await new Promise((resolve) => setTimeout(resolve, sleep_for_ms));
|
|
139
132
|
}
|
|
140
133
|
}
|
|
134
|
+
async wait_for_completion(job_id, options = {}) {
|
|
135
|
+
return this.waitForCompletion(job_id, options);
|
|
136
|
+
}
|
|
141
137
|
/**
|
|
142
138
|
* Cancel a queued or in-progress job.
|
|
143
139
|
*/
|
|
144
140
|
async cancel(job_id, options) {
|
|
145
141
|
return this._fetchJson(ZJob, {
|
|
146
|
-
url: `/
|
|
142
|
+
url: `/jobs/${job_id}/cancel`,
|
|
147
143
|
method: "POST",
|
|
148
144
|
params: options?.params,
|
|
149
145
|
headers: options?.headers,
|
|
@@ -154,7 +150,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
154
150
|
*/
|
|
155
151
|
async retry(job_id, options) {
|
|
156
152
|
return this._fetchJson(ZJob, {
|
|
157
|
-
url: `/
|
|
153
|
+
url: `/jobs/${job_id}/retry`,
|
|
158
154
|
method: "POST",
|
|
159
155
|
params: options?.params,
|
|
160
156
|
headers: options?.headers,
|
|
@@ -189,7 +185,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
189
185
|
// Remove undefined values
|
|
190
186
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
191
187
|
return this._fetchJson(ZJobListResponse, {
|
|
192
|
-
url: "/
|
|
188
|
+
url: "/jobs",
|
|
193
189
|
method: "GET",
|
|
194
190
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
195
191
|
headers: options?.headers,
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { CompositionClient, RequestOptions } from "../../client.js";
|
|
2
|
+
import { Model } from "../../types.js";
|
|
2
3
|
export default class APIModels extends CompositionClient {
|
|
3
|
-
|
|
4
|
-
list(params?: {
|
|
4
|
+
list({ supports_finetuning, supports_image, include_finetuned_models, }?: {
|
|
5
5
|
supports_finetuning?: boolean;
|
|
6
6
|
supports_image?: boolean;
|
|
7
7
|
include_finetuned_models?: boolean;
|
|
8
|
-
}, options?: RequestOptions): Promise<
|
|
9
|
-
data: {
|
|
10
|
-
object: "model";
|
|
11
|
-
id: string;
|
|
12
|
-
created: number;
|
|
13
|
-
owned_by: string;
|
|
14
|
-
}[];
|
|
15
|
-
}>;
|
|
8
|
+
}, options?: RequestOptions): Promise<Model[]>;
|
|
16
9
|
}
|
|
17
10
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/models/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/models/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAa,KAAK,EAAU,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,iBAAiB;IAC9C,IAAI,CAAC,EACP,mBAA2B,EAC3B,cAAsB,EACtB,wBAA+B,GAClC,GAAE;QACC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACjC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAatD"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { CompositionClient } from "../../client.js";
|
|
2
|
-
import { ZModel } from "../../types.js";
|
|
3
|
-
import * as z from "zod";
|
|
2
|
+
import { dataArray, ZModel } from "../../types.js";
|
|
4
3
|
export default class APIModels extends CompositionClient {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
async list(params, options) {
|
|
9
|
-
return this._fetchJson(z.object({ data: z.array(ZModel) }), {
|
|
4
|
+
async list({ supports_finetuning = false, supports_image = false, include_finetuned_models = true, } = {}, options) {
|
|
5
|
+
return this._fetchJson(dataArray(ZModel), {
|
|
10
6
|
url: "/v1/models",
|
|
11
7
|
method: "GET",
|
|
12
|
-
params: {
|
|
8
|
+
params: {
|
|
9
|
+
supports_finetuning,
|
|
10
|
+
supports_image,
|
|
11
|
+
include_finetuned_models,
|
|
12
|
+
...(options?.params || {}),
|
|
13
|
+
},
|
|
13
14
|
headers: options?.headers,
|
|
14
15
|
});
|
|
15
16
|
}
|