unstructured-transform-client 0.18.20 → 0.18.22
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 +5 -2
- package/dist/_generated/apis/JobsApi.d.ts +7 -2
- package/dist/_generated/apis/JobsApi.js +5 -2
- package/dist/_generated/models/JobPage.d.ts +4 -0
- package/dist/_generated/models/JobPage.js +2 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -134,10 +134,13 @@ Polling with `client.jobs.get(job.body.id)` returns the same resource if you wou
|
|
|
134
134
|
rather not hold a connection open.
|
|
135
135
|
|
|
136
136
|
To scan jobs across every page, use the cursor-following async iterator.
|
|
137
|
-
`list()` still returns one page when you need page boundaries
|
|
137
|
+
`list()` still returns one page when you need page boundaries; its `totalCount`
|
|
138
|
+
is the number of matching jobs across all pages, or null/undefined when the
|
|
139
|
+
service cannot count. Both take `status` and `operation` (`"parse"` or
|
|
140
|
+
`"extract"`) filters. Jobs whose result has expired are not listed.
|
|
138
141
|
|
|
139
142
|
```ts
|
|
140
|
-
for await (const job of client.jobs.iterate({ status: "completed" })) {
|
|
143
|
+
for await (const job of client.jobs.iterate({ status: "completed", operation: "parse" })) {
|
|
141
144
|
console.log(job.id, job.status);
|
|
142
145
|
}
|
|
143
146
|
```
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type JobOperation } from '../models/JobOperation.js';
|
|
13
14
|
import { type JobPage } from '../models/JobPage.js';
|
|
14
15
|
import { type JobResult } from '../models/JobResult.js';
|
|
15
16
|
import { type JobStatus } from '../models/JobStatus.js';
|
|
@@ -53,6 +54,10 @@ export interface JobsListRequest {
|
|
|
53
54
|
* Return only jobs with this public status. completed_with_warnings maps to completed upstream and may include completed jobs without warnings.
|
|
54
55
|
*/
|
|
55
56
|
status?: JobStatus;
|
|
57
|
+
/**
|
|
58
|
+
* Return only jobs created by this operation.
|
|
59
|
+
*/
|
|
60
|
+
operation?: JobOperation;
|
|
56
61
|
}
|
|
57
62
|
/**
|
|
58
63
|
*
|
|
@@ -105,12 +110,12 @@ export declare class JobsApi extends runtime.BaseAPI {
|
|
|
105
110
|
*/
|
|
106
111
|
jobsListRequestOpts(requestParameters: JobsListRequest): Promise<runtime.RequestOpts>;
|
|
107
112
|
/**
|
|
108
|
-
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter.
|
|
113
|
+
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter. Jobs whose result has expired are omitted.
|
|
109
114
|
* List parse and extraction jobs
|
|
110
115
|
*/
|
|
111
116
|
jobsListRaw(requestParameters: JobsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobPage>>;
|
|
112
117
|
/**
|
|
113
|
-
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter.
|
|
118
|
+
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter. Jobs whose result has expired are omitted.
|
|
114
119
|
* List parse and extraction jobs
|
|
115
120
|
*/
|
|
116
121
|
jobsList(requestParameters?: JobsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobPage>;
|
|
@@ -172,6 +172,9 @@ export class JobsApi extends runtime.BaseAPI {
|
|
|
172
172
|
if (requestParameters['status'] != null) {
|
|
173
173
|
queryParameters['status'] = requestParameters['status'];
|
|
174
174
|
}
|
|
175
|
+
if (requestParameters['operation'] != null) {
|
|
176
|
+
queryParameters['operation'] = requestParameters['operation'];
|
|
177
|
+
}
|
|
175
178
|
const headerParameters = {};
|
|
176
179
|
if (this.configuration && this.configuration.apiKey) {
|
|
177
180
|
headerParameters["unstructured-api-key"] = await this.configuration.apiKey("unstructured-api-key"); // ApiKeyAuth authentication
|
|
@@ -192,7 +195,7 @@ export class JobsApi extends runtime.BaseAPI {
|
|
|
192
195
|
};
|
|
193
196
|
}
|
|
194
197
|
/**
|
|
195
|
-
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter.
|
|
198
|
+
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter. Jobs whose result has expired are omitted.
|
|
196
199
|
* List parse and extraction jobs
|
|
197
200
|
*/
|
|
198
201
|
async jobsListRaw(requestParameters, initOverrides) {
|
|
@@ -201,7 +204,7 @@ export class JobsApi extends runtime.BaseAPI {
|
|
|
201
204
|
return new runtime.JSONApiResponse(response, (jsonValue) => JobPageFromJSON(jsonValue));
|
|
202
205
|
}
|
|
203
206
|
/**
|
|
204
|
-
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter.
|
|
207
|
+
* Returns this caller\'s visible jobs, newest first. Tenant scope comes from the credential; the request has no tenant parameter. Jobs whose result has expired are omitted.
|
|
205
208
|
* List parse and extraction jobs
|
|
206
209
|
*/
|
|
207
210
|
async jobsList(requestParameters = {}, initOverrides) {
|
|
@@ -24,6 +24,10 @@ export interface JobPage {
|
|
|
24
24
|
* Opaque cursor for the next page, or null at the end.
|
|
25
25
|
*/
|
|
26
26
|
nextCursor: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Number of jobs matching every filter across all pages, or null when unknown.
|
|
29
|
+
*/
|
|
30
|
+
totalCount?: number | null;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
33
|
* Check if a given object implements the JobPage interface.
|
|
@@ -32,6 +32,7 @@ export function JobPageFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
32
32
|
return {
|
|
33
33
|
'jobs': (json['jobs'].map(JobSummaryFromJSON)),
|
|
34
34
|
'nextCursor': json['next_cursor'],
|
|
35
|
+
'totalCount': json['total_count'] === undefined ? undefined : json['total_count'] === null ? null : json['total_count'],
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
export function JobPageToJSON(json) {
|
|
@@ -44,5 +45,6 @@ export function JobPageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
44
45
|
return {
|
|
45
46
|
'jobs': (value['jobs'].map(JobSummaryToJSON)),
|
|
46
47
|
'next_cursor': value['nextCursor'],
|
|
48
|
+
'total_count': value['totalCount'],
|
|
47
49
|
};
|
|
48
50
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { ParseRunProfileEnum } from "./_generated/apis/ParseApi.js";
|
|
23
23
|
import { Configuration } from "./_generated/runtime.js";
|
|
24
|
-
import type { JobPage, JobResult, JobStatus, OutputFormat, ParseResult, UploadResult } from "./_generated/models/index.js";
|
|
24
|
+
import type { JobOperation, JobPage, JobResult, JobStatus, OutputFormat, ParseResult, UploadResult } from "./_generated/models/index.js";
|
|
25
25
|
import { type FileInput } from "./files.js";
|
|
26
26
|
import { type Outcome } from "./outcome.js";
|
|
27
27
|
import { type RetryConfig } from "./retry.js";
|
|
@@ -112,6 +112,7 @@ export interface JobsListOptions {
|
|
|
112
112
|
cursor?: string;
|
|
113
113
|
limit?: number;
|
|
114
114
|
status?: JobStatus;
|
|
115
|
+
operation?: JobOperation;
|
|
115
116
|
}
|
|
116
117
|
export interface JobsStreamOptions {
|
|
117
118
|
signal?: AbortSignal;
|
package/dist/client.js
CHANGED
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED