@retab/node 1.0.87 → 1.0.91
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 +1 -1
- package/dist/api/extractions/client.d.ts +4 -8
- package/dist/api/extractions/client.d.ts.map +1 -1
- package/dist/api/extractions/client.js +4 -11
- package/dist/api/jobs/client.d.ts +54 -12
- package/dist/api/jobs/client.d.ts.map +1 -1
- package/dist/api/jobs/client.js +88 -4
- package/dist/api/projects/client.d.ts +1 -4
- package/dist/api/projects/client.d.ts.map +1 -1
- package/dist/api/projects/client.js +1 -7
- package/dist/api/workflows/runs/client.d.ts +171 -1
- package/dist/api/workflows/runs/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/client.js +233 -6
- package/dist/api/workflows/runs/steps/client.d.ts +46 -0
- package/dist/api/workflows/runs/steps/client.d.ts.map +1 -0
- package/dist/api/workflows/runs/steps/client.js +62 -0
- package/dist/generated_types.d.ts +16346 -5904
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +408 -39
- package/dist/types.d.ts +5 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CompositionClient, RequestOptions } from "../../client.js";
|
|
2
2
|
import { PaginatedList } from "../../types.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
-
type HumanReviewStatus = "success" | "review_required" | "reviewed";
|
|
5
4
|
declare const ZDownloadResponse: z.ZodObject<{
|
|
6
5
|
download_url: z.ZodString;
|
|
7
6
|
filename: z.ZodString;
|
|
@@ -23,7 +22,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
23
22
|
/**
|
|
24
23
|
* List extractions with pagination and filtering.
|
|
25
24
|
*/
|
|
26
|
-
list({ before, after, limit, order, origin_dot_type, origin_dot_id, from_date, to_date,
|
|
25
|
+
list({ before, after, limit, order, origin_dot_type, origin_dot_id, from_date, to_date, metadata, filename, }?: {
|
|
27
26
|
before?: string;
|
|
28
27
|
after?: string;
|
|
29
28
|
limit?: number;
|
|
@@ -32,19 +31,17 @@ export default class APIExtractions extends CompositionClient {
|
|
|
32
31
|
origin_dot_id?: string;
|
|
33
32
|
from_date?: Date;
|
|
34
33
|
to_date?: Date;
|
|
35
|
-
human_review_status?: HumanReviewStatus;
|
|
36
34
|
metadata?: Record<string, string>;
|
|
37
35
|
filename?: string;
|
|
38
36
|
}, options?: RequestOptions): Promise<PaginatedList>;
|
|
39
37
|
/**
|
|
40
|
-
* Download extractions in various formats.
|
|
38
|
+
* Download extractions in various formats.
|
|
41
39
|
*/
|
|
42
|
-
download({ order, origin_dot_id, from_date, to_date,
|
|
40
|
+
download({ order, origin_dot_id, from_date, to_date, metadata, filename, format, }?: {
|
|
43
41
|
order?: "asc" | "desc";
|
|
44
42
|
origin_dot_id?: string;
|
|
45
43
|
from_date?: Date;
|
|
46
44
|
to_date?: Date;
|
|
47
|
-
human_review_status?: HumanReviewStatus;
|
|
48
45
|
metadata?: Record<string, string>;
|
|
49
46
|
filename?: string;
|
|
50
47
|
format?: "jsonl" | "csv" | "xlsx";
|
|
@@ -52,10 +49,9 @@ export default class APIExtractions extends CompositionClient {
|
|
|
52
49
|
/**
|
|
53
50
|
* Update an extraction.
|
|
54
51
|
*/
|
|
55
|
-
update(extraction_id: string, { predictions, predictions_draft,
|
|
52
|
+
update(extraction_id: string, { predictions, predictions_draft, json_schema, inference_settings, metadata, }: {
|
|
56
53
|
predictions?: Record<string, any>;
|
|
57
54
|
predictions_draft?: Record<string, any>;
|
|
58
|
-
human_review_status?: HumanReviewStatus;
|
|
59
55
|
json_schema?: Record<string, any>;
|
|
60
56
|
inference_settings?: Record<string, any>;
|
|
61
57
|
metadata?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/extractions/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,E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OAEG;IACG,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ/E"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CompositionClient } from "../../client.js";
|
|
2
2
|
import { ZPaginatedList } from "../../types.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
-
// Response types for extractions API
|
|
5
4
|
const ZDownloadResponse = z.object({
|
|
6
5
|
download_url: z.string(),
|
|
7
6
|
filename: z.string(),
|
|
@@ -16,7 +15,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
16
15
|
/**
|
|
17
16
|
* List extractions with pagination and filtering.
|
|
18
17
|
*/
|
|
19
|
-
async list({ before, after, limit = 10, order = "desc", origin_dot_type, origin_dot_id, from_date, to_date,
|
|
18
|
+
async list({ before, after, limit = 10, order = "desc", origin_dot_type, origin_dot_id, from_date, to_date, metadata, filename, } = {}, options) {
|
|
20
19
|
const params = {
|
|
21
20
|
before,
|
|
22
21
|
after,
|
|
@@ -26,12 +25,10 @@ export default class APIExtractions extends CompositionClient {
|
|
|
26
25
|
origin_dot_id,
|
|
27
26
|
from_date: from_date?.toISOString(),
|
|
28
27
|
to_date: to_date?.toISOString(),
|
|
29
|
-
human_review_status,
|
|
30
28
|
filename,
|
|
31
29
|
// Note: metadata must be JSON-serialized as the backend expects a JSON string
|
|
32
30
|
metadata: metadata ? JSON.stringify(metadata) : undefined,
|
|
33
31
|
};
|
|
34
|
-
// Remove undefined values
|
|
35
32
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
36
33
|
return this._fetchJson(ZPaginatedList, {
|
|
37
34
|
url: "/v1/extractions",
|
|
@@ -41,21 +38,19 @@ export default class APIExtractions extends CompositionClient {
|
|
|
41
38
|
});
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
|
-
* Download extractions in various formats.
|
|
41
|
+
* Download extractions in various formats.
|
|
45
42
|
*/
|
|
46
|
-
async download({ order = "desc", origin_dot_id, from_date, to_date,
|
|
43
|
+
async download({ order = "desc", origin_dot_id, from_date, to_date, metadata, filename, format = "jsonl", } = {}, options) {
|
|
47
44
|
const params = {
|
|
48
45
|
order,
|
|
49
46
|
origin_dot_id,
|
|
50
47
|
from_date: from_date?.toISOString(),
|
|
51
48
|
to_date: to_date?.toISOString(),
|
|
52
|
-
human_review_status,
|
|
53
49
|
filename,
|
|
54
50
|
format,
|
|
55
51
|
// Note: metadata must be JSON-serialized as the backend expects a JSON string
|
|
56
52
|
metadata: metadata ? JSON.stringify(metadata) : undefined,
|
|
57
53
|
};
|
|
58
|
-
// Remove undefined values
|
|
59
54
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
60
55
|
return this._fetchJson(ZDownloadResponse, {
|
|
61
56
|
url: "/v1/extractions/download",
|
|
@@ -67,14 +62,12 @@ export default class APIExtractions extends CompositionClient {
|
|
|
67
62
|
/**
|
|
68
63
|
* Update an extraction.
|
|
69
64
|
*/
|
|
70
|
-
async update(extraction_id, { predictions, predictions_draft,
|
|
65
|
+
async update(extraction_id, { predictions, predictions_draft, json_schema, inference_settings, metadata, }, options) {
|
|
71
66
|
const body = {};
|
|
72
67
|
if (predictions !== undefined)
|
|
73
68
|
body.predictions = predictions;
|
|
74
69
|
if (predictions_draft !== undefined)
|
|
75
70
|
body.predictions_draft = predictions_draft;
|
|
76
|
-
if (human_review_status !== undefined)
|
|
77
|
-
body.human_review_status = human_review_status;
|
|
78
71
|
if (json_schema !== undefined)
|
|
79
72
|
body.json_schema = json_schema;
|
|
80
73
|
if (inference_settings !== undefined)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CompositionClient, RequestOptions } from "../../client.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
type JobStatus = "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
4
|
+
type JobListSource = "api" | "project" | "workflow";
|
|
5
|
+
type JobListOrder = "asc" | "desc";
|
|
4
6
|
type SupportedEndpoint = "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
5
7
|
declare const ZJobResponse: z.ZodObject<{
|
|
6
8
|
status_code: z.ZodNumber;
|
|
@@ -32,7 +34,7 @@ declare const ZJob: z.ZodObject<{
|
|
|
32
34
|
object: z.ZodLiteral<"job">;
|
|
33
35
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
34
36
|
endpoint: z.ZodEnum<["/v1/documents/extract", "/v1/documents/parse", "/v1/documents/split", "/v1/documents/classify", "/v1/schemas/generate", "/v1/edit/agent/fill", "/v1/edit/templates/fill", "/v1/edit/templates/generate", "/v1/projects/extract"]>;
|
|
35
|
-
request: z.ZodRecord<z.ZodString, z.ZodAny
|
|
37
|
+
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
36
38
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
37
39
|
status_code: z.ZodNumber;
|
|
38
40
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -67,11 +69,11 @@ declare const ZJob: z.ZodObject<{
|
|
|
67
69
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
68
70
|
id: string;
|
|
69
71
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
70
|
-
request: Record<string, any>;
|
|
71
72
|
created_at: number;
|
|
72
73
|
expires_at: number;
|
|
73
74
|
organization_id: string;
|
|
74
75
|
metadata?: Record<string, string> | null | undefined;
|
|
76
|
+
request?: Record<string, any> | null | undefined;
|
|
75
77
|
response?: {
|
|
76
78
|
status_code: number;
|
|
77
79
|
body: Record<string, any>;
|
|
@@ -88,11 +90,11 @@ declare const ZJob: z.ZodObject<{
|
|
|
88
90
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
89
91
|
id: string;
|
|
90
92
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
91
|
-
request: Record<string, any>;
|
|
92
93
|
created_at: number;
|
|
93
94
|
expires_at: number;
|
|
94
95
|
organization_id: string;
|
|
95
96
|
metadata?: Record<string, string> | null | undefined;
|
|
97
|
+
request?: Record<string, any> | null | undefined;
|
|
96
98
|
response?: {
|
|
97
99
|
status_code: number;
|
|
98
100
|
body: Record<string, any>;
|
|
@@ -113,7 +115,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
113
115
|
object: z.ZodLiteral<"job">;
|
|
114
116
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
115
117
|
endpoint: z.ZodEnum<["/v1/documents/extract", "/v1/documents/parse", "/v1/documents/split", "/v1/documents/classify", "/v1/schemas/generate", "/v1/edit/agent/fill", "/v1/edit/templates/fill", "/v1/edit/templates/generate", "/v1/projects/extract"]>;
|
|
116
|
-
request: z.ZodRecord<z.ZodString, z.ZodAny
|
|
118
|
+
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
117
119
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
118
120
|
status_code: z.ZodNumber;
|
|
119
121
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -148,11 +150,11 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
148
150
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
149
151
|
id: string;
|
|
150
152
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
151
|
-
request: Record<string, any>;
|
|
152
153
|
created_at: number;
|
|
153
154
|
expires_at: number;
|
|
154
155
|
organization_id: string;
|
|
155
156
|
metadata?: Record<string, string> | null | undefined;
|
|
157
|
+
request?: Record<string, any> | null | undefined;
|
|
156
158
|
response?: {
|
|
157
159
|
status_code: number;
|
|
158
160
|
body: Record<string, any>;
|
|
@@ -169,11 +171,11 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
169
171
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
170
172
|
id: string;
|
|
171
173
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
172
|
-
request: Record<string, any>;
|
|
173
174
|
created_at: number;
|
|
174
175
|
expires_at: number;
|
|
175
176
|
organization_id: string;
|
|
176
177
|
metadata?: Record<string, string> | null | undefined;
|
|
178
|
+
request?: Record<string, any> | null | undefined;
|
|
177
179
|
response?: {
|
|
178
180
|
status_code: number;
|
|
179
181
|
body: Record<string, any>;
|
|
@@ -196,11 +198,11 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
196
198
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
197
199
|
id: string;
|
|
198
200
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
199
|
-
request: Record<string, any>;
|
|
200
201
|
created_at: number;
|
|
201
202
|
expires_at: number;
|
|
202
203
|
organization_id: string;
|
|
203
204
|
metadata?: Record<string, string> | null | undefined;
|
|
205
|
+
request?: Record<string, any> | null | undefined;
|
|
204
206
|
response?: {
|
|
205
207
|
status_code: number;
|
|
206
208
|
body: Record<string, any>;
|
|
@@ -223,11 +225,11 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
223
225
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
224
226
|
id: string;
|
|
225
227
|
endpoint: "/v1/documents/extract" | "/v1/documents/parse" | "/v1/documents/split" | "/v1/documents/classify" | "/v1/schemas/generate" | "/v1/edit/agent/fill" | "/v1/edit/templates/fill" | "/v1/edit/templates/generate" | "/v1/projects/extract";
|
|
226
|
-
request: Record<string, any>;
|
|
227
228
|
created_at: number;
|
|
228
229
|
expires_at: number;
|
|
229
230
|
organization_id: string;
|
|
230
231
|
metadata?: Record<string, string> | null | undefined;
|
|
232
|
+
request?: Record<string, any> | null | undefined;
|
|
231
233
|
response?: {
|
|
232
234
|
status_code: number;
|
|
233
235
|
body: Record<string, any>;
|
|
@@ -245,6 +247,16 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
245
247
|
last_id?: string | null | undefined;
|
|
246
248
|
}>;
|
|
247
249
|
type JobListResponse = z.infer<typeof ZJobListResponse>;
|
|
250
|
+
type JobRetrieveOptions = RequestOptions & {
|
|
251
|
+
include_request?: boolean;
|
|
252
|
+
include_response?: boolean;
|
|
253
|
+
};
|
|
254
|
+
type JobWaitForCompletionOptions = RequestOptions & {
|
|
255
|
+
poll_interval_ms?: number;
|
|
256
|
+
timeout_ms?: number;
|
|
257
|
+
include_request?: boolean;
|
|
258
|
+
include_response?: boolean;
|
|
259
|
+
};
|
|
248
260
|
export default class APIJobs extends CompositionClient {
|
|
249
261
|
constructor(client: CompositionClient);
|
|
250
262
|
/**
|
|
@@ -262,19 +274,49 @@ export default class APIJobs extends CompositionClient {
|
|
|
262
274
|
/**
|
|
263
275
|
* Retrieve a job by ID.
|
|
264
276
|
*/
|
|
265
|
-
retrieve(job_id: string, options?:
|
|
277
|
+
retrieve(job_id: string, options?: JobRetrieveOptions): Promise<Job>;
|
|
278
|
+
/**
|
|
279
|
+
* Retrieve a job by ID including full request and response payloads.
|
|
280
|
+
*/
|
|
281
|
+
retrieveFull(job_id: string, options?: RequestOptions): Promise<Job>;
|
|
282
|
+
/**
|
|
283
|
+
* Poll a job until terminal status, then fetch final payload once.
|
|
284
|
+
*/
|
|
285
|
+
waitForCompletion(job_id: string, options?: JobWaitForCompletionOptions): Promise<Job>;
|
|
266
286
|
/**
|
|
267
287
|
* Cancel a queued or in-progress job.
|
|
268
288
|
*/
|
|
269
289
|
cancel(job_id: string, options?: RequestOptions): Promise<Job>;
|
|
270
290
|
/**
|
|
271
|
-
*
|
|
291
|
+
* Retry a failed, cancelled, or expired job.
|
|
272
292
|
*/
|
|
273
|
-
|
|
293
|
+
retry(job_id: string, options?: RequestOptions): Promise<Job>;
|
|
294
|
+
/**
|
|
295
|
+
* List jobs with pagination and optional filtering.
|
|
296
|
+
*/
|
|
297
|
+
list({ before, after, limit, order, id, status, endpoint, source, project_id, workflow_id, workflow_node_id, model, filename_regex, filename_contains, document_type, from_date, to_date, metadata, include_request, include_response, }?: {
|
|
298
|
+
before?: string;
|
|
274
299
|
after?: string;
|
|
275
300
|
limit?: number;
|
|
301
|
+
order?: JobListOrder;
|
|
302
|
+
id?: string;
|
|
276
303
|
status?: JobStatus;
|
|
304
|
+
endpoint?: SupportedEndpoint;
|
|
305
|
+
source?: JobListSource;
|
|
306
|
+
project_id?: string;
|
|
307
|
+
workflow_id?: string;
|
|
308
|
+
workflow_node_id?: string;
|
|
309
|
+
model?: string;
|
|
310
|
+
filename_regex?: string;
|
|
311
|
+
filename_contains?: string;
|
|
312
|
+
document_type?: string[];
|
|
313
|
+
from_date?: string;
|
|
314
|
+
to_date?: string;
|
|
315
|
+
metadata?: Record<string, string>;
|
|
316
|
+
include_request?: boolean;
|
|
317
|
+
include_response?: boolean;
|
|
277
318
|
}, options?: RequestOptions): Promise<JobListResponse>;
|
|
278
319
|
}
|
|
279
|
-
export { Job, JobListResponse, JobStatus, SupportedEndpoint, JobResponse, JobError };
|
|
320
|
+
export { Job, JobListOrder, JobListResponse, JobListSource, JobStatus, SupportedEndpoint, JobResponse, JobError };
|
|
321
|
+
export { JobRetrieveOptions, JobWaitForCompletionOptions };
|
|
280
322
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -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,WAAW,GAAG,SAAS,CAAC;
|
|
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,WAAW,GAAG,SAAS,CAAC;AAC5G,KAAK,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,CAAC;AACpD,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AAGnC,KAAK,iBAAiB,GAChB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,qBAAqB,GACrB,yBAAyB,GACzB,6BAA6B,GAC7B,s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AM,CAAC,EAAE,SAAS,CAAC;QACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;QAC7B,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,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
|
@@ -27,7 +27,7 @@ const ZJob = z.object({
|
|
|
27
27
|
"/v1/edit/templates/generate",
|
|
28
28
|
"/v1/projects/extract",
|
|
29
29
|
]),
|
|
30
|
-
request: z.record(z.any()),
|
|
30
|
+
request: z.record(z.any()).nullable().optional(),
|
|
31
31
|
response: ZJobResponse.nullable().optional(),
|
|
32
32
|
error: ZJobError.nullable().optional(),
|
|
33
33
|
created_at: z.number(),
|
|
@@ -75,13 +75,69 @@ export default class APIJobs extends CompositionClient {
|
|
|
75
75
|
* Retrieve a job by ID.
|
|
76
76
|
*/
|
|
77
77
|
async retrieve(job_id, options) {
|
|
78
|
+
const include_request = options?.include_request ?? false;
|
|
79
|
+
const include_response = options?.include_response ?? false;
|
|
80
|
+
const params = {
|
|
81
|
+
...(options?.params || {}),
|
|
82
|
+
include_request,
|
|
83
|
+
include_response,
|
|
84
|
+
};
|
|
78
85
|
return this._fetchJson(ZJob, {
|
|
79
86
|
url: `/v1/jobs/${job_id}`,
|
|
80
87
|
method: "GET",
|
|
81
|
-
params
|
|
88
|
+
params,
|
|
82
89
|
headers: options?.headers,
|
|
83
90
|
});
|
|
84
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Retrieve a job by ID including full request and response payloads.
|
|
94
|
+
*/
|
|
95
|
+
async retrieveFull(job_id, options) {
|
|
96
|
+
return this.retrieve(job_id, {
|
|
97
|
+
...options,
|
|
98
|
+
include_request: true,
|
|
99
|
+
include_response: true,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Poll a job until terminal status, then fetch final payload once.
|
|
104
|
+
*/
|
|
105
|
+
async waitForCompletion(job_id, options = {}) {
|
|
106
|
+
const poll_interval_ms = options.poll_interval_ms ?? 2000;
|
|
107
|
+
const timeout_ms = options.timeout_ms ?? 600000;
|
|
108
|
+
const include_request = options.include_request ?? false;
|
|
109
|
+
const include_response = options.include_response ?? true;
|
|
110
|
+
if (poll_interval_ms <= 0)
|
|
111
|
+
throw new Error("poll_interval_ms must be > 0");
|
|
112
|
+
if (timeout_ms <= 0)
|
|
113
|
+
throw new Error("timeout_ms must be > 0");
|
|
114
|
+
const terminal_statuses = new Set(["completed", "failed", "cancelled", "expired"]);
|
|
115
|
+
const started_at_ms = Date.now();
|
|
116
|
+
const deadline_ms = started_at_ms + timeout_ms;
|
|
117
|
+
while (true) {
|
|
118
|
+
const job = await this.retrieve(job_id, {
|
|
119
|
+
...options,
|
|
120
|
+
include_request: false,
|
|
121
|
+
include_response: false,
|
|
122
|
+
});
|
|
123
|
+
if (terminal_statuses.has(job.status)) {
|
|
124
|
+
if (include_request || include_response) {
|
|
125
|
+
return this.retrieve(job_id, {
|
|
126
|
+
...options,
|
|
127
|
+
include_request,
|
|
128
|
+
include_response,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return job;
|
|
132
|
+
}
|
|
133
|
+
const now_ms = Date.now();
|
|
134
|
+
if (now_ms >= deadline_ms) {
|
|
135
|
+
throw new Error(`Timed out waiting for job ${job_id} completion after ${timeout_ms}ms`);
|
|
136
|
+
}
|
|
137
|
+
const sleep_for_ms = Math.min(poll_interval_ms, Math.max(deadline_ms - now_ms, 0));
|
|
138
|
+
await new Promise((resolve) => setTimeout(resolve, sleep_for_ms));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
85
141
|
/**
|
|
86
142
|
* Cancel a queued or in-progress job.
|
|
87
143
|
*/
|
|
@@ -94,13 +150,41 @@ export default class APIJobs extends CompositionClient {
|
|
|
94
150
|
});
|
|
95
151
|
}
|
|
96
152
|
/**
|
|
97
|
-
*
|
|
153
|
+
* Retry a failed, cancelled, or expired job.
|
|
98
154
|
*/
|
|
99
|
-
async
|
|
155
|
+
async retry(job_id, options) {
|
|
156
|
+
return this._fetchJson(ZJob, {
|
|
157
|
+
url: `/v1/jobs/${job_id}/retry`,
|
|
158
|
+
method: "POST",
|
|
159
|
+
params: options?.params,
|
|
160
|
+
headers: options?.headers,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* List jobs with pagination and optional filtering.
|
|
165
|
+
*/
|
|
166
|
+
async list({ before, after, limit = 20, order = "desc", id, status, endpoint, source, project_id, workflow_id, workflow_node_id, model, filename_regex, filename_contains, document_type, from_date, to_date, metadata, include_request, include_response, } = {}, options) {
|
|
100
167
|
const params = {
|
|
168
|
+
before,
|
|
101
169
|
after,
|
|
102
170
|
limit,
|
|
171
|
+
order,
|
|
172
|
+
id,
|
|
103
173
|
status,
|
|
174
|
+
endpoint,
|
|
175
|
+
source,
|
|
176
|
+
project_id,
|
|
177
|
+
workflow_id,
|
|
178
|
+
workflow_node_id,
|
|
179
|
+
model,
|
|
180
|
+
filename_regex,
|
|
181
|
+
filename_contains,
|
|
182
|
+
document_type,
|
|
183
|
+
from_date,
|
|
184
|
+
to_date,
|
|
185
|
+
metadata: metadata ? JSON.stringify(metadata) : undefined,
|
|
186
|
+
include_request,
|
|
187
|
+
include_response,
|
|
104
188
|
};
|
|
105
189
|
// Remove undefined values
|
|
106
190
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
@@ -7,16 +7,13 @@ export default class APIProjects extends CompositionClient {
|
|
|
7
7
|
get(projectId: string, options?: RequestOptions): Promise<Project>;
|
|
8
8
|
delete(projectId: string, options?: RequestOptions): Promise<void>;
|
|
9
9
|
publish(projectId: string, origin?: string, options?: RequestOptions): Promise<Project>;
|
|
10
|
-
extract({ project_id, iteration_id, document, model, image_resolution_dpi, n_consensus,
|
|
10
|
+
extract({ project_id, iteration_id, document, model, image_resolution_dpi, n_consensus, metadata, extraction_id }: {
|
|
11
11
|
project_id: string;
|
|
12
12
|
iteration_id?: string;
|
|
13
13
|
document: MIMEDataInput;
|
|
14
14
|
model?: string;
|
|
15
15
|
image_resolution_dpi?: number;
|
|
16
16
|
n_consensus?: number;
|
|
17
|
-
temperature?: number;
|
|
18
|
-
seed?: number;
|
|
19
|
-
store?: boolean;
|
|
20
17
|
metadata?: Record<string, string>;
|
|
21
18
|
extraction_id?: string;
|
|
22
19
|
}, options?: RequestOptions): Promise<RetabParsedChatCompletion>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/projects/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAa,OAAO,EAAmC,oBAAoB,EAAE,aAAa,EAAa,yBAAyB,EAA8B,MAAM,gBAAgB,CAAC;AAE5L,MAAM,CAAC,O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AO,CAAC,OAAO,CAAC;IASlE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IASlE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAWvF,OAAO,CAAC,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,WAAW,EACX,QAAQ,EACR,aAAa,EAChB,EAAE;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,aAAa,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC;CA2BnE"}
|
|
@@ -47,7 +47,7 @@ export default class APIProjects extends CompositionClient {
|
|
|
47
47
|
headers: options?.headers,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
async extract({ project_id, iteration_id, document, model, image_resolution_dpi, n_consensus,
|
|
50
|
+
async extract({ project_id, iteration_id, document, model, image_resolution_dpi, n_consensus, metadata, extraction_id }, options) {
|
|
51
51
|
const url = iteration_id ? `/v1/projects/extract/${project_id}/${iteration_id}` : `/v1/projects/extract/${project_id}`;
|
|
52
52
|
// Parse and convert document to blob for multipart form upload
|
|
53
53
|
const parsedDocument = await ZMIMEData.parseAsync(document);
|
|
@@ -61,12 +61,6 @@ export default class APIProjects extends CompositionClient {
|
|
|
61
61
|
bodyParams.image_resolution_dpi = image_resolution_dpi;
|
|
62
62
|
if (n_consensus !== undefined)
|
|
63
63
|
bodyParams.n_consensus = n_consensus;
|
|
64
|
-
if (temperature !== undefined)
|
|
65
|
-
bodyParams.temperature = temperature;
|
|
66
|
-
if (seed !== undefined)
|
|
67
|
-
bodyParams.seed = seed;
|
|
68
|
-
if (store !== undefined)
|
|
69
|
-
bodyParams.store = store;
|
|
70
64
|
// Note: metadata must be JSON-serialized since multipart forms only accept primitive types
|
|
71
65
|
if (metadata !== undefined)
|
|
72
66
|
bodyParams.metadata = JSON.stringify(metadata);
|