files.com 1.0.474 → 1.1.1
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/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +63 -49
- package/lib/models/ActionWebhookFailure.js +1 -1
- package/lib/models/ApiKey.js +113 -94
- package/lib/models/As2Partner.js +81 -62
- package/lib/models/As2Station.js +79 -60
- package/lib/models/Automation.js +90 -71
- package/lib/models/Behavior.js +114 -95
- package/lib/models/Bundle.js +90 -71
- package/lib/models/BundleNotification.js +75 -56
- package/lib/models/BundleRecipient.js +61 -47
- package/lib/models/Clickwrap.js +77 -58
- package/lib/models/ExternalEvent.js +71 -57
- package/lib/models/File.js +166 -154
- package/lib/models/FileComment.js +65 -46
- package/lib/models/FileCommentReaction.js +44 -30
- package/lib/models/Folder.js +58 -46
- package/lib/models/FormFieldSet.js +76 -57
- package/lib/models/GpgKey.js +79 -60
- package/lib/models/Group.js +78 -59
- package/lib/models/GroupUser.js +63 -44
- package/lib/models/HistoryExport.js +76 -62
- package/lib/models/InboxRecipient.js +61 -47
- package/lib/models/Lock.js +56 -44
- package/lib/models/Message.js +82 -63
- package/lib/models/MessageComment.js +78 -59
- package/lib/models/MessageCommentReaction.js +73 -59
- package/lib/models/MessageReaction.js +73 -59
- package/lib/models/Notification.js +84 -65
- package/lib/models/Permission.js +60 -46
- package/lib/models/Project.js +74 -55
- package/lib/models/PublicKey.js +78 -59
- package/lib/models/RemoteServer.js +147 -128
- package/lib/models/Request.js +76 -62
- package/lib/models/Session.js +53 -39
- package/lib/models/SftpHostKey.js +74 -55
- package/lib/models/ShareGroup.js +79 -60
- package/lib/models/Snapshot.js +75 -56
- package/lib/models/SsoStrategy.js +1 -1
- package/lib/models/Style.js +37 -23
- package/lib/models/User.js +104 -85
- package/lib/models/UserRequest.js +73 -59
- package/lib/models/WebhookTest.js +46 -32
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ActionNotificationExport.js +2 -2
- package/src/models/ActionWebhookFailure.js +1 -1
- package/src/models/ApiKey.js +7 -5
- package/src/models/As2Partner.js +6 -4
- package/src/models/As2Station.js +6 -4
- package/src/models/Automation.js +7 -5
- package/src/models/Behavior.js +7 -5
- package/src/models/Bundle.js +7 -5
- package/src/models/BundleNotification.js +6 -4
- package/src/models/BundleRecipient.js +2 -2
- package/src/models/Clickwrap.js +6 -4
- package/src/models/ExternalEvent.js +2 -2
- package/src/models/File.js +3 -3
- package/src/models/FileComment.js +6 -4
- package/src/models/FileCommentReaction.js +3 -3
- package/src/models/Folder.js +2 -2
- package/src/models/FormFieldSet.js +6 -4
- package/src/models/GpgKey.js +6 -4
- package/src/models/Group.js +6 -4
- package/src/models/GroupUser.js +6 -4
- package/src/models/HistoryExport.js +2 -2
- package/src/models/InboxRecipient.js +2 -2
- package/src/models/Lock.js +3 -3
- package/src/models/Message.js +6 -4
- package/src/models/MessageComment.js +6 -4
- package/src/models/MessageCommentReaction.js +3 -3
- package/src/models/MessageReaction.js +3 -3
- package/src/models/Notification.js +6 -4
- package/src/models/Permission.js +3 -3
- package/src/models/Project.js +6 -4
- package/src/models/PublicKey.js +6 -4
- package/src/models/RemoteServer.js +6 -4
- package/src/models/Request.js +3 -3
- package/src/models/Session.js +3 -3
- package/src/models/SftpHostKey.js +6 -4
- package/src/models/ShareGroup.js +6 -4
- package/src/models/Snapshot.js +6 -4
- package/src/models/SsoStrategy.js +1 -1
- package/src/models/Style.js +6 -3
- package/src/models/User.js +9 -7
- package/src/models/UserRequest.js +3 -3
- package/src/models/WebhookTest.js +2 -2
package/lib/models/Automation.js
CHANGED
@@ -247,7 +247,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
247
247
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id']), "/manual_run"), 'POST', params, _this.options);
|
248
248
|
case 16:
|
249
249
|
response = _context.sent;
|
250
|
-
return _context.abrupt("return"
|
250
|
+
return _context.abrupt("return");
|
251
251
|
case 18:
|
252
252
|
case "end":
|
253
253
|
return _context.stop();
|
@@ -467,7 +467,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
467
467
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
468
468
|
case 16:
|
469
469
|
response = _context3.sent;
|
470
|
-
return _context3.abrupt("return"
|
470
|
+
return _context3.abrupt("return");
|
471
471
|
case 18:
|
472
472
|
case "end":
|
473
473
|
return _context3.stop();
|
@@ -478,19 +478,38 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
478
478
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
479
479
|
return _this.delete(params);
|
480
480
|
});
|
481
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
481
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
482
|
+
var newObject, _newObject;
|
483
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
484
|
+
while (1) switch (_context4.prev = _context4.next) {
|
485
|
+
case 0:
|
486
|
+
if (!_this.attributes['id']) {
|
487
|
+
_context4.next = 8;
|
488
|
+
break;
|
489
|
+
}
|
490
|
+
_context4.next = 3;
|
491
|
+
return _this.update(_this.attributes);
|
492
|
+
case 3:
|
493
|
+
newObject = _context4.sent;
|
494
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
495
|
+
return _context4.abrupt("return", true);
|
496
|
+
case 8:
|
497
|
+
_context4.next = 10;
|
498
|
+
return Automation.create(_this.attributes, _this.options);
|
499
|
+
case 10:
|
500
|
+
_newObject = _context4.sent;
|
501
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
502
|
+
return _context4.abrupt("return", true);
|
503
|
+
case 13:
|
504
|
+
case "end":
|
505
|
+
return _context4.stop();
|
506
|
+
}
|
507
|
+
}, _callee4);
|
508
|
+
})));
|
509
|
+
Object.entries(attributes).forEach(function (_ref5) {
|
510
|
+
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
|
511
|
+
key = _ref6[0],
|
512
|
+
value = _ref6[1];
|
494
513
|
var normalizedKey = key.replace('?', '');
|
495
514
|
_this.attributes[normalizedKey] = value;
|
496
515
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -511,41 +530,41 @@ _class = Automation;
|
|
511
530
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `last_modified_at`.
|
512
531
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `last_modified_at`.
|
513
532
|
// with_deleted - boolean - Set to true to include deleted automations in the results.
|
514
|
-
(0, _defineProperty2.default)(Automation, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
533
|
+
(0, _defineProperty2.default)(Automation, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
515
534
|
var _response$data;
|
516
535
|
var params,
|
517
536
|
options,
|
518
537
|
response,
|
519
|
-
|
520
|
-
return _regenerator.default.wrap(function
|
521
|
-
while (1) switch (
|
538
|
+
_args5 = arguments;
|
539
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
540
|
+
while (1) switch (_context5.prev = _context5.next) {
|
522
541
|
case 0:
|
523
|
-
params =
|
524
|
-
options =
|
542
|
+
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
543
|
+
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
525
544
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
526
|
-
|
545
|
+
_context5.next = 4;
|
527
546
|
break;
|
528
547
|
}
|
529
548
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
530
549
|
case 4:
|
531
550
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
532
|
-
|
551
|
+
_context5.next = 6;
|
533
552
|
break;
|
534
553
|
}
|
535
554
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
536
555
|
case 6:
|
537
|
-
|
556
|
+
_context5.next = 8;
|
538
557
|
return _Api.default.sendRequest("/automations", 'GET', params, options);
|
539
558
|
case 8:
|
540
|
-
response =
|
541
|
-
return
|
559
|
+
response = _context5.sent;
|
560
|
+
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) {
|
542
561
|
return new _class(obj, options);
|
543
562
|
})) || []);
|
544
563
|
case 10:
|
545
564
|
case "end":
|
546
|
-
return
|
565
|
+
return _context5.stop();
|
547
566
|
}
|
548
|
-
},
|
567
|
+
}, _callee5);
|
549
568
|
})));
|
550
569
|
(0, _defineProperty2.default)(Automation, "all", function () {
|
551
570
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -555,48 +574,48 @@ _class = Automation;
|
|
555
574
|
// Parameters:
|
556
575
|
// id (required) - int64 - Automation ID.
|
557
576
|
(0, _defineProperty2.default)(Automation, "find", /*#__PURE__*/function () {
|
558
|
-
var
|
577
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(id) {
|
559
578
|
var params,
|
560
579
|
options,
|
561
580
|
response,
|
562
|
-
|
563
|
-
return _regenerator.default.wrap(function
|
564
|
-
while (1) switch (
|
581
|
+
_args6 = arguments;
|
582
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
583
|
+
while (1) switch (_context6.prev = _context6.next) {
|
565
584
|
case 0:
|
566
|
-
params =
|
567
|
-
options =
|
585
|
+
params = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
586
|
+
options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
568
587
|
if ((0, _utils.isObject)(params)) {
|
569
|
-
|
588
|
+
_context6.next = 4;
|
570
589
|
break;
|
571
590
|
}
|
572
591
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
573
592
|
case 4:
|
574
593
|
params['id'] = id;
|
575
594
|
if (params['id']) {
|
576
|
-
|
595
|
+
_context6.next = 7;
|
577
596
|
break;
|
578
597
|
}
|
579
598
|
throw new errors.MissingParameterError('Parameter missing: id');
|
580
599
|
case 7:
|
581
600
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
582
|
-
|
601
|
+
_context6.next = 9;
|
583
602
|
break;
|
584
603
|
}
|
585
604
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
586
605
|
case 9:
|
587
|
-
|
606
|
+
_context6.next = 11;
|
588
607
|
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
589
608
|
case 11:
|
590
|
-
response =
|
591
|
-
return
|
609
|
+
response = _context6.sent;
|
610
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
592
611
|
case 13:
|
593
612
|
case "end":
|
594
|
-
return
|
613
|
+
return _context6.stop();
|
595
614
|
}
|
596
|
-
},
|
615
|
+
}, _callee6);
|
597
616
|
}));
|
598
617
|
return function (_x) {
|
599
|
-
return
|
618
|
+
return _ref8.apply(this, arguments);
|
600
619
|
};
|
601
620
|
}());
|
602
621
|
(0, _defineProperty2.default)(Automation, "get", function (id) {
|
@@ -624,128 +643,128 @@ _class = Automation;
|
|
624
643
|
// value - object - A Hash of attributes specific to the automation type.
|
625
644
|
// recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
626
645
|
// automation (required) - string - Automation type
|
627
|
-
(0, _defineProperty2.default)(Automation, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
646
|
+
(0, _defineProperty2.default)(Automation, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
628
647
|
var params,
|
629
648
|
options,
|
630
649
|
response,
|
631
|
-
|
632
|
-
return _regenerator.default.wrap(function
|
633
|
-
while (1) switch (
|
650
|
+
_args7 = arguments;
|
651
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
652
|
+
while (1) switch (_context7.prev = _context7.next) {
|
634
653
|
case 0:
|
635
|
-
params =
|
636
|
-
options =
|
654
|
+
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
655
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
637
656
|
if (params['automation']) {
|
638
|
-
|
657
|
+
_context7.next = 4;
|
639
658
|
break;
|
640
659
|
}
|
641
660
|
throw new errors.MissingParameterError('Parameter missing: automation');
|
642
661
|
case 4:
|
643
662
|
if (!(params['source'] && !(0, _utils.isString)(params['source']))) {
|
644
|
-
|
663
|
+
_context7.next = 6;
|
645
664
|
break;
|
646
665
|
}
|
647
666
|
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params['source'])));
|
648
667
|
case 6:
|
649
668
|
if (!(params['destination'] && !(0, _utils.isString)(params['destination']))) {
|
650
|
-
|
669
|
+
_context7.next = 8;
|
651
670
|
break;
|
652
671
|
}
|
653
672
|
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params['destination'])));
|
654
673
|
case 8:
|
655
674
|
if (!(params['destinations'] && !(0, _utils.isArray)(params['destinations']))) {
|
656
|
-
|
675
|
+
_context7.next = 10;
|
657
676
|
break;
|
658
677
|
}
|
659
678
|
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params['destinations'])));
|
660
679
|
case 10:
|
661
680
|
if (!(params['destination_replace_from'] && !(0, _utils.isString)(params['destination_replace_from']))) {
|
662
|
-
|
681
|
+
_context7.next = 12;
|
663
682
|
break;
|
664
683
|
}
|
665
684
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_from'])));
|
666
685
|
case 12:
|
667
686
|
if (!(params['destination_replace_to'] && !(0, _utils.isString)(params['destination_replace_to']))) {
|
668
|
-
|
687
|
+
_context7.next = 14;
|
669
688
|
break;
|
670
689
|
}
|
671
690
|
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_to'])));
|
672
691
|
case 14:
|
673
692
|
if (!(params['interval'] && !(0, _utils.isString)(params['interval']))) {
|
674
|
-
|
693
|
+
_context7.next = 16;
|
675
694
|
break;
|
676
695
|
}
|
677
696
|
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params['interval'])));
|
678
697
|
case 16:
|
679
698
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
680
|
-
|
699
|
+
_context7.next = 18;
|
681
700
|
break;
|
682
701
|
}
|
683
702
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
684
703
|
case 18:
|
685
704
|
if (!(params['sync_ids'] && !(0, _utils.isString)(params['sync_ids']))) {
|
686
|
-
|
705
|
+
_context7.next = 20;
|
687
706
|
break;
|
688
707
|
}
|
689
708
|
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params['sync_ids'])));
|
690
709
|
case 20:
|
691
710
|
if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
|
692
|
-
|
711
|
+
_context7.next = 22;
|
693
712
|
break;
|
694
713
|
}
|
695
714
|
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
|
696
715
|
case 22:
|
697
716
|
if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
|
698
|
-
|
717
|
+
_context7.next = 24;
|
699
718
|
break;
|
700
719
|
}
|
701
720
|
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
|
702
721
|
case 24:
|
703
722
|
if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
|
704
|
-
|
723
|
+
_context7.next = 26;
|
705
724
|
break;
|
706
725
|
}
|
707
726
|
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
|
708
727
|
case 26:
|
709
728
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
710
|
-
|
729
|
+
_context7.next = 28;
|
711
730
|
break;
|
712
731
|
}
|
713
732
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
714
733
|
case 28:
|
715
734
|
if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
|
716
|
-
|
735
|
+
_context7.next = 30;
|
717
736
|
break;
|
718
737
|
}
|
719
738
|
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params['trigger'])));
|
720
739
|
case 30:
|
721
740
|
if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
|
722
|
-
|
741
|
+
_context7.next = 32;
|
723
742
|
break;
|
724
743
|
}
|
725
744
|
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
|
726
745
|
case 32:
|
727
746
|
if (!(params['recurring_day'] && !(0, _utils.isInt)(params['recurring_day']))) {
|
728
|
-
|
747
|
+
_context7.next = 34;
|
729
748
|
break;
|
730
749
|
}
|
731
750
|
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params['recurring_day'])));
|
732
751
|
case 34:
|
733
752
|
if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
|
734
|
-
|
753
|
+
_context7.next = 36;
|
735
754
|
break;
|
736
755
|
}
|
737
756
|
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
|
738
757
|
case 36:
|
739
|
-
|
758
|
+
_context7.next = 38;
|
740
759
|
return _Api.default.sendRequest("/automations", 'POST', params, options);
|
741
760
|
case 38:
|
742
|
-
response =
|
743
|
-
return
|
761
|
+
response = _context7.sent;
|
762
|
+
return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
744
763
|
case 40:
|
745
764
|
case "end":
|
746
|
-
return
|
765
|
+
return _context7.stop();
|
747
766
|
}
|
748
|
-
},
|
767
|
+
}, _callee7);
|
749
768
|
})));
|
750
769
|
var _default = exports.default = Automation;
|
751
770
|
module.exports = Automation;
|