@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.
- package/CHANGELOG.md +22 -0
- package/client.d.mts +1 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/lib/upload-file.d.mts +34 -0
- package/lib/upload-file.d.mts.map +1 -0
- package/lib/upload-file.d.ts +34 -0
- package/lib/upload-file.d.ts.map +1 -0
- package/lib/upload-file.js +146 -0
- package/lib/upload-file.js.map +1 -0
- package/lib/upload-file.mjs +141 -0
- package/lib/upload-file.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/files/files.d.mts +156 -0
- package/resources/files/files.d.mts.map +1 -0
- package/resources/files/files.d.ts +156 -0
- package/resources/files/files.d.ts.map +1 -0
- package/resources/files/files.js +86 -0
- package/resources/files/files.js.map +1 -0
- package/resources/files/files.mjs +81 -0
- package/resources/files/files.mjs.map +1 -0
- package/resources/files/index.d.mts +3 -0
- package/resources/files/index.d.mts.map +1 -0
- package/resources/files/index.d.ts +3 -0
- package/resources/files/index.d.ts.map +1 -0
- package/resources/files/index.js +9 -0
- package/resources/files/index.js.map +1 -0
- package/resources/files/index.mjs +4 -0
- package/resources/files/index.mjs.map +1 -0
- package/resources/files/uploads.d.mts +169 -0
- package/resources/files/uploads.d.mts.map +1 -0
- package/resources/files/uploads.d.ts +169 -0
- package/resources/files/uploads.d.ts.map +1 -0
- package/resources/files/uploads.js +43 -0
- package/resources/files/uploads.js.map +1 -0
- package/resources/files/uploads.mjs +39 -0
- package/resources/files/uploads.mjs.map +1 -0
- package/resources/files.d.mts +1 -144
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +1 -144
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +2 -73
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +1 -71
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/stores/files.d.mts +9 -6
- package/resources/stores/files.d.mts.map +1 -1
- package/resources/stores/files.d.ts +9 -6
- package/resources/stores/files.d.ts.map +1 -1
- package/resources/stores/files.js +15 -4
- package/resources/stores/files.js.map +1 -1
- package/resources/stores/files.mjs +15 -4
- package/resources/stores/files.mjs.map +1 -1
- package/resources/stores/stores.d.mts +4 -4
- package/resources/stores/stores.d.mts.map +1 -1
- package/resources/stores/stores.d.ts +4 -4
- package/resources/stores/stores.d.ts.map +1 -1
- package/src/client.ts +10 -10
- package/src/index.ts +1 -0
- package/src/lib/upload-file.ts +233 -0
- package/src/resources/files/files.ts +239 -0
- package/src/resources/files/index.ts +23 -0
- package/src/resources/files/uploads.ts +229 -0
- package/src/resources/files.ts +1 -201
- package/src/resources/index.ts +1 -1
- package/src/resources/stores/files.ts +27 -6
- package/src/resources/stores/stores.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as FilesAPI from './files';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Uploads extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Initiate a multipart upload and receive presigned URLs for uploading parts
|
|
12
|
+
* directly to storage.
|
|
13
|
+
*/
|
|
14
|
+
create(body: UploadCreateParams, options?: RequestOptions): APIPromise<UploadCreateResponse> {
|
|
15
|
+
return this._client.post('/v1/files/uploads', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get a multipart upload's details with fresh presigned URLs for any parts not yet
|
|
20
|
+
* uploaded.
|
|
21
|
+
*/
|
|
22
|
+
retrieve(uploadID: string, options?: RequestOptions): APIPromise<UploadRetrieveResponse> {
|
|
23
|
+
return this._client.get(path`/v1/files/uploads/${uploadID}`, options);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List all in-progress multipart uploads for the authenticated organization.
|
|
28
|
+
*/
|
|
29
|
+
list(options?: RequestOptions): APIPromise<UploadListResponse> {
|
|
30
|
+
return this._client.get('/v1/files/uploads', options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Abort a multipart upload and clean up any uploaded parts.
|
|
35
|
+
*/
|
|
36
|
+
abort(uploadID: string, options?: RequestOptions): APIPromise<UploadAbortResponse> {
|
|
37
|
+
return this._client.post(path`/v1/files/uploads/${uploadID}/abort`, options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Complete a multipart upload after all parts have been uploaded. Creates the file
|
|
42
|
+
* object and returns it.
|
|
43
|
+
*/
|
|
44
|
+
complete(
|
|
45
|
+
uploadID: string,
|
|
46
|
+
body: UploadCompleteParams,
|
|
47
|
+
options?: RequestOptions,
|
|
48
|
+
): APIPromise<FilesAPI.FileObject> {
|
|
49
|
+
return this._client.post(path`/v1/files/uploads/${uploadID}/complete`, { body, ...options });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface MultipartUploadPart {
|
|
54
|
+
/**
|
|
55
|
+
* 1-based part number
|
|
56
|
+
*/
|
|
57
|
+
part_number: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* ETag returned by the storage backend after uploading the part
|
|
61
|
+
*/
|
|
62
|
+
etag: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface MultipartUploadPartURL {
|
|
66
|
+
/**
|
|
67
|
+
* 1-based part number
|
|
68
|
+
*/
|
|
69
|
+
part_number: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Presigned URL for uploading this part
|
|
73
|
+
*/
|
|
74
|
+
url: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface UploadCreateResponse {
|
|
78
|
+
/**
|
|
79
|
+
* The multipart upload ID (use this to complete or abort)
|
|
80
|
+
*/
|
|
81
|
+
id: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Presigned URLs for uploading parts
|
|
85
|
+
*/
|
|
86
|
+
part_urls: Array<MultipartUploadPartURL>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface UploadRetrieveResponse {
|
|
90
|
+
/**
|
|
91
|
+
* The multipart upload record ID
|
|
92
|
+
*/
|
|
93
|
+
id: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Original filename
|
|
97
|
+
*/
|
|
98
|
+
filename: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Total file size in bytes
|
|
102
|
+
*/
|
|
103
|
+
file_size: number;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* MIME type of the file
|
|
107
|
+
*/
|
|
108
|
+
mime_type: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Number of parts the file was split into
|
|
112
|
+
*/
|
|
113
|
+
part_count: number;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* When the upload was initiated
|
|
117
|
+
*/
|
|
118
|
+
created_at: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Parts that have already been uploaded
|
|
122
|
+
*/
|
|
123
|
+
completed_parts: Array<MultipartUploadPart>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Presigned URLs for the parts that still need to be uploaded
|
|
127
|
+
*/
|
|
128
|
+
part_urls: Array<MultipartUploadPartURL>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface UploadListResponse {
|
|
132
|
+
/**
|
|
133
|
+
* List of in-progress multipart uploads
|
|
134
|
+
*/
|
|
135
|
+
data: Array<UploadListResponse.Data>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export namespace UploadListResponse {
|
|
139
|
+
export interface Data {
|
|
140
|
+
/**
|
|
141
|
+
* The multipart upload record ID
|
|
142
|
+
*/
|
|
143
|
+
id: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Original filename
|
|
147
|
+
*/
|
|
148
|
+
filename: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Total file size in bytes
|
|
152
|
+
*/
|
|
153
|
+
file_size: number;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* MIME type of the file
|
|
157
|
+
*/
|
|
158
|
+
mime_type: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Number of parts the file was split into
|
|
162
|
+
*/
|
|
163
|
+
part_count: number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* When the upload was initiated
|
|
167
|
+
*/
|
|
168
|
+
created_at: string;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface UploadAbortResponse {
|
|
173
|
+
/**
|
|
174
|
+
* The ID of the deleted file
|
|
175
|
+
*/
|
|
176
|
+
id: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Whether the file was deleted
|
|
180
|
+
*/
|
|
181
|
+
deleted?: boolean;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The type of the deleted object
|
|
185
|
+
*/
|
|
186
|
+
object?: 'file';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface UploadCreateParams {
|
|
190
|
+
/**
|
|
191
|
+
* Name of the file including extension
|
|
192
|
+
*/
|
|
193
|
+
filename: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Total size of the file in bytes
|
|
197
|
+
*/
|
|
198
|
+
file_size: number;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* MIME type of the file
|
|
202
|
+
*/
|
|
203
|
+
mime_type: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Number of parts to split the upload into
|
|
207
|
+
*/
|
|
208
|
+
part_count?: number;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface UploadCompleteParams {
|
|
212
|
+
/**
|
|
213
|
+
* List of completed parts with their ETags
|
|
214
|
+
*/
|
|
215
|
+
parts: Array<MultipartUploadPart>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export declare namespace Uploads {
|
|
219
|
+
export {
|
|
220
|
+
type MultipartUploadPart as MultipartUploadPart,
|
|
221
|
+
type MultipartUploadPartURL as MultipartUploadPartURL,
|
|
222
|
+
type UploadCreateResponse as UploadCreateResponse,
|
|
223
|
+
type UploadRetrieveResponse as UploadRetrieveResponse,
|
|
224
|
+
type UploadListResponse as UploadListResponse,
|
|
225
|
+
type UploadAbortResponse as UploadAbortResponse,
|
|
226
|
+
type UploadCreateParams as UploadCreateParams,
|
|
227
|
+
type UploadCompleteParams as UploadCompleteParams,
|
|
228
|
+
};
|
|
229
|
+
}
|
package/src/resources/files.ts
CHANGED
|
@@ -1,203 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
6
|
-
import { type Uploadable } from '../core/uploads';
|
|
7
|
-
import { buildHeaders } from '../internal/headers';
|
|
8
|
-
import { RequestOptions } from '../internal/request-options';
|
|
9
|
-
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
10
|
-
import { path } from '../internal/utils/path';
|
|
11
|
-
|
|
12
|
-
export class Files extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* Upload a new file.
|
|
15
|
-
*
|
|
16
|
-
* Args: file: The file to upload.
|
|
17
|
-
*
|
|
18
|
-
* Returns: FileResponse: The response containing the details of the uploaded file.
|
|
19
|
-
*/
|
|
20
|
-
create(body: FileCreateParams, options?: RequestOptions): APIPromise<FileObject> {
|
|
21
|
-
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Retrieve details of a specific file by its ID.
|
|
26
|
-
*
|
|
27
|
-
* Args: file_id: The ID of the file to retrieve.
|
|
28
|
-
*
|
|
29
|
-
* Returns: FileResponse: The response containing the file details.
|
|
30
|
-
*/
|
|
31
|
-
retrieve(fileID: string, options?: RequestOptions): APIPromise<FileObject> {
|
|
32
|
-
return this._client.get(path`/v1/files/${fileID}`, options);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Update the details of a specific file.
|
|
37
|
-
*
|
|
38
|
-
* Args: file_id: The ID of the file to update. file: The new details for the file.
|
|
39
|
-
*
|
|
40
|
-
* Returns: FileObject: The updated file details.
|
|
41
|
-
*/
|
|
42
|
-
update(fileID: string, body: FileUpdateParams, options?: RequestOptions): APIPromise<FileObject> {
|
|
43
|
-
return this._client.post(
|
|
44
|
-
path`/v1/files/${fileID}`,
|
|
45
|
-
multipartFormRequestOptions({ body, ...options }, this._client),
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* List all files for the authenticated user.
|
|
51
|
-
*
|
|
52
|
-
* Args: pagination: The pagination options
|
|
53
|
-
*
|
|
54
|
-
* Returns: A list of files belonging to the user.
|
|
55
|
-
*/
|
|
56
|
-
list(
|
|
57
|
-
query: FileListParams | null | undefined = {},
|
|
58
|
-
options?: RequestOptions,
|
|
59
|
-
): PagePromise<FileObjectsCursor, FileObject> {
|
|
60
|
-
return this._client.getAPIList('/v1/files', Cursor<FileObject>, { query, ...options });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Delete a specific file by its ID.
|
|
65
|
-
*
|
|
66
|
-
* Args: file_id: The ID of the file to delete.
|
|
67
|
-
*
|
|
68
|
-
* Returns: FileDeleted: The response containing the details of the deleted file.
|
|
69
|
-
*/
|
|
70
|
-
delete(fileID: string, options?: RequestOptions): APIPromise<FileDeleteResponse> {
|
|
71
|
-
return this._client.delete(path`/v1/files/${fileID}`, options);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Download a specific file by its ID.
|
|
76
|
-
*
|
|
77
|
-
* Args: file_id: The ID of the file to download.
|
|
78
|
-
*
|
|
79
|
-
* Returns: FileStreamResponse: The response containing the file to be downloaded.
|
|
80
|
-
*/
|
|
81
|
-
content(fileID: string, options?: RequestOptions): APIPromise<Response> {
|
|
82
|
-
return this._client.get(path`/v1/files/${fileID}/content`, {
|
|
83
|
-
...options,
|
|
84
|
-
headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
|
|
85
|
-
__binaryResponse: true,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type FileObjectsCursor = Cursor<FileObject>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* A model representing a file object in the system.
|
|
94
|
-
*
|
|
95
|
-
* This model contains metadata about files stored in the system, including
|
|
96
|
-
* identifiers, size information, and timestamps.
|
|
97
|
-
*/
|
|
98
|
-
export interface FileObject {
|
|
99
|
-
/**
|
|
100
|
-
* Unique identifier for the file
|
|
101
|
-
*/
|
|
102
|
-
id: string;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Name of the file including extension
|
|
106
|
-
*/
|
|
107
|
-
filename: string;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Size of the file in bytes
|
|
111
|
-
*/
|
|
112
|
-
bytes: number;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* MIME type of the file
|
|
116
|
-
*/
|
|
117
|
-
mime_type: string;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Version of the file
|
|
121
|
-
*/
|
|
122
|
-
version: number;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Timestamp when the file was created
|
|
126
|
-
*/
|
|
127
|
-
created_at: string;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Timestamp when the file was last updated
|
|
131
|
-
*/
|
|
132
|
-
updated_at: string;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Pagination model that includes total count of items.
|
|
137
|
-
*/
|
|
138
|
-
export interface PaginationWithTotal {
|
|
139
|
-
/**
|
|
140
|
-
* Maximum number of items to return per page
|
|
141
|
-
*/
|
|
142
|
-
limit?: number;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Offset of the first item to return
|
|
146
|
-
*/
|
|
147
|
-
offset?: number;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Total number of items available
|
|
151
|
-
*/
|
|
152
|
-
total?: number;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface FileDeleteResponse {
|
|
156
|
-
/**
|
|
157
|
-
* The ID of the deleted file
|
|
158
|
-
*/
|
|
159
|
-
id: string;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Whether the file was deleted
|
|
163
|
-
*/
|
|
164
|
-
deleted?: boolean;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The type of the deleted object
|
|
168
|
-
*/
|
|
169
|
-
object?: 'file';
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface FileCreateParams {
|
|
173
|
-
/**
|
|
174
|
-
* The file to upload
|
|
175
|
-
*/
|
|
176
|
-
file: Uploadable;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export interface FileUpdateParams {
|
|
180
|
-
/**
|
|
181
|
-
* The file to update
|
|
182
|
-
*/
|
|
183
|
-
file: Uploadable;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface FileListParams extends CursorParams {
|
|
187
|
-
/**
|
|
188
|
-
* Search query for fuzzy matching over name and description fields
|
|
189
|
-
*/
|
|
190
|
-
q?: string | null;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export declare namespace Files {
|
|
194
|
-
export {
|
|
195
|
-
type FileObject as FileObject,
|
|
196
|
-
type PaginationWithTotal as PaginationWithTotal,
|
|
197
|
-
type FileDeleteResponse as FileDeleteResponse,
|
|
198
|
-
type FileObjectsCursor as FileObjectsCursor,
|
|
199
|
-
type FileCreateParams as FileCreateParams,
|
|
200
|
-
type FileUpdateParams as FileUpdateParams,
|
|
201
|
-
type FileListParams as FileListParams,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
3
|
+
export * from './files/index';
|
package/src/resources/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as StoresAPI from './stores';
|
|
|
7
7
|
import { APIPromise } from '../../core/api-promise';
|
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
9
|
import * as polling from '../../lib/polling';
|
|
10
|
+
import { type MultipartUploadConfig } from '../../lib/upload-file';
|
|
10
11
|
import { Uploadable } from '../../uploads';
|
|
11
12
|
import { path } from '../../internal/utils/path';
|
|
12
13
|
|
|
@@ -230,6 +231,7 @@ export class Files extends APIResource {
|
|
|
230
231
|
file: Uploadable,
|
|
231
232
|
body?: Omit<FileCreateParams, 'file_id'>,
|
|
232
233
|
options?: RequestOptions,
|
|
234
|
+
multipartUpload?: MultipartUploadConfig,
|
|
233
235
|
): Promise<StoreFile>;
|
|
234
236
|
async upload(params: FileUploadHelperParams): Promise<StoreFile>;
|
|
235
237
|
async upload(
|
|
@@ -237,13 +239,26 @@ export class Files extends APIResource {
|
|
|
237
239
|
file?: Uploadable,
|
|
238
240
|
body?: Omit<FileCreateParams, 'file_id'>,
|
|
239
241
|
options?: RequestOptions,
|
|
242
|
+
multipartUpload?: MultipartUploadConfig,
|
|
240
243
|
): Promise<StoreFile> {
|
|
241
244
|
const params: FileUploadHelperParams =
|
|
242
245
|
typeof storeIdentifierOrParams === 'string' ?
|
|
243
|
-
{
|
|
246
|
+
{
|
|
247
|
+
storeIdentifier: storeIdentifierOrParams,
|
|
248
|
+
file: file as Uploadable,
|
|
249
|
+
body,
|
|
250
|
+
options,
|
|
251
|
+
multipartUpload,
|
|
252
|
+
}
|
|
244
253
|
: storeIdentifierOrParams;
|
|
245
254
|
|
|
246
|
-
const fileUploadResponse = await this._client.files.create(
|
|
255
|
+
const fileUploadResponse = await this._client.files.create(
|
|
256
|
+
{
|
|
257
|
+
file: params.file,
|
|
258
|
+
...(params.multipartUpload && { multipartUpload: params.multipartUpload }),
|
|
259
|
+
},
|
|
260
|
+
params.options,
|
|
261
|
+
);
|
|
247
262
|
|
|
248
263
|
return this.create(
|
|
249
264
|
params.storeIdentifier,
|
|
@@ -274,6 +289,7 @@ export class Files extends APIResource {
|
|
|
274
289
|
pollIntervalMs?: number,
|
|
275
290
|
pollTimeoutMs?: number,
|
|
276
291
|
options?: RequestOptions,
|
|
292
|
+
multipartUpload?: MultipartUploadConfig,
|
|
277
293
|
): Promise<StoreFile>;
|
|
278
294
|
async uploadAndPoll(params: FileUploadAndPollHelperParams): Promise<StoreFile>;
|
|
279
295
|
async uploadAndPoll(
|
|
@@ -283,6 +299,7 @@ export class Files extends APIResource {
|
|
|
283
299
|
pollIntervalMs?: number,
|
|
284
300
|
pollTimeoutMs?: number,
|
|
285
301
|
options?: RequestOptions,
|
|
302
|
+
multipartUpload?: MultipartUploadConfig,
|
|
286
303
|
): Promise<StoreFile> {
|
|
287
304
|
const params: FileUploadAndPollHelperParams =
|
|
288
305
|
typeof storeIdentifierOrParams === 'string' ?
|
|
@@ -293,6 +310,7 @@ export class Files extends APIResource {
|
|
|
293
310
|
pollIntervalMs,
|
|
294
311
|
pollTimeoutMs,
|
|
295
312
|
options,
|
|
313
|
+
multipartUpload,
|
|
296
314
|
}
|
|
297
315
|
: storeIdentifierOrParams;
|
|
298
316
|
|
|
@@ -301,6 +319,7 @@ export class Files extends APIResource {
|
|
|
301
319
|
file: params.file,
|
|
302
320
|
body: params.body,
|
|
303
321
|
options: params.options,
|
|
322
|
+
multipartUpload: params.multipartUpload,
|
|
304
323
|
});
|
|
305
324
|
|
|
306
325
|
return this.poll({
|
|
@@ -346,6 +365,7 @@ export interface FileUploadHelperParams {
|
|
|
346
365
|
file: Uploadable;
|
|
347
366
|
body?: Omit<FileCreateParams, 'file_id'> | undefined;
|
|
348
367
|
options?: RequestOptions | undefined;
|
|
368
|
+
multipartUpload?: MultipartUploadConfig | undefined;
|
|
349
369
|
}
|
|
350
370
|
|
|
351
371
|
/**
|
|
@@ -359,6 +379,7 @@ export interface FileUploadAndPollHelperParams {
|
|
|
359
379
|
pollTimeoutMs?: number | undefined;
|
|
360
380
|
options?: RequestOptions | undefined;
|
|
361
381
|
returnChunks?: boolean | undefined;
|
|
382
|
+
multipartUpload?: MultipartUploadConfig | undefined;
|
|
362
383
|
}
|
|
363
384
|
|
|
364
385
|
/**
|
|
@@ -716,7 +737,7 @@ export namespace StoreFile {
|
|
|
716
737
|
|
|
717
738
|
file_type: string;
|
|
718
739
|
|
|
719
|
-
file_size
|
|
740
|
+
file_size?: number | null;
|
|
720
741
|
|
|
721
742
|
total_duration_seconds: number;
|
|
722
743
|
|
|
@@ -922,7 +943,7 @@ export namespace StoreFile {
|
|
|
922
943
|
|
|
923
944
|
file_type: string;
|
|
924
945
|
|
|
925
|
-
file_size
|
|
946
|
+
file_size?: number | null;
|
|
926
947
|
|
|
927
948
|
total_duration_seconds: number;
|
|
928
949
|
|
|
@@ -1148,7 +1169,7 @@ export namespace StoreFile {
|
|
|
1148
1169
|
|
|
1149
1170
|
file_type: string;
|
|
1150
1171
|
|
|
1151
|
-
file_size
|
|
1172
|
+
file_size?: number | null;
|
|
1152
1173
|
|
|
1153
1174
|
total_duration_seconds: number;
|
|
1154
1175
|
|
|
@@ -1364,7 +1385,7 @@ export namespace StoreFile {
|
|
|
1364
1385
|
|
|
1365
1386
|
file_type: string;
|
|
1366
1387
|
|
|
1367
|
-
file_size
|
|
1388
|
+
file_size?: number | null;
|
|
1368
1389
|
|
|
1369
1390
|
total_duration_seconds: number;
|
|
1370
1391
|
|
|
@@ -358,7 +358,7 @@ export namespace ScoredAudioURLInputChunk {
|
|
|
358
358
|
|
|
359
359
|
file_type: string;
|
|
360
360
|
|
|
361
|
-
file_size
|
|
361
|
+
file_size?: number | null;
|
|
362
362
|
|
|
363
363
|
total_duration_seconds: number;
|
|
364
364
|
|
|
@@ -604,7 +604,7 @@ export namespace ScoredImageURLInputChunk {
|
|
|
604
604
|
|
|
605
605
|
file_type: string;
|
|
606
606
|
|
|
607
|
-
file_size
|
|
607
|
+
file_size?: number | null;
|
|
608
608
|
|
|
609
609
|
total_duration_seconds: number;
|
|
610
610
|
|
|
@@ -850,7 +850,7 @@ export namespace ScoredTextInputChunk {
|
|
|
850
850
|
|
|
851
851
|
file_type: string;
|
|
852
852
|
|
|
853
|
-
file_size
|
|
853
|
+
file_size?: number | null;
|
|
854
854
|
|
|
855
855
|
total_duration_seconds: number;
|
|
856
856
|
|
|
@@ -1086,7 +1086,7 @@ export namespace ScoredVideoURLInputChunk {
|
|
|
1086
1086
|
|
|
1087
1087
|
file_type: string;
|
|
1088
1088
|
|
|
1089
|
-
file_size
|
|
1089
|
+
file_size?: number | null;
|
|
1090
1090
|
|
|
1091
1091
|
total_duration_seconds: number;
|
|
1092
1092
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.57.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.57.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.57.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.57.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|