@retab/node 1.0.94 → 1.0.96
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 +1 -1
- package/dist/api/workflows/runs/client.js +1 -1
- 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 +12 -16
- 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 +196 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +27 -0
- 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;AACjE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,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,OAAO,MAAM,eAAe,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,iBAAiB;gBACpC,MAAM,EAAE,cAAc;IAGlC,MAAM,YAAuB;IAC7B,SAAS,eAA0B;IACnC,OAAO,aAAwB;IAC/B,QAAQ,cAAyB;IACjC,WAAW,iBAA4B;IACvC,SAAS,eAA0B;IACnC,IAAI,UAAqB;IACzB,IAAI,UAAqB;CAC5B"}
|
|
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,SAAS,MAAM,iBAAiB,CAAC;AACxC,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,MAAM,YAAuB;IAC7B,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
|
@@ -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,S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,GACzB,OAAO,CAAC,UAAU,CAAC;IAiBtB;;OAEG;IACG,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,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
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ function sleep(ms) {
|
|
|
9
9
|
* Workflow Runs API client for managing workflow executions.
|
|
10
10
|
*
|
|
11
11
|
* Sub-clients:
|
|
12
|
-
* - steps: Step output operations (get,
|
|
12
|
+
* - steps: Step output operations (get, list)
|
|
13
13
|
*/
|
|
14
14
|
export default class APIWorkflowRuns extends CompositionClient {
|
|
15
15
|
constructor(client) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CompositionClient, RequestOptions } from "../../../../client.js";
|
|
2
|
-
import { StepOutputResponse,
|
|
2
|
+
import { StepOutputResponse, WorkflowRunStep } from "../../../../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Workflow Run Steps API client for accessing step-level outputs.
|
|
5
5
|
*
|
|
6
|
-
* Usage: `client.workflows.runs.steps.get(runId, nodeId)`
|
|
6
|
+
* Usage: `client.workflows.runs.steps.get(runId, nodeId)` or `client.workflows.runs.steps.list(runId)`
|
|
7
7
|
*/
|
|
8
8
|
export default class APIWorkflowRunSteps extends CompositionClient {
|
|
9
9
|
constructor(client: CompositionClient);
|
|
@@ -23,24 +23,20 @@ export default class APIWorkflowRunSteps extends CompositionClient {
|
|
|
23
23
|
*/
|
|
24
24
|
get(runId: string, nodeId: string, options?: RequestOptions): Promise<StepOutputResponse>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* List all persisted step documents for a workflow run.
|
|
27
27
|
*
|
|
28
28
|
* @param runId - The ID of the workflow run
|
|
29
|
-
* @param nodeIds - List of node IDs to fetch outputs for (max 1000)
|
|
30
29
|
* @param options - Optional request options
|
|
31
|
-
* @returns
|
|
30
|
+
* @returns All step documents for the run
|
|
32
31
|
*
|
|
33
32
|
* @example
|
|
34
33
|
* ```typescript
|
|
35
|
-
* const
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* );
|
|
39
|
-
* for (const [nodeId, step] of Object.entries(batch.outputs)) {
|
|
40
|
-
* console.log(`${nodeId}: ${step.status}`);
|
|
34
|
+
* const steps = await client.workflows.runs.steps.list("run_abc123");
|
|
35
|
+
* for (const step of steps) {
|
|
36
|
+
* console.log(`${step.node_id}: ${step.status}`);
|
|
41
37
|
* }
|
|
42
38
|
* ```
|
|
43
39
|
*/
|
|
44
|
-
|
|
40
|
+
list(runId: string, options?: RequestOptions): Promise<WorkflowRunStep[]>;
|
|
45
41
|
}
|
|
46
42
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/api/workflows/runs/steps/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACH,kBAAkB,EAElB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/api/workflows/runs/steps/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACH,kBAAkB,EAElB,eAAe,EAElB,MAAM,sBAAsB,CAAC;AAG9B;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,iBAAiB;gBAClD,MAAM,EAAE,iBAAiB;IAIrC;;;;;;;;;;;;;OAaG;IACG,GAAG,CACL,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,kBAAkB,CAAC;IAS9B;;;;;;;;;;;;;;OAcG;IACG,IAAI,CACN,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC;CAQhC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CompositionClient } from "../../../../client.js";
|
|
2
|
-
import { ZStepOutputResponse,
|
|
2
|
+
import { ZStepOutputResponse, ZWorkflowRunStep, } from "../../../../types.js";
|
|
3
|
+
import * as z from "zod";
|
|
3
4
|
/**
|
|
4
5
|
* Workflow Run Steps API client for accessing step-level outputs.
|
|
5
6
|
*
|
|
6
|
-
* Usage: `client.workflows.runs.steps.get(runId, nodeId)`
|
|
7
|
+
* Usage: `client.workflows.runs.steps.get(runId, nodeId)` or `client.workflows.runs.steps.list(runId)`
|
|
7
8
|
*/
|
|
8
9
|
export default class APIWorkflowRunSteps extends CompositionClient {
|
|
9
10
|
constructor(client) {
|
|
@@ -32,29 +33,24 @@ export default class APIWorkflowRunSteps extends CompositionClient {
|
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* List all persisted step documents for a workflow run.
|
|
36
37
|
*
|
|
37
38
|
* @param runId - The ID of the workflow run
|
|
38
|
-
* @param nodeIds - List of node IDs to fetch outputs for (max 1000)
|
|
39
39
|
* @param options - Optional request options
|
|
40
|
-
* @returns
|
|
40
|
+
* @returns All step documents for the run
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```typescript
|
|
44
|
-
* const
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* );
|
|
48
|
-
* for (const [nodeId, step] of Object.entries(batch.outputs)) {
|
|
49
|
-
* console.log(`${nodeId}: ${step.status}`);
|
|
44
|
+
* const steps = await client.workflows.runs.steps.list("run_abc123");
|
|
45
|
+
* for (const step of steps) {
|
|
46
|
+
* console.log(`${step.node_id}: ${step.status}`);
|
|
50
47
|
* }
|
|
51
48
|
* ```
|
|
52
49
|
*/
|
|
53
|
-
async
|
|
54
|
-
return this._fetchJson(
|
|
55
|
-
url: `/v1/workflows/runs/${runId}/steps
|
|
56
|
-
method: "
|
|
57
|
-
body: { node_ids: nodeIds, ...(options?.body || {}) },
|
|
50
|
+
async list(runId, options) {
|
|
51
|
+
return this._fetchJson(z.array(ZWorkflowRunStep), {
|
|
52
|
+
url: `/v1/workflows/runs/${runId}/steps`,
|
|
53
|
+
method: "GET",
|
|
58
54
|
params: options?.params,
|
|
59
55
|
headers: options?.headers,
|
|
60
56
|
});
|