unstructured-transform-client 0.18.19 → 0.18.21

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 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) {
@@ -75,5 +75,6 @@ export declare class ParseApi extends runtime.BaseAPI {
75
75
  export declare const ParseRunProfileEnum: {
76
76
  readonly Balanced: "balanced";
77
77
  readonly Best: "best";
78
+ readonly Fast: "fast";
78
79
  };
79
80
  export type ParseRunProfileEnum = typeof ParseRunProfileEnum[keyof typeof ParseRunProfileEnum];
@@ -108,4 +108,5 @@ export class ParseApi extends runtime.BaseAPI {
108
108
  export const ParseRunProfileEnum = {
109
109
  Balanced: 'balanced',
110
110
  Best: 'best',
111
+ Fast: 'fast',
111
112
  };
@@ -55,6 +55,7 @@ export type JobAcceptedStatusEnum = typeof JobAcceptedStatusEnum[keyof typeof Jo
55
55
  export declare const JobAcceptedProfileEnum: {
56
56
  readonly Balanced: "balanced";
57
57
  readonly Best: "best";
58
+ readonly Fast: "fast";
58
59
  };
59
60
  export type JobAcceptedProfileEnum = typeof JobAcceptedProfileEnum[keyof typeof JobAcceptedProfileEnum];
60
61
  /**
@@ -24,6 +24,7 @@ export const JobAcceptedStatusEnum = {
24
24
  export const JobAcceptedProfileEnum = {
25
25
  Balanced: 'balanced',
26
26
  Best: 'best',
27
+ Fast: 'fast',
27
28
  };
28
29
  /**
29
30
  * Check if a given object implements the JobAccepted interface.
@@ -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
  }
@@ -68,6 +68,7 @@ export interface ParseResult {
68
68
  export declare const ParseResultProfileEnum: {
69
69
  readonly Balanced: "balanced";
70
70
  readonly Best: "best";
71
+ readonly Fast: "fast";
71
72
  };
72
73
  export type ParseResultProfileEnum = typeof ParseResultProfileEnum[keyof typeof ParseResultProfileEnum];
73
74
  /**
@@ -23,6 +23,7 @@ import { SourceFileFromJSON, SourceFileToJSON, } from './SourceFile.js';
23
23
  export const ParseResultProfileEnum = {
24
24
  Balanced: 'balanced',
25
25
  Best: 'best',
26
+ Fast: 'fast',
26
27
  };
27
28
  /**
28
29
  * @export
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
@@ -195,6 +195,7 @@ class JobsNamespace {
195
195
  cursor: options.cursor,
196
196
  limit: options.limit,
197
197
  status: options.status,
198
+ operation: options.operation,
198
199
  });
199
200
  }
200
201
  async *iterate(options = {}) {
package/dist/version.d.ts CHANGED
@@ -7,4 +7,4 @@
7
7
  * runtime, because importing JSON differs across module systems and bundlers
8
8
  * and would make this module's behaviour depend on how it was built.
9
9
  */
10
- export declare const VERSION = "0.18.19";
10
+ export declare const VERSION = "0.18.21";
package/dist/version.js CHANGED
@@ -7,4 +7,4 @@
7
7
  * runtime, because importing JSON differs across module systems and bundlers
8
8
  * and would make this module's behaviour depend on how it was built.
9
9
  */
10
- export const VERSION = "0.18.19";
10
+ export const VERSION = "0.18.21";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unstructured-transform-client",
3
- "version": "0.18.19",
3
+ "version": "0.18.21",
4
4
  "description": "TypeScript client for the Unstructured Transform v2 API — one document in, structured output back.",
5
5
  "license": "MIT",
6
6
  "author": "Unstructured",