files.com 1.0.284 → 1.0.286

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.
@@ -395,6 +395,27 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
395
395
  (0, _defineProperty2.default)(this, "setDropboxTeams", function (value) {
396
396
  _this.attributes.dropbox_teams = value;
397
397
  });
398
+ // string # Linode Bucket name
399
+ (0, _defineProperty2.default)(this, "getLinodeBucket", function () {
400
+ return _this.attributes.linode_bucket;
401
+ });
402
+ (0, _defineProperty2.default)(this, "setLinodeBucket", function (value) {
403
+ _this.attributes.linode_bucket = value;
404
+ });
405
+ // string # Linode Access Key.
406
+ (0, _defineProperty2.default)(this, "getLinodeAccessKey", function () {
407
+ return _this.attributes.linode_access_key;
408
+ });
409
+ (0, _defineProperty2.default)(this, "setLinodeAccessKey", function (value) {
410
+ _this.attributes.linode_access_key = value;
411
+ });
412
+ // string # Linode region
413
+ (0, _defineProperty2.default)(this, "getLinodeRegion", function () {
414
+ return _this.attributes.linode_region;
415
+ });
416
+ (0, _defineProperty2.default)(this, "setLinodeRegion", function (value) {
417
+ _this.attributes.linode_region = value;
418
+ });
398
419
  // string # AWS secret key.
399
420
  (0, _defineProperty2.default)(this, "getAwsSecretKey", function () {
400
421
  return _this.attributes.aws_secret_key;
@@ -507,6 +528,13 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
507
528
  (0, _defineProperty2.default)(this, "setCloudflareSecretKey", function (value) {
508
529
  _this.attributes.cloudflare_secret_key = value;
509
530
  });
531
+ // string # Linode secret key
532
+ (0, _defineProperty2.default)(this, "getLinodeSecretKey", function () {
533
+ return _this.attributes.linode_secret_key;
534
+ });
535
+ (0, _defineProperty2.default)(this, "setLinodeSecretKey", function (value) {
536
+ _this.attributes.linode_secret_key = value;
537
+ });
510
538
  // Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
511
539
  //
512
540
  // Parameters:
@@ -699,6 +727,10 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
699
727
  // cloudflare_bucket - string - Cloudflare Bucket name
700
728
  // cloudflare_endpoint - string - Cloudflare endpoint
701
729
  // dropbox_teams - boolean - List Team folders in root
730
+ // linode_access_key - string - Linode Access Key.
731
+ // linode_secret_key - string - Linode secret key
732
+ // linode_bucket - string - Linode Bucket name
733
+ // linode_region - string - Linode region
702
734
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
703
735
  var params,
704
736
  response,
@@ -1056,26 +1088,50 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
1056
1088
  }
1057
1089
  throw new errors.InvalidParameterError("Bad parameter: cloudflare_endpoint must be of type String, received ".concat((0, _utils.getType)(cloudflare_endpoint)));
1058
1090
  case 118:
1059
- if (params['id']) {
1091
+ if (!(params['linode_access_key'] && !(0, _utils.isString)(params['linode_access_key']))) {
1092
+ _context2.next = 120;
1093
+ break;
1094
+ }
1095
+ throw new errors.InvalidParameterError("Bad parameter: linode_access_key must be of type String, received ".concat((0, _utils.getType)(linode_access_key)));
1096
+ case 120:
1097
+ if (!(params['linode_secret_key'] && !(0, _utils.isString)(params['linode_secret_key']))) {
1098
+ _context2.next = 122;
1099
+ break;
1100
+ }
1101
+ throw new errors.InvalidParameterError("Bad parameter: linode_secret_key must be of type String, received ".concat((0, _utils.getType)(linode_secret_key)));
1102
+ case 122:
1103
+ if (!(params['linode_bucket'] && !(0, _utils.isString)(params['linode_bucket']))) {
1060
1104
  _context2.next = 124;
1061
1105
  break;
1062
1106
  }
1107
+ throw new errors.InvalidParameterError("Bad parameter: linode_bucket must be of type String, received ".concat((0, _utils.getType)(linode_bucket)));
1108
+ case 124:
1109
+ if (!(params['linode_region'] && !(0, _utils.isString)(params['linode_region']))) {
1110
+ _context2.next = 126;
1111
+ break;
1112
+ }
1113
+ throw new errors.InvalidParameterError("Bad parameter: linode_region must be of type String, received ".concat((0, _utils.getType)(linode_region)));
1114
+ case 126:
1115
+ if (params['id']) {
1116
+ _context2.next = 132;
1117
+ break;
1118
+ }
1063
1119
  if (!_this.attributes.id) {
1064
- _context2.next = 123;
1120
+ _context2.next = 131;
1065
1121
  break;
1066
1122
  }
1067
1123
  params['id'] = _this.id;
1068
- _context2.next = 124;
1124
+ _context2.next = 132;
1069
1125
  break;
1070
- case 123:
1126
+ case 131:
1071
1127
  throw new errors.MissingParameterError('Parameter missing: id');
1072
- case 124:
1073
- _context2.next = 126;
1128
+ case 132:
1129
+ _context2.next = 134;
1074
1130
  return _Api.default.sendRequest("/remote_servers/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
1075
- case 126:
1131
+ case 134:
1076
1132
  response = _context2.sent;
1077
1133
  return _context2.abrupt("return", new RemoteServer(response === null || response === void 0 ? void 0 : response.data, _this.options));
1078
- case 128:
1134
+ case 136:
1079
1135
  case "end":
1080
1136
  return _context2.stop();
1081
1137
  }
@@ -1362,6 +1418,10 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
1362
1418
  // cloudflare_bucket - string - Cloudflare Bucket name
1363
1419
  // cloudflare_endpoint - string - Cloudflare endpoint
1364
1420
  // dropbox_teams - boolean - List Team folders in root
1421
+ // linode_access_key - string - Linode Access Key.
1422
+ // linode_secret_key - string - Linode secret key
1423
+ // linode_bucket - string - Linode Bucket name
1424
+ // linode_region - string - Linode region
1365
1425
  (0, _defineProperty2.default)(RemoteServer, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
1366
1426
  var params,
1367
1427
  options,
@@ -1702,12 +1762,36 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
1702
1762
  }
1703
1763
  throw new errors.InvalidParameterError("Bad parameter: cloudflare_endpoint must be of type String, received ".concat((0, _utils.getType)(params['cloudflare_endpoint'])));
1704
1764
  case 112:
1705
- _context7.next = 114;
1706
- return _Api.default.sendRequest("/remote_servers", 'POST', params, options);
1765
+ if (!(params['linode_access_key'] && !(0, _utils.isString)(params['linode_access_key']))) {
1766
+ _context7.next = 114;
1767
+ break;
1768
+ }
1769
+ throw new errors.InvalidParameterError("Bad parameter: linode_access_key must be of type String, received ".concat((0, _utils.getType)(params['linode_access_key'])));
1707
1770
  case 114:
1771
+ if (!(params['linode_secret_key'] && !(0, _utils.isString)(params['linode_secret_key']))) {
1772
+ _context7.next = 116;
1773
+ break;
1774
+ }
1775
+ throw new errors.InvalidParameterError("Bad parameter: linode_secret_key must be of type String, received ".concat((0, _utils.getType)(params['linode_secret_key'])));
1776
+ case 116:
1777
+ if (!(params['linode_bucket'] && !(0, _utils.isString)(params['linode_bucket']))) {
1778
+ _context7.next = 118;
1779
+ break;
1780
+ }
1781
+ throw new errors.InvalidParameterError("Bad parameter: linode_bucket must be of type String, received ".concat((0, _utils.getType)(params['linode_bucket'])));
1782
+ case 118:
1783
+ if (!(params['linode_region'] && !(0, _utils.isString)(params['linode_region']))) {
1784
+ _context7.next = 120;
1785
+ break;
1786
+ }
1787
+ throw new errors.InvalidParameterError("Bad parameter: linode_region must be of type String, received ".concat((0, _utils.getType)(params['linode_region'])));
1788
+ case 120:
1789
+ _context7.next = 122;
1790
+ return _Api.default.sendRequest("/remote_servers", 'POST', params, options);
1791
+ case 122:
1708
1792
  response = _context7.sent;
1709
1793
  return _context7.abrupt("return", new RemoteServer(response === null || response === void 0 ? void 0 : response.data, options));
1710
- case 116:
1794
+ case 124:
1711
1795
  case "end":
1712
1796
  return _context7.stop();
1713
1797
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.284",
3
+ "version": "1.0.286",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Errors.js CHANGED
@@ -185,6 +185,7 @@ export class NotFound_NestedNotFoundError extends NotFoundError { constructor(me
185
185
  export class NotFound_PlanNotFoundError extends NotFoundError { constructor(message, code) { super(message, code); this.name = 'NotFound_PlanNotFoundError' } } errorClasses.NotFound_PlanNotFoundError = NotFound_PlanNotFoundError
186
186
  export class NotFound_SiteNotFoundError extends NotFoundError { constructor(message, code) { super(message, code); this.name = 'NotFound_SiteNotFoundError' } } errorClasses.NotFound_SiteNotFoundError = NotFound_SiteNotFoundError
187
187
  export class NotFound_UserNotFoundError extends NotFoundError { constructor(message, code) { super(message, code); this.name = 'NotFound_UserNotFoundError' } } errorClasses.NotFound_UserNotFoundError = NotFound_UserNotFoundError
188
+ export class ProcessingFailure_AutomationCannotBeRunManuallyError extends ProcessingFailureError { constructor(message, code) { super(message, code); this.name = 'ProcessingFailure_AutomationCannotBeRunManuallyError' } } errorClasses.ProcessingFailure_AutomationCannotBeRunManuallyError = ProcessingFailure_AutomationCannotBeRunManuallyError
188
189
  export class ProcessingFailure_BundleOnlyAllowsPreviewsError extends ProcessingFailureError { constructor(message, code) { super(message, code); this.name = 'ProcessingFailure_BundleOnlyAllowsPreviewsError' } } errorClasses.ProcessingFailure_BundleOnlyAllowsPreviewsError = ProcessingFailure_BundleOnlyAllowsPreviewsError
189
190
  export class ProcessingFailure_BundleOperationRequiresSubfolderError extends ProcessingFailureError { constructor(message, code) { super(message, code); this.name = 'ProcessingFailure_BundleOperationRequiresSubfolderError' } } errorClasses.ProcessingFailure_BundleOperationRequiresSubfolderError = ProcessingFailure_BundleOperationRequiresSubfolderError
190
191
  export class ProcessingFailure_CouldNotCreateParentError extends ProcessingFailureError { constructor(message, code) { super(message, code); this.name = 'ProcessingFailure_CouldNotCreateParentError' } } errorClasses.ProcessingFailure_CouldNotCreateParentError = ProcessingFailure_CouldNotCreateParentError
@@ -192,6 +192,34 @@ class Automation {
192
192
  }
193
193
 
194
194
 
195
+ // Manually run automation
196
+ manualRun = async (params = {}) => {
197
+ if (!this.attributes.id) {
198
+ throw new errors.EmptyPropertyError('Current object has no id')
199
+ }
200
+
201
+ if (!isObject(params)) {
202
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
203
+ }
204
+
205
+ params.id = this.attributes.id
206
+ if (params['id'] && !isInt(params['id'])) {
207
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
208
+ }
209
+
210
+ if (!params['id']) {
211
+ if (this.attributes.id) {
212
+ params['id'] = this.id
213
+ } else {
214
+ throw new errors.MissingParameterError('Parameter missing: id')
215
+ }
216
+ }
217
+
218
+ const response = await Api.sendRequest(`/automations/${encodeURIComponent(params['id'])}/manual_run`, 'POST', params, this.options)
219
+
220
+ return response?.data
221
+ }
222
+
195
223
  // Parameters:
196
224
  // source - string - Source Path
197
225
  // destination - string - DEPRECATED: Destination Path. Use `destinations` instead.
@@ -387,6 +387,27 @@ class RemoteServer {
387
387
  this.attributes.dropbox_teams = value
388
388
  }
389
389
 
390
+ // string # Linode Bucket name
391
+ getLinodeBucket = () => this.attributes.linode_bucket
392
+
393
+ setLinodeBucket = value => {
394
+ this.attributes.linode_bucket = value
395
+ }
396
+
397
+ // string # Linode Access Key.
398
+ getLinodeAccessKey = () => this.attributes.linode_access_key
399
+
400
+ setLinodeAccessKey = value => {
401
+ this.attributes.linode_access_key = value
402
+ }
403
+
404
+ // string # Linode region
405
+ getLinodeRegion = () => this.attributes.linode_region
406
+
407
+ setLinodeRegion = value => {
408
+ this.attributes.linode_region = value
409
+ }
410
+
390
411
  // string # AWS secret key.
391
412
  getAwsSecretKey = () => this.attributes.aws_secret_key
392
413
 
@@ -499,6 +520,13 @@ class RemoteServer {
499
520
  this.attributes.cloudflare_secret_key = value
500
521
  }
501
522
 
523
+ // string # Linode secret key
524
+ getLinodeSecretKey = () => this.attributes.linode_secret_key
525
+
526
+ setLinodeSecretKey = value => {
527
+ this.attributes.linode_secret_key = value
528
+ }
529
+
502
530
 
503
531
  // Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
504
532
  //
@@ -634,6 +662,10 @@ class RemoteServer {
634
662
  // cloudflare_bucket - string - Cloudflare Bucket name
635
663
  // cloudflare_endpoint - string - Cloudflare endpoint
636
664
  // dropbox_teams - boolean - List Team folders in root
665
+ // linode_access_key - string - Linode Access Key.
666
+ // linode_secret_key - string - Linode secret key
667
+ // linode_bucket - string - Linode Bucket name
668
+ // linode_region - string - Linode region
637
669
  update = async (params = {}) => {
638
670
  if (!this.attributes.id) {
639
671
  throw new errors.EmptyPropertyError('Current object has no id')
@@ -812,6 +844,18 @@ class RemoteServer {
812
844
  if (params['cloudflare_endpoint'] && !isString(params['cloudflare_endpoint'])) {
813
845
  throw new errors.InvalidParameterError(`Bad parameter: cloudflare_endpoint must be of type String, received ${getType(cloudflare_endpoint)}`)
814
846
  }
847
+ if (params['linode_access_key'] && !isString(params['linode_access_key'])) {
848
+ throw new errors.InvalidParameterError(`Bad parameter: linode_access_key must be of type String, received ${getType(linode_access_key)}`)
849
+ }
850
+ if (params['linode_secret_key'] && !isString(params['linode_secret_key'])) {
851
+ throw new errors.InvalidParameterError(`Bad parameter: linode_secret_key must be of type String, received ${getType(linode_secret_key)}`)
852
+ }
853
+ if (params['linode_bucket'] && !isString(params['linode_bucket'])) {
854
+ throw new errors.InvalidParameterError(`Bad parameter: linode_bucket must be of type String, received ${getType(linode_bucket)}`)
855
+ }
856
+ if (params['linode_region'] && !isString(params['linode_region'])) {
857
+ throw new errors.InvalidParameterError(`Bad parameter: linode_region must be of type String, received ${getType(linode_region)}`)
858
+ }
815
859
 
816
860
  if (!params['id']) {
817
861
  if (this.attributes.id) {
@@ -993,6 +1037,10 @@ class RemoteServer {
993
1037
  // cloudflare_bucket - string - Cloudflare Bucket name
994
1038
  // cloudflare_endpoint - string - Cloudflare endpoint
995
1039
  // dropbox_teams - boolean - List Team folders in root
1040
+ // linode_access_key - string - Linode Access Key.
1041
+ // linode_secret_key - string - Linode secret key
1042
+ // linode_bucket - string - Linode Bucket name
1043
+ // linode_region - string - Linode region
996
1044
  static create = async (params = {}, options = {}) => {
997
1045
  if (params['aws_access_key'] && !isString(params['aws_access_key'])) {
998
1046
  throw new errors.InvalidParameterError(`Bad parameter: aws_access_key must be of type String, received ${getType(params['aws_access_key'])}`)
@@ -1214,6 +1262,22 @@ class RemoteServer {
1214
1262
  throw new errors.InvalidParameterError(`Bad parameter: cloudflare_endpoint must be of type String, received ${getType(params['cloudflare_endpoint'])}`)
1215
1263
  }
1216
1264
 
1265
+ if (params['linode_access_key'] && !isString(params['linode_access_key'])) {
1266
+ throw new errors.InvalidParameterError(`Bad parameter: linode_access_key must be of type String, received ${getType(params['linode_access_key'])}`)
1267
+ }
1268
+
1269
+ if (params['linode_secret_key'] && !isString(params['linode_secret_key'])) {
1270
+ throw new errors.InvalidParameterError(`Bad parameter: linode_secret_key must be of type String, received ${getType(params['linode_secret_key'])}`)
1271
+ }
1272
+
1273
+ if (params['linode_bucket'] && !isString(params['linode_bucket'])) {
1274
+ throw new errors.InvalidParameterError(`Bad parameter: linode_bucket must be of type String, received ${getType(params['linode_bucket'])}`)
1275
+ }
1276
+
1277
+ if (params['linode_region'] && !isString(params['linode_region'])) {
1278
+ throw new errors.InvalidParameterError(`Bad parameter: linode_region must be of type String, received ${getType(params['linode_region'])}`)
1279
+ }
1280
+
1217
1281
  const response = await Api.sendRequest(`/remote_servers`, 'POST', params, options)
1218
1282
 
1219
1283
  return new RemoteServer(response?.data, options)