Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/authorization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# AuthorizationManager


- [Authorize user](#authorize-user)

## Authorize user
Expand All @@ -18,7 +17,7 @@ This operation is performed by calling function `getAuthorize`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-authorize/).

*Currently we don't have an example for calling `getAuthorize` in integration tests*
_Currently we don't have an example for calling `getAuthorize` in integration tests_

### Arguments

Expand All @@ -27,11 +26,8 @@ See the endpoint docs at
- headers `GetAuthorizeHeadersArg`
- Headers of getAuthorize method


### Returns

This function returns a value of type `undefined`.

Does not return any data, but rather should be used in the browser.


31 changes: 16 additions & 15 deletions docs/avatars.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# AvatarsManager


- [Get user avatar](#get-user-avatar)
- [Add or update user avatar](#add-or-update-user-avatar)
- [Delete user avatar](#delete-user-avatar)
Expand All @@ -15,8 +14,9 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-users-id-avatar/).

<!-- sample get_users_id_avatar -->

```ts
await client.avatars.getUserAvatar(user.id)
await client.avatars.getUserAvatar(user.id);
```

### Arguments
Expand All @@ -26,7 +26,6 @@ await client.avatars.getUserAvatar(user.id)
- headers `GetUserAvatarHeadersArg`
- Headers of getUserAvatar method


### Returns

This function returns a value of type `ByteStream`.
Expand All @@ -35,7 +34,6 @@ When an avatar can be found for the user the
image data will be returned in the body of the
response.


## Add or update user avatar

Adds or updates a user avatar.
Expand All @@ -46,8 +44,15 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-users-id-avatar/).

<!-- sample post_users_id_avatar -->

```ts
await client.avatars.createUserAvatar(user.id, { pic: decodeBase64ByteStream("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEW10NBjBBbqAAAAH0lEQVRoge3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAvg0hAAABmmDh1QAAAABJRU5ErkJggg=="), picContentType: "image/png", picFileName: "avatar.png" } satisfies CreateUserAvatarRequestBodyArg)
await client.avatars.createUserAvatar(user.id, {
pic: decodeBase64ByteStream(
'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEW10NBjBBbqAAAAH0lEQVRoge3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAvg0hAAABmmDh1QAAAABJRU5ErkJggg=='
),
picContentType: 'image/png',
picFileName: 'avatar.png',
} satisfies CreateUserAvatarRequestBodyArg);
```

### Arguments
Expand All @@ -59,15 +64,13 @@ await client.avatars.createUserAvatar(user.id, { pic: decodeBase64ByteStream("iV
- headers `CreateUserAvatarHeadersArg`
- Headers of createUserAvatar method


### Returns

This function returns a value of type `UserAvatar`.

* `ok`: Returns the `pic_urls` object with URLs to existing
user avatars that were updated.* `created`: Returns the `pic_urls` object with URLS to user avatars
uploaded to Box with the request.

- `ok`: Returns the `pic_urls` object with URLs to existing
user avatars that were updated.\* `created`: Returns the `pic_urls` object with URLS to user avatars
uploaded to Box with the request.

## Delete user avatar

Expand All @@ -80,8 +83,9 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/delete-users-id-avatar/).

<!-- sample delete_users_id_avatar -->

```ts
await client.avatars.deleteUserAvatar(user.id)
await client.avatars.deleteUserAvatar(user.id);
```

### Arguments
Expand All @@ -91,11 +95,8 @@ await client.avatars.deleteUserAvatar(user.id)
- headers `DeleteUserAvatarHeadersArg`
- Headers of deleteUserAvatar method


### Returns

This function returns a value of type `undefined`.

* `no_content`: Removes the avatar and returns an empty response.


- `no_content`: Removes the avatar and returns an empty response.
48 changes: 25 additions & 23 deletions docs/chunkedUploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-files-upload-sessions/).

<!-- sample post_files_upload_sessions -->

```ts
await client.chunkedUploads.createFileUploadSession({ fileName: fileName, fileSize: fileSize, folderId: folderId } satisfies CreateFileUploadSessionRequestBodyArg)
await client.chunkedUploads.createFileUploadSession({
fileName: fileName,
fileSize: fileSize,
folderId: folderId,
} satisfies CreateFileUploadSessionRequestBodyArg);
```

### Arguments
Expand All @@ -31,14 +36,12 @@ await client.chunkedUploads.createFileUploadSession({ fileName: fileName, fileSi
- headers `CreateFileUploadSessionHeadersArg`
- Headers of createFileUploadSession method


### Returns

This function returns a value of type `UploadSession`.

Returns a new upload session.


## Create upload session for existing file

Creates an upload session for an existing file.
Expand All @@ -48,25 +51,23 @@ This operation is performed by calling function `createFileUploadSessionForExist
See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-files-id-upload-sessions/).

*Currently we don't have an example for calling `createFileUploadSessionForExistingFile` in integration tests*
_Currently we don't have an example for calling `createFileUploadSessionForExistingFile` in integration tests_

### Arguments

- fileId `string`
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345"
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345"
- requestBody `CreateFileUploadSessionForExistingFileRequestBodyArg`
- Request body of createFileUploadSessionForExistingFile method
- headers `CreateFileUploadSessionForExistingFileHeadersArg`
- Headers of createFileUploadSessionForExistingFile method


### Returns

This function returns a value of type `UploadSession`.

Returns a new upload session.


## Get upload session

Return information about an upload session.
Expand All @@ -77,8 +78,9 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-files-upload-sessions-id/).

<!-- sample get_files_upload_sessions_id -->

```ts
await client.chunkedUploads.getFileUploadSessionById(uploadSessionId)
await client.chunkedUploads.getFileUploadSessionById(uploadSessionId);
```

### Arguments
Expand All @@ -88,14 +90,12 @@ await client.chunkedUploads.getFileUploadSessionById(uploadSessionId)
- headers `GetFileUploadSessionByIdHeadersArg`
- Headers of getFileUploadSessionById method


### Returns

This function returns a value of type `UploadSession`.

Returns an upload session object.


## Upload part of file

Updates a chunk of an upload session for a file.
Expand All @@ -106,8 +106,13 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/put-files-upload-sessions-id/).

<!-- sample put_files_upload_sessions_id -->

```ts
await client.chunkedUploads.uploadFilePart(uploadSessionId, uploadedChunk, new UploadFilePartHeadersArg({ digest: digest, contentRange: contentRange }))
await client.chunkedUploads.uploadFilePart(
uploadSessionId,
uploadedChunk,
new UploadFilePartHeadersArg({ digest: digest, contentRange: contentRange })
);
```

### Arguments
Expand All @@ -119,14 +124,12 @@ await client.chunkedUploads.uploadFilePart(uploadSessionId, uploadedChunk, new U
- headers `UploadFilePartHeadersArg`
- Headers of uploadFilePart method


### Returns

This function returns a value of type `UploadedPart`.

Chunk has been uploaded successfully.


## Remove upload session

Abort an upload session and discard all data uploaded.
Expand All @@ -138,7 +141,7 @@ This operation is performed by calling function `deleteFileUploadSessionById`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/delete-files-upload-sessions-id/).

*Currently we don't have an example for calling `deleteFileUploadSessionById` in integration tests*
_Currently we don't have an example for calling `deleteFileUploadSessionById` in integration tests_

### Arguments

Expand All @@ -147,15 +150,13 @@ See the endpoint docs at
- headers `DeleteFileUploadSessionByIdHeadersArg`
- Headers of deleteFileUploadSessionById method


### Returns

This function returns a value of type `undefined`.

A blank response is returned if the session was
successfully aborted.


## List parts

Return a list of the chunks uploaded to the upload
Expand All @@ -167,8 +168,9 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-files-upload-sessions-id-parts/).

<!-- sample get_files_upload_sessions_id_parts -->

```ts
await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId)
await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId);
```

### Arguments
Expand All @@ -180,14 +182,12 @@ await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId)
- headers `GetFileUploadSessionPartsHeadersArg`
- Headers of getFileUploadSessionParts method


### Returns

This function returns a value of type `UploadParts`.

Returns a list of parts that have been uploaded.


## Commit upload session

Close an upload session and create a file from the
Expand All @@ -199,8 +199,13 @@ See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-files-upload-sessions-id-commit/).

<!-- sample post_files_upload_sessions_id_commit -->

```ts
await client.chunkedUploads.createFileUploadSessionCommit(uploadSessionId, { parts: parts } satisfies CreateFileUploadSessionCommitRequestBodyArg, new CreateFileUploadSessionCommitHeadersArg({ digest: digest }))
await client.chunkedUploads.createFileUploadSessionCommit(
uploadSessionId,
{ parts: parts } satisfies CreateFileUploadSessionCommitRequestBodyArg,
new CreateFileUploadSessionCommitHeadersArg({ digest: digest })
);
```

### Arguments
Expand All @@ -212,7 +217,6 @@ await client.chunkedUploads.createFileUploadSessionCommit(uploadSessionId, { par
- headers `CreateFileUploadSessionCommitHeadersArg`
- Headers of createFileUploadSessionCommit method


### Returns

This function returns a value of type `Files`.
Expand All @@ -222,5 +226,3 @@ Returns the file object in a list.Returns when all chunks have been uploaded but
Inspect the upload session to get more information about the
progress of processing the chunks, then retry committing the file
when all chunks have processed.


Loading