files.com 1.0.235 → 1.0.237
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/_VERSION +1 -1
- package/docs/models/Bundle.md +9 -2
- package/docs/models/BundleNotification.md +35 -0
- package/docs/models/BundleRegistration.md +3 -1
- package/docs/models/InboxRegistration.md +3 -1
- package/docs/models/Site.md +2 -0
- package/lib/Api.js +153 -159
- package/lib/isomorphic/File.node.js +24 -28
- package/lib/models/ActionNotificationExport.js +97 -101
- package/lib/models/ActionNotificationExportResult.js +44 -46
- package/lib/models/ActionWebhookFailure.js +42 -44
- package/lib/models/ApiKey.js +271 -287
- package/lib/models/App.js +26 -28
- package/lib/models/As2IncomingMessage.js +32 -34
- package/lib/models/As2OutgoingMessage.js +32 -34
- package/lib/models/As2Partner.js +231 -241
- package/lib/models/As2Station.js +219 -229
- package/lib/models/Automation.js +333 -343
- package/lib/models/AutomationRun.js +75 -79
- package/lib/models/BandwidthSnapshot.js +26 -28
- package/lib/models/Behavior.js +323 -337
- package/lib/models/Bundle.js +381 -387
- package/lib/models/BundleDownload.js +38 -40
- package/lib/models/BundleNotification.js +223 -173
- package/lib/models/BundleRecipient.js +104 -108
- package/lib/models/BundleRegistration.js +41 -40
- package/lib/models/Clickwrap.js +213 -223
- package/lib/models/DnsRecord.js +26 -28
- package/lib/models/ExternalEvent.js +93 -99
- package/lib/models/File.js +726 -766
- package/lib/models/FileComment.js +180 -188
- package/lib/models/FileCommentReaction.js +84 -88
- package/lib/models/FileMigration.js +31 -33
- package/lib/models/Folder.js +94 -98
- package/lib/models/FormFieldSet.js +189 -199
- package/lib/models/Group.js +207 -217
- package/lib/models/GroupUser.js +230 -238
- package/lib/models/History.js +266 -276
- package/lib/models/HistoryExport.js +175 -179
- package/lib/models/HistoryExportResult.js +44 -46
- package/lib/models/InboxRecipient.js +104 -108
- package/lib/models/InboxRegistration.js +35 -34
- package/lib/models/InboxUpload.js +38 -40
- package/lib/models/Invoice.js +57 -61
- package/lib/models/IpAddress.js +78 -84
- package/lib/models/Lock.js +148 -154
- package/lib/models/Message.js +267 -277
- package/lib/models/MessageComment.js +207 -217
- package/lib/models/MessageCommentReaction.js +147 -155
- package/lib/models/MessageReaction.js +147 -155
- package/lib/models/Notification.js +255 -265
- package/lib/models/Payment.js +57 -61
- package/lib/models/Permission.js +128 -134
- package/lib/models/Priority.js +45 -47
- package/lib/models/Project.js +183 -193
- package/lib/models/PublicKey.js +207 -217
- package/lib/models/RemoteBandwidthSnapshot.js +26 -28
- package/lib/models/RemoteServer.js +805 -819
- package/lib/models/Request.js +166 -174
- package/lib/models/Session.js +47 -51
- package/lib/models/SettingsChange.js +26 -28
- package/lib/models/SftpHostKey.js +177 -187
- package/lib/models/Site.js +415 -418
- package/lib/models/SsoStrategy.js +99 -105
- package/lib/models/Style.js +127 -133
- package/lib/models/UsageDailySnapshot.js +26 -28
- package/lib/models/UsageSnapshot.js +26 -28
- package/lib/models/User.js +587 -603
- package/lib/models/UserCipherUse.js +32 -34
- package/lib/models/UserRequest.js +147 -155
- package/lib/models/WebhookTest.js +54 -56
- package/package.json +1 -1
- package/src/models/Bundle.js +10 -1
- package/src/models/BundleNotification.js +39 -1
- package/src/models/BundleRegistration.js +3 -0
- package/src/models/InboxRegistration.js +3 -0
- package/src/models/Site.js +3 -0
package/lib/models/Automation.js
CHANGED
@@ -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
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
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
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
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
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
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
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
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
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
return
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
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
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
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
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
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
|
})));
|