files.com 1.2.82 → 1.2.83

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.82
1
+ 1.2.83
@@ -68,10 +68,10 @@ await Lock.create(path, {
68
68
  ### Parameters
69
69
 
70
70
  * `path` (string): Required - Path
71
- * `allow_access_by_any_user` (boolean): Allow lock to be updated by any user?
71
+ * `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator?
72
72
  * `exclusive` (boolean): Is lock exclusive?
73
- * `recursive` (string): Does lock apply to subfolders?
74
- * `timeout` (int64): Lock timeout length
73
+ * `recursive` (boolean): Does lock apply to subfolders?
74
+ * `timeout` (int64): Lock timeout in seconds
75
75
 
76
76
  ---
77
77
 
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.82';
14
+ var version = '1.2.83';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -289,10 +289,10 @@ _Lock = Lock;
289
289
  }());
290
290
  // Parameters:
291
291
  // path (required) - string - Path
292
- // allow_access_by_any_user - boolean - Allow lock to be updated by any user?
292
+ // allow_access_by_any_user - boolean - Can lock be modified by users other than its creator?
293
293
  // exclusive - boolean - Is lock exclusive?
294
- // recursive - string - Does lock apply to subfolders?
295
- // timeout - int64 - Lock timeout length
294
+ // recursive - boolean - Does lock apply to subfolders?
295
+ // timeout - int64 - Lock timeout in seconds
296
296
  (0, _defineProperty2.default)(Lock, "create", /*#__PURE__*/function () {
297
297
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(path) {
298
298
  var params,
@@ -323,24 +323,18 @@ _Lock = Lock;
323
323
  }
324
324
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
325
325
  case 9:
326
- if (!(params.recursive && !(0, _utils.isString)(params.recursive))) {
327
- _context4.next = 11;
328
- break;
329
- }
330
- throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params.recursive)));
331
- case 11:
332
326
  if (!(params.timeout && !(0, _utils.isInt)(params.timeout))) {
333
- _context4.next = 13;
327
+ _context4.next = 11;
334
328
  break;
335
329
  }
336
330
  throw new errors.InvalidParameterError("Bad parameter: timeout must be of type Int, received ".concat((0, _utils.getType)(params.timeout)));
337
- case 13:
338
- _context4.next = 15;
331
+ case 11:
332
+ _context4.next = 13;
339
333
  return _Api.default.sendRequest("/locks/".concat(encodeURIComponent(params.path)), 'POST', params, options);
340
- case 15:
334
+ case 13:
341
335
  response = _context4.sent;
342
336
  return _context4.abrupt("return", new _Lock(response === null || response === void 0 ? void 0 : response.data, options));
343
- case 17:
337
+ case 15:
344
338
  case "end":
345
339
  return _context4.stop();
346
340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.82'
8
+ const version = '1.2.83'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -195,10 +195,10 @@ class Lock {
195
195
 
196
196
  // Parameters:
197
197
  // path (required) - string - Path
198
- // allow_access_by_any_user - boolean - Allow lock to be updated by any user?
198
+ // allow_access_by_any_user - boolean - Can lock be modified by users other than its creator?
199
199
  // exclusive - boolean - Is lock exclusive?
200
- // recursive - string - Does lock apply to subfolders?
201
- // timeout - int64 - Lock timeout length
200
+ // recursive - boolean - Does lock apply to subfolders?
201
+ // timeout - int64 - Lock timeout in seconds
202
202
  static create = async (path, params = {}, options = {}) => {
203
203
  if (!isObject(params)) {
204
204
  throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
@@ -214,10 +214,6 @@ class Lock {
214
214
  throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
215
215
  }
216
216
 
217
- if (params.recursive && !isString(params.recursive)) {
218
- throw new errors.InvalidParameterError(`Bad parameter: recursive must be of type String, received ${getType(params.recursive)}`)
219
- }
220
-
221
217
  if (params.timeout && !isInt(params.timeout)) {
222
218
  throw new errors.InvalidParameterError(`Bad parameter: timeout must be of type Int, received ${getType(params.timeout)}`)
223
219
  }