files.com 1.1.18 → 1.2.0
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/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
package/lib/models/File.js
CHANGED
|
@@ -379,25 +379,25 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
379
379
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
380
380
|
case 5:
|
|
381
381
|
params.path = _this.attributes.path;
|
|
382
|
-
if (!(params
|
|
382
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
383
383
|
_context6.next = 8;
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
386
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
387
387
|
case 8:
|
|
388
|
-
if (!(params
|
|
388
|
+
if (!(params.action && !(0, _utils.isString)(params.action))) {
|
|
389
389
|
_context6.next = 10;
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
|
-
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params
|
|
392
|
+
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params.action)));
|
|
393
393
|
case 10:
|
|
394
|
-
if (!(params
|
|
394
|
+
if (!(params.preview_size && !(0, _utils.isString)(params.preview_size))) {
|
|
395
395
|
_context6.next = 12;
|
|
396
396
|
break;
|
|
397
397
|
}
|
|
398
|
-
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params
|
|
398
|
+
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params.preview_size)));
|
|
399
399
|
case 12:
|
|
400
|
-
if (params
|
|
400
|
+
if (params.path) {
|
|
401
401
|
_context6.next = 18;
|
|
402
402
|
break;
|
|
403
403
|
}
|
|
@@ -405,14 +405,14 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
405
405
|
_context6.next = 17;
|
|
406
406
|
break;
|
|
407
407
|
}
|
|
408
|
-
params
|
|
408
|
+
params.path = _this.path;
|
|
409
409
|
_context6.next = 18;
|
|
410
410
|
break;
|
|
411
411
|
case 17:
|
|
412
412
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
413
413
|
case 18:
|
|
414
414
|
_context6.next = 20;
|
|
415
|
-
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params
|
|
415
|
+
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'GET', params, _this.options);
|
|
416
416
|
case 20:
|
|
417
417
|
response = _context6.sent;
|
|
418
418
|
return _context6.abrupt("return", new File(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -446,25 +446,25 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
446
446
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
447
447
|
case 5:
|
|
448
448
|
params.path = _this.attributes.path;
|
|
449
|
-
if (!(params
|
|
449
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
450
450
|
_context7.next = 8;
|
|
451
451
|
break;
|
|
452
452
|
}
|
|
453
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
453
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
454
454
|
case 8:
|
|
455
|
-
if (!(params
|
|
455
|
+
if (!(params.provided_mtime && !(0, _utils.isString)(params.provided_mtime))) {
|
|
456
456
|
_context7.next = 10;
|
|
457
457
|
break;
|
|
458
458
|
}
|
|
459
|
-
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params
|
|
459
|
+
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params.provided_mtime)));
|
|
460
460
|
case 10:
|
|
461
|
-
if (!(params
|
|
461
|
+
if (!(params.priority_color && !(0, _utils.isString)(params.priority_color))) {
|
|
462
462
|
_context7.next = 12;
|
|
463
463
|
break;
|
|
464
464
|
}
|
|
465
|
-
throw new errors.InvalidParameterError("Bad parameter: priority_color must be of type String, received ".concat((0, _utils.getType)(params
|
|
465
|
+
throw new errors.InvalidParameterError("Bad parameter: priority_color must be of type String, received ".concat((0, _utils.getType)(params.priority_color)));
|
|
466
466
|
case 12:
|
|
467
|
-
if (params
|
|
467
|
+
if (params.path) {
|
|
468
468
|
_context7.next = 18;
|
|
469
469
|
break;
|
|
470
470
|
}
|
|
@@ -472,14 +472,14 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
472
472
|
_context7.next = 17;
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
475
|
-
params
|
|
475
|
+
params.path = _this.path;
|
|
476
476
|
_context7.next = 18;
|
|
477
477
|
break;
|
|
478
478
|
case 17:
|
|
479
479
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
480
480
|
case 18:
|
|
481
481
|
_context7.next = 20;
|
|
482
|
-
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params
|
|
482
|
+
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'PATCH', params, _this.options);
|
|
483
483
|
case 20:
|
|
484
484
|
response = _context7.sent;
|
|
485
485
|
return _context7.abrupt("return", new File(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -493,7 +493,6 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
493
493
|
// recursive - boolean - If true, will recursively delete folers. Otherwise, will error on non-empty folders.
|
|
494
494
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
495
495
|
var params,
|
|
496
|
-
response,
|
|
497
496
|
_args8 = arguments;
|
|
498
497
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
499
498
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -512,13 +511,13 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
512
511
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
513
512
|
case 5:
|
|
514
513
|
params.path = _this.attributes.path;
|
|
515
|
-
if (!(params
|
|
514
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
516
515
|
_context8.next = 8;
|
|
517
516
|
break;
|
|
518
517
|
}
|
|
519
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
518
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
520
519
|
case 8:
|
|
521
|
-
if (params
|
|
520
|
+
if (params.path) {
|
|
522
521
|
_context8.next = 14;
|
|
523
522
|
break;
|
|
524
523
|
}
|
|
@@ -526,18 +525,15 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
526
525
|
_context8.next = 13;
|
|
527
526
|
break;
|
|
528
527
|
}
|
|
529
|
-
params
|
|
528
|
+
params.path = _this.path;
|
|
530
529
|
_context8.next = 14;
|
|
531
530
|
break;
|
|
532
531
|
case 13:
|
|
533
532
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
534
533
|
case 14:
|
|
535
534
|
_context8.next = 16;
|
|
536
|
-
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params
|
|
535
|
+
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'DELETE', params, _this.options);
|
|
537
536
|
case 16:
|
|
538
|
-
response = _context8.sent;
|
|
539
|
-
return _context8.abrupt("return");
|
|
540
|
-
case 18:
|
|
541
537
|
case "end":
|
|
542
538
|
return _context8.stop();
|
|
543
539
|
}
|
|
@@ -574,19 +570,19 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
574
570
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
575
571
|
case 5:
|
|
576
572
|
params.path = _this.attributes.path;
|
|
577
|
-
if (!(params
|
|
573
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
578
574
|
_context9.next = 8;
|
|
579
575
|
break;
|
|
580
576
|
}
|
|
581
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
577
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
582
578
|
case 8:
|
|
583
|
-
if (!(params
|
|
579
|
+
if (!(params.destination && !(0, _utils.isString)(params.destination))) {
|
|
584
580
|
_context9.next = 10;
|
|
585
581
|
break;
|
|
586
582
|
}
|
|
587
|
-
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params
|
|
583
|
+
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
|
|
588
584
|
case 10:
|
|
589
|
-
if (params
|
|
585
|
+
if (params.path) {
|
|
590
586
|
_context9.next = 16;
|
|
591
587
|
break;
|
|
592
588
|
}
|
|
@@ -594,13 +590,13 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
594
590
|
_context9.next = 15;
|
|
595
591
|
break;
|
|
596
592
|
}
|
|
597
|
-
params
|
|
593
|
+
params.path = _this.path;
|
|
598
594
|
_context9.next = 16;
|
|
599
595
|
break;
|
|
600
596
|
case 15:
|
|
601
597
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
602
598
|
case 16:
|
|
603
|
-
if (params
|
|
599
|
+
if (params.destination) {
|
|
604
600
|
_context9.next = 22;
|
|
605
601
|
break;
|
|
606
602
|
}
|
|
@@ -608,17 +604,17 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
608
604
|
_context9.next = 21;
|
|
609
605
|
break;
|
|
610
606
|
}
|
|
611
|
-
params
|
|
607
|
+
params.destination = _this.destination;
|
|
612
608
|
_context9.next = 22;
|
|
613
609
|
break;
|
|
614
610
|
case 21:
|
|
615
611
|
throw new errors.MissingParameterError('Parameter missing: destination');
|
|
616
612
|
case 22:
|
|
617
613
|
_context9.next = 24;
|
|
618
|
-
return _Api.default.sendRequest("/file_actions/copy/".concat(encodeURIComponent(params
|
|
614
|
+
return _Api.default.sendRequest("/file_actions/copy/".concat(encodeURIComponent(params.path)), 'POST', params, _this.options);
|
|
619
615
|
case 24:
|
|
620
616
|
response = _context9.sent;
|
|
621
|
-
FileAction = require(
|
|
617
|
+
FileAction = require('./FileAction.js').default;
|
|
622
618
|
return _context9.abrupt("return", new FileAction(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
623
619
|
case 27:
|
|
624
620
|
case "end":
|
|
@@ -652,19 +648,19 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
652
648
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
653
649
|
case 5:
|
|
654
650
|
params.path = _this.attributes.path;
|
|
655
|
-
if (!(params
|
|
651
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
656
652
|
_context10.next = 8;
|
|
657
653
|
break;
|
|
658
654
|
}
|
|
659
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
655
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
660
656
|
case 8:
|
|
661
|
-
if (!(params
|
|
657
|
+
if (!(params.destination && !(0, _utils.isString)(params.destination))) {
|
|
662
658
|
_context10.next = 10;
|
|
663
659
|
break;
|
|
664
660
|
}
|
|
665
|
-
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params
|
|
661
|
+
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
|
|
666
662
|
case 10:
|
|
667
|
-
if (params
|
|
663
|
+
if (params.path) {
|
|
668
664
|
_context10.next = 16;
|
|
669
665
|
break;
|
|
670
666
|
}
|
|
@@ -672,13 +668,13 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
672
668
|
_context10.next = 15;
|
|
673
669
|
break;
|
|
674
670
|
}
|
|
675
|
-
params
|
|
671
|
+
params.path = _this.path;
|
|
676
672
|
_context10.next = 16;
|
|
677
673
|
break;
|
|
678
674
|
case 15:
|
|
679
675
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
680
676
|
case 16:
|
|
681
|
-
if (params
|
|
677
|
+
if (params.destination) {
|
|
682
678
|
_context10.next = 22;
|
|
683
679
|
break;
|
|
684
680
|
}
|
|
@@ -686,17 +682,17 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
686
682
|
_context10.next = 21;
|
|
687
683
|
break;
|
|
688
684
|
}
|
|
689
|
-
params
|
|
685
|
+
params.destination = _this.destination;
|
|
690
686
|
_context10.next = 22;
|
|
691
687
|
break;
|
|
692
688
|
case 21:
|
|
693
689
|
throw new errors.MissingParameterError('Parameter missing: destination');
|
|
694
690
|
case 22:
|
|
695
691
|
_context10.next = 24;
|
|
696
|
-
return _Api.default.sendRequest("/file_actions/move/".concat(encodeURIComponent(params
|
|
692
|
+
return _Api.default.sendRequest("/file_actions/move/".concat(encodeURIComponent(params.path)), 'POST', params, _this.options);
|
|
697
693
|
case 24:
|
|
698
694
|
response = _context10.sent;
|
|
699
|
-
FileAction = require(
|
|
695
|
+
FileAction = require('./FileAction.js').default;
|
|
700
696
|
return _context10.abrupt("return", new FileAction(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
701
697
|
case 27:
|
|
702
698
|
case "end":
|
|
@@ -737,43 +733,43 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
737
733
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
738
734
|
case 5:
|
|
739
735
|
params.path = _this.attributes.path;
|
|
740
|
-
if (!(params
|
|
736
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
741
737
|
_context11.next = 8;
|
|
742
738
|
break;
|
|
743
739
|
}
|
|
744
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
740
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
745
741
|
case 8:
|
|
746
|
-
if (!(params
|
|
742
|
+
if (!(params.part && !(0, _utils.isInt)(params.part))) {
|
|
747
743
|
_context11.next = 10;
|
|
748
744
|
break;
|
|
749
745
|
}
|
|
750
|
-
throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params
|
|
746
|
+
throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params.part)));
|
|
751
747
|
case 10:
|
|
752
|
-
if (!(params
|
|
748
|
+
if (!(params.parts && !(0, _utils.isInt)(params.parts))) {
|
|
753
749
|
_context11.next = 12;
|
|
754
750
|
break;
|
|
755
751
|
}
|
|
756
|
-
throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params
|
|
752
|
+
throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params.parts)));
|
|
757
753
|
case 12:
|
|
758
|
-
if (!(params
|
|
754
|
+
if (!(params.ref && !(0, _utils.isString)(params.ref))) {
|
|
759
755
|
_context11.next = 14;
|
|
760
756
|
break;
|
|
761
757
|
}
|
|
762
|
-
throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params
|
|
758
|
+
throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params.ref)));
|
|
763
759
|
case 14:
|
|
764
|
-
if (!(params
|
|
760
|
+
if (!(params.restart && !(0, _utils.isInt)(params.restart))) {
|
|
765
761
|
_context11.next = 16;
|
|
766
762
|
break;
|
|
767
763
|
}
|
|
768
|
-
throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params
|
|
764
|
+
throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params.restart)));
|
|
769
765
|
case 16:
|
|
770
|
-
if (!(params
|
|
766
|
+
if (!(params.size && !(0, _utils.isInt)(params.size))) {
|
|
771
767
|
_context11.next = 18;
|
|
772
768
|
break;
|
|
773
769
|
}
|
|
774
|
-
throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params
|
|
770
|
+
throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params.size)));
|
|
775
771
|
case 18:
|
|
776
|
-
if (params
|
|
772
|
+
if (params.path) {
|
|
777
773
|
_context11.next = 24;
|
|
778
774
|
break;
|
|
779
775
|
}
|
|
@@ -781,17 +777,17 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
781
777
|
_context11.next = 23;
|
|
782
778
|
break;
|
|
783
779
|
}
|
|
784
|
-
params
|
|
780
|
+
params.path = _this.path;
|
|
785
781
|
_context11.next = 24;
|
|
786
782
|
break;
|
|
787
783
|
case 23:
|
|
788
784
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
789
785
|
case 24:
|
|
790
786
|
_context11.next = 26;
|
|
791
|
-
return _Api.default.sendRequest("/file_actions/begin_upload/".concat(encodeURIComponent(params
|
|
787
|
+
return _Api.default.sendRequest("/file_actions/begin_upload/".concat(encodeURIComponent(params.path)), 'POST', params, _this.options);
|
|
792
788
|
case 26:
|
|
793
789
|
response = _context11.sent;
|
|
794
|
-
FileUploadPart = require(
|
|
790
|
+
FileUploadPart = require('./FileUploadPart.js').default;
|
|
795
791
|
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) {
|
|
796
792
|
return new FileUploadPart(obj, _this.options);
|
|
797
793
|
})) || []);
|
|
@@ -1220,75 +1216,75 @@ _class = File;
|
|
|
1220
1216
|
}
|
|
1221
1217
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
1222
1218
|
case 4:
|
|
1223
|
-
params
|
|
1224
|
-
if (params
|
|
1219
|
+
params.path = path;
|
|
1220
|
+
if (params.path) {
|
|
1225
1221
|
_context21.next = 7;
|
|
1226
1222
|
break;
|
|
1227
1223
|
}
|
|
1228
1224
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
1229
1225
|
case 7:
|
|
1230
|
-
if (!(params
|
|
1226
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
1231
1227
|
_context21.next = 9;
|
|
1232
1228
|
break;
|
|
1233
1229
|
}
|
|
1234
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
1230
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
1235
1231
|
case 9:
|
|
1236
|
-
if (!(params
|
|
1232
|
+
if (!(params.action && !(0, _utils.isString)(params.action))) {
|
|
1237
1233
|
_context21.next = 11;
|
|
1238
1234
|
break;
|
|
1239
1235
|
}
|
|
1240
|
-
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params
|
|
1236
|
+
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params.action)));
|
|
1241
1237
|
case 11:
|
|
1242
|
-
if (!(params
|
|
1238
|
+
if (!(params.length && !(0, _utils.isInt)(params.length))) {
|
|
1243
1239
|
_context21.next = 13;
|
|
1244
1240
|
break;
|
|
1245
1241
|
}
|
|
1246
|
-
throw new errors.InvalidParameterError("Bad parameter: length must be of type Int, received ".concat((0, _utils.getType)(params
|
|
1242
|
+
throw new errors.InvalidParameterError("Bad parameter: length must be of type Int, received ".concat((0, _utils.getType)(params.length)));
|
|
1247
1243
|
case 13:
|
|
1248
|
-
if (!(params
|
|
1244
|
+
if (!(params.part && !(0, _utils.isInt)(params.part))) {
|
|
1249
1245
|
_context21.next = 15;
|
|
1250
1246
|
break;
|
|
1251
1247
|
}
|
|
1252
|
-
throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params
|
|
1248
|
+
throw new errors.InvalidParameterError("Bad parameter: part must be of type Int, received ".concat((0, _utils.getType)(params.part)));
|
|
1253
1249
|
case 15:
|
|
1254
|
-
if (!(params
|
|
1250
|
+
if (!(params.parts && !(0, _utils.isInt)(params.parts))) {
|
|
1255
1251
|
_context21.next = 17;
|
|
1256
1252
|
break;
|
|
1257
1253
|
}
|
|
1258
|
-
throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params
|
|
1254
|
+
throw new errors.InvalidParameterError("Bad parameter: parts must be of type Int, received ".concat((0, _utils.getType)(params.parts)));
|
|
1259
1255
|
case 17:
|
|
1260
|
-
if (!(params
|
|
1256
|
+
if (!(params.provided_mtime && !(0, _utils.isString)(params.provided_mtime))) {
|
|
1261
1257
|
_context21.next = 19;
|
|
1262
1258
|
break;
|
|
1263
1259
|
}
|
|
1264
|
-
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params
|
|
1260
|
+
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params.provided_mtime)));
|
|
1265
1261
|
case 19:
|
|
1266
|
-
if (!(params
|
|
1262
|
+
if (!(params.ref && !(0, _utils.isString)(params.ref))) {
|
|
1267
1263
|
_context21.next = 21;
|
|
1268
1264
|
break;
|
|
1269
1265
|
}
|
|
1270
|
-
throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params
|
|
1266
|
+
throw new errors.InvalidParameterError("Bad parameter: ref must be of type String, received ".concat((0, _utils.getType)(params.ref)));
|
|
1271
1267
|
case 21:
|
|
1272
|
-
if (!(params
|
|
1268
|
+
if (!(params.restart && !(0, _utils.isInt)(params.restart))) {
|
|
1273
1269
|
_context21.next = 23;
|
|
1274
1270
|
break;
|
|
1275
1271
|
}
|
|
1276
|
-
throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params
|
|
1272
|
+
throw new errors.InvalidParameterError("Bad parameter: restart must be of type Int, received ".concat((0, _utils.getType)(params.restart)));
|
|
1277
1273
|
case 23:
|
|
1278
|
-
if (!(params
|
|
1274
|
+
if (!(params.size && !(0, _utils.isInt)(params.size))) {
|
|
1279
1275
|
_context21.next = 25;
|
|
1280
1276
|
break;
|
|
1281
1277
|
}
|
|
1282
|
-
throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params
|
|
1278
|
+
throw new errors.InvalidParameterError("Bad parameter: size must be of type Int, received ".concat((0, _utils.getType)(params.size)));
|
|
1283
1279
|
case 25:
|
|
1284
|
-
if (!(params
|
|
1280
|
+
if (!(params.structure && !(0, _utils.isString)(params.structure))) {
|
|
1285
1281
|
_context21.next = 27;
|
|
1286
1282
|
break;
|
|
1287
1283
|
}
|
|
1288
|
-
throw new errors.InvalidParameterError("Bad parameter: structure must be of type String, received ".concat((0, _utils.getType)(params
|
|
1284
|
+
throw new errors.InvalidParameterError("Bad parameter: structure must be of type String, received ".concat((0, _utils.getType)(params.structure)));
|
|
1289
1285
|
case 27:
|
|
1290
1286
|
_context21.next = 29;
|
|
1291
|
-
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params
|
|
1287
|
+
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'POST', params, options);
|
|
1292
1288
|
case 29:
|
|
1293
1289
|
response = _context21.sent;
|
|
1294
1290
|
return _context21.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -1324,27 +1320,27 @@ _class = File;
|
|
|
1324
1320
|
}
|
|
1325
1321
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
1326
1322
|
case 4:
|
|
1327
|
-
params
|
|
1328
|
-
if (params
|
|
1323
|
+
params.path = path;
|
|
1324
|
+
if (params.path) {
|
|
1329
1325
|
_context22.next = 7;
|
|
1330
1326
|
break;
|
|
1331
1327
|
}
|
|
1332
1328
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
1333
1329
|
case 7:
|
|
1334
|
-
if (!(params
|
|
1330
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
1335
1331
|
_context22.next = 9;
|
|
1336
1332
|
break;
|
|
1337
1333
|
}
|
|
1338
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
1334
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
1339
1335
|
case 9:
|
|
1340
|
-
if (!(params
|
|
1336
|
+
if (!(params.preview_size && !(0, _utils.isString)(params.preview_size))) {
|
|
1341
1337
|
_context22.next = 11;
|
|
1342
1338
|
break;
|
|
1343
1339
|
}
|
|
1344
|
-
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params
|
|
1340
|
+
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params.preview_size)));
|
|
1345
1341
|
case 11:
|
|
1346
1342
|
_context22.next = 13;
|
|
1347
|
-
return _Api.default.sendRequest("/file_actions/metadata/".concat(encodeURIComponent(params
|
|
1343
|
+
return _Api.default.sendRequest("/file_actions/metadata/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
|
1348
1344
|
case 13:
|
|
1349
1345
|
response = _context22.sent;
|
|
1350
1346
|
return _context22.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|