@retab/node 1.0.95 → 1.0.98
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 +0 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +0 -2
- package/dist/api/documents/client.js +9 -9
- package/dist/api/edit/agent/client.js +1 -1
- package/dist/api/edit/templates/client.js +8 -8
- package/dist/api/extractions/client.js +6 -6
- package/dist/api/files/client.js +4 -4
- package/dist/api/jobs/client.d.ts +10 -10
- package/dist/api/jobs/client.d.ts.map +1 -1
- package/dist/api/jobs/client.js +15 -15
- package/dist/api/projects/client.js +6 -6
- package/dist/api/schemas/client.js +1 -1
- package/dist/api/workflows/client.d.ts +18 -2
- package/dist/api/workflows/client.d.ts.map +1 -1
- package/dist/api/workflows/client.js +33 -1
- package/dist/api/workflows/runs/client.d.ts +1 -1
- package/dist/api/workflows/runs/client.js +8 -8
- package/dist/api/workflows/runs/steps/client.d.ts +8 -12
- package/dist/api/workflows/runs/steps/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/steps/client.js +13 -17
- package/dist/client.js +1 -1
- package/dist/generated_types.d.ts +44 -44
- package/dist/generated_types.js +2 -2
- package/dist/types.d.ts +229 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +41 -0
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractClient, CompositionClient } from "../client.js";
|
|
2
|
-
import APIModels from "./models/client";
|
|
3
2
|
import APIDocuments from "./documents/client";
|
|
4
3
|
import APISchemas from "./schemas/client";
|
|
5
4
|
import APIProjects from "./projects/client";
|
|
@@ -11,7 +10,6 @@ import APIJobs from "./jobs/client";
|
|
|
11
10
|
export default class APIV1 extends CompositionClient {
|
|
12
11
|
constructor(client: AbstractClient);
|
|
13
12
|
files: APIFiles;
|
|
14
|
-
models: APIModels;
|
|
15
13
|
documents: APIDocuments;
|
|
16
14
|
schemas: APISchemas;
|
|
17
15
|
projects: APIProjects;
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,iBAAiB;gBACpC,MAAM,EAAE,cAAc;IAGlC,KAAK,WAAsB;IAC3B,SAAS,eAA0B;IACnC,OAAO,aAAwB;IAC/B,QAAQ,cAAyB;IACjC,WAAW,iBAA4B;IACvC,SAAS,eAA0B;IACnC,IAAI,UAAqB;IACzB,IAAI,UAAqB;CAC5B"}
|
package/dist/api/client.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CompositionClient } from "../client.js";
|
|
2
|
-
import APIModels from "./models/client";
|
|
3
2
|
import APIDocuments from "./documents/client";
|
|
4
3
|
import APISchemas from "./schemas/client";
|
|
5
4
|
import APIProjects from "./projects/client";
|
|
@@ -12,7 +11,6 @@ export default class APIV1 extends CompositionClient {
|
|
|
12
11
|
constructor(client) {
|
|
13
12
|
super(client);
|
|
14
13
|
this.files = new APIFiles(this);
|
|
15
|
-
this.models = new APIModels(this);
|
|
16
14
|
this.documents = new APIDocuments(this);
|
|
17
15
|
this.schemas = new APISchemas(this);
|
|
18
16
|
this.projects = new APIProjects(this);
|
|
@@ -8,7 +8,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
8
8
|
async extract(params, options) {
|
|
9
9
|
let request = await ZDocumentExtractRequest.parseAsync(params);
|
|
10
10
|
return this._fetchJson(ZRetabParsedChatCompletion, {
|
|
11
|
-
url: "/
|
|
11
|
+
url: "/documents/extract",
|
|
12
12
|
method: "POST",
|
|
13
13
|
body: { ...request, ...(options?.body || {}) },
|
|
14
14
|
params: options?.params,
|
|
@@ -18,7 +18,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
18
18
|
async extract_stream(params, options) {
|
|
19
19
|
let request = await ZDocumentExtractRequest.parseAsync(params);
|
|
20
20
|
return this._fetchStream(ZRetabParsedChatCompletionChunk, {
|
|
21
|
-
url: "/
|
|
21
|
+
url: "/documents/extract",
|
|
22
22
|
method: "POST",
|
|
23
23
|
body: { ...request, stream: true, ...(options?.body || {}) },
|
|
24
24
|
params: options?.params,
|
|
@@ -27,7 +27,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
27
27
|
}
|
|
28
28
|
async parse(params, options) {
|
|
29
29
|
return this._fetchJson(ZParseResult, {
|
|
30
|
-
url: "/
|
|
30
|
+
url: "/documents/parse",
|
|
31
31
|
method: "POST",
|
|
32
32
|
body: { ...(await ZParseRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
33
33
|
params: options?.params,
|
|
@@ -36,7 +36,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
36
36
|
}
|
|
37
37
|
async create_messages(params, options) {
|
|
38
38
|
return this._fetchJson(ZDocumentMessage, {
|
|
39
|
-
url: "/
|
|
39
|
+
url: "/documents/create_messages",
|
|
40
40
|
method: "POST",
|
|
41
41
|
body: { ...(await ZDocumentCreateMessageRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
42
42
|
params: options?.params,
|
|
@@ -45,7 +45,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
45
45
|
}
|
|
46
46
|
async create_inputs(params, options) {
|
|
47
47
|
return this._fetchJson(ZDocumentMessage, {
|
|
48
|
-
url: "/
|
|
48
|
+
url: "/documents/create_inputs",
|
|
49
49
|
method: "POST",
|
|
50
50
|
body: { ...(await ZDocumentCreateInputRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
51
51
|
params: options?.params,
|
|
@@ -73,7 +73,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
73
73
|
*/
|
|
74
74
|
async edit(params, options) {
|
|
75
75
|
return this._fetchJson(ZEditResponse, {
|
|
76
|
-
url: "/
|
|
76
|
+
url: "/documents/edit",
|
|
77
77
|
method: "POST",
|
|
78
78
|
body: { ...(await ZEditRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
79
79
|
params: options?.params,
|
|
@@ -111,7 +111,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
111
111
|
*/
|
|
112
112
|
async split(params, options) {
|
|
113
113
|
return this._fetchJson(ZSplitResponse, {
|
|
114
|
-
url: "/
|
|
114
|
+
url: "/documents/split",
|
|
115
115
|
method: "POST",
|
|
116
116
|
body: { ...(await ZSplitRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
117
117
|
params: options?.params,
|
|
@@ -151,7 +151,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
151
151
|
*/
|
|
152
152
|
async classify(params, options) {
|
|
153
153
|
return this._fetchJson(ZClassifyResponse, {
|
|
154
|
-
url: "/
|
|
154
|
+
url: "/documents/classify",
|
|
155
155
|
method: "POST",
|
|
156
156
|
body: { ...(await ZClassifyRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
157
157
|
params: options?.params,
|
|
@@ -160,7 +160,7 @@ export default class APIDocuments extends CompositionClient {
|
|
|
160
160
|
}
|
|
161
161
|
async generate_split_config(params, options) {
|
|
162
162
|
return this._fetchJson(ZGenerateSplitConfigResponse, {
|
|
163
|
-
url: "/
|
|
163
|
+
url: "/documents/split/generate_config",
|
|
164
164
|
method: "POST",
|
|
165
165
|
body: { ...(await ZGenerateSplitConfigRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
166
166
|
params: options?.params,
|
|
@@ -28,7 +28,7 @@ export default class APIEditAgent extends CompositionClient {
|
|
|
28
28
|
*/
|
|
29
29
|
async fill(params, options) {
|
|
30
30
|
return this._fetchJson(ZEditResponse, {
|
|
31
|
-
url: "/
|
|
31
|
+
url: "/edit/agent/fill",
|
|
32
32
|
method: "POST",
|
|
33
33
|
body: { ...(await ZEditRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
34
34
|
params: options?.params,
|
|
@@ -26,7 +26,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
26
26
|
// Remove undefined values
|
|
27
27
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
28
28
|
return this._fetchJson(ZPaginatedList, {
|
|
29
|
-
url: "/
|
|
29
|
+
url: "/edit/templates",
|
|
30
30
|
method: "GET",
|
|
31
31
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
32
32
|
headers: options?.headers,
|
|
@@ -41,7 +41,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
41
41
|
*/
|
|
42
42
|
async get(template_id, options) {
|
|
43
43
|
return this._fetchJson(ZEditTemplate, {
|
|
44
|
-
url: `/
|
|
44
|
+
url: `/edit/templates/${template_id}`,
|
|
45
45
|
method: "GET",
|
|
46
46
|
params: options?.params,
|
|
47
47
|
headers: options?.headers,
|
|
@@ -60,7 +60,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
60
60
|
async create({ name, document, form_fields, }, options) {
|
|
61
61
|
const parsedDocument = await ZMIMEData.parseAsync(document);
|
|
62
62
|
return this._fetchJson(ZEditTemplate, {
|
|
63
|
-
url: "/
|
|
63
|
+
url: "/edit/templates",
|
|
64
64
|
method: "POST",
|
|
65
65
|
body: {
|
|
66
66
|
name,
|
|
@@ -89,7 +89,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
89
89
|
if (form_fields !== undefined)
|
|
90
90
|
body.form_fields = form_fields;
|
|
91
91
|
return this._fetchJson(ZEditTemplate, {
|
|
92
|
-
url: `/
|
|
92
|
+
url: `/edit/templates/${template_id}`,
|
|
93
93
|
method: "PATCH",
|
|
94
94
|
body: { ...body, ...(options?.body || {}) },
|
|
95
95
|
params: options?.params,
|
|
@@ -104,7 +104,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
104
104
|
*/
|
|
105
105
|
async delete(template_id, options) {
|
|
106
106
|
return this._fetchJson({
|
|
107
|
-
url: `/
|
|
107
|
+
url: `/edit/templates/${template_id}`,
|
|
108
108
|
method: "DELETE",
|
|
109
109
|
params: options?.params,
|
|
110
110
|
headers: options?.headers,
|
|
@@ -124,7 +124,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
124
124
|
if (name !== undefined)
|
|
125
125
|
body.name = name;
|
|
126
126
|
return this._fetchJson(ZEditTemplate, {
|
|
127
|
-
url: `/
|
|
127
|
+
url: `/edit/templates/${template_id}/duplicate`,
|
|
128
128
|
method: "POST",
|
|
129
129
|
body: { ...body, ...(options?.body || {}) },
|
|
130
130
|
params: options?.params,
|
|
@@ -152,7 +152,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
152
152
|
*/
|
|
153
153
|
async generate(params, options) {
|
|
154
154
|
return this._fetchJson(ZInferFormSchemaResponse, {
|
|
155
|
-
url: "/
|
|
155
|
+
url: "/edit/templates/generate",
|
|
156
156
|
method: "POST",
|
|
157
157
|
body: { ...(await ZInferFormSchemaRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
158
158
|
params: options?.params,
|
|
@@ -190,7 +190,7 @@ export default class APIEditTemplates extends CompositionClient {
|
|
|
190
190
|
body.config = { color };
|
|
191
191
|
}
|
|
192
192
|
return this._fetchJson(ZEditResponse, {
|
|
193
|
-
url: "/
|
|
193
|
+
url: "/edit/templates/fill",
|
|
194
194
|
method: "POST",
|
|
195
195
|
body: {
|
|
196
196
|
...body,
|
|
@@ -31,7 +31,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
31
31
|
};
|
|
32
32
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
33
33
|
return this._fetchJson(ZPaginatedList, {
|
|
34
|
-
url: "/
|
|
34
|
+
url: "/extractions",
|
|
35
35
|
method: "GET",
|
|
36
36
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
37
37
|
headers: options?.headers,
|
|
@@ -53,7 +53,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
53
53
|
};
|
|
54
54
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
55
55
|
return this._fetchJson(ZDownloadResponse, {
|
|
56
|
-
url: "/
|
|
56
|
+
url: "/extractions/download",
|
|
57
57
|
method: "GET",
|
|
58
58
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
59
59
|
headers: options?.headers,
|
|
@@ -75,7 +75,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
75
75
|
if (metadata !== undefined)
|
|
76
76
|
body.metadata = metadata;
|
|
77
77
|
return this._fetchJson(ZExtraction, {
|
|
78
|
-
url: `/
|
|
78
|
+
url: `/extractions/${extraction_id}`,
|
|
79
79
|
method: "PATCH",
|
|
80
80
|
body: { ...body, ...(options?.body || {}) },
|
|
81
81
|
params: options?.params,
|
|
@@ -87,7 +87,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
87
87
|
*/
|
|
88
88
|
async get(extraction_id, options) {
|
|
89
89
|
return this._fetchJson(ZExtraction, {
|
|
90
|
-
url: `/
|
|
90
|
+
url: `/extractions/${extraction_id}`,
|
|
91
91
|
method: "GET",
|
|
92
92
|
params: options?.params,
|
|
93
93
|
headers: options?.headers,
|
|
@@ -103,7 +103,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
103
103
|
*/
|
|
104
104
|
async sources(extraction_id, options) {
|
|
105
105
|
return this._fetchJson(z.record(z.any()), {
|
|
106
|
-
url: `/
|
|
106
|
+
url: `/extractions/${extraction_id}/sources`,
|
|
107
107
|
method: "GET",
|
|
108
108
|
params: options?.params,
|
|
109
109
|
headers: options?.headers,
|
|
@@ -114,7 +114,7 @@ export default class APIExtractions extends CompositionClient {
|
|
|
114
114
|
*/
|
|
115
115
|
async delete(extraction_id, options) {
|
|
116
116
|
return this._fetchJson({
|
|
117
|
-
url: `/
|
|
117
|
+
url: `/extractions/${extraction_id}`,
|
|
118
118
|
method: "DELETE",
|
|
119
119
|
params: options?.params,
|
|
120
120
|
headers: options?.headers,
|
package/dist/api/files/client.js
CHANGED
|
@@ -26,7 +26,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
26
26
|
async upload(mimeData, options) {
|
|
27
27
|
const parsed = await ZMIMEData.parseAsync(mimeData);
|
|
28
28
|
return this._fetchJson(ZUploadFileResponse, {
|
|
29
|
-
url: "/
|
|
29
|
+
url: "/files/upload",
|
|
30
30
|
method: "POST",
|
|
31
31
|
body: { mimeData: parsed, ...(options?.body || {}) },
|
|
32
32
|
params: options?.params,
|
|
@@ -45,7 +45,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
45
45
|
};
|
|
46
46
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
47
47
|
return this._fetchJson(ZPaginatedList, {
|
|
48
|
-
url: "/
|
|
48
|
+
url: "/files",
|
|
49
49
|
method: "GET",
|
|
50
50
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
51
51
|
headers: options?.headers,
|
|
@@ -53,7 +53,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
53
53
|
}
|
|
54
54
|
async get(fileId, options) {
|
|
55
55
|
return this._fetchJson(ZFile, {
|
|
56
|
-
url: `/
|
|
56
|
+
url: `/files/${fileId}`,
|
|
57
57
|
method: "GET",
|
|
58
58
|
params: options?.params,
|
|
59
59
|
headers: options?.headers,
|
|
@@ -61,7 +61,7 @@ export default class APIFiles extends CompositionClient {
|
|
|
61
61
|
}
|
|
62
62
|
async getDownloadLink(fileId, options) {
|
|
63
63
|
return this._fetchJson(ZFileLink, {
|
|
64
|
-
url: `/
|
|
64
|
+
url: `/files/${fileId}/download-link`,
|
|
65
65
|
method: "GET",
|
|
66
66
|
params: options?.params,
|
|
67
67
|
headers: options?.headers,
|
|
@@ -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 = "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/agent/fill" | "/edit/templates/fill" | "/edit/templates/generate" | "/projects/extract";
|
|
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.ZodEnum<["/
|
|
36
|
+
endpoint: z.ZodEnum<["/documents/extract", "/documents/parse", "/documents/split", "/documents/classify", "/schemas/generate", "/edit/agent/fill", "/edit/templates/fill", "/edit/templates/generate", "/projects/extract"]>;
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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.ZodEnum<["/
|
|
117
|
+
endpoint: z.ZodEnum<["/documents/extract", "/documents/parse", "/documents/split", "/documents/classify", "/schemas/generate", "/edit/agent/fill", "/edit/templates/fill", "/edit/templates/generate", "/projects/extract"]>;
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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: "/documents/extract" | "/documents/parse" | "/documents/split" | "/documents/classify" | "/schemas/generate" | "/edit/templates/generate" | "/edit/templates/fill" | "/edit/agent/fill" | "/projects/extract";
|
|
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
|
*/
|
|
@@ -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;AAC5G,KAAK,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,CAAC;AACpD,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AAGnC,KAAK,iBAAiB,GAChB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/jobs/client.ts"],"names":[],"mappings":"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"}
|
package/dist/api/jobs/client.js
CHANGED
|
@@ -17,15 +17,15 @@ const ZJob = z.object({
|
|
|
17
17
|
object: z.literal("job"),
|
|
18
18
|
status: z.enum(["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]),
|
|
19
19
|
endpoint: z.enum([
|
|
20
|
-
"/
|
|
21
|
-
"/
|
|
22
|
-
"/
|
|
23
|
-
"/
|
|
24
|
-
"/
|
|
25
|
-
"/
|
|
26
|
-
"/
|
|
27
|
-
"/
|
|
28
|
-
"/
|
|
20
|
+
"/documents/extract",
|
|
21
|
+
"/documents/parse",
|
|
22
|
+
"/documents/split",
|
|
23
|
+
"/documents/classify",
|
|
24
|
+
"/schemas/generate",
|
|
25
|
+
"/edit/agent/fill",
|
|
26
|
+
"/edit/templates/fill",
|
|
27
|
+
"/edit/templates/generate",
|
|
28
|
+
"/projects/extract",
|
|
29
29
|
]),
|
|
30
30
|
request: z.record(z.any()).nullable().optional(),
|
|
31
31
|
response: ZJobResponse.nullable().optional(),
|
|
@@ -52,7 +52,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
52
52
|
/**
|
|
53
53
|
* Create a new asynchronous job.
|
|
54
54
|
*
|
|
55
|
-
* @param endpoint - The API endpoint to call ("/
|
|
55
|
+
* @param endpoint - The API endpoint to call ("/documents/extract" or "/documents/parse")
|
|
56
56
|
* @param request - The full request body for the target endpoint
|
|
57
57
|
* @param metadata - Optional metadata (max 16 pairs; keys ≤64 chars, values ≤512 chars)
|
|
58
58
|
*/
|
|
@@ -64,7 +64,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
64
64
|
if (metadata !== undefined)
|
|
65
65
|
body.metadata = metadata;
|
|
66
66
|
return this._fetchJson(ZJob, {
|
|
67
|
-
url: "/
|
|
67
|
+
url: "/jobs",
|
|
68
68
|
method: "POST",
|
|
69
69
|
body: { ...body, ...(options?.body || {}) },
|
|
70
70
|
params: options?.params,
|
|
@@ -83,7 +83,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
83
83
|
include_response,
|
|
84
84
|
};
|
|
85
85
|
return this._fetchJson(ZJob, {
|
|
86
|
-
url: `/
|
|
86
|
+
url: `/jobs/${job_id}`,
|
|
87
87
|
method: "GET",
|
|
88
88
|
params,
|
|
89
89
|
headers: options?.headers,
|
|
@@ -143,7 +143,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
143
143
|
*/
|
|
144
144
|
async cancel(job_id, options) {
|
|
145
145
|
return this._fetchJson(ZJob, {
|
|
146
|
-
url: `/
|
|
146
|
+
url: `/jobs/${job_id}/cancel`,
|
|
147
147
|
method: "POST",
|
|
148
148
|
params: options?.params,
|
|
149
149
|
headers: options?.headers,
|
|
@@ -154,7 +154,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
154
154
|
*/
|
|
155
155
|
async retry(job_id, options) {
|
|
156
156
|
return this._fetchJson(ZJob, {
|
|
157
|
-
url: `/
|
|
157
|
+
url: `/jobs/${job_id}/retry`,
|
|
158
158
|
method: "POST",
|
|
159
159
|
params: options?.params,
|
|
160
160
|
headers: options?.headers,
|
|
@@ -189,7 +189,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
189
189
|
// Remove undefined values
|
|
190
190
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
191
191
|
return this._fetchJson(ZJobListResponse, {
|
|
192
|
-
url: "/
|
|
192
|
+
url: "/jobs",
|
|
193
193
|
method: "GET",
|
|
194
194
|
params: { ...cleanParams, ...(options?.params || {}) },
|
|
195
195
|
headers: options?.headers,
|
|
@@ -7,7 +7,7 @@ export default class APIProjects extends CompositionClient {
|
|
|
7
7
|
}
|
|
8
8
|
async create(body, options) {
|
|
9
9
|
return this._fetchJson(ZProject, {
|
|
10
|
-
url: "/
|
|
10
|
+
url: "/projects",
|
|
11
11
|
method: "POST",
|
|
12
12
|
body: { ...(await ZCreateProjectRequest.parseAsync(body)), ...(options?.body || {}) },
|
|
13
13
|
params: options?.params,
|
|
@@ -16,7 +16,7 @@ export default class APIProjects extends CompositionClient {
|
|
|
16
16
|
}
|
|
17
17
|
async list(options) {
|
|
18
18
|
return this._fetchJson(dataArray(ZProject), {
|
|
19
|
-
url: "/
|
|
19
|
+
url: "/projects",
|
|
20
20
|
method: "GET",
|
|
21
21
|
params: options?.params,
|
|
22
22
|
headers: options?.headers,
|
|
@@ -24,7 +24,7 @@ export default class APIProjects extends CompositionClient {
|
|
|
24
24
|
}
|
|
25
25
|
async get(projectId, options) {
|
|
26
26
|
return this._fetchJson(ZProject, {
|
|
27
|
-
url: `/
|
|
27
|
+
url: `/projects/${projectId}`,
|
|
28
28
|
method: "GET",
|
|
29
29
|
params: options?.params,
|
|
30
30
|
headers: options?.headers,
|
|
@@ -32,7 +32,7 @@ export default class APIProjects extends CompositionClient {
|
|
|
32
32
|
}
|
|
33
33
|
async delete(projectId, options) {
|
|
34
34
|
return this._fetchJson({
|
|
35
|
-
url: `/
|
|
35
|
+
url: `/projects/${projectId}`,
|
|
36
36
|
method: "DELETE",
|
|
37
37
|
params: options?.params,
|
|
38
38
|
headers: options?.headers,
|
|
@@ -41,14 +41,14 @@ export default class APIProjects extends CompositionClient {
|
|
|
41
41
|
async publish(projectId, origin, options) {
|
|
42
42
|
const params = origin ? { origin, ...(options?.params || {}) } : options?.params;
|
|
43
43
|
return this._fetchJson(ZProject, {
|
|
44
|
-
url: `/
|
|
44
|
+
url: `/projects/${projectId}/publish`,
|
|
45
45
|
method: "POST",
|
|
46
46
|
params,
|
|
47
47
|
headers: options?.headers,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
async extract({ project_id, iteration_id, document, model, image_resolution_dpi, n_consensus, metadata, extraction_id }, options) {
|
|
51
|
-
const url = iteration_id ? `/
|
|
51
|
+
const url = iteration_id ? `/projects/extract/${project_id}/${iteration_id}` : `/projects/extract/${project_id}`;
|
|
52
52
|
// Parse and convert document to blob for multipart form upload
|
|
53
53
|
const parsedDocument = await ZMIMEData.parseAsync(document);
|
|
54
54
|
// Only include optional parameters if they are provided
|
|
@@ -6,7 +6,7 @@ export default class APISchemas extends CompositionClient {
|
|
|
6
6
|
}
|
|
7
7
|
async generate(params, options) {
|
|
8
8
|
return this._fetchJson(ZSchema, {
|
|
9
|
-
url: "/
|
|
9
|
+
url: "/schemas/generate",
|
|
10
10
|
method: "POST",
|
|
11
11
|
body: { ...(await ZGenerateSchemaRequest.parseAsync(params)), ...(options?.body || {}) },
|
|
12
12
|
params: options?.params,
|
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
import { CompositionClient } from "../../client.js";
|
|
1
|
+
import { CompositionClient, RequestOptions } from "../../client.js";
|
|
2
|
+
import { PaginatedList, Workflow } from "../../types.js";
|
|
2
3
|
import APIWorkflowRuns from "./runs/client.js";
|
|
3
4
|
/**
|
|
4
5
|
* Workflows API client for workflow operations.
|
|
5
6
|
*
|
|
6
7
|
* Sub-clients:
|
|
7
|
-
* - runs: Workflow run operations
|
|
8
|
+
* - runs: Workflow run operations
|
|
8
9
|
*/
|
|
9
10
|
export default class APIWorkflows extends CompositionClient {
|
|
10
11
|
runs: APIWorkflowRuns;
|
|
11
12
|
constructor(client: CompositionClient);
|
|
13
|
+
/**
|
|
14
|
+
* Get a workflow by ID.
|
|
15
|
+
*/
|
|
16
|
+
get(workflowId: string, options?: RequestOptions): Promise<Workflow>;
|
|
17
|
+
/**
|
|
18
|
+
* List workflows with pagination.
|
|
19
|
+
*/
|
|
20
|
+
list({ before, after, limit, order, sortBy, fields, }?: {
|
|
21
|
+
before?: string;
|
|
22
|
+
after?: string;
|
|
23
|
+
limit?: number;
|
|
24
|
+
order?: "asc" | "desc";
|
|
25
|
+
sortBy?: string;
|
|
26
|
+
fields?: string;
|
|
27
|
+
}, options?: RequestOptions): Promise<PaginatedList>;
|
|
12
28
|
}
|
|
13
29
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/workflows/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/workflows/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAA6B,MAAM,gBAAgB,CAAC;AACpF,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,iBAAiB;IAChD,IAAI,EAAE,eAAe,CAAC;gBAEjB,MAAM,EAAE,iBAAiB;IAKrC;;OAEG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAS1E;;OAEG;IACG,IAAI,CACN,EACI,MAAM,EACN,KAAK,EACL,KAAU,EACV,KAAc,EACd,MAAM,EACN,MAAM,GACT,GAAE;QACC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACd,EACN,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,aAAa,CAAC;CAoB5B"}
|
|
@@ -1,14 +1,46 @@
|
|
|
1
1
|
import { CompositionClient } from "../../client.js";
|
|
2
|
+
import { ZPaginatedList, ZWorkflow } from "../../types.js";
|
|
2
3
|
import APIWorkflowRuns from "./runs/client.js";
|
|
3
4
|
/**
|
|
4
5
|
* Workflows API client for workflow operations.
|
|
5
6
|
*
|
|
6
7
|
* Sub-clients:
|
|
7
|
-
* - runs: Workflow run operations
|
|
8
|
+
* - runs: Workflow run operations
|
|
8
9
|
*/
|
|
9
10
|
export default class APIWorkflows extends CompositionClient {
|
|
10
11
|
constructor(client) {
|
|
11
12
|
super(client);
|
|
12
13
|
this.runs = new APIWorkflowRuns(this);
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Get a workflow by ID.
|
|
17
|
+
*/
|
|
18
|
+
async get(workflowId, options) {
|
|
19
|
+
return this._fetchJson(ZWorkflow, {
|
|
20
|
+
url: `/workflows/${workflowId}`,
|
|
21
|
+
method: "GET",
|
|
22
|
+
params: options?.params,
|
|
23
|
+
headers: options?.headers,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List workflows with pagination.
|
|
28
|
+
*/
|
|
29
|
+
async list({ before, after, limit = 10, order = "desc", sortBy, fields, } = {}, options) {
|
|
30
|
+
const params = Object.fromEntries(Object.entries({
|
|
31
|
+
before,
|
|
32
|
+
after,
|
|
33
|
+
limit,
|
|
34
|
+
order,
|
|
35
|
+
sort_by: sortBy,
|
|
36
|
+
fields,
|
|
37
|
+
...(options?.params || {}),
|
|
38
|
+
}).filter(([_, value]) => value !== undefined));
|
|
39
|
+
return this._fetchJson(ZPaginatedList, {
|
|
40
|
+
url: "/workflows",
|
|
41
|
+
method: "GET",
|
|
42
|
+
params,
|
|
43
|
+
headers: options?.headers,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
14
46
|
}
|
|
@@ -5,7 +5,7 @@ import APIWorkflowRunSteps from "./steps/client.js";
|
|
|
5
5
|
* Workflow Runs API client for managing workflow executions.
|
|
6
6
|
*
|
|
7
7
|
* Sub-clients:
|
|
8
|
-
* - steps: Step output operations (get,
|
|
8
|
+
* - steps: Step output operations (get, list)
|
|
9
9
|
*/
|
|
10
10
|
export default class APIWorkflowRuns extends CompositionClient {
|
|
11
11
|
steps: APIWorkflowRunSteps;
|