Skip to content

Commit 1aa8f5a

Browse files
codegen output 4db10943597d42a59fb95dab8dec4ddf (#40)
1 parent c2fb3d2 commit 1aa8f5a

File tree

149 files changed

+1995
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1995
-388
lines changed

docs/authentication.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
- [Obtaining User token](#obtaining-user-token)
1414
- [Switching between Service Account and User](#switching-between-service-account-and-user)
1515
- [OAuth 2.0 Auth](#oauth-20-auth)
16+
- [Authentication with OAuth2](#authentication-with-oauth2)
17+
- [Downscoping tokens](#downscoping-tokens)
18+
- [Token storage](#token-storage)
19+
- [In-memory token storage](#in-memory-token-storage)
20+
- [Custom storage](#custom-storage)
21+
- [Setting as-user header](#setting-as-user-header)
1622

1723
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1824

@@ -246,6 +252,8 @@ to authenticate as User with provided ID. The new token will be automatically fe
246252

247253
## OAuth 2.0 Auth
248254

255+
### Authentication with OAuth2
256+
249257
If your application needs to integrate with existing Box users who will provide
250258
their login credentials to grant your application access to their account, you
251259
will need to go through the standard OAuth2 login flow. A detailed guide for
@@ -287,6 +295,35 @@ You need to provide the auth code to the SDK to obtain an access token, then you
287295
await oauth.getTokensAuthorizationCodeGrant('code');
288296
```
289297

298+
### Revoking tokens
299+
300+
Access tokens for a client can be revoked when needed. As this removes the client's way of authenticating this client can no
301+
longer be used after this call. This method is only available for OAuth2 clients.
302+
303+
To revoke current client's tokens in the storage use the following code:
304+
305+
<!-- sample post_oauth2_revoke -->
306+
307+
```js
308+
await oauth.revokeTokens();
309+
// client's tokens have been revoked
310+
```
311+
312+
### Downscoping tokens
313+
314+
You can exchange a client's access token for one with a lower scope, in order
315+
to restrict the permissions for a child client or to pass to a less secure
316+
location (e.g. a browser-based app). This method is only available for OAuth2 clients.
317+
318+
For example to exchange the client's token for one with scopes to upload and delete items, but not to view their contents, which would be suitable for an less-trusted server-side process; use the following code:
319+
320+
<!-- sample post_oauth2_token downscope_token -->
321+
322+
```js
323+
let accessToken = await oauth.downscopeToken(['item_upload', 'item_delete']);
324+
// accessToken contains the new downscoped access token
325+
```
326+
290327
# Token storage
291328

292329
## In-memory token storage

docs/authorization.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ _Currently we don't have an example for calling `getAuthorize` in integration te
2525
- Query parameters of getAuthorize method
2626
- headers `GetAuthorizeHeadersArg`
2727
- Headers of getAuthorize method
28+
- cancellationToken `undefined | CancellationToken`
29+
- Token used for request cancellation.
2830

2931
### Returns
3032

docs/avatars.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ await client.avatars.getUserAvatar(user.id);
2525
- The ID of the user. Example: "12345"
2626
- headers `GetUserAvatarHeadersArg`
2727
- Headers of getUserAvatar method
28+
- cancellationToken `undefined | CancellationToken`
29+
- Token used for request cancellation.
2830

2931
### Returns
3032

@@ -63,6 +65,8 @@ await client.avatars.createUserAvatar(user.id, {
6365
- Request body of createUserAvatar method
6466
- headers `CreateUserAvatarHeadersArg`
6567
- Headers of createUserAvatar method
68+
- cancellationToken `undefined | CancellationToken`
69+
- Token used for request cancellation.
6670

6771
### Returns
6872

@@ -94,6 +98,8 @@ await client.avatars.deleteUserAvatar(user.id);
9498
- The ID of the user. Example: "12345"
9599
- headers `DeleteUserAvatarHeadersArg`
96100
- Headers of deleteUserAvatar method
101+
- cancellationToken `undefined | CancellationToken`
102+
- Token used for request cancellation.
97103

98104
### Returns
99105

docs/chunkedUploads.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ _Currently we don't have an example for calling `createFileUploadSession` in int
2929
- Request body of createFileUploadSession method
3030
- headers `CreateFileUploadSessionHeadersArg`
3131
- Headers of createFileUploadSession method
32+
- cancellationToken `undefined | CancellationToken`
33+
- Token used for request cancellation.
3234

3335
### Returns
3436

@@ -55,6 +57,8 @@ _Currently we don't have an example for calling `createFileUploadSessionForExist
5557
- Request body of createFileUploadSessionForExistingFile method
5658
- headers `CreateFileUploadSessionForExistingFileHeadersArg`
5759
- Headers of createFileUploadSessionForExistingFile method
60+
- cancellationToken `undefined | CancellationToken`
61+
- Token used for request cancellation.
5862

5963
### Returns
6064

@@ -79,6 +83,8 @@ _Currently we don't have an example for calling `getFileUploadSessionById` in in
7983
- The ID of the upload session. Example: "D5E3F7A"
8084
- headers `GetFileUploadSessionByIdHeadersArg`
8185
- Headers of getFileUploadSessionById method
86+
- cancellationToken `undefined | CancellationToken`
87+
- Token used for request cancellation.
8288

8389
### Returns
8490

@@ -105,6 +111,8 @@ _Currently we don't have an example for calling `uploadFilePart` in integration
105111
- Request body of uploadFilePart method
106112
- headers `UploadFilePartHeadersArg`
107113
- Headers of uploadFilePart method
114+
- cancellationToken `undefined | CancellationToken`
115+
- Token used for request cancellation.
108116

109117
### Returns
110118

@@ -131,6 +139,8 @@ _Currently we don't have an example for calling `deleteFileUploadSessionById` in
131139
- The ID of the upload session. Example: "D5E3F7A"
132140
- headers `DeleteFileUploadSessionByIdHeadersArg`
133141
- Headers of deleteFileUploadSessionById method
142+
- cancellationToken `undefined | CancellationToken`
143+
- Token used for request cancellation.
134144

135145
### Returns
136146

@@ -159,6 +169,8 @@ _Currently we don't have an example for calling `getFileUploadSessionParts` in i
159169
- Query parameters of getFileUploadSessionParts method
160170
- headers `GetFileUploadSessionPartsHeadersArg`
161171
- Headers of getFileUploadSessionParts method
172+
- cancellationToken `undefined | CancellationToken`
173+
- Token used for request cancellation.
162174

163175
### Returns
164176

@@ -186,6 +198,8 @@ _Currently we don't have an example for calling `createFileUploadSessionCommit`
186198
- Request body of createFileUploadSessionCommit method
187199
- headers `CreateFileUploadSessionCommitHeadersArg`
188200
- Headers of createFileUploadSessionCommit method
201+
- cancellationToken `undefined | CancellationToken`
202+
- Token used for request cancellation.
189203

190204
### Returns
191205

docs/classifications.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ _Currently we don't have an example for calling `getMetadataTemplateEnterpriseSe
2727

2828
- headers `GetMetadataTemplateEnterpriseSecurityClassificationSchemaHeadersArg`
2929
- Headers of getMetadataTemplateEnterpriseSecurityClassificationSchema method
30+
- cancellationToken `undefined | CancellationToken`
31+
- Token used for request cancellation.
3032

3133
### Returns
3234

@@ -52,6 +54,8 @@ _Currently we don't have an example for calling `deleteMetadataTemplateEnterpris
5254

5355
- headers `DeleteMetadataTemplateEnterpriseSecurityClassificationSchemaHeadersArg`
5456
- Headers of deleteMetadataTemplateEnterpriseSecurityClassificationSchema method
57+
- cancellationToken `undefined | CancellationToken`
58+
- Token used for request cancellation.
5559

5660
### Returns
5761

@@ -82,6 +86,8 @@ _Currently we don't have an example for calling `updateMetadataTemplateEnterpris
8286
- Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd method
8387
- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg`
8488
- Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd method
89+
- cancellationToken `undefined | CancellationToken`
90+
- Token used for request cancellation.
8591

8692
### Returns
8793

@@ -113,6 +119,8 @@ _Currently we don't have an example for calling `updateMetadataTemplateEnterpris
113119
- Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate method
114120
- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg`
115121
- Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate method
122+
- cancellationToken `undefined | CancellationToken`
123+
- Token used for request cancellation.
116124

117125
### Returns
118126

@@ -144,6 +152,8 @@ _Currently we don't have an example for calling `updateMetadataTemplateEnterpris
144152
- Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete method
145153
- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg`
146154
- Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete method
155+
- cancellationToken `undefined | CancellationToken`
156+
- Token used for request cancellation.
147157

148158
### Returns
149159

@@ -176,6 +186,8 @@ _Currently we don't have an example for calling `createMetadataTemplateSchemaCla
176186
- Request body of createMetadataTemplateSchemaClassification method
177187
- headers `CreateMetadataTemplateSchemaClassificationHeadersArg`
178188
- Headers of createMetadataTemplateSchemaClassification method
189+
- cancellationToken `undefined | CancellationToken`
190+
- Token used for request cancellation.
179191

180192
### Returns
181193

docs/collaborationAllowlistEntries.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ await client.collaborationAllowlistEntries.getCollaborationWhitelistEntries();
2727
- Query parameters of getCollaborationWhitelistEntries method
2828
- headers `GetCollaborationWhitelistEntriesHeadersArg`
2929
- Headers of getCollaborationWhitelistEntries method
30+
- cancellationToken `undefined | CancellationToken`
31+
- Token used for request cancellation.
3032

3133
### Returns
3234

@@ -59,6 +61,8 @@ await client.collaborationAllowlistEntries.createCollaborationWhitelistEntry({
5961
- Request body of createCollaborationWhitelistEntry method
6062
- headers `CreateCollaborationWhitelistEntryHeadersArg`
6163
- Headers of createCollaborationWhitelistEntry method
64+
- cancellationToken `undefined | CancellationToken`
65+
- Token used for request cancellation.
6266

6367
### Returns
6468

@@ -90,6 +94,8 @@ await client.collaborationAllowlistEntries.getCollaborationWhitelistEntryById(
9094
- The ID of the entry in the list. Example: "213123"
9195
- headers `GetCollaborationWhitelistEntryByIdHeadersArg`
9296
- Headers of getCollaborationWhitelistEntryById method
97+
- cancellationToken `undefined | CancellationToken`
98+
- Token used for request cancellation.
9399

94100
### Returns
95101

@@ -121,6 +127,8 @@ await client.collaborationAllowlistEntries.deleteCollaborationWhitelistEntryById
121127
- The ID of the entry in the list. Example: "213123"
122128
- headers `DeleteCollaborationWhitelistEntryByIdHeadersArg`
123129
- Headers of deleteCollaborationWhitelistEntryById method
130+
- cancellationToken `undefined | CancellationToken`
131+
- Token used for request cancellation.
124132

125133
### Returns
126134

docs/collaborationAllowlistExemptTargets.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ await client.collaborationAllowlistExemptTargets.getCollaborationWhitelistExempt
2727
- Query parameters of getCollaborationWhitelistExemptTargets method
2828
- headers `GetCollaborationWhitelistExemptTargetsHeadersArg`
2929
- Headers of getCollaborationWhitelistExemptTargets method
30+
- cancellationToken `undefined | CancellationToken`
31+
- Token used for request cancellation.
3032

3133
### Returns
3234

@@ -62,6 +64,8 @@ await client.collaborationAllowlistExemptTargets.createCollaborationWhitelistExe
6264
- Request body of createCollaborationWhitelistExemptTarget method
6365
- headers `CreateCollaborationWhitelistExemptTargetHeadersArg`
6466
- Headers of createCollaborationWhitelistExemptTarget method
67+
- cancellationToken `undefined | CancellationToken`
68+
- Token used for request cancellation.
6569

6670
### Returns
6771

@@ -93,6 +97,8 @@ await client.collaborationAllowlistExemptTargets.getCollaborationWhitelistExempt
9397
- The ID of the exemption to the list. Example: "984923"
9498
- headers `GetCollaborationWhitelistExemptTargetByIdHeadersArg`
9599
- Headers of getCollaborationWhitelistExemptTargetById method
100+
- cancellationToken `undefined | CancellationToken`
101+
- Token used for request cancellation.
96102

97103
### Returns
98104

@@ -124,6 +130,8 @@ await client.collaborationAllowlistExemptTargets.deleteCollaborationWhitelistExe
124130
- The ID of the exemption to the list. Example: "984923"
125131
- headers `DeleteCollaborationWhitelistExemptTargetByIdHeadersArg`
126132
- Headers of deleteCollaborationWhitelistExemptTargetById method
133+
- cancellationToken `undefined | CancellationToken`
134+
- Token used for request cancellation.
127135

128136
### Returns
129137

docs/collections.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ await client.collections.getCollections();
2727
- Query parameters of getCollections method
2828
- headers `GetCollectionsHeadersArg`
2929
- Headers of getCollections method
30+
- cancellationToken `undefined | CancellationToken`
31+
- Token used for request cancellation.
3032

3133
### Returns
3234

@@ -58,6 +60,8 @@ await client.collections.getCollectionItems(favouriteCollection.id!);
5860
- Query parameters of getCollectionItems method
5961
- headers `GetCollectionItemsHeadersArg`
6062
- Headers of getCollectionItems method
63+
- cancellationToken `undefined | CancellationToken`
64+
- Token used for request cancellation.
6165

6266
### Returns
6367

docs/comments.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ await client.comments.getFileComments(fileId);
2929
- Query parameters of getFileComments method
3030
- headers `GetFileCommentsHeadersArg`
3131
- Headers of getFileComments method
32+
- cancellationToken `undefined | CancellationToken`
33+
- Token used for request cancellation.
3234

3335
### Returns
3436

@@ -61,6 +63,8 @@ await client.comments.getCommentById(newComment.id!);
6163
- Query parameters of getCommentById method
6264
- headers `GetCommentByIdHeadersArg`
6365
- Headers of getCommentById method
66+
- cancellationToken `undefined | CancellationToken`
67+
- Token used for request cancellation.
6468

6569
### Returns
6670

@@ -95,6 +99,8 @@ await client.comments.updateCommentById(newReplyComment.id!, {
9599
- Query parameters of updateCommentById method
96100
- headers `UpdateCommentByIdHeadersArg`
97101
- Headers of updateCommentById method
102+
- cancellationToken `undefined | CancellationToken`
103+
- Token used for request cancellation.
98104

99105
### Returns
100106

@@ -123,6 +129,8 @@ await client.comments.deleteCommentById(newComment.id!);
123129
- The ID of the comment. Example: "12345"
124130
- headers `DeleteCommentByIdHeadersArg`
125131
- Headers of deleteCommentById method
132+
- cancellationToken `undefined | CancellationToken`
133+
- Token used for request cancellation.
126134

127135
### Returns
128136

@@ -160,6 +168,8 @@ await client.comments.createComment({
160168
- Query parameters of createComment method
161169
- headers `CreateCommentHeadersArg`
162170
- Headers of createComment method
171+
- cancellationToken `undefined | CancellationToken`
172+
- Token used for request cancellation.
163173

164174
### Returns
165175

docs/devicePinners.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ _Currently we don't have an example for calling `getDevicePinnerById` in integra
2121
- The ID of the device pin Example: "2324234"
2222
- headers `GetDevicePinnerByIdHeadersArg`
2323
- Headers of getDevicePinnerById method
24+
- cancellationToken `undefined | CancellationToken`
25+
- Token used for request cancellation.
2426

2527
### Returns
2628

@@ -45,6 +47,8 @@ _Currently we don't have an example for calling `deleteDevicePinnerById` in inte
4547
- The ID of the device pin Example: "2324234"
4648
- headers `DeleteDevicePinnerByIdHeadersArg`
4749
- Headers of deleteDevicePinnerById method
50+
- cancellationToken `undefined | CancellationToken`
51+
- Token used for request cancellation.
4852

4953
### Returns
5054

@@ -74,6 +78,8 @@ _Currently we don't have an example for calling `getEnterpriseDevicePinners` in
7478
- Query parameters of getEnterpriseDevicePinners method
7579
- headers `GetEnterpriseDevicePinnersHeadersArg`
7680
- Headers of getEnterpriseDevicePinners method
81+
- cancellationToken `undefined | CancellationToken`
82+
- Token used for request cancellation.
7783

7884
### Returns
7985

0 commit comments

Comments
 (0)