box-node-sdk 1.35.0 → 1.37.2
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 +37 -2
- package/README.md +1 -1
- package/lib/api-request-manager.d.ts +38 -0
- package/lib/api-request-manager.js +48 -55
- package/lib/api-request-manager.js.map +1 -0
- package/lib/api-request.d.ts +141 -0
- package/lib/api-request.js +202 -281
- package/lib/api-request.js.map +1 -0
- package/lib/box-client.d.ts +269 -0
- package/lib/box-client.js +551 -713
- package/lib/box-client.js.map +1 -0
- package/lib/box-node-sdk.d.ts +216 -0
- package/lib/box-node-sdk.js +317 -352
- package/lib/box-node-sdk.js.map +1 -0
- package/lib/chunked-uploader.d.ts +129 -0
- package/lib/chunked-uploader.js +287 -358
- package/lib/chunked-uploader.js.map +1 -0
- package/lib/enterprise-event-stream.d.ts +82 -0
- package/lib/enterprise-event-stream.js +189 -203
- package/lib/enterprise-event-stream.js.map +1 -0
- package/lib/event-stream.d.ts +92 -0
- package/lib/event-stream.js +274 -302
- package/lib/event-stream.js.map +1 -0
- package/lib/managers/collaboration-allowlist.d.ts +137 -0
- package/lib/managers/collaboration-allowlist.js +200 -0
- package/lib/managers/collaboration-allowlist.js.map +1 -0
- package/lib/managers/collaboration-whitelist.d.ts +3 -0
- package/lib/managers/collaboration-whitelist.js +8 -222
- package/lib/managers/collaboration-whitelist.js.map +1 -0
- package/lib/managers/collaborations.d.ts +166 -0
- package/lib/managers/collaborations.js +225 -258
- package/lib/managers/collaborations.js.map +1 -0
- package/lib/managers/collections.d.ts +42 -0
- package/lib/managers/collections.js +45 -50
- package/lib/managers/collections.js.map +1 -0
- package/lib/managers/comments.d.ts +103 -0
- package/lib/managers/comments.js +158 -173
- package/lib/managers/comments.js.map +1 -0
- package/lib/managers/device-pins.d.ts +52 -0
- package/lib/managers/device-pins.js +75 -88
- package/lib/managers/device-pins.js.map +1 -0
- package/lib/managers/enterprise.d.ts +162 -0
- package/lib/managers/enterprise.js +168 -199
- package/lib/managers/enterprise.js.map +1 -0
- package/lib/managers/events.d.ts +177 -0
- package/lib/managers/events.js +230 -254
- package/lib/managers/events.js.map +1 -0
- package/lib/managers/files.d.ts +772 -0
- package/lib/managers/files.js +1400 -1602
- package/lib/managers/files.js.map +1 -0
- package/lib/managers/folders.d.ts +347 -0
- package/lib/managers/folders.js +551 -567
- package/lib/managers/folders.js.map +1 -0
- package/lib/managers/groups.d.ts +202 -0
- package/lib/managers/groups.js +238 -287
- package/lib/managers/groups.js.map +1 -0
- package/lib/managers/legal-hold-policies.d.ts +190 -0
- package/lib/managers/legal-hold-policies.js +228 -272
- package/lib/managers/legal-hold-policies.js.map +1 -0
- package/lib/managers/metadata.d.ts +228 -0
- package/lib/managers/metadata.js +265 -328
- package/lib/managers/metadata.js.map +1 -0
- package/lib/managers/recent-items.d.ts +38 -0
- package/lib/managers/recent-items.js +32 -39
- package/lib/managers/recent-items.js.map +1 -0
- package/lib/managers/retention-policies.d.ts +213 -0
- package/lib/managers/retention-policies.js +235 -281
- package/lib/managers/retention-policies.js.map +1 -0
- package/lib/managers/search.d.ts +82 -0
- package/lib/managers/search.js +68 -88
- package/lib/managers/search.js.map +1 -0
- package/lib/managers/shared-items.d.ts +33 -0
- package/lib/managers/shared-items.js +54 -62
- package/lib/managers/shared-items.js.map +1 -0
- package/lib/managers/storage-policies.d.ts +86 -0
- package/lib/managers/storage-policies.js +108 -142
- package/lib/managers/storage-policies.js.map +1 -0
- package/lib/managers/tasks.d.ts +161 -0
- package/lib/managers/tasks.js +219 -260
- package/lib/managers/tasks.js.map +1 -0
- package/lib/managers/terms-of-service.d.ts +161 -0
- package/lib/managers/terms-of-service.js +250 -273
- package/lib/managers/terms-of-service.js.map +1 -0
- package/lib/managers/trash.d.ts +30 -0
- package/lib/managers/trash.js +30 -41
- package/lib/managers/trash.js.map +1 -0
- package/lib/managers/users.d.ts +131 -0
- package/lib/managers/users.js +160 -203
- package/lib/managers/users.js.map +1 -0
- package/lib/managers/web-links.d.ts +127 -0
- package/lib/managers/web-links.js +183 -209
- package/lib/managers/web-links.js.map +1 -0
- package/lib/managers/webhooks.d.ts +166 -0
- package/lib/managers/webhooks.js +312 -305
- package/lib/managers/webhooks.js.map +1 -0
- package/lib/sessions/anonymous-session.d.ts +69 -0
- package/lib/sessions/anonymous-session.js +88 -102
- package/lib/sessions/anonymous-session.js.map +1 -0
- package/lib/sessions/app-auth-session.d.ts +92 -0
- package/lib/sessions/app-auth-session.js +140 -160
- package/lib/sessions/app-auth-session.js.map +1 -0
- package/lib/sessions/basic-session.d.ts +56 -0
- package/lib/sessions/basic-session.js +40 -50
- package/lib/sessions/basic-session.js.map +1 -0
- package/lib/sessions/persistent-session.d.ts +96 -0
- package/lib/sessions/persistent-session.js +191 -211
- package/lib/sessions/persistent-session.js.map +1 -0
- package/lib/token-manager.d.ts +191 -0
- package/lib/token-manager.js +390 -465
- package/lib/token-manager.js.map +1 -0
- package/lib/util/config.d.ts +86 -0
- package/lib/util/config.js +124 -152
- package/lib/util/config.js.map +1 -0
- package/lib/util/errors.d.ts +50 -0
- package/lib/util/errors.js +134 -145
- package/lib/util/errors.js.map +1 -0
- package/lib/util/exponential-backoff.d.ts +11 -0
- package/lib/util/exponential-backoff.js +10 -22
- package/lib/util/exponential-backoff.js.map +1 -0
- package/lib/util/paging-iterator.d.ts +53 -0
- package/lib/util/paging-iterator.js +202 -218
- package/lib/util/paging-iterator.js.map +1 -0
- package/lib/util/url-path.d.ts +16 -0
- package/lib/util/url-path.js +20 -35
- package/lib/util/url-path.js.map +1 -0
- package/package.json +24 -9
|
@@ -1,26 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* @fileoverview Manager for the Device Pins resource
|
|
3
4
|
* @author mwiller
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
var url_path_1 = __importDefault(require("../util/url-path"));
|
|
10
|
+
// -----------------------------------------------------------------------------
|
|
11
|
+
// Typedefs
|
|
12
|
+
// -----------------------------------------------------------------------------
|
|
13
13
|
// ------------------------------------------------------------------------------
|
|
14
14
|
// Private
|
|
15
15
|
// ------------------------------------------------------------------------------
|
|
16
|
-
var BASE_PATH = '/device_pinners',
|
|
17
|
-
ENTERPRISES_PATH = '/enterprises',
|
|
18
|
-
DEVICE_PINNERS_SUBRESOURCE = 'device_pinners';
|
|
19
|
-
|
|
16
|
+
var BASE_PATH = '/device_pinners', ENTERPRISES_PATH = '/enterprises', DEVICE_PINNERS_SUBRESOURCE = 'device_pinners';
|
|
20
17
|
// ------------------------------------------------------------------------------
|
|
21
18
|
// Public
|
|
22
19
|
// ------------------------------------------------------------------------------
|
|
23
|
-
|
|
24
20
|
/**
|
|
25
21
|
* Simple manager for interacting with all Device Pin endpoints and actions.
|
|
26
22
|
*
|
|
@@ -28,79 +24,70 @@ var BASE_PATH = '/device_pinners',
|
|
|
28
24
|
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
29
25
|
* @returns {void}
|
|
30
26
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
DevicePins.prototype.get = function(pinID, options, callback) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var apiPath = urlPath(ENTERPRISES_PATH, data.enterprise.id, DEVICE_PINNERS_SUBRESOURCE),
|
|
97
|
-
params = {
|
|
98
|
-
qs: options
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params);
|
|
102
|
-
})
|
|
103
|
-
.asCallback(callback);
|
|
104
|
-
};
|
|
105
|
-
|
|
27
|
+
var DevicePins = /** @class */ (function () {
|
|
28
|
+
function DevicePins(client) {
|
|
29
|
+
this.client = client;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get a specific device pinning record
|
|
33
|
+
*
|
|
34
|
+
* API Endpoint: '/device_pinners/:pinID'
|
|
35
|
+
* Method: GET
|
|
36
|
+
*
|
|
37
|
+
* @param {string} pinID - The ID of the pin to retrieve
|
|
38
|
+
* @param {Object} [options] - Optional paramters, can be left null in many cases
|
|
39
|
+
* @param {Function} [callback] - Passed the device pin if successful, error otherwise
|
|
40
|
+
* @returns {Promise<Object>} A promise resolving to the device pin object
|
|
41
|
+
*/
|
|
42
|
+
DevicePins.prototype.get = function (pinID, options, callback) {
|
|
43
|
+
var apiPath = url_path_1.default(BASE_PATH, pinID), params = {
|
|
44
|
+
qs: options,
|
|
45
|
+
};
|
|
46
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Delete a specific device pinning record
|
|
50
|
+
*
|
|
51
|
+
* API Endpoint: '/device_pinners/:pinID'
|
|
52
|
+
* Method: DELETE
|
|
53
|
+
*
|
|
54
|
+
* @param {string} pinID - The ID of the pin to delete
|
|
55
|
+
* @param {Object} [options] - Optional paramters, can be left null in many cases
|
|
56
|
+
* @param {Function} [callback] - Passed nothing if successful, error otherwise
|
|
57
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
58
|
+
*/
|
|
59
|
+
DevicePins.prototype.delete = function (pinID, options, callback) {
|
|
60
|
+
var apiPath = url_path_1.default(BASE_PATH, pinID), params = {
|
|
61
|
+
qs: options,
|
|
62
|
+
};
|
|
63
|
+
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, params, callback);
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Get all device pin records for the current enterprise
|
|
67
|
+
*
|
|
68
|
+
* API Endpoint: '/enterprises/:enterpriseID/device_pinners'
|
|
69
|
+
* Method: GET
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} [options] - Optional paramters, can be left null in many cases
|
|
72
|
+
* @param {Function} [callback] - Passed a list of device pins if successful, error otherwise
|
|
73
|
+
* @returns {Promise<Object>} A promise resolving to the collection of device pins
|
|
74
|
+
*/
|
|
75
|
+
DevicePins.prototype.getAll = function (options, callback) {
|
|
76
|
+
var _this = this;
|
|
77
|
+
return this.client.users
|
|
78
|
+
.get(this.client.CURRENT_USER_ID, { fields: 'enterprise' })
|
|
79
|
+
.then(function (data /* FIXME */) {
|
|
80
|
+
if (!data.enterprise || !data.enterprise.id) {
|
|
81
|
+
throw new Error('User must be in an enterprise to view device pins');
|
|
82
|
+
}
|
|
83
|
+
var apiPath = url_path_1.default(ENTERPRISES_PATH, data.enterprise.id, DEVICE_PINNERS_SUBRESOURCE), params = {
|
|
84
|
+
qs: options,
|
|
85
|
+
};
|
|
86
|
+
return _this.client.wrapWithDefaultHandler(_this.client.get)(apiPath, params);
|
|
87
|
+
})
|
|
88
|
+
.asCallback(callback);
|
|
89
|
+
};
|
|
90
|
+
return DevicePins;
|
|
91
|
+
}());
|
|
106
92
|
module.exports = DevicePins;
|
|
93
|
+
//# sourceMappingURL=device-pins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-pins.js","sourceRoot":"","sources":["../../src/managers/device-pins.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAOH,8DAAuC;AAEvC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AAEjF,IAAM,SAAS,GAAG,iBAAiB,EAClC,gBAAgB,GAAG,cAAc,EACjC,0BAA0B,GAAG,gBAAgB,CAAC;AAE/C,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH;IAGC,oBAAY,MAAiB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;;;;;;;;;OAUG;IACH,wBAAG,GAAH,UAAI,KAAa,EAAE,OAA6B,EAAE,QAAmB;QACpE,IAAI,OAAO,GAAG,kBAAO,CAAC,SAAS,EAAE,KAAK,CAAC,EACtC,MAAM,GAAG;YACR,EAAE,EAAE,OAAO;SACX,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACzD,OAAO,EACP,MAAM,EACN,QAAQ,CACR,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACH,2BAAM,GAAN,UAAO,KAAa,EAAE,OAA6B,EAAE,QAAmB;QACvE,IAAI,OAAO,GAAG,kBAAO,CAAC,SAAS,EAAE,KAAK,CAAC,EACtC,MAAM,GAAG;YACR,EAAE,EAAE,OAAO;SACX,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACzD,OAAO,EACP,MAAM,EACN,QAAQ,CACR,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,2BAAM,GAAN,UAAO,OAA6B,EAAE,QAAmB;QAAzD,iBAuBC;QAtBA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;aACtB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;aAC1D,IAAI,CAAC,UAAC,IAAS,CAAC,WAAW;YAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE;gBAC5C,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;aACrE;YAED,IAAI,OAAO,GAAG,kBAAO,CACnB,gBAAgB,EAChB,IAAI,CAAC,UAAU,CAAC,EAAE,EAClB,0BAA0B,CAC1B,EACD,MAAM,GAAG;gBACR,EAAE,EAAE,OAAO;aACX,CAAC;YAEH,OAAO,KAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACzD,OAAO,EACP,MAAM,CACN,CAAC;QACH,CAAC,CAAC;aACD,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IACF,iBAAC;AAAD,CAAC,AAzFD,IAyFC;AAED,iBAAS,UAAU,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manager for Enterprise resources
|
|
3
|
+
*/
|
|
4
|
+
import BoxClient from '../box-client';
|
|
5
|
+
/**
|
|
6
|
+
* List of valid user types
|
|
7
|
+
* @readonly
|
|
8
|
+
* @enum {EnterpriseUserType}
|
|
9
|
+
*/
|
|
10
|
+
declare enum EnterpriseUserType {
|
|
11
|
+
ALL = "all",
|
|
12
|
+
MANAGED = "managed",
|
|
13
|
+
EXTERNAL = "external"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* List of valid user statuses
|
|
17
|
+
* @readonly
|
|
18
|
+
* @enum {EnterpriseUserStatus}
|
|
19
|
+
*/
|
|
20
|
+
declare enum EnterpriseUserStatus {
|
|
21
|
+
ACTIVE = "active",
|
|
22
|
+
INACTIVE = "inactive",
|
|
23
|
+
CANNOT_DELETE_OR_EDIT = "cannot_delete_edit",
|
|
24
|
+
CANNOT_DELETE_EDIT_OR_UPLOAD = "cannot_delete_edit_upload"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List of valid roles
|
|
28
|
+
* @readonly
|
|
29
|
+
* @enum {EnterpriseRole}
|
|
30
|
+
*/
|
|
31
|
+
declare enum EnterpriseRole {
|
|
32
|
+
USER = "user",
|
|
33
|
+
COADMIN = "coadmin"
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Simple manager for interacting with all Enterprise endpoints and actions.
|
|
37
|
+
*
|
|
38
|
+
* @constructor
|
|
39
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
declare class Enterprise {
|
|
43
|
+
client: BoxClient;
|
|
44
|
+
userTypes: typeof EnterpriseUserType;
|
|
45
|
+
userStatuses: typeof EnterpriseUserStatus;
|
|
46
|
+
userRoles: typeof EnterpriseRole;
|
|
47
|
+
constructor(client: BoxClient);
|
|
48
|
+
/**
|
|
49
|
+
* Get a list of users in the current enterprise
|
|
50
|
+
*
|
|
51
|
+
* API Endpoint: '/users'
|
|
52
|
+
* Method: GET
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} [options] - Optional parameters, can be left null in most cases
|
|
55
|
+
* @param {string} [options.filter_term] - Filter the results to only users starting with the filter_term in either the name or the login
|
|
56
|
+
* @param {int} [options.limit=100] - The number of records to return
|
|
57
|
+
* @param {boolean} [options.usemarker=false] - Whether or not to use marker-based pagination
|
|
58
|
+
* @param {string} [options.marker=''] - The marker for the page at which to start. Default is the first page
|
|
59
|
+
* @param {int} [options.offset=0] - The record at which to start
|
|
60
|
+
* @param {EnterpriseUserType} [options.user_type=managed] - The type of user to search for
|
|
61
|
+
* @param {Function} [callback] - Passed the list of users if successful, error otherwise
|
|
62
|
+
* @returns {Promise<Object>} A promise resolving to the collection of users
|
|
63
|
+
*/
|
|
64
|
+
getUsers(options?: {
|
|
65
|
+
filter_term?: string;
|
|
66
|
+
limit?: number;
|
|
67
|
+
usemarker?: boolean;
|
|
68
|
+
marker?: string;
|
|
69
|
+
offset?: number;
|
|
70
|
+
user_type?: EnterpriseUserType;
|
|
71
|
+
}, callback?: Function): any;
|
|
72
|
+
/**
|
|
73
|
+
* Invites a user to join the enterprise
|
|
74
|
+
*
|
|
75
|
+
* API Endpoint: '/invites'
|
|
76
|
+
* Method: POST
|
|
77
|
+
*
|
|
78
|
+
* @param {string} enterpriseID - The ID of the enterprise to invite the user to
|
|
79
|
+
* @param {string} email - The email address of the user to invite
|
|
80
|
+
* @param {Function} [callback] - Passed the invite object if successful, error otherwise
|
|
81
|
+
* @returns {Promise<Object>} A promise resolving to the invite object
|
|
82
|
+
*/
|
|
83
|
+
inviteUser(enterpriseID: string, email: string, callback?: Function): any;
|
|
84
|
+
/**
|
|
85
|
+
* Create a new user in the current enterprise
|
|
86
|
+
*
|
|
87
|
+
* API Endpoint: '/users'
|
|
88
|
+
* Method: POST
|
|
89
|
+
*
|
|
90
|
+
* @param {string} login - The email address this user uses to login
|
|
91
|
+
* @param {string} name - The name of this user
|
|
92
|
+
* @param {Object} [options] - Optional parameters, can be left null in most cases
|
|
93
|
+
* @param {EnterpriseRole} [options.role] - This user’s enterprise role
|
|
94
|
+
* @param {string} [options.language] - The user's language
|
|
95
|
+
* @param {boolean} [options.is_sync_enabled] - Whether or not this user can use Box Sync
|
|
96
|
+
* @param {string} [options.job_title] - The user’s job title
|
|
97
|
+
* @param {string} [options.phone] - The user’s phone number
|
|
98
|
+
* @param {string} [options.address] - The user’s address
|
|
99
|
+
* @param {int} [options.space_amount] - The user’s total available storage space in bytes
|
|
100
|
+
* @param {Array} [options.tracking_codes] - An array of key/value pairs set by the user’s admin
|
|
101
|
+
* @param {EnterpriseUserStatus} [options.status] - The user's status
|
|
102
|
+
* @param {boolean} [options.can_see_managed_users] - Whether the user should be able to see other managed users
|
|
103
|
+
* @param {string} [options.timezone] - The user's timezone
|
|
104
|
+
* @param {boolean} [options.is_exempt_from_device_limits] - Whether to exempt this user from Enterprise device limits
|
|
105
|
+
* @param {boolean} [options.is_exempt_from_login_verification] - Whether or not this user must use two-factor authentication
|
|
106
|
+
* @param {Function} [callback] - Passed the created user if successful, error otherwise
|
|
107
|
+
* @returns {Promise<Object>} A promise resolving to the created user
|
|
108
|
+
*/
|
|
109
|
+
addUser(login: string, name: string, options?: {
|
|
110
|
+
role?: EnterpriseRole;
|
|
111
|
+
language?: string;
|
|
112
|
+
is_sync_enabled?: boolean;
|
|
113
|
+
job_title?: string;
|
|
114
|
+
phone?: string;
|
|
115
|
+
address?: string;
|
|
116
|
+
space_amount?: number;
|
|
117
|
+
tracking_codes?: [string, any][];
|
|
118
|
+
status?: EnterpriseUserStatus;
|
|
119
|
+
can_see_managed_users?: boolean;
|
|
120
|
+
timezone?: string;
|
|
121
|
+
is_exempt_from_device_limits?: boolean;
|
|
122
|
+
is_exempt_from_login_verification?: boolean;
|
|
123
|
+
}, callback?: Function): any;
|
|
124
|
+
/**
|
|
125
|
+
* Create a new app user in the current enterprise
|
|
126
|
+
*
|
|
127
|
+
* API Endpoint: '/users'
|
|
128
|
+
* Method: POST
|
|
129
|
+
*
|
|
130
|
+
* @param {string} name - The name of this user
|
|
131
|
+
* @param {Object} [options] - Optional parameters, can be left null in most cases
|
|
132
|
+
* @param {string} [options.language] - The user's language
|
|
133
|
+
* @param {string} [options.job_title] - The user’s job title
|
|
134
|
+
* @param {string} [options.phone] - The user’s phone number
|
|
135
|
+
* @param {string} [options.address] - The user’s address
|
|
136
|
+
* @param {int} [options.space_amount] - The user’s total available storage space in bytes
|
|
137
|
+
* @param {string} [options.timezone] - The user's timezone
|
|
138
|
+
* @param {Function} [callback] - Passed the created user if successful, error otherwise
|
|
139
|
+
* @returns {Promise<Object>} A promise resolving to the created user
|
|
140
|
+
*/
|
|
141
|
+
addAppUser(name: string, options?: {
|
|
142
|
+
language?: string;
|
|
143
|
+
job_title?: string;
|
|
144
|
+
phone?: string;
|
|
145
|
+
address?: string;
|
|
146
|
+
space_amount?: number;
|
|
147
|
+
timezone?: string;
|
|
148
|
+
}, callback?: Function): any;
|
|
149
|
+
/**
|
|
150
|
+
* Transfers all of a user's files into another user's account.
|
|
151
|
+
*
|
|
152
|
+
* API Endpoint: '/users/:sourceUserID/folders/0'
|
|
153
|
+
* Method: PUT
|
|
154
|
+
*
|
|
155
|
+
* @param {string} sourceUserID - The ID of the user whose files will be transferred
|
|
156
|
+
* @param {string} destUserID - The ID of the user to transfer the files to
|
|
157
|
+
* @param {Function} [callback] - Passed the new folder which contains all the files if successful, error otherwise
|
|
158
|
+
* @returns {Promise<Object>} A promise resolving to the folder containing the transferred content
|
|
159
|
+
*/
|
|
160
|
+
transferUserContent(sourceUserID: string, destUserID: string, callback?: Function): any;
|
|
161
|
+
}
|
|
162
|
+
export = Enterprise;
|