@mixedbread/sdk 0.15.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 (104) hide show
  1. package/CHANGELOG.md +9 -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 +10 -16
  9. package/core/pagination.d.mts.map +1 -1
  10. package/core/pagination.d.ts +10 -16
  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/package.json +1 -1
  15. package/resources/data-sources/connectors.d.mts +5 -106
  16. package/resources/data-sources/connectors.d.mts.map +1 -1
  17. package/resources/data-sources/connectors.d.ts +5 -106
  18. package/resources/data-sources/connectors.d.ts.map +1 -1
  19. package/resources/data-sources/connectors.js +2 -1
  20. package/resources/data-sources/connectors.js.map +1 -1
  21. package/resources/data-sources/connectors.mjs +2 -1
  22. package/resources/data-sources/connectors.mjs.map +1 -1
  23. package/resources/data-sources/data-sources.d.mts +7 -108
  24. package/resources/data-sources/data-sources.d.mts.map +1 -1
  25. package/resources/data-sources/data-sources.d.ts +7 -108
  26. package/resources/data-sources/data-sources.d.ts.map +1 -1
  27. package/resources/data-sources/data-sources.js +2 -1
  28. package/resources/data-sources/data-sources.js.map +1 -1
  29. package/resources/data-sources/data-sources.mjs +2 -1
  30. package/resources/data-sources/data-sources.mjs.map +1 -1
  31. package/resources/data-sources/index.d.mts +2 -2
  32. package/resources/data-sources/index.d.mts.map +1 -1
  33. package/resources/data-sources/index.d.ts +2 -2
  34. package/resources/data-sources/index.d.ts.map +1 -1
  35. package/resources/files.d.mts +5 -103
  36. package/resources/files.d.mts.map +1 -1
  37. package/resources/files.d.ts +5 -103
  38. package/resources/files.d.ts.map +1 -1
  39. package/resources/files.js +2 -1
  40. package/resources/files.js.map +1 -1
  41. package/resources/files.mjs +2 -1
  42. package/resources/files.mjs.map +1 -1
  43. package/resources/index.d.mts +3 -3
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +3 -3
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/parsing/index.d.mts +1 -1
  48. package/resources/parsing/index.d.mts.map +1 -1
  49. package/resources/parsing/index.d.ts +1 -1
  50. package/resources/parsing/index.d.ts.map +1 -1
  51. package/resources/parsing/index.js.map +1 -1
  52. package/resources/parsing/index.mjs.map +1 -1
  53. package/resources/parsing/jobs.d.mts +33 -134
  54. package/resources/parsing/jobs.d.mts.map +1 -1
  55. package/resources/parsing/jobs.d.ts +33 -134
  56. package/resources/parsing/jobs.d.ts.map +1 -1
  57. package/resources/parsing/jobs.js +2 -1
  58. package/resources/parsing/jobs.js.map +1 -1
  59. package/resources/parsing/jobs.mjs +2 -1
  60. package/resources/parsing/jobs.mjs.map +1 -1
  61. package/resources/parsing/parsing.d.mts +2 -2
  62. package/resources/parsing/parsing.d.mts.map +1 -1
  63. package/resources/parsing/parsing.d.ts +2 -2
  64. package/resources/parsing/parsing.d.ts.map +1 -1
  65. package/resources/parsing/parsing.js.map +1 -1
  66. package/resources/parsing/parsing.mjs.map +1 -1
  67. package/resources/vector-stores/files.d.mts +5 -103
  68. package/resources/vector-stores/files.d.mts.map +1 -1
  69. package/resources/vector-stores/files.d.ts +5 -103
  70. package/resources/vector-stores/files.d.ts.map +1 -1
  71. package/resources/vector-stores/files.js +2 -1
  72. package/resources/vector-stores/files.js.map +1 -1
  73. package/resources/vector-stores/files.mjs +2 -1
  74. package/resources/vector-stores/files.mjs.map +1 -1
  75. package/resources/vector-stores/index.d.mts +2 -2
  76. package/resources/vector-stores/index.d.mts.map +1 -1
  77. package/resources/vector-stores/index.d.ts +2 -2
  78. package/resources/vector-stores/index.d.ts.map +1 -1
  79. package/resources/vector-stores/vector-stores.d.mts +7 -105
  80. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  81. package/resources/vector-stores/vector-stores.d.ts +7 -105
  82. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  83. package/resources/vector-stores/vector-stores.js +2 -1
  84. package/resources/vector-stores/vector-stores.js.map +1 -1
  85. package/resources/vector-stores/vector-stores.mjs +2 -1
  86. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  87. package/src/client.ts +6 -6
  88. package/src/core/pagination.ts +10 -18
  89. package/src/resources/data-sources/connectors.ts +11 -118
  90. package/src/resources/data-sources/data-sources.ts +9 -120
  91. package/src/resources/data-sources/index.ts +2 -2
  92. package/src/resources/files.ts +7 -115
  93. package/src/resources/index.ts +3 -3
  94. package/src/resources/parsing/index.ts +1 -0
  95. package/src/resources/parsing/jobs.ts +38 -145
  96. package/src/resources/parsing/parsing.ts +2 -0
  97. package/src/resources/vector-stores/files.ts +11 -115
  98. package/src/resources/vector-stores/index.ts +2 -2
  99. package/src/resources/vector-stores/vector-stores.ts +9 -117
  100. package/src/version.ts +1 -1
  101. package/version.d.mts +1 -1
  102. package/version.d.ts +1 -1
  103. package/version.js +1 -1
  104. package/version.mjs +1 -1
@@ -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';
@@ -8,7 +8,6 @@ import {
8
8
  FileDeleteParams,
9
9
  FileDeleteResponse,
10
10
  FileListParams,
11
- FileListResponse,
12
11
  FileRetrieveParams,
13
12
  FileSearchParams,
14
13
  FileSearchResponse,
@@ -17,8 +16,10 @@ import {
17
16
  ScoredVectorStoreFile,
18
17
  VectorStoreFile,
19
18
  VectorStoreFileStatus,
19
+ VectorStoreFilesCursor,
20
20
  } from './files';
21
21
  import { APIPromise } from '../../core/api-promise';
22
+ import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
22
23
  import { RequestOptions } from '../../internal/request-options';
23
24
  import { path } from '../../internal/utils/path';
24
25
 
@@ -76,8 +77,8 @@ export class VectorStores extends APIResource {
76
77
  list(
77
78
  query: VectorStoreListParams | null | undefined = {},
78
79
  options?: RequestOptions,
79
- ): APIPromise<VectorStoreListResponse> {
80
- return this._client.get('/v1/vector_stores', { query, ...options });
80
+ ): PagePromise<VectorStoresCursor, VectorStore> {
81
+ return this._client.getAPIList('/v1/vector_stores', Cursor<VectorStore>, { query, ...options });
81
82
  }
82
83
 
83
84
  /**
@@ -125,6 +126,8 @@ export class VectorStores extends APIResource {
125
126
  }
126
127
  }
127
128
 
129
+ export type VectorStoresCursor = Cursor<VectorStore>;
130
+
128
131
  /**
129
132
  * Represents an expiration policy for a vector store.
130
133
  */
@@ -576,95 +579,6 @@ export interface VectorStoreChunkSearchOptions {
576
579
  return_metadata?: boolean;
577
580
  }
578
581
 
579
- export interface VectorStoreListResponse {
580
- /**
581
- * Response model for cursor-based pagination.
582
- *
583
- * Examples: Forward pagination response: { "has_more": true, "first_cursor":
584
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
585
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
586
- *
587
- * Final page response:
588
- * {
589
- * "has_more": false,
590
- * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
591
- * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
592
- * "total": 42
593
- * }
594
- *
595
- * Empty results:
596
- * {
597
- * "has_more": false,
598
- * "first_cursor": null,
599
- * "last_cursor": null,
600
- * "total": 0
601
- * }
602
- */
603
- pagination: VectorStoreListResponse.Pagination;
604
-
605
- /**
606
- * The object type of the response
607
- */
608
- object?: 'list';
609
-
610
- /**
611
- * The list of vector stores
612
- */
613
- data: Array<VectorStore>;
614
- }
615
-
616
- export namespace VectorStoreListResponse {
617
- /**
618
- * Response model for cursor-based pagination.
619
- *
620
- * Examples: Forward pagination response: { "has_more": true, "first_cursor":
621
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
622
- * "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
623
- *
624
- * Final page response:
625
- * {
626
- * "has_more": false,
627
- * "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
628
- * "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
629
- * "total": 42
630
- * }
631
- *
632
- * Empty results:
633
- * {
634
- * "has_more": false,
635
- * "first_cursor": null,
636
- * "last_cursor": null,
637
- * "total": 0
638
- * }
639
- */
640
- export interface Pagination {
641
- /**
642
- * Contextual direction-aware flag: True if more items exist in the requested
643
- * pagination direction. For 'after': more items after this page. For 'before':
644
- * more items before this page.
645
- */
646
- has_more: boolean;
647
-
648
- /**
649
- * Cursor of the first item in this page. Use for backward pagination. None if page
650
- * is empty.
651
- */
652
- first_cursor: string | null;
653
-
654
- /**
655
- * Cursor of the last item in this page. Use for forward pagination. None if page
656
- * is empty.
657
- */
658
- last_cursor: string | null;
659
-
660
- /**
661
- * Total number of items available across all pages. Only included when
662
- * include_total=true was requested. Expensive operation - use sparingly.
663
- */
664
- total?: number | null;
665
- }
666
- }
667
-
668
582
  /**
669
583
  * Response model for vector store deletion.
670
584
  */
@@ -775,29 +689,7 @@ export interface VectorStoreUpdateParams {
775
689
  metadata?: unknown;
776
690
  }
777
691
 
778
- export interface VectorStoreListParams {
779
- /**
780
- * Maximum number of items to return per page (1-100)
781
- */
782
- limit?: number;
783
-
784
- /**
785
- * Cursor for forward pagination - get items after this position. Use last_cursor
786
- * from previous response.
787
- */
788
- after?: string | null;
789
-
790
- /**
791
- * Cursor for backward pagination - get items before this position. Use
792
- * first_cursor from previous response.
793
- */
794
- before?: string | null;
795
-
796
- /**
797
- * Whether to include total count in response (expensive operation)
798
- */
799
- include_total?: boolean;
800
-
692
+ export interface VectorStoreListParams extends CursorParams {
801
693
  /**
802
694
  * Search query for fuzzy matching over name and description fields
803
695
  */
@@ -925,10 +817,10 @@ export declare namespace VectorStores {
925
817
  type ScoredVideoURLInputChunk as ScoredVideoURLInputChunk,
926
818
  type VectorStore as VectorStore,
927
819
  type VectorStoreChunkSearchOptions as VectorStoreChunkSearchOptions,
928
- type VectorStoreListResponse as VectorStoreListResponse,
929
820
  type VectorStoreDeleteResponse as VectorStoreDeleteResponse,
930
821
  type VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
931
822
  type VectorStoreSearchResponse as VectorStoreSearchResponse,
823
+ type VectorStoresCursor as VectorStoresCursor,
932
824
  type VectorStoreCreateParams as VectorStoreCreateParams,
933
825
  type VectorStoreUpdateParams as VectorStoreUpdateParams,
934
826
  type VectorStoreListParams as VectorStoreListParams,
@@ -942,9 +834,9 @@ export declare namespace VectorStores {
942
834
  type ScoredVectorStoreFile as ScoredVectorStoreFile,
943
835
  type VectorStoreFileStatus as VectorStoreFileStatus,
944
836
  type VectorStoreFile as VectorStoreFile,
945
- type FileListResponse as FileListResponse,
946
837
  type FileDeleteResponse as FileDeleteResponse,
947
838
  type FileSearchResponse as FileSearchResponse,
839
+ type VectorStoreFilesCursor as VectorStoreFilesCursor,
948
840
  type FileCreateParams as FileCreateParams,
949
841
  type FileRetrieveParams as FileRetrieveParams,
950
842
  type FileListParams as FileListParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.15.0'; // x-release-please-version
1
+ export const VERSION = '0.16.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.0";
1
+ export declare const VERSION = "0.16.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.0";
1
+ export declare const VERSION = "0.16.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.15.0'; // x-release-please-version
4
+ exports.VERSION = '0.16.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.15.0'; // x-release-please-version
1
+ export const VERSION = '0.16.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map