files.com 1.0.474 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +63 -49
- package/lib/models/ActionWebhookFailure.js +1 -1
- package/lib/models/ApiKey.js +113 -94
- package/lib/models/As2Partner.js +81 -62
- package/lib/models/As2Station.js +79 -60
- package/lib/models/Automation.js +90 -71
- package/lib/models/Behavior.js +114 -95
- package/lib/models/Bundle.js +90 -71
- package/lib/models/BundleNotification.js +75 -56
- package/lib/models/BundleRecipient.js +61 -47
- package/lib/models/Clickwrap.js +77 -58
- package/lib/models/ExternalEvent.js +71 -57
- package/lib/models/File.js +166 -154
- package/lib/models/FileComment.js +65 -46
- package/lib/models/FileCommentReaction.js +44 -30
- package/lib/models/Folder.js +58 -46
- package/lib/models/FormFieldSet.js +76 -57
- package/lib/models/GpgKey.js +79 -60
- package/lib/models/Group.js +78 -59
- package/lib/models/GroupUser.js +63 -44
- package/lib/models/HistoryExport.js +76 -62
- package/lib/models/InboxRecipient.js +61 -47
- package/lib/models/Lock.js +56 -44
- package/lib/models/Message.js +82 -63
- package/lib/models/MessageComment.js +78 -59
- package/lib/models/MessageCommentReaction.js +73 -59
- package/lib/models/MessageReaction.js +73 -59
- package/lib/models/Notification.js +84 -65
- package/lib/models/Permission.js +60 -46
- package/lib/models/Project.js +74 -55
- package/lib/models/PublicKey.js +78 -59
- package/lib/models/RemoteServer.js +147 -128
- package/lib/models/Request.js +76 -62
- package/lib/models/Session.js +53 -39
- package/lib/models/SftpHostKey.js +74 -55
- package/lib/models/ShareGroup.js +79 -60
- package/lib/models/Snapshot.js +75 -56
- package/lib/models/SsoStrategy.js +1 -1
- package/lib/models/Style.js +37 -23
- package/lib/models/User.js +104 -85
- package/lib/models/UserRequest.js +73 -59
- package/lib/models/WebhookTest.js +46 -32
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ActionNotificationExport.js +2 -2
- package/src/models/ActionWebhookFailure.js +1 -1
- package/src/models/ApiKey.js +7 -5
- package/src/models/As2Partner.js +6 -4
- package/src/models/As2Station.js +6 -4
- package/src/models/Automation.js +7 -5
- package/src/models/Behavior.js +7 -5
- package/src/models/Bundle.js +7 -5
- package/src/models/BundleNotification.js +6 -4
- package/src/models/BundleRecipient.js +2 -2
- package/src/models/Clickwrap.js +6 -4
- package/src/models/ExternalEvent.js +2 -2
- package/src/models/File.js +3 -3
- package/src/models/FileComment.js +6 -4
- package/src/models/FileCommentReaction.js +3 -3
- package/src/models/Folder.js +2 -2
- package/src/models/FormFieldSet.js +6 -4
- package/src/models/GpgKey.js +6 -4
- package/src/models/Group.js +6 -4
- package/src/models/GroupUser.js +6 -4
- package/src/models/HistoryExport.js +2 -2
- package/src/models/InboxRecipient.js +2 -2
- package/src/models/Lock.js +3 -3
- package/src/models/Message.js +6 -4
- package/src/models/MessageComment.js +6 -4
- package/src/models/MessageCommentReaction.js +3 -3
- package/src/models/MessageReaction.js +3 -3
- package/src/models/Notification.js +6 -4
- package/src/models/Permission.js +3 -3
- package/src/models/Project.js +6 -4
- package/src/models/PublicKey.js +6 -4
- package/src/models/RemoteServer.js +6 -4
- package/src/models/Request.js +3 -3
- package/src/models/Session.js +3 -3
- package/src/models/SftpHostKey.js +6 -4
- package/src/models/ShareGroup.js +6 -4
- package/src/models/Snapshot.js +6 -4
- package/src/models/SsoStrategy.js +1 -1
- package/src/models/Style.js +6 -3
- package/src/models/User.js +9 -7
- package/src/models/UserRequest.js +3 -3
- package/src/models/WebhookTest.js +2 -2
package/lib/models/As2Partner.js
CHANGED
@@ -258,7 +258,7 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
258
258
|
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
259
259
|
case 16:
|
260
260
|
response = _context2.sent;
|
261
|
-
return _context2.abrupt("return"
|
261
|
+
return _context2.abrupt("return");
|
262
262
|
case 18:
|
263
263
|
case "end":
|
264
264
|
return _context2.stop();
|
@@ -269,19 +269,38 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
269
269
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
270
270
|
return _this.delete(params);
|
271
271
|
});
|
272
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
272
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
273
|
+
var newObject, _newObject;
|
274
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
275
|
+
while (1) switch (_context3.prev = _context3.next) {
|
276
|
+
case 0:
|
277
|
+
if (!_this.attributes['id']) {
|
278
|
+
_context3.next = 8;
|
279
|
+
break;
|
280
|
+
}
|
281
|
+
_context3.next = 3;
|
282
|
+
return _this.update(_this.attributes);
|
283
|
+
case 3:
|
284
|
+
newObject = _context3.sent;
|
285
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
286
|
+
return _context3.abrupt("return", true);
|
287
|
+
case 8:
|
288
|
+
_context3.next = 10;
|
289
|
+
return As2Partner.create(_this.attributes, _this.options);
|
290
|
+
case 10:
|
291
|
+
_newObject = _context3.sent;
|
292
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
293
|
+
return _context3.abrupt("return", true);
|
294
|
+
case 13:
|
295
|
+
case "end":
|
296
|
+
return _context3.stop();
|
297
|
+
}
|
298
|
+
}, _callee3);
|
299
|
+
})));
|
300
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
301
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
302
|
+
key = _ref5[0],
|
303
|
+
value = _ref5[1];
|
285
304
|
var normalizedKey = key.replace('?', '');
|
286
305
|
_this.attributes[normalizedKey] = value;
|
287
306
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -295,41 +314,41 @@ _class = As2Partner;
|
|
295
314
|
// Parameters:
|
296
315
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
297
316
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
298
|
-
(0, _defineProperty2.default)(As2Partner, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
317
|
+
(0, _defineProperty2.default)(As2Partner, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
299
318
|
var _response$data;
|
300
319
|
var params,
|
301
320
|
options,
|
302
321
|
response,
|
303
|
-
|
304
|
-
return _regenerator.default.wrap(function
|
305
|
-
while (1) switch (
|
322
|
+
_args4 = arguments;
|
323
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
324
|
+
while (1) switch (_context4.prev = _context4.next) {
|
306
325
|
case 0:
|
307
|
-
params =
|
308
|
-
options =
|
326
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
327
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
309
328
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
310
|
-
|
329
|
+
_context4.next = 4;
|
311
330
|
break;
|
312
331
|
}
|
313
332
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
314
333
|
case 4:
|
315
334
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
316
|
-
|
335
|
+
_context4.next = 6;
|
317
336
|
break;
|
318
337
|
}
|
319
338
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
320
339
|
case 6:
|
321
|
-
|
340
|
+
_context4.next = 8;
|
322
341
|
return _Api.default.sendRequest("/as2_partners", 'GET', params, options);
|
323
342
|
case 8:
|
324
|
-
response =
|
325
|
-
return
|
343
|
+
response = _context4.sent;
|
344
|
+
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
326
345
|
return new _class(obj, options);
|
327
346
|
})) || []);
|
328
347
|
case 10:
|
329
348
|
case "end":
|
330
|
-
return
|
349
|
+
return _context4.stop();
|
331
350
|
}
|
332
|
-
},
|
351
|
+
}, _callee4);
|
333
352
|
})));
|
334
353
|
(0, _defineProperty2.default)(As2Partner, "all", function () {
|
335
354
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -339,48 +358,48 @@ _class = As2Partner;
|
|
339
358
|
// Parameters:
|
340
359
|
// id (required) - int64 - As2 Partner ID.
|
341
360
|
(0, _defineProperty2.default)(As2Partner, "find", /*#__PURE__*/function () {
|
342
|
-
var
|
361
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
|
343
362
|
var params,
|
344
363
|
options,
|
345
364
|
response,
|
346
|
-
|
347
|
-
return _regenerator.default.wrap(function
|
348
|
-
while (1) switch (
|
365
|
+
_args5 = arguments;
|
366
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
367
|
+
while (1) switch (_context5.prev = _context5.next) {
|
349
368
|
case 0:
|
350
|
-
params =
|
351
|
-
options =
|
369
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
370
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
352
371
|
if ((0, _utils.isObject)(params)) {
|
353
|
-
|
372
|
+
_context5.next = 4;
|
354
373
|
break;
|
355
374
|
}
|
356
375
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
357
376
|
case 4:
|
358
377
|
params['id'] = id;
|
359
378
|
if (params['id']) {
|
360
|
-
|
379
|
+
_context5.next = 7;
|
361
380
|
break;
|
362
381
|
}
|
363
382
|
throw new errors.MissingParameterError('Parameter missing: id');
|
364
383
|
case 7:
|
365
384
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
366
|
-
|
385
|
+
_context5.next = 9;
|
367
386
|
break;
|
368
387
|
}
|
369
388
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
370
389
|
case 9:
|
371
|
-
|
390
|
+
_context5.next = 11;
|
372
391
|
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
373
392
|
case 11:
|
374
|
-
response =
|
375
|
-
return
|
393
|
+
response = _context5.sent;
|
394
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
376
395
|
case 13:
|
377
396
|
case "end":
|
378
|
-
return
|
397
|
+
return _context5.stop();
|
379
398
|
}
|
380
|
-
},
|
399
|
+
}, _callee5);
|
381
400
|
}));
|
382
401
|
return function (_x) {
|
383
|
-
return
|
402
|
+
return _ref7.apply(this, arguments);
|
384
403
|
};
|
385
404
|
}());
|
386
405
|
(0, _defineProperty2.default)(As2Partner, "get", function (id) {
|
@@ -395,80 +414,80 @@ _class = As2Partner;
|
|
395
414
|
// as2_station_id (required) - int64 - Id of As2Station for this partner
|
396
415
|
// server_certificate - string - Remote server certificate security setting
|
397
416
|
// enable_dedicated_ips - boolean
|
398
|
-
(0, _defineProperty2.default)(As2Partner, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
417
|
+
(0, _defineProperty2.default)(As2Partner, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
399
418
|
var params,
|
400
419
|
options,
|
401
420
|
response,
|
402
|
-
|
403
|
-
return _regenerator.default.wrap(function
|
404
|
-
while (1) switch (
|
421
|
+
_args6 = arguments;
|
422
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
423
|
+
while (1) switch (_context6.prev = _context6.next) {
|
405
424
|
case 0:
|
406
|
-
params =
|
407
|
-
options =
|
425
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
426
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
408
427
|
if (params['name']) {
|
409
|
-
|
428
|
+
_context6.next = 4;
|
410
429
|
break;
|
411
430
|
}
|
412
431
|
throw new errors.MissingParameterError('Parameter missing: name');
|
413
432
|
case 4:
|
414
433
|
if (params['uri']) {
|
415
|
-
|
434
|
+
_context6.next = 6;
|
416
435
|
break;
|
417
436
|
}
|
418
437
|
throw new errors.MissingParameterError('Parameter missing: uri');
|
419
438
|
case 6:
|
420
439
|
if (params['public_certificate']) {
|
421
|
-
|
440
|
+
_context6.next = 8;
|
422
441
|
break;
|
423
442
|
}
|
424
443
|
throw new errors.MissingParameterError('Parameter missing: public_certificate');
|
425
444
|
case 8:
|
426
445
|
if (params['as2_station_id']) {
|
427
|
-
|
446
|
+
_context6.next = 10;
|
428
447
|
break;
|
429
448
|
}
|
430
449
|
throw new errors.MissingParameterError('Parameter missing: as2_station_id');
|
431
450
|
case 10:
|
432
451
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
433
|
-
|
452
|
+
_context6.next = 12;
|
434
453
|
break;
|
435
454
|
}
|
436
455
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
437
456
|
case 12:
|
438
457
|
if (!(params['uri'] && !(0, _utils.isString)(params['uri']))) {
|
439
|
-
|
458
|
+
_context6.next = 14;
|
440
459
|
break;
|
441
460
|
}
|
442
461
|
throw new errors.InvalidParameterError("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(params['uri'])));
|
443
462
|
case 14:
|
444
463
|
if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
|
445
|
-
|
464
|
+
_context6.next = 16;
|
446
465
|
break;
|
447
466
|
}
|
448
467
|
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params['public_certificate'])));
|
449
468
|
case 16:
|
450
469
|
if (!(params['as2_station_id'] && !(0, _utils.isInt)(params['as2_station_id']))) {
|
451
|
-
|
470
|
+
_context6.next = 18;
|
452
471
|
break;
|
453
472
|
}
|
454
473
|
throw new errors.InvalidParameterError("Bad parameter: as2_station_id must be of type Int, received ".concat((0, _utils.getType)(params['as2_station_id'])));
|
455
474
|
case 18:
|
456
475
|
if (!(params['server_certificate'] && !(0, _utils.isString)(params['server_certificate']))) {
|
457
|
-
|
476
|
+
_context6.next = 20;
|
458
477
|
break;
|
459
478
|
}
|
460
479
|
throw new errors.InvalidParameterError("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(params['server_certificate'])));
|
461
480
|
case 20:
|
462
|
-
|
481
|
+
_context6.next = 22;
|
463
482
|
return _Api.default.sendRequest("/as2_partners", 'POST', params, options);
|
464
483
|
case 22:
|
465
|
-
response =
|
466
|
-
return
|
484
|
+
response = _context6.sent;
|
485
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
467
486
|
case 24:
|
468
487
|
case "end":
|
469
|
-
return
|
488
|
+
return _context6.stop();
|
470
489
|
}
|
471
|
-
},
|
490
|
+
}, _callee6);
|
472
491
|
})));
|
473
492
|
var _default = exports.default = As2Partner;
|
474
493
|
module.exports = As2Partner;
|
package/lib/models/As2Station.js
CHANGED
@@ -271,7 +271,7 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
271
271
|
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
272
272
|
case 16:
|
273
273
|
response = _context2.sent;
|
274
|
-
return _context2.abrupt("return"
|
274
|
+
return _context2.abrupt("return");
|
275
275
|
case 18:
|
276
276
|
case "end":
|
277
277
|
return _context2.stop();
|
@@ -282,19 +282,38 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
282
282
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
283
283
|
return _this.delete(params);
|
284
284
|
});
|
285
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
285
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
286
|
+
var newObject, _newObject;
|
287
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
288
|
+
while (1) switch (_context3.prev = _context3.next) {
|
289
|
+
case 0:
|
290
|
+
if (!_this.attributes['id']) {
|
291
|
+
_context3.next = 8;
|
292
|
+
break;
|
293
|
+
}
|
294
|
+
_context3.next = 3;
|
295
|
+
return _this.update(_this.attributes);
|
296
|
+
case 3:
|
297
|
+
newObject = _context3.sent;
|
298
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
299
|
+
return _context3.abrupt("return", true);
|
300
|
+
case 8:
|
301
|
+
_context3.next = 10;
|
302
|
+
return As2Station.create(_this.attributes, _this.options);
|
303
|
+
case 10:
|
304
|
+
_newObject = _context3.sent;
|
305
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
306
|
+
return _context3.abrupt("return", true);
|
307
|
+
case 13:
|
308
|
+
case "end":
|
309
|
+
return _context3.stop();
|
310
|
+
}
|
311
|
+
}, _callee3);
|
312
|
+
})));
|
313
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
314
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
315
|
+
key = _ref5[0],
|
316
|
+
value = _ref5[1];
|
298
317
|
var normalizedKey = key.replace('?', '');
|
299
318
|
_this.attributes[normalizedKey] = value;
|
300
319
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -308,41 +327,41 @@ _class = As2Station;
|
|
308
327
|
// Parameters:
|
309
328
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
310
329
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
311
|
-
(0, _defineProperty2.default)(As2Station, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
330
|
+
(0, _defineProperty2.default)(As2Station, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
312
331
|
var _response$data;
|
313
332
|
var params,
|
314
333
|
options,
|
315
334
|
response,
|
316
|
-
|
317
|
-
return _regenerator.default.wrap(function
|
318
|
-
while (1) switch (
|
335
|
+
_args4 = arguments;
|
336
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
337
|
+
while (1) switch (_context4.prev = _context4.next) {
|
319
338
|
case 0:
|
320
|
-
params =
|
321
|
-
options =
|
339
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
340
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
322
341
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
323
|
-
|
342
|
+
_context4.next = 4;
|
324
343
|
break;
|
325
344
|
}
|
326
345
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
327
346
|
case 4:
|
328
347
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
329
|
-
|
348
|
+
_context4.next = 6;
|
330
349
|
break;
|
331
350
|
}
|
332
351
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
333
352
|
case 6:
|
334
|
-
|
353
|
+
_context4.next = 8;
|
335
354
|
return _Api.default.sendRequest("/as2_stations", 'GET', params, options);
|
336
355
|
case 8:
|
337
|
-
response =
|
338
|
-
return
|
356
|
+
response = _context4.sent;
|
357
|
+
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
339
358
|
return new _class(obj, options);
|
340
359
|
})) || []);
|
341
360
|
case 10:
|
342
361
|
case "end":
|
343
|
-
return
|
362
|
+
return _context4.stop();
|
344
363
|
}
|
345
|
-
},
|
364
|
+
}, _callee4);
|
346
365
|
})));
|
347
366
|
(0, _defineProperty2.default)(As2Station, "all", function () {
|
348
367
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -352,48 +371,48 @@ _class = As2Station;
|
|
352
371
|
// Parameters:
|
353
372
|
// id (required) - int64 - As2 Station ID.
|
354
373
|
(0, _defineProperty2.default)(As2Station, "find", /*#__PURE__*/function () {
|
355
|
-
var
|
374
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
|
356
375
|
var params,
|
357
376
|
options,
|
358
377
|
response,
|
359
|
-
|
360
|
-
return _regenerator.default.wrap(function
|
361
|
-
while (1) switch (
|
378
|
+
_args5 = arguments;
|
379
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
380
|
+
while (1) switch (_context5.prev = _context5.next) {
|
362
381
|
case 0:
|
363
|
-
params =
|
364
|
-
options =
|
382
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
383
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
365
384
|
if ((0, _utils.isObject)(params)) {
|
366
|
-
|
385
|
+
_context5.next = 4;
|
367
386
|
break;
|
368
387
|
}
|
369
388
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
370
389
|
case 4:
|
371
390
|
params['id'] = id;
|
372
391
|
if (params['id']) {
|
373
|
-
|
392
|
+
_context5.next = 7;
|
374
393
|
break;
|
375
394
|
}
|
376
395
|
throw new errors.MissingParameterError('Parameter missing: id');
|
377
396
|
case 7:
|
378
397
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
379
|
-
|
398
|
+
_context5.next = 9;
|
380
399
|
break;
|
381
400
|
}
|
382
401
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
383
402
|
case 9:
|
384
|
-
|
403
|
+
_context5.next = 11;
|
385
404
|
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
386
405
|
case 11:
|
387
|
-
response =
|
388
|
-
return
|
406
|
+
response = _context5.sent;
|
407
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
389
408
|
case 13:
|
390
409
|
case "end":
|
391
|
-
return
|
410
|
+
return _context5.stop();
|
392
411
|
}
|
393
|
-
},
|
412
|
+
}, _callee5);
|
394
413
|
}));
|
395
414
|
return function (_x) {
|
396
|
-
return
|
415
|
+
return _ref7.apply(this, arguments);
|
397
416
|
};
|
398
417
|
}());
|
399
418
|
(0, _defineProperty2.default)(As2Station, "get", function (id) {
|
@@ -406,68 +425,68 @@ _class = As2Station;
|
|
406
425
|
// public_certificate (required) - string
|
407
426
|
// private_key (required) - string
|
408
427
|
// private_key_password - string
|
409
|
-
(0, _defineProperty2.default)(As2Station, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
428
|
+
(0, _defineProperty2.default)(As2Station, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
410
429
|
var params,
|
411
430
|
options,
|
412
431
|
response,
|
413
|
-
|
414
|
-
return _regenerator.default.wrap(function
|
415
|
-
while (1) switch (
|
432
|
+
_args6 = arguments;
|
433
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
434
|
+
while (1) switch (_context6.prev = _context6.next) {
|
416
435
|
case 0:
|
417
|
-
params =
|
418
|
-
options =
|
436
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
437
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
419
438
|
if (params['name']) {
|
420
|
-
|
439
|
+
_context6.next = 4;
|
421
440
|
break;
|
422
441
|
}
|
423
442
|
throw new errors.MissingParameterError('Parameter missing: name');
|
424
443
|
case 4:
|
425
444
|
if (params['public_certificate']) {
|
426
|
-
|
445
|
+
_context6.next = 6;
|
427
446
|
break;
|
428
447
|
}
|
429
448
|
throw new errors.MissingParameterError('Parameter missing: public_certificate');
|
430
449
|
case 6:
|
431
450
|
if (params['private_key']) {
|
432
|
-
|
451
|
+
_context6.next = 8;
|
433
452
|
break;
|
434
453
|
}
|
435
454
|
throw new errors.MissingParameterError('Parameter missing: private_key');
|
436
455
|
case 8:
|
437
456
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
438
|
-
|
457
|
+
_context6.next = 10;
|
439
458
|
break;
|
440
459
|
}
|
441
460
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
442
461
|
case 10:
|
443
462
|
if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
|
444
|
-
|
463
|
+
_context6.next = 12;
|
445
464
|
break;
|
446
465
|
}
|
447
466
|
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params['public_certificate'])));
|
448
467
|
case 12:
|
449
468
|
if (!(params['private_key'] && !(0, _utils.isString)(params['private_key']))) {
|
450
|
-
|
469
|
+
_context6.next = 14;
|
451
470
|
break;
|
452
471
|
}
|
453
472
|
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params['private_key'])));
|
454
473
|
case 14:
|
455
474
|
if (!(params['private_key_password'] && !(0, _utils.isString)(params['private_key_password']))) {
|
456
|
-
|
475
|
+
_context6.next = 16;
|
457
476
|
break;
|
458
477
|
}
|
459
478
|
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params['private_key_password'])));
|
460
479
|
case 16:
|
461
|
-
|
480
|
+
_context6.next = 18;
|
462
481
|
return _Api.default.sendRequest("/as2_stations", 'POST', params, options);
|
463
482
|
case 18:
|
464
|
-
response =
|
465
|
-
return
|
483
|
+
response = _context6.sent;
|
484
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
466
485
|
case 20:
|
467
486
|
case "end":
|
468
|
-
return
|
487
|
+
return _context6.stop();
|
469
488
|
}
|
470
|
-
},
|
489
|
+
}, _callee6);
|
471
490
|
})));
|
472
491
|
var _default = exports.default = As2Station;
|
473
492
|
module.exports = As2Station;
|