files.com 1.1.19 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/lib/Api.js +1 -1
- package/lib/Errors.js +345 -334
- 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 -178
- 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/Automation.js
CHANGED
@@ -211,7 +211,6 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
211
211
|
// Manually run automation
|
212
212
|
(0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
213
213
|
var params,
|
214
|
-
response,
|
215
214
|
_args = arguments;
|
216
215
|
return _regenerator.default.wrap(function _callee$(_context) {
|
217
216
|
while (1) switch (_context.prev = _context.next) {
|
@@ -230,13 +229,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
230
229
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
231
230
|
case 5:
|
232
231
|
params.id = _this.attributes.id;
|
233
|
-
if (!(params
|
232
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
234
233
|
_context.next = 8;
|
235
234
|
break;
|
236
235
|
}
|
237
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
236
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
238
237
|
case 8:
|
239
|
-
if (params
|
238
|
+
if (params.id) {
|
240
239
|
_context.next = 14;
|
241
240
|
break;
|
242
241
|
}
|
@@ -244,18 +243,15 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
244
243
|
_context.next = 13;
|
245
244
|
break;
|
246
245
|
}
|
247
|
-
params
|
246
|
+
params.id = _this.id;
|
248
247
|
_context.next = 14;
|
249
248
|
break;
|
250
249
|
case 13:
|
251
250
|
throw new errors.MissingParameterError('Parameter missing: id');
|
252
251
|
case 14:
|
253
252
|
_context.next = 16;
|
254
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params
|
253
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id), "/manual_run"), 'POST', params, _this.options);
|
255
254
|
case 16:
|
256
|
-
response = _context.sent;
|
257
|
-
return _context.abrupt("return");
|
258
|
-
case 18:
|
259
255
|
case "end":
|
260
256
|
return _context.stop();
|
261
257
|
}
|
@@ -303,109 +299,109 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
303
299
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
304
300
|
case 5:
|
305
301
|
params.id = _this.attributes.id;
|
306
|
-
if (!(params
|
302
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
307
303
|
_context2.next = 8;
|
308
304
|
break;
|
309
305
|
}
|
310
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
306
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
311
307
|
case 8:
|
312
|
-
if (!(params
|
308
|
+
if (!(params.source && !(0, _utils.isString)(params.source))) {
|
313
309
|
_context2.next = 10;
|
314
310
|
break;
|
315
311
|
}
|
316
|
-
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params
|
312
|
+
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params.source)));
|
317
313
|
case 10:
|
318
|
-
if (!(params
|
314
|
+
if (!(params.destination && !(0, _utils.isString)(params.destination))) {
|
319
315
|
_context2.next = 12;
|
320
316
|
break;
|
321
317
|
}
|
322
|
-
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params
|
318
|
+
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
|
323
319
|
case 12:
|
324
|
-
if (!(params
|
320
|
+
if (!(params.destinations && !(0, _utils.isArray)(params.destinations))) {
|
325
321
|
_context2.next = 14;
|
326
322
|
break;
|
327
323
|
}
|
328
|
-
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params
|
324
|
+
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params.destinations)));
|
329
325
|
case 14:
|
330
|
-
if (!(params
|
326
|
+
if (!(params.destination_replace_from && !(0, _utils.isString)(params.destination_replace_from))) {
|
331
327
|
_context2.next = 16;
|
332
328
|
break;
|
333
329
|
}
|
334
|
-
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params
|
330
|
+
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_from)));
|
335
331
|
case 16:
|
336
|
-
if (!(params
|
332
|
+
if (!(params.destination_replace_to && !(0, _utils.isString)(params.destination_replace_to))) {
|
337
333
|
_context2.next = 18;
|
338
334
|
break;
|
339
335
|
}
|
340
|
-
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params
|
336
|
+
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_to)));
|
341
337
|
case 18:
|
342
|
-
if (!(params
|
338
|
+
if (!(params.interval && !(0, _utils.isString)(params.interval))) {
|
343
339
|
_context2.next = 20;
|
344
340
|
break;
|
345
341
|
}
|
346
|
-
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params
|
342
|
+
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
|
347
343
|
case 20:
|
348
|
-
if (!(params
|
344
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
349
345
|
_context2.next = 22;
|
350
346
|
break;
|
351
347
|
}
|
352
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
348
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
353
349
|
case 22:
|
354
|
-
if (!(params
|
350
|
+
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
355
351
|
_context2.next = 24;
|
356
352
|
break;
|
357
353
|
}
|
358
|
-
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params
|
354
|
+
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
359
355
|
case 24:
|
360
|
-
if (!(params
|
356
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
361
357
|
_context2.next = 26;
|
362
358
|
break;
|
363
359
|
}
|
364
|
-
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params
|
360
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
365
361
|
case 26:
|
366
|
-
if (!(params
|
362
|
+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
367
363
|
_context2.next = 28;
|
368
364
|
break;
|
369
365
|
}
|
370
|
-
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params
|
366
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
371
367
|
case 28:
|
372
|
-
if (!(params
|
368
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
373
369
|
_context2.next = 30;
|
374
370
|
break;
|
375
371
|
}
|
376
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
372
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
377
373
|
case 30:
|
378
|
-
if (!(params
|
374
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
379
375
|
_context2.next = 32;
|
380
376
|
break;
|
381
377
|
}
|
382
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
378
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
383
379
|
case 32:
|
384
|
-
if (!(params
|
380
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
385
381
|
_context2.next = 34;
|
386
382
|
break;
|
387
383
|
}
|
388
|
-
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params
|
384
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
389
385
|
case 34:
|
390
|
-
if (!(params
|
386
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
391
387
|
_context2.next = 36;
|
392
388
|
break;
|
393
389
|
}
|
394
|
-
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params
|
390
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
395
391
|
case 36:
|
396
|
-
if (!(params
|
392
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
397
393
|
_context2.next = 38;
|
398
394
|
break;
|
399
395
|
}
|
400
|
-
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params
|
396
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
401
397
|
case 38:
|
402
|
-
if (!(params
|
398
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
403
399
|
_context2.next = 40;
|
404
400
|
break;
|
405
401
|
}
|
406
|
-
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params
|
402
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
407
403
|
case 40:
|
408
|
-
if (params
|
404
|
+
if (params.id) {
|
409
405
|
_context2.next = 46;
|
410
406
|
break;
|
411
407
|
}
|
@@ -413,14 +409,14 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
413
409
|
_context2.next = 45;
|
414
410
|
break;
|
415
411
|
}
|
416
|
-
params
|
412
|
+
params.id = _this.id;
|
417
413
|
_context2.next = 46;
|
418
414
|
break;
|
419
415
|
case 45:
|
420
416
|
throw new errors.MissingParameterError('Parameter missing: id');
|
421
417
|
case 46:
|
422
418
|
_context2.next = 48;
|
423
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params
|
419
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
424
420
|
case 48:
|
425
421
|
response = _context2.sent;
|
426
422
|
return _context2.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -432,7 +428,6 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
432
428
|
})));
|
433
429
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
434
430
|
var params,
|
435
|
-
response,
|
436
431
|
_args3 = arguments;
|
437
432
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
438
433
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -451,13 +446,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
451
446
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
452
447
|
case 5:
|
453
448
|
params.id = _this.attributes.id;
|
454
|
-
if (!(params
|
449
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
455
450
|
_context3.next = 8;
|
456
451
|
break;
|
457
452
|
}
|
458
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
453
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
459
454
|
case 8:
|
460
|
-
if (params
|
455
|
+
if (params.id) {
|
461
456
|
_context3.next = 14;
|
462
457
|
break;
|
463
458
|
}
|
@@ -465,18 +460,15 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
465
460
|
_context3.next = 13;
|
466
461
|
break;
|
467
462
|
}
|
468
|
-
params
|
463
|
+
params.id = _this.id;
|
469
464
|
_context3.next = 14;
|
470
465
|
break;
|
471
466
|
case 13:
|
472
467
|
throw new errors.MissingParameterError('Parameter missing: id');
|
473
468
|
case 14:
|
474
469
|
_context3.next = 16;
|
475
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params
|
470
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
476
471
|
case 16:
|
477
|
-
response = _context3.sent;
|
478
|
-
return _context3.abrupt("return");
|
479
|
-
case 18:
|
480
472
|
case "end":
|
481
473
|
return _context3.stop();
|
482
474
|
}
|
@@ -487,28 +479,28 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
487
479
|
return _this.delete(params);
|
488
480
|
});
|
489
481
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
490
|
-
var
|
482
|
+
var _newObject, newObject;
|
491
483
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
492
484
|
while (1) switch (_context4.prev = _context4.next) {
|
493
485
|
case 0:
|
494
|
-
if (!_this.attributes
|
495
|
-
_context4.next =
|
486
|
+
if (!_this.attributes.id) {
|
487
|
+
_context4.next = 6;
|
496
488
|
break;
|
497
489
|
}
|
498
490
|
_context4.next = 3;
|
499
491
|
return _this.update(_this.attributes);
|
500
492
|
case 3:
|
501
|
-
newObject = _context4.sent;
|
502
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
503
|
-
return _context4.abrupt("return", true);
|
504
|
-
case 8:
|
505
|
-
_context4.next = 10;
|
506
|
-
return Automation.create(_this.attributes, _this.options);
|
507
|
-
case 10:
|
508
493
|
_newObject = _context4.sent;
|
509
494
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
510
495
|
return _context4.abrupt("return", true);
|
511
|
-
case
|
496
|
+
case 6:
|
497
|
+
_context4.next = 8;
|
498
|
+
return Automation.create(_this.attributes, _this.options);
|
499
|
+
case 8:
|
500
|
+
newObject = _context4.sent;
|
501
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
502
|
+
return _context4.abrupt("return", true);
|
503
|
+
case 11:
|
512
504
|
case "end":
|
513
505
|
return _context4.stop();
|
514
506
|
}
|
@@ -549,20 +541,20 @@ _class = Automation;
|
|
549
541
|
case 0:
|
550
542
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
551
543
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
552
|
-
if (!(params
|
544
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
553
545
|
_context5.next = 4;
|
554
546
|
break;
|
555
547
|
}
|
556
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
548
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
557
549
|
case 4:
|
558
|
-
if (!(params
|
550
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
559
551
|
_context5.next = 6;
|
560
552
|
break;
|
561
553
|
}
|
562
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
554
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
563
555
|
case 6:
|
564
556
|
_context5.next = 8;
|
565
|
-
return _Api.default.sendRequest(
|
557
|
+
return _Api.default.sendRequest('/automations', 'GET', params, options);
|
566
558
|
case 8:
|
567
559
|
response = _context5.sent;
|
568
560
|
return _context5.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
@@ -598,21 +590,21 @@ _class = Automation;
|
|
598
590
|
}
|
599
591
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
600
592
|
case 4:
|
601
|
-
params
|
602
|
-
if (params
|
593
|
+
params.id = id;
|
594
|
+
if (params.id) {
|
603
595
|
_context6.next = 7;
|
604
596
|
break;
|
605
597
|
}
|
606
598
|
throw new errors.MissingParameterError('Parameter missing: id');
|
607
599
|
case 7:
|
608
|
-
if (!(params
|
600
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
609
601
|
_context6.next = 9;
|
610
602
|
break;
|
611
603
|
}
|
612
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
604
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
613
605
|
case 9:
|
614
606
|
_context6.next = 11;
|
615
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params
|
607
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
616
608
|
case 11:
|
617
609
|
response = _context6.sent;
|
618
610
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -662,110 +654,110 @@ _class = Automation;
|
|
662
654
|
case 0:
|
663
655
|
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
664
656
|
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
665
|
-
if (params
|
657
|
+
if (params.automation) {
|
666
658
|
_context7.next = 4;
|
667
659
|
break;
|
668
660
|
}
|
669
661
|
throw new errors.MissingParameterError('Parameter missing: automation');
|
670
662
|
case 4:
|
671
|
-
if (!(params
|
663
|
+
if (!(params.source && !(0, _utils.isString)(params.source))) {
|
672
664
|
_context7.next = 6;
|
673
665
|
break;
|
674
666
|
}
|
675
|
-
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params
|
667
|
+
throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params.source)));
|
676
668
|
case 6:
|
677
|
-
if (!(params
|
669
|
+
if (!(params.destination && !(0, _utils.isString)(params.destination))) {
|
678
670
|
_context7.next = 8;
|
679
671
|
break;
|
680
672
|
}
|
681
|
-
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params
|
673
|
+
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
|
682
674
|
case 8:
|
683
|
-
if (!(params
|
675
|
+
if (!(params.destinations && !(0, _utils.isArray)(params.destinations))) {
|
684
676
|
_context7.next = 10;
|
685
677
|
break;
|
686
678
|
}
|
687
|
-
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params
|
679
|
+
throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params.destinations)));
|
688
680
|
case 10:
|
689
|
-
if (!(params
|
681
|
+
if (!(params.destination_replace_from && !(0, _utils.isString)(params.destination_replace_from))) {
|
690
682
|
_context7.next = 12;
|
691
683
|
break;
|
692
684
|
}
|
693
|
-
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params
|
685
|
+
throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_from)));
|
694
686
|
case 12:
|
695
|
-
if (!(params
|
687
|
+
if (!(params.destination_replace_to && !(0, _utils.isString)(params.destination_replace_to))) {
|
696
688
|
_context7.next = 14;
|
697
689
|
break;
|
698
690
|
}
|
699
|
-
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params
|
691
|
+
throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params.destination_replace_to)));
|
700
692
|
case 14:
|
701
|
-
if (!(params
|
693
|
+
if (!(params.interval && !(0, _utils.isString)(params.interval))) {
|
702
694
|
_context7.next = 16;
|
703
695
|
break;
|
704
696
|
}
|
705
|
-
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params
|
697
|
+
throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params.interval)));
|
706
698
|
case 16:
|
707
|
-
if (!(params
|
699
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
708
700
|
_context7.next = 18;
|
709
701
|
break;
|
710
702
|
}
|
711
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
703
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
712
704
|
case 18:
|
713
|
-
if (!(params
|
705
|
+
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
714
706
|
_context7.next = 20;
|
715
707
|
break;
|
716
708
|
}
|
717
|
-
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params
|
709
|
+
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
718
710
|
case 20:
|
719
|
-
if (!(params
|
711
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
720
712
|
_context7.next = 22;
|
721
713
|
break;
|
722
714
|
}
|
723
|
-
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params
|
715
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
724
716
|
case 22:
|
725
|
-
if (!(params
|
717
|
+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
726
718
|
_context7.next = 24;
|
727
719
|
break;
|
728
720
|
}
|
729
|
-
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params
|
721
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
730
722
|
case 24:
|
731
|
-
if (!(params
|
723
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
732
724
|
_context7.next = 26;
|
733
725
|
break;
|
734
726
|
}
|
735
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
727
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
736
728
|
case 26:
|
737
|
-
if (!(params
|
729
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
738
730
|
_context7.next = 28;
|
739
731
|
break;
|
740
732
|
}
|
741
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
733
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
742
734
|
case 28:
|
743
|
-
if (!(params
|
735
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
744
736
|
_context7.next = 30;
|
745
737
|
break;
|
746
738
|
}
|
747
|
-
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params
|
739
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
748
740
|
case 30:
|
749
|
-
if (!(params
|
741
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
750
742
|
_context7.next = 32;
|
751
743
|
break;
|
752
744
|
}
|
753
|
-
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params
|
745
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
754
746
|
case 32:
|
755
|
-
if (!(params
|
747
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
756
748
|
_context7.next = 34;
|
757
749
|
break;
|
758
750
|
}
|
759
|
-
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params
|
751
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
760
752
|
case 34:
|
761
|
-
if (!(params
|
753
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
762
754
|
_context7.next = 36;
|
763
755
|
break;
|
764
756
|
}
|
765
|
-
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params
|
757
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
766
758
|
case 36:
|
767
759
|
_context7.next = 38;
|
768
|
-
return _Api.default.sendRequest(
|
760
|
+
return _Api.default.sendRequest('/automations', 'POST', params, options);
|
769
761
|
case 38:
|
770
762
|
response = _context7.sent;
|
771
763
|
return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -88,32 +88,32 @@ _class = AutomationRun;
|
|
88
88
|
case 0:
|
89
89
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
90
90
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
91
|
-
if (params
|
91
|
+
if (params.automation_id) {
|
92
92
|
_context.next = 4;
|
93
93
|
break;
|
94
94
|
}
|
95
95
|
throw new errors.MissingParameterError('Parameter missing: automation_id');
|
96
96
|
case 4:
|
97
|
-
if (!(params
|
97
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
98
98
|
_context.next = 6;
|
99
99
|
break;
|
100
100
|
}
|
101
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
101
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
102
102
|
case 6:
|
103
|
-
if (!(params
|
103
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
104
104
|
_context.next = 8;
|
105
105
|
break;
|
106
106
|
}
|
107
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
107
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
108
108
|
case 8:
|
109
|
-
if (!(params
|
109
|
+
if (!(params.automation_id && !(0, _utils.isInt)(params.automation_id))) {
|
110
110
|
_context.next = 10;
|
111
111
|
break;
|
112
112
|
}
|
113
|
-
throw new errors.InvalidParameterError("Bad parameter: automation_id must be of type Int, received ".concat((0, _utils.getType)(params
|
113
|
+
throw new errors.InvalidParameterError("Bad parameter: automation_id must be of type Int, received ".concat((0, _utils.getType)(params.automation_id)));
|
114
114
|
case 10:
|
115
115
|
_context.next = 12;
|
116
|
-
return _Api.default.sendRequest(
|
116
|
+
return _Api.default.sendRequest('/automation_runs', 'GET', params, options);
|
117
117
|
case 12:
|
118
118
|
response = _context.sent;
|
119
119
|
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) {
|
@@ -149,21 +149,21 @@ _class = AutomationRun;
|
|
149
149
|
}
|
150
150
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
151
151
|
case 4:
|
152
|
-
params
|
153
|
-
if (params
|
152
|
+
params.id = id;
|
153
|
+
if (params.id) {
|
154
154
|
_context2.next = 7;
|
155
155
|
break;
|
156
156
|
}
|
157
157
|
throw new errors.MissingParameterError('Parameter missing: id');
|
158
158
|
case 7:
|
159
|
-
if (!(params
|
159
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
160
160
|
_context2.next = 9;
|
161
161
|
break;
|
162
162
|
}
|
163
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
163
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
164
164
|
case 9:
|
165
165
|
_context2.next = 11;
|
166
|
-
return _Api.default.sendRequest("/automation_runs/".concat(encodeURIComponent(params
|
166
|
+
return _Api.default.sendRequest("/automation_runs/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
167
167
|
case 11:
|
168
168
|
response = _context2.sent;
|
169
169
|
return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -103,20 +103,20 @@ _class = BandwidthSnapshot;
|
|
103
103
|
case 0:
|
104
104
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
105
105
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
106
|
-
if (!(params
|
106
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
107
107
|
_context.next = 4;
|
108
108
|
break;
|
109
109
|
}
|
110
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
110
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
111
111
|
case 4:
|
112
|
-
if (!(params
|
112
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
113
113
|
_context.next = 6;
|
114
114
|
break;
|
115
115
|
}
|
116
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
116
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
117
117
|
case 6:
|
118
118
|
_context.next = 8;
|
119
|
-
return _Api.default.sendRequest(
|
119
|
+
return _Api.default.sendRequest('/bandwidth_snapshots', 'GET', params, options);
|
120
120
|
case 8:
|
121
121
|
response = _context.sent;
|
122
122
|
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) {
|