files.com 1.1.18 → 1.2.0
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/.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
package/lib/models/Request.js
CHANGED
|
@@ -91,7 +91,6 @@ var Request = /*#__PURE__*/(0, _createClass2.default)(function Request() {
|
|
|
91
91
|
});
|
|
92
92
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
93
93
|
var params,
|
|
94
|
-
response,
|
|
95
94
|
_args = arguments;
|
|
96
95
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
97
96
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -110,13 +109,13 @@ var Request = /*#__PURE__*/(0, _createClass2.default)(function Request() {
|
|
|
110
109
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
111
110
|
case 5:
|
|
112
111
|
params.id = _this.attributes.id;
|
|
113
|
-
if (!(params
|
|
112
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
114
113
|
_context.next = 8;
|
|
115
114
|
break;
|
|
116
115
|
}
|
|
117
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
116
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
118
117
|
case 8:
|
|
119
|
-
if (params
|
|
118
|
+
if (params.id) {
|
|
120
119
|
_context.next = 14;
|
|
121
120
|
break;
|
|
122
121
|
}
|
|
@@ -124,18 +123,15 @@ var Request = /*#__PURE__*/(0, _createClass2.default)(function Request() {
|
|
|
124
123
|
_context.next = 13;
|
|
125
124
|
break;
|
|
126
125
|
}
|
|
127
|
-
params
|
|
126
|
+
params.id = _this.id;
|
|
128
127
|
_context.next = 14;
|
|
129
128
|
break;
|
|
130
129
|
case 13:
|
|
131
130
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
132
131
|
case 14:
|
|
133
132
|
_context.next = 16;
|
|
134
|
-
return _Api.default.sendRequest("/requests/".concat(encodeURIComponent(params
|
|
133
|
+
return _Api.default.sendRequest("/requests/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
135
134
|
case 16:
|
|
136
|
-
response = _context.sent;
|
|
137
|
-
return _context.abrupt("return");
|
|
138
|
-
case 18:
|
|
139
135
|
case "end":
|
|
140
136
|
return _context.stop();
|
|
141
137
|
}
|
|
@@ -150,7 +146,7 @@ var Request = /*#__PURE__*/(0, _createClass2.default)(function Request() {
|
|
|
150
146
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
151
147
|
while (1) switch (_context2.prev = _context2.next) {
|
|
152
148
|
case 0:
|
|
153
|
-
if (!_this.attributes
|
|
149
|
+
if (!_this.attributes.id) {
|
|
154
150
|
_context2.next = 4;
|
|
155
151
|
break;
|
|
156
152
|
}
|
|
@@ -199,26 +195,26 @@ _class = Request;
|
|
|
199
195
|
case 0:
|
|
200
196
|
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
201
197
|
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
202
|
-
if (!(params
|
|
198
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
203
199
|
_context3.next = 4;
|
|
204
200
|
break;
|
|
205
201
|
}
|
|
206
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
202
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
207
203
|
case 4:
|
|
208
|
-
if (!(params
|
|
204
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
209
205
|
_context3.next = 6;
|
|
210
206
|
break;
|
|
211
207
|
}
|
|
212
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
208
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
213
209
|
case 6:
|
|
214
|
-
if (!(params
|
|
210
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
215
211
|
_context3.next = 8;
|
|
216
212
|
break;
|
|
217
213
|
}
|
|
218
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
214
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
219
215
|
case 8:
|
|
220
216
|
_context3.next = 10;
|
|
221
|
-
return _Api.default.sendRequest(
|
|
217
|
+
return _Api.default.sendRequest('/requests', 'GET', params, options);
|
|
222
218
|
case 10:
|
|
223
219
|
response = _context3.sent;
|
|
224
220
|
return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
|
@@ -259,33 +255,33 @@ _class = Request;
|
|
|
259
255
|
}
|
|
260
256
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
261
257
|
case 4:
|
|
262
|
-
params
|
|
263
|
-
if (params
|
|
258
|
+
params.path = path;
|
|
259
|
+
if (params.path) {
|
|
264
260
|
_context4.next = 7;
|
|
265
261
|
break;
|
|
266
262
|
}
|
|
267
263
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
268
264
|
case 7:
|
|
269
|
-
if (!(params
|
|
265
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
270
266
|
_context4.next = 9;
|
|
271
267
|
break;
|
|
272
268
|
}
|
|
273
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
269
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
274
270
|
case 9:
|
|
275
|
-
if (!(params
|
|
271
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
276
272
|
_context4.next = 11;
|
|
277
273
|
break;
|
|
278
274
|
}
|
|
279
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
275
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
280
276
|
case 11:
|
|
281
|
-
if (!(params
|
|
277
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
282
278
|
_context4.next = 13;
|
|
283
279
|
break;
|
|
284
280
|
}
|
|
285
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
281
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
286
282
|
case 13:
|
|
287
283
|
_context4.next = 15;
|
|
288
|
-
return _Api.default.sendRequest("/requests/folders/".concat(encodeURIComponent(params
|
|
284
|
+
return _Api.default.sendRequest("/requests/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
|
289
285
|
case 15:
|
|
290
286
|
response = _context4.sent;
|
|
291
287
|
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
|
|
@@ -316,44 +312,44 @@ _class = Request;
|
|
|
316
312
|
case 0:
|
|
317
313
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
318
314
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
319
|
-
if (params
|
|
315
|
+
if (params.path) {
|
|
320
316
|
_context5.next = 4;
|
|
321
317
|
break;
|
|
322
318
|
}
|
|
323
319
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
324
320
|
case 4:
|
|
325
|
-
if (params
|
|
321
|
+
if (params.destination) {
|
|
326
322
|
_context5.next = 6;
|
|
327
323
|
break;
|
|
328
324
|
}
|
|
329
325
|
throw new errors.MissingParameterError('Parameter missing: destination');
|
|
330
326
|
case 6:
|
|
331
|
-
if (!(params
|
|
327
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
332
328
|
_context5.next = 8;
|
|
333
329
|
break;
|
|
334
330
|
}
|
|
335
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
331
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
336
332
|
case 8:
|
|
337
|
-
if (!(params
|
|
333
|
+
if (!(params.destination && !(0, _utils.isString)(params.destination))) {
|
|
338
334
|
_context5.next = 10;
|
|
339
335
|
break;
|
|
340
336
|
}
|
|
341
|
-
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params
|
|
337
|
+
throw new errors.InvalidParameterError("Bad parameter: destination must be of type String, received ".concat((0, _utils.getType)(params.destination)));
|
|
342
338
|
case 10:
|
|
343
|
-
if (!(params
|
|
339
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
344
340
|
_context5.next = 12;
|
|
345
341
|
break;
|
|
346
342
|
}
|
|
347
|
-
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
343
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
348
344
|
case 12:
|
|
349
|
-
if (!(params
|
|
345
|
+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
|
350
346
|
_context5.next = 14;
|
|
351
347
|
break;
|
|
352
348
|
}
|
|
353
|
-
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
349
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
|
354
350
|
case 14:
|
|
355
351
|
_context5.next = 16;
|
|
356
|
-
return _Api.default.sendRequest(
|
|
352
|
+
return _Api.default.sendRequest('/requests', 'POST', params, options);
|
|
357
353
|
case 16:
|
|
358
354
|
response = _context5.sent;
|
|
359
355
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/Session.js
CHANGED
|
@@ -94,7 +94,7 @@ var Session = /*#__PURE__*/(0, _createClass2.default)(function Session() {
|
|
|
94
94
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
95
95
|
while (1) switch (_context.prev = _context.next) {
|
|
96
96
|
case 0:
|
|
97
|
-
if (!_this.attributes
|
|
97
|
+
if (!_this.attributes.id) {
|
|
98
98
|
_context.next = 4;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
@@ -141,32 +141,32 @@ _class = Session;
|
|
|
141
141
|
case 0:
|
|
142
142
|
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
143
143
|
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
144
|
-
if (!(params
|
|
144
|
+
if (!(params.username && !(0, _utils.isString)(params.username))) {
|
|
145
145
|
_context2.next = 4;
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
|
-
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params
|
|
148
|
+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
|
|
149
149
|
case 4:
|
|
150
|
-
if (!(params
|
|
150
|
+
if (!(params.password && !(0, _utils.isString)(params.password))) {
|
|
151
151
|
_context2.next = 6;
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
|
-
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params
|
|
154
|
+
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params.password)));
|
|
155
155
|
case 6:
|
|
156
|
-
if (!(params
|
|
156
|
+
if (!(params.otp && !(0, _utils.isString)(params.otp))) {
|
|
157
157
|
_context2.next = 8;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
|
-
throw new errors.InvalidParameterError("Bad parameter: otp must be of type String, received ".concat((0, _utils.getType)(params
|
|
160
|
+
throw new errors.InvalidParameterError("Bad parameter: otp must be of type String, received ".concat((0, _utils.getType)(params.otp)));
|
|
161
161
|
case 8:
|
|
162
|
-
if (!(params
|
|
162
|
+
if (!(params.partial_session_id && !(0, _utils.isString)(params.partial_session_id))) {
|
|
163
163
|
_context2.next = 10;
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
throw new errors.InvalidParameterError("Bad parameter: partial_session_id must be of type String, received ".concat((0, _utils.getType)(params
|
|
166
|
+
throw new errors.InvalidParameterError("Bad parameter: partial_session_id must be of type String, received ".concat((0, _utils.getType)(params.partial_session_id)));
|
|
167
167
|
case 10:
|
|
168
168
|
_context2.next = 12;
|
|
169
|
-
return _Api.default.sendRequest(
|
|
169
|
+
return _Api.default.sendRequest('/sessions', 'POST', params, options);
|
|
170
170
|
case 12:
|
|
171
171
|
response = _context2.sent;
|
|
172
172
|
return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -178,18 +178,14 @@ _class = Session;
|
|
|
178
178
|
})));
|
|
179
179
|
(0, _defineProperty2.default)(Session, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
180
180
|
var options,
|
|
181
|
-
response,
|
|
182
181
|
_args3 = arguments;
|
|
183
182
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
184
183
|
while (1) switch (_context3.prev = _context3.next) {
|
|
185
184
|
case 0:
|
|
186
185
|
options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
187
186
|
_context3.next = 3;
|
|
188
|
-
return _Api.default.sendRequest(
|
|
187
|
+
return _Api.default.sendRequest('/sessions', 'DELETE', {}, options);
|
|
189
188
|
case 3:
|
|
190
|
-
response = _context3.sent;
|
|
191
|
-
return _context3.abrupt("return");
|
|
192
|
-
case 5:
|
|
193
189
|
case "end":
|
|
194
190
|
return _context3.stop();
|
|
195
191
|
}
|
|
@@ -87,20 +87,20 @@ _class = SettingsChange;
|
|
|
87
87
|
case 0:
|
|
88
88
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
89
89
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
90
|
-
if (!(params
|
|
90
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
91
91
|
_context.next = 4;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
94
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
95
95
|
case 4:
|
|
96
|
-
if (!(params
|
|
96
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
97
97
|
_context.next = 6;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
100
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
101
101
|
case 6:
|
|
102
102
|
_context.next = 8;
|
|
103
|
-
return _Api.default.sendRequest(
|
|
103
|
+
return _Api.default.sendRequest('/settings_changes', 'GET', params, options);
|
|
104
104
|
case 8:
|
|
105
105
|
response = _context.sent;
|
|
106
106
|
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) {
|
|
@@ -92,25 +92,25 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
92
92
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
93
93
|
case 5:
|
|
94
94
|
params.id = _this.attributes.id;
|
|
95
|
-
if (!(params
|
|
95
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
96
96
|
_context.next = 8;
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
99
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
100
100
|
case 8:
|
|
101
|
-
if (!(params
|
|
101
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
102
102
|
_context.next = 10;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
105
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
106
106
|
case 10:
|
|
107
|
-
if (!(params
|
|
107
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
|
108
108
|
_context.next = 12;
|
|
109
109
|
break;
|
|
110
110
|
}
|
|
111
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
|
111
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
|
112
112
|
case 12:
|
|
113
|
-
if (params
|
|
113
|
+
if (params.id) {
|
|
114
114
|
_context.next = 18;
|
|
115
115
|
break;
|
|
116
116
|
}
|
|
@@ -118,14 +118,14 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
118
118
|
_context.next = 17;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
|
-
params
|
|
121
|
+
params.id = _this.id;
|
|
122
122
|
_context.next = 18;
|
|
123
123
|
break;
|
|
124
124
|
case 17:
|
|
125
125
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
126
126
|
case 18:
|
|
127
127
|
_context.next = 20;
|
|
128
|
-
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params
|
|
128
|
+
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
129
129
|
case 20:
|
|
130
130
|
response = _context.sent;
|
|
131
131
|
return _context.abrupt("return", new SftpHostKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -137,7 +137,6 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
137
137
|
})));
|
|
138
138
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
139
139
|
var params,
|
|
140
|
-
response,
|
|
141
140
|
_args2 = arguments;
|
|
142
141
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
143
142
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -156,13 +155,13 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
156
155
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
157
156
|
case 5:
|
|
158
157
|
params.id = _this.attributes.id;
|
|
159
|
-
if (!(params
|
|
158
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
160
159
|
_context2.next = 8;
|
|
161
160
|
break;
|
|
162
161
|
}
|
|
163
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
162
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
164
163
|
case 8:
|
|
165
|
-
if (params
|
|
164
|
+
if (params.id) {
|
|
166
165
|
_context2.next = 14;
|
|
167
166
|
break;
|
|
168
167
|
}
|
|
@@ -170,18 +169,15 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
170
169
|
_context2.next = 13;
|
|
171
170
|
break;
|
|
172
171
|
}
|
|
173
|
-
params
|
|
172
|
+
params.id = _this.id;
|
|
174
173
|
_context2.next = 14;
|
|
175
174
|
break;
|
|
176
175
|
case 13:
|
|
177
176
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
178
177
|
case 14:
|
|
179
178
|
_context2.next = 16;
|
|
180
|
-
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params
|
|
179
|
+
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
181
180
|
case 16:
|
|
182
|
-
response = _context2.sent;
|
|
183
|
-
return _context2.abrupt("return");
|
|
184
|
-
case 18:
|
|
185
181
|
case "end":
|
|
186
182
|
return _context2.stop();
|
|
187
183
|
}
|
|
@@ -192,28 +188,28 @@ var SftpHostKey = /*#__PURE__*/(0, _createClass2.default)(function SftpHostKey()
|
|
|
192
188
|
return _this.delete(params);
|
|
193
189
|
});
|
|
194
190
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
195
|
-
var
|
|
191
|
+
var _newObject, newObject;
|
|
196
192
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
197
193
|
while (1) switch (_context3.prev = _context3.next) {
|
|
198
194
|
case 0:
|
|
199
|
-
if (!_this.attributes
|
|
200
|
-
_context3.next =
|
|
195
|
+
if (!_this.attributes.id) {
|
|
196
|
+
_context3.next = 6;
|
|
201
197
|
break;
|
|
202
198
|
}
|
|
203
199
|
_context3.next = 3;
|
|
204
200
|
return _this.update(_this.attributes);
|
|
205
201
|
case 3:
|
|
206
|
-
newObject = _context3.sent;
|
|
207
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
208
|
-
return _context3.abrupt("return", true);
|
|
209
|
-
case 8:
|
|
210
|
-
_context3.next = 10;
|
|
211
|
-
return SftpHostKey.create(_this.attributes, _this.options);
|
|
212
|
-
case 10:
|
|
213
202
|
_newObject = _context3.sent;
|
|
214
203
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
215
204
|
return _context3.abrupt("return", true);
|
|
216
|
-
case
|
|
205
|
+
case 6:
|
|
206
|
+
_context3.next = 8;
|
|
207
|
+
return SftpHostKey.create(_this.attributes, _this.options);
|
|
208
|
+
case 8:
|
|
209
|
+
newObject = _context3.sent;
|
|
210
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
211
|
+
return _context3.abrupt("return", true);
|
|
212
|
+
case 11:
|
|
217
213
|
case "end":
|
|
218
214
|
return _context3.stop();
|
|
219
215
|
}
|
|
@@ -247,20 +243,20 @@ _class = SftpHostKey;
|
|
|
247
243
|
case 0:
|
|
248
244
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
249
245
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
250
|
-
if (!(params
|
|
246
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
251
247
|
_context4.next = 4;
|
|
252
248
|
break;
|
|
253
249
|
}
|
|
254
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
250
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
255
251
|
case 4:
|
|
256
|
-
if (!(params
|
|
252
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
257
253
|
_context4.next = 6;
|
|
258
254
|
break;
|
|
259
255
|
}
|
|
260
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
256
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
261
257
|
case 6:
|
|
262
258
|
_context4.next = 8;
|
|
263
|
-
return _Api.default.sendRequest(
|
|
259
|
+
return _Api.default.sendRequest('/sftp_host_keys', 'GET', params, options);
|
|
264
260
|
case 8:
|
|
265
261
|
response = _context4.sent;
|
|
266
262
|
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) {
|
|
@@ -296,21 +292,21 @@ _class = SftpHostKey;
|
|
|
296
292
|
}
|
|
297
293
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
298
294
|
case 4:
|
|
299
|
-
params
|
|
300
|
-
if (params
|
|
295
|
+
params.id = id;
|
|
296
|
+
if (params.id) {
|
|
301
297
|
_context5.next = 7;
|
|
302
298
|
break;
|
|
303
299
|
}
|
|
304
300
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
305
301
|
case 7:
|
|
306
|
-
if (!(params
|
|
302
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
307
303
|
_context5.next = 9;
|
|
308
304
|
break;
|
|
309
305
|
}
|
|
310
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
306
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
311
307
|
case 9:
|
|
312
308
|
_context5.next = 11;
|
|
313
|
-
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params
|
|
309
|
+
return _Api.default.sendRequest("/sftp_host_keys/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
314
310
|
case 11:
|
|
315
311
|
response = _context5.sent;
|
|
316
312
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -342,20 +338,20 @@ _class = SftpHostKey;
|
|
|
342
338
|
case 0:
|
|
343
339
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
344
340
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
345
|
-
if (!(params
|
|
341
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
346
342
|
_context6.next = 4;
|
|
347
343
|
break;
|
|
348
344
|
}
|
|
349
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
345
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
350
346
|
case 4:
|
|
351
|
-
if (!(params
|
|
347
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
|
352
348
|
_context6.next = 6;
|
|
353
349
|
break;
|
|
354
350
|
}
|
|
355
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
|
351
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
|
356
352
|
case 6:
|
|
357
353
|
_context6.next = 8;
|
|
358
|
-
return _Api.default.sendRequest(
|
|
354
|
+
return _Api.default.sendRequest('/sftp_host_keys', 'POST', params, options);
|
|
359
355
|
case 8:
|
|
360
356
|
response = _context6.sent;
|
|
361
357
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|