files.com 1.0.235 → 1.0.237

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/Bundle.md +9 -2
  3. package/docs/models/BundleNotification.md +35 -0
  4. package/docs/models/BundleRegistration.md +3 -1
  5. package/docs/models/InboxRegistration.md +3 -1
  6. package/docs/models/Site.md +2 -0
  7. package/lib/Api.js +153 -159
  8. package/lib/isomorphic/File.node.js +24 -28
  9. package/lib/models/ActionNotificationExport.js +97 -101
  10. package/lib/models/ActionNotificationExportResult.js +44 -46
  11. package/lib/models/ActionWebhookFailure.js +42 -44
  12. package/lib/models/ApiKey.js +271 -287
  13. package/lib/models/App.js +26 -28
  14. package/lib/models/As2IncomingMessage.js +32 -34
  15. package/lib/models/As2OutgoingMessage.js +32 -34
  16. package/lib/models/As2Partner.js +231 -241
  17. package/lib/models/As2Station.js +219 -229
  18. package/lib/models/Automation.js +333 -343
  19. package/lib/models/AutomationRun.js +75 -79
  20. package/lib/models/BandwidthSnapshot.js +26 -28
  21. package/lib/models/Behavior.js +323 -337
  22. package/lib/models/Bundle.js +381 -387
  23. package/lib/models/BundleDownload.js +38 -40
  24. package/lib/models/BundleNotification.js +223 -173
  25. package/lib/models/BundleRecipient.js +104 -108
  26. package/lib/models/BundleRegistration.js +41 -40
  27. package/lib/models/Clickwrap.js +213 -223
  28. package/lib/models/DnsRecord.js +26 -28
  29. package/lib/models/ExternalEvent.js +93 -99
  30. package/lib/models/File.js +726 -766
  31. package/lib/models/FileComment.js +180 -188
  32. package/lib/models/FileCommentReaction.js +84 -88
  33. package/lib/models/FileMigration.js +31 -33
  34. package/lib/models/Folder.js +94 -98
  35. package/lib/models/FormFieldSet.js +189 -199
  36. package/lib/models/Group.js +207 -217
  37. package/lib/models/GroupUser.js +230 -238
  38. package/lib/models/History.js +266 -276
  39. package/lib/models/HistoryExport.js +175 -179
  40. package/lib/models/HistoryExportResult.js +44 -46
  41. package/lib/models/InboxRecipient.js +104 -108
  42. package/lib/models/InboxRegistration.js +35 -34
  43. package/lib/models/InboxUpload.js +38 -40
  44. package/lib/models/Invoice.js +57 -61
  45. package/lib/models/IpAddress.js +78 -84
  46. package/lib/models/Lock.js +148 -154
  47. package/lib/models/Message.js +267 -277
  48. package/lib/models/MessageComment.js +207 -217
  49. package/lib/models/MessageCommentReaction.js +147 -155
  50. package/lib/models/MessageReaction.js +147 -155
  51. package/lib/models/Notification.js +255 -265
  52. package/lib/models/Payment.js +57 -61
  53. package/lib/models/Permission.js +128 -134
  54. package/lib/models/Priority.js +45 -47
  55. package/lib/models/Project.js +183 -193
  56. package/lib/models/PublicKey.js +207 -217
  57. package/lib/models/RemoteBandwidthSnapshot.js +26 -28
  58. package/lib/models/RemoteServer.js +805 -819
  59. package/lib/models/Request.js +166 -174
  60. package/lib/models/Session.js +47 -51
  61. package/lib/models/SettingsChange.js +26 -28
  62. package/lib/models/SftpHostKey.js +177 -187
  63. package/lib/models/Site.js +415 -418
  64. package/lib/models/SsoStrategy.js +99 -105
  65. package/lib/models/Style.js +127 -133
  66. package/lib/models/UsageDailySnapshot.js +26 -28
  67. package/lib/models/UsageSnapshot.js +26 -28
  68. package/lib/models/User.js +587 -603
  69. package/lib/models/UserCipherUse.js +32 -34
  70. package/lib/models/UserRequest.js +147 -155
  71. package/lib/models/WebhookTest.js +54 -56
  72. package/package.json +1 -1
  73. package/src/models/Bundle.js +10 -1
  74. package/src/models/BundleNotification.js +39 -1
  75. package/src/models/BundleRegistration.js +3 -0
  76. package/src/models/InboxRegistration.js +3 -0
  77. package/src/models/Site.js +3 -0
@@ -168,136 +168,134 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
168
168
  response,
169
169
  _args = arguments;
170
170
  return _regenerator.default.wrap(function _callee$(_context) {
171
- while (1) {
172
- switch (_context.prev = _context.next) {
173
- case 0:
174
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
175
- if (_this.attributes.id) {
176
- _context.next = 3;
177
- break;
178
- }
179
- throw new errors.EmptyPropertyError('Current object has no id');
180
- case 3:
181
- if ((0, _utils.isObject)(params)) {
182
- _context.next = 5;
183
- break;
184
- }
185
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
186
- case 5:
187
- params.id = _this.attributes.id;
188
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
189
- _context.next = 8;
190
- break;
191
- }
192
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
193
- case 8:
194
- if (!(params['source'] && !(0, _utils.isString)(params['source']))) {
195
- _context.next = 10;
196
- break;
197
- }
198
- throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(source)));
199
- case 10:
200
- if (!(params['destination'] && !(0, _utils.isString)(params['destination']))) {
201
- _context.next = 12;
202
- break;
203
- }
204
- throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(destination)));
205
- case 12:
206
- if (!(params['destinations'] && !(0, _utils.isArray)(params['destinations']))) {
207
- _context.next = 14;
208
- break;
209
- }
210
- throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(destinations)));
211
- case 14:
212
- if (!(params['destination_replace_from'] && !(0, _utils.isString)(params['destination_replace_from']))) {
213
- _context.next = 16;
214
- break;
215
- }
216
- throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(destination_replace_from)));
217
- case 16:
218
- if (!(params['destination_replace_to'] && !(0, _utils.isString)(params['destination_replace_to']))) {
219
- _context.next = 18;
220
- break;
221
- }
222
- throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(destination_replace_to)));
223
- case 18:
224
- if (!(params['interval'] && !(0, _utils.isString)(params['interval']))) {
225
- _context.next = 20;
226
- break;
227
- }
228
- throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(interval)));
229
- case 20:
230
- if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
231
- _context.next = 22;
232
- break;
233
- }
234
- throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(path)));
235
- case 22:
236
- if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
237
- _context.next = 24;
238
- break;
239
- }
240
- throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(user_ids)));
241
- case 24:
242
- if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
243
- _context.next = 26;
244
- break;
245
- }
246
- throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(group_ids)));
247
- case 26:
248
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
249
- _context.next = 28;
250
- break;
251
- }
252
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
253
- case 28:
254
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
255
- _context.next = 30;
256
- break;
257
- }
258
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
259
- case 30:
260
- if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
261
- _context.next = 32;
262
- break;
263
- }
264
- throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(trigger)));
265
- case 32:
266
- if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
267
- _context.next = 34;
268
- break;
269
- }
270
- throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
271
- case 34:
272
- if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
273
- _context.next = 36;
274
- break;
275
- }
276
- throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(automation)));
277
- case 36:
278
- if (params['id']) {
279
- _context.next = 42;
280
- break;
281
- }
282
- if (!_this.attributes.id) {
283
- _context.next = 41;
284
- break;
285
- }
286
- params['id'] = _this.id;
171
+ while (1) switch (_context.prev = _context.next) {
172
+ case 0:
173
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
174
+ if (_this.attributes.id) {
175
+ _context.next = 3;
176
+ break;
177
+ }
178
+ throw new errors.EmptyPropertyError('Current object has no id');
179
+ case 3:
180
+ if ((0, _utils.isObject)(params)) {
181
+ _context.next = 5;
182
+ break;
183
+ }
184
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
185
+ case 5:
186
+ params.id = _this.attributes.id;
187
+ if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
188
+ _context.next = 8;
189
+ break;
190
+ }
191
+ throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
192
+ case 8:
193
+ if (!(params['source'] && !(0, _utils.isString)(params['source']))) {
194
+ _context.next = 10;
195
+ break;
196
+ }
197
+ throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(source)));
198
+ case 10:
199
+ if (!(params['destination'] && !(0, _utils.isString)(params['destination']))) {
200
+ _context.next = 12;
201
+ break;
202
+ }
203
+ throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(destination)));
204
+ case 12:
205
+ if (!(params['destinations'] && !(0, _utils.isArray)(params['destinations']))) {
206
+ _context.next = 14;
207
+ break;
208
+ }
209
+ throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(destinations)));
210
+ case 14:
211
+ if (!(params['destination_replace_from'] && !(0, _utils.isString)(params['destination_replace_from']))) {
212
+ _context.next = 16;
213
+ break;
214
+ }
215
+ throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(destination_replace_from)));
216
+ case 16:
217
+ if (!(params['destination_replace_to'] && !(0, _utils.isString)(params['destination_replace_to']))) {
218
+ _context.next = 18;
219
+ break;
220
+ }
221
+ throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(destination_replace_to)));
222
+ case 18:
223
+ if (!(params['interval'] && !(0, _utils.isString)(params['interval']))) {
224
+ _context.next = 20;
225
+ break;
226
+ }
227
+ throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(interval)));
228
+ case 20:
229
+ if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
230
+ _context.next = 22;
231
+ break;
232
+ }
233
+ throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(path)));
234
+ case 22:
235
+ if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
236
+ _context.next = 24;
237
+ break;
238
+ }
239
+ throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(user_ids)));
240
+ case 24:
241
+ if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
242
+ _context.next = 26;
243
+ break;
244
+ }
245
+ throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(group_ids)));
246
+ case 26:
247
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
248
+ _context.next = 28;
249
+ break;
250
+ }
251
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
252
+ case 28:
253
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
254
+ _context.next = 30;
255
+ break;
256
+ }
257
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
258
+ case 30:
259
+ if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
260
+ _context.next = 32;
261
+ break;
262
+ }
263
+ throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(trigger)));
264
+ case 32:
265
+ if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
266
+ _context.next = 34;
267
+ break;
268
+ }
269
+ throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
270
+ case 34:
271
+ if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
272
+ _context.next = 36;
273
+ break;
274
+ }
275
+ throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(automation)));
276
+ case 36:
277
+ if (params['id']) {
287
278
  _context.next = 42;
288
279
  break;
289
- case 41:
290
- throw new errors.MissingParameterError('Parameter missing: id');
291
- case 42:
292
- _context.next = 44;
293
- return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
294
- case 44:
295
- response = _context.sent;
296
- return _context.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
297
- case 46:
298
- case "end":
299
- return _context.stop();
300
- }
280
+ }
281
+ if (!_this.attributes.id) {
282
+ _context.next = 41;
283
+ break;
284
+ }
285
+ params['id'] = _this.id;
286
+ _context.next = 42;
287
+ break;
288
+ case 41:
289
+ throw new errors.MissingParameterError('Parameter missing: id');
290
+ case 42:
291
+ _context.next = 44;
292
+ return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
293
+ case 44:
294
+ response = _context.sent;
295
+ return _context.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
296
+ case 46:
297
+ case "end":
298
+ return _context.stop();
301
299
  }
302
300
  }, _callee);
303
301
  })));
@@ -306,52 +304,50 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
306
304
  response,
307
305
  _args2 = arguments;
308
306
  return _regenerator.default.wrap(function _callee2$(_context2) {
309
- while (1) {
310
- switch (_context2.prev = _context2.next) {
311
- case 0:
312
- params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
313
- if (_this.attributes.id) {
314
- _context2.next = 3;
315
- break;
316
- }
317
- throw new errors.EmptyPropertyError('Current object has no id');
318
- case 3:
319
- if ((0, _utils.isObject)(params)) {
320
- _context2.next = 5;
321
- break;
322
- }
323
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
324
- case 5:
325
- params.id = _this.attributes.id;
326
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
327
- _context2.next = 8;
328
- break;
329
- }
330
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
331
- case 8:
332
- if (params['id']) {
333
- _context2.next = 14;
334
- break;
335
- }
336
- if (!_this.attributes.id) {
337
- _context2.next = 13;
338
- break;
339
- }
340
- params['id'] = _this.id;
307
+ while (1) switch (_context2.prev = _context2.next) {
308
+ case 0:
309
+ params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
310
+ if (_this.attributes.id) {
311
+ _context2.next = 3;
312
+ break;
313
+ }
314
+ throw new errors.EmptyPropertyError('Current object has no id');
315
+ case 3:
316
+ if ((0, _utils.isObject)(params)) {
317
+ _context2.next = 5;
318
+ break;
319
+ }
320
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
321
+ case 5:
322
+ params.id = _this.attributes.id;
323
+ if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
324
+ _context2.next = 8;
325
+ break;
326
+ }
327
+ throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
328
+ case 8:
329
+ if (params['id']) {
341
330
  _context2.next = 14;
342
331
  break;
343
- case 13:
344
- throw new errors.MissingParameterError('Parameter missing: id');
345
- case 14:
346
- _context2.next = 16;
347
- return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
348
- case 16:
349
- response = _context2.sent;
350
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
351
- case 18:
352
- case "end":
353
- return _context2.stop();
354
- }
332
+ }
333
+ if (!_this.attributes.id) {
334
+ _context2.next = 13;
335
+ break;
336
+ }
337
+ params['id'] = _this.id;
338
+ _context2.next = 14;
339
+ break;
340
+ case 13:
341
+ throw new errors.MissingParameterError('Parameter missing: id');
342
+ case 14:
343
+ _context2.next = 16;
344
+ return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
345
+ case 16:
346
+ response = _context2.sent;
347
+ return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
348
+ case 18:
349
+ case "end":
350
+ return _context2.stop();
355
351
  }
356
352
  }, _callee2);
357
353
  })));
@@ -388,40 +384,38 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
388
384
  response,
389
385
  _args3 = arguments;
390
386
  return _regenerator.default.wrap(function _callee3$(_context3) {
391
- while (1) {
392
- switch (_context3.prev = _context3.next) {
393
- case 0:
394
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
395
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
396
- if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
397
- _context3.next = 4;
398
- break;
399
- }
400
- throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
401
- case 4:
402
- if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
403
- _context3.next = 6;
404
- break;
405
- }
406
- throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
407
- case 6:
408
- if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
409
- _context3.next = 8;
410
- break;
411
- }
412
- throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
413
- case 8:
414
- _context3.next = 10;
415
- return _Api.default.sendRequest("/automations", 'GET', params, options);
416
- case 10:
417
- response = _context3.sent;
418
- return _context3.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
419
- return new Automation(obj, options);
420
- })) || []);
421
- case 12:
422
- case "end":
423
- return _context3.stop();
424
- }
387
+ while (1) switch (_context3.prev = _context3.next) {
388
+ case 0:
389
+ params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
390
+ options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
391
+ if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
392
+ _context3.next = 4;
393
+ break;
394
+ }
395
+ throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
396
+ case 4:
397
+ if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
398
+ _context3.next = 6;
399
+ break;
400
+ }
401
+ throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
402
+ case 6:
403
+ if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
404
+ _context3.next = 8;
405
+ break;
406
+ }
407
+ throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
408
+ case 8:
409
+ _context3.next = 10;
410
+ return _Api.default.sendRequest("/automations", 'GET', params, options);
411
+ case 10:
412
+ response = _context3.sent;
413
+ return _context3.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
414
+ return new Automation(obj, options);
415
+ })) || []);
416
+ case 12:
417
+ case "end":
418
+ return _context3.stop();
425
419
  }
426
420
  }, _callee3);
427
421
  })));
@@ -437,39 +431,37 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
437
431
  response,
438
432
  _args4 = arguments;
439
433
  return _regenerator.default.wrap(function _callee4$(_context4) {
440
- while (1) {
441
- switch (_context4.prev = _context4.next) {
442
- case 0:
443
- params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
444
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
445
- if ((0, _utils.isObject)(params)) {
446
- _context4.next = 4;
447
- break;
448
- }
449
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
450
- case 4:
451
- params['id'] = id;
452
- if (params['id']) {
453
- _context4.next = 7;
454
- break;
455
- }
456
- throw new errors.MissingParameterError('Parameter missing: id');
457
- case 7:
458
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
459
- _context4.next = 9;
460
- break;
461
- }
462
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
463
- case 9:
464
- _context4.next = 11;
465
- return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
466
- case 11:
467
- response = _context4.sent;
468
- return _context4.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
469
- case 13:
470
- case "end":
471
- return _context4.stop();
472
- }
434
+ while (1) switch (_context4.prev = _context4.next) {
435
+ case 0:
436
+ params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
437
+ options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
438
+ if ((0, _utils.isObject)(params)) {
439
+ _context4.next = 4;
440
+ break;
441
+ }
442
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
443
+ case 4:
444
+ params['id'] = id;
445
+ if (params['id']) {
446
+ _context4.next = 7;
447
+ break;
448
+ }
449
+ throw new errors.MissingParameterError('Parameter missing: id');
450
+ case 7:
451
+ if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
452
+ _context4.next = 9;
453
+ break;
454
+ }
455
+ throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
456
+ case 9:
457
+ _context4.next = 11;
458
+ return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
459
+ case 11:
460
+ response = _context4.sent;
461
+ return _context4.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
462
+ case 13:
463
+ case "end":
464
+ return _context4.stop();
473
465
  }
474
466
  }, _callee4);
475
467
  }));
@@ -488,110 +480,108 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
488
480
  response,
489
481
  _args5 = arguments;
490
482
  return _regenerator.default.wrap(function _callee5$(_context5) {
491
- while (1) {
492
- switch (_context5.prev = _context5.next) {
493
- case 0:
494
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
495
- options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
496
- if (params['automation']) {
497
- _context5.next = 4;
498
- break;
499
- }
500
- throw new errors.MissingParameterError('Parameter missing: automation');
501
- case 4:
502
- if (!(params['source'] && !(0, _utils.isString)(params['source']))) {
503
- _context5.next = 6;
504
- break;
505
- }
506
- throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params['source'])));
507
- case 6:
508
- if (!(params['destination'] && !(0, _utils.isString)(params['destination']))) {
509
- _context5.next = 8;
510
- break;
511
- }
512
- throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params['destination'])));
513
- case 8:
514
- if (!(params['destinations'] && !(0, _utils.isArray)(params['destinations']))) {
515
- _context5.next = 10;
516
- break;
517
- }
518
- throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params['destinations'])));
519
- case 10:
520
- if (!(params['destination_replace_from'] && !(0, _utils.isString)(params['destination_replace_from']))) {
521
- _context5.next = 12;
522
- break;
523
- }
524
- throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_from'])));
525
- case 12:
526
- if (!(params['destination_replace_to'] && !(0, _utils.isString)(params['destination_replace_to']))) {
527
- _context5.next = 14;
528
- break;
529
- }
530
- throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_to'])));
531
- case 14:
532
- if (!(params['interval'] && !(0, _utils.isString)(params['interval']))) {
533
- _context5.next = 16;
534
- break;
535
- }
536
- throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params['interval'])));
537
- case 16:
538
- if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
539
- _context5.next = 18;
540
- break;
541
- }
542
- throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
543
- case 18:
544
- if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
545
- _context5.next = 20;
546
- break;
547
- }
548
- throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
549
- case 20:
550
- if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
551
- _context5.next = 22;
552
- break;
553
- }
554
- throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
555
- case 22:
556
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
557
- _context5.next = 24;
558
- break;
559
- }
560
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
561
- case 24:
562
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
563
- _context5.next = 26;
564
- break;
565
- }
566
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
567
- case 26:
568
- if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
569
- _context5.next = 28;
570
- break;
571
- }
572
- throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params['trigger'])));
573
- case 28:
574
- if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
575
- _context5.next = 30;
576
- break;
577
- }
578
- throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
579
- case 30:
580
- if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
581
- _context5.next = 32;
582
- break;
583
- }
584
- throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
585
- case 32:
586
- _context5.next = 34;
587
- return _Api.default.sendRequest("/automations", 'POST', params, options);
588
- case 34:
589
- response = _context5.sent;
590
- return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
591
- case 36:
592
- case "end":
593
- return _context5.stop();
594
- }
483
+ while (1) switch (_context5.prev = _context5.next) {
484
+ case 0:
485
+ params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
486
+ options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
487
+ if (params['automation']) {
488
+ _context5.next = 4;
489
+ break;
490
+ }
491
+ throw new errors.MissingParameterError('Parameter missing: automation');
492
+ case 4:
493
+ if (!(params['source'] && !(0, _utils.isString)(params['source']))) {
494
+ _context5.next = 6;
495
+ break;
496
+ }
497
+ throw new errors.InvalidParameterError("Bad parameter: source must be of type String, received ".concat((0, _utils.getType)(params['source'])));
498
+ case 6:
499
+ if (!(params['destination'] && !(0, _utils.isString)(params['destination']))) {
500
+ _context5.next = 8;
501
+ break;
502
+ }
503
+ throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params['destination'])));
504
+ case 8:
505
+ if (!(params['destinations'] && !(0, _utils.isArray)(params['destinations']))) {
506
+ _context5.next = 10;
507
+ break;
508
+ }
509
+ throw new errors.InvalidParameterError("Bad parameter: destinations must be of type Array, received ".concat((0, _utils.getType)(params['destinations'])));
510
+ case 10:
511
+ if (!(params['destination_replace_from'] && !(0, _utils.isString)(params['destination_replace_from']))) {
512
+ _context5.next = 12;
513
+ break;
514
+ }
515
+ throw new errors.InvalidParameterError("Bad parameter: destination_replace_from must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_from'])));
516
+ case 12:
517
+ if (!(params['destination_replace_to'] && !(0, _utils.isString)(params['destination_replace_to']))) {
518
+ _context5.next = 14;
519
+ break;
520
+ }
521
+ throw new errors.InvalidParameterError("Bad parameter: destination_replace_to must be of type String, received ".concat((0, _utils.getType)(params['destination_replace_to'])));
522
+ case 14:
523
+ if (!(params['interval'] && !(0, _utils.isString)(params['interval']))) {
524
+ _context5.next = 16;
525
+ break;
526
+ }
527
+ throw new errors.InvalidParameterError("Bad parameter: interval must be of type String, received ".concat((0, _utils.getType)(params['interval'])));
528
+ case 16:
529
+ if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
530
+ _context5.next = 18;
531
+ break;
532
+ }
533
+ throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
534
+ case 18:
535
+ if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
536
+ _context5.next = 20;
537
+ break;
538
+ }
539
+ throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
540
+ case 20:
541
+ if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
542
+ _context5.next = 22;
543
+ break;
544
+ }
545
+ throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
546
+ case 22:
547
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
548
+ _context5.next = 24;
549
+ break;
550
+ }
551
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
552
+ case 24:
553
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
554
+ _context5.next = 26;
555
+ break;
556
+ }
557
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
558
+ case 26:
559
+ if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
560
+ _context5.next = 28;
561
+ break;
562
+ }
563
+ throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params['trigger'])));
564
+ case 28:
565
+ if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
566
+ _context5.next = 30;
567
+ break;
568
+ }
569
+ throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
570
+ case 30:
571
+ if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
572
+ _context5.next = 32;
573
+ break;
574
+ }
575
+ throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
576
+ case 32:
577
+ _context5.next = 34;
578
+ return _Api.default.sendRequest("/automations", 'POST', params, options);
579
+ case 34:
580
+ response = _context5.sent;
581
+ return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
582
+ case 36:
583
+ case "end":
584
+ return _context5.stop();
595
585
  }
596
586
  }, _callee5);
597
587
  })));