files.com 1.1.18 → 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/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
@@ -192,26 +192,26 @@ _class = As2OutgoingMessage;
|
|
192
192
|
case 0:
|
193
193
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
194
194
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
195
|
-
if (!(params
|
195
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
196
196
|
_context.next = 4;
|
197
197
|
break;
|
198
198
|
}
|
199
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
199
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
200
200
|
case 4:
|
201
|
-
if (!(params
|
201
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
202
202
|
_context.next = 6;
|
203
203
|
break;
|
204
204
|
}
|
205
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
205
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
206
206
|
case 6:
|
207
|
-
if (!(params
|
207
|
+
if (!(params.as2_partner_id && !(0, _utils.isInt)(params.as2_partner_id))) {
|
208
208
|
_context.next = 8;
|
209
209
|
break;
|
210
210
|
}
|
211
|
-
throw new errors.InvalidParameterError("Bad parameter: as2_partner_id must be of type Int, received ".concat((0, _utils.getType)(params
|
211
|
+
throw new errors.InvalidParameterError("Bad parameter: as2_partner_id must be of type Int, received ".concat((0, _utils.getType)(params.as2_partner_id)));
|
212
212
|
case 8:
|
213
213
|
_context.next = 10;
|
214
|
-
return _Api.default.sendRequest(
|
214
|
+
return _Api.default.sendRequest('/as2_outgoing_messages', 'GET', params, options);
|
215
215
|
case 10:
|
216
216
|
response = _context.sent;
|
217
217
|
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) {
|
package/lib/models/As2Partner.js
CHANGED
@@ -158,37 +158,37 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
158
158
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
159
159
|
case 5:
|
160
160
|
params.id = _this.attributes.id;
|
161
|
-
if (!(params
|
161
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
162
162
|
_context.next = 8;
|
163
163
|
break;
|
164
164
|
}
|
165
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
165
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
166
166
|
case 8:
|
167
|
-
if (!(params
|
167
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
168
168
|
_context.next = 10;
|
169
169
|
break;
|
170
170
|
}
|
171
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
171
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
172
172
|
case 10:
|
173
|
-
if (!(params
|
173
|
+
if (!(params.uri && !(0, _utils.isString)(params.uri))) {
|
174
174
|
_context.next = 12;
|
175
175
|
break;
|
176
176
|
}
|
177
|
-
throw new errors.InvalidParameterError("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(params
|
177
|
+
throw new errors.InvalidParameterError("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(params.uri)));
|
178
178
|
case 12:
|
179
|
-
if (!(params
|
179
|
+
if (!(params.server_certificate && !(0, _utils.isString)(params.server_certificate))) {
|
180
180
|
_context.next = 14;
|
181
181
|
break;
|
182
182
|
}
|
183
|
-
throw new errors.InvalidParameterError("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
183
|
+
throw new errors.InvalidParameterError("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(params.server_certificate)));
|
184
184
|
case 14:
|
185
|
-
if (!(params
|
185
|
+
if (!(params.public_certificate && !(0, _utils.isString)(params.public_certificate))) {
|
186
186
|
_context.next = 16;
|
187
187
|
break;
|
188
188
|
}
|
189
|
-
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
189
|
+
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params.public_certificate)));
|
190
190
|
case 16:
|
191
|
-
if (params
|
191
|
+
if (params.id) {
|
192
192
|
_context.next = 22;
|
193
193
|
break;
|
194
194
|
}
|
@@ -196,14 +196,14 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
196
196
|
_context.next = 21;
|
197
197
|
break;
|
198
198
|
}
|
199
|
-
params
|
199
|
+
params.id = _this.id;
|
200
200
|
_context.next = 22;
|
201
201
|
break;
|
202
202
|
case 21:
|
203
203
|
throw new errors.MissingParameterError('Parameter missing: id');
|
204
204
|
case 22:
|
205
205
|
_context.next = 24;
|
206
|
-
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params
|
206
|
+
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
207
207
|
case 24:
|
208
208
|
response = _context.sent;
|
209
209
|
return _context.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -215,7 +215,6 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
215
215
|
})));
|
216
216
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
217
217
|
var params,
|
218
|
-
response,
|
219
218
|
_args2 = arguments;
|
220
219
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
221
220
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -234,13 +233,13 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
234
233
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
235
234
|
case 5:
|
236
235
|
params.id = _this.attributes.id;
|
237
|
-
if (!(params
|
236
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
238
237
|
_context2.next = 8;
|
239
238
|
break;
|
240
239
|
}
|
241
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
240
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
242
241
|
case 8:
|
243
|
-
if (params
|
242
|
+
if (params.id) {
|
244
243
|
_context2.next = 14;
|
245
244
|
break;
|
246
245
|
}
|
@@ -248,18 +247,15 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
248
247
|
_context2.next = 13;
|
249
248
|
break;
|
250
249
|
}
|
251
|
-
params
|
250
|
+
params.id = _this.id;
|
252
251
|
_context2.next = 14;
|
253
252
|
break;
|
254
253
|
case 13:
|
255
254
|
throw new errors.MissingParameterError('Parameter missing: id');
|
256
255
|
case 14:
|
257
256
|
_context2.next = 16;
|
258
|
-
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params
|
257
|
+
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
259
258
|
case 16:
|
260
|
-
response = _context2.sent;
|
261
|
-
return _context2.abrupt("return");
|
262
|
-
case 18:
|
263
259
|
case "end":
|
264
260
|
return _context2.stop();
|
265
261
|
}
|
@@ -270,28 +266,28 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
270
266
|
return _this.delete(params);
|
271
267
|
});
|
272
268
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
273
|
-
var
|
269
|
+
var _newObject, newObject;
|
274
270
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
275
271
|
while (1) switch (_context3.prev = _context3.next) {
|
276
272
|
case 0:
|
277
|
-
if (!_this.attributes
|
278
|
-
_context3.next =
|
273
|
+
if (!_this.attributes.id) {
|
274
|
+
_context3.next = 6;
|
279
275
|
break;
|
280
276
|
}
|
281
277
|
_context3.next = 3;
|
282
278
|
return _this.update(_this.attributes);
|
283
279
|
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
280
|
_newObject = _context3.sent;
|
292
281
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
293
282
|
return _context3.abrupt("return", true);
|
294
|
-
case
|
283
|
+
case 6:
|
284
|
+
_context3.next = 8;
|
285
|
+
return As2Partner.create(_this.attributes, _this.options);
|
286
|
+
case 8:
|
287
|
+
newObject = _context3.sent;
|
288
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
289
|
+
return _context3.abrupt("return", true);
|
290
|
+
case 11:
|
295
291
|
case "end":
|
296
292
|
return _context3.stop();
|
297
293
|
}
|
@@ -325,20 +321,20 @@ _class = As2Partner;
|
|
325
321
|
case 0:
|
326
322
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
327
323
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
328
|
-
if (!(params
|
324
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
329
325
|
_context4.next = 4;
|
330
326
|
break;
|
331
327
|
}
|
332
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
328
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
333
329
|
case 4:
|
334
|
-
if (!(params
|
330
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
335
331
|
_context4.next = 6;
|
336
332
|
break;
|
337
333
|
}
|
338
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
334
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
339
335
|
case 6:
|
340
336
|
_context4.next = 8;
|
341
|
-
return _Api.default.sendRequest(
|
337
|
+
return _Api.default.sendRequest('/as2_partners', 'GET', params, options);
|
342
338
|
case 8:
|
343
339
|
response = _context4.sent;
|
344
340
|
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) {
|
@@ -374,21 +370,21 @@ _class = As2Partner;
|
|
374
370
|
}
|
375
371
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
376
372
|
case 4:
|
377
|
-
params
|
378
|
-
if (params
|
373
|
+
params.id = id;
|
374
|
+
if (params.id) {
|
379
375
|
_context5.next = 7;
|
380
376
|
break;
|
381
377
|
}
|
382
378
|
throw new errors.MissingParameterError('Parameter missing: id');
|
383
379
|
case 7:
|
384
|
-
if (!(params
|
380
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
385
381
|
_context5.next = 9;
|
386
382
|
break;
|
387
383
|
}
|
388
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
384
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
389
385
|
case 9:
|
390
386
|
_context5.next = 11;
|
391
|
-
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params
|
387
|
+
return _Api.default.sendRequest("/as2_partners/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
392
388
|
case 11:
|
393
389
|
response = _context5.sent;
|
394
390
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -424,62 +420,62 @@ _class = As2Partner;
|
|
424
420
|
case 0:
|
425
421
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
426
422
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
427
|
-
if (params
|
423
|
+
if (params.name) {
|
428
424
|
_context6.next = 4;
|
429
425
|
break;
|
430
426
|
}
|
431
427
|
throw new errors.MissingParameterError('Parameter missing: name');
|
432
428
|
case 4:
|
433
|
-
if (params
|
429
|
+
if (params.uri) {
|
434
430
|
_context6.next = 6;
|
435
431
|
break;
|
436
432
|
}
|
437
433
|
throw new errors.MissingParameterError('Parameter missing: uri');
|
438
434
|
case 6:
|
439
|
-
if (params
|
435
|
+
if (params.public_certificate) {
|
440
436
|
_context6.next = 8;
|
441
437
|
break;
|
442
438
|
}
|
443
439
|
throw new errors.MissingParameterError('Parameter missing: public_certificate');
|
444
440
|
case 8:
|
445
|
-
if (params
|
441
|
+
if (params.as2_station_id) {
|
446
442
|
_context6.next = 10;
|
447
443
|
break;
|
448
444
|
}
|
449
445
|
throw new errors.MissingParameterError('Parameter missing: as2_station_id');
|
450
446
|
case 10:
|
451
|
-
if (!(params
|
447
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
452
448
|
_context6.next = 12;
|
453
449
|
break;
|
454
450
|
}
|
455
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
451
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
456
452
|
case 12:
|
457
|
-
if (!(params
|
453
|
+
if (!(params.uri && !(0, _utils.isString)(params.uri))) {
|
458
454
|
_context6.next = 14;
|
459
455
|
break;
|
460
456
|
}
|
461
|
-
throw new errors.InvalidParameterError("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(params
|
457
|
+
throw new errors.InvalidParameterError("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(params.uri)));
|
462
458
|
case 14:
|
463
|
-
if (!(params
|
459
|
+
if (!(params.public_certificate && !(0, _utils.isString)(params.public_certificate))) {
|
464
460
|
_context6.next = 16;
|
465
461
|
break;
|
466
462
|
}
|
467
|
-
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
463
|
+
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params.public_certificate)));
|
468
464
|
case 16:
|
469
|
-
if (!(params
|
465
|
+
if (!(params.as2_station_id && !(0, _utils.isInt)(params.as2_station_id))) {
|
470
466
|
_context6.next = 18;
|
471
467
|
break;
|
472
468
|
}
|
473
|
-
throw new errors.InvalidParameterError("Bad parameter: as2_station_id must be of type Int, received ".concat((0, _utils.getType)(params
|
469
|
+
throw new errors.InvalidParameterError("Bad parameter: as2_station_id must be of type Int, received ".concat((0, _utils.getType)(params.as2_station_id)));
|
474
470
|
case 18:
|
475
|
-
if (!(params
|
471
|
+
if (!(params.server_certificate && !(0, _utils.isString)(params.server_certificate))) {
|
476
472
|
_context6.next = 20;
|
477
473
|
break;
|
478
474
|
}
|
479
|
-
throw new errors.InvalidParameterError("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
475
|
+
throw new errors.InvalidParameterError("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(params.server_certificate)));
|
480
476
|
case 20:
|
481
477
|
_context6.next = 22;
|
482
|
-
return _Api.default.sendRequest(
|
478
|
+
return _Api.default.sendRequest('/as2_partners', 'POST', params, options);
|
483
479
|
case 22:
|
484
480
|
response = _context6.sent;
|
485
481
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/As2Station.js
CHANGED
@@ -171,37 +171,37 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
171
171
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
172
172
|
case 5:
|
173
173
|
params.id = _this.attributes.id;
|
174
|
-
if (!(params
|
174
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
175
175
|
_context.next = 8;
|
176
176
|
break;
|
177
177
|
}
|
178
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
178
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
179
179
|
case 8:
|
180
|
-
if (!(params
|
180
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
181
181
|
_context.next = 10;
|
182
182
|
break;
|
183
183
|
}
|
184
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
184
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
185
185
|
case 10:
|
186
|
-
if (!(params
|
186
|
+
if (!(params.public_certificate && !(0, _utils.isString)(params.public_certificate))) {
|
187
187
|
_context.next = 12;
|
188
188
|
break;
|
189
189
|
}
|
190
|
-
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
190
|
+
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params.public_certificate)));
|
191
191
|
case 12:
|
192
|
-
if (!(params
|
192
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
193
193
|
_context.next = 14;
|
194
194
|
break;
|
195
195
|
}
|
196
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
196
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
197
197
|
case 14:
|
198
|
-
if (!(params
|
198
|
+
if (!(params.private_key_password && !(0, _utils.isString)(params.private_key_password))) {
|
199
199
|
_context.next = 16;
|
200
200
|
break;
|
201
201
|
}
|
202
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params
|
202
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params.private_key_password)));
|
203
203
|
case 16:
|
204
|
-
if (params
|
204
|
+
if (params.id) {
|
205
205
|
_context.next = 22;
|
206
206
|
break;
|
207
207
|
}
|
@@ -209,14 +209,14 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
209
209
|
_context.next = 21;
|
210
210
|
break;
|
211
211
|
}
|
212
|
-
params
|
212
|
+
params.id = _this.id;
|
213
213
|
_context.next = 22;
|
214
214
|
break;
|
215
215
|
case 21:
|
216
216
|
throw new errors.MissingParameterError('Parameter missing: id');
|
217
217
|
case 22:
|
218
218
|
_context.next = 24;
|
219
|
-
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params
|
219
|
+
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
220
220
|
case 24:
|
221
221
|
response = _context.sent;
|
222
222
|
return _context.abrupt("return", new As2Station(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -228,7 +228,6 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
228
228
|
})));
|
229
229
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
230
230
|
var params,
|
231
|
-
response,
|
232
231
|
_args2 = arguments;
|
233
232
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
234
233
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -247,13 +246,13 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
247
246
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
248
247
|
case 5:
|
249
248
|
params.id = _this.attributes.id;
|
250
|
-
if (!(params
|
249
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
251
250
|
_context2.next = 8;
|
252
251
|
break;
|
253
252
|
}
|
254
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
253
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
255
254
|
case 8:
|
256
|
-
if (params
|
255
|
+
if (params.id) {
|
257
256
|
_context2.next = 14;
|
258
257
|
break;
|
259
258
|
}
|
@@ -261,18 +260,15 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
261
260
|
_context2.next = 13;
|
262
261
|
break;
|
263
262
|
}
|
264
|
-
params
|
263
|
+
params.id = _this.id;
|
265
264
|
_context2.next = 14;
|
266
265
|
break;
|
267
266
|
case 13:
|
268
267
|
throw new errors.MissingParameterError('Parameter missing: id');
|
269
268
|
case 14:
|
270
269
|
_context2.next = 16;
|
271
|
-
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params
|
270
|
+
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
272
271
|
case 16:
|
273
|
-
response = _context2.sent;
|
274
|
-
return _context2.abrupt("return");
|
275
|
-
case 18:
|
276
272
|
case "end":
|
277
273
|
return _context2.stop();
|
278
274
|
}
|
@@ -283,28 +279,28 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
283
279
|
return _this.delete(params);
|
284
280
|
});
|
285
281
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
286
|
-
var
|
282
|
+
var _newObject, newObject;
|
287
283
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
288
284
|
while (1) switch (_context3.prev = _context3.next) {
|
289
285
|
case 0:
|
290
|
-
if (!_this.attributes
|
291
|
-
_context3.next =
|
286
|
+
if (!_this.attributes.id) {
|
287
|
+
_context3.next = 6;
|
292
288
|
break;
|
293
289
|
}
|
294
290
|
_context3.next = 3;
|
295
291
|
return _this.update(_this.attributes);
|
296
292
|
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
293
|
_newObject = _context3.sent;
|
305
294
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
306
295
|
return _context3.abrupt("return", true);
|
307
|
-
case
|
296
|
+
case 6:
|
297
|
+
_context3.next = 8;
|
298
|
+
return As2Station.create(_this.attributes, _this.options);
|
299
|
+
case 8:
|
300
|
+
newObject = _context3.sent;
|
301
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
302
|
+
return _context3.abrupt("return", true);
|
303
|
+
case 11:
|
308
304
|
case "end":
|
309
305
|
return _context3.stop();
|
310
306
|
}
|
@@ -338,20 +334,20 @@ _class = As2Station;
|
|
338
334
|
case 0:
|
339
335
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
340
336
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
341
|
-
if (!(params
|
337
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
342
338
|
_context4.next = 4;
|
343
339
|
break;
|
344
340
|
}
|
345
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
341
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
346
342
|
case 4:
|
347
|
-
if (!(params
|
343
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
348
344
|
_context4.next = 6;
|
349
345
|
break;
|
350
346
|
}
|
351
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
347
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
352
348
|
case 6:
|
353
349
|
_context4.next = 8;
|
354
|
-
return _Api.default.sendRequest(
|
350
|
+
return _Api.default.sendRequest('/as2_stations', 'GET', params, options);
|
355
351
|
case 8:
|
356
352
|
response = _context4.sent;
|
357
353
|
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) {
|
@@ -387,21 +383,21 @@ _class = As2Station;
|
|
387
383
|
}
|
388
384
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
389
385
|
case 4:
|
390
|
-
params
|
391
|
-
if (params
|
386
|
+
params.id = id;
|
387
|
+
if (params.id) {
|
392
388
|
_context5.next = 7;
|
393
389
|
break;
|
394
390
|
}
|
395
391
|
throw new errors.MissingParameterError('Parameter missing: id');
|
396
392
|
case 7:
|
397
|
-
if (!(params
|
393
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
398
394
|
_context5.next = 9;
|
399
395
|
break;
|
400
396
|
}
|
401
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
397
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
402
398
|
case 9:
|
403
399
|
_context5.next = 11;
|
404
|
-
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params
|
400
|
+
return _Api.default.sendRequest("/as2_stations/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
405
401
|
case 11:
|
406
402
|
response = _context5.sent;
|
407
403
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -435,50 +431,50 @@ _class = As2Station;
|
|
435
431
|
case 0:
|
436
432
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
437
433
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
438
|
-
if (params
|
434
|
+
if (params.name) {
|
439
435
|
_context6.next = 4;
|
440
436
|
break;
|
441
437
|
}
|
442
438
|
throw new errors.MissingParameterError('Parameter missing: name');
|
443
439
|
case 4:
|
444
|
-
if (params
|
440
|
+
if (params.public_certificate) {
|
445
441
|
_context6.next = 6;
|
446
442
|
break;
|
447
443
|
}
|
448
444
|
throw new errors.MissingParameterError('Parameter missing: public_certificate');
|
449
445
|
case 6:
|
450
|
-
if (params
|
446
|
+
if (params.private_key) {
|
451
447
|
_context6.next = 8;
|
452
448
|
break;
|
453
449
|
}
|
454
450
|
throw new errors.MissingParameterError('Parameter missing: private_key');
|
455
451
|
case 8:
|
456
|
-
if (!(params
|
452
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
457
453
|
_context6.next = 10;
|
458
454
|
break;
|
459
455
|
}
|
460
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
456
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
461
457
|
case 10:
|
462
|
-
if (!(params
|
458
|
+
if (!(params.public_certificate && !(0, _utils.isString)(params.public_certificate))) {
|
463
459
|
_context6.next = 12;
|
464
460
|
break;
|
465
461
|
}
|
466
|
-
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params
|
462
|
+
throw new errors.InvalidParameterError("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(params.public_certificate)));
|
467
463
|
case 12:
|
468
|
-
if (!(params
|
464
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
469
465
|
_context6.next = 14;
|
470
466
|
break;
|
471
467
|
}
|
472
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
468
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
473
469
|
case 14:
|
474
|
-
if (!(params
|
470
|
+
if (!(params.private_key_password && !(0, _utils.isString)(params.private_key_password))) {
|
475
471
|
_context6.next = 16;
|
476
472
|
break;
|
477
473
|
}
|
478
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params
|
474
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params.private_key_password)));
|
479
475
|
case 16:
|
480
476
|
_context6.next = 18;
|
481
|
-
return _Api.default.sendRequest(
|
477
|
+
return _Api.default.sendRequest('/as2_stations', 'POST', params, options);
|
482
478
|
case 18:
|
483
479
|
response = _context6.sent;
|
484
480
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|