files.com 1.2.265 → 1.2.267

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/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.265
1
+ 1.2.267
@@ -284,7 +284,8 @@
284
284
  "user_root": "example",
285
285
  "user_home": "example",
286
286
  "days_remaining_until_password_expire": 1,
287
- "password_expire_at": "2000-01-01T01:00:00Z"
287
+ "password_expire_at": "2000-01-01T01:00:00Z",
288
+ "has_reassignable_associations": true
288
289
  },
289
290
  "user_lockout": true,
290
291
  "user_lockout_lock_period": 1,
@@ -152,6 +152,21 @@ await Sync.createMigrateTo
152
152
  ```
153
153
 
154
154
 
155
+ ---
156
+
157
+ ## Manually Run Sync
158
+
159
+ ```
160
+ const sync = await Sync.find(id)
161
+
162
+ await sync.manual_run()
163
+ ```
164
+
165
+ ### Parameters
166
+
167
+ * `id` (int64): Required - Sync ID.
168
+
169
+
155
170
  ---
156
171
 
157
172
  ## Update Sync
@@ -71,7 +71,8 @@
71
71
  "user_root": "example",
72
72
  "user_home": "example",
73
73
  "days_remaining_until_password_expire": 1,
74
- "password_expire_at": "2000-01-01T01:00:00Z"
74
+ "password_expire_at": "2000-01-01T01:00:00Z",
75
+ "has_reassignable_associations": true
75
76
  }
76
77
  ```
77
78
 
@@ -141,6 +142,7 @@
141
142
  * `user_home` (string): Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
142
143
  * `days_remaining_until_password_expire` (int64): Number of days remaining until password expires
143
144
  * `password_expire_at` (date-time): Password expiration datetime
145
+ * `has_reassignable_associations` (boolean): Does this user have any associations that can be reassigned on delete?
144
146
  * `avatar_file` (file): An image file for your user avatar.
145
147
  * `avatar_delete` (boolean): If true, the avatar will be deleted.
146
148
  * `change_password` (string): Used for changing a password on an existing user.
@@ -509,7 +511,8 @@ await user.update({
509
511
  "user_root": "example",
510
512
  "user_home": "example",
511
513
  "days_remaining_until_password_expire": 1,
512
- "password_expire_at": "2000-01-01T01:00:00Z"
514
+ "password_expire_at": "2000-01-01T01:00:00Z",
515
+ "has_reassignable_associations": true
513
516
  }
514
517
  ```
515
518
 
package/lib/Files.js CHANGED
@@ -12,7 +12,7 @@ var apiKey;
12
12
  var baseUrl = 'https://app.files.com';
13
13
  var sessionId = null;
14
14
  var language = null;
15
- var version = '1.2.265';
15
+ var version = '1.2.267';
16
16
  var userAgent = "Files.com JavaScript SDK v".concat(version);
17
17
  var logLevel = _Logger.LogLevel.INFO;
18
18
  var debugRequest = false;
@@ -201,6 +201,55 @@ var Sync = /*#__PURE__*/(0, _createClass2.default)(function Sync() {
201
201
  (0, _defineProperty2.default)(this, "setScheduleTimeZone", function (value) {
202
202
  _this.attributes.schedule_time_zone = value;
203
203
  });
204
+ // Manually Run Sync
205
+ (0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
206
+ var params,
207
+ _args = arguments;
208
+ return _regenerator.default.wrap(function (_context) {
209
+ while (1) switch (_context.prev = _context.next) {
210
+ case 0:
211
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
212
+ if (_this.attributes.id) {
213
+ _context.next = 1;
214
+ break;
215
+ }
216
+ throw new errors.EmptyPropertyError('Current object has no id');
217
+ case 1:
218
+ if ((0, _utils.isObject)(params)) {
219
+ _context.next = 2;
220
+ break;
221
+ }
222
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
223
+ case 2:
224
+ params.id = _this.attributes.id;
225
+ if (!(params.id && !(0, _utils.isInt)(params.id))) {
226
+ _context.next = 3;
227
+ break;
228
+ }
229
+ throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
230
+ case 3:
231
+ if (params.id) {
232
+ _context.next = 5;
233
+ break;
234
+ }
235
+ if (!_this.attributes.id) {
236
+ _context.next = 4;
237
+ break;
238
+ }
239
+ params.id = _this.id;
240
+ _context.next = 5;
241
+ break;
242
+ case 4:
243
+ throw new errors.MissingParameterError('Parameter missing: id');
244
+ case 5:
245
+ _context.next = 6;
246
+ return _Api.default.sendRequest("/syncs/".concat(encodeURIComponent(params.id), "/manual_run"), 'POST', params, _this.options);
247
+ case 6:
248
+ case "end":
249
+ return _context.stop();
250
+ }
251
+ }, _callee);
252
+ })));
204
253
  // Parameters:
205
254
  // name - string - Name for this sync job
206
255
  // description - string - Description for this sync job
@@ -219,220 +268,220 @@ var Sync = /*#__PURE__*/(0, _createClass2.default)(function Sync() {
219
268
  // schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
220
269
  // schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
221
270
  // schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
222
- (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
271
+ (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
223
272
  var params,
224
273
  response,
225
- _args = arguments;
226
- return _regenerator.default.wrap(function (_context) {
227
- while (1) switch (_context.prev = _context.next) {
274
+ _args2 = arguments;
275
+ return _regenerator.default.wrap(function (_context2) {
276
+ while (1) switch (_context2.prev = _context2.next) {
228
277
  case 0:
229
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
278
+ params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
230
279
  if (_this.attributes.id) {
231
- _context.next = 1;
280
+ _context2.next = 1;
232
281
  break;
233
282
  }
234
283
  throw new errors.EmptyPropertyError('Current object has no id');
235
284
  case 1:
236
285
  if ((0, _utils.isObject)(params)) {
237
- _context.next = 2;
286
+ _context2.next = 2;
238
287
  break;
239
288
  }
240
289
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
241
290
  case 2:
242
291
  params.id = _this.attributes.id;
243
292
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
244
- _context.next = 3;
293
+ _context2.next = 3;
245
294
  break;
246
295
  }
247
296
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
248
297
  case 3:
249
298
  if (!(params.name && !(0, _utils.isString)(params.name))) {
250
- _context.next = 4;
299
+ _context2.next = 4;
251
300
  break;
252
301
  }
253
302
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
254
303
  case 4:
255
304
  if (!(params.description && !(0, _utils.isString)(params.description))) {
256
- _context.next = 5;
305
+ _context2.next = 5;
257
306
  break;
258
307
  }
259
308
  throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
260
309
  case 5:
261
310
  if (!(params.src_path && !(0, _utils.isString)(params.src_path))) {
262
- _context.next = 6;
311
+ _context2.next = 6;
263
312
  break;
264
313
  }
265
314
  throw new errors.InvalidParameterError("Bad parameter: src_path must be of type String, received ".concat((0, _utils.getType)(params.src_path)));
266
315
  case 6:
267
316
  if (!(params.dest_path && !(0, _utils.isString)(params.dest_path))) {
268
- _context.next = 7;
317
+ _context2.next = 7;
269
318
  break;
270
319
  }
271
320
  throw new errors.InvalidParameterError("Bad parameter: dest_path must be of type String, received ".concat((0, _utils.getType)(params.dest_path)));
272
321
  case 7:
273
322
  if (!(params.src_remote_server_id && !(0, _utils.isInt)(params.src_remote_server_id))) {
274
- _context.next = 8;
323
+ _context2.next = 8;
275
324
  break;
276
325
  }
277
326
  throw new errors.InvalidParameterError("Bad parameter: src_remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.src_remote_server_id)));
278
327
  case 8:
279
328
  if (!(params.dest_remote_server_id && !(0, _utils.isInt)(params.dest_remote_server_id))) {
280
- _context.next = 9;
329
+ _context2.next = 9;
281
330
  break;
282
331
  }
283
332
  throw new errors.InvalidParameterError("Bad parameter: dest_remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.dest_remote_server_id)));
284
333
  case 9:
285
334
  if (!(params.interval && !(0, _utils.isString)(params.interval))) {
286
- _context.next = 10;
335
+ _context2.next = 10;
287
336
  break;
288
337
  }
289
338
  throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
290
339
  case 10:
291
340
  if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
292
- _context.next = 11;
341
+ _context2.next = 11;
293
342
  break;
294
343
  }
295
344
  throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
296
345
  case 11:
297
346
  if (!(params.trigger_file && !(0, _utils.isString)(params.trigger_file))) {
298
- _context.next = 12;
347
+ _context2.next = 12;
299
348
  break;
300
349
  }
301
350
  throw new errors.InvalidParameterError("Bad parameter: trigger_file must be of type String, received ".concat((0, _utils.getType)(params.trigger_file)));
302
351
  case 12:
303
352
  if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
304
- _context.next = 13;
353
+ _context2.next = 13;
305
354
  break;
306
355
  }
307
356
  throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
308
357
  case 13:
309
358
  if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
310
- _context.next = 14;
359
+ _context2.next = 14;
311
360
  break;
312
361
  }
313
362
  throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
314
363
  case 14:
315
364
  if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
316
- _context.next = 15;
365
+ _context2.next = 15;
317
366
  break;
318
367
  }
319
368
  throw new errors.InvalidParameterError("Bad parameter: schedule_days_of_week must be of type Array, received ".concat((0, _utils.getType)(params.schedule_days_of_week)));
320
369
  case 15:
321
370
  if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
322
- _context.next = 16;
371
+ _context2.next = 16;
323
372
  break;
324
373
  }
325
374
  throw new errors.InvalidParameterError("Bad parameter: schedule_times_of_day must be of type Array, received ".concat((0, _utils.getType)(params.schedule_times_of_day)));
326
375
  case 16:
327
376
  if (params.id) {
328
- _context.next = 18;
377
+ _context2.next = 18;
329
378
  break;
330
379
  }
331
380
  if (!_this.attributes.id) {
332
- _context.next = 17;
381
+ _context2.next = 17;
333
382
  break;
334
383
  }
335
384
  params.id = _this.id;
336
- _context.next = 18;
385
+ _context2.next = 18;
337
386
  break;
338
387
  case 17:
339
388
  throw new errors.MissingParameterError('Parameter missing: id');
340
389
  case 18:
341
- _context.next = 19;
390
+ _context2.next = 19;
342
391
  return _Api.default.sendRequest("/syncs/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
343
392
  case 19:
344
- response = _context.sent;
345
- return _context.abrupt("return", new Sync(response === null || response === void 0 ? void 0 : response.data, _this.options));
393
+ response = _context2.sent;
394
+ return _context2.abrupt("return", new Sync(response === null || response === void 0 ? void 0 : response.data, _this.options));
346
395
  case 20:
347
396
  case "end":
348
- return _context.stop();
397
+ return _context2.stop();
349
398
  }
350
- }, _callee);
399
+ }, _callee2);
351
400
  })));
352
- (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
401
+ (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
353
402
  var params,
354
- _args2 = arguments;
355
- return _regenerator.default.wrap(function (_context2) {
356
- while (1) switch (_context2.prev = _context2.next) {
403
+ _args3 = arguments;
404
+ return _regenerator.default.wrap(function (_context3) {
405
+ while (1) switch (_context3.prev = _context3.next) {
357
406
  case 0:
358
- params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
407
+ params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
359
408
  if (_this.attributes.id) {
360
- _context2.next = 1;
409
+ _context3.next = 1;
361
410
  break;
362
411
  }
363
412
  throw new errors.EmptyPropertyError('Current object has no id');
364
413
  case 1:
365
414
  if ((0, _utils.isObject)(params)) {
366
- _context2.next = 2;
415
+ _context3.next = 2;
367
416
  break;
368
417
  }
369
418
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
370
419
  case 2:
371
420
  params.id = _this.attributes.id;
372
421
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
373
- _context2.next = 3;
422
+ _context3.next = 3;
374
423
  break;
375
424
  }
376
425
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
377
426
  case 3:
378
427
  if (params.id) {
379
- _context2.next = 5;
428
+ _context3.next = 5;
380
429
  break;
381
430
  }
382
431
  if (!_this.attributes.id) {
383
- _context2.next = 4;
432
+ _context3.next = 4;
384
433
  break;
385
434
  }
386
435
  params.id = _this.id;
387
- _context2.next = 5;
436
+ _context3.next = 5;
388
437
  break;
389
438
  case 4:
390
439
  throw new errors.MissingParameterError('Parameter missing: id');
391
440
  case 5:
392
- _context2.next = 6;
441
+ _context3.next = 6;
393
442
  return _Api.default.sendRequest("/syncs/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
394
443
  case 6:
395
444
  case "end":
396
- return _context2.stop();
445
+ return _context3.stop();
397
446
  }
398
- }, _callee2);
447
+ }, _callee3);
399
448
  })));
400
449
  (0, _defineProperty2.default)(this, "destroy", function () {
401
450
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
402
451
  return _this.delete(params);
403
452
  });
404
- (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
453
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
405
454
  var _newObject, newObject;
406
- return _regenerator.default.wrap(function (_context3) {
407
- while (1) switch (_context3.prev = _context3.next) {
455
+ return _regenerator.default.wrap(function (_context4) {
456
+ while (1) switch (_context4.prev = _context4.next) {
408
457
  case 0:
409
458
  if (!_this.attributes.id) {
410
- _context3.next = 2;
459
+ _context4.next = 2;
411
460
  break;
412
461
  }
413
- _context3.next = 1;
462
+ _context4.next = 1;
414
463
  return _this.update(_this.attributes);
415
464
  case 1:
416
- _newObject = _context3.sent;
465
+ _newObject = _context4.sent;
417
466
  _this.attributes = _objectSpread({}, _newObject.attributes);
418
- return _context3.abrupt("return", true);
467
+ return _context4.abrupt("return", true);
419
468
  case 2:
420
- _context3.next = 3;
469
+ _context4.next = 3;
421
470
  return Sync.create(_this.attributes, _this.options);
422
471
  case 3:
423
- newObject = _context3.sent;
472
+ newObject = _context4.sent;
424
473
  _this.attributes = _objectSpread({}, newObject.attributes);
425
- return _context3.abrupt("return", true);
474
+ return _context4.abrupt("return", true);
426
475
  case 4:
427
476
  case "end":
428
- return _context3.stop();
477
+ return _context4.stop();
429
478
  }
430
- }, _callee3);
479
+ }, _callee4);
431
480
  })));
432
- Object.entries(attributes).forEach(function (_ref4) {
433
- var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
434
- key = _ref5[0],
435
- value = _ref5[1];
481
+ Object.entries(attributes).forEach(function (_ref5) {
482
+ var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
483
+ key = _ref6[0],
484
+ value = _ref6[1];
436
485
  var normalizedKey = key.replace('?', '');
437
486
  _this.attributes[normalizedKey] = value;
438
487
  Object.defineProperty(_this, normalizedKey, {
@@ -446,41 +495,41 @@ _Sync = Sync;
446
495
  // Parameters:
447
496
  // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
448
497
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
449
- (0, _defineProperty2.default)(Sync, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
498
+ (0, _defineProperty2.default)(Sync, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
450
499
  var _response$data;
451
500
  var params,
452
501
  options,
453
502
  response,
454
- _args4 = arguments;
455
- return _regenerator.default.wrap(function (_context4) {
456
- while (1) switch (_context4.prev = _context4.next) {
503
+ _args5 = arguments;
504
+ return _regenerator.default.wrap(function (_context5) {
505
+ while (1) switch (_context5.prev = _context5.next) {
457
506
  case 0:
458
- params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
459
- options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
507
+ params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
508
+ options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
460
509
  if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
461
- _context4.next = 1;
510
+ _context5.next = 1;
462
511
  break;
463
512
  }
464
513
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
465
514
  case 1:
466
515
  if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
467
- _context4.next = 2;
516
+ _context5.next = 2;
468
517
  break;
469
518
  }
470
519
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
471
520
  case 2:
472
- _context4.next = 3;
521
+ _context5.next = 3;
473
522
  return _Api.default.sendRequest('/syncs', 'GET', params, options);
474
523
  case 3:
475
- response = _context4.sent;
476
- return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
524
+ response = _context5.sent;
525
+ return _context5.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
477
526
  return new _Sync(obj, options);
478
527
  })) || []);
479
528
  case 4:
480
529
  case "end":
481
- return _context4.stop();
530
+ return _context5.stop();
482
531
  }
483
- }, _callee4);
532
+ }, _callee5);
484
533
  })));
485
534
  (0, _defineProperty2.default)(Sync, "all", function () {
486
535
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -490,48 +539,48 @@ _Sync = Sync;
490
539
  // Parameters:
491
540
  // id (required) - int64 - Sync ID.
492
541
  (0, _defineProperty2.default)(Sync, "find", /*#__PURE__*/function () {
493
- var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
542
+ var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(id) {
494
543
  var params,
495
544
  options,
496
545
  response,
497
- _args5 = arguments;
498
- return _regenerator.default.wrap(function (_context5) {
499
- while (1) switch (_context5.prev = _context5.next) {
546
+ _args6 = arguments;
547
+ return _regenerator.default.wrap(function (_context6) {
548
+ while (1) switch (_context6.prev = _context6.next) {
500
549
  case 0:
501
- params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
502
- options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
550
+ params = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
551
+ options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
503
552
  if ((0, _utils.isObject)(params)) {
504
- _context5.next = 1;
553
+ _context6.next = 1;
505
554
  break;
506
555
  }
507
556
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
508
557
  case 1:
509
558
  params.id = id;
510
559
  if (params.id) {
511
- _context5.next = 2;
560
+ _context6.next = 2;
512
561
  break;
513
562
  }
514
563
  throw new errors.MissingParameterError('Parameter missing: id');
515
564
  case 2:
516
565
  if (!(params.id && !(0, _utils.isInt)(params.id))) {
517
- _context5.next = 3;
566
+ _context6.next = 3;
518
567
  break;
519
568
  }
520
569
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
521
570
  case 3:
522
- _context5.next = 4;
571
+ _context6.next = 4;
523
572
  return _Api.default.sendRequest("/syncs/".concat(encodeURIComponent(params.id)), 'GET', params, options);
524
573
  case 4:
525
- response = _context5.sent;
526
- return _context5.abrupt("return", new _Sync(response === null || response === void 0 ? void 0 : response.data, options));
574
+ response = _context6.sent;
575
+ return _context6.abrupt("return", new _Sync(response === null || response === void 0 ? void 0 : response.data, options));
527
576
  case 5:
528
577
  case "end":
529
- return _context5.stop();
578
+ return _context6.stop();
530
579
  }
531
- }, _callee5);
580
+ }, _callee6);
532
581
  }));
533
582
  return function (_x) {
534
- return _ref7.apply(this, arguments);
583
+ return _ref8.apply(this, arguments);
535
584
  };
536
585
  }());
537
586
  (0, _defineProperty2.default)(Sync, "get", function (id) {
@@ -557,119 +606,119 @@ _Sync = Sync;
557
606
  // schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
558
607
  // schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
559
608
  // schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
560
- (0, _defineProperty2.default)(Sync, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
609
+ (0, _defineProperty2.default)(Sync, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
561
610
  var params,
562
611
  options,
563
612
  response,
564
- _args6 = arguments;
565
- return _regenerator.default.wrap(function (_context6) {
566
- while (1) switch (_context6.prev = _context6.next) {
613
+ _args7 = arguments;
614
+ return _regenerator.default.wrap(function (_context7) {
615
+ while (1) switch (_context7.prev = _context7.next) {
567
616
  case 0:
568
- params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
569
- options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
617
+ params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
618
+ options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
570
619
  if (!(params.name && !(0, _utils.isString)(params.name))) {
571
- _context6.next = 1;
620
+ _context7.next = 1;
572
621
  break;
573
622
  }
574
623
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
575
624
  case 1:
576
625
  if (!(params.description && !(0, _utils.isString)(params.description))) {
577
- _context6.next = 2;
626
+ _context7.next = 2;
578
627
  break;
579
628
  }
580
629
  throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
581
630
  case 2:
582
631
  if (!(params.src_path && !(0, _utils.isString)(params.src_path))) {
583
- _context6.next = 3;
632
+ _context7.next = 3;
584
633
  break;
585
634
  }
586
635
  throw new errors.InvalidParameterError("Bad parameter: src_path must be of type String, received ".concat((0, _utils.getType)(params.src_path)));
587
636
  case 3:
588
637
  if (!(params.dest_path && !(0, _utils.isString)(params.dest_path))) {
589
- _context6.next = 4;
638
+ _context7.next = 4;
590
639
  break;
591
640
  }
592
641
  throw new errors.InvalidParameterError("Bad parameter: dest_path must be of type String, received ".concat((0, _utils.getType)(params.dest_path)));
593
642
  case 4:
594
643
  if (!(params.src_remote_server_id && !(0, _utils.isInt)(params.src_remote_server_id))) {
595
- _context6.next = 5;
644
+ _context7.next = 5;
596
645
  break;
597
646
  }
598
647
  throw new errors.InvalidParameterError("Bad parameter: src_remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.src_remote_server_id)));
599
648
  case 5:
600
649
  if (!(params.dest_remote_server_id && !(0, _utils.isInt)(params.dest_remote_server_id))) {
601
- _context6.next = 6;
650
+ _context7.next = 6;
602
651
  break;
603
652
  }
604
653
  throw new errors.InvalidParameterError("Bad parameter: dest_remote_server_id must be of type Int, received ".concat((0, _utils.getType)(params.dest_remote_server_id)));
605
654
  case 6:
606
655
  if (!(params.interval && !(0, _utils.isString)(params.interval))) {
607
- _context6.next = 7;
656
+ _context7.next = 7;
608
657
  break;
609
658
  }
610
659
  throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
611
660
  case 7:
612
661
  if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
613
- _context6.next = 8;
662
+ _context7.next = 8;
614
663
  break;
615
664
  }
616
665
  throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
617
666
  case 8:
618
667
  if (!(params.trigger_file && !(0, _utils.isString)(params.trigger_file))) {
619
- _context6.next = 9;
668
+ _context7.next = 9;
620
669
  break;
621
670
  }
622
671
  throw new errors.InvalidParameterError("Bad parameter: trigger_file must be of type String, received ".concat((0, _utils.getType)(params.trigger_file)));
623
672
  case 9:
624
673
  if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
625
- _context6.next = 10;
674
+ _context7.next = 10;
626
675
  break;
627
676
  }
628
677
  throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
629
678
  case 10:
630
679
  if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
631
- _context6.next = 11;
680
+ _context7.next = 11;
632
681
  break;
633
682
  }
634
683
  throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
635
684
  case 11:
636
685
  if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
637
- _context6.next = 12;
686
+ _context7.next = 12;
638
687
  break;
639
688
  }
640
689
  throw new errors.InvalidParameterError("Bad parameter: schedule_days_of_week must be of type Array, received ".concat((0, _utils.getType)(params.schedule_days_of_week)));
641
690
  case 12:
642
691
  if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
643
- _context6.next = 13;
692
+ _context7.next = 13;
644
693
  break;
645
694
  }
646
695
  throw new errors.InvalidParameterError("Bad parameter: schedule_times_of_day must be of type Array, received ".concat((0, _utils.getType)(params.schedule_times_of_day)));
647
696
  case 13:
648
- _context6.next = 14;
697
+ _context7.next = 14;
649
698
  return _Api.default.sendRequest('/syncs', 'POST', params, options);
650
699
  case 14:
651
- response = _context6.sent;
652
- return _context6.abrupt("return", new _Sync(response === null || response === void 0 ? void 0 : response.data, options));
700
+ response = _context7.sent;
701
+ return _context7.abrupt("return", new _Sync(response === null || response === void 0 ? void 0 : response.data, options));
653
702
  case 15:
654
703
  case "end":
655
- return _context6.stop();
704
+ return _context7.stop();
656
705
  }
657
- }, _callee6);
706
+ }, _callee7);
658
707
  })));
659
- (0, _defineProperty2.default)(Sync, "createMigrateTo", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
708
+ (0, _defineProperty2.default)(Sync, "createMigrateTo", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
660
709
  var options,
661
- _args7 = arguments;
662
- return _regenerator.default.wrap(function (_context7) {
663
- while (1) switch (_context7.prev = _context7.next) {
710
+ _args8 = arguments;
711
+ return _regenerator.default.wrap(function (_context8) {
712
+ while (1) switch (_context8.prev = _context8.next) {
664
713
  case 0:
665
- options = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
666
- _context7.next = 1;
714
+ options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
715
+ _context8.next = 1;
667
716
  return _Api.default.sendRequest('/syncs/migrate_to_syncs', 'POST', {}, options);
668
717
  case 1:
669
718
  case "end":
670
- return _context7.stop();
719
+ return _context8.stop();
671
720
  }
672
- }, _callee7);
721
+ }, _callee8);
673
722
  })));
674
723
  var _default = exports.default = Sync;
675
724
  module.exports = Sync;
@@ -491,6 +491,13 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
491
491
  (0, _defineProperty2.default)(this, "setPasswordExpireAt", function (value) {
492
492
  _this.attributes.password_expire_at = value;
493
493
  });
494
+ // boolean # Does this user have any associations that can be reassigned on delete?
495
+ (0, _defineProperty2.default)(this, "getHasReassignableAssociations", function () {
496
+ return _this.attributes.has_reassignable_associations;
497
+ });
498
+ (0, _defineProperty2.default)(this, "setHasReassignableAssociations", function (value) {
499
+ _this.attributes.has_reassignable_associations = value;
500
+ });
494
501
  // file # An image file for your user avatar.
495
502
  (0, _defineProperty2.default)(this, "getAvatarFile", function () {
496
503
  return _this.attributes.avatar_file;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.265",
3
+ "version": "1.2.267",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -6,7 +6,7 @@ let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
8
  let language = null
9
- const version = '1.2.265'
9
+ const version = '1.2.267'
10
10
  let userAgent = `Files.com JavaScript SDK v${version}`
11
11
 
12
12
  let logLevel = LogLevel.INFO
@@ -195,6 +195,32 @@ class Sync {
195
195
  this.attributes.schedule_time_zone = value
196
196
  }
197
197
 
198
+ // Manually Run Sync
199
+ manualRun = async (params = {}) => {
200
+ if (!this.attributes.id) {
201
+ throw new errors.EmptyPropertyError('Current object has no id')
202
+ }
203
+
204
+ if (!isObject(params)) {
205
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
206
+ }
207
+
208
+ params.id = this.attributes.id
209
+ if (params.id && !isInt(params.id)) {
210
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
211
+ }
212
+
213
+ if (!params.id) {
214
+ if (this.attributes.id) {
215
+ params.id = this.id
216
+ } else {
217
+ throw new errors.MissingParameterError('Parameter missing: id')
218
+ }
219
+ }
220
+
221
+ await Api.sendRequest(`/syncs/${encodeURIComponent(params.id)}/manual_run`, 'POST', params, this.options)
222
+ }
223
+
198
224
  // Parameters:
199
225
  // name - string - Name for this sync job
200
226
  // description - string - Description for this sync job
@@ -486,6 +486,13 @@ class User {
486
486
  this.attributes.password_expire_at = value
487
487
  }
488
488
 
489
+ // boolean # Does this user have any associations that can be reassigned on delete?
490
+ getHasReassignableAssociations = () => this.attributes.has_reassignable_associations
491
+
492
+ setHasReassignableAssociations = value => {
493
+ this.attributes.has_reassignable_associations = value
494
+ }
495
+
489
496
  // file # An image file for your user avatar.
490
497
  getAvatarFile = () => this.attributes.avatar_file
491
498