@mixedbread/sdk 0.14.0 → 0.16.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 (121) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +31 -0
  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/core/pagination.d.mts +0 -1
  9. package/core/pagination.d.mts.map +1 -1
  10. package/core/pagination.d.ts +0 -1
  11. package/core/pagination.d.ts.map +1 -1
  12. package/core/pagination.js.map +1 -1
  13. package/core/pagination.mjs.map +1 -1
  14. package/internal/uploads.js +1 -1
  15. package/internal/uploads.js.map +1 -1
  16. package/internal/uploads.mjs +1 -1
  17. package/internal/uploads.mjs.map +1 -1
  18. package/internal/utils/log.js +1 -1
  19. package/internal/utils/log.js.map +1 -1
  20. package/internal/utils/log.mjs +1 -1
  21. package/internal/utils/log.mjs.map +1 -1
  22. package/internal/utils/path.d.mts.map +1 -1
  23. package/internal/utils/path.d.ts.map +1 -1
  24. package/internal/utils/path.js +26 -5
  25. package/internal/utils/path.js.map +1 -1
  26. package/internal/utils/path.mjs +26 -5
  27. package/internal/utils/path.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/resources/data-sources/connectors.d.mts +5 -106
  30. package/resources/data-sources/connectors.d.mts.map +1 -1
  31. package/resources/data-sources/connectors.d.ts +5 -106
  32. package/resources/data-sources/connectors.d.ts.map +1 -1
  33. package/resources/data-sources/connectors.js +2 -1
  34. package/resources/data-sources/connectors.js.map +1 -1
  35. package/resources/data-sources/connectors.mjs +2 -1
  36. package/resources/data-sources/connectors.mjs.map +1 -1
  37. package/resources/data-sources/data-sources.d.mts +7 -108
  38. package/resources/data-sources/data-sources.d.mts.map +1 -1
  39. package/resources/data-sources/data-sources.d.ts +7 -108
  40. package/resources/data-sources/data-sources.d.ts.map +1 -1
  41. package/resources/data-sources/data-sources.js +2 -1
  42. package/resources/data-sources/data-sources.js.map +1 -1
  43. package/resources/data-sources/data-sources.mjs +2 -1
  44. package/resources/data-sources/data-sources.mjs.map +1 -1
  45. package/resources/data-sources/index.d.mts +2 -2
  46. package/resources/data-sources/index.d.mts.map +1 -1
  47. package/resources/data-sources/index.d.ts +2 -2
  48. package/resources/data-sources/index.d.ts.map +1 -1
  49. package/resources/files.d.mts +5 -103
  50. package/resources/files.d.mts.map +1 -1
  51. package/resources/files.d.ts +5 -103
  52. package/resources/files.d.ts.map +1 -1
  53. package/resources/files.js +2 -1
  54. package/resources/files.js.map +1 -1
  55. package/resources/files.mjs +2 -1
  56. package/resources/files.mjs.map +1 -1
  57. package/resources/index.d.mts +3 -3
  58. package/resources/index.d.mts.map +1 -1
  59. package/resources/index.d.ts +3 -3
  60. package/resources/index.d.ts.map +1 -1
  61. package/resources/parsing/index.d.mts +1 -1
  62. package/resources/parsing/index.d.mts.map +1 -1
  63. package/resources/parsing/index.d.ts +1 -1
  64. package/resources/parsing/index.d.ts.map +1 -1
  65. package/resources/parsing/index.js.map +1 -1
  66. package/resources/parsing/index.mjs.map +1 -1
  67. package/resources/parsing/jobs.d.mts +41 -130
  68. package/resources/parsing/jobs.d.mts.map +1 -1
  69. package/resources/parsing/jobs.d.ts +41 -130
  70. package/resources/parsing/jobs.d.ts.map +1 -1
  71. package/resources/parsing/jobs.js +2 -1
  72. package/resources/parsing/jobs.js.map +1 -1
  73. package/resources/parsing/jobs.mjs +2 -1
  74. package/resources/parsing/jobs.mjs.map +1 -1
  75. package/resources/parsing/parsing.d.mts +2 -2
  76. package/resources/parsing/parsing.d.mts.map +1 -1
  77. package/resources/parsing/parsing.d.ts +2 -2
  78. package/resources/parsing/parsing.d.ts.map +1 -1
  79. package/resources/parsing/parsing.js.map +1 -1
  80. package/resources/parsing/parsing.mjs.map +1 -1
  81. package/resources/vector-stores/files.d.mts +5 -103
  82. package/resources/vector-stores/files.d.mts.map +1 -1
  83. package/resources/vector-stores/files.d.ts +5 -103
  84. package/resources/vector-stores/files.d.ts.map +1 -1
  85. package/resources/vector-stores/files.js +2 -1
  86. package/resources/vector-stores/files.js.map +1 -1
  87. package/resources/vector-stores/files.mjs +2 -1
  88. package/resources/vector-stores/files.mjs.map +1 -1
  89. package/resources/vector-stores/index.d.mts +2 -2
  90. package/resources/vector-stores/index.d.mts.map +1 -1
  91. package/resources/vector-stores/index.d.ts +2 -2
  92. package/resources/vector-stores/index.d.ts.map +1 -1
  93. package/resources/vector-stores/vector-stores.d.mts +7 -105
  94. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  95. package/resources/vector-stores/vector-stores.d.ts +7 -105
  96. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  97. package/resources/vector-stores/vector-stores.js +2 -1
  98. package/resources/vector-stores/vector-stores.js.map +1 -1
  99. package/resources/vector-stores/vector-stores.mjs +2 -1
  100. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  101. package/src/client.ts +6 -6
  102. package/src/core/pagination.ts +0 -2
  103. package/src/internal/uploads.ts +1 -1
  104. package/src/internal/utils/log.ts +1 -1
  105. package/src/internal/utils/path.ts +30 -7
  106. package/src/resources/data-sources/connectors.ts +11 -118
  107. package/src/resources/data-sources/data-sources.ts +9 -120
  108. package/src/resources/data-sources/index.ts +2 -2
  109. package/src/resources/files.ts +7 -115
  110. package/src/resources/index.ts +3 -3
  111. package/src/resources/parsing/index.ts +1 -0
  112. package/src/resources/parsing/jobs.ts +47 -139
  113. package/src/resources/parsing/parsing.ts +2 -0
  114. package/src/resources/vector-stores/files.ts +11 -115
  115. package/src/resources/vector-stores/index.ts +2 -2
  116. package/src/resources/vector-stores/vector-stores.ts +9 -117
  117. package/src/version.ts +1 -1
  118. package/version.d.mts +1 -1
  119. package/version.d.ts +1 -1
  120. package/version.js +1 -1
  121. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
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';
5
6
  import { type Uploadable } from '../core/uploads';
6
7
  import { buildHeaders } from '../internal/headers';
7
8
  import { RequestOptions } from '../internal/request-options';
@@ -55,8 +56,8 @@ export class Files extends APIResource {
55
56
  list(
56
57
  query: FileListParams | null | undefined = {},
57
58
  options?: RequestOptions,
58
- ): APIPromise<FileListResponse> {
59
- return this._client.get('/v1/files', { query, ...options });
59
+ ): PagePromise<FileObjectsCursor, FileObject> {
60
+ return this._client.getAPIList('/v1/files', Cursor<FileObject>, { query, ...options });
60
61
  }
61
62
 
62
63
  /**
@@ -86,6 +87,8 @@ export class Files extends APIResource {
86
87
  }
87
88
  }
88
89
 
90
+ export type FileObjectsCursor = Cursor<FileObject>;
91
+
89
92
  /**
90
93
  * A model representing a file object in the system.
91
94
  *
@@ -149,95 +152,6 @@ export interface PaginationWithTotal {
149
152
  total?: number;
150
153
  }
151
154
 
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
-
241
155
  export interface FileDeleteResponse {
242
156
  /**
243
157
  * The ID of the deleted file
@@ -269,29 +183,7 @@ export interface FileUpdateParams {
269
183
  file: Uploadable;
270
184
  }
271
185
 
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
-
186
+ export interface FileListParams extends CursorParams {
295
187
  /**
296
188
  * Search query for fuzzy matching over name and description fields
297
189
  */
@@ -302,8 +194,8 @@ export declare namespace Files {
302
194
  export {
303
195
  type FileObject as FileObject,
304
196
  type PaginationWithTotal as PaginationWithTotal,
305
- type FileListResponse as FileListResponse,
306
197
  type FileDeleteResponse as FileDeleteResponse,
198
+ type FileObjectsCursor as FileObjectsCursor,
307
199
  type FileCreateParams as FileCreateParams,
308
200
  type FileUpdateParams as FileUpdateParams,
309
201
  type FileListParams as FileListParams,
@@ -19,11 +19,11 @@ export {
19
19
  type LinearDataSource,
20
20
  type NotionDataSource,
21
21
  type Oauth2Params,
22
- type DataSourceListResponse,
23
22
  type DataSourceDeleteResponse,
24
23
  type DataSourceCreateParams,
25
24
  type DataSourceUpdateParams,
26
25
  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,
35
34
  type FileDeleteResponse,
36
35
  type FileCreateParams,
37
36
  type FileUpdateParams,
38
37
  type FileListParams,
38
+ type FileObjectsCursor,
39
39
  } from './files';
40
40
  export { Parsing } from './parsing/parsing';
41
41
  export {
@@ -47,7 +47,6 @@ export {
47
47
  type ScoredVideoURLInputChunk,
48
48
  type VectorStore,
49
49
  type VectorStoreChunkSearchOptions,
50
- type VectorStoreListResponse,
51
50
  type VectorStoreDeleteResponse,
52
51
  type VectorStoreQuestionAnsweringResponse,
53
52
  type VectorStoreSearchResponse,
@@ -56,6 +55,7 @@ export {
56
55
  type VectorStoreListParams,
57
56
  type VectorStoreQuestionAnsweringParams,
58
57
  type VectorStoreSearchParams,
58
+ type VectorStoresCursor,
59
59
  } from './vector-stores/vector-stores';
60
60
  export {
61
61
  type Embedding,
@@ -11,5 +11,6 @@ export {
11
11
  type JobDeleteResponse,
12
12
  type JobCreateParams,
13
13
  type JobListParams,
14
+ type JobListResponsesCursor,
14
15
  } from './jobs';
15
16
  export { Parsing } from './parsing';
@@ -3,6 +3,7 @@
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';
6
7
  import { RequestOptions } from '../../internal/request-options';
7
8
  import { path } from '../../internal/utils/path';
8
9
  import * as polling from '../../lib/polling';
@@ -38,8 +39,11 @@ export class Jobs extends APIResource {
38
39
  *
39
40
  * Returns: List of parsing jobs with pagination.
40
41
  */
41
- list(query: JobListParams | null | undefined = {}, options?: RequestOptions): APIPromise<JobListResponse> {
42
- return this._client.get('/v1/parsing/jobs', { query, ...options });
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 });
43
47
  }
44
48
 
45
49
  /**
@@ -157,6 +161,8 @@ export class Jobs extends APIResource {
157
161
  }
158
162
  }
159
163
 
164
+ export type JobListResponsesCursor = Cursor<JobListResponse>;
165
+
160
166
  /**
161
167
  * Strategy used for chunking document content.
162
168
  */
@@ -194,6 +200,11 @@ export interface ParsingJob {
194
200
  */
195
201
  file_id: string;
196
202
 
203
+ /**
204
+ * The name of the file
205
+ */
206
+ filename?: string | null;
207
+
197
208
  /**
198
209
  * The status of the job
199
210
  */
@@ -332,140 +343,53 @@ export namespace ParsingJob {
332
343
  export type ReturnFormat = 'html' | 'markdown' | 'plain';
333
344
 
334
345
  /**
335
- * A list of parsing jobs with pagination.
346
+ * A parsing job item for list responses, omitting result and error fields.
336
347
  */
337
348
  export interface JobListResponse {
338
349
  /**
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
- * }
350
+ * The ID of the job
360
351
  */
361
- pagination: JobListResponse.Pagination;
352
+ id: string;
362
353
 
363
354
  /**
364
- * The list of parsing jobs
355
+ * The ID of the file to parse
365
356
  */
366
- data: Array<JobListResponse.Data>;
357
+ file_id: string;
367
358
 
368
359
  /**
369
- * The object type of the response
360
+ * The name of the file
370
361
  */
371
- object?: 'list';
372
- }
362
+ filename?: string | null;
373
363
 
374
- export namespace JobListResponse {
375
364
  /**
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;
405
-
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;
411
-
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;
417
-
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
- }
365
+ * The status of the job
366
+ */
367
+ status: ParsingJobStatus;
424
368
 
425
369
  /**
426
- * A parsing job item for list responses, omitting result and error fields.
370
+ * The started time of the job
427
371
  */
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;
372
+ started_at?: string | null;
448
373
 
449
- /**
450
- * The finished time of the job
451
- */
452
- finished_at?: string | null;
374
+ /**
375
+ * The finished time of the job
376
+ */
377
+ finished_at?: string | null;
453
378
 
454
- /**
455
- * The creation time of the job
456
- */
457
- created_at?: string;
379
+ /**
380
+ * The creation time of the job
381
+ */
382
+ created_at?: string;
458
383
 
459
- /**
460
- * The updated time of the job
461
- */
462
- updated_at?: string | null;
384
+ /**
385
+ * The updated time of the job
386
+ */
387
+ updated_at?: string | null;
463
388
 
464
- /**
465
- * The type of the object
466
- */
467
- object?: 'parsing_job';
468
- }
389
+ /**
390
+ * The type of the object
391
+ */
392
+ object?: 'parsing_job';
469
393
  }
470
394
 
471
395
  /**
@@ -515,33 +439,16 @@ export interface JobCreateParams {
515
439
  mode?: 'fast' | 'high_quality';
516
440
  }
517
441
 
518
- export interface JobListParams {
519
- /**
520
- * Maximum number of items to return per page (1-100)
521
- */
522
- limit?: number;
523
-
442
+ export interface JobListParams extends CursorParams {
524
443
  /**
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)
444
+ * Status to filter by
538
445
  */
539
- include_total?: boolean;
446
+ statuses?: Array<ParsingJobStatus> | null;
540
447
 
541
448
  /**
542
- * Status to filter by
449
+ * Search query to filter by
543
450
  */
544
- statuses?: Array<ParsingJobStatus> | null;
451
+ q?: string | null;
545
452
  }
546
453
 
547
454
  export declare namespace Jobs {
@@ -553,6 +460,7 @@ export declare namespace Jobs {
553
460
  type ReturnFormat as ReturnFormat,
554
461
  type JobListResponse as JobListResponse,
555
462
  type JobDeleteResponse as JobDeleteResponse,
463
+ type JobListResponsesCursor as JobListResponsesCursor,
556
464
  type JobCreateParams as JobCreateParams,
557
465
  type JobListParams as JobListParams,
558
466
  };
@@ -9,6 +9,7 @@ import {
9
9
  JobDeleteResponse,
10
10
  JobListParams,
11
11
  JobListResponse,
12
+ JobListResponsesCursor,
12
13
  Jobs,
13
14
  ParsingJob,
14
15
  ParsingJobStatus,
@@ -31,6 +32,7 @@ export declare namespace Parsing {
31
32
  type ReturnFormat as ReturnFormat,
32
33
  type JobListResponse as JobListResponse,
33
34
  type JobDeleteResponse as JobDeleteResponse,
35
+ type JobListResponsesCursor as JobListResponsesCursor,
34
36
  type JobCreateParams as JobCreateParams,
35
37
  type JobListParams as JobListParams,
36
38
  };
@@ -5,6 +5,7 @@ import * as FilesAPI from './files';
5
5
  import * as Shared from '../shared';
6
6
  import * as VectorStoresAPI from './vector-stores';
7
7
  import { APIPromise } from '../../core/api-promise';
8
+ import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
8
9
  import { RequestOptions } from '../../internal/request-options';
9
10
  import * as polling from '../../lib/polling';
10
11
  import { Uploadable } from '../../uploads';
@@ -56,8 +57,12 @@ export class Files extends APIResource {
56
57
  vectorStoreIdentifier: string,
57
58
  query: FileListParams | null | undefined = {},
58
59
  options?: RequestOptions,
59
- ): APIPromise<FileListResponse> {
60
- return this._client.get(path`/v1/vector_stores/${vectorStoreIdentifier}/files`, { query, ...options });
60
+ ): PagePromise<VectorStoreFilesCursor, VectorStoreFile> {
61
+ return this._client.getAPIList(
62
+ path`/v1/vector_stores/${vectorStoreIdentifier}/files`,
63
+ Cursor<VectorStoreFile>,
64
+ { query, ...options },
65
+ );
61
66
  }
62
67
 
63
68
  /**
@@ -197,6 +202,8 @@ export class Files extends APIResource {
197
202
  }
198
203
  }
199
204
 
205
+ export type VectorStoreFilesCursor = Cursor<VectorStoreFile>;
206
+
200
207
  /**
201
208
  * Represents a reranking configuration.
202
209
  */
@@ -345,95 +352,6 @@ export interface VectorStoreFile {
345
352
  object?: 'vector_store.file';
346
353
  }
347
354
 
348
- export interface FileListResponse {
349
- /**
350
- * Response model for cursor-based pagination.
351
- *
352
- * Examples: Forward pagination response: { "has_more": true, "first_cursor":
353
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
354
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
355
- *
356
- * Final page response:
357
- * {
358
- * "has_more": false,
359
- * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
360
- * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
361
- * "total": 42
362
- * }
363
- *
364
- * Empty results:
365
- * {
366
- * "has_more": false,
367
- * "first_cursor": null,
368
- * "last_cursor": null,
369
- * "total": 0
370
- * }
371
- */
372
- pagination: FileListResponse.Pagination;
373
-
374
- /**
375
- * The object type of the response
376
- */
377
- object?: 'list';
378
-
379
- /**
380
- * The list of vector store files
381
- */
382
- data: Array<VectorStoreFile>;
383
- }
384
-
385
- export namespace FileListResponse {
386
- /**
387
- * Response model for cursor-based pagination.
388
- *
389
- * Examples: Forward pagination response: { "has_more": true, "first_cursor":
390
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
391
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
392
- *
393
- * Final page response:
394
- * {
395
- * "has_more": false,
396
- * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
397
- * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
398
- * "total": 42
399
- * }
400
- *
401
- * Empty results:
402
- * {
403
- * "has_more": false,
404
- * "first_cursor": null,
405
- * "last_cursor": null,
406
- * "total": 0
407
- * }
408
- */
409
- export interface Pagination {
410
- /**
411
- * Contextual direction-aware flag: True if more items exist in the requested
412
- * pagination direction. For 'after': more items after this page. For 'before':
413
- * more items before this page.
414
- */
415
- has_more: boolean;
416
-
417
- /**
418
- * Cursor of the first item in this page. Use for backward pagination. None if page
419
- * is empty.
420
- */
421
- first_cursor: string | null;
422
-
423
- /**
424
- * Cursor of the last item in this page. Use for forward pagination. None if page
425
- * is empty.
426
- */
427
- last_cursor: string | null;
428
-
429
- /**
430
- * Total number of items available across all pages. Only included when
431
- * include_total=true was requested. Expensive operation - use sparingly.
432
- */
433
- total?: number | null;
434
- }
435
- }
436
-
437
355
  /**
438
356
  * Response model for file deletion.
439
357
  */
@@ -507,29 +425,7 @@ export interface FileRetrieveParams {
507
425
  vector_store_identifier: string;
508
426
  }
509
427
 
510
- export interface FileListParams {
511
- /**
512
- * Maximum number of items to return per page (1-100)
513
- */
514
- limit?: number;
515
-
516
- /**
517
- * Cursor for forward pagination - get items after this position. Use last_cursor
518
- * from previous response.
519
- */
520
- after?: string | null;
521
-
522
- /**
523
- * Cursor for backward pagination - get items before this position. Use
524
- * first_cursor from previous response.
525
- */
526
- before?: string | null;
527
-
528
- /**
529
- * Whether to include total count in response (expensive operation)
530
- */
531
- include_total?: boolean;
532
-
428
+ export interface FileListParams extends CursorParams {
533
429
  /**
534
430
  * Status to filter by
535
431
  */
@@ -627,9 +523,9 @@ export declare namespace Files {
627
523
  type ScoredVectorStoreFile as ScoredVectorStoreFile,
628
524
  type VectorStoreFileStatus as VectorStoreFileStatus,
629
525
  type VectorStoreFile as VectorStoreFile,
630
- type FileListResponse as FileListResponse,
631
526
  type FileDeleteResponse as FileDeleteResponse,
632
527
  type FileSearchResponse as FileSearchResponse,
528
+ type VectorStoreFilesCursor as VectorStoreFilesCursor,
633
529
  type FileCreateParams as FileCreateParams,
634
530
  type FileRetrieveParams as FileRetrieveParams,
635
531
  type FileListParams as FileListParams,
@@ -6,7 +6,6 @@ export {
6
6
  type ScoredVectorStoreFile,
7
7
  type VectorStoreFileStatus,
8
8
  type VectorStoreFile,
9
- type FileListResponse,
10
9
  type FileDeleteResponse,
11
10
  type FileSearchResponse,
12
11
  type FileCreateParams,
@@ -14,6 +13,7 @@ export {
14
13
  type FileListParams,
15
14
  type FileDeleteParams,
16
15
  type FileSearchParams,
16
+ type VectorStoreFilesCursor,
17
17
  } from './files';
18
18
  export {
19
19
  VectorStores,
@@ -24,7 +24,6 @@ export {
24
24
  type ScoredVideoURLInputChunk,
25
25
  type VectorStore,
26
26
  type VectorStoreChunkSearchOptions,
27
- type VectorStoreListResponse,
28
27
  type VectorStoreDeleteResponse,
29
28
  type VectorStoreQuestionAnsweringResponse,
30
29
  type VectorStoreSearchResponse,
@@ -33,4 +32,5 @@ export {
33
32
  type VectorStoreListParams,
34
33
  type VectorStoreQuestionAnsweringParams,
35
34
  type VectorStoreSearchParams,
35
+ type VectorStoresCursor,
36
36
  } from './vector-stores';