@retab/node 1.0.93 → 1.0.95
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/client.d.ts +2 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -0
- package/dist/api/extractions/client.d.ts +11 -2
- package/dist/api/extractions/client.d.ts.map +1 -1
- package/dist/api/extractions/client.js +16 -0
- package/dist/api/files/client.d.ts +71 -0
- package/dist/api/files/client.d.ts.map +1 -0
- package/dist/api/files/client.js +70 -0
- package/dist/api/jobs/client.d.ts +12 -12
- package/dist/api/schemas/client.d.ts +1 -1
- package/dist/api/workflows/runs/client.d.ts +2 -9
- package/dist/api/workflows/runs/client.d.ts.map +1 -1
- package/dist/api/workflows/runs/client.js +3 -11
- package/dist/generated_types.d.ts +46521 -27053
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +426 -25
- package/dist/schema_types.d.ts +2 -2
- package/dist/types.d.ts +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/api/client.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ import APIProjects from "./projects/client";
|
|
|
6
6
|
import APIExtractions from "./extractions/client";
|
|
7
7
|
import APIWorkflows from "./workflows/client";
|
|
8
8
|
import APIEdit from "./edit/client";
|
|
9
|
+
import APIFiles from "./files/client";
|
|
9
10
|
import APIJobs from "./jobs/client";
|
|
10
11
|
export default class APIV1 extends CompositionClient {
|
|
11
12
|
constructor(client: AbstractClient);
|
|
13
|
+
files: APIFiles;
|
|
12
14
|
models: APIModels;
|
|
13
15
|
documents: APIDocuments;
|
|
14
16
|
schemas: APISchemas;
|
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;AAC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iBAA4B;IACvC,SAAS,eAA0B;IACnC,IAAI,UAAqB;IACzB,IAAI,UAAqB;CAC5B"}
|
package/dist/api/client.js
CHANGED
|
@@ -6,10 +6,12 @@ import APIProjects from "./projects/client";
|
|
|
6
6
|
import APIExtractions from "./extractions/client";
|
|
7
7
|
import APIWorkflows from "./workflows/client";
|
|
8
8
|
import APIEdit from "./edit/client";
|
|
9
|
+
import APIFiles from "./files/client";
|
|
9
10
|
import APIJobs from "./jobs/client";
|
|
10
11
|
export default class APIV1 extends CompositionClient {
|
|
11
12
|
constructor(client) {
|
|
12
13
|
super(client);
|
|
14
|
+
this.files = new APIFiles(this);
|
|
13
15
|
this.models = new APIModels(this);
|
|
14
16
|
this.documents = new APIDocuments(this);
|
|
15
17
|
this.schemas = new APISchemas(this);
|
|
@@ -7,12 +7,12 @@ declare const ZDownloadResponse: z.ZodObject<{
|
|
|
7
7
|
expires_at: z.ZodString;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
filename: string;
|
|
10
|
-
expires_at: string;
|
|
11
10
|
download_url: string;
|
|
11
|
+
expires_at: string;
|
|
12
12
|
}, {
|
|
13
13
|
filename: string;
|
|
14
|
-
expires_at: string;
|
|
15
14
|
download_url: string;
|
|
15
|
+
expires_at: string;
|
|
16
16
|
}>;
|
|
17
17
|
type DownloadResponse = z.infer<typeof ZDownloadResponse>;
|
|
18
18
|
declare const ZExtraction: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -60,6 +60,15 @@ export default class APIExtractions extends CompositionClient {
|
|
|
60
60
|
* Get an extraction by ID.
|
|
61
61
|
*/
|
|
62
62
|
get(extraction_id: string, options?: RequestOptions): Promise<Extraction>;
|
|
63
|
+
/**
|
|
64
|
+
* Get extraction result enriched with per-leaf source provenance.
|
|
65
|
+
*
|
|
66
|
+
* Each extracted leaf value is wrapped as {value, source} where source
|
|
67
|
+
* contains citation content, surrounding context, and a format-specific anchor.
|
|
68
|
+
*
|
|
69
|
+
* @param extraction_id - ID of the extraction to source
|
|
70
|
+
*/
|
|
71
|
+
sources(extraction_id: string, options?: RequestOptions): Promise<Record<string, any>>;
|
|
63
72
|
/**
|
|
64
73
|
* Delete an extraction by ID.
|
|
65
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/extractions/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,QAAA,MAAM,iBAAiB;;;;;;;;;;;;EAIrB,CAAC;AAEH,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAG1D,QAAA,MAAM,WAAW,oCAAoB,CAAC;AACtC,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,iBAAiB;gBAC7C,MAAM,EAAE,iBAAiB;IAIrC;;OAEG;IACG,IAAI,CACN,EACI,MAAM,EACN,KAAK,EACL,KAAU,EACV,KAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,GACX,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,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,M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AG,OAAO,CAAC,UAAU,CAAC;IAS/E;;;;;;;OAOG;IACG,OAAO,CACT,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAS/B;;OAEG;IACG,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ/E"}
|
|
@@ -93,6 +93,22 @@ export default class APIExtractions extends CompositionClient {
|
|
|
93
93
|
headers: options?.headers,
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Get extraction result enriched with per-leaf source provenance.
|
|
98
|
+
*
|
|
99
|
+
* Each extracted leaf value is wrapped as {value, source} where source
|
|
100
|
+
* contains citation content, surrounding context, and a format-specific anchor.
|
|
101
|
+
*
|
|
102
|
+
* @param extraction_id - ID of the extraction to source
|
|
103
|
+
*/
|
|
104
|
+
async sources(extraction_id, options) {
|
|
105
|
+
return this._fetchJson(z.record(z.any()), {
|
|
106
|
+
url: `/v1/extractions/${extraction_id}/sources`,
|
|
107
|
+
method: "GET",
|
|
108
|
+
params: options?.params,
|
|
109
|
+
headers: options?.headers,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
96
112
|
/**
|
|
97
113
|
* Delete an extraction by ID.
|
|
98
114
|
*/
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CompositionClient, RequestOptions } from "../../client.js";
|
|
2
|
+
import { MIMEDataInput, PaginatedList } from "../../types.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
declare const ZFile: z.ZodObject<{
|
|
5
|
+
object: z.ZodDefault<z.ZodLiteral<"file">>;
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
filename: z.ZodString;
|
|
8
|
+
organization_id: z.ZodString;
|
|
9
|
+
created_at: z.ZodString;
|
|
10
|
+
updated_at: z.ZodString;
|
|
11
|
+
page_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
object: "file";
|
|
14
|
+
filename: string;
|
|
15
|
+
id: string;
|
|
16
|
+
organization_id: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
page_count?: number | null | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
filename: string;
|
|
22
|
+
id: string;
|
|
23
|
+
organization_id: string;
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
object?: "file" | undefined;
|
|
27
|
+
page_count?: number | null | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
type File = z.infer<typeof ZFile>;
|
|
30
|
+
declare const ZFileLink: z.ZodObject<{
|
|
31
|
+
download_url: z.ZodString;
|
|
32
|
+
expires_in: z.ZodString;
|
|
33
|
+
filename: z.ZodString;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
filename: string;
|
|
36
|
+
download_url: string;
|
|
37
|
+
expires_in: string;
|
|
38
|
+
}, {
|
|
39
|
+
filename: string;
|
|
40
|
+
download_url: string;
|
|
41
|
+
expires_in: string;
|
|
42
|
+
}>;
|
|
43
|
+
type FileLink = z.infer<typeof ZFileLink>;
|
|
44
|
+
declare const ZUploadFileResponse: z.ZodObject<{
|
|
45
|
+
fileId: z.ZodString;
|
|
46
|
+
filename: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
filename: string;
|
|
49
|
+
fileId: string;
|
|
50
|
+
}, {
|
|
51
|
+
filename: string;
|
|
52
|
+
fileId: string;
|
|
53
|
+
}>;
|
|
54
|
+
type UploadFileResponse = z.infer<typeof ZUploadFileResponse>;
|
|
55
|
+
export default class APIFiles extends CompositionClient {
|
|
56
|
+
constructor(client: CompositionClient);
|
|
57
|
+
upload(mimeData: MIMEDataInput, options?: RequestOptions): Promise<UploadFileResponse>;
|
|
58
|
+
list({ before, after, limit, order, filename, mime_type, sort_by, }?: {
|
|
59
|
+
before?: string;
|
|
60
|
+
after?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
order?: "asc" | "desc";
|
|
63
|
+
filename?: string;
|
|
64
|
+
mime_type?: string;
|
|
65
|
+
sort_by?: string;
|
|
66
|
+
}, options?: RequestOptions): Promise<PaginatedList>;
|
|
67
|
+
get(fileId: string, options?: RequestOptions): Promise<File>;
|
|
68
|
+
getDownloadLink(fileId: string, options?: RequestOptions): Promise<FileLink>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/files/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAa,aAAa,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;EAQT,CAAC;AACH,KAAK,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAElC,QAAA,MAAM,SAAS;;;;;;;;;;;;EAIb,CAAC;AACH,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAE1C,QAAA,MAAM,mBAAmB;;;;;;;;;EAGvB,CAAC;AACH,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,iBAAiB;gBACvC,MAAM,EAAE,iBAAiB;IAI/B,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWtF,IAAI,CACN,EACI,MAAM,EACN,KAAK,EACL,KAAU,EACV,KAAc,EACd,QAAQ,EACR,SAAS,EACT,OAAsB,GACzB,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,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KACf,EACN,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,aAAa,CAAC;IAqBnB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;CAQrF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CompositionClient } from "../../client.js";
|
|
2
|
+
import { ZMIMEData, ZPaginatedList } from "../../types.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
const ZFile = z.object({
|
|
5
|
+
object: z.literal("file").default("file"),
|
|
6
|
+
id: z.string(),
|
|
7
|
+
filename: z.string(),
|
|
8
|
+
organization_id: z.string(),
|
|
9
|
+
created_at: z.string(),
|
|
10
|
+
updated_at: z.string(),
|
|
11
|
+
page_count: z.number().nullable().optional(),
|
|
12
|
+
});
|
|
13
|
+
const ZFileLink = z.object({
|
|
14
|
+
download_url: z.string(),
|
|
15
|
+
expires_in: z.string(),
|
|
16
|
+
filename: z.string(),
|
|
17
|
+
});
|
|
18
|
+
const ZUploadFileResponse = z.object({
|
|
19
|
+
fileId: z.string(),
|
|
20
|
+
filename: z.string(),
|
|
21
|
+
});
|
|
22
|
+
export default class APIFiles extends CompositionClient {
|
|
23
|
+
constructor(client) {
|
|
24
|
+
super(client);
|
|
25
|
+
}
|
|
26
|
+
async upload(mimeData, options) {
|
|
27
|
+
const parsed = await ZMIMEData.parseAsync(mimeData);
|
|
28
|
+
return this._fetchJson(ZUploadFileResponse, {
|
|
29
|
+
url: "/v1/files/upload",
|
|
30
|
+
method: "POST",
|
|
31
|
+
body: { mimeData: parsed, ...(options?.body || {}) },
|
|
32
|
+
params: options?.params,
|
|
33
|
+
headers: options?.headers,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async list({ before, after, limit = 10, order = "desc", filename, mime_type, sort_by = "created_at", } = {}, options) {
|
|
37
|
+
const params = {
|
|
38
|
+
before,
|
|
39
|
+
after,
|
|
40
|
+
limit,
|
|
41
|
+
order,
|
|
42
|
+
filename,
|
|
43
|
+
mime_type,
|
|
44
|
+
sort_by,
|
|
45
|
+
};
|
|
46
|
+
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|
|
47
|
+
return this._fetchJson(ZPaginatedList, {
|
|
48
|
+
url: "/v1/files",
|
|
49
|
+
method: "GET",
|
|
50
|
+
params: { ...cleanParams, ...(options?.params || {}) },
|
|
51
|
+
headers: options?.headers,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async get(fileId, options) {
|
|
55
|
+
return this._fetchJson(ZFile, {
|
|
56
|
+
url: `/v1/files/${fileId}`,
|
|
57
|
+
method: "GET",
|
|
58
|
+
params: options?.params,
|
|
59
|
+
headers: options?.headers,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async getDownloadLink(fileId, options) {
|
|
63
|
+
return this._fetchJson(ZFileLink, {
|
|
64
|
+
url: `/v1/files/${fileId}/download-link`,
|
|
65
|
+
method: "GET",
|
|
66
|
+
params: options?.params,
|
|
67
|
+
headers: options?.headers,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -68,10 +68,10 @@ declare const ZJob: z.ZodObject<{
|
|
|
68
68
|
object: "job";
|
|
69
69
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
70
70
|
id: string;
|
|
71
|
-
|
|
71
|
+
organization_id: string;
|
|
72
72
|
created_at: number;
|
|
73
|
+
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";
|
|
73
74
|
expires_at: number;
|
|
74
|
-
organization_id: string;
|
|
75
75
|
metadata?: Record<string, string> | null | undefined;
|
|
76
76
|
request?: Record<string, any> | null | undefined;
|
|
77
77
|
response?: {
|
|
@@ -89,10 +89,10 @@ declare const ZJob: z.ZodObject<{
|
|
|
89
89
|
object: "job";
|
|
90
90
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
91
91
|
id: string;
|
|
92
|
-
|
|
92
|
+
organization_id: string;
|
|
93
93
|
created_at: number;
|
|
94
|
+
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";
|
|
94
95
|
expires_at: number;
|
|
95
|
-
organization_id: string;
|
|
96
96
|
metadata?: Record<string, string> | null | undefined;
|
|
97
97
|
request?: Record<string, any> | null | undefined;
|
|
98
98
|
response?: {
|
|
@@ -149,10 +149,10 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
149
149
|
object: "job";
|
|
150
150
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
151
151
|
id: string;
|
|
152
|
-
|
|
152
|
+
organization_id: string;
|
|
153
153
|
created_at: number;
|
|
154
|
+
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";
|
|
154
155
|
expires_at: number;
|
|
155
|
-
organization_id: string;
|
|
156
156
|
metadata?: Record<string, string> | null | undefined;
|
|
157
157
|
request?: Record<string, any> | null | undefined;
|
|
158
158
|
response?: {
|
|
@@ -170,10 +170,10 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
170
170
|
object: "job";
|
|
171
171
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
172
172
|
id: string;
|
|
173
|
-
|
|
173
|
+
organization_id: string;
|
|
174
174
|
created_at: number;
|
|
175
|
+
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";
|
|
175
176
|
expires_at: number;
|
|
176
|
-
organization_id: string;
|
|
177
177
|
metadata?: Record<string, string> | null | undefined;
|
|
178
178
|
request?: Record<string, any> | null | undefined;
|
|
179
179
|
response?: {
|
|
@@ -197,10 +197,10 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
197
197
|
object: "job";
|
|
198
198
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
199
199
|
id: string;
|
|
200
|
-
|
|
200
|
+
organization_id: string;
|
|
201
201
|
created_at: number;
|
|
202
|
+
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";
|
|
202
203
|
expires_at: number;
|
|
203
|
-
organization_id: string;
|
|
204
204
|
metadata?: Record<string, string> | null | undefined;
|
|
205
205
|
request?: Record<string, any> | null | undefined;
|
|
206
206
|
response?: {
|
|
@@ -224,10 +224,10 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
224
224
|
object: "job";
|
|
225
225
|
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
226
226
|
id: string;
|
|
227
|
-
|
|
227
|
+
organization_id: string;
|
|
228
228
|
created_at: number;
|
|
229
|
+
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";
|
|
229
230
|
expires_at: number;
|
|
230
|
-
organization_id: string;
|
|
231
231
|
metadata?: Record<string, string> | null | undefined;
|
|
232
232
|
request?: Record<string, any> | null | undefined;
|
|
233
233
|
response?: {
|
|
@@ -5,8 +5,8 @@ export default class APISchemas extends CompositionClient {
|
|
|
5
5
|
generate(params: GenerateSchemaRequest, options?: RequestOptions): Promise<{
|
|
6
6
|
object: "schema";
|
|
7
7
|
strict: boolean;
|
|
8
|
-
json_schema: Record<string, any>;
|
|
9
8
|
created_at: string;
|
|
9
|
+
json_schema: Record<string, any>;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -20,7 +20,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
20
20
|
* @param workflowId - The ID of the workflow to run
|
|
21
21
|
* @param documents - Mapping of start node IDs to their input documents
|
|
22
22
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
23
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
24
23
|
* @param options - Optional request options
|
|
25
24
|
* @returns The created workflow run with status "running"
|
|
26
25
|
*
|
|
@@ -34,18 +33,14 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
34
33
|
* jsonInputs: {
|
|
35
34
|
* "json-node-1": { key: "value" },
|
|
36
35
|
* },
|
|
37
|
-
* textInputs: {
|
|
38
|
-
* "text-node-1": "Hello, world!",
|
|
39
|
-
* }
|
|
40
36
|
* });
|
|
41
37
|
* console.log(`Run started: ${run.id}, status: ${run.status}`);
|
|
42
38
|
* ```
|
|
43
39
|
*/
|
|
44
|
-
create({ workflowId, documents, jsonInputs,
|
|
40
|
+
create({ workflowId, documents, jsonInputs, }: {
|
|
45
41
|
workflowId: string;
|
|
46
42
|
documents?: Record<string, MIMEDataInput>;
|
|
47
43
|
jsonInputs?: Record<string, Record<string, unknown>>;
|
|
48
|
-
textInputs?: Record<string, string>;
|
|
49
44
|
}, options?: RequestOptions): Promise<WorkflowRun>;
|
|
50
45
|
/**
|
|
51
46
|
* Get a workflow run by ID.
|
|
@@ -200,7 +195,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
200
195
|
* @param workflowId - The ID of the workflow to run
|
|
201
196
|
* @param documents - Mapping of start node IDs to their input documents
|
|
202
197
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
203
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
204
198
|
* @param pollIntervalMs - Milliseconds between polls (default: 2000)
|
|
205
199
|
* @param timeoutMs - Maximum time to wait in milliseconds (default: 600000)
|
|
206
200
|
* @param options - Optional request options
|
|
@@ -218,11 +212,10 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
218
212
|
* }
|
|
219
213
|
* ```
|
|
220
214
|
*/
|
|
221
|
-
createAndWait({ workflowId, documents, jsonInputs,
|
|
215
|
+
createAndWait({ workflowId, documents, jsonInputs, pollIntervalMs, timeoutMs, }: {
|
|
222
216
|
workflowId: string;
|
|
223
217
|
documents?: Record<string, MIMEDataInput>;
|
|
224
218
|
jsonInputs?: Record<string, Record<string, unknown>>;
|
|
225
|
-
textInputs?: Record<string, string>;
|
|
226
219
|
pollIntervalMs?: number;
|
|
227
220
|
timeoutMs?: number;
|
|
228
221
|
}, options?: RequestOptions): Promise<WorkflowRun>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/api/workflows/runs/client.ts"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qB,EACrB,SAAkB,GACrB,EAAE;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACrD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,EACD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,WAAW,CAAC;CAO1B"}
|
|
@@ -26,7 +26,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
26
26
|
* @param workflowId - The ID of the workflow to run
|
|
27
27
|
* @param documents - Mapping of start node IDs to their input documents
|
|
28
28
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
29
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
30
29
|
* @param options - Optional request options
|
|
31
30
|
* @returns The created workflow run with status "running"
|
|
32
31
|
*
|
|
@@ -40,14 +39,11 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
40
39
|
* jsonInputs: {
|
|
41
40
|
* "json-node-1": { key: "value" },
|
|
42
41
|
* },
|
|
43
|
-
* textInputs: {
|
|
44
|
-
* "text-node-1": "Hello, world!",
|
|
45
|
-
* }
|
|
46
42
|
* });
|
|
47
43
|
* console.log(`Run started: ${run.id}, status: ${run.status}`);
|
|
48
44
|
* ```
|
|
49
45
|
*/
|
|
50
|
-
async create({ workflowId, documents, jsonInputs,
|
|
46
|
+
async create({ workflowId, documents, jsonInputs, }, options) {
|
|
51
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
48
|
const body = {};
|
|
53
49
|
if (documents) {
|
|
@@ -67,9 +63,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
67
63
|
if (jsonInputs) {
|
|
68
64
|
body.json_inputs = jsonInputs;
|
|
69
65
|
}
|
|
70
|
-
if (textInputs) {
|
|
71
|
-
body.text_inputs = textInputs;
|
|
72
|
-
}
|
|
73
66
|
return this._fetchJson(ZWorkflowRun, {
|
|
74
67
|
url: `/v1/workflows/${workflowId}/run`,
|
|
75
68
|
method: "POST",
|
|
@@ -300,7 +293,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
300
293
|
* @param workflowId - The ID of the workflow to run
|
|
301
294
|
* @param documents - Mapping of start node IDs to their input documents
|
|
302
295
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
303
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
304
296
|
* @param pollIntervalMs - Milliseconds between polls (default: 2000)
|
|
305
297
|
* @param timeoutMs - Maximum time to wait in milliseconds (default: 600000)
|
|
306
298
|
* @param options - Optional request options
|
|
@@ -318,8 +310,8 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
318
310
|
* }
|
|
319
311
|
* ```
|
|
320
312
|
*/
|
|
321
|
-
async createAndWait({ workflowId, documents, jsonInputs,
|
|
322
|
-
const run = await this.create({ workflowId, documents, jsonInputs
|
|
313
|
+
async createAndWait({ workflowId, documents, jsonInputs, pollIntervalMs = 2000, timeoutMs = 600000, }, options) {
|
|
314
|
+
const run = await this.create({ workflowId, documents, jsonInputs }, options);
|
|
323
315
|
return this.waitForCompletion(run.id, { pollIntervalMs, timeoutMs });
|
|
324
316
|
}
|
|
325
317
|
}
|