@mixedbread/sdk 0.56.0 → 0.57.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 (90) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/index.d.mts +1 -0
  11. package/index.d.mts.map +1 -1
  12. package/index.d.ts +1 -0
  13. package/index.d.ts.map +1 -1
  14. package/index.js +3 -1
  15. package/index.js.map +1 -1
  16. package/index.mjs +1 -0
  17. package/index.mjs.map +1 -1
  18. package/lib/upload-file.d.mts +34 -0
  19. package/lib/upload-file.d.mts.map +1 -0
  20. package/lib/upload-file.d.ts +34 -0
  21. package/lib/upload-file.d.ts.map +1 -0
  22. package/lib/upload-file.js +146 -0
  23. package/lib/upload-file.js.map +1 -0
  24. package/lib/upload-file.mjs +141 -0
  25. package/lib/upload-file.mjs.map +1 -0
  26. package/package.json +1 -1
  27. package/resources/files/files.d.mts +156 -0
  28. package/resources/files/files.d.mts.map +1 -0
  29. package/resources/files/files.d.ts +156 -0
  30. package/resources/files/files.d.ts.map +1 -0
  31. package/resources/files/files.js +86 -0
  32. package/resources/files/files.js.map +1 -0
  33. package/resources/files/files.mjs +81 -0
  34. package/resources/files/files.mjs.map +1 -0
  35. package/resources/files/index.d.mts +3 -0
  36. package/resources/files/index.d.mts.map +1 -0
  37. package/resources/files/index.d.ts +3 -0
  38. package/resources/files/index.d.ts.map +1 -0
  39. package/resources/files/index.js +9 -0
  40. package/resources/files/index.js.map +1 -0
  41. package/resources/files/index.mjs +4 -0
  42. package/resources/files/index.mjs.map +1 -0
  43. package/resources/files/uploads.d.mts +169 -0
  44. package/resources/files/uploads.d.mts.map +1 -0
  45. package/resources/files/uploads.d.ts +169 -0
  46. package/resources/files/uploads.d.ts.map +1 -0
  47. package/resources/files/uploads.js +43 -0
  48. package/resources/files/uploads.js.map +1 -0
  49. package/resources/files/uploads.mjs +39 -0
  50. package/resources/files/uploads.mjs.map +1 -0
  51. package/resources/files.d.mts +1 -144
  52. package/resources/files.d.mts.map +1 -1
  53. package/resources/files.d.ts +1 -144
  54. package/resources/files.d.ts.map +1 -1
  55. package/resources/files.js +2 -73
  56. package/resources/files.js.map +1 -1
  57. package/resources/files.mjs +1 -71
  58. package/resources/files.mjs.map +1 -1
  59. package/resources/index.d.mts +1 -1
  60. package/resources/index.d.ts +1 -1
  61. package/resources/index.js +1 -1
  62. package/resources/index.js.map +1 -1
  63. package/resources/index.mjs +1 -1
  64. package/resources/stores/files.d.mts +9 -6
  65. package/resources/stores/files.d.mts.map +1 -1
  66. package/resources/stores/files.d.ts +9 -6
  67. package/resources/stores/files.d.ts.map +1 -1
  68. package/resources/stores/files.js +15 -4
  69. package/resources/stores/files.js.map +1 -1
  70. package/resources/stores/files.mjs +15 -4
  71. package/resources/stores/files.mjs.map +1 -1
  72. package/resources/stores/stores.d.mts +4 -4
  73. package/resources/stores/stores.d.mts.map +1 -1
  74. package/resources/stores/stores.d.ts +4 -4
  75. package/resources/stores/stores.d.ts.map +1 -1
  76. package/src/client.ts +10 -10
  77. package/src/index.ts +1 -0
  78. package/src/lib/upload-file.ts +233 -0
  79. package/src/resources/files/files.ts +239 -0
  80. package/src/resources/files/index.ts +23 -0
  81. package/src/resources/files/uploads.ts +229 -0
  82. package/src/resources/files.ts +1 -201
  83. package/src/resources/index.ts +1 -1
  84. package/src/resources/stores/files.ts +27 -6
  85. package/src/resources/stores/stores.ts +4 -4
  86. package/src/version.ts +1 -1
  87. package/version.d.mts +1 -1
  88. package/version.d.ts +1 -1
  89. package/version.js +1 -1
  90. package/version.mjs +1 -1
@@ -1,145 +1,2 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import { APIPromise } from "../core/api-promise.mjs";
3
- import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
4
- import { type Uploadable } from "../core/uploads.mjs";
5
- import { RequestOptions } from "../internal/request-options.mjs";
6
- export declare class Files extends APIResource {
7
- /**
8
- * Upload a new file.
9
- *
10
- * Args: file: The file to upload.
11
- *
12
- * Returns: FileResponse: The response containing the details of the uploaded file.
13
- */
14
- create(body: FileCreateParams, options?: RequestOptions): APIPromise<FileObject>;
15
- /**
16
- * Retrieve details of a specific file by its ID.
17
- *
18
- * Args: file_id: The ID of the file to retrieve.
19
- *
20
- * Returns: FileResponse: The response containing the file details.
21
- */
22
- retrieve(fileID: string, options?: RequestOptions): APIPromise<FileObject>;
23
- /**
24
- * Update the details of a specific file.
25
- *
26
- * Args: file_id: The ID of the file to update. file: The new details for the file.
27
- *
28
- * Returns: FileObject: The updated file details.
29
- */
30
- update(fileID: string, body: FileUpdateParams, options?: RequestOptions): APIPromise<FileObject>;
31
- /**
32
- * List all files for the authenticated user.
33
- *
34
- * Args: pagination: The pagination options
35
- *
36
- * Returns: A list of files belonging to the user.
37
- */
38
- list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FileObjectsCursor, FileObject>;
39
- /**
40
- * Delete a specific file by its ID.
41
- *
42
- * Args: file_id: The ID of the file to delete.
43
- *
44
- * Returns: FileDeleted: The response containing the details of the deleted file.
45
- */
46
- delete(fileID: string, options?: RequestOptions): APIPromise<FileDeleteResponse>;
47
- /**
48
- * Download a specific file by its ID.
49
- *
50
- * Args: file_id: The ID of the file to download.
51
- *
52
- * Returns: FileStreamResponse: The response containing the file to be downloaded.
53
- */
54
- content(fileID: string, options?: RequestOptions): APIPromise<Response>;
55
- }
56
- export type FileObjectsCursor = Cursor<FileObject>;
57
- /**
58
- * A model representing a file object in the system.
59
- *
60
- * This model contains metadata about files stored in the system, including
61
- * identifiers, size information, and timestamps.
62
- */
63
- export interface FileObject {
64
- /**
65
- * Unique identifier for the file
66
- */
67
- id: string;
68
- /**
69
- * Name of the file including extension
70
- */
71
- filename: string;
72
- /**
73
- * Size of the file in bytes
74
- */
75
- bytes: number;
76
- /**
77
- * MIME type of the file
78
- */
79
- mime_type: string;
80
- /**
81
- * Version of the file
82
- */
83
- version: number;
84
- /**
85
- * Timestamp when the file was created
86
- */
87
- created_at: string;
88
- /**
89
- * Timestamp when the file was last updated
90
- */
91
- updated_at: string;
92
- }
93
- /**
94
- * Pagination model that includes total count of items.
95
- */
96
- export interface PaginationWithTotal {
97
- /**
98
- * Maximum number of items to return per page
99
- */
100
- limit?: number;
101
- /**
102
- * Offset of the first item to return
103
- */
104
- offset?: number;
105
- /**
106
- * Total number of items available
107
- */
108
- total?: number;
109
- }
110
- export interface FileDeleteResponse {
111
- /**
112
- * The ID of the deleted file
113
- */
114
- id: string;
115
- /**
116
- * Whether the file was deleted
117
- */
118
- deleted?: boolean;
119
- /**
120
- * The type of the deleted object
121
- */
122
- object?: 'file';
123
- }
124
- export interface FileCreateParams {
125
- /**
126
- * The file to upload
127
- */
128
- file: Uploadable;
129
- }
130
- export interface FileUpdateParams {
131
- /**
132
- * The file to update
133
- */
134
- file: Uploadable;
135
- }
136
- export interface FileListParams extends CursorParams {
137
- /**
138
- * Search query for fuzzy matching over name and description fields
139
- */
140
- q?: string | null;
141
- }
142
- export declare namespace Files {
143
- export { type FileObject as FileObject, type PaginationWithTotal as PaginationWithTotal, type FileDeleteResponse as FileDeleteResponse, type FileObjectsCursor as FileObjectsCursor, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, };
144
- }
1
+ export * from "./files/index.mjs";
145
2
  //# sourceMappingURL=files.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EA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WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
1
+ {"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":""}
@@ -1,145 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
2
- import { APIPromise } from "../core/api-promise.js";
3
- import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
4
- import { type Uploadable } from "../core/uploads.js";
5
- import { RequestOptions } from "../internal/request-options.js";
6
- export declare class Files extends APIResource {
7
- /**
8
- * Upload a new file.
9
- *
10
- * Args: file: The file to upload.
11
- *
12
- * Returns: FileResponse: The response containing the details of the uploaded file.
13
- */
14
- create(body: FileCreateParams, options?: RequestOptions): APIPromise<FileObject>;
15
- /**
16
- * Retrieve details of a specific file by its ID.
17
- *
18
- * Args: file_id: The ID of the file to retrieve.
19
- *
20
- * Returns: FileResponse: The response containing the file details.
21
- */
22
- retrieve(fileID: string, options?: RequestOptions): APIPromise<FileObject>;
23
- /**
24
- * Update the details of a specific file.
25
- *
26
- * Args: file_id: The ID of the file to update. file: The new details for the file.
27
- *
28
- * Returns: FileObject: The updated file details.
29
- */
30
- update(fileID: string, body: FileUpdateParams, options?: RequestOptions): APIPromise<FileObject>;
31
- /**
32
- * List all files for the authenticated user.
33
- *
34
- * Args: pagination: The pagination options
35
- *
36
- * Returns: A list of files belonging to the user.
37
- */
38
- list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FileObjectsCursor, FileObject>;
39
- /**
40
- * Delete a specific file by its ID.
41
- *
42
- * Args: file_id: The ID of the file to delete.
43
- *
44
- * Returns: FileDeleted: The response containing the details of the deleted file.
45
- */
46
- delete(fileID: string, options?: RequestOptions): APIPromise<FileDeleteResponse>;
47
- /**
48
- * Download a specific file by its ID.
49
- *
50
- * Args: file_id: The ID of the file to download.
51
- *
52
- * Returns: FileStreamResponse: The response containing the file to be downloaded.
53
- */
54
- content(fileID: string, options?: RequestOptions): APIPromise<Response>;
55
- }
56
- export type FileObjectsCursor = Cursor<FileObject>;
57
- /**
58
- * A model representing a file object in the system.
59
- *
60
- * This model contains metadata about files stored in the system, including
61
- * identifiers, size information, and timestamps.
62
- */
63
- export interface FileObject {
64
- /**
65
- * Unique identifier for the file
66
- */
67
- id: string;
68
- /**
69
- * Name of the file including extension
70
- */
71
- filename: string;
72
- /**
73
- * Size of the file in bytes
74
- */
75
- bytes: number;
76
- /**
77
- * MIME type of the file
78
- */
79
- mime_type: string;
80
- /**
81
- * Version of the file
82
- */
83
- version: number;
84
- /**
85
- * Timestamp when the file was created
86
- */
87
- created_at: string;
88
- /**
89
- * Timestamp when the file was last updated
90
- */
91
- updated_at: string;
92
- }
93
- /**
94
- * Pagination model that includes total count of items.
95
- */
96
- export interface PaginationWithTotal {
97
- /**
98
- * Maximum number of items to return per page
99
- */
100
- limit?: number;
101
- /**
102
- * Offset of the first item to return
103
- */
104
- offset?: number;
105
- /**
106
- * Total number of items available
107
- */
108
- total?: number;
109
- }
110
- export interface FileDeleteResponse {
111
- /**
112
- * The ID of the deleted file
113
- */
114
- id: string;
115
- /**
116
- * Whether the file was deleted
117
- */
118
- deleted?: boolean;
119
- /**
120
- * The type of the deleted object
121
- */
122
- object?: 'file';
123
- }
124
- export interface FileCreateParams {
125
- /**
126
- * The file to upload
127
- */
128
- file: Uploadable;
129
- }
130
- export interface FileUpdateParams {
131
- /**
132
- * The file to update
133
- */
134
- file: Uploadable;
135
- }
136
- export interface FileListParams extends CursorParams {
137
- /**
138
- * Search query for fuzzy matching over name and description fields
139
- */
140
- q?: string | null;
141
- }
142
- export declare namespace Files {
143
- export { type FileObject as FileObject, type PaginationWithTotal as PaginationWithTotal, type FileDeleteResponse as FileDeleteResponse, type FileObjectsCursor as FileObjectsCursor, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, };
144
- }
1
+ export * from "./files/index.js";
145
2
  //# sourceMappingURL=files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIhF;;;;;;OAMG;IACH,QAAQ,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BAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":""}
@@ -1,77 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Files = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const pagination_1 = require("../core/pagination.js");
7
- const headers_1 = require("../internal/headers.js");
8
- const uploads_1 = require("../internal/uploads.js");
9
- const path_1 = require("../internal/utils/path.js");
10
- class Files extends resource_1.APIResource {
11
- /**
12
- * Upload a new file.
13
- *
14
- * Args: file: The file to upload.
15
- *
16
- * Returns: FileResponse: The response containing the details of the uploaded file.
17
- */
18
- create(body, options) {
19
- return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
20
- }
21
- /**
22
- * Retrieve details of a specific file by its ID.
23
- *
24
- * Args: file_id: The ID of the file to retrieve.
25
- *
26
- * Returns: FileResponse: The response containing the file details.
27
- */
28
- retrieve(fileID, options) {
29
- return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
30
- }
31
- /**
32
- * Update the details of a specific file.
33
- *
34
- * Args: file_id: The ID of the file to update. file: The new details for the file.
35
- *
36
- * Returns: FileObject: The updated file details.
37
- */
38
- update(fileID, body, options) {
39
- return this._client.post((0, path_1.path) `/v1/files/${fileID}`, (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
40
- }
41
- /**
42
- * List all files for the authenticated user.
43
- *
44
- * Args: pagination: The pagination options
45
- *
46
- * Returns: A list of files belonging to the user.
47
- */
48
- list(query = {}, options) {
49
- return this._client.getAPIList('/v1/files', (pagination_1.Cursor), { query, ...options });
50
- }
51
- /**
52
- * Delete a specific file by its ID.
53
- *
54
- * Args: file_id: The ID of the file to delete.
55
- *
56
- * Returns: FileDeleted: The response containing the details of the deleted file.
57
- */
58
- delete(fileID, options) {
59
- return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, options);
60
- }
61
- /**
62
- * Download a specific file by its ID.
63
- *
64
- * Args: file_id: The ID of the file to download.
65
- *
66
- * Returns: FileStreamResponse: The response containing the file to be downloaded.
67
- */
68
- content(fileID, options) {
69
- return this._client.get((0, path_1.path) `/v1/files/${fileID}/content`, {
70
- ...options,
71
- headers: (0, headers_1.buildHeaders)([{ Accept: 'application/octet-stream' }, options?.headers]),
72
- __binaryResponse: true,
73
- });
74
- }
75
- }
76
- exports.Files = Files;
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./files/index.js"), exports);
77
6
  //# sourceMappingURL=files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,s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G,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,UAAU,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AA5ED,sBA4EC"}
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
@@ -1,73 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { Cursor } from "../core/pagination.mjs";
4
- import { buildHeaders } from "../internal/headers.mjs";
5
- import { multipartFormRequestOptions } from "../internal/uploads.mjs";
6
- import { path } from "../internal/utils/path.mjs";
7
- export class Files extends APIResource {
8
- /**
9
- * Upload a new file.
10
- *
11
- * Args: file: The file to upload.
12
- *
13
- * Returns: FileResponse: The response containing the details of the uploaded file.
14
- */
15
- create(body, options) {
16
- return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
17
- }
18
- /**
19
- * Retrieve details of a specific file by its ID.
20
- *
21
- * Args: file_id: The ID of the file to retrieve.
22
- *
23
- * Returns: FileResponse: The response containing the file details.
24
- */
25
- retrieve(fileID, options) {
26
- return this._client.get(path `/v1/files/${fileID}`, options);
27
- }
28
- /**
29
- * Update the details of a specific file.
30
- *
31
- * Args: file_id: The ID of the file to update. file: The new details for the file.
32
- *
33
- * Returns: FileObject: The updated file details.
34
- */
35
- update(fileID, body, options) {
36
- return this._client.post(path `/v1/files/${fileID}`, multipartFormRequestOptions({ body, ...options }, this._client));
37
- }
38
- /**
39
- * List all files for the authenticated user.
40
- *
41
- * Args: pagination: The pagination options
42
- *
43
- * Returns: A list of files belonging to the user.
44
- */
45
- list(query = {}, options) {
46
- return this._client.getAPIList('/v1/files', (Cursor), { query, ...options });
47
- }
48
- /**
49
- * Delete a specific file by its ID.
50
- *
51
- * Args: file_id: The ID of the file to delete.
52
- *
53
- * Returns: FileDeleted: The response containing the details of the deleted file.
54
- */
55
- delete(fileID, options) {
56
- return this._client.delete(path `/v1/files/${fileID}`, options);
57
- }
58
- /**
59
- * Download a specific file by its ID.
60
- *
61
- * Args: file_id: The ID of the file to download.
62
- *
63
- * Returns: FileStreamResponse: The response containing the file to be downloaded.
64
- */
65
- content(fileID, options) {
66
- return this._client.get(path `/v1/files/${fileID}/content`, {
67
- ...options,
68
- headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
69
- __binaryResponse: true,
70
- });
71
- }
72
- }
2
+ export * from "./files/index.mjs";
73
3
  //# sourceMappingURL=files.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;OAMG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAc,EAAE,IAAsB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,CAAA,aAAa,MAAM,EAAE,EACzB,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,MAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,UAAU,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -4,7 +4,7 @@ export { Chat, type ChatCreateCompletionResponse } from "./chat.mjs";
4
4
  export { DataSources, type DataSource, type DataSourceOauth2Params, type DataSourceType, type LinearDataSource, type NotionDataSource, type Oauth2Params, type DataSourceDeleteResponse, type DataSourceCreateParams, type DataSourceUpdateParams, type DataSourceListParams, type DataSourcesCursor, } from "./data-sources/data-sources.mjs";
5
5
  export { Embeddings, type EncodingFormat, type EmbeddingCreateParams } from "./embeddings.mjs";
6
6
  export { Extractions } from "./extractions/extractions.mjs";
7
- export { Files, type FileObject, type PaginationWithTotal, type FileDeleteResponse, type FileCreateParams, type FileUpdateParams, type FileListParams, type FileObjectsCursor, } from "./files.mjs";
7
+ export { Files, type FileObject, type PaginationWithTotal, type FileDeleteResponse, type FileCreateParams, type FileUpdateParams, type FileListParams, type FileObjectsCursor, } from "./files/files.mjs";
8
8
  export { Parsing } from "./parsing/parsing.mjs";
9
9
  export { Stores, type ExpiresAfter, type ScoredAudioURLInputChunk, type ScoredImageURLInputChunk, type ScoredTextInputChunk, type ScoredVideoURLInputChunk, type Store, type StoreChunkSearchOptions, type StoreDeleteResponse, type StoreMetadataFacetsResponse, type StoreQuestionAnsweringResponse, type StoreSearchResponse, type StoreCreateParams, type StoreUpdateParams, type StoreListParams, type StoreMetadataFacetsParams, type StoreQuestionAnsweringParams, type StoreSearchParams, type StoresCursor, } from "./stores/stores.mjs";
10
10
  export { type Embedding, type EmbeddingCreateResponse, type MultiEncodingEmbedding, type InfoResponse, type RerankResponse, type EmbedParams, type RerankParams, } from "./top-level.mjs";
@@ -4,7 +4,7 @@ export { Chat, type ChatCreateCompletionResponse } from "./chat.js";
4
4
  export { DataSources, type DataSource, type DataSourceOauth2Params, type DataSourceType, type LinearDataSource, type NotionDataSource, type Oauth2Params, type DataSourceDeleteResponse, type DataSourceCreateParams, type DataSourceUpdateParams, type DataSourceListParams, type DataSourcesCursor, } from "./data-sources/data-sources.js";
5
5
  export { Embeddings, type EncodingFormat, type EmbeddingCreateParams } from "./embeddings.js";
6
6
  export { Extractions } from "./extractions/extractions.js";
7
- export { Files, type FileObject, type PaginationWithTotal, type FileDeleteResponse, type FileCreateParams, type FileUpdateParams, type FileListParams, type FileObjectsCursor, } from "./files.js";
7
+ export { Files, type FileObject, type PaginationWithTotal, type FileDeleteResponse, type FileCreateParams, type FileUpdateParams, type FileListParams, type FileObjectsCursor, } from "./files/files.js";
8
8
  export { Parsing } from "./parsing/parsing.js";
9
9
  export { Stores, type ExpiresAfter, type ScoredAudioURLInputChunk, type ScoredImageURLInputChunk, type ScoredTextInputChunk, type ScoredVideoURLInputChunk, type Store, type StoreChunkSearchOptions, type StoreDeleteResponse, type StoreMetadataFacetsResponse, type StoreQuestionAnsweringResponse, type StoreSearchResponse, type StoreCreateParams, type StoreUpdateParams, type StoreListParams, type StoreMetadataFacetsParams, type StoreQuestionAnsweringParams, type StoreSearchParams, type StoresCursor, } from "./stores/stores.js";
10
10
  export { type Embedding, type EmbeddingCreateResponse, type MultiEncodingEmbedding, type InfoResponse, type RerankResponse, type EmbedParams, type RerankParams, } from "./top-level.js";
@@ -14,7 +14,7 @@ var embeddings_1 = require("./embeddings.js");
14
14
  Object.defineProperty(exports, "Embeddings", { enumerable: true, get: function () { return embeddings_1.Embeddings; } });
15
15
  var extractions_1 = require("./extractions/extractions.js");
16
16
  Object.defineProperty(exports, "Extractions", { enumerable: true, get: function () { return extractions_1.Extractions; } });
17
- var files_1 = require("./files.js");
17
+ var files_1 = require("./files/files.js");
18
18
  Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
19
19
  var parsing_1 = require("./parsing/parsing.js");
20
20
  Object.defineProperty(exports, "Parsing", { enumerable: true, get: function () { return parsing_1.Parsing; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,0CAQoB;AAPlB,mGAAA,OAAO,OAAA;AAQT,kCAAiE;AAAxD,4FAAA,IAAI,OAAA;AACb,+DAaqC;AAZnC,2GAAA,WAAW,OAAA;AAab,8CAA2F;AAAlF,wGAAA,UAAU,OAAA;AACnB,4DAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,oCASiB;AARf,8FAAA,KAAK,OAAA;AASP,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,6CAoByB;AAnBvB,gGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,0CAQoB;AAPlB,mGAAA,OAAO,OAAA;AAQT,kCAAiE;AAAxD,4FAAA,IAAI,OAAA;AACb,+DAaqC;AAZnC,2GAAA,WAAW,OAAA;AAab,8CAA2F;AAAlF,wGAAA,UAAU,OAAA;AACnB,4DAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,0CASuB;AARrB,8FAAA,KAAK,OAAA;AASP,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,6CAoByB;AAnBvB,gGAAA,MAAM,OAAA"}
@@ -5,7 +5,7 @@ export { Chat } from "./chat.mjs";
5
5
  export { DataSources, } from "./data-sources/data-sources.mjs";
6
6
  export { Embeddings } from "./embeddings.mjs";
7
7
  export { Extractions } from "./extractions/extractions.mjs";
8
- export { Files, } from "./files.mjs";
8
+ export { Files, } from "./files/files.mjs";
9
9
  export { Parsing } from "./parsing/parsing.mjs";
10
10
  export { Stores, } from "./stores/stores.mjs";
11
11
  //# sourceMappingURL=index.mjs.map
@@ -4,6 +4,7 @@ import * as ContentAPI from "../extractions/content.mjs";
4
4
  import * as StoresAPI from "./stores.mjs";
5
5
  import { APIPromise } from "../../core/api-promise.mjs";
6
6
  import { RequestOptions } from "../../internal/request-options.mjs";
7
+ import { type MultipartUploadConfig } from "../../lib/upload-file.mjs";
7
8
  import { Uploadable } from "../../uploads.mjs";
8
9
  export declare class Files extends APIResource {
9
10
  /**
@@ -107,7 +108,7 @@ export declare class Files extends APIResource {
107
108
  * @param params - Upload configuration when using named parameters
108
109
  * @returns The created vector store file
109
110
  */
110
- upload(storeIdentifier: string, file: Uploadable, body?: Omit<FileCreateParams, 'file_id'>, options?: RequestOptions): Promise<StoreFile>;
111
+ upload(storeIdentifier: string, file: Uploadable, body?: Omit<FileCreateParams, 'file_id'>, options?: RequestOptions, multipartUpload?: MultipartUploadConfig): Promise<StoreFile>;
111
112
  upload(params: FileUploadHelperParams): Promise<StoreFile>;
112
113
  /**
113
114
  * Upload a file to files API, create a file in a vector store, and poll until processing is complete.
@@ -124,7 +125,7 @@ export declare class Files extends APIResource {
124
125
  * @param params - Upload and poll configuration when using named parameters
125
126
  * @returns The vector store file object once it reaches a terminal state
126
127
  */
127
- uploadAndPoll(storeIdentifier: string, file: Uploadable, body?: Omit<FileCreateParams, 'file_id'>, pollIntervalMs?: number, pollTimeoutMs?: number, options?: RequestOptions): Promise<StoreFile>;
128
+ uploadAndPoll(storeIdentifier: string, file: Uploadable, body?: Omit<FileCreateParams, 'file_id'>, pollIntervalMs?: number, pollTimeoutMs?: number, options?: RequestOptions, multipartUpload?: MultipartUploadConfig): Promise<StoreFile>;
128
129
  uploadAndPoll(params: FileUploadAndPollHelperParams): Promise<StoreFile>;
129
130
  }
130
131
  /**
@@ -157,6 +158,7 @@ export interface FileUploadHelperParams {
157
158
  file: Uploadable;
158
159
  body?: Omit<FileCreateParams, 'file_id'> | undefined;
159
160
  options?: RequestOptions | undefined;
161
+ multipartUpload?: MultipartUploadConfig | undefined;
160
162
  }
161
163
  /**
162
164
  * Parameters for uploading and polling a store file.
@@ -169,6 +171,7 @@ export interface FileUploadAndPollHelperParams {
169
171
  pollTimeoutMs?: number | undefined;
170
172
  options?: RequestOptions | undefined;
171
173
  returnChunks?: boolean | undefined;
174
+ multipartUpload?: MultipartUploadConfig | undefined;
172
175
  }
173
176
  /**
174
177
  * Represents a scored store file.
@@ -419,7 +422,7 @@ export declare namespace StoreFile {
419
422
  interface VideoChunkGeneratedMetadata {
420
423
  type?: 'video';
421
424
  file_type: string;
422
- file_size: number;
425
+ file_size?: number | null;
423
426
  total_duration_seconds: number;
424
427
  fps: number;
425
428
  width: number;
@@ -544,7 +547,7 @@ export declare namespace StoreFile {
544
547
  interface VideoChunkGeneratedMetadata {
545
548
  type?: 'video';
546
549
  file_type: string;
547
- file_size: number;
550
+ file_size?: number | null;
548
551
  total_duration_seconds: number;
549
552
  fps: number;
550
553
  width: number;
@@ -686,7 +689,7 @@ export declare namespace StoreFile {
686
689
  interface VideoChunkGeneratedMetadata {
687
690
  type?: 'video';
688
691
  file_type: string;
689
- file_size: number;
692
+ file_size?: number | null;
690
693
  total_duration_seconds: number;
691
694
  fps: number;
692
695
  width: number;
@@ -820,7 +823,7 @@ export declare namespace StoreFile {
820
823
  interface VideoChunkGeneratedMetadata {
821
824
  type?: 'video';
822
825
  file_type: string;
823
- file_size: number;
826
+ file_size?: number | null;
824
827
  total_duration_seconds: number;
825
828
  fps: number;
826
829
  width: number;