@@ -4,10 +4,15 @@ This is a manager for chunked uploads (allowed for files at least 20MB).
4
4
5
5
- [ Create upload session] ( #create-upload-session )
6
6
- [ Create upload session for existing file] ( #create-upload-session-for-existing-file )
7
+ - [ Get upload session by URL] ( #get-upload-session-by-url )
7
8
- [ Get upload session] ( #get-upload-session )
9
+ - [ Upload part of file by URL] ( #upload-part-of-file-by-url )
8
10
- [ Upload part of file] ( #upload-part-of-file )
11
+ - [ Remove upload session by URL] ( #remove-upload-session-by-url )
9
12
- [ Remove upload session] ( #remove-upload-session )
13
+ - [ List parts by URL] ( #list-parts-by-url )
10
14
- [ List parts] ( #list-parts )
15
+ - [ Commit upload session by URL] ( #commit-upload-session-by-url )
11
16
- [ Commit upload session] ( #commit-upload-session )
12
17
- [ Upload big file] ( #upload-big-file )
13
18
@@ -23,17 +28,11 @@ See the endpoint docs at
23
28
<!-- sample post_files_upload_sessions -->
24
29
25
30
``` ts
26
- await this .createFileUploadSession (
27
- {
28
- fileName: fileName ,
29
- fileSize: fileSize ,
30
- folderId: parentFolderId ,
31
- } satisfies CreateFileUploadSessionRequestBody ,
32
- {
33
- headers: new CreateFileUploadSessionHeaders ({}),
34
- cancellationToken: cancellationToken ,
35
- } satisfies CreateFileUploadSessionOptionalsInput
36
- );
31
+ await client .chunkedUploads .createFileUploadSession ({
32
+ fileName: fileName ,
33
+ fileSize: fileSize ,
34
+ folderId: parentFolderId ,
35
+ } satisfies CreateFileUploadSessionRequestBody );
37
36
```
38
37
39
38
### Arguments
@@ -75,16 +74,52 @@ This function returns a value of type `UploadSession`.
75
74
76
75
Returns a new upload session.
77
76
77
+ ## Get upload session by URL
78
+
79
+ Return information about an upload session.
80
+
81
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions ) endpoint.
82
+
83
+ This operation is performed by calling function ` getFileUploadSessionByUrl ` .
84
+
85
+ See the endpoint docs at
86
+ [ API Reference] ( https://developer.box.com/reference/get-files-upload-sessions-id/ ) .
87
+
88
+ <!-- sample get_files_upload_sessions_id -->
89
+
90
+ ``` ts
91
+ await client .chunkedUploads .getFileUploadSessionByUrl (statusUrl );
92
+ ```
93
+
94
+ ### Arguments
95
+
96
+ - url ` string `
97
+ - URL of getFileUploadSessionById method
98
+ - optionalsInput ` GetFileUploadSessionByUrlOptionalsInput `
99
+ -
100
+
101
+ ### Returns
102
+
103
+ This function returns a value of type ` UploadSession ` .
104
+
105
+ Returns an upload session object.
106
+
78
107
## Get upload session
79
108
80
109
Return information about an upload session.
81
110
111
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions ) endpoint.
112
+
82
113
This operation is performed by calling function ` getFileUploadSessionById ` .
83
114
84
115
See the endpoint docs at
85
116
[ API Reference] ( https://developer.box.com/reference/get-files-upload-sessions-id/ ) .
86
117
87
- _ Currently we don't have an example for calling ` getFileUploadSessionById ` in integration tests_
118
+ <!-- sample get_files_upload_sessions_id -->
119
+
120
+ ``` ts
121
+ await client .chunkedUploads .getFileUploadSessionById (uploadSessionId );
122
+ ```
88
123
89
124
### Arguments
90
125
@@ -99,9 +134,54 @@ This function returns a value of type `UploadSession`.
99
134
100
135
Returns an upload session object.
101
136
137
+ ## Upload part of file by URL
138
+
139
+ Uploads a chunk of a file for an upload session.
140
+
141
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
142
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
143
+
144
+ This operation is performed by calling function ` uploadFilePartByUrl ` .
145
+
146
+ See the endpoint docs at
147
+ [ API Reference] ( https://developer.box.com/reference/put-files-upload-sessions-id/ ) .
148
+
149
+ <!-- sample put_files_upload_sessions_id -->
150
+
151
+ ``` ts
152
+ await client .chunkedUploads .uploadFilePartByUrl (
153
+ acc .uploadPartUrl ,
154
+ generateByteStreamFromBuffer (chunkBuffer ),
155
+ {
156
+ digest: digest ,
157
+ contentRange: contentRange ,
158
+ } satisfies UploadFilePartByUrlHeadersInput
159
+ );
160
+ ```
161
+
162
+ ### Arguments
163
+
164
+ - url ` string `
165
+ - URL of uploadFilePart method
166
+ - requestBody ` ByteStream `
167
+ - Request body of uploadFilePart method
168
+ - headersInput ` UploadFilePartByUrlHeadersInput `
169
+ - Headers of uploadFilePart method
170
+ - optionalsInput ` UploadFilePartByUrlOptionalsInput `
171
+ -
172
+
173
+ ### Returns
174
+
175
+ This function returns a value of type ` UploadedPart ` .
176
+
177
+ Chunk has been uploaded successfully.
178
+
102
179
## Upload part of file
103
180
104
- Updates a chunk of an upload session for a file.
181
+ Uploads a chunk of a file for an upload session.
182
+
183
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
184
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
105
185
106
186
This operation is performed by calling function ` uploadFilePart ` .
107
187
@@ -111,7 +191,7 @@ See the endpoint docs at
111
191
<!-- sample put_files_upload_sessions_id -->
112
192
113
193
``` ts
114
- await this .uploadFilePart (
194
+ await client . chunkedUploads .uploadFilePart (
115
195
acc .uploadSessionId ,
116
196
generateByteStreamFromBuffer (chunkBuffer ),
117
197
{
@@ -138,18 +218,59 @@ This function returns a value of type `UploadedPart`.
138
218
139
219
Chunk has been uploaded successfully.
140
220
221
+ ## Remove upload session by URL
222
+
223
+ Abort an upload session and discard all data uploaded.
224
+
225
+ This cannot be reversed.
226
+
227
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
228
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
229
+
230
+ This operation is performed by calling function ` deleteFileUploadSessionByUrl ` .
231
+
232
+ See the endpoint docs at
233
+ [ API Reference] ( https://developer.box.com/reference/delete-files-upload-sessions-id/ ) .
234
+
235
+ <!-- sample delete_files_upload_sessions_id -->
236
+
237
+ ``` ts
238
+ await client .chunkedUploads .deleteFileUploadSessionByUrl (abortUrl );
239
+ ```
240
+
241
+ ### Arguments
242
+
243
+ - url ` string `
244
+ - URL of deleteFileUploadSessionById method
245
+ - optionalsInput ` DeleteFileUploadSessionByUrlOptionalsInput `
246
+ -
247
+
248
+ ### Returns
249
+
250
+ This function returns a value of type ` undefined ` .
251
+
252
+ A blank response is returned if the session was
253
+ successfully aborted.
254
+
141
255
## Remove upload session
142
256
143
257
Abort an upload session and discard all data uploaded.
144
258
145
259
This cannot be reversed.
146
260
261
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
262
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
263
+
147
264
This operation is performed by calling function ` deleteFileUploadSessionById ` .
148
265
149
266
See the endpoint docs at
150
267
[ API Reference] ( https://developer.box.com/reference/delete-files-upload-sessions-id/ ) .
151
268
152
- _ Currently we don't have an example for calling ` deleteFileUploadSessionById ` in integration tests_
269
+ <!-- sample delete_files_upload_sessions_id -->
270
+
271
+ ``` ts
272
+ await client .chunkedUploads .deleteFileUploadSessionById (uploadSessionId );
273
+ ```
153
274
154
275
### Arguments
155
276
@@ -165,10 +286,43 @@ This function returns a value of type `undefined`.
165
286
A blank response is returned if the session was
166
287
successfully aborted.
167
288
289
+ ## List parts by URL
290
+
291
+ Return a list of the chunks uploaded to the upload session so far.
292
+
293
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
294
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
295
+
296
+ This operation is performed by calling function ` getFileUploadSessionPartsByUrl ` .
297
+
298
+ See the endpoint docs at
299
+ [ API Reference] ( https://developer.box.com/reference/get-files-upload-sessions-id-parts/ ) .
300
+
301
+ <!-- sample get_files_upload_sessions_id_parts -->
302
+
303
+ ``` ts
304
+ await client .chunkedUploads .getFileUploadSessionPartsByUrl (listPartsUrl );
305
+ ```
306
+
307
+ ### Arguments
308
+
309
+ - url ` string `
310
+ - URL of getFileUploadSessionParts method
311
+ - optionalsInput ` GetFileUploadSessionPartsByUrlOptionalsInput `
312
+ -
313
+
314
+ ### Returns
315
+
316
+ This function returns a value of type ` UploadParts ` .
317
+
318
+ Returns a list of parts that have been uploaded.
319
+
168
320
## List parts
169
321
170
- Return a list of the chunks uploaded to the upload
171
- session so far.
322
+ Return a list of the chunks uploaded to the upload session so far.
323
+
324
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
325
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
172
326
173
327
This operation is performed by calling function ` getFileUploadSessionParts ` .
174
328
@@ -178,11 +332,7 @@ See the endpoint docs at
178
332
<!-- sample get_files_upload_sessions_id_parts -->
179
333
180
334
``` ts
181
- await this .getFileUploadSessionParts (uploadSessionId , {
182
- queryParams: {} satisfies GetFileUploadSessionPartsQueryParams ,
183
- headers: new GetFileUploadSessionPartsHeaders ({}),
184
- cancellationToken: cancellationToken ,
185
- } satisfies GetFileUploadSessionPartsOptionalsInput );
335
+ await client .chunkedUploads .getFileUploadSessionParts (uploadSessionId );
186
336
```
187
337
188
338
### Arguments
@@ -198,10 +348,55 @@ This function returns a value of type `UploadParts`.
198
348
199
349
Returns a list of parts that have been uploaded.
200
350
351
+ ## Commit upload session by URL
352
+
353
+ Close an upload session and create a file from the uploaded chunks.
354
+
355
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
356
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
357
+
358
+ This operation is performed by calling function ` createFileUploadSessionCommitByUrl ` .
359
+
360
+ See the endpoint docs at
361
+ [ API Reference] ( https://developer.box.com/reference/post-files-upload-sessions-id-commit/ ) .
362
+
363
+ <!-- sample post_files_upload_sessions_id_commit -->
364
+
365
+ ``` ts
366
+ await client .chunkedUploads .createFileUploadSessionCommitByUrl (
367
+ commitUrl ,
368
+ { parts: parts } satisfies CreateFileUploadSessionCommitByUrlRequestBody ,
369
+ { digest: digest } satisfies CreateFileUploadSessionCommitByUrlHeadersInput
370
+ );
371
+ ```
372
+
373
+ ### Arguments
374
+
375
+ - url ` string `
376
+ - URL of createFileUploadSessionCommit method
377
+ - requestBody ` CreateFileUploadSessionCommitByUrlRequestBody `
378
+ - Request body of createFileUploadSessionCommit method
379
+ - headersInput ` CreateFileUploadSessionCommitByUrlHeadersInput `
380
+ - Headers of createFileUploadSessionCommit method
381
+ - optionalsInput ` CreateFileUploadSessionCommitByUrlOptionalsInput `
382
+ -
383
+
384
+ ### Returns
385
+
386
+ This function returns a value of type ` Files ` .
387
+
388
+ Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed.
389
+
390
+ Inspect the upload session to get more information about the
391
+ progress of processing the chunks, then retry committing the file
392
+ when all chunks have processed.
393
+
201
394
## Commit upload session
202
395
203
- Close an upload session and create a file from the
204
- uploaded chunks.
396
+ Close an upload session and create a file from the uploaded chunks.
397
+
398
+ The actual endpoint URL is returned by the [ ` Create upload session ` ] ( e://post-files-upload-sessions )
399
+ and [ ` Get upload session ` ] ( e://get-files-upload-sessions-id ) endpoints.
205
400
206
401
This operation is performed by calling function ` createFileUploadSessionCommit ` .
207
402
@@ -211,13 +406,10 @@ See the endpoint docs at
211
406
<!-- sample post_files_upload_sessions_id_commit -->
212
407
213
408
``` ts
214
- await this .createFileUploadSessionCommit (
409
+ await client . chunkedUploads .createFileUploadSessionCommit (
215
410
uploadSessionId ,
216
411
{ parts: parts } satisfies CreateFileUploadSessionCommitRequestBody ,
217
- { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput ,
218
- {
219
- cancellationToken: cancellationToken ,
220
- } satisfies CreateFileUploadSessionCommitOptionalsInput
412
+ { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput
221
413
);
222
414
```
223
415
0 commit comments