@retab/node 1.0.86 → 1.0.90
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 +58 -52
- package/dist/api/jobs/client.d.ts.map +1 -1
- package/dist/api/jobs/client.js +12 -3
- package/dist/generated_types.d.ts +21373 -11400
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +422 -20
- package/dist/types.d.ts +12 -11
- 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,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
|
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,EAAk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,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;KAChC,EACN,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;OAEG;IACG,MAAM,CACR,aAAa,EAAE,MAAM,EACrB,EACI,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,QAAQ,GACX,EAAE;QACC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACxC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC,EACD,OAAO,CAAC,EAAE,cAAc,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;;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)
|
|
@@ -32,7 +32,7 @@ declare const ZJob: z.ZodObject<{
|
|
|
32
32
|
object: z.ZodLiteral<"job">;
|
|
33
33
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
34
34
|
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
|
|
35
|
+
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
36
36
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
37
37
|
status_code: z.ZodNumber;
|
|
38
38
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -64,14 +64,18 @@ declare const ZJob: z.ZodObject<{
|
|
|
64
64
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
65
65
|
}, "strip", z.ZodTypeAny, {
|
|
66
66
|
object: "job";
|
|
67
|
-
status: "
|
|
67
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
68
68
|
id: string;
|
|
69
|
-
|
|
69
|
+
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
70
|
created_at: number;
|
|
71
71
|
expires_at: number;
|
|
72
|
-
|
|
73
|
-
request: Record<string, any>;
|
|
72
|
+
organization_id: string;
|
|
74
73
|
metadata?: Record<string, string> | null | undefined;
|
|
74
|
+
request?: Record<string, any> | null | undefined;
|
|
75
|
+
response?: {
|
|
76
|
+
status_code: number;
|
|
77
|
+
body: Record<string, any>;
|
|
78
|
+
} | null | undefined;
|
|
75
79
|
error?: {
|
|
76
80
|
code: string;
|
|
77
81
|
message: string;
|
|
@@ -79,20 +83,20 @@ declare const ZJob: z.ZodObject<{
|
|
|
79
83
|
} | null | undefined;
|
|
80
84
|
started_at?: number | null | undefined;
|
|
81
85
|
completed_at?: number | null | undefined;
|
|
82
|
-
response?: {
|
|
83
|
-
status_code: number;
|
|
84
|
-
body: Record<string, any>;
|
|
85
|
-
} | null | undefined;
|
|
86
86
|
}, {
|
|
87
87
|
object: "job";
|
|
88
|
-
status: "
|
|
88
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
89
89
|
id: string;
|
|
90
|
-
|
|
90
|
+
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
91
|
created_at: number;
|
|
92
92
|
expires_at: number;
|
|
93
|
-
|
|
94
|
-
request: Record<string, any>;
|
|
93
|
+
organization_id: string;
|
|
95
94
|
metadata?: Record<string, string> | null | undefined;
|
|
95
|
+
request?: Record<string, any> | null | undefined;
|
|
96
|
+
response?: {
|
|
97
|
+
status_code: number;
|
|
98
|
+
body: Record<string, any>;
|
|
99
|
+
} | null | undefined;
|
|
96
100
|
error?: {
|
|
97
101
|
code: string;
|
|
98
102
|
message: string;
|
|
@@ -100,10 +104,6 @@ declare const ZJob: z.ZodObject<{
|
|
|
100
104
|
} | null | undefined;
|
|
101
105
|
started_at?: number | null | undefined;
|
|
102
106
|
completed_at?: number | null | undefined;
|
|
103
|
-
response?: {
|
|
104
|
-
status_code: number;
|
|
105
|
-
body: Record<string, any>;
|
|
106
|
-
} | null | undefined;
|
|
107
107
|
}>;
|
|
108
108
|
type Job = z.infer<typeof ZJob>;
|
|
109
109
|
declare const ZJobListResponse: z.ZodObject<{
|
|
@@ -113,7 +113,7 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
113
113
|
object: z.ZodLiteral<"job">;
|
|
114
114
|
status: z.ZodEnum<["validating", "queued", "in_progress", "completed", "failed", "cancelled", "expired"]>;
|
|
115
115
|
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
|
|
116
|
+
request: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
117
117
|
response: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
118
118
|
status_code: z.ZodNumber;
|
|
119
119
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -145,14 +145,18 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
145
145
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
146
146
|
}, "strip", z.ZodTypeAny, {
|
|
147
147
|
object: "job";
|
|
148
|
-
status: "
|
|
148
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
149
149
|
id: string;
|
|
150
|
-
|
|
150
|
+
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
151
|
created_at: number;
|
|
152
152
|
expires_at: number;
|
|
153
|
-
|
|
154
|
-
request: Record<string, any>;
|
|
153
|
+
organization_id: string;
|
|
155
154
|
metadata?: Record<string, string> | null | undefined;
|
|
155
|
+
request?: Record<string, any> | null | undefined;
|
|
156
|
+
response?: {
|
|
157
|
+
status_code: number;
|
|
158
|
+
body: Record<string, any>;
|
|
159
|
+
} | null | undefined;
|
|
156
160
|
error?: {
|
|
157
161
|
code: string;
|
|
158
162
|
message: string;
|
|
@@ -160,20 +164,20 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
160
164
|
} | null | undefined;
|
|
161
165
|
started_at?: number | null | undefined;
|
|
162
166
|
completed_at?: number | null | undefined;
|
|
163
|
-
response?: {
|
|
164
|
-
status_code: number;
|
|
165
|
-
body: Record<string, any>;
|
|
166
|
-
} | null | undefined;
|
|
167
167
|
}, {
|
|
168
168
|
object: "job";
|
|
169
|
-
status: "
|
|
169
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
170
170
|
id: string;
|
|
171
|
-
|
|
171
|
+
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
172
|
created_at: number;
|
|
173
173
|
expires_at: number;
|
|
174
|
-
|
|
175
|
-
request: Record<string, any>;
|
|
174
|
+
organization_id: string;
|
|
176
175
|
metadata?: Record<string, string> | null | undefined;
|
|
176
|
+
request?: Record<string, any> | null | undefined;
|
|
177
|
+
response?: {
|
|
178
|
+
status_code: number;
|
|
179
|
+
body: Record<string, any>;
|
|
180
|
+
} | null | undefined;
|
|
177
181
|
error?: {
|
|
178
182
|
code: string;
|
|
179
183
|
message: string;
|
|
@@ -181,10 +185,6 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
181
185
|
} | null | undefined;
|
|
182
186
|
started_at?: number | null | undefined;
|
|
183
187
|
completed_at?: number | null | undefined;
|
|
184
|
-
response?: {
|
|
185
|
-
status_code: number;
|
|
186
|
-
body: Record<string, any>;
|
|
187
|
-
} | null | undefined;
|
|
188
188
|
}>, "many">;
|
|
189
189
|
first_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
190
|
last_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -193,14 +193,18 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
193
193
|
object: "list";
|
|
194
194
|
data: {
|
|
195
195
|
object: "job";
|
|
196
|
-
status: "
|
|
196
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
197
197
|
id: string;
|
|
198
|
-
|
|
198
|
+
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
199
|
created_at: number;
|
|
200
200
|
expires_at: number;
|
|
201
|
-
|
|
202
|
-
request: Record<string, any>;
|
|
201
|
+
organization_id: string;
|
|
203
202
|
metadata?: Record<string, string> | null | undefined;
|
|
203
|
+
request?: Record<string, any> | null | undefined;
|
|
204
|
+
response?: {
|
|
205
|
+
status_code: number;
|
|
206
|
+
body: Record<string, any>;
|
|
207
|
+
} | null | undefined;
|
|
204
208
|
error?: {
|
|
205
209
|
code: string;
|
|
206
210
|
message: string;
|
|
@@ -208,10 +212,6 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
208
212
|
} | null | undefined;
|
|
209
213
|
started_at?: number | null | undefined;
|
|
210
214
|
completed_at?: number | null | undefined;
|
|
211
|
-
response?: {
|
|
212
|
-
status_code: number;
|
|
213
|
-
body: Record<string, any>;
|
|
214
|
-
} | null | undefined;
|
|
215
215
|
}[];
|
|
216
216
|
has_more: boolean;
|
|
217
217
|
first_id?: string | null | undefined;
|
|
@@ -220,14 +220,18 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
220
220
|
object: "list";
|
|
221
221
|
data: {
|
|
222
222
|
object: "job";
|
|
223
|
-
status: "
|
|
223
|
+
status: "validating" | "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "expired";
|
|
224
224
|
id: string;
|
|
225
|
-
|
|
225
|
+
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
226
|
created_at: number;
|
|
227
227
|
expires_at: number;
|
|
228
|
-
|
|
229
|
-
request: Record<string, any>;
|
|
228
|
+
organization_id: string;
|
|
230
229
|
metadata?: Record<string, string> | null | undefined;
|
|
230
|
+
request?: Record<string, any> | null | undefined;
|
|
231
|
+
response?: {
|
|
232
|
+
status_code: number;
|
|
233
|
+
body: Record<string, any>;
|
|
234
|
+
} | null | undefined;
|
|
231
235
|
error?: {
|
|
232
236
|
code: string;
|
|
233
237
|
message: string;
|
|
@@ -235,16 +239,16 @@ declare const ZJobListResponse: z.ZodObject<{
|
|
|
235
239
|
} | null | undefined;
|
|
236
240
|
started_at?: number | null | undefined;
|
|
237
241
|
completed_at?: number | null | undefined;
|
|
238
|
-
response?: {
|
|
239
|
-
status_code: number;
|
|
240
|
-
body: Record<string, any>;
|
|
241
|
-
} | null | undefined;
|
|
242
242
|
}[];
|
|
243
243
|
has_more: boolean;
|
|
244
244
|
first_id?: string | null | undefined;
|
|
245
245
|
last_id?: string | null | undefined;
|
|
246
246
|
}>;
|
|
247
247
|
type JobListResponse = z.infer<typeof ZJobListResponse>;
|
|
248
|
+
type JobRetrieveOptions = RequestOptions & {
|
|
249
|
+
include_request?: boolean;
|
|
250
|
+
include_response?: boolean;
|
|
251
|
+
};
|
|
248
252
|
export default class APIJobs extends CompositionClient {
|
|
249
253
|
constructor(client: CompositionClient);
|
|
250
254
|
/**
|
|
@@ -262,7 +266,7 @@ export default class APIJobs extends CompositionClient {
|
|
|
262
266
|
/**
|
|
263
267
|
* Retrieve a job by ID.
|
|
264
268
|
*/
|
|
265
|
-
retrieve(job_id: string, options?:
|
|
269
|
+
retrieve(job_id: string, options?: JobRetrieveOptions): Promise<Job>;
|
|
266
270
|
/**
|
|
267
271
|
* Cancel a queued or in-progress job.
|
|
268
272
|
*/
|
|
@@ -270,10 +274,12 @@ export default class APIJobs extends CompositionClient {
|
|
|
270
274
|
/**
|
|
271
275
|
* List jobs with pagination and optional status filtering.
|
|
272
276
|
*/
|
|
273
|
-
list({ after, limit, status, }?: {
|
|
277
|
+
list({ after, limit, status, include_request, include_response, }?: {
|
|
274
278
|
after?: string;
|
|
275
279
|
limit?: number;
|
|
276
280
|
status?: JobStatus;
|
|
281
|
+
include_request?: boolean;
|
|
282
|
+
include_response?: boolean;
|
|
277
283
|
}, options?: RequestOptions): Promise<JobListResponse>;
|
|
278
284
|
}
|
|
279
285
|
export { Job, JobListResponse, JobStatus, SupportedEndpoint, JobResponse, JobError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":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,MAAM,CAAC,EAAE,SAAS,CAAC;QACnB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KACzB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;CAqB9D;AAED,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,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,10 +75,17 @@ export default class APIJobs extends CompositionClient {
|
|
|
75
75
|
* Retrieve a job by ID.
|
|
76
76
|
*/
|
|
77
77
|
async retrieve(job_id, options) {
|
|
78
|
+
const params = {
|
|
79
|
+
...(options?.params || {}),
|
|
80
|
+
};
|
|
81
|
+
if (options?.include_request !== undefined)
|
|
82
|
+
params.include_request = options.include_request;
|
|
83
|
+
if (options?.include_response !== undefined)
|
|
84
|
+
params.include_response = options.include_response;
|
|
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
|
}
|
|
@@ -96,11 +103,13 @@ export default class APIJobs extends CompositionClient {
|
|
|
96
103
|
/**
|
|
97
104
|
* List jobs with pagination and optional status filtering.
|
|
98
105
|
*/
|
|
99
|
-
async list({ after, limit = 20, status, } = {}, options) {
|
|
106
|
+
async list({ after, limit = 20, status, include_request, include_response, } = {}, options) {
|
|
100
107
|
const params = {
|
|
101
108
|
after,
|
|
102
109
|
limit,
|
|
103
110
|
status,
|
|
111
|
+
include_request,
|
|
112
|
+
include_response,
|
|
104
113
|
};
|
|
105
114
|
// Remove undefined values
|
|
106
115
|
const cleanParams = Object.fromEntries(Object.entries(params).filter(([_, v]) => v !== undefined));
|