files.com 1.2.236 → 1.2.238

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.
Files changed (106) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/Site.md +4 -0
  3. package/lib/Api.js +3 -4
  4. package/lib/Errors.js +964 -964
  5. package/lib/Files.js +1 -1
  6. package/lib/models/AccountLineItem.js +1 -2
  7. package/lib/models/Action.js +1 -2
  8. package/lib/models/ActionNotificationExport.js +1 -2
  9. package/lib/models/ActionNotificationExportResult.js +1 -2
  10. package/lib/models/ApiKey.js +1 -2
  11. package/lib/models/ApiRequestLog.js +1 -2
  12. package/lib/models/App.js +1 -2
  13. package/lib/models/As2IncomingMessage.js +1 -2
  14. package/lib/models/As2OutgoingMessage.js +1 -2
  15. package/lib/models/As2Partner.js +1 -2
  16. package/lib/models/As2Station.js +1 -2
  17. package/lib/models/Auto.js +1 -2
  18. package/lib/models/Automation.js +1 -2
  19. package/lib/models/AutomationLog.js +1 -2
  20. package/lib/models/AutomationRun.js +1 -2
  21. package/lib/models/BandwidthSnapshot.js +1 -2
  22. package/lib/models/Behavior.js +1 -2
  23. package/lib/models/Bundle.js +1 -2
  24. package/lib/models/BundleAction.js +1 -2
  25. package/lib/models/BundleDownload.js +1 -2
  26. package/lib/models/BundleNotification.js +1 -2
  27. package/lib/models/BundlePath.js +1 -2
  28. package/lib/models/BundleRecipient.js +1 -2
  29. package/lib/models/BundleRegistration.js +1 -2
  30. package/lib/models/Clickwrap.js +1 -2
  31. package/lib/models/DnsRecord.js +1 -2
  32. package/lib/models/EmailIncomingMessage.js +1 -2
  33. package/lib/models/EmailLog.js +1 -2
  34. package/lib/models/Errors.js +1 -2
  35. package/lib/models/ExavaultApiRequestLog.js +1 -2
  36. package/lib/models/ExternalEvent.js +1 -2
  37. package/lib/models/File.js +206 -207
  38. package/lib/models/FileAction.js +1 -2
  39. package/lib/models/FileComment.js +1 -2
  40. package/lib/models/FileCommentReaction.js +1 -2
  41. package/lib/models/FileMigration.js +1 -2
  42. package/lib/models/FileMigrationLog.js +1 -2
  43. package/lib/models/FileUploadPart.js +1 -2
  44. package/lib/models/Folder.js +1 -2
  45. package/lib/models/FormField.js +1 -2
  46. package/lib/models/FormFieldSet.js +1 -2
  47. package/lib/models/FtpActionLog.js +1 -2
  48. package/lib/models/GpgKey.js +1 -2
  49. package/lib/models/Group.js +1 -2
  50. package/lib/models/GroupUser.js +1 -2
  51. package/lib/models/History.js +1 -2
  52. package/lib/models/HistoryExport.js +1 -2
  53. package/lib/models/HistoryExportResult.js +1 -2
  54. package/lib/models/Image.js +1 -2
  55. package/lib/models/InboxRecipient.js +1 -2
  56. package/lib/models/InboxRegistration.js +1 -2
  57. package/lib/models/InboxUpload.js +1 -2
  58. package/lib/models/Invoice.js +1 -2
  59. package/lib/models/InvoiceLineItem.js +1 -2
  60. package/lib/models/IpAddress.js +1 -2
  61. package/lib/models/Lock.js +1 -2
  62. package/lib/models/Message.js +1 -2
  63. package/lib/models/MessageComment.js +1 -2
  64. package/lib/models/MessageCommentReaction.js +1 -2
  65. package/lib/models/MessageReaction.js +1 -2
  66. package/lib/models/Notification.js +1 -2
  67. package/lib/models/OutboundConnectionLog.js +1 -2
  68. package/lib/models/Payment.js +1 -2
  69. package/lib/models/PaymentLineItem.js +1 -2
  70. package/lib/models/Permission.js +1 -2
  71. package/lib/models/Preview.js +1 -2
  72. package/lib/models/Priority.js +1 -2
  73. package/lib/models/Project.js +1 -2
  74. package/lib/models/PublicHostingRequestLog.js +1 -2
  75. package/lib/models/PublicIpAddress.js +1 -2
  76. package/lib/models/PublicKey.js +1 -2
  77. package/lib/models/RemoteBandwidthSnapshot.js +1 -2
  78. package/lib/models/RemoteServer.js +1 -2
  79. package/lib/models/RemoteServerConfigurationFile.js +1 -2
  80. package/lib/models/Request.js +1 -2
  81. package/lib/models/Restore.js +1 -2
  82. package/lib/models/Session.js +1 -2
  83. package/lib/models/SettingsChange.js +1 -2
  84. package/lib/models/SftpActionLog.js +1 -2
  85. package/lib/models/SftpHostKey.js +1 -2
  86. package/lib/models/ShareGroup.js +1 -2
  87. package/lib/models/ShareGroupMember.js +1 -2
  88. package/lib/models/SiemHttpDestination.js +1 -2
  89. package/lib/models/Site.js +6 -2
  90. package/lib/models/Snapshot.js +1 -2
  91. package/lib/models/SsoStrategy.js +1 -2
  92. package/lib/models/Status.js +1 -2
  93. package/lib/models/Style.js +1 -2
  94. package/lib/models/SyncLog.js +1 -2
  95. package/lib/models/UsageByTopLevelDir.js +1 -2
  96. package/lib/models/UsageDailySnapshot.js +1 -2
  97. package/lib/models/UsageSnapshot.js +1 -2
  98. package/lib/models/User.js +3 -4
  99. package/lib/models/UserCipherUse.js +1 -2
  100. package/lib/models/UserRequest.js +1 -2
  101. package/lib/models/UserSftpClientUse.js +1 -2
  102. package/lib/models/WebDavActionLog.js +1 -2
  103. package/lib/models/WebhookTest.js +1 -2
  104. package/package.json +1 -1
  105. package/src/Files.js +1 -1
  106. package/src/models/Site.js +4 -0
@@ -19,8 +19,7 @@ var _utils = require("../utils");
19
19
  var _excluded = ["determinePartUploadUri"];
20
20
  var _File;
21
21
  /* eslint-disable no-unused-vars */
22
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
25
  /* eslint-enable no-unused-vars */
@@ -748,79 +747,79 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
748
747
  // Parameters:
749
748
  // destination (required) - string - Move destination path.
750
749
  // overwrite - boolean - Overwrite existing file(s) in the destination?
751
- (0, _defineProperty2.default)(this, "move", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
750
+ (0, _defineProperty2.default)(this, "move", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
752
751
  var params,
753
752
  response,
754
753
  FileAction,
755
- _args10 = arguments;
756
- return _regenerator.default.wrap(function _callee10$(_context10) {
757
- while (1) switch (_context10.prev = _context10.next) {
754
+ _args0 = arguments;
755
+ return _regenerator.default.wrap(function _callee0$(_context0) {
756
+ while (1) switch (_context0.prev = _context0.next) {
758
757
  case 0:
759
- params = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
758
+ params = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : {};
760
759
  if (_this.attributes.path) {
761
- _context10.next = 3;
760
+ _context0.next = 3;
762
761
  break;
763
762
  }
764
763
  throw new errors.EmptyPropertyError('Current object has no path');
765
764
  case 3:
766
765
  if ((0, _utils.isObject)(params)) {
767
- _context10.next = 5;
766
+ _context0.next = 5;
768
767
  break;
769
768
  }
770
769
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
771
770
  case 5:
772
771
  params.path = _this.attributes.path;
773
772
  if (!(params.path && !(0, _utils.isString)(params.path))) {
774
- _context10.next = 8;
773
+ _context0.next = 8;
775
774
  break;
776
775
  }
777
776
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
778
777
  case 8:
779
778
  if (!(params.destination && !(0, _utils.isString)(params.destination))) {
780
- _context10.next = 10;
779
+ _context0.next = 10;
781
780
  break;
782
781
  }
783
782
  throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
784
783
  case 10:
785
784
  if (params.path) {
786
- _context10.next = 16;
785
+ _context0.next = 16;
787
786
  break;
788
787
  }
789
788
  if (!_this.attributes.path) {
790
- _context10.next = 15;
789
+ _context0.next = 15;
791
790
  break;
792
791
  }
793
792
  params.path = _this.path;
794
- _context10.next = 16;
793
+ _context0.next = 16;
795
794
  break;
796
795
  case 15:
797
796
  throw new errors.MissingParameterError('Parameter missing: path');
798
797
  case 16:
799
798
  if (params.destination) {
800
- _context10.next = 22;
799
+ _context0.next = 22;
801
800
  break;
802
801
  }
803
802
  if (!_this.attributes.destination) {
804
- _context10.next = 21;
803
+ _context0.next = 21;
805
804
  break;
806
805
  }
807
806
  params.destination = _this.destination;
808
- _context10.next = 22;
807
+ _context0.next = 22;
809
808
  break;
810
809
  case 21:
811
810
  throw new errors.MissingParameterError('Parameter missing: destination');
812
811
  case 22:
813
- _context10.next = 24;
812
+ _context0.next = 24;
814
813
  return _Api.default.sendRequest("/file_actions/move/".concat(encodeURIComponent(params.path)), 'POST', params, _this.options);
815
814
  case 24:
816
- response = _context10.sent;
815
+ response = _context0.sent;
817
816
  FileAction = require('./FileAction.js').default;
818
- return _context10.abrupt("return", new FileAction(response === null || response === void 0 ? void 0 : response.data, _this.options));
817
+ return _context0.abrupt("return", new FileAction(response === null || response === void 0 ? void 0 : response.data, _this.options));
819
818
  case 27:
820
819
  case "end":
821
- return _context10.stop();
820
+ return _context0.stop();
822
821
  }
823
- }, _callee10);
822
+ }, _callee0);
824
823
  })));
825
824
  // Begin File Upload
826
825
  //
@@ -832,114 +831,114 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
832
831
  // restart - int64 - File byte offset to restart from.
833
832
  // size - int64 - Total bytes of file being uploaded (include bytes being retained if appending/restarting).
834
833
  // with_rename - boolean - Allow file rename instead of overwrite?
835
- (0, _defineProperty2.default)(this, "beginUpload", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
834
+ (0, _defineProperty2.default)(this, "beginUpload", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
836
835
  var _response$data;
837
836
  var params,
838
837
  response,
839
838
  FileUploadPart,
840
- _args11 = arguments;
841
- return _regenerator.default.wrap(function _callee11$(_context11) {
842
- while (1) switch (_context11.prev = _context11.next) {
839
+ _args1 = arguments;
840
+ return _regenerator.default.wrap(function _callee1$(_context1) {
841
+ while (1) switch (_context1.prev = _context1.next) {
843
842
  case 0:
844
- params = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
843
+ params = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : {};
845
844
  if (_this.attributes.path) {
846
- _context11.next = 3;
845
+ _context1.next = 3;
847
846
  break;
848
847
  }
849
848
  throw new errors.EmptyPropertyError('Current object has no path');
850
849
  case 3:
851
850
  if ((0, _utils.isObject)(params)) {
852
- _context11.next = 5;
851
+ _context1.next = 5;
853
852
  break;
854
853
  }
855
854
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
856
855
  case 5:
857
856
  params.path = _this.attributes.path;
858
857
  if (!(params.path && !(0, _utils.isString)(params.path))) {
859
- _context11.next = 8;
858
+ _context1.next = 8;
860
859
  break;
861
860
  }
862
861
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
863
862
  case 8:
864
863
  if (!(params.part && !(0, _utils.isInt)(params.part))) {
865
- _context11.next = 10;
864
+ _context1.next = 10;
866
865
  break;
867
866
  }
868
867
  throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params.part)));
869
868
  case 10:
870
869
  if (!(params.parts && !(0, _utils.isInt)(params.parts))) {
871
- _context11.next = 12;
870
+ _context1.next = 12;
872
871
  break;
873
872
  }
874
873
  throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params.parts)));
875
874
  case 12:
876
875
  if (!(params.ref && !(0, _utils.isString)(params.ref))) {
877
- _context11.next = 14;
876
+ _context1.next = 14;
878
877
  break;
879
878
  }
880
879
  throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params.ref)));
881
880
  case 14:
882
881
  if (!(params.restart && !(0, _utils.isInt)(params.restart))) {
883
- _context11.next = 16;
882
+ _context1.next = 16;
884
883
  break;
885
884
  }
886
885
  throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params.restart)));
887
886
  case 16:
888
887
  if (!(params.size && !(0, _utils.isInt)(params.size))) {
889
- _context11.next = 18;
888
+ _context1.next = 18;
890
889
  break;
891
890
  }
892
891
  throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params.size)));
893
892
  case 18:
894
893
  if (params.path) {
895
- _context11.next = 24;
894
+ _context1.next = 24;
896
895
  break;
897
896
  }
898
897
  if (!_this.attributes.path) {
899
- _context11.next = 23;
898
+ _context1.next = 23;
900
899
  break;
901
900
  }
902
901
  params.path = _this.path;
903
- _context11.next = 24;
902
+ _context1.next = 24;
904
903
  break;
905
904
  case 23:
906
905
  throw new errors.MissingParameterError('Parameter missing: path');
907
906
  case 24:
908
- _context11.next = 26;
907
+ _context1.next = 26;
909
908
  return _Api.default.sendRequest("/file_actions/begin_upload/".concat(encodeURIComponent(params.path)), 'POST', params, _this.options);
910
909
  case 26:
911
- response = _context11.sent;
910
+ response = _context1.sent;
912
911
  FileUploadPart = require('./FileUploadPart.js').default;
913
- return _context11.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
912
+ return _context1.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
914
913
  return new FileUploadPart(obj, _this.options);
915
914
  })) || []);
916
915
  case 29:
917
916
  case "end":
918
- return _context11.stop();
917
+ return _context1.stop();
919
918
  }
920
- }, _callee11);
919
+ }, _callee1);
921
920
  })));
922
- (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
921
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
923
922
  var newObject;
924
- return _regenerator.default.wrap(function _callee12$(_context12) {
925
- while (1) switch (_context12.prev = _context12.next) {
923
+ return _regenerator.default.wrap(function _callee10$(_context10) {
924
+ while (1) switch (_context10.prev = _context10.next) {
926
925
  case 0:
927
- _context12.next = 2;
926
+ _context10.next = 2;
928
927
  return File.create(_this.attributes.path, _this.attributes, _this.options);
929
928
  case 2:
930
- newObject = _context12.sent;
929
+ newObject = _context10.sent;
931
930
  _this.attributes = _objectSpread({}, newObject.attributes);
932
- return _context12.abrupt("return", true);
931
+ return _context10.abrupt("return", true);
933
932
  case 5:
934
933
  case "end":
935
- return _context12.stop();
934
+ return _context10.stop();
936
935
  }
937
- }, _callee12);
936
+ }, _callee10);
938
937
  })));
939
- Object.entries(attributes).forEach(function (_ref13) {
940
- var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
941
- key = _ref14[0],
942
- value = _ref14[1];
938
+ Object.entries(attributes).forEach(function (_ref11) {
939
+ var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
940
+ key = _ref12[0],
941
+ value = _ref12[1];
943
942
  var normalizedKey = key.replace('?', '');
944
943
  _this.attributes[normalizedKey] = value;
945
944
  Object.defineProperty(_this, normalizedKey, {
@@ -951,123 +950,123 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
951
950
  });
952
951
  _File = File;
953
952
  (0, _defineProperty2.default)(File, "_openUpload", /*#__PURE__*/function () {
954
- var _ref15 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(path, paramsRaw, options) {
953
+ var _ref13 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(path, paramsRaw, options) {
955
954
  var params, response, partData, FileUploadPart;
956
- return _regenerator.default.wrap(function _callee13$(_context13) {
957
- while (1) switch (_context13.prev = _context13.next) {
955
+ return _regenerator.default.wrap(function _callee11$(_context11) {
956
+ while (1) switch (_context11.prev = _context11.next) {
958
957
  case 0:
959
958
  params = _objectSpread(_objectSpread({}, paramsRaw), {}, {
960
959
  action: 'put'
961
960
  });
962
- _context13.next = 3;
961
+ _context11.next = 3;
963
962
  return _Api.default.sendRequest("/files/".concat(encodeURIComponent(path)), 'POST', params, options);
964
963
  case 3:
965
- response = _context13.sent;
964
+ response = _context11.sent;
966
965
  if (response) {
967
- _context13.next = 6;
966
+ _context11.next = 6;
968
967
  break;
969
968
  }
970
- return _context13.abrupt("return", null);
969
+ return _context11.abrupt("return", null);
971
970
  case 6:
972
971
  partData = _objectSpread(_objectSpread({}, response.data), {}, {
973
972
  headers: response.headers,
974
973
  parameters: params
975
974
  });
976
975
  FileUploadPart = require('./FileUploadPart.js').default;
977
- return _context13.abrupt("return", new FileUploadPart(partData));
976
+ return _context11.abrupt("return", new FileUploadPart(partData));
978
977
  case 9:
979
978
  case "end":
980
- return _context13.stop();
979
+ return _context11.stop();
981
980
  }
982
- }, _callee13);
981
+ }, _callee11);
983
982
  }));
984
983
  return function (_x7, _x8, _x9) {
985
- return _ref15.apply(this, arguments);
984
+ return _ref13.apply(this, arguments);
986
985
  };
987
986
  }());
988
987
  (0, _defineProperty2.default)(File, "_continueUpload", /*#__PURE__*/function () {
989
- var _ref16 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(path, partNumber, firstFileUploadPart, options) {
988
+ var _ref14 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(path, partNumber, firstFileUploadPart, options) {
990
989
  var params, response, partData, FileUploadPart;
991
- return _regenerator.default.wrap(function _callee14$(_context14) {
992
- while (1) switch (_context14.prev = _context14.next) {
990
+ return _regenerator.default.wrap(function _callee12$(_context12) {
991
+ while (1) switch (_context12.prev = _context12.next) {
993
992
  case 0:
994
993
  params = {
995
994
  action: 'put',
996
995
  part: partNumber,
997
996
  ref: firstFileUploadPart.ref
998
997
  };
999
- _context14.next = 3;
998
+ _context12.next = 3;
1000
999
  return _Api.default.sendRequest("/files/".concat(encodeURIComponent(path)), 'POST', params, options);
1001
1000
  case 3:
1002
- response = _context14.sent;
1001
+ response = _context12.sent;
1003
1002
  if (response) {
1004
- _context14.next = 6;
1003
+ _context12.next = 6;
1005
1004
  break;
1006
1005
  }
1007
- return _context14.abrupt("return", null);
1006
+ return _context12.abrupt("return", null);
1008
1007
  case 6:
1009
1008
  partData = _objectSpread(_objectSpread({}, response.data), {}, {
1010
1009
  headers: response.headers,
1011
1010
  parameters: params
1012
1011
  });
1013
1012
  FileUploadPart = require('./FileUploadPart.js').default;
1014
- return _context14.abrupt("return", new FileUploadPart(partData));
1013
+ return _context12.abrupt("return", new FileUploadPart(partData));
1015
1014
  case 9:
1016
1015
  case "end":
1017
- return _context14.stop();
1016
+ return _context12.stop();
1018
1017
  }
1019
- }, _callee14);
1018
+ }, _callee12);
1020
1019
  }));
1021
- return function (_x10, _x11, _x12, _x13) {
1022
- return _ref16.apply(this, arguments);
1020
+ return function (_x0, _x1, _x10, _x11) {
1021
+ return _ref14.apply(this, arguments);
1023
1022
  };
1024
1023
  }());
1025
1024
  (0, _defineProperty2.default)(File, "_completeUpload", /*#__PURE__*/function () {
1026
- var _ref17 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(firstFileUploadPart, options) {
1025
+ var _ref15 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(firstFileUploadPart, options) {
1027
1026
  var params;
1028
- return _regenerator.default.wrap(function _callee15$(_context15) {
1029
- while (1) switch (_context15.prev = _context15.next) {
1027
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1028
+ while (1) switch (_context13.prev = _context13.next) {
1030
1029
  case 0:
1031
1030
  params = {
1032
1031
  action: 'end',
1033
1032
  ref: firstFileUploadPart.ref
1034
1033
  };
1035
- return _context15.abrupt("return", _Api.default.sendRequest("/files/".concat(encodeURIComponent(firstFileUploadPart.path)), 'POST', params, options));
1034
+ return _context13.abrupt("return", _Api.default.sendRequest("/files/".concat(encodeURIComponent(firstFileUploadPart.path)), 'POST', params, options));
1036
1035
  case 2:
1037
1036
  case "end":
1038
- return _context15.stop();
1037
+ return _context13.stop();
1039
1038
  }
1040
- }, _callee15);
1039
+ }, _callee13);
1041
1040
  }));
1042
- return function (_x14, _x15) {
1043
- return _ref17.apply(this, arguments);
1041
+ return function (_x12, _x13) {
1042
+ return _ref15.apply(this, arguments);
1044
1043
  };
1045
1044
  }());
1046
1045
  /**
1047
1046
  * @note see File.copy() for list of supported params
1048
1047
  */
1049
1048
  (0, _defineProperty2.default)(File, "uploadStream", /*#__PURE__*/function () {
1050
- var _ref18 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(destinationPath, readableStream, params, optionsRaw) {
1051
- var _ref19, determinePartUploadUriRaw, options, firstFileUploadPart, determinePartUploadUri, file;
1052
- return _regenerator.default.wrap(function _callee18$(_context18) {
1053
- while (1) switch (_context18.prev = _context18.next) {
1049
+ var _ref16 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(destinationPath, readableStream, params, optionsRaw) {
1050
+ var _ref17, determinePartUploadUriRaw, options, firstFileUploadPart, determinePartUploadUri, file;
1051
+ return _regenerator.default.wrap(function _callee16$(_context16) {
1052
+ while (1) switch (_context16.prev = _context16.next) {
1054
1053
  case 0:
1055
- _ref19 = optionsRaw || {}, determinePartUploadUriRaw = _ref19.determinePartUploadUri, options = (0, _objectWithoutProperties2.default)(_ref19, _excluded);
1056
- _context18.next = 3;
1054
+ _ref17 = optionsRaw || {}, determinePartUploadUriRaw = _ref17.determinePartUploadUri, options = (0, _objectWithoutProperties2.default)(_ref17, _excluded);
1055
+ _context16.next = 3;
1057
1056
  return _File._openUpload(destinationPath, params, options);
1058
1057
  case 3:
1059
- firstFileUploadPart = _context18.sent;
1058
+ firstFileUploadPart = _context16.sent;
1060
1059
  if (firstFileUploadPart) {
1061
- _context18.next = 6;
1060
+ _context16.next = 6;
1062
1061
  break;
1063
1062
  }
1064
- return _context18.abrupt("return", null);
1063
+ return _context16.abrupt("return", null);
1065
1064
  case 6:
1066
1065
  determinePartUploadUri = determinePartUploadUriRaw || function (fileUploadPart) {
1067
1066
  return fileUploadPart.upload_uri;
1068
1067
  };
1069
- _context18.prev = 7;
1070
- _context18.next = 10;
1068
+ _context16.prev = 7;
1069
+ _context16.next = 10;
1071
1070
  return new Promise(function (resolve, reject) {
1072
1071
  var part = 0;
1073
1072
  var chunks = [];
@@ -1076,56 +1075,56 @@ _File = File;
1076
1075
  var chunkBuffer = null;
1077
1076
  var streamEnded = false;
1078
1077
  var handleStreamEnd = /*#__PURE__*/function () {
1079
- var _ref20 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1078
+ var _ref18 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
1080
1079
  var _options$getAgentForU, buffer, nextFileUploadPart, uploadUri, agent, response, createdFile;
1081
- return _regenerator.default.wrap(function _callee16$(_context16) {
1082
- while (1) switch (_context16.prev = _context16.next) {
1080
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1081
+ while (1) switch (_context14.prev = _context14.next) {
1083
1082
  case 0:
1084
1083
  if (!(chunkBuffer !== null || !streamEnded)) {
1085
- _context16.next = 2;
1084
+ _context14.next = 2;
1086
1085
  break;
1087
1086
  }
1088
- return _context16.abrupt("return");
1087
+ return _context14.abrupt("return");
1089
1088
  case 2:
1090
- _context16.prev = 2;
1089
+ _context14.prev = 2;
1091
1090
  if (!(chunks.length > 0)) {
1092
- _context16.next = 11;
1091
+ _context14.next = 11;
1093
1092
  break;
1094
1093
  }
1095
1094
  buffer = _safeBuffer.Buffer.concat(chunks);
1096
- _context16.next = 7;
1095
+ _context14.next = 7;
1097
1096
  return _File._continueUpload(destinationPath, ++part, firstFileUploadPart, options);
1098
1097
  case 7:
1099
- nextFileUploadPart = _context16.sent;
1098
+ nextFileUploadPart = _context14.sent;
1100
1099
  uploadUri = determinePartUploadUri(nextFileUploadPart); // instantiate an httpsAgent dynamically if needed
1101
1100
  agent = ((_options$getAgentForU = options.getAgentForUrl) === null || _options$getAgentForU === void 0 ? void 0 : _options$getAgentForU.call(options, uploadUri)) || (options === null || options === void 0 ? void 0 : options.agent);
1102
1101
  concurrentUploads.push(_Api.default.sendFilePart(uploadUri, 'PUT', buffer, {
1103
1102
  agent: agent
1104
1103
  }));
1105
1104
  case 11:
1106
- _context16.next = 13;
1105
+ _context14.next = 13;
1107
1106
  return Promise.all(concurrentUploads);
1108
1107
  case 13:
1109
- _context16.next = 15;
1108
+ _context14.next = 15;
1110
1109
  return _File._completeUpload(firstFileUploadPart, options);
1111
1110
  case 15:
1112
- response = _context16.sent;
1111
+ response = _context14.sent;
1113
1112
  createdFile = new _File(response.data, options);
1114
1113
  resolve(createdFile);
1115
- _context16.next = 23;
1114
+ _context14.next = 23;
1116
1115
  break;
1117
1116
  case 20:
1118
- _context16.prev = 20;
1119
- _context16.t0 = _context16["catch"](2);
1120
- reject(_context16.t0);
1117
+ _context14.prev = 20;
1118
+ _context14.t0 = _context14["catch"](2);
1119
+ reject(_context14.t0);
1121
1120
  case 23:
1122
1121
  case "end":
1123
- return _context16.stop();
1122
+ return _context14.stop();
1124
1123
  }
1125
- }, _callee16, null, [[2, 20]]);
1124
+ }, _callee14, null, [[2, 20]]);
1126
1125
  }));
1127
1126
  return function handleStreamEnd() {
1128
- return _ref20.apply(this, arguments);
1127
+ return _ref18.apply(this, arguments);
1129
1128
  };
1130
1129
  }();
1131
1130
  readableStream.on('error', function (error) {
@@ -1136,22 +1135,22 @@ _File = File;
1136
1135
  // if a stream has been created based on very large data, it's possible for a chunk to
1137
1136
  // contain the entire file and we could get a single chunk with length >= partsize * 3
1138
1137
  readableStream.on('data', /*#__PURE__*/function () {
1139
- var _ref21 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(chunk) {
1138
+ var _ref19 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(chunk) {
1140
1139
  var excessLength, _options$getAgentForU2, lengthForEndOfCurrentPart, lastChunkForCurrentPart, chunkBufferAfterCurrentPart, buffer, nextFileUploadPart, uploadUri, agent, uploadPromise, isNextChunkAtLeastOnePart;
1141
- return _regenerator.default.wrap(function _callee17$(_context17) {
1142
- while (1) switch (_context17.prev = _context17.next) {
1140
+ return _regenerator.default.wrap(function _callee15$(_context15) {
1141
+ while (1) switch (_context15.prev = _context15.next) {
1143
1142
  case 0:
1144
- _context17.prev = 0;
1143
+ _context15.prev = 0;
1145
1144
  excessLength = length + chunk.length - firstFileUploadPart.partsize;
1146
1145
  chunkBuffer = _safeBuffer.Buffer.from(chunk);
1147
1146
  if (!(excessLength > 0)) {
1148
- _context17.next = 30;
1147
+ _context15.next = 30;
1149
1148
  break;
1150
1149
  }
1151
1150
  readableStream.pause();
1152
1151
  case 5:
1153
1152
  if (!chunkBuffer) {
1154
- _context17.next = 27;
1153
+ _context15.next = 27;
1155
1154
  break;
1156
1155
  }
1157
1156
  // the amount to append this last part with to make it exactly the full partsize
@@ -1161,24 +1160,24 @@ _File = File;
1161
1160
  chunks.push(lastChunkForCurrentPart);
1162
1161
  buffer = _safeBuffer.Buffer.concat(chunks);
1163
1162
  /* eslint-disable-next-line no-await-in-loop */
1164
- _context17.next = 13;
1163
+ _context15.next = 13;
1165
1164
  return _File._continueUpload(destinationPath, ++part, firstFileUploadPart, options);
1166
1165
  case 13:
1167
- nextFileUploadPart = _context17.sent;
1166
+ nextFileUploadPart = _context15.sent;
1168
1167
  uploadUri = determinePartUploadUri(nextFileUploadPart); // instantiate an httpsAgent dynamically if needed
1169
1168
  agent = ((_options$getAgentForU2 = options.getAgentForUrl) === null || _options$getAgentForU2 === void 0 ? void 0 : _options$getAgentForU2.call(options, uploadUri)) || (options === null || options === void 0 ? void 0 : options.agent);
1170
1169
  uploadPromise = _Api.default.sendFilePart(uploadUri, 'PUT', buffer, {
1171
1170
  agent: agent
1172
1171
  });
1173
1172
  if (!firstFileUploadPart.parallel_parts) {
1174
- _context17.next = 21;
1173
+ _context15.next = 21;
1175
1174
  break;
1176
1175
  }
1177
1176
  concurrentUploads.push(uploadPromise);
1178
- _context17.next = 23;
1177
+ _context15.next = 23;
1179
1178
  break;
1180
1179
  case 21:
1181
- _context17.next = 23;
1180
+ _context15.next = 23;
1182
1181
  return uploadPromise;
1183
1182
  case 23:
1184
1183
  // determine if the remainder of the excess chunk data is too large to be a single part
@@ -1197,11 +1196,11 @@ _File = File;
1197
1196
  } else {
1198
1197
  chunkBuffer = null;
1199
1198
  }
1200
- _context17.next = 5;
1199
+ _context15.next = 5;
1201
1200
  break;
1202
1201
  case 27:
1203
1202
  readableStream.resume();
1204
- _context17.next = 33;
1203
+ _context15.next = 33;
1205
1204
  break;
1206
1205
  case 30:
1207
1206
  chunks.push(chunkBuffer);
@@ -1211,20 +1210,20 @@ _File = File;
1211
1210
  if (streamEnded) {
1212
1211
  handleStreamEnd();
1213
1212
  }
1214
- _context17.next = 39;
1213
+ _context15.next = 39;
1215
1214
  break;
1216
1215
  case 36:
1217
- _context17.prev = 36;
1218
- _context17.t0 = _context17["catch"](0);
1219
- reject(_context17.t0);
1216
+ _context15.prev = 36;
1217
+ _context15.t0 = _context15["catch"](0);
1218
+ reject(_context15.t0);
1220
1219
  case 39:
1221
1220
  case "end":
1222
- return _context17.stop();
1221
+ return _context15.stop();
1223
1222
  }
1224
- }, _callee17, null, [[0, 36]]);
1223
+ }, _callee15, null, [[0, 36]]);
1225
1224
  }));
1226
- return function (_x20) {
1227
- return _ref21.apply(this, arguments);
1225
+ return function (_x18) {
1226
+ return _ref19.apply(this, arguments);
1228
1227
  };
1229
1228
  }());
1230
1229
 
@@ -1235,21 +1234,21 @@ _File = File;
1235
1234
  });
1236
1235
  });
1237
1236
  case 10:
1238
- file = _context18.sent;
1239
- return _context18.abrupt("return", file);
1237
+ file = _context16.sent;
1238
+ return _context16.abrupt("return", file);
1240
1239
  case 14:
1241
- _context18.prev = 14;
1242
- _context18.t0 = _context18["catch"](7);
1243
- errors.handleErrorResponse(_context18.t0);
1244
- return _context18.abrupt("return", null);
1240
+ _context16.prev = 14;
1241
+ _context16.t0 = _context16["catch"](7);
1242
+ errors.handleErrorResponse(_context16.t0);
1243
+ return _context16.abrupt("return", null);
1245
1244
  case 18:
1246
1245
  case "end":
1247
- return _context18.stop();
1246
+ return _context16.stop();
1248
1247
  }
1249
- }, _callee18, null, [[7, 14]]);
1248
+ }, _callee16, null, [[7, 14]]);
1250
1249
  }));
1251
- return function (_x16, _x17, _x18, _x19) {
1252
- return _ref18.apply(this, arguments);
1250
+ return function (_x14, _x15, _x16, _x17) {
1251
+ return _ref16.apply(this, arguments);
1253
1252
  };
1254
1253
  }());
1255
1254
  /**
@@ -1257,53 +1256,53 @@ _File = File;
1257
1256
  * @note see File.copy() for list of supported params
1258
1257
  */
1259
1258
  (0, _defineProperty2.default)(File, "uploadData", /*#__PURE__*/function () {
1260
- var _ref22 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(destinationPath, data, params, options) {
1261
- return _regenerator.default.wrap(function _callee19$(_context19) {
1262
- while (1) switch (_context19.prev = _context19.next) {
1259
+ var _ref20 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(destinationPath, data, params, options) {
1260
+ return _regenerator.default.wrap(function _callee17$(_context17) {
1261
+ while (1) switch (_context17.prev = _context17.next) {
1263
1262
  case 0:
1264
1263
  if (data) {
1265
- _context19.next = 2;
1264
+ _context17.next = 2;
1266
1265
  break;
1267
1266
  }
1268
1267
  throw new errors.MissingParameterError('Upload data was not provided');
1269
1268
  case 2:
1270
- return _context19.abrupt("return", _File.uploadStream(destinationPath, _readableStream.default.from(data), params, options));
1269
+ return _context17.abrupt("return", _File.uploadStream(destinationPath, _readableStream.default.from(data), params, options));
1271
1270
  case 3:
1272
1271
  case "end":
1273
- return _context19.stop();
1272
+ return _context17.stop();
1274
1273
  }
1275
- }, _callee19);
1274
+ }, _callee17);
1276
1275
  }));
1277
- return function (_x21, _x22, _x23, _x24) {
1278
- return _ref22.apply(this, arguments);
1276
+ return function (_x19, _x20, _x21, _x22) {
1277
+ return _ref20.apply(this, arguments);
1279
1278
  };
1280
1279
  }());
1281
1280
  /**
1282
1281
  * @note see File.copy() for list of supported params
1283
1282
  */
1284
1283
  (0, _defineProperty2.default)(File, "uploadFile", /*#__PURE__*/function () {
1285
- var _ref23 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(destinationPath, sourceFilePath, params, options) {
1284
+ var _ref21 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(destinationPath, sourceFilePath, params, options) {
1286
1285
  var _require4, openDiskFileReadStream, stream;
1287
- return _regenerator.default.wrap(function _callee20$(_context20) {
1288
- while (1) switch (_context20.prev = _context20.next) {
1286
+ return _regenerator.default.wrap(function _callee18$(_context18) {
1287
+ while (1) switch (_context18.prev = _context18.next) {
1289
1288
  case 0:
1290
1289
  if (!(0, _utils.isBrowser)()) {
1291
- _context20.next = 2;
1290
+ _context18.next = 2;
1292
1291
  break;
1293
1292
  }
1294
1293
  throw new errors.NotImplementedError('Disk file uploads are only available in a NodeJS environment');
1295
1294
  case 2:
1296
1295
  _require4 = require('../isomorphic/File.node.js'), openDiskFileReadStream = _require4.openDiskFileReadStream;
1297
1296
  stream = openDiskFileReadStream(sourceFilePath);
1298
- return _context20.abrupt("return", _File.uploadStream(destinationPath, stream, params, options));
1297
+ return _context18.abrupt("return", _File.uploadStream(destinationPath, stream, params, options));
1299
1298
  case 5:
1300
1299
  case "end":
1301
- return _context20.stop();
1300
+ return _context18.stop();
1302
1301
  }
1303
- }, _callee20);
1302
+ }, _callee18);
1304
1303
  }));
1305
- return function (_x25, _x26, _x27, _x28) {
1306
- return _ref23.apply(this, arguments);
1304
+ return function (_x23, _x24, _x25, _x26) {
1305
+ return _ref21.apply(this, arguments);
1307
1306
  };
1308
1307
  }());
1309
1308
  // Parameters:
@@ -1322,102 +1321,102 @@ _File = File;
1322
1321
  // structure - string - If copying folder, copy just the structure?
1323
1322
  // with_rename - boolean - Allow file rename instead of overwrite?
1324
1323
  (0, _defineProperty2.default)(File, "create", /*#__PURE__*/function () {
1325
- var _ref24 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(path) {
1324
+ var _ref22 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(path) {
1326
1325
  var params,
1327
1326
  options,
1328
1327
  response,
1329
- _args21 = arguments;
1330
- return _regenerator.default.wrap(function _callee21$(_context21) {
1331
- while (1) switch (_context21.prev = _context21.next) {
1328
+ _args19 = arguments;
1329
+ return _regenerator.default.wrap(function _callee19$(_context19) {
1330
+ while (1) switch (_context19.prev = _context19.next) {
1332
1331
  case 0:
1333
- params = _args21.length > 1 && _args21[1] !== undefined ? _args21[1] : {};
1334
- options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
1332
+ params = _args19.length > 1 && _args19[1] !== undefined ? _args19[1] : {};
1333
+ options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
1335
1334
  if ((0, _utils.isObject)(params)) {
1336
- _context21.next = 4;
1335
+ _context19.next = 4;
1337
1336
  break;
1338
1337
  }
1339
1338
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
1340
1339
  case 4:
1341
1340
  params.path = path;
1342
1341
  if (params.path) {
1343
- _context21.next = 7;
1342
+ _context19.next = 7;
1344
1343
  break;
1345
1344
  }
1346
1345
  throw new errors.MissingParameterError('Parameter missing: path');
1347
1346
  case 7:
1348
1347
  if (!(params.path && !(0, _utils.isString)(params.path))) {
1349
- _context21.next = 9;
1348
+ _context19.next = 9;
1350
1349
  break;
1351
1350
  }
1352
1351
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
1353
1352
  case 9:
1354
1353
  if (!(params.action && !(0, _utils.isString)(params.action))) {
1355
- _context21.next = 11;
1354
+ _context19.next = 11;
1356
1355
  break;
1357
1356
  }
1358
1357
  throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params.action)));
1359
1358
  case 11:
1360
1359
  if (!(params.length && !(0, _utils.isInt)(params.length))) {
1361
- _context21.next = 13;
1360
+ _context19.next = 13;
1362
1361
  break;
1363
1362
  }
1364
1363
  throw new errors.InvalidParameterError("Bad parameter: length must be of type Int, received ".concat((0, _utils.getType)(params.length)));
1365
1364
  case 13:
1366
1365
  if (!(params.part && !(0, _utils.isInt)(params.part))) {
1367
- _context21.next = 15;
1366
+ _context19.next = 15;
1368
1367
  break;
1369
1368
  }
1370
1369
  throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params.part)));
1371
1370
  case 15:
1372
1371
  if (!(params.parts && !(0, _utils.isInt)(params.parts))) {
1373
- _context21.next = 17;
1372
+ _context19.next = 17;
1374
1373
  break;
1375
1374
  }
1376
1375
  throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params.parts)));
1377
1376
  case 17:
1378
1377
  if (!(params.provided_mtime && !(0, _utils.isString)(params.provided_mtime))) {
1379
- _context21.next = 19;
1378
+ _context19.next = 19;
1380
1379
  break;
1381
1380
  }
1382
1381
  throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params.provided_mtime)));
1383
1382
  case 19:
1384
1383
  if (!(params.ref && !(0, _utils.isString)(params.ref))) {
1385
- _context21.next = 21;
1384
+ _context19.next = 21;
1386
1385
  break;
1387
1386
  }
1388
1387
  throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params.ref)));
1389
1388
  case 21:
1390
1389
  if (!(params.restart && !(0, _utils.isInt)(params.restart))) {
1391
- _context21.next = 23;
1390
+ _context19.next = 23;
1392
1391
  break;
1393
1392
  }
1394
1393
  throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params.restart)));
1395
1394
  case 23:
1396
1395
  if (!(params.size && !(0, _utils.isInt)(params.size))) {
1397
- _context21.next = 25;
1396
+ _context19.next = 25;
1398
1397
  break;
1399
1398
  }
1400
1399
  throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params.size)));
1401
1400
  case 25:
1402
1401
  if (!(params.structure && !(0, _utils.isString)(params.structure))) {
1403
- _context21.next = 27;
1402
+ _context19.next = 27;
1404
1403
  break;
1405
1404
  }
1406
1405
  throw new errors.InvalidParameterError("Bad parameter: structure must be of type String, received ".concat((0, _utils.getType)(params.structure)));
1407
1406
  case 27:
1408
- _context21.next = 29;
1407
+ _context19.next = 29;
1409
1408
  return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'POST', params, options);
1410
1409
  case 29:
1411
- response = _context21.sent;
1412
- return _context21.abrupt("return", new _File(response === null || response === void 0 ? void 0 : response.data, options));
1410
+ response = _context19.sent;
1411
+ return _context19.abrupt("return", new _File(response === null || response === void 0 ? void 0 : response.data, options));
1413
1412
  case 31:
1414
1413
  case "end":
1415
- return _context21.stop();
1414
+ return _context19.stop();
1416
1415
  }
1417
- }, _callee21);
1416
+ }, _callee19);
1418
1417
  }));
1419
- return function (_x29) {
1420
- return _ref24.apply(this, arguments);
1418
+ return function (_x27) {
1419
+ return _ref22.apply(this, arguments);
1421
1420
  };
1422
1421
  }());
1423
1422
  // Parameters:
@@ -1426,54 +1425,54 @@ _File = File;
1426
1425
  // with_previews - boolean - Include file preview information?
1427
1426
  // with_priority_color - boolean - Include file priority color information?
1428
1427
  (0, _defineProperty2.default)(File, "find", /*#__PURE__*/function () {
1429
- var _ref25 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(path) {
1428
+ var _ref23 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(path) {
1430
1429
  var params,
1431
1430
  options,
1432
1431
  response,
1433
- _args22 = arguments;
1434
- return _regenerator.default.wrap(function _callee22$(_context22) {
1435
- while (1) switch (_context22.prev = _context22.next) {
1432
+ _args20 = arguments;
1433
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1434
+ while (1) switch (_context20.prev = _context20.next) {
1436
1435
  case 0:
1437
- params = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {};
1438
- options = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : {};
1436
+ params = _args20.length > 1 && _args20[1] !== undefined ? _args20[1] : {};
1437
+ options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
1439
1438
  if ((0, _utils.isObject)(params)) {
1440
- _context22.next = 4;
1439
+ _context20.next = 4;
1441
1440
  break;
1442
1441
  }
1443
1442
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
1444
1443
  case 4:
1445
1444
  params.path = path;
1446
1445
  if (params.path) {
1447
- _context22.next = 7;
1446
+ _context20.next = 7;
1448
1447
  break;
1449
1448
  }
1450
1449
  throw new errors.MissingParameterError('Parameter missing: path');
1451
1450
  case 7:
1452
1451
  if (!(params.path && !(0, _utils.isString)(params.path))) {
1453
- _context22.next = 9;
1452
+ _context20.next = 9;
1454
1453
  break;
1455
1454
  }
1456
1455
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
1457
1456
  case 9:
1458
1457
  if (!(params.preview_size && !(0, _utils.isString)(params.preview_size))) {
1459
- _context22.next = 11;
1458
+ _context20.next = 11;
1460
1459
  break;
1461
1460
  }
1462
1461
  throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params.preview_size)));
1463
1462
  case 11:
1464
- _context22.next = 13;
1463
+ _context20.next = 13;
1465
1464
  return _Api.default.sendRequest("/file_actions/metadata/".concat(encodeURIComponent(params.path)), 'GET', params, options);
1466
1465
  case 13:
1467
- response = _context22.sent;
1468
- return _context22.abrupt("return", new _File(response === null || response === void 0 ? void 0 : response.data, options));
1466
+ response = _context20.sent;
1467
+ return _context20.abrupt("return", new _File(response === null || response === void 0 ? void 0 : response.data, options));
1469
1468
  case 15:
1470
1469
  case "end":
1471
- return _context22.stop();
1470
+ return _context20.stop();
1472
1471
  }
1473
- }, _callee22);
1472
+ }, _callee20);
1474
1473
  }));
1475
- return function (_x30) {
1476
- return _ref25.apply(this, arguments);
1474
+ return function (_x28) {
1475
+ return _ref23.apply(this, arguments);
1477
1476
  };
1478
1477
  }());
1479
1478
  (0, _defineProperty2.default)(File, "get", function (path) {