box-node-sdk 2.0.0 → 2.1.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 +221 -205
- package/README.md +42 -18
- package/lib/box-node-sdk.d.ts +23 -10
- package/lib/box-node-sdk.js +40 -11
- package/lib/box-node-sdk.js.map +1 -1
- package/lib/managers/metadata.d.ts +4 -2
- package/lib/managers/metadata.js +17 -3
- package/lib/managers/metadata.js.map +1 -1
- package/lib/schemas/index.d.ts +3 -3
- package/lib/schemas/index.js +3 -3
- package/lib/schemas/index.js.map +1 -1
- package/lib/sessions/{anonymous-session.d.ts → ccg-session.d.ts} +18 -15
- package/lib/sessions/{anonymous-session.js → ccg-session.js} +23 -23
- package/lib/sessions/ccg-session.js.map +1 -0
- package/lib/token-manager.js +11 -10
- package/lib/token-manager.js.map +1 -1
- package/package.json +9 -7
- package/lib/sessions/anonymous-session.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Box Node.js SDK
|
|
|
4
4
|
[](https://greenkeeper.io/)
|
|
5
5
|
|
|
6
6
|
[](http://opensource.box.com/badges)
|
|
7
|
+
[](https://coveralls.io/github/box/box-node-sdk?branch=main)
|
|
7
8
|
|
|
8
9
|
A Node.js interface to the [Box Content API](https://developers.box.com/docs/).
|
|
9
10
|
|
|
@@ -12,7 +13,6 @@ Getting Started Docs: https://developer.box.com/guides/tooling/sdks/node/
|
|
|
12
13
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
13
14
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
14
15
|
|
|
15
|
-
|
|
16
16
|
- [Installation](#installation)
|
|
17
17
|
- [Getting Started](#getting-started)
|
|
18
18
|
- [Creating API Clients](#creating-api-clients)
|
|
@@ -21,21 +21,25 @@ Getting Started Docs: https://developer.box.com/guides/tooling/sdks/node/
|
|
|
21
21
|
- [App Auth Client](#app-auth-client)
|
|
22
22
|
- [Using the Client to Make API Calls](#using-the-client-to-make-api-calls)
|
|
23
23
|
- [Constructing API Calls Manually](#constructing-api-calls-manually)
|
|
24
|
+
- [Versions](#versions)
|
|
25
|
+
- [Supported Version](#supported-version)
|
|
26
|
+
- [Version schedule](#version-schedule)
|
|
24
27
|
- [Questions, Bugs, and Feature Requests?](#questions-bugs-and-feature-requests)
|
|
25
28
|
- [Contributing to the Box Node.js SDK](#contributing-to-the-box-nodejs-sdk)
|
|
29
|
+
- [Changelog](#changelog)
|
|
26
30
|
- [Copyright and License](#copyright-and-license)
|
|
27
31
|
|
|
28
32
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
29
33
|
|
|
30
|
-
Installation
|
|
31
|
-
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
32
36
|
|
|
33
37
|
```
|
|
34
38
|
npm install --save box-node-sdk
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
Getting Started
|
|
38
|
-
|
|
41
|
+
## Getting Started
|
|
42
|
+
|
|
39
43
|
|
|
40
44
|
To get started with the SDK, get a Developer Token from the Configuration page
|
|
41
45
|
of your app in the [Box Developer Console][dev-console].
|
|
@@ -63,8 +67,8 @@ client.users.get(client.CURRENT_USER_ID)
|
|
|
63
67
|
|
|
64
68
|
[dev-console]: https://app.box.com/developers/console
|
|
65
69
|
|
|
66
|
-
Creating API Clients
|
|
67
|
-
|
|
70
|
+
## Creating API Clients
|
|
71
|
+
|
|
68
72
|
|
|
69
73
|
Clients are used to communicate with the API on behalf of a user.
|
|
70
74
|
|
|
@@ -72,7 +76,7 @@ Box supports three different types of client:
|
|
|
72
76
|
|
|
73
77
|
- **Basic Client:** Simple, makes calls via the given access token until the access token expires
|
|
74
78
|
- **Persistent Client:** For use with traditional OAuth2 apps, can refresh its tokens automatically and persist them via a token store
|
|
75
|
-
- **App Auth Client:** Uses the app auth JWT grant to act on behalf of app
|
|
79
|
+
- **App Auth Client:** Uses the app auth JWT grant to act on behalf of app/managed users and create new tokens automatically
|
|
76
80
|
|
|
77
81
|
### Basic Client
|
|
78
82
|
|
|
@@ -130,7 +134,7 @@ var sdk = BoxSDK.getPreconfiguredInstance(sdkConfig);
|
|
|
130
134
|
// so you don't need to specify it here
|
|
131
135
|
var serviceAccountClient = sdk.getAppAuthClient('enterprise');
|
|
132
136
|
|
|
133
|
-
// Get an app user client
|
|
137
|
+
// Get an app user or managed user client
|
|
134
138
|
var appUserClient = sdk.getAppAuthClient('user', 'YOUR-APP-USER-ID');
|
|
135
139
|
```
|
|
136
140
|
|
|
@@ -150,13 +154,13 @@ var sdk = new BoxSDK({
|
|
|
150
154
|
// Get the service account client, used to create and manage app user accounts
|
|
151
155
|
var serviceAccountClient = sdk.getAppAuthClient('enterprise', 'APP_ENTERPRISE_ID');
|
|
152
156
|
|
|
153
|
-
// Get an app user client
|
|
157
|
+
// Get an app user or managed user client
|
|
154
158
|
var appUserClient = sdk.getAppAuthClient('user', 'YOUR-APP-USER-ID');
|
|
155
159
|
```
|
|
156
160
|
|
|
157
161
|
|
|
158
|
-
Using the Client to Make API Calls
|
|
159
|
-
|
|
162
|
+
## Using the Client to Make API Calls
|
|
163
|
+
|
|
160
164
|
|
|
161
165
|
The different API endpoints you can call are represented as methods, grouped into
|
|
162
166
|
managers by the type of object they interact with.
|
|
@@ -218,15 +222,31 @@ client.del('/files/123');
|
|
|
218
222
|
.catch(error => { /* handle any errors */ });
|
|
219
223
|
```
|
|
220
224
|
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
## Versions
|
|
226
|
+
We use a modified version of [Semantic Versioning](https://semver.org/) for all changes. See [version strategy](VERSIONS.md) for details which is effective from 30 July 2022.
|
|
227
|
+
|
|
228
|
+
### Supported Version
|
|
229
|
+
|
|
230
|
+
Only the current MAJOR version of SDK is supported. New features, functionality, bug fixes, and security updates will only be added to the current MAJOR version.
|
|
231
|
+
|
|
232
|
+
A current release is on the leading edge of our SDK development, and is intended for customers who are in active development and want the latest and greatest features. Instead of stating a release date for a new feature, we set a fixed minor or patch release cadence of maximum 2-3 months (while we may release more often). At the same time, there is no schedule for major or breaking release. Instead, we will communicate one quarter in advance the upcoming breaking change to allow customers to plan for the upgrade. We always recommend that all users run the latest available minor release for whatever major version is in use. We highly recommend upgrading to the latest SDK major release at the earliest convenient time and before the EOL date.
|
|
233
|
+
|
|
234
|
+
### Version schedule
|
|
235
|
+
|
|
236
|
+
| Version | Supported Environments | State | First Release | EOL/Terminated |
|
|
237
|
+
|---------|------------------------|-----------|---------------|----------------|
|
|
238
|
+
| 2 | | Supported | 29 Sep 2021 | TBD |
|
|
239
|
+
| 1 | | EOL | 28 Mar 2019 | 29 Sep 2021 |
|
|
240
|
+
|
|
241
|
+
## Questions, Bugs, and Feature Requests?
|
|
242
|
+
|
|
223
243
|
|
|
224
244
|
[Browse the issues tickets](https://github.com/box/box-node-sdk/issues)! Or, if that doesn't work, [file a new one](https://github.com/box/box-node-sdk/issues/new) and someone will get back to you. If you have general questions about the
|
|
225
245
|
Box API, you can post to the [Box Developer Forum](https://community.box.com/t5/Developer-Forum/bd-p/DeveloperForum).
|
|
226
246
|
|
|
227
247
|
|
|
228
|
-
Contributing to the Box Node.js SDK
|
|
229
|
-
|
|
248
|
+
## Contributing to the Box Node.js SDK
|
|
249
|
+
|
|
230
250
|
|
|
231
251
|
1. Clone this repo.
|
|
232
252
|
1. Run `npm install`.
|
|
@@ -237,8 +257,12 @@ in the `tests/` directory!
|
|
|
237
257
|
|
|
238
258
|
For more information, please see [the Contribution guidelines](./CONTRIBUTING.md).
|
|
239
259
|
|
|
240
|
-
|
|
241
|
-
|
|
260
|
+
## Changelog
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
See [CHANGELOG.md](./CHANGELOG.md).
|
|
264
|
+
|
|
265
|
+
## Copyright and License
|
|
242
266
|
|
|
243
267
|
Copyright 2018 Box, Inc. All rights reserved.
|
|
244
268
|
|
package/lib/box-node-sdk.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
/// <reference types="bluebird" />
|
|
6
6
|
import { EventEmitter } from 'events';
|
|
7
|
-
import
|
|
7
|
+
import CCGAPISession = require('./sessions/ccg-session');
|
|
8
8
|
import APIRequestManager = require('./api-request-manager');
|
|
9
9
|
import BoxClient = require('./box-client');
|
|
10
10
|
import TokenManager = require('./token-manager');
|
|
@@ -36,6 +36,10 @@ import TokenManager = require('./token-manager');
|
|
|
36
36
|
declare type TokenStore = object;
|
|
37
37
|
declare type UserConfigurationOptions = object;
|
|
38
38
|
declare type TokenRequestOptions = object;
|
|
39
|
+
declare type CCGConfig = {
|
|
40
|
+
boxSubjectType: "user" | "enterprise";
|
|
41
|
+
boxSubjectId: string;
|
|
42
|
+
};
|
|
39
43
|
/**
|
|
40
44
|
* A backend NodeJS SDK to interact with the Box V2 API.
|
|
41
45
|
* This is the single entry point for all SDK consumer interactions. This is the only file that a 3rd party app
|
|
@@ -57,7 +61,7 @@ declare class BoxSDKNode extends EventEmitter {
|
|
|
57
61
|
_eventBus: EventEmitter;
|
|
58
62
|
requestManager: APIRequestManager;
|
|
59
63
|
tokenManager: TokenManager;
|
|
60
|
-
|
|
64
|
+
ccgSession: CCGAPISession;
|
|
61
65
|
/**
|
|
62
66
|
* Expose the BoxClient property enumerations to the SDK as a whole. This allows
|
|
63
67
|
* the consumer to access and use these values from anywhere in their application
|
|
@@ -128,19 +132,28 @@ declare class BoxSDKNode extends EventEmitter {
|
|
|
128
132
|
*/
|
|
129
133
|
getPersistentClient(tokenInfo: any, tokenStore?: TokenStore): BoxClient;
|
|
130
134
|
/**
|
|
131
|
-
* Returns
|
|
132
|
-
*
|
|
133
|
-
*
|
|
135
|
+
* Returns a Box Client configured to use Client Credentials Grant for a service account. Requires enterprise ID
|
|
136
|
+
* to be set when configuring SDK instance.
|
|
137
|
+
*
|
|
138
|
+
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession. All Anonymous API Sessions share the
|
|
134
139
|
* same tokens, which allows them to refresh them efficiently and reduce load on both the application and
|
|
135
140
|
* the API.
|
|
136
|
-
*
|
|
137
|
-
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession
|
|
138
141
|
*/
|
|
139
142
|
getAnonymousClient(): BoxClient;
|
|
140
143
|
/**
|
|
141
|
-
*
|
|
144
|
+
* Returns a Box Client configured to use Client Credentials Grant for a specified user.
|
|
145
|
+
*
|
|
146
|
+
* @param userId the user ID to use when getting the access token
|
|
147
|
+
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession. All Anonymous API Sessions share the
|
|
148
|
+
* same tokens, which allows them to refresh them efficiently and reduce load on both the application and
|
|
149
|
+
* the API.
|
|
150
|
+
*/
|
|
151
|
+
getCCGClientForUser(userId: string): BoxClient;
|
|
152
|
+
_getCCGClient(config: CCGConfig): BoxClient;
|
|
153
|
+
/**
|
|
154
|
+
* Create a new client using App Auth for the given entity. This allows either
|
|
142
155
|
* managing App Users (as the enterprise) or performing operations as the App
|
|
143
|
-
* Users themselves (as a user).
|
|
156
|
+
* Users or Managed Users themselves (as a user).
|
|
144
157
|
*
|
|
145
158
|
* @param {string} type The type of entity to operate as, "enterprise" or "user"
|
|
146
159
|
* @param {string} [id] (Optional) The Box ID of the entity to operate as
|
|
@@ -199,7 +212,7 @@ declare class BoxSDKNode extends EventEmitter {
|
|
|
199
212
|
* @param {string} userID The ID of the App User to generate a token for
|
|
200
213
|
* @param {TokenRequestOptions} [options] - Sets optional behavior for the token grant, null for default behavior
|
|
201
214
|
* @param {Function} [callback] Passed the tokens if successful
|
|
202
|
-
* @returns {Promise<TokentInfo>} Promise
|
|
215
|
+
* @returns {Promise<TokentInfo>} Promise resolving to the token info
|
|
203
216
|
*/
|
|
204
217
|
getAppUserTokens(userID: string, options: TokenRequestOptions | Function | null, callback: Function): import("bluebird")<any>;
|
|
205
218
|
/**
|
package/lib/box-node-sdk.js
CHANGED
|
@@ -17,6 +17,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
+
var __assign = (this && this.__assign) || function () {
|
|
21
|
+
__assign = Object.assign || function(t) {
|
|
22
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23
|
+
s = arguments[i];
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
return __assign.apply(this, arguments);
|
|
30
|
+
};
|
|
20
31
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
32
|
if (k2 === undefined) k2 = k;
|
|
22
33
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -41,7 +52,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
41
52
|
// ------------------------------------------------------------------------------
|
|
42
53
|
var events_1 = require("events");
|
|
43
54
|
var qs = __importStar(require("querystring"));
|
|
44
|
-
var
|
|
55
|
+
var CCGAPISession = require("./sessions/ccg-session");
|
|
45
56
|
var APIRequestManager = require("./api-request-manager");
|
|
46
57
|
var BoxClient = require("./box-client");
|
|
47
58
|
var TokenManager = require("./token-manager");
|
|
@@ -94,7 +105,7 @@ var BoxSDKNode = /** @class */ (function (_super) {
|
|
|
94
105
|
this.requestManager = new APIRequestManager(this.config, this._eventBus);
|
|
95
106
|
// Initialize the rest of the SDK with the given configuration
|
|
96
107
|
this.tokenManager = new TokenManager(this.config, this.requestManager);
|
|
97
|
-
this.
|
|
108
|
+
this.ccgSession = new CCGAPISession(this.config, this.tokenManager);
|
|
98
109
|
};
|
|
99
110
|
/**
|
|
100
111
|
* Gets the BoxSDKNode instance by passing boxAppSettings json downloaded from the developer console.
|
|
@@ -190,21 +201,39 @@ var BoxSDKNode = /** @class */ (function (_super) {
|
|
|
190
201
|
return new BoxClient(apiSession, this.config, this.requestManager);
|
|
191
202
|
};
|
|
192
203
|
/**
|
|
193
|
-
* Returns
|
|
194
|
-
*
|
|
195
|
-
*
|
|
204
|
+
* Returns a Box Client configured to use Client Credentials Grant for a service account. Requires enterprise ID
|
|
205
|
+
* to be set when configuring SDK instance.
|
|
206
|
+
*
|
|
207
|
+
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession. All Anonymous API Sessions share the
|
|
196
208
|
* same tokens, which allows them to refresh them efficiently and reduce load on both the application and
|
|
197
209
|
* the API.
|
|
198
|
-
*
|
|
199
|
-
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession
|
|
200
210
|
*/
|
|
201
211
|
BoxSDKNode.prototype.getAnonymousClient = function () {
|
|
202
|
-
|
|
212
|
+
if (!this.config.enterpriseID) {
|
|
213
|
+
throw new Error('Enterprise ID must be passed');
|
|
214
|
+
}
|
|
215
|
+
return this._getCCGClient({ boxSubjectType: "enterprise", boxSubjectId: this.config.enterpriseID });
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Returns a Box Client configured to use Client Credentials Grant for a specified user.
|
|
219
|
+
*
|
|
220
|
+
* @param userId the user ID to use when getting the access token
|
|
221
|
+
* @returns {BoxClient} Returns a new Box Client paired to a AnonymousAPISession. All Anonymous API Sessions share the
|
|
222
|
+
* same tokens, which allows them to refresh them efficiently and reduce load on both the application and
|
|
223
|
+
* the API.
|
|
224
|
+
*/
|
|
225
|
+
BoxSDKNode.prototype.getCCGClientForUser = function (userId) {
|
|
226
|
+
return this._getCCGClient({ boxSubjectType: "user", boxSubjectId: userId });
|
|
227
|
+
};
|
|
228
|
+
BoxSDKNode.prototype._getCCGClient = function (config) {
|
|
229
|
+
var anonymousTokenManager = new TokenManager(__assign(__assign({}, this.config), config), this.requestManager);
|
|
230
|
+
var newAnonymousSession = new CCGAPISession(this.config, anonymousTokenManager);
|
|
231
|
+
return new BoxClient(newAnonymousSession, this.config, this.requestManager);
|
|
203
232
|
};
|
|
204
233
|
/**
|
|
205
|
-
* Create a new client using App Auth for the given entity.
|
|
234
|
+
* Create a new client using App Auth for the given entity. This allows either
|
|
206
235
|
* managing App Users (as the enterprise) or performing operations as the App
|
|
207
|
-
* Users themselves (as a user).
|
|
236
|
+
* Users or Managed Users themselves (as a user).
|
|
208
237
|
*
|
|
209
238
|
* @param {string} type The type of entity to operate as, "enterprise" or "user"
|
|
210
239
|
* @param {string} [id] (Optional) The Box ID of the entity to operate as
|
|
@@ -293,7 +322,7 @@ var BoxSDKNode = /** @class */ (function (_super) {
|
|
|
293
322
|
* @param {string} userID The ID of the App User to generate a token for
|
|
294
323
|
* @param {TokenRequestOptions} [options] - Sets optional behavior for the token grant, null for default behavior
|
|
295
324
|
* @param {Function} [callback] Passed the tokens if successful
|
|
296
|
-
* @returns {Promise<TokentInfo>} Promise
|
|
325
|
+
* @returns {Promise<TokentInfo>} Promise resolving to the token info
|
|
297
326
|
*/
|
|
298
327
|
BoxSDKNode.prototype.getAppUserTokens = function (userID, options, callback) {
|
|
299
328
|
if (typeof options === 'function') {
|
package/lib/box-node-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-node-sdk.js","sourceRoot":"","sources":["../src/box-node-sdk.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"box-node-sdk.js","sourceRoot":"","sources":["../src/box-node-sdk.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iFAAiF;AACjF,eAAe;AACf,iFAAiF;AAEjF,iCAAsC;AACtC,8CAAkC;AAClC,sDAAyD;AACzD,yDAA4D;AAC5D,wCAA2C;AAC3C,8CAAiD;AAEjD,IAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,EACtC,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,EACrD,oBAAoB,GAAG,OAAO,CAAC,+BAA+B,CAAC,EAC/D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,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,IAAI,CAAC;SACf;QAED,OAAO,IAAI,CAAC,YAAY;aACtB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAc,CAAC,WAAW,CAAC;aAC7D,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAED;;;;;;;OAOG;IACH,iCAAY,GAAZ,UACC,KAAa,EACb,OAA8C,EAC9C,QAAkB;QAElB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;YAClC,QAAQ,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,IAAI,CAAC;SACf;QAED,OAAO,IAAI,CAAC,YAAY;aACtB,YAAY,CAAC,KAAK,EAAE,OAAc,CAAC,WAAW,CAAC;aAC/C,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAhYD;;;;OAIG;IACI,uBAAY,GAAG,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC;IACjD,6BAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC;IAC7D,0BAAe,GAAG,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC;IAE9D;;;;OAIG;IACI,iCAAsB,GAAG,QAAQ,CAAC,eAAe,CAAC;IAmX1D,iBAAC;CAAA,AA5YD,CAAyB,qBAAY,GA4YpC;AAED;;;;GAIG;AACH,UAAU,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC;AACrE,UAAU,CAAC,SAAS,CAAC,kBAAkB;IACtC,SAAS,CAAC,SAAS,CAAC,kBAAkB,CAAC;AACxC,UAAU,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC;AAG3E,iBAAS,UAAU,CAAC"}
|
|
@@ -201,7 +201,9 @@ declare class Metadata {
|
|
|
201
201
|
*/
|
|
202
202
|
forceApplyCascadePolicy(policyID: string, resolutionMethod: string, callback?: Function): any;
|
|
203
203
|
/**
|
|
204
|
-
* Query Box items by their metadata
|
|
204
|
+
* Query Box items by their metadata.
|
|
205
|
+
* We no longer require the index_name/use_index for queries that leverage indexes,
|
|
206
|
+
* internal analysis engine determines which existing index will satisfy the query.
|
|
205
207
|
*
|
|
206
208
|
* API Endpoint: '/metadata_queries/execute_read'
|
|
207
209
|
* Method: POST
|
|
@@ -211,7 +213,7 @@ declare class Metadata {
|
|
|
211
213
|
* @param {Object} [options] - Optional parameters
|
|
212
214
|
* @param {string} [options.query] - The logical expression of the query
|
|
213
215
|
* @param {Object} [options.query_parameters] - Required if query present. The arguments for the query
|
|
214
|
-
* @param {string} [options.index_name] - The name of the
|
|
216
|
+
* @param {string} [options.index_name] - DEPRECATED: This parameter is ignored. The name of the index to use
|
|
215
217
|
* @param {Object} [options.order_by] - The field_key(s) to order on and the corresponding direction(s)
|
|
216
218
|
* @param {Array} [options.fields] - An array of fields to return
|
|
217
219
|
* @param {Function} [callback] - Passed a collection of items and their associated metadata
|
package/lib/managers/metadata.js
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview Manager for the Box Metadata Resource
|
|
4
4
|
*/
|
|
5
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
6
|
+
var t = {};
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
10
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
12
|
+
t[p[i]] = s[p[i]];
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
5
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
18
|
};
|
|
@@ -239,7 +250,9 @@ var Metadata = /** @class */ (function () {
|
|
|
239
250
|
return this.client.wrapWithDefaultHandler(this.client.post)(apiPath, params, callback);
|
|
240
251
|
};
|
|
241
252
|
/**
|
|
242
|
-
* Query Box items by their metadata
|
|
253
|
+
* Query Box items by their metadata.
|
|
254
|
+
* We no longer require the index_name/use_index for queries that leverage indexes,
|
|
255
|
+
* internal analysis engine determines which existing index will satisfy the query.
|
|
243
256
|
*
|
|
244
257
|
* API Endpoint: '/metadata_queries/execute_read'
|
|
245
258
|
* Method: POST
|
|
@@ -249,7 +262,7 @@ var Metadata = /** @class */ (function () {
|
|
|
249
262
|
* @param {Object} [options] - Optional parameters
|
|
250
263
|
* @param {string} [options.query] - The logical expression of the query
|
|
251
264
|
* @param {Object} [options.query_parameters] - Required if query present. The arguments for the query
|
|
252
|
-
* @param {string} [options.index_name] - The name of the
|
|
265
|
+
* @param {string} [options.index_name] - DEPRECATED: This parameter is ignored. The name of the index to use
|
|
253
266
|
* @param {Object} [options.order_by] - The field_key(s) to order on and the corresponding direction(s)
|
|
254
267
|
* @param {Array} [options.fields] - An array of fields to return
|
|
255
268
|
* @param {Function} [callback] - Passed a collection of items and their associated metadata
|
|
@@ -260,8 +273,9 @@ var Metadata = /** @class */ (function () {
|
|
|
260
273
|
from: from,
|
|
261
274
|
ancestor_folder_id: ancestorFolderId,
|
|
262
275
|
};
|
|
276
|
+
var _a = options !== null && options !== void 0 ? options : {}, indexName = _a.index_name, newOptions = __rest(_a, ["index_name"]);
|
|
263
277
|
var params = {
|
|
264
|
-
body: merge(body,
|
|
278
|
+
body: merge(body, newOptions),
|
|
265
279
|
};
|
|
266
280
|
return this.client.wrapWithDefaultHandler(this.client.post)(QUERY_PATH, params, callback);
|
|
267
281
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/managers/metadata.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"metadata.js","source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AAA,EAAK,UAAU,cAAtC,cAAwC,CAAgB,CAAC;QAE/D,IAAI,MAAM,GAAG;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC;SAC7B,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1D,UAAU,EACV,MAAM,EACN,QAAQ,CACR,CAAC;IACH,CAAC;IACF,eAAC;AAAD,CAAC,AAlWD,IAkWC;AAED,QAAQ,CAAC,SAAS,CAAC,SAAS,GAAG;IAC9B,UAAU,EAAE,mBAAmB;CAC/B,CAAC;AAEF,QAAQ,CAAC,SAAS,CAAC,MAAM,GAAG;IAC3B,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,YAAY;CACpB,CAAC;AAEF,QAAQ,CAAC,SAAS,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IACpD,iBAAiB,EAAE,MAAM;IACzB,SAAS,EAAE,WAAW;CACtB,CAAC,CAAC;AAEH;;;;GAIG;AACH,QAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,iBAAiB,CAAC;AAElD,iBAAS,QAAQ,CAAC"}
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export * from './file-version-base.generated';
|
|
|
4
4
|
export * from './file-version-mini.generated';
|
|
5
5
|
export * from './folder-base.generated';
|
|
6
6
|
export * from './folder-mini.generated';
|
|
7
|
-
export * from './sign-request.generated';
|
|
8
7
|
export * from './sign-request-create-request.generated';
|
|
9
8
|
export * from './sign-request-create-signer.generated';
|
|
10
9
|
export * from './sign-request-prefill-tag.generated';
|
|
11
|
-
export * from './sign-requests.generated';
|
|
12
|
-
export * from './sign-request-signer.generated';
|
|
13
10
|
export * from './sign-request-signer-input.generated';
|
|
11
|
+
export * from './sign-request-signer.generated';
|
|
12
|
+
export * from './sign-request.generated';
|
|
13
|
+
export * from './sign-requests.generated';
|
package/lib/schemas/index.js
CHANGED
|
@@ -16,11 +16,11 @@ __exportStar(require("./file-version-base.generated"), exports);
|
|
|
16
16
|
__exportStar(require("./file-version-mini.generated"), exports);
|
|
17
17
|
__exportStar(require("./folder-base.generated"), exports);
|
|
18
18
|
__exportStar(require("./folder-mini.generated"), exports);
|
|
19
|
-
__exportStar(require("./sign-request.generated"), exports);
|
|
20
19
|
__exportStar(require("./sign-request-create-request.generated"), exports);
|
|
21
20
|
__exportStar(require("./sign-request-create-signer.generated"), exports);
|
|
22
21
|
__exportStar(require("./sign-request-prefill-tag.generated"), exports);
|
|
23
|
-
__exportStar(require("./sign-requests.generated"), exports);
|
|
24
|
-
__exportStar(require("./sign-request-signer.generated"), exports);
|
|
25
22
|
__exportStar(require("./sign-request-signer-input.generated"), exports);
|
|
23
|
+
__exportStar(require("./sign-request-signer.generated"), exports);
|
|
24
|
+
__exportStar(require("./sign-request.generated"), exports);
|
|
25
|
+
__exportStar(require("./sign-requests.generated"), exports);
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/lib/schemas/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,0DAAwC;AACxC,0DAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,0DAAwC;AACxC,0DAAwC;AACxC,0EAAwD;AACxD,yEAAuD;AACvD,uEAAqD;AACrD,wEAAsD;AACtD,kEAAgD;AAChD,2DAAyC;AACzC,4DAA0C"}
|
|
@@ -6,12 +6,12 @@ declare type TokenManager = any;
|
|
|
6
6
|
declare type TokenInfo = any;
|
|
7
7
|
declare type TokenRequestOptions = any;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The Client Credentials Grant Box API Session.
|
|
10
10
|
*
|
|
11
|
-
* The
|
|
12
|
-
* returns to the client so that it may make calls on behalf of
|
|
11
|
+
* The Client Credentials Grant API Session holds a Client Credentials accessToken, which it
|
|
12
|
+
* returns to the client so that it may make calls on behalf of service account or specified users.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* Tokens will be refreshed in the background if a request is made within the
|
|
15
15
|
* "stale buffer" (defaults to 10 minutes before the token is set to expire).
|
|
16
16
|
* If the token is also expired, all incoming requests will be held until a fresh token
|
|
17
17
|
* is retrieved.
|
|
@@ -20,21 +20,21 @@ declare type TokenRequestOptions = any;
|
|
|
20
20
|
* @param {TokenManager} tokenManager The TokenManager
|
|
21
21
|
* @constructor
|
|
22
22
|
*/
|
|
23
|
-
declare class
|
|
23
|
+
declare class CCGSession {
|
|
24
24
|
_config: Config;
|
|
25
25
|
_tokenManager: TokenManager;
|
|
26
26
|
_tokenInfo: TokenInfo;
|
|
27
27
|
_refreshPromise: Promise<any> | null;
|
|
28
28
|
constructor(config: Config, tokenManager: TokenManager);
|
|
29
29
|
/**
|
|
30
|
-
* Initiate a refresh of the
|
|
30
|
+
* Initiate a refresh of the access tokens. New tokens should be passed to the
|
|
31
31
|
* caller, and then cached for later use.
|
|
32
32
|
*
|
|
33
33
|
* @param {?TokenRequestOptions} [options] - Sets optional behavior for the token grant
|
|
34
34
|
* @returns {Promise<string>} Promise resolving to the access token
|
|
35
35
|
* @private
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
_refreshAccessToken(options?: TokenRequestOptions): Promise<any>;
|
|
38
38
|
/**
|
|
39
39
|
* Produces a valid, anonymous access token.
|
|
40
40
|
* Performs a refresh before returning if the current token is expired. If the current
|
|
@@ -53,17 +53,20 @@ declare class AnonymousSession {
|
|
|
53
53
|
*/
|
|
54
54
|
revokeTokens(options?: TokenRequestOptions): any;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
56
|
+
* Exchange the client access token for one with lower scope
|
|
57
|
+
*
|
|
58
58
|
* @param {string|string[]} scopes The scope(s) requested for the new token
|
|
59
59
|
* @param {string} [resource] The absolute URL of an API resource to scope the new token to
|
|
60
|
-
* @param {
|
|
61
|
-
* @
|
|
60
|
+
* @param {Object} [options] - Optional parameters
|
|
61
|
+
* @param {TokenRequestOptions} [options.tokenRequestOptions] - Sets optional behavior for the token grant
|
|
62
|
+
* @returns {void}
|
|
62
63
|
*/
|
|
63
|
-
exchangeToken(scopes: string | string[], resource?: string, options?:
|
|
64
|
+
exchangeToken(scopes: string | string[], resource?: string, options?: {
|
|
65
|
+
tokenRequestOptions?: TokenRequestOptions;
|
|
66
|
+
}): Promise<any>;
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
|
-
* @module box-node-sdk/lib/sessions/
|
|
67
|
-
* @see {@Link
|
|
69
|
+
* @module box-node-sdk/lib/sessions/ccg-session
|
|
70
|
+
* @see {@Link CCGSession}
|
|
68
71
|
*/
|
|
69
|
-
export =
|
|
72
|
+
export = CCGSession;
|