@mixedbread/sdk 0.11.1 → 0.12.0

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +0 -31
  3. package/client.d.mts +6 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/data-sources/connectors.d.mts +106 -5
  10. package/resources/data-sources/connectors.d.mts.map +1 -1
  11. package/resources/data-sources/connectors.d.ts +106 -5
  12. package/resources/data-sources/connectors.d.ts.map +1 -1
  13. package/resources/data-sources/connectors.js +1 -2
  14. package/resources/data-sources/connectors.js.map +1 -1
  15. package/resources/data-sources/connectors.mjs +1 -2
  16. package/resources/data-sources/connectors.mjs.map +1 -1
  17. package/resources/data-sources/data-sources.d.mts +108 -7
  18. package/resources/data-sources/data-sources.d.mts.map +1 -1
  19. package/resources/data-sources/data-sources.d.ts +108 -7
  20. package/resources/data-sources/data-sources.d.ts.map +1 -1
  21. package/resources/data-sources/data-sources.js +1 -2
  22. package/resources/data-sources/data-sources.js.map +1 -1
  23. package/resources/data-sources/data-sources.mjs +1 -2
  24. package/resources/data-sources/data-sources.mjs.map +1 -1
  25. package/resources/data-sources/index.d.mts +2 -2
  26. package/resources/data-sources/index.d.mts.map +1 -1
  27. package/resources/data-sources/index.d.ts +2 -2
  28. package/resources/data-sources/index.d.ts.map +1 -1
  29. package/resources/files.d.mts +107 -5
  30. package/resources/files.d.mts.map +1 -1
  31. package/resources/files.d.ts +107 -5
  32. package/resources/files.d.ts.map +1 -1
  33. package/resources/files.js +1 -2
  34. package/resources/files.js.map +1 -1
  35. package/resources/files.mjs +1 -2
  36. package/resources/files.mjs.map +1 -1
  37. package/resources/index.d.mts +3 -3
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +3 -3
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/parsing/index.d.mts +1 -1
  42. package/resources/parsing/index.d.mts.map +1 -1
  43. package/resources/parsing/index.d.ts +1 -1
  44. package/resources/parsing/index.d.ts.map +1 -1
  45. package/resources/parsing/index.js.map +1 -1
  46. package/resources/parsing/index.mjs.map +1 -1
  47. package/resources/parsing/jobs.d.mts +134 -29
  48. package/resources/parsing/jobs.d.mts.map +1 -1
  49. package/resources/parsing/jobs.d.ts +134 -29
  50. package/resources/parsing/jobs.d.ts.map +1 -1
  51. package/resources/parsing/jobs.js +1 -2
  52. package/resources/parsing/jobs.js.map +1 -1
  53. package/resources/parsing/jobs.mjs +1 -2
  54. package/resources/parsing/jobs.mjs.map +1 -1
  55. package/resources/parsing/parsing.d.mts +2 -2
  56. package/resources/parsing/parsing.d.mts.map +1 -1
  57. package/resources/parsing/parsing.d.ts +2 -2
  58. package/resources/parsing/parsing.d.ts.map +1 -1
  59. package/resources/parsing/parsing.js.map +1 -1
  60. package/resources/parsing/parsing.mjs.map +1 -1
  61. package/resources/vector-stores/files.d.mts +103 -5
  62. package/resources/vector-stores/files.d.mts.map +1 -1
  63. package/resources/vector-stores/files.d.ts +103 -5
  64. package/resources/vector-stores/files.d.ts.map +1 -1
  65. package/resources/vector-stores/files.js +1 -2
  66. package/resources/vector-stores/files.js.map +1 -1
  67. package/resources/vector-stores/files.mjs +1 -2
  68. package/resources/vector-stores/files.mjs.map +1 -1
  69. package/resources/vector-stores/index.d.mts +2 -2
  70. package/resources/vector-stores/index.d.mts.map +1 -1
  71. package/resources/vector-stores/index.d.ts +2 -2
  72. package/resources/vector-stores/index.d.ts.map +1 -1
  73. package/resources/vector-stores/vector-stores.d.mts +105 -7
  74. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  75. package/resources/vector-stores/vector-stores.d.ts +105 -7
  76. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  77. package/resources/vector-stores/vector-stores.js +1 -2
  78. package/resources/vector-stores/vector-stores.js.map +1 -1
  79. package/resources/vector-stores/vector-stores.mjs +1 -2
  80. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  81. package/src/client.ts +6 -6
  82. package/src/resources/data-sources/connectors.ts +118 -11
  83. package/src/resources/data-sources/data-sources.ts +120 -9
  84. package/src/resources/data-sources/index.ts +2 -2
  85. package/src/resources/files.ts +120 -7
  86. package/src/resources/index.ts +3 -3
  87. package/src/resources/parsing/index.ts +0 -1
  88. package/src/resources/parsing/jobs.ts +146 -34
  89. package/src/resources/parsing/parsing.ts +0 -2
  90. package/src/resources/vector-stores/files.ts +115 -11
  91. package/src/resources/vector-stores/index.ts +2 -2
  92. package/src/resources/vector-stores/vector-stores.ts +117 -9
  93. package/src/version.ts +1 -1
  94. package/version.d.mts +1 -1
  95. package/version.d.ts +1 -1
  96. package/version.js +1 -1
  97. package/version.mjs +1 -1
@@ -7,14 +7,13 @@ import {
7
7
  ConnectorDeleteParams,
8
8
  ConnectorDeleteResponse,
9
9
  ConnectorListParams,
10
+ ConnectorListResponse,
10
11
  ConnectorRetrieveParams,
11
12
  ConnectorUpdateParams,
12
13
  Connectors,
13
14
  DataSourceConnector,
14
- DataSourceConnectorsCursor,
15
15
  } from './connectors';
16
16
  import { APIPromise } from '../../core/api-promise';
17
- import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
18
17
  import { RequestOptions } from '../../internal/request-options';
19
18
  import { path } from '../../internal/utils/path';
20
19
 
@@ -67,8 +66,8 @@ export class DataSources extends APIResource {
67
66
  list(
68
67
  query: DataSourceListParams | null | undefined = {},
69
68
  options?: RequestOptions,
70
- ): PagePromise<DataSourcesCursor, DataSource> {
71
- return this._client.getAPIList('/v1/data_sources/', Cursor<DataSource>, { query, ...options });
69
+ ): APIPromise<DataSourceListResponse> {
70
+ return this._client.get('/v1/data_sources/', { query, ...options });
72
71
  }
73
72
 
74
73
  /**
@@ -81,8 +80,6 @@ export class DataSources extends APIResource {
81
80
  }
82
81
  }
83
82
 
84
- export type DataSourcesCursor = Cursor<DataSource>;
85
-
86
83
  /**
87
84
  * Service-level representation of a data source.
88
85
  */
@@ -258,6 +255,98 @@ export interface Oauth2Params {
258
255
  type?: 'oauth2';
259
256
  }
260
257
 
258
+ /**
259
+ * A list of data sources with pagination.
260
+ */
261
+ export interface DataSourceListResponse {
262
+ /**
263
+ * Response model for cursor-based pagination.
264
+ *
265
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
266
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
267
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
268
+ *
269
+ * Final page response:
270
+ * {
271
+ * "has_more": false,
272
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
273
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
274
+ * "total": 42
275
+ * }
276
+ *
277
+ * Empty results:
278
+ * {
279
+ * "has_more": false,
280
+ * "first_cursor": null,
281
+ * "last_cursor": null,
282
+ * "total": 0
283
+ * }
284
+ */
285
+ pagination: DataSourceListResponse.Pagination;
286
+
287
+ /**
288
+ * The list of data sources
289
+ */
290
+ data: Array<DataSource>;
291
+
292
+ /**
293
+ * The object type of the response
294
+ */
295
+ object?: 'list';
296
+ }
297
+
298
+ export namespace DataSourceListResponse {
299
+ /**
300
+ * Response model for cursor-based pagination.
301
+ *
302
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
303
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
304
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
305
+ *
306
+ * Final page response:
307
+ * {
308
+ * "has_more": false,
309
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
310
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
311
+ * "total": 42
312
+ * }
313
+ *
314
+ * Empty results:
315
+ * {
316
+ * "has_more": false,
317
+ * "first_cursor": null,
318
+ * "last_cursor": null,
319
+ * "total": 0
320
+ * }
321
+ */
322
+ export interface Pagination {
323
+ /**
324
+ * Contextual direction-aware flag: True if more items exist in the requested
325
+ * pagination direction. For 'after': more items after this page. For 'before':
326
+ * more items before this page.
327
+ */
328
+ has_more: boolean;
329
+
330
+ /**
331
+ * Cursor of the first item in this page. Use for backward pagination. None if page
332
+ * is empty.
333
+ */
334
+ first_cursor: string | null;
335
+
336
+ /**
337
+ * Cursor of the last item in this page. Use for forward pagination. None if page
338
+ * is empty.
339
+ */
340
+ last_cursor: string | null;
341
+
342
+ /**
343
+ * Total number of items available across all pages. Only included when
344
+ * include_total=true was requested. Expensive operation - use sparingly.
345
+ */
346
+ total?: number | null;
347
+ }
348
+ }
349
+
261
350
  /**
262
351
  * Deleted data source.
263
352
  */
@@ -408,7 +497,29 @@ export declare namespace DataSourceUpdateParams {
408
497
  }
409
498
  }
410
499
 
411
- export interface DataSourceListParams extends CursorParams {}
500
+ export interface DataSourceListParams {
501
+ /**
502
+ * Maximum number of items to return per page (1-100)
503
+ */
504
+ limit?: number;
505
+
506
+ /**
507
+ * Cursor for forward pagination - get items after this position. Use last_cursor
508
+ * from previous response.
509
+ */
510
+ after?: string | null;
511
+
512
+ /**
513
+ * Cursor for backward pagination - get items before this position. Use
514
+ * first_cursor from previous response.
515
+ */
516
+ before?: string | null;
517
+
518
+ /**
519
+ * Whether to include total count in response (expensive operation)
520
+ */
521
+ include_total?: boolean;
522
+ }
412
523
 
413
524
  DataSources.Connectors = Connectors;
414
525
 
@@ -420,8 +531,8 @@ export declare namespace DataSources {
420
531
  type LinearDataSource as LinearDataSource,
421
532
  type NotionDataSource as NotionDataSource,
422
533
  type Oauth2Params as Oauth2Params,
534
+ type DataSourceListResponse as DataSourceListResponse,
423
535
  type DataSourceDeleteResponse as DataSourceDeleteResponse,
424
- type DataSourcesCursor as DataSourcesCursor,
425
536
  type DataSourceCreateParams as DataSourceCreateParams,
426
537
  type DataSourceUpdateParams as DataSourceUpdateParams,
427
538
  type DataSourceListParams as DataSourceListParams,
@@ -430,8 +541,8 @@ export declare namespace DataSources {
430
541
  export {
431
542
  Connectors as Connectors,
432
543
  type DataSourceConnector as DataSourceConnector,
544
+ type ConnectorListResponse as ConnectorListResponse,
433
545
  type ConnectorDeleteResponse as ConnectorDeleteResponse,
434
- type DataSourceConnectorsCursor as DataSourceConnectorsCursor,
435
546
  type ConnectorCreateParams as ConnectorCreateParams,
436
547
  type ConnectorRetrieveParams as ConnectorRetrieveParams,
437
548
  type ConnectorUpdateParams as ConnectorUpdateParams,
@@ -3,13 +3,13 @@
3
3
  export {
4
4
  Connectors,
5
5
  type DataSourceConnector,
6
+ type ConnectorListResponse,
6
7
  type ConnectorDeleteResponse,
7
8
  type ConnectorCreateParams,
8
9
  type ConnectorRetrieveParams,
9
10
  type ConnectorUpdateParams,
10
11
  type ConnectorListParams,
11
12
  type ConnectorDeleteParams,
12
- type DataSourceConnectorsCursor,
13
13
  } from './connectors';
14
14
  export {
15
15
  DataSources,
@@ -19,9 +19,9 @@ export {
19
19
  type LinearDataSource,
20
20
  type NotionDataSource,
21
21
  type Oauth2Params,
22
+ type DataSourceListResponse,
22
23
  type DataSourceDeleteResponse,
23
24
  type DataSourceCreateParams,
24
25
  type DataSourceUpdateParams,
25
26
  type DataSourceListParams,
26
- type DataSourcesCursor,
27
27
  } from './data-sources';
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
- import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
6
5
  import { type Uploadable } from '../core/uploads';
7
6
  import { buildHeaders } from '../internal/headers';
8
7
  import { RequestOptions } from '../internal/request-options';
@@ -56,8 +55,8 @@ export class Files extends APIResource {
56
55
  list(
57
56
  query: FileListParams | null | undefined = {},
58
57
  options?: RequestOptions,
59
- ): PagePromise<FileObjectsCursor, FileObject> {
60
- return this._client.getAPIList('/v1/files', Cursor<FileObject>, { query, ...options });
58
+ ): APIPromise<FileListResponse> {
59
+ return this._client.get('/v1/files', { query, ...options });
61
60
  }
62
61
 
63
62
  /**
@@ -87,8 +86,6 @@ export class Files extends APIResource {
87
86
  }
88
87
  }
89
88
 
90
- export type FileObjectsCursor = Cursor<FileObject>;
91
-
92
89
  /**
93
90
  * A model representing a file object in the system.
94
91
  *
@@ -152,6 +149,95 @@ export interface PaginationWithTotal {
152
149
  total?: number;
153
150
  }
154
151
 
152
+ export interface FileListResponse {
153
+ /**
154
+ * Response model for cursor-based pagination.
155
+ *
156
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
157
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
158
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
159
+ *
160
+ * Final page response:
161
+ * {
162
+ * "has_more": false,
163
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
164
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
165
+ * "total": 42
166
+ * }
167
+ *
168
+ * Empty results:
169
+ * {
170
+ * "has_more": false,
171
+ * "first_cursor": null,
172
+ * "last_cursor": null,
173
+ * "total": 0
174
+ * }
175
+ */
176
+ pagination: FileListResponse.Pagination;
177
+
178
+ /**
179
+ * The object type of the response
180
+ */
181
+ object?: 'list';
182
+
183
+ /**
184
+ * The list of files
185
+ */
186
+ data: Array<FileObject>;
187
+ }
188
+
189
+ export namespace FileListResponse {
190
+ /**
191
+ * Response model for cursor-based pagination.
192
+ *
193
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
194
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
195
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
196
+ *
197
+ * Final page response:
198
+ * {
199
+ * "has_more": false,
200
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
201
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
202
+ * "total": 42
203
+ * }
204
+ *
205
+ * Empty results:
206
+ * {
207
+ * "has_more": false,
208
+ * "first_cursor": null,
209
+ * "last_cursor": null,
210
+ * "total": 0
211
+ * }
212
+ */
213
+ export interface Pagination {
214
+ /**
215
+ * Contextual direction-aware flag: True if more items exist in the requested
216
+ * pagination direction. For 'after': more items after this page. For 'before':
217
+ * more items before this page.
218
+ */
219
+ has_more: boolean;
220
+
221
+ /**
222
+ * Cursor of the first item in this page. Use for backward pagination. None if page
223
+ * is empty.
224
+ */
225
+ first_cursor: string | null;
226
+
227
+ /**
228
+ * Cursor of the last item in this page. Use for forward pagination. None if page
229
+ * is empty.
230
+ */
231
+ last_cursor: string | null;
232
+
233
+ /**
234
+ * Total number of items available across all pages. Only included when
235
+ * include_total=true was requested. Expensive operation - use sparingly.
236
+ */
237
+ total?: number | null;
238
+ }
239
+ }
240
+
155
241
  export interface FileDeleteResponse {
156
242
  /**
157
243
  * The ID of the deleted file
@@ -183,14 +269,41 @@ export interface FileUpdateParams {
183
269
  file: Uploadable;
184
270
  }
185
271
 
186
- export interface FileListParams extends CursorParams {}
272
+ export interface FileListParams {
273
+ /**
274
+ * Maximum number of items to return per page (1-100)
275
+ */
276
+ limit?: number;
277
+
278
+ /**
279
+ * Cursor for forward pagination - get items after this position. Use last_cursor
280
+ * from previous response.
281
+ */
282
+ after?: string | null;
283
+
284
+ /**
285
+ * Cursor for backward pagination - get items before this position. Use
286
+ * first_cursor from previous response.
287
+ */
288
+ before?: string | null;
289
+
290
+ /**
291
+ * Whether to include total count in response (expensive operation)
292
+ */
293
+ include_total?: boolean;
294
+
295
+ /**
296
+ * Search query for fuzzy matching over name and description fields
297
+ */
298
+ q?: string | null;
299
+ }
187
300
 
188
301
  export declare namespace Files {
189
302
  export {
190
303
  type FileObject as FileObject,
191
304
  type PaginationWithTotal as PaginationWithTotal,
305
+ type FileListResponse as FileListResponse,
192
306
  type FileDeleteResponse as FileDeleteResponse,
193
- type FileObjectsCursor as FileObjectsCursor,
194
307
  type FileCreateParams as FileCreateParams,
195
308
  type FileUpdateParams as FileUpdateParams,
196
309
  type FileListParams as FileListParams,
@@ -19,11 +19,11 @@ export {
19
19
  type LinearDataSource,
20
20
  type NotionDataSource,
21
21
  type Oauth2Params,
22
+ type DataSourceListResponse,
22
23
  type DataSourceDeleteResponse,
23
24
  type DataSourceCreateParams,
24
25
  type DataSourceUpdateParams,
25
26
  type DataSourceListParams,
26
- type DataSourcesCursor,
27
27
  } from './data-sources/data-sources';
28
28
  export { Embeddings, type EncodingFormat, type ObjectType, type EmbeddingCreateParams } from './embeddings';
29
29
  export { Extractions } from './extractions/extractions';
@@ -31,11 +31,11 @@ export {
31
31
  Files,
32
32
  type FileObject,
33
33
  type PaginationWithTotal,
34
+ type FileListResponse,
34
35
  type FileDeleteResponse,
35
36
  type FileCreateParams,
36
37
  type FileUpdateParams,
37
38
  type FileListParams,
38
- type FileObjectsCursor,
39
39
  } from './files';
40
40
  export { Parsing } from './parsing/parsing';
41
41
  export {
@@ -47,6 +47,7 @@ export {
47
47
  type ScoredVideoURLInputChunk,
48
48
  type VectorStore,
49
49
  type VectorStoreChunkSearchOptions,
50
+ type VectorStoreListResponse,
50
51
  type VectorStoreDeleteResponse,
51
52
  type VectorStoreQuestionAnsweringResponse,
52
53
  type VectorStoreSearchResponse,
@@ -55,7 +56,6 @@ export {
55
56
  type VectorStoreListParams,
56
57
  type VectorStoreQuestionAnsweringParams,
57
58
  type VectorStoreSearchParams,
58
- type VectorStoresCursor,
59
59
  } from './vector-stores/vector-stores';
60
60
  export {
61
61
  type Embedding,
@@ -11,6 +11,5 @@ export {
11
11
  type JobDeleteResponse,
12
12
  type JobCreateParams,
13
13
  type JobListParams,
14
- type JobListResponsesCursor,
15
14
  } from './jobs';
16
15
  export { Parsing } from './parsing';
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as JobsAPI from './jobs';
5
5
  import { APIPromise } from '../../core/api-promise';
6
- import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
7
6
  import { RequestOptions } from '../../internal/request-options';
8
7
  import { path } from '../../internal/utils/path';
9
8
  import * as polling from '../../lib/polling';
@@ -39,11 +38,8 @@ export class Jobs extends APIResource {
39
38
  *
40
39
  * Returns: List of parsing jobs with pagination.
41
40
  */
42
- list(
43
- query: JobListParams | null | undefined = {},
44
- options?: RequestOptions,
45
- ): PagePromise<JobListResponsesCursor, JobListResponse> {
46
- return this._client.getAPIList('/v1/parsing/jobs', Cursor<JobListResponse>, { query, ...options });
41
+ list(query: JobListParams | null | undefined = {}, options?: RequestOptions): APIPromise<JobListResponse> {
42
+ return this._client.get('/v1/parsing/jobs', { query, ...options });
47
43
  }
48
44
 
49
45
  /**
@@ -161,8 +157,6 @@ export class Jobs extends APIResource {
161
157
  }
162
158
  }
163
159
 
164
- export type JobListResponsesCursor = Cursor<JobListResponse>;
165
-
166
160
  /**
167
161
  * Strategy used for chunking document content.
168
162
  */
@@ -338,48 +332,140 @@ export namespace ParsingJob {
338
332
  export type ReturnFormat = 'html' | 'markdown' | 'plain';
339
333
 
340
334
  /**
341
- * A parsing job item for list responses, omitting result and error fields.
335
+ * A list of parsing jobs with pagination.
342
336
  */
343
337
  export interface JobListResponse {
344
338
  /**
345
- * The ID of the job
339
+ * Response model for cursor-based pagination.
340
+ *
341
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
342
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
343
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
344
+ *
345
+ * Final page response:
346
+ * {
347
+ * "has_more": false,
348
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
349
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
350
+ * "total": 42
351
+ * }
352
+ *
353
+ * Empty results:
354
+ * {
355
+ * "has_more": false,
356
+ * "first_cursor": null,
357
+ * "last_cursor": null,
358
+ * "total": 0
359
+ * }
346
360
  */
347
- id: string;
361
+ pagination: JobListResponse.Pagination;
348
362
 
349
363
  /**
350
- * The ID of the file to parse
364
+ * The list of parsing jobs
351
365
  */
352
- file_id: string;
366
+ data: Array<JobListResponse.Data>;
353
367
 
354
368
  /**
355
- * The status of the job
369
+ * The object type of the response
356
370
  */
357
- status: ParsingJobStatus;
371
+ object?: 'list';
372
+ }
358
373
 
374
+ export namespace JobListResponse {
359
375
  /**
360
- * The started time of the job
361
- */
362
- started_at?: string | null;
376
+ * Response model for cursor-based pagination.
377
+ *
378
+ * Examples: Forward pagination response: { "has_more": true, "first_cursor":
379
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
380
+ * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
381
+ *
382
+ * Final page response:
383
+ * {
384
+ * "has_more": false,
385
+ * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
386
+ * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
387
+ * "total": 42
388
+ * }
389
+ *
390
+ * Empty results:
391
+ * {
392
+ * "has_more": false,
393
+ * "first_cursor": null,
394
+ * "last_cursor": null,
395
+ * "total": 0
396
+ * }
397
+ */
398
+ export interface Pagination {
399
+ /**
400
+ * Contextual direction-aware flag: True if more items exist in the requested
401
+ * pagination direction. For 'after': more items after this page. For 'before':
402
+ * more items before this page.
403
+ */
404
+ has_more: boolean;
363
405
 
364
- /**
365
- * The finished time of the job
366
- */
367
- finished_at?: string | null;
406
+ /**
407
+ * Cursor of the first item in this page. Use for backward pagination. None if page
408
+ * is empty.
409
+ */
410
+ first_cursor: string | null;
368
411
 
369
- /**
370
- * The creation time of the job
371
- */
372
- created_at?: string;
412
+ /**
413
+ * Cursor of the last item in this page. Use for forward pagination. None if page
414
+ * is empty.
415
+ */
416
+ last_cursor: string | null;
373
417
 
374
- /**
375
- * The updated time of the job
376
- */
377
- updated_at?: string | null;
418
+ /**
419
+ * Total number of items available across all pages. Only included when
420
+ * include_total=true was requested. Expensive operation - use sparingly.
421
+ */
422
+ total?: number | null;
423
+ }
378
424
 
379
425
  /**
380
- * The type of the object
426
+ * A parsing job item for list responses, omitting result and error fields.
381
427
  */
382
- object?: 'parsing_job';
428
+ export interface Data {
429
+ /**
430
+ * The ID of the job
431
+ */
432
+ id: string;
433
+
434
+ /**
435
+ * The ID of the file to parse
436
+ */
437
+ file_id: string;
438
+
439
+ /**
440
+ * The status of the job
441
+ */
442
+ status: JobsAPI.ParsingJobStatus;
443
+
444
+ /**
445
+ * The started time of the job
446
+ */
447
+ started_at?: string | null;
448
+
449
+ /**
450
+ * The finished time of the job
451
+ */
452
+ finished_at?: string | null;
453
+
454
+ /**
455
+ * The creation time of the job
456
+ */
457
+ created_at?: string;
458
+
459
+ /**
460
+ * The updated time of the job
461
+ */
462
+ updated_at?: string | null;
463
+
464
+ /**
465
+ * The type of the object
466
+ */
467
+ object?: 'parsing_job';
468
+ }
383
469
  }
384
470
 
385
471
  /**
@@ -429,7 +515,34 @@ export interface JobCreateParams {
429
515
  mode?: 'fast' | 'high_quality';
430
516
  }
431
517
 
432
- export interface JobListParams extends CursorParams {}
518
+ export interface JobListParams {
519
+ /**
520
+ * Maximum number of items to return per page (1-100)
521
+ */
522
+ limit?: number;
523
+
524
+ /**
525
+ * Cursor for forward pagination - get items after this position. Use last_cursor
526
+ * from previous response.
527
+ */
528
+ after?: string | null;
529
+
530
+ /**
531
+ * Cursor for backward pagination - get items before this position. Use
532
+ * first_cursor from previous response.
533
+ */
534
+ before?: string | null;
535
+
536
+ /**
537
+ * Whether to include total count in response (expensive operation)
538
+ */
539
+ include_total?: boolean;
540
+
541
+ /**
542
+ * Status to filter by
543
+ */
544
+ statuses?: Array<ParsingJobStatus> | null;
545
+ }
433
546
 
434
547
  export declare namespace Jobs {
435
548
  export {
@@ -440,7 +553,6 @@ export declare namespace Jobs {
440
553
  type ReturnFormat as ReturnFormat,
441
554
  type JobListResponse as JobListResponse,
442
555
  type JobDeleteResponse as JobDeleteResponse,
443
- type JobListResponsesCursor as JobListResponsesCursor,
444
556
  type JobCreateParams as JobCreateParams,
445
557
  type JobListParams as JobListParams,
446
558
  };
@@ -9,7 +9,6 @@ import {
9
9
  JobDeleteResponse,
10
10
  JobListParams,
11
11
  JobListResponse,
12
- JobListResponsesCursor,
13
12
  Jobs,
14
13
  ParsingJob,
15
14
  ParsingJobStatus,
@@ -32,7 +31,6 @@ export declare namespace Parsing {
32
31
  type ReturnFormat as ReturnFormat,
33
32
  type JobListResponse as JobListResponse,
34
33
  type JobDeleteResponse as JobDeleteResponse,
35
- type JobListResponsesCursor as JobListResponsesCursor,
36
34
  type JobCreateParams as JobCreateParams,
37
35
  type JobListParams as JobListParams,
38
36
  };