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/Bundle.js
CHANGED
|
@@ -339,7 +339,6 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
339
339
|
// recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
|
|
340
340
|
(0, _defineProperty2.default)(this, "share", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
341
341
|
var params,
|
|
342
|
-
response,
|
|
343
342
|
_args = arguments;
|
|
344
343
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
345
344
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -358,31 +357,31 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
358
357
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
359
358
|
case 5:
|
|
360
359
|
params.id = _this.attributes.id;
|
|
361
|
-
if (!(params
|
|
360
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
362
361
|
_context.next = 8;
|
|
363
362
|
break;
|
|
364
363
|
}
|
|
365
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
364
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
366
365
|
case 8:
|
|
367
|
-
if (!(params
|
|
366
|
+
if (!(params.to && !(0, _utils.isArray)(params.to))) {
|
|
368
367
|
_context.next = 10;
|
|
369
368
|
break;
|
|
370
369
|
}
|
|
371
|
-
throw new errors.InvalidParameterError("Bad parameter: to must be of type Array, received ".concat((0, _utils.getType)(params
|
|
370
|
+
throw new errors.InvalidParameterError("Bad parameter: to must be of type Array, received ".concat((0, _utils.getType)(params.to)));
|
|
372
371
|
case 10:
|
|
373
|
-
if (!(params
|
|
372
|
+
if (!(params.note && !(0, _utils.isString)(params.note))) {
|
|
374
373
|
_context.next = 12;
|
|
375
374
|
break;
|
|
376
375
|
}
|
|
377
|
-
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params
|
|
376
|
+
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params.note)));
|
|
378
377
|
case 12:
|
|
379
|
-
if (!(params
|
|
378
|
+
if (!(params.recipients && !(0, _utils.isArray)(params.recipients))) {
|
|
380
379
|
_context.next = 14;
|
|
381
380
|
break;
|
|
382
381
|
}
|
|
383
|
-
throw new errors.InvalidParameterError("Bad parameter: recipients must be of type Array, received ".concat((0, _utils.getType)(params
|
|
382
|
+
throw new errors.InvalidParameterError("Bad parameter: recipients must be of type Array, received ".concat((0, _utils.getType)(params.recipients)));
|
|
384
383
|
case 14:
|
|
385
|
-
if (params
|
|
384
|
+
if (params.id) {
|
|
386
385
|
_context.next = 20;
|
|
387
386
|
break;
|
|
388
387
|
}
|
|
@@ -390,18 +389,15 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
390
389
|
_context.next = 19;
|
|
391
390
|
break;
|
|
392
391
|
}
|
|
393
|
-
params
|
|
392
|
+
params.id = _this.id;
|
|
394
393
|
_context.next = 20;
|
|
395
394
|
break;
|
|
396
395
|
case 19:
|
|
397
396
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
398
397
|
case 20:
|
|
399
398
|
_context.next = 22;
|
|
400
|
-
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params
|
|
399
|
+
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id), "/share"), 'POST', params, _this.options);
|
|
401
400
|
case 22:
|
|
402
|
-
response = _context.sent;
|
|
403
|
-
return _context.abrupt("return");
|
|
404
|
-
case 24:
|
|
405
401
|
case "end":
|
|
406
402
|
return _context.stop();
|
|
407
403
|
}
|
|
@@ -454,91 +450,91 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
454
450
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
455
451
|
case 5:
|
|
456
452
|
params.id = _this.attributes.id;
|
|
457
|
-
if (!(params
|
|
453
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
458
454
|
_context2.next = 8;
|
|
459
455
|
break;
|
|
460
456
|
}
|
|
461
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
457
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
462
458
|
case 8:
|
|
463
|
-
if (!(params
|
|
459
|
+
if (!(params.paths && !(0, _utils.isArray)(params.paths))) {
|
|
464
460
|
_context2.next = 10;
|
|
465
461
|
break;
|
|
466
462
|
}
|
|
467
|
-
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params
|
|
463
|
+
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params.paths)));
|
|
468
464
|
case 10:
|
|
469
|
-
if (!(params
|
|
465
|
+
if (!(params.password && !(0, _utils.isString)(params.password))) {
|
|
470
466
|
_context2.next = 12;
|
|
471
467
|
break;
|
|
472
468
|
}
|
|
473
|
-
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params
|
|
469
|
+
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params.password)));
|
|
474
470
|
case 12:
|
|
475
|
-
if (!(params
|
|
471
|
+
if (!(params.form_field_set_id && !(0, _utils.isInt)(params.form_field_set_id))) {
|
|
476
472
|
_context2.next = 14;
|
|
477
473
|
break;
|
|
478
474
|
}
|
|
479
|
-
throw new errors.InvalidParameterError("Bad parameter: form_field_set_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
475
|
+
throw new errors.InvalidParameterError("Bad parameter: form_field_set_id must be of type Int, received ".concat((0, _utils.getType)(params.form_field_set_id)));
|
|
480
476
|
case 14:
|
|
481
|
-
if (!(params
|
|
477
|
+
if (!(params.clickwrap_id && !(0, _utils.isInt)(params.clickwrap_id))) {
|
|
482
478
|
_context2.next = 16;
|
|
483
479
|
break;
|
|
484
480
|
}
|
|
485
|
-
throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
481
|
+
throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params.clickwrap_id)));
|
|
486
482
|
case 16:
|
|
487
|
-
if (!(params
|
|
483
|
+
if (!(params.code && !(0, _utils.isString)(params.code))) {
|
|
488
484
|
_context2.next = 18;
|
|
489
485
|
break;
|
|
490
486
|
}
|
|
491
|
-
throw new errors.InvalidParameterError("Bad parameter: code must be of type String, received ".concat((0, _utils.getType)(params
|
|
487
|
+
throw new errors.InvalidParameterError("Bad parameter: code must be of type String, received ".concat((0, _utils.getType)(params.code)));
|
|
492
488
|
case 18:
|
|
493
|
-
if (!(params
|
|
489
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
494
490
|
_context2.next = 20;
|
|
495
491
|
break;
|
|
496
492
|
}
|
|
497
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
|
493
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
498
494
|
case 20:
|
|
499
|
-
if (!(params
|
|
495
|
+
if (!(params.expires_at && !(0, _utils.isString)(params.expires_at))) {
|
|
500
496
|
_context2.next = 22;
|
|
501
497
|
break;
|
|
502
498
|
}
|
|
503
|
-
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params
|
|
499
|
+
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params.expires_at)));
|
|
504
500
|
case 22:
|
|
505
|
-
if (!(params
|
|
501
|
+
if (!(params.inbox_id && !(0, _utils.isInt)(params.inbox_id))) {
|
|
506
502
|
_context2.next = 24;
|
|
507
503
|
break;
|
|
508
504
|
}
|
|
509
|
-
throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
505
|
+
throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params.inbox_id)));
|
|
510
506
|
case 24:
|
|
511
|
-
if (!(params
|
|
507
|
+
if (!(params.max_uses && !(0, _utils.isInt)(params.max_uses))) {
|
|
512
508
|
_context2.next = 26;
|
|
513
509
|
break;
|
|
514
510
|
}
|
|
515
|
-
throw new errors.InvalidParameterError("Bad parameter: max_uses must be of type Int, received ".concat((0, _utils.getType)(params
|
|
511
|
+
throw new errors.InvalidParameterError("Bad parameter: max_uses must be of type Int, received ".concat((0, _utils.getType)(params.max_uses)));
|
|
516
512
|
case 26:
|
|
517
|
-
if (!(params
|
|
513
|
+
if (!(params.note && !(0, _utils.isString)(params.note))) {
|
|
518
514
|
_context2.next = 28;
|
|
519
515
|
break;
|
|
520
516
|
}
|
|
521
|
-
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params
|
|
517
|
+
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params.note)));
|
|
522
518
|
case 28:
|
|
523
|
-
if (!(params
|
|
519
|
+
if (!(params.path_template && !(0, _utils.isString)(params.path_template))) {
|
|
524
520
|
_context2.next = 30;
|
|
525
521
|
break;
|
|
526
522
|
}
|
|
527
|
-
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params
|
|
523
|
+
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params.path_template)));
|
|
528
524
|
case 30:
|
|
529
|
-
if (!(params
|
|
525
|
+
if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
|
|
530
526
|
_context2.next = 32;
|
|
531
527
|
break;
|
|
532
528
|
}
|
|
533
|
-
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params
|
|
529
|
+
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
|
|
534
530
|
case 32:
|
|
535
|
-
if (!(params
|
|
531
|
+
if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
|
|
536
532
|
_context2.next = 34;
|
|
537
533
|
break;
|
|
538
534
|
}
|
|
539
|
-
throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params
|
|
535
|
+
throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
|
|
540
536
|
case 34:
|
|
541
|
-
if (params
|
|
537
|
+
if (params.id) {
|
|
542
538
|
_context2.next = 40;
|
|
543
539
|
break;
|
|
544
540
|
}
|
|
@@ -546,14 +542,14 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
546
542
|
_context2.next = 39;
|
|
547
543
|
break;
|
|
548
544
|
}
|
|
549
|
-
params
|
|
545
|
+
params.id = _this.id;
|
|
550
546
|
_context2.next = 40;
|
|
551
547
|
break;
|
|
552
548
|
case 39:
|
|
553
549
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
554
550
|
case 40:
|
|
555
551
|
_context2.next = 42;
|
|
556
|
-
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params
|
|
552
|
+
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
557
553
|
case 42:
|
|
558
554
|
response = _context2.sent;
|
|
559
555
|
return _context2.abrupt("return", new Bundle(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -565,7 +561,6 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
565
561
|
})));
|
|
566
562
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
567
563
|
var params,
|
|
568
|
-
response,
|
|
569
564
|
_args3 = arguments;
|
|
570
565
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
571
566
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -584,13 +579,13 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
584
579
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
585
580
|
case 5:
|
|
586
581
|
params.id = _this.attributes.id;
|
|
587
|
-
if (!(params
|
|
582
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
588
583
|
_context3.next = 8;
|
|
589
584
|
break;
|
|
590
585
|
}
|
|
591
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
586
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
592
587
|
case 8:
|
|
593
|
-
if (params
|
|
588
|
+
if (params.id) {
|
|
594
589
|
_context3.next = 14;
|
|
595
590
|
break;
|
|
596
591
|
}
|
|
@@ -598,18 +593,15 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
598
593
|
_context3.next = 13;
|
|
599
594
|
break;
|
|
600
595
|
}
|
|
601
|
-
params
|
|
596
|
+
params.id = _this.id;
|
|
602
597
|
_context3.next = 14;
|
|
603
598
|
break;
|
|
604
599
|
case 13:
|
|
605
600
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
606
601
|
case 14:
|
|
607
602
|
_context3.next = 16;
|
|
608
|
-
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params
|
|
603
|
+
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
609
604
|
case 16:
|
|
610
|
-
response = _context3.sent;
|
|
611
|
-
return _context3.abrupt("return");
|
|
612
|
-
case 18:
|
|
613
605
|
case "end":
|
|
614
606
|
return _context3.stop();
|
|
615
607
|
}
|
|
@@ -620,28 +612,28 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
|
620
612
|
return _this.delete(params);
|
|
621
613
|
});
|
|
622
614
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
623
|
-
var
|
|
615
|
+
var _newObject, newObject;
|
|
624
616
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
625
617
|
while (1) switch (_context4.prev = _context4.next) {
|
|
626
618
|
case 0:
|
|
627
|
-
if (!_this.attributes
|
|
628
|
-
_context4.next =
|
|
619
|
+
if (!_this.attributes.id) {
|
|
620
|
+
_context4.next = 6;
|
|
629
621
|
break;
|
|
630
622
|
}
|
|
631
623
|
_context4.next = 3;
|
|
632
624
|
return _this.update(_this.attributes);
|
|
633
625
|
case 3:
|
|
634
|
-
newObject = _context4.sent;
|
|
635
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
636
|
-
return _context4.abrupt("return", true);
|
|
637
|
-
case 8:
|
|
638
|
-
_context4.next = 10;
|
|
639
|
-
return Bundle.create(_this.attributes, _this.options);
|
|
640
|
-
case 10:
|
|
641
626
|
_newObject = _context4.sent;
|
|
642
627
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
643
628
|
return _context4.abrupt("return", true);
|
|
644
|
-
case
|
|
629
|
+
case 6:
|
|
630
|
+
_context4.next = 8;
|
|
631
|
+
return Bundle.create(_this.attributes, _this.options);
|
|
632
|
+
case 8:
|
|
633
|
+
newObject = _context4.sent;
|
|
634
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
635
|
+
return _context4.abrupt("return", true);
|
|
636
|
+
case 11:
|
|
645
637
|
case "end":
|
|
646
638
|
return _context4.stop();
|
|
647
639
|
}
|
|
@@ -682,26 +674,26 @@ _class = Bundle;
|
|
|
682
674
|
case 0:
|
|
683
675
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
684
676
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
685
|
-
if (!(params
|
|
677
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
686
678
|
_context5.next = 4;
|
|
687
679
|
break;
|
|
688
680
|
}
|
|
689
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
681
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
690
682
|
case 4:
|
|
691
|
-
if (!(params
|
|
683
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
692
684
|
_context5.next = 6;
|
|
693
685
|
break;
|
|
694
686
|
}
|
|
695
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
687
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
696
688
|
case 6:
|
|
697
|
-
if (!(params
|
|
689
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
698
690
|
_context5.next = 8;
|
|
699
691
|
break;
|
|
700
692
|
}
|
|
701
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
693
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
702
694
|
case 8:
|
|
703
695
|
_context5.next = 10;
|
|
704
|
-
return _Api.default.sendRequest(
|
|
696
|
+
return _Api.default.sendRequest('/bundles', 'GET', params, options);
|
|
705
697
|
case 10:
|
|
706
698
|
response = _context5.sent;
|
|
707
699
|
return _context5.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
|
@@ -737,21 +729,21 @@ _class = Bundle;
|
|
|
737
729
|
}
|
|
738
730
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
739
731
|
case 4:
|
|
740
|
-
params
|
|
741
|
-
if (params
|
|
732
|
+
params.id = id;
|
|
733
|
+
if (params.id) {
|
|
742
734
|
_context6.next = 7;
|
|
743
735
|
break;
|
|
744
736
|
}
|
|
745
737
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
746
738
|
case 7:
|
|
747
|
-
if (!(params
|
|
739
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
748
740
|
_context6.next = 9;
|
|
749
741
|
break;
|
|
750
742
|
}
|
|
751
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
743
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
752
744
|
case 9:
|
|
753
745
|
_context6.next = 11;
|
|
754
|
-
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params
|
|
746
|
+
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
755
747
|
case 11:
|
|
756
748
|
response = _context6.sent;
|
|
757
749
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -807,104 +799,104 @@ _class = Bundle;
|
|
|
807
799
|
case 0:
|
|
808
800
|
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
|
809
801
|
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
810
|
-
if (params
|
|
802
|
+
if (params.paths) {
|
|
811
803
|
_context7.next = 4;
|
|
812
804
|
break;
|
|
813
805
|
}
|
|
814
806
|
throw new errors.MissingParameterError('Parameter missing: paths');
|
|
815
807
|
case 4:
|
|
816
|
-
if (!(params
|
|
808
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
817
809
|
_context7.next = 6;
|
|
818
810
|
break;
|
|
819
811
|
}
|
|
820
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
812
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
821
813
|
case 6:
|
|
822
|
-
if (!(params
|
|
814
|
+
if (!(params.paths && !(0, _utils.isArray)(params.paths))) {
|
|
823
815
|
_context7.next = 8;
|
|
824
816
|
break;
|
|
825
817
|
}
|
|
826
|
-
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params
|
|
818
|
+
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params.paths)));
|
|
827
819
|
case 8:
|
|
828
|
-
if (!(params
|
|
820
|
+
if (!(params.password && !(0, _utils.isString)(params.password))) {
|
|
829
821
|
_context7.next = 10;
|
|
830
822
|
break;
|
|
831
823
|
}
|
|
832
|
-
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params
|
|
824
|
+
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params.password)));
|
|
833
825
|
case 10:
|
|
834
|
-
if (!(params
|
|
826
|
+
if (!(params.form_field_set_id && !(0, _utils.isInt)(params.form_field_set_id))) {
|
|
835
827
|
_context7.next = 12;
|
|
836
828
|
break;
|
|
837
829
|
}
|
|
838
|
-
throw new errors.InvalidParameterError("Bad parameter: form_field_set_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
830
|
+
throw new errors.InvalidParameterError("Bad parameter: form_field_set_id must be of type Int, received ".concat((0, _utils.getType)(params.form_field_set_id)));
|
|
839
831
|
case 12:
|
|
840
|
-
if (!(params
|
|
832
|
+
if (!(params.expires_at && !(0, _utils.isString)(params.expires_at))) {
|
|
841
833
|
_context7.next = 14;
|
|
842
834
|
break;
|
|
843
835
|
}
|
|
844
|
-
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params
|
|
836
|
+
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params.expires_at)));
|
|
845
837
|
case 14:
|
|
846
|
-
if (!(params
|
|
838
|
+
if (!(params.max_uses && !(0, _utils.isInt)(params.max_uses))) {
|
|
847
839
|
_context7.next = 16;
|
|
848
840
|
break;
|
|
849
841
|
}
|
|
850
|
-
throw new errors.InvalidParameterError("Bad parameter: max_uses must be of type Int, received ".concat((0, _utils.getType)(params
|
|
842
|
+
throw new errors.InvalidParameterError("Bad parameter: max_uses must be of type Int, received ".concat((0, _utils.getType)(params.max_uses)));
|
|
851
843
|
case 16:
|
|
852
|
-
if (!(params
|
|
844
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
853
845
|
_context7.next = 18;
|
|
854
846
|
break;
|
|
855
847
|
}
|
|
856
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
|
848
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
857
849
|
case 18:
|
|
858
|
-
if (!(params
|
|
850
|
+
if (!(params.note && !(0, _utils.isString)(params.note))) {
|
|
859
851
|
_context7.next = 20;
|
|
860
852
|
break;
|
|
861
853
|
}
|
|
862
|
-
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params
|
|
854
|
+
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params.note)));
|
|
863
855
|
case 20:
|
|
864
|
-
if (!(params
|
|
856
|
+
if (!(params.code && !(0, _utils.isString)(params.code))) {
|
|
865
857
|
_context7.next = 22;
|
|
866
858
|
break;
|
|
867
859
|
}
|
|
868
|
-
throw new errors.InvalidParameterError("Bad parameter: code must be of type String, received ".concat((0, _utils.getType)(params
|
|
860
|
+
throw new errors.InvalidParameterError("Bad parameter: code must be of type String, received ".concat((0, _utils.getType)(params.code)));
|
|
869
861
|
case 22:
|
|
870
|
-
if (!(params
|
|
862
|
+
if (!(params.path_template && !(0, _utils.isString)(params.path_template))) {
|
|
871
863
|
_context7.next = 24;
|
|
872
864
|
break;
|
|
873
865
|
}
|
|
874
|
-
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params
|
|
866
|
+
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params.path_template)));
|
|
875
867
|
case 24:
|
|
876
|
-
if (!(params
|
|
868
|
+
if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
|
|
877
869
|
_context7.next = 26;
|
|
878
870
|
break;
|
|
879
871
|
}
|
|
880
|
-
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params
|
|
872
|
+
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
|
|
881
873
|
case 26:
|
|
882
|
-
if (!(params
|
|
874
|
+
if (!(params.clickwrap_id && !(0, _utils.isInt)(params.clickwrap_id))) {
|
|
883
875
|
_context7.next = 28;
|
|
884
876
|
break;
|
|
885
877
|
}
|
|
886
|
-
throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
878
|
+
throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params.clickwrap_id)));
|
|
887
879
|
case 28:
|
|
888
|
-
if (!(params
|
|
880
|
+
if (!(params.inbox_id && !(0, _utils.isInt)(params.inbox_id))) {
|
|
889
881
|
_context7.next = 30;
|
|
890
882
|
break;
|
|
891
883
|
}
|
|
892
|
-
throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
884
|
+
throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params.inbox_id)));
|
|
893
885
|
case 30:
|
|
894
|
-
if (!(params
|
|
886
|
+
if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
|
|
895
887
|
_context7.next = 32;
|
|
896
888
|
break;
|
|
897
889
|
}
|
|
898
|
-
throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params
|
|
890
|
+
throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
|
|
899
891
|
case 32:
|
|
900
|
-
if (!(params
|
|
892
|
+
if (!(params.snapshot_id && !(0, _utils.isInt)(params.snapshot_id))) {
|
|
901
893
|
_context7.next = 34;
|
|
902
894
|
break;
|
|
903
895
|
}
|
|
904
|
-
throw new errors.InvalidParameterError("Bad parameter: snapshot_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
896
|
+
throw new errors.InvalidParameterError("Bad parameter: snapshot_id must be of type Int, received ".concat((0, _utils.getType)(params.snapshot_id)));
|
|
905
897
|
case 34:
|
|
906
898
|
_context7.next = 36;
|
|
907
|
-
return _Api.default.sendRequest(
|
|
899
|
+
return _Api.default.sendRequest('/bundles', 'POST', params, options);
|
|
908
900
|
case 36:
|
|
909
901
|
response = _context7.sent;
|
|
910
902
|
return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -85,32 +85,32 @@ _class = BundleDownload;
|
|
|
85
85
|
case 0:
|
|
86
86
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
87
87
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
88
|
-
if (!(params
|
|
88
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
89
89
|
_context.next = 4;
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
92
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
93
93
|
case 4:
|
|
94
|
-
if (!(params
|
|
94
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
95
95
|
_context.next = 6;
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
98
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
99
99
|
case 6:
|
|
100
|
-
if (!(params
|
|
100
|
+
if (!(params.bundle_id && !(0, _utils.isInt)(params.bundle_id))) {
|
|
101
101
|
_context.next = 8;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
|
-
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
104
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_id)));
|
|
105
105
|
case 8:
|
|
106
|
-
if (!(params
|
|
106
|
+
if (!(params.bundle_registration_id && !(0, _utils.isInt)(params.bundle_registration_id))) {
|
|
107
107
|
_context.next = 10;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
|
-
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
110
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_registration_id)));
|
|
111
111
|
case 10:
|
|
112
112
|
_context.next = 12;
|
|
113
|
-
return _Api.default.sendRequest(
|
|
113
|
+
return _Api.default.sendRequest('/bundle_downloads', 'GET', params, options);
|
|
114
114
|
case 12:
|
|
115
115
|
response = _context.sent;
|
|
116
116
|
return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|