files.com 1.2.249 → 1.2.251
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 +1 -1
- package/docs/models/User.md +4 -1
- package/lib/Api.js +72 -71
- package/lib/Files.js +1 -1
- package/lib/isomorphic/File.node.js +5 -5
- package/lib/models/ActionNotificationExport.js +38 -38
- package/lib/models/ActionNotificationExportResult.js +14 -14
- package/lib/models/ApiKey.js +100 -100
- package/lib/models/ApiRequestLog.js +8 -8
- package/lib/models/App.js +8 -8
- package/lib/models/As2IncomingMessage.js +10 -10
- package/lib/models/As2OutgoingMessage.js +10 -10
- package/lib/models/As2Partner.js +101 -101
- package/lib/models/As2Station.js +81 -81
- package/lib/models/Automation.js +167 -167
- package/lib/models/AutomationLog.js +8 -8
- package/lib/models/AutomationRun.js +24 -24
- package/lib/models/BandwidthSnapshot.js +8 -8
- package/lib/models/Behavior.js +106 -106
- package/lib/models/Bundle.js +143 -143
- package/lib/models/BundleAction.js +10 -10
- package/lib/models/BundleDownload.js +12 -12
- package/lib/models/BundleNotification.js +69 -69
- package/lib/models/BundleRecipient.js +40 -40
- package/lib/models/BundleRegistration.js +12 -12
- package/lib/models/Clickwrap.js +79 -79
- package/lib/models/DnsRecord.js +8 -8
- package/lib/models/EmailIncomingMessage.js +8 -8
- package/lib/models/EmailLog.js +8 -8
- package/lib/models/ExavaultApiRequestLog.js +8 -8
- package/lib/models/ExternalEvent.js +36 -36
- package/lib/models/File.js +269 -269
- package/lib/models/FileComment.js +70 -70
- package/lib/models/FileCommentReaction.js +34 -34
- package/lib/models/FileMigration.js +10 -10
- package/lib/models/FileMigrationLog.js +8 -8
- package/lib/models/Folder.js +36 -36
- package/lib/models/FormFieldSet.js +71 -71
- package/lib/models/FtpActionLog.js +8 -8
- package/lib/models/GpgKey.js +81 -81
- package/lib/models/Group.js +83 -83
- package/lib/models/GroupUser.js +89 -89
- package/lib/models/History.js +88 -88
- package/lib/models/HistoryExport.js +64 -64
- package/lib/models/HistoryExportResult.js +14 -14
- package/lib/models/InboxRecipient.js +36 -36
- package/lib/models/InboxRegistration.js +10 -10
- package/lib/models/InboxUpload.js +8 -8
- package/lib/models/Invoice.js +18 -18
- package/lib/models/IpAddress.js +32 -32
- package/lib/models/Lock.js +51 -51
- package/lib/models/Message.js +100 -100
- package/lib/models/MessageComment.js +78 -78
- package/lib/models/MessageCommentReaction.js +54 -54
- package/lib/models/MessageReaction.js +54 -54
- package/lib/models/Notification.js +91 -91
- package/lib/models/OutboundConnectionLog.js +8 -8
- package/lib/models/Payment.js +18 -18
- package/lib/models/Permission.js +54 -54
- package/lib/models/Priority.js +14 -14
- package/lib/models/Project.js +70 -70
- package/lib/models/PublicHostingRequestLog.js +8 -8
- package/lib/models/PublicKey.js +78 -78
- package/lib/models/RemoteBandwidthSnapshot.js +8 -8
- package/lib/models/RemoteServer.js +362 -362
- package/lib/models/Request.js +60 -60
- package/lib/models/Restore.js +24 -24
- package/lib/models/Session.js +21 -21
- package/lib/models/SettingsChange.js +8 -8
- package/lib/models/SftpActionLog.js +8 -8
- package/lib/models/SftpHostKey.js +67 -67
- package/lib/models/ShareGroup.js +79 -79
- package/lib/models/SiemHttpDestination.js +158 -158
- package/lib/models/Site.js +150 -150
- package/lib/models/Snapshot.js +85 -85
- package/lib/models/SsoStrategy.js +32 -32
- package/lib/models/Style.js +48 -48
- package/lib/models/SyncLog.js +8 -8
- package/lib/models/UsageDailySnapshot.js +8 -8
- package/lib/models/UsageSnapshot.js +8 -8
- package/lib/models/User.js +223 -215
- package/lib/models/UserCipherUse.js +10 -10
- package/lib/models/UserLifecycleRule.js +92 -92
- package/lib/models/UserRequest.js +56 -56
- package/lib/models/UserSftpClientUse.js +10 -10
- package/lib/models/WebDavActionLog.js +8 -8
- package/lib/models/WebhookTest.js +24 -24
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/User.js +6 -0
package/lib/models/Automation.js
CHANGED
|
@@ -295,46 +295,46 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
295
295
|
(0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
296
296
|
var params,
|
|
297
297
|
_args = arguments;
|
|
298
|
-
return _regenerator.default.wrap(function
|
|
298
|
+
return _regenerator.default.wrap(function (_context) {
|
|
299
299
|
while (1) switch (_context.prev = _context.next) {
|
|
300
300
|
case 0:
|
|
301
301
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
302
302
|
if (_this.attributes.id) {
|
|
303
|
-
_context.next =
|
|
303
|
+
_context.next = 1;
|
|
304
304
|
break;
|
|
305
305
|
}
|
|
306
306
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
307
|
-
case
|
|
307
|
+
case 1:
|
|
308
308
|
if ((0, _utils.isObject)(params)) {
|
|
309
|
-
_context.next =
|
|
309
|
+
_context.next = 2;
|
|
310
310
|
break;
|
|
311
311
|
}
|
|
312
312
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
313
|
-
case
|
|
313
|
+
case 2:
|
|
314
314
|
params.id = _this.attributes.id;
|
|
315
315
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
316
|
-
_context.next =
|
|
316
|
+
_context.next = 3;
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
320
|
-
case
|
|
320
|
+
case 3:
|
|
321
321
|
if (params.id) {
|
|
322
|
-
_context.next =
|
|
322
|
+
_context.next = 5;
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
325
|
if (!_this.attributes.id) {
|
|
326
|
-
_context.next =
|
|
326
|
+
_context.next = 4;
|
|
327
327
|
break;
|
|
328
328
|
}
|
|
329
329
|
params.id = _this.id;
|
|
330
|
-
_context.next =
|
|
330
|
+
_context.next = 5;
|
|
331
331
|
break;
|
|
332
|
-
case
|
|
332
|
+
case 4:
|
|
333
333
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
334
|
-
case
|
|
335
|
-
_context.next =
|
|
334
|
+
case 5:
|
|
335
|
+
_context.next = 6;
|
|
336
336
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id), "/manual_run"), 'POST', params, _this.options);
|
|
337
|
-
case
|
|
337
|
+
case 6:
|
|
338
338
|
case "end":
|
|
339
339
|
return _context.stop();
|
|
340
340
|
}
|
|
@@ -375,187 +375,187 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
375
375
|
var params,
|
|
376
376
|
response,
|
|
377
377
|
_args2 = arguments;
|
|
378
|
-
return _regenerator.default.wrap(function
|
|
378
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
379
379
|
while (1) switch (_context2.prev = _context2.next) {
|
|
380
380
|
case 0:
|
|
381
381
|
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
382
382
|
if (_this.attributes.id) {
|
|
383
|
-
_context2.next =
|
|
383
|
+
_context2.next = 1;
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
386
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
387
|
-
case
|
|
387
|
+
case 1:
|
|
388
388
|
if ((0, _utils.isObject)(params)) {
|
|
389
|
-
_context2.next =
|
|
389
|
+
_context2.next = 2;
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
392
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
393
|
-
case
|
|
393
|
+
case 2:
|
|
394
394
|
params.id = _this.attributes.id;
|
|
395
395
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
396
|
-
_context2.next =
|
|
396
|
+
_context2.next = 3;
|
|
397
397
|
break;
|
|
398
398
|
}
|
|
399
399
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
400
|
-
case
|
|
400
|
+
case 3:
|
|
401
401
|
if (!(params.source && !(0, _utils.isString)(params.source))) {
|
|
402
|
-
_context2.next =
|
|
402
|
+
_context2.next = 4;
|
|
403
403
|
break;
|
|
404
404
|
}
|
|
405
405
|
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params.source)));
|
|
406
|
-
case
|
|
406
|
+
case 4:
|
|
407
407
|
if (!(params.destinations && !(0, _utils.isArray)(params.destinations))) {
|
|
408
|
-
_context2.next =
|
|
408
|
+
_context2.next = 5;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params.destinations)));
|
|
412
|
-
case
|
|
412
|
+
case 5:
|
|
413
413
|
if (!(params.destination_replace_from && !(0, _utils.isString)(params.destination_replace_from))) {
|
|
414
|
-
_context2.next =
|
|
414
|
+
_context2.next = 6;
|
|
415
415
|
break;
|
|
416
416
|
}
|
|
417
417
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_from)));
|
|
418
|
-
case
|
|
418
|
+
case 6:
|
|
419
419
|
if (!(params.destination_replace_to && !(0, _utils.isString)(params.destination_replace_to))) {
|
|
420
|
-
_context2.next =
|
|
420
|
+
_context2.next = 7;
|
|
421
421
|
break;
|
|
422
422
|
}
|
|
423
423
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_to)));
|
|
424
|
-
case
|
|
424
|
+
case 7:
|
|
425
425
|
if (!(params.interval && !(0, _utils.isString)(params.interval))) {
|
|
426
|
-
_context2.next =
|
|
426
|
+
_context2.next = 8;
|
|
427
427
|
break;
|
|
428
428
|
}
|
|
429
429
|
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
|
|
430
|
-
case
|
|
430
|
+
case 8:
|
|
431
431
|
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
432
|
-
_context2.next =
|
|
432
|
+
_context2.next = 9;
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
435
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
436
|
-
case
|
|
436
|
+
case 9:
|
|
437
437
|
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
|
438
|
-
_context2.next =
|
|
438
|
+
_context2.next = 10;
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
441
|
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
|
442
|
-
case
|
|
442
|
+
case 10:
|
|
443
443
|
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
444
|
-
_context2.next =
|
|
444
|
+
_context2.next = 11;
|
|
445
445
|
break;
|
|
446
446
|
}
|
|
447
447
|
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
448
|
-
case
|
|
448
|
+
case 11:
|
|
449
449
|
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
|
450
|
-
_context2.next =
|
|
450
|
+
_context2.next = 12;
|
|
451
451
|
break;
|
|
452
452
|
}
|
|
453
453
|
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
|
454
|
-
case
|
|
454
|
+
case 12:
|
|
455
455
|
if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
|
|
456
|
-
_context2.next =
|
|
456
|
+
_context2.next = 13;
|
|
457
457
|
break;
|
|
458
458
|
}
|
|
459
459
|
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)));
|
|
460
|
-
case
|
|
460
|
+
case 13:
|
|
461
461
|
if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
|
|
462
|
-
_context2.next =
|
|
462
|
+
_context2.next = 14;
|
|
463
463
|
break;
|
|
464
464
|
}
|
|
465
465
|
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)));
|
|
466
|
-
case
|
|
466
|
+
case 14:
|
|
467
467
|
if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
|
|
468
|
-
_context2.next =
|
|
468
|
+
_context2.next = 15;
|
|
469
469
|
break;
|
|
470
470
|
}
|
|
471
471
|
throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
|
|
472
|
-
case
|
|
472
|
+
case 15:
|
|
473
473
|
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
474
|
-
_context2.next =
|
|
474
|
+
_context2.next = 16;
|
|
475
475
|
break;
|
|
476
476
|
}
|
|
477
477
|
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
478
|
-
case
|
|
478
|
+
case 16:
|
|
479
479
|
if (!(params.exclude_pattern && !(0, _utils.isString)(params.exclude_pattern))) {
|
|
480
|
-
_context2.next =
|
|
480
|
+
_context2.next = 17;
|
|
481
481
|
break;
|
|
482
482
|
}
|
|
483
483
|
throw new errors.InvalidParameterError("Bad parameter: exclude_pattern must be of type String, received ".concat((0, _utils.getType)(params.exclude_pattern)));
|
|
484
|
-
case
|
|
484
|
+
case 17:
|
|
485
485
|
if (!(params.import_urls && !(0, _utils.isArray)(params.import_urls))) {
|
|
486
|
-
_context2.next =
|
|
486
|
+
_context2.next = 18;
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
489
|
throw new errors.InvalidParameterError("Bad parameter: import_urls must be of type Array, received ".concat((0, _utils.getType)(params.import_urls)));
|
|
490
|
-
case
|
|
490
|
+
case 18:
|
|
491
491
|
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
492
|
-
_context2.next =
|
|
492
|
+
_context2.next = 19;
|
|
493
493
|
break;
|
|
494
494
|
}
|
|
495
495
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
496
|
-
case
|
|
496
|
+
case 19:
|
|
497
497
|
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
|
498
|
-
_context2.next =
|
|
498
|
+
_context2.next = 20;
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
501
501
|
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
|
502
|
-
case
|
|
502
|
+
case 20:
|
|
503
503
|
if (!(params.retry_on_failure_interval_in_minutes && !(0, _utils.isInt)(params.retry_on_failure_interval_in_minutes))) {
|
|
504
|
-
_context2.next =
|
|
504
|
+
_context2.next = 21;
|
|
505
505
|
break;
|
|
506
506
|
}
|
|
507
507
|
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_interval_in_minutes must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_interval_in_minutes)));
|
|
508
|
-
case
|
|
508
|
+
case 21:
|
|
509
509
|
if (!(params.retry_on_failure_number_of_attempts && !(0, _utils.isInt)(params.retry_on_failure_number_of_attempts))) {
|
|
510
|
-
_context2.next =
|
|
510
|
+
_context2.next = 22;
|
|
511
511
|
break;
|
|
512
512
|
}
|
|
513
513
|
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_number_of_attempts must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_number_of_attempts)));
|
|
514
|
-
case
|
|
514
|
+
case 22:
|
|
515
515
|
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
|
516
|
-
_context2.next =
|
|
516
|
+
_context2.next = 23;
|
|
517
517
|
break;
|
|
518
518
|
}
|
|
519
519
|
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
|
520
|
-
case
|
|
520
|
+
case 23:
|
|
521
521
|
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
|
522
|
-
_context2.next =
|
|
522
|
+
_context2.next = 24;
|
|
523
523
|
break;
|
|
524
524
|
}
|
|
525
525
|
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
|
526
|
-
case
|
|
526
|
+
case 24:
|
|
527
527
|
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
|
528
|
-
_context2.next =
|
|
528
|
+
_context2.next = 25;
|
|
529
529
|
break;
|
|
530
530
|
}
|
|
531
531
|
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
|
532
|
-
case
|
|
532
|
+
case 25:
|
|
533
533
|
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
|
534
|
-
_context2.next =
|
|
534
|
+
_context2.next = 26;
|
|
535
535
|
break;
|
|
536
536
|
}
|
|
537
537
|
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
|
538
|
-
case
|
|
538
|
+
case 26:
|
|
539
539
|
if (params.id) {
|
|
540
|
-
_context2.next =
|
|
540
|
+
_context2.next = 28;
|
|
541
541
|
break;
|
|
542
542
|
}
|
|
543
543
|
if (!_this.attributes.id) {
|
|
544
|
-
_context2.next =
|
|
544
|
+
_context2.next = 27;
|
|
545
545
|
break;
|
|
546
546
|
}
|
|
547
547
|
params.id = _this.id;
|
|
548
|
-
_context2.next =
|
|
548
|
+
_context2.next = 28;
|
|
549
549
|
break;
|
|
550
|
-
case
|
|
550
|
+
case 27:
|
|
551
551
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
552
|
-
case
|
|
553
|
-
_context2.next =
|
|
552
|
+
case 28:
|
|
553
|
+
_context2.next = 29;
|
|
554
554
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
555
|
-
case
|
|
555
|
+
case 29:
|
|
556
556
|
response = _context2.sent;
|
|
557
557
|
return _context2.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
558
|
-
case
|
|
558
|
+
case 30:
|
|
559
559
|
case "end":
|
|
560
560
|
return _context2.stop();
|
|
561
561
|
}
|
|
@@ -564,46 +564,46 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
564
564
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
565
565
|
var params,
|
|
566
566
|
_args3 = arguments;
|
|
567
|
-
return _regenerator.default.wrap(function
|
|
567
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
568
568
|
while (1) switch (_context3.prev = _context3.next) {
|
|
569
569
|
case 0:
|
|
570
570
|
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
571
571
|
if (_this.attributes.id) {
|
|
572
|
-
_context3.next =
|
|
572
|
+
_context3.next = 1;
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
575
575
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
576
|
-
case
|
|
576
|
+
case 1:
|
|
577
577
|
if ((0, _utils.isObject)(params)) {
|
|
578
|
-
_context3.next =
|
|
578
|
+
_context3.next = 2;
|
|
579
579
|
break;
|
|
580
580
|
}
|
|
581
581
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
582
|
-
case
|
|
582
|
+
case 2:
|
|
583
583
|
params.id = _this.attributes.id;
|
|
584
584
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
585
|
-
_context3.next =
|
|
585
|
+
_context3.next = 3;
|
|
586
586
|
break;
|
|
587
587
|
}
|
|
588
588
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
589
|
-
case
|
|
589
|
+
case 3:
|
|
590
590
|
if (params.id) {
|
|
591
|
-
_context3.next =
|
|
591
|
+
_context3.next = 5;
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
594
594
|
if (!_this.attributes.id) {
|
|
595
|
-
_context3.next =
|
|
595
|
+
_context3.next = 4;
|
|
596
596
|
break;
|
|
597
597
|
}
|
|
598
598
|
params.id = _this.id;
|
|
599
|
-
_context3.next =
|
|
599
|
+
_context3.next = 5;
|
|
600
600
|
break;
|
|
601
|
-
case
|
|
601
|
+
case 4:
|
|
602
602
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
603
|
-
case
|
|
604
|
-
_context3.next =
|
|
603
|
+
case 5:
|
|
604
|
+
_context3.next = 6;
|
|
605
605
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
606
|
-
case
|
|
606
|
+
case 6:
|
|
607
607
|
case "end":
|
|
608
608
|
return _context3.stop();
|
|
609
609
|
}
|
|
@@ -615,27 +615,27 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
615
615
|
});
|
|
616
616
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
617
617
|
var _newObject, newObject;
|
|
618
|
-
return _regenerator.default.wrap(function
|
|
618
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
619
619
|
while (1) switch (_context4.prev = _context4.next) {
|
|
620
620
|
case 0:
|
|
621
621
|
if (!_this.attributes.id) {
|
|
622
|
-
_context4.next =
|
|
622
|
+
_context4.next = 2;
|
|
623
623
|
break;
|
|
624
624
|
}
|
|
625
|
-
_context4.next =
|
|
625
|
+
_context4.next = 1;
|
|
626
626
|
return _this.update(_this.attributes);
|
|
627
|
-
case
|
|
627
|
+
case 1:
|
|
628
628
|
_newObject = _context4.sent;
|
|
629
629
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
630
630
|
return _context4.abrupt("return", true);
|
|
631
|
-
case
|
|
632
|
-
_context4.next =
|
|
631
|
+
case 2:
|
|
632
|
+
_context4.next = 3;
|
|
633
633
|
return Automation.create(_this.attributes, _this.options);
|
|
634
|
-
case
|
|
634
|
+
case 3:
|
|
635
635
|
newObject = _context4.sent;
|
|
636
636
|
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
637
637
|
return _context4.abrupt("return", true);
|
|
638
|
-
case
|
|
638
|
+
case 4:
|
|
639
639
|
case "end":
|
|
640
640
|
return _context4.stop();
|
|
641
641
|
}
|
|
@@ -670,31 +670,31 @@ _Automation = Automation;
|
|
|
670
670
|
options,
|
|
671
671
|
response,
|
|
672
672
|
_args5 = arguments;
|
|
673
|
-
return _regenerator.default.wrap(function
|
|
673
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
674
674
|
while (1) switch (_context5.prev = _context5.next) {
|
|
675
675
|
case 0:
|
|
676
676
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
677
677
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
678
678
|
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
679
|
-
_context5.next =
|
|
679
|
+
_context5.next = 1;
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
683
|
-
case
|
|
683
|
+
case 1:
|
|
684
684
|
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
685
|
-
_context5.next =
|
|
685
|
+
_context5.next = 2;
|
|
686
686
|
break;
|
|
687
687
|
}
|
|
688
688
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
689
|
-
case
|
|
690
|
-
_context5.next =
|
|
689
|
+
case 2:
|
|
690
|
+
_context5.next = 3;
|
|
691
691
|
return _Api.default.sendRequest('/automations', 'GET', params, options);
|
|
692
|
-
case
|
|
692
|
+
case 3:
|
|
693
693
|
response = _context5.sent;
|
|
694
694
|
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) {
|
|
695
695
|
return new _Automation(obj, options);
|
|
696
696
|
})) || []);
|
|
697
|
-
case
|
|
697
|
+
case 4:
|
|
698
698
|
case "end":
|
|
699
699
|
return _context5.stop();
|
|
700
700
|
}
|
|
@@ -713,36 +713,36 @@ _Automation = Automation;
|
|
|
713
713
|
options,
|
|
714
714
|
response,
|
|
715
715
|
_args6 = arguments;
|
|
716
|
-
return _regenerator.default.wrap(function
|
|
716
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
717
717
|
while (1) switch (_context6.prev = _context6.next) {
|
|
718
718
|
case 0:
|
|
719
719
|
params = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
720
720
|
options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
|
721
721
|
if ((0, _utils.isObject)(params)) {
|
|
722
|
-
_context6.next =
|
|
722
|
+
_context6.next = 1;
|
|
723
723
|
break;
|
|
724
724
|
}
|
|
725
725
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
726
|
-
case
|
|
726
|
+
case 1:
|
|
727
727
|
params.id = id;
|
|
728
728
|
if (params.id) {
|
|
729
|
-
_context6.next =
|
|
729
|
+
_context6.next = 2;
|
|
730
730
|
break;
|
|
731
731
|
}
|
|
732
732
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
733
|
-
case
|
|
733
|
+
case 2:
|
|
734
734
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
735
|
-
_context6.next =
|
|
735
|
+
_context6.next = 3;
|
|
736
736
|
break;
|
|
737
737
|
}
|
|
738
738
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
739
|
-
case
|
|
740
|
-
_context6.next =
|
|
739
|
+
case 3:
|
|
740
|
+
_context6.next = 4;
|
|
741
741
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
742
|
-
case
|
|
742
|
+
case 4:
|
|
743
743
|
response = _context6.sent;
|
|
744
744
|
return _context6.abrupt("return", new _Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
|
745
|
-
case
|
|
745
|
+
case 5:
|
|
746
746
|
case "end":
|
|
747
747
|
return _context6.stop();
|
|
748
748
|
}
|
|
@@ -793,161 +793,161 @@ _Automation = Automation;
|
|
|
793
793
|
options,
|
|
794
794
|
response,
|
|
795
795
|
_args7 = arguments;
|
|
796
|
-
return _regenerator.default.wrap(function
|
|
796
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
797
797
|
while (1) switch (_context7.prev = _context7.next) {
|
|
798
798
|
case 0:
|
|
799
799
|
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
|
800
800
|
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
801
801
|
if (params.automation) {
|
|
802
|
-
_context7.next =
|
|
802
|
+
_context7.next = 1;
|
|
803
803
|
break;
|
|
804
804
|
}
|
|
805
805
|
throw new errors.MissingParameterError('Parameter missing: automation');
|
|
806
|
-
case
|
|
806
|
+
case 1:
|
|
807
807
|
if (!(params.source && !(0, _utils.isString)(params.source))) {
|
|
808
|
-
_context7.next =
|
|
808
|
+
_context7.next = 2;
|
|
809
809
|
break;
|
|
810
810
|
}
|
|
811
811
|
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params.source)));
|
|
812
|
-
case
|
|
812
|
+
case 2:
|
|
813
813
|
if (!(params.destinations && !(0, _utils.isArray)(params.destinations))) {
|
|
814
|
-
_context7.next =
|
|
814
|
+
_context7.next = 3;
|
|
815
815
|
break;
|
|
816
816
|
}
|
|
817
817
|
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params.destinations)));
|
|
818
|
-
case
|
|
818
|
+
case 3:
|
|
819
819
|
if (!(params.destination_replace_from && !(0, _utils.isString)(params.destination_replace_from))) {
|
|
820
|
-
_context7.next =
|
|
820
|
+
_context7.next = 4;
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
823
823
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_from)));
|
|
824
|
-
case
|
|
824
|
+
case 4:
|
|
825
825
|
if (!(params.destination_replace_to && !(0, _utils.isString)(params.destination_replace_to))) {
|
|
826
|
-
_context7.next =
|
|
826
|
+
_context7.next = 5;
|
|
827
827
|
break;
|
|
828
828
|
}
|
|
829
829
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_to)));
|
|
830
|
-
case
|
|
830
|
+
case 5:
|
|
831
831
|
if (!(params.interval && !(0, _utils.isString)(params.interval))) {
|
|
832
|
-
_context7.next =
|
|
832
|
+
_context7.next = 6;
|
|
833
833
|
break;
|
|
834
834
|
}
|
|
835
835
|
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
|
|
836
|
-
case
|
|
836
|
+
case 6:
|
|
837
837
|
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
838
|
-
_context7.next =
|
|
838
|
+
_context7.next = 7;
|
|
839
839
|
break;
|
|
840
840
|
}
|
|
841
841
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
842
|
-
case
|
|
842
|
+
case 7:
|
|
843
843
|
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
|
844
|
-
_context7.next =
|
|
844
|
+
_context7.next = 8;
|
|
845
845
|
break;
|
|
846
846
|
}
|
|
847
847
|
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
|
848
|
-
case
|
|
848
|
+
case 8:
|
|
849
849
|
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
850
|
-
_context7.next =
|
|
850
|
+
_context7.next = 9;
|
|
851
851
|
break;
|
|
852
852
|
}
|
|
853
853
|
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
854
|
-
case
|
|
854
|
+
case 9:
|
|
855
855
|
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
|
856
|
-
_context7.next =
|
|
856
|
+
_context7.next = 10;
|
|
857
857
|
break;
|
|
858
858
|
}
|
|
859
859
|
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
|
860
|
-
case
|
|
860
|
+
case 10:
|
|
861
861
|
if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
|
|
862
|
-
_context7.next =
|
|
862
|
+
_context7.next = 11;
|
|
863
863
|
break;
|
|
864
864
|
}
|
|
865
865
|
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)));
|
|
866
|
-
case
|
|
866
|
+
case 11:
|
|
867
867
|
if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
|
|
868
|
-
_context7.next =
|
|
868
|
+
_context7.next = 12;
|
|
869
869
|
break;
|
|
870
870
|
}
|
|
871
871
|
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)));
|
|
872
|
-
case
|
|
872
|
+
case 12:
|
|
873
873
|
if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
|
|
874
|
-
_context7.next =
|
|
874
|
+
_context7.next = 13;
|
|
875
875
|
break;
|
|
876
876
|
}
|
|
877
877
|
throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
|
|
878
|
-
case
|
|
878
|
+
case 13:
|
|
879
879
|
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
880
|
-
_context7.next =
|
|
880
|
+
_context7.next = 14;
|
|
881
881
|
break;
|
|
882
882
|
}
|
|
883
883
|
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
884
|
-
case
|
|
884
|
+
case 14:
|
|
885
885
|
if (!(params.exclude_pattern && !(0, _utils.isString)(params.exclude_pattern))) {
|
|
886
|
-
_context7.next =
|
|
886
|
+
_context7.next = 15;
|
|
887
887
|
break;
|
|
888
888
|
}
|
|
889
889
|
throw new errors.InvalidParameterError("Bad parameter: exclude_pattern must be of type String, received ".concat((0, _utils.getType)(params.exclude_pattern)));
|
|
890
|
-
case
|
|
890
|
+
case 15:
|
|
891
891
|
if (!(params.import_urls && !(0, _utils.isArray)(params.import_urls))) {
|
|
892
|
-
_context7.next =
|
|
892
|
+
_context7.next = 16;
|
|
893
893
|
break;
|
|
894
894
|
}
|
|
895
895
|
throw new errors.InvalidParameterError("Bad parameter: import_urls must be of type Array, received ".concat((0, _utils.getType)(params.import_urls)));
|
|
896
|
-
case
|
|
896
|
+
case 16:
|
|
897
897
|
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
898
|
-
_context7.next =
|
|
898
|
+
_context7.next = 17;
|
|
899
899
|
break;
|
|
900
900
|
}
|
|
901
901
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
902
|
-
case
|
|
902
|
+
case 17:
|
|
903
903
|
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
|
904
|
-
_context7.next =
|
|
904
|
+
_context7.next = 18;
|
|
905
905
|
break;
|
|
906
906
|
}
|
|
907
907
|
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
|
908
|
-
case
|
|
908
|
+
case 18:
|
|
909
909
|
if (!(params.retry_on_failure_interval_in_minutes && !(0, _utils.isInt)(params.retry_on_failure_interval_in_minutes))) {
|
|
910
|
-
_context7.next =
|
|
910
|
+
_context7.next = 19;
|
|
911
911
|
break;
|
|
912
912
|
}
|
|
913
913
|
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_interval_in_minutes must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_interval_in_minutes)));
|
|
914
|
-
case
|
|
914
|
+
case 19:
|
|
915
915
|
if (!(params.retry_on_failure_number_of_attempts && !(0, _utils.isInt)(params.retry_on_failure_number_of_attempts))) {
|
|
916
|
-
_context7.next =
|
|
916
|
+
_context7.next = 20;
|
|
917
917
|
break;
|
|
918
918
|
}
|
|
919
919
|
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_number_of_attempts must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_number_of_attempts)));
|
|
920
|
-
case
|
|
920
|
+
case 20:
|
|
921
921
|
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
|
922
|
-
_context7.next =
|
|
922
|
+
_context7.next = 21;
|
|
923
923
|
break;
|
|
924
924
|
}
|
|
925
925
|
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
|
926
|
-
case
|
|
926
|
+
case 21:
|
|
927
927
|
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
|
928
|
-
_context7.next =
|
|
928
|
+
_context7.next = 22;
|
|
929
929
|
break;
|
|
930
930
|
}
|
|
931
931
|
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
|
932
|
-
case
|
|
932
|
+
case 22:
|
|
933
933
|
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
|
934
|
-
_context7.next =
|
|
934
|
+
_context7.next = 23;
|
|
935
935
|
break;
|
|
936
936
|
}
|
|
937
937
|
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
|
938
|
-
case
|
|
938
|
+
case 23:
|
|
939
939
|
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
|
940
|
-
_context7.next =
|
|
940
|
+
_context7.next = 24;
|
|
941
941
|
break;
|
|
942
942
|
}
|
|
943
943
|
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
|
944
|
-
case
|
|
945
|
-
_context7.next =
|
|
944
|
+
case 24:
|
|
945
|
+
_context7.next = 25;
|
|
946
946
|
return _Api.default.sendRequest('/automations', 'POST', params, options);
|
|
947
|
-
case
|
|
947
|
+
case 25:
|
|
948
948
|
response = _context7.sent;
|
|
949
949
|
return _context7.abrupt("return", new _Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
|
950
|
-
case
|
|
950
|
+
case 26:
|
|
951
951
|
case "end":
|
|
952
952
|
return _context7.stop();
|
|
953
953
|
}
|