files.com 1.2.106 → 1.2.108
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/_VERSION +1 -1
- package/docs/models/ApiKey.md +4 -4
- package/lib/Files.js +1 -1
- package/lib/models/ApiKey.js +4 -4
- package/package.json +1 -1
- package/shared/normalization_for_comparison_test_data.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ApiKey.js +4 -4
- package/test/integration/src/index.js +7 -7
package/README.md
CHANGED
@@ -256,9 +256,9 @@ try {
|
|
256
256
|
}
|
257
257
|
catch(err) {
|
258
258
|
if (err instanceof FilesErrors.NotAuthenticatedError) {
|
259
|
-
console.log("Authorization Error
|
259
|
+
console.log("Authorization Error Occurred (" + err.constructor.name + "): " + err.error);
|
260
260
|
} else if (err instanceof FilesErrors.FilesError) {
|
261
|
-
console.log("Unknown Error
|
261
|
+
console.log("Unknown Error Occurred (" + err.constructor.name + "): " + err.error);
|
262
262
|
} else {
|
263
263
|
throw err;
|
264
264
|
}
|
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.108
|
package/docs/models/ApiKey.md
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
* `key` (string): API Key actual key string
|
28
28
|
* `last_use_at` (date-time): API Key last used - note this value is only updated once per 3 hour period, so the 'actual' time of last use may be up to 3 hours later than this timestamp.
|
29
29
|
* `name` (string): Internal name for the API Key. For your use.
|
30
|
-
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
30
|
+
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
31
31
|
* `platform` (string): If this API key represents a Desktop app, what platform was it created on?
|
32
32
|
* `url` (string): URL for API host.
|
33
33
|
* `user_id` (int64): User ID for the owner of this API Key. May be blank for Site-wide API Keys.
|
@@ -99,7 +99,7 @@ await ApiKey.create({
|
|
99
99
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
100
100
|
* `description` (string): User-supplied description of API key.
|
101
101
|
* `expires_at` (string): API Key expiration date
|
102
|
-
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
102
|
+
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
103
103
|
* `name` (string): Required - Internal name for the API Key. For your use.
|
104
104
|
* `path` (string): Folder path restriction for this API key.
|
105
105
|
|
@@ -120,7 +120,7 @@ await ApiKey.updateCurrent({
|
|
120
120
|
|
121
121
|
* `expires_at` (string): API Key expiration date
|
122
122
|
* `name` (string): Internal name for the API Key. For your use.
|
123
|
-
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
123
|
+
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
124
124
|
|
125
125
|
---
|
126
126
|
|
@@ -151,7 +151,7 @@ await api_key.update({
|
|
151
151
|
* `id` (int64): Required - Api Key ID.
|
152
152
|
* `description` (string): User-supplied description of API key.
|
153
153
|
* `expires_at` (string): API Key expiration date
|
154
|
-
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
154
|
+
* `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
155
155
|
* `name` (string): Internal name for the API Key. For your use.
|
156
156
|
|
157
157
|
### Example Response
|
package/lib/Files.js
CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
|
|
11
11
|
var apiKey;
|
12
12
|
var baseUrl = 'https://app.files.com';
|
13
13
|
var sessionId = null;
|
14
|
-
var version = '1.2.
|
14
|
+
var version = '1.2.108';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
package/lib/models/ApiKey.js
CHANGED
@@ -86,7 +86,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
86
86
|
(0, _defineProperty2.default)(this, "setName", function (value) {
|
87
87
|
_this.attributes.name = value;
|
88
88
|
});
|
89
|
-
// string # Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
89
|
+
// string # Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
90
90
|
(0, _defineProperty2.default)(this, "getPermissionSet", function () {
|
91
91
|
return _this.attributes.permission_set;
|
92
92
|
});
|
@@ -124,7 +124,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
124
124
|
// Parameters:
|
125
125
|
// description - string - User-supplied description of API key.
|
126
126
|
// expires_at - string - API Key expiration date
|
127
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
127
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
128
128
|
// name - string - Internal name for the API Key. For your use.
|
129
129
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
130
130
|
var params,
|
@@ -428,7 +428,7 @@ _ApiKey = ApiKey;
|
|
428
428
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
429
429
|
// description - string - User-supplied description of API key.
|
430
430
|
// expires_at - string - API Key expiration date
|
431
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
431
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
432
432
|
// name (required) - string - Internal name for the API Key. For your use.
|
433
433
|
// path - string - Folder path restriction for this API key.
|
434
434
|
(0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
@@ -497,7 +497,7 @@ _ApiKey = ApiKey;
|
|
497
497
|
// Parameters:
|
498
498
|
// expires_at - string - API Key expiration date
|
499
499
|
// name - string - Internal name for the API Key. For your use.
|
500
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
500
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
501
501
|
(0, _defineProperty2.default)(ApiKey, "updateCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
502
502
|
var params,
|
503
503
|
options,
|
package/package.json
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
[ "a/b/c.txt\r", "a/b/c.txt" ],
|
15
15
|
[ " space_at_beginning", " space_at_beginning"],
|
16
16
|
[ "space_at_end ", "space_at_end"],
|
17
|
-
[ "tab\
|
17
|
+
[ "tab\tseparated", "tab\tseparated"],
|
18
18
|
[ "<title>hello</hello>", "<title>hello</hello>"],
|
19
19
|
[ "안녕하세요", "안녕하세요" ],
|
20
20
|
[ "こんにちは", "こんにちは" ],
|
package/src/Files.js
CHANGED
package/src/models/ApiKey.js
CHANGED
@@ -80,7 +80,7 @@ class ApiKey {
|
|
80
80
|
this.attributes.name = value
|
81
81
|
}
|
82
82
|
|
83
|
-
// string # Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
83
|
+
// string # Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
84
84
|
getPermissionSet = () => this.attributes.permission_set
|
85
85
|
|
86
86
|
setPermissionSet = value => {
|
@@ -118,7 +118,7 @@ class ApiKey {
|
|
118
118
|
// Parameters:
|
119
119
|
// description - string - User-supplied description of API key.
|
120
120
|
// expires_at - string - API Key expiration date
|
121
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
121
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
122
122
|
// name - string - Internal name for the API Key. For your use.
|
123
123
|
update = async (params = {}) => {
|
124
124
|
if (!this.attributes.id) {
|
@@ -269,7 +269,7 @@ class ApiKey {
|
|
269
269
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
270
270
|
// description - string - User-supplied description of API key.
|
271
271
|
// expires_at - string - API Key expiration date
|
272
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
272
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
273
273
|
// name (required) - string - Internal name for the API Key. For your use.
|
274
274
|
// path - string - Folder path restriction for this API key.
|
275
275
|
static create = async (params = {}, options = {}) => {
|
@@ -309,7 +309,7 @@ class ApiKey {
|
|
309
309
|
// Parameters:
|
310
310
|
// expires_at - string - API Key expiration date
|
311
311
|
// name - string - Internal name for the API Key. For your use.
|
312
|
-
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).
|
312
|
+
// permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Keys with the `office_integration` permission set are auto generated, and automatically expire, to allow users to interact with office integration platforms. Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
313
313
|
static updateCurrent = async (params = {}, options = {}) => {
|
314
314
|
if (params.expires_at && !isString(params.expires_at)) {
|
315
315
|
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(params.expires_at)}`)
|
@@ -82,7 +82,7 @@ const testSuite = async () => {
|
|
82
82
|
invariant(file.display_name === displayName, 'Uploaded file response object should have the same display_name as the file we uploaded')
|
83
83
|
|
84
84
|
const foundFile = await File.find(destinationPath)
|
85
|
-
|
85
|
+
|
86
86
|
invariant(foundFile.path === destinationPath, 'Found file should have the same path as the file we uploaded')
|
87
87
|
invariant(foundFile.display_name === displayName, 'Found file should have the same display_name as the file we uploaded')
|
88
88
|
invariant(typeof foundFile.getDownloadUri() === 'undefined', 'Found file should not have a download uri yet')
|
@@ -211,7 +211,7 @@ const testSuite = async () => {
|
|
211
211
|
const auto = await ApiKey.list({ user_id: 0 })
|
212
212
|
|
213
213
|
invariant(JSON.stringify(manual.attributes) === JSON.stringify(auto.attributes), 'Manual and auto session API key lists should match')
|
214
|
-
|
214
|
+
|
215
215
|
await Session.destroy()
|
216
216
|
|
217
217
|
Files.setSessionId(null)
|
@@ -244,19 +244,19 @@ const testSuite = async () => {
|
|
244
244
|
const testUserListAndUpdate = async () => {
|
245
245
|
const allUsers = await User.all()
|
246
246
|
const firstUser = allUsers[0]
|
247
|
-
|
247
|
+
|
248
248
|
const oldName = firstUser.name
|
249
249
|
const newName = `edited name - ${Math.random()}`
|
250
|
-
|
250
|
+
|
251
251
|
firstUser.setName(newName)
|
252
252
|
await firstUser.save()
|
253
|
-
|
253
|
+
|
254
254
|
const updatedUser = await User.find(firstUser.id)
|
255
|
-
|
255
|
+
|
256
256
|
invariant(updatedUser.isLoaded(), 'updated user should be loaded')
|
257
257
|
invariant(oldName !== newName, 'old name should not equal new name')
|
258
258
|
invariant(updatedUser.name === newName, 'updated user name should match new name')
|
259
|
-
|
259
|
+
|
260
260
|
Logger.info('***** testUserListAndUpdate() succeeded! *****');
|
261
261
|
}
|
262
262
|
|