files.com 1.1.19 → 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/lib/Api.js +1 -1
- package/lib/Errors.js +345 -334
- 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 -178
- 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/Project.js
CHANGED
@@ -70,19 +70,19 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
70
70
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
71
71
|
case 5:
|
72
72
|
params.id = _this.attributes.id;
|
73
|
-
if (!(params
|
73
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
74
74
|
_context.next = 8;
|
75
75
|
break;
|
76
76
|
}
|
77
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
77
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
78
78
|
case 8:
|
79
|
-
if (!(params
|
79
|
+
if (!(params.global_access && !(0, _utils.isString)(params.global_access))) {
|
80
80
|
_context.next = 10;
|
81
81
|
break;
|
82
82
|
}
|
83
|
-
throw new errors.InvalidParameterError("Bad parameter: global_access must be of type String, received ".concat((0, _utils.getType)(params
|
83
|
+
throw new errors.InvalidParameterError("Bad parameter: global_access must be of type String, received ".concat((0, _utils.getType)(params.global_access)));
|
84
84
|
case 10:
|
85
|
-
if (params
|
85
|
+
if (params.id) {
|
86
86
|
_context.next = 16;
|
87
87
|
break;
|
88
88
|
}
|
@@ -90,13 +90,13 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
90
90
|
_context.next = 15;
|
91
91
|
break;
|
92
92
|
}
|
93
|
-
params
|
93
|
+
params.id = _this.id;
|
94
94
|
_context.next = 16;
|
95
95
|
break;
|
96
96
|
case 15:
|
97
97
|
throw new errors.MissingParameterError('Parameter missing: id');
|
98
98
|
case 16:
|
99
|
-
if (params
|
99
|
+
if (params.global_access) {
|
100
100
|
_context.next = 22;
|
101
101
|
break;
|
102
102
|
}
|
@@ -104,14 +104,14 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
104
104
|
_context.next = 21;
|
105
105
|
break;
|
106
106
|
}
|
107
|
-
params
|
107
|
+
params.global_access = _this.global_access;
|
108
108
|
_context.next = 22;
|
109
109
|
break;
|
110
110
|
case 21:
|
111
111
|
throw new errors.MissingParameterError('Parameter missing: global_access');
|
112
112
|
case 22:
|
113
113
|
_context.next = 24;
|
114
|
-
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params
|
114
|
+
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
115
115
|
case 24:
|
116
116
|
response = _context.sent;
|
117
117
|
return _context.abrupt("return", new Project(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -123,7 +123,6 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
123
123
|
})));
|
124
124
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
125
125
|
var params,
|
126
|
-
response,
|
127
126
|
_args2 = arguments;
|
128
127
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
129
128
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -142,13 +141,13 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
142
141
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
143
142
|
case 5:
|
144
143
|
params.id = _this.attributes.id;
|
145
|
-
if (!(params
|
144
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
146
145
|
_context2.next = 8;
|
147
146
|
break;
|
148
147
|
}
|
149
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
148
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
150
149
|
case 8:
|
151
|
-
if (params
|
150
|
+
if (params.id) {
|
152
151
|
_context2.next = 14;
|
153
152
|
break;
|
154
153
|
}
|
@@ -156,18 +155,15 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
156
155
|
_context2.next = 13;
|
157
156
|
break;
|
158
157
|
}
|
159
|
-
params
|
158
|
+
params.id = _this.id;
|
160
159
|
_context2.next = 14;
|
161
160
|
break;
|
162
161
|
case 13:
|
163
162
|
throw new errors.MissingParameterError('Parameter missing: id');
|
164
163
|
case 14:
|
165
164
|
_context2.next = 16;
|
166
|
-
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params
|
165
|
+
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
167
166
|
case 16:
|
168
|
-
response = _context2.sent;
|
169
|
-
return _context2.abrupt("return");
|
170
|
-
case 18:
|
171
167
|
case "end":
|
172
168
|
return _context2.stop();
|
173
169
|
}
|
@@ -178,28 +174,28 @@ var Project = /*#__PURE__*/(0, _createClass2.default)(function Project() {
|
|
178
174
|
return _this.delete(params);
|
179
175
|
});
|
180
176
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
181
|
-
var
|
177
|
+
var _newObject, newObject;
|
182
178
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
183
179
|
while (1) switch (_context3.prev = _context3.next) {
|
184
180
|
case 0:
|
185
|
-
if (!_this.attributes
|
186
|
-
_context3.next =
|
181
|
+
if (!_this.attributes.id) {
|
182
|
+
_context3.next = 6;
|
187
183
|
break;
|
188
184
|
}
|
189
185
|
_context3.next = 3;
|
190
186
|
return _this.update(_this.attributes);
|
191
187
|
case 3:
|
192
|
-
newObject = _context3.sent;
|
193
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
194
|
-
return _context3.abrupt("return", true);
|
195
|
-
case 8:
|
196
|
-
_context3.next = 10;
|
197
|
-
return Project.create(_this.attributes, _this.options);
|
198
|
-
case 10:
|
199
188
|
_newObject = _context3.sent;
|
200
189
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
201
190
|
return _context3.abrupt("return", true);
|
202
|
-
case
|
191
|
+
case 6:
|
192
|
+
_context3.next = 8;
|
193
|
+
return Project.create(_this.attributes, _this.options);
|
194
|
+
case 8:
|
195
|
+
newObject = _context3.sent;
|
196
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
197
|
+
return _context3.abrupt("return", true);
|
198
|
+
case 11:
|
203
199
|
case "end":
|
204
200
|
return _context3.stop();
|
205
201
|
}
|
@@ -233,20 +229,20 @@ _class = Project;
|
|
233
229
|
case 0:
|
234
230
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
235
231
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
236
|
-
if (!(params
|
232
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
237
233
|
_context4.next = 4;
|
238
234
|
break;
|
239
235
|
}
|
240
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
236
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
241
237
|
case 4:
|
242
|
-
if (!(params
|
238
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
243
239
|
_context4.next = 6;
|
244
240
|
break;
|
245
241
|
}
|
246
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
242
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
247
243
|
case 6:
|
248
244
|
_context4.next = 8;
|
249
|
-
return _Api.default.sendRequest(
|
245
|
+
return _Api.default.sendRequest('/projects', 'GET', params, options);
|
250
246
|
case 8:
|
251
247
|
response = _context4.sent;
|
252
248
|
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) {
|
@@ -282,21 +278,21 @@ _class = Project;
|
|
282
278
|
}
|
283
279
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
284
280
|
case 4:
|
285
|
-
params
|
286
|
-
if (params
|
281
|
+
params.id = id;
|
282
|
+
if (params.id) {
|
287
283
|
_context5.next = 7;
|
288
284
|
break;
|
289
285
|
}
|
290
286
|
throw new errors.MissingParameterError('Parameter missing: id');
|
291
287
|
case 7:
|
292
|
-
if (!(params
|
288
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
293
289
|
_context5.next = 9;
|
294
290
|
break;
|
295
291
|
}
|
296
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
292
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
297
293
|
case 9:
|
298
294
|
_context5.next = 11;
|
299
|
-
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params
|
295
|
+
return _Api.default.sendRequest("/projects/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
300
296
|
case 11:
|
301
297
|
response = _context5.sent;
|
302
298
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -327,20 +323,20 @@ _class = Project;
|
|
327
323
|
case 0:
|
328
324
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
329
325
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
330
|
-
if (params
|
326
|
+
if (params.global_access) {
|
331
327
|
_context6.next = 4;
|
332
328
|
break;
|
333
329
|
}
|
334
330
|
throw new errors.MissingParameterError('Parameter missing: global_access');
|
335
331
|
case 4:
|
336
|
-
if (!(params
|
332
|
+
if (!(params.global_access && !(0, _utils.isString)(params.global_access))) {
|
337
333
|
_context6.next = 6;
|
338
334
|
break;
|
339
335
|
}
|
340
|
-
throw new errors.InvalidParameterError("Bad parameter: global_access must be of type String, received ".concat((0, _utils.getType)(params
|
336
|
+
throw new errors.InvalidParameterError("Bad parameter: global_access must be of type String, received ".concat((0, _utils.getType)(params.global_access)));
|
341
337
|
case 6:
|
342
338
|
_context6.next = 8;
|
343
|
-
return _Api.default.sendRequest(
|
339
|
+
return _Api.default.sendRequest('/projects', 'POST', params, options);
|
344
340
|
case 8:
|
345
341
|
response = _context6.sent;
|
346
342
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/PublicKey.js
CHANGED
@@ -109,19 +109,19 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
109
109
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
110
110
|
case 5:
|
111
111
|
params.id = _this.attributes.id;
|
112
|
-
if (!(params
|
112
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
113
113
|
_context.next = 8;
|
114
114
|
break;
|
115
115
|
}
|
116
|
-
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)));
|
117
117
|
case 8:
|
118
|
-
if (!(params
|
118
|
+
if (!(params.title && !(0, _utils.isString)(params.title))) {
|
119
119
|
_context.next = 10;
|
120
120
|
break;
|
121
121
|
}
|
122
|
-
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params
|
122
|
+
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params.title)));
|
123
123
|
case 10:
|
124
|
-
if (params
|
124
|
+
if (params.id) {
|
125
125
|
_context.next = 16;
|
126
126
|
break;
|
127
127
|
}
|
@@ -129,13 +129,13 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
129
129
|
_context.next = 15;
|
130
130
|
break;
|
131
131
|
}
|
132
|
-
params
|
132
|
+
params.id = _this.id;
|
133
133
|
_context.next = 16;
|
134
134
|
break;
|
135
135
|
case 15:
|
136
136
|
throw new errors.MissingParameterError('Parameter missing: id');
|
137
137
|
case 16:
|
138
|
-
if (params
|
138
|
+
if (params.title) {
|
139
139
|
_context.next = 22;
|
140
140
|
break;
|
141
141
|
}
|
@@ -143,14 +143,14 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
143
143
|
_context.next = 21;
|
144
144
|
break;
|
145
145
|
}
|
146
|
-
params
|
146
|
+
params.title = _this.title;
|
147
147
|
_context.next = 22;
|
148
148
|
break;
|
149
149
|
case 21:
|
150
150
|
throw new errors.MissingParameterError('Parameter missing: title');
|
151
151
|
case 22:
|
152
152
|
_context.next = 24;
|
153
|
-
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params
|
153
|
+
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
154
154
|
case 24:
|
155
155
|
response = _context.sent;
|
156
156
|
return _context.abrupt("return", new PublicKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -162,7 +162,6 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
162
162
|
})));
|
163
163
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
164
164
|
var params,
|
165
|
-
response,
|
166
165
|
_args2 = arguments;
|
167
166
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
168
167
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -181,13 +180,13 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
181
180
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
182
181
|
case 5:
|
183
182
|
params.id = _this.attributes.id;
|
184
|
-
if (!(params
|
183
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
185
184
|
_context2.next = 8;
|
186
185
|
break;
|
187
186
|
}
|
188
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
187
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
189
188
|
case 8:
|
190
|
-
if (params
|
189
|
+
if (params.id) {
|
191
190
|
_context2.next = 14;
|
192
191
|
break;
|
193
192
|
}
|
@@ -195,18 +194,15 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
195
194
|
_context2.next = 13;
|
196
195
|
break;
|
197
196
|
}
|
198
|
-
params
|
197
|
+
params.id = _this.id;
|
199
198
|
_context2.next = 14;
|
200
199
|
break;
|
201
200
|
case 13:
|
202
201
|
throw new errors.MissingParameterError('Parameter missing: id');
|
203
202
|
case 14:
|
204
203
|
_context2.next = 16;
|
205
|
-
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params
|
204
|
+
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
206
205
|
case 16:
|
207
|
-
response = _context2.sent;
|
208
|
-
return _context2.abrupt("return");
|
209
|
-
case 18:
|
210
206
|
case "end":
|
211
207
|
return _context2.stop();
|
212
208
|
}
|
@@ -217,28 +213,28 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
217
213
|
return _this.delete(params);
|
218
214
|
});
|
219
215
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
220
|
-
var
|
216
|
+
var _newObject, newObject;
|
221
217
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
222
218
|
while (1) switch (_context3.prev = _context3.next) {
|
223
219
|
case 0:
|
224
|
-
if (!_this.attributes
|
225
|
-
_context3.next =
|
220
|
+
if (!_this.attributes.id) {
|
221
|
+
_context3.next = 6;
|
226
222
|
break;
|
227
223
|
}
|
228
224
|
_context3.next = 3;
|
229
225
|
return _this.update(_this.attributes);
|
230
226
|
case 3:
|
231
|
-
newObject = _context3.sent;
|
232
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
233
|
-
return _context3.abrupt("return", true);
|
234
|
-
case 8:
|
235
|
-
_context3.next = 10;
|
236
|
-
return PublicKey.create(_this.attributes, _this.options);
|
237
|
-
case 10:
|
238
227
|
_newObject = _context3.sent;
|
239
228
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
240
229
|
return _context3.abrupt("return", true);
|
241
|
-
case
|
230
|
+
case 6:
|
231
|
+
_context3.next = 8;
|
232
|
+
return PublicKey.create(_this.attributes, _this.options);
|
233
|
+
case 8:
|
234
|
+
newObject = _context3.sent;
|
235
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
236
|
+
return _context3.abrupt("return", true);
|
237
|
+
case 11:
|
242
238
|
case "end":
|
243
239
|
return _context3.stop();
|
244
240
|
}
|
@@ -273,26 +269,26 @@ _class = PublicKey;
|
|
273
269
|
case 0:
|
274
270
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
275
271
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
276
|
-
if (!(params
|
272
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
277
273
|
_context4.next = 4;
|
278
274
|
break;
|
279
275
|
}
|
280
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
276
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
281
277
|
case 4:
|
282
|
-
if (!(params
|
278
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
283
279
|
_context4.next = 6;
|
284
280
|
break;
|
285
281
|
}
|
286
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
282
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
287
283
|
case 6:
|
288
|
-
if (!(params
|
284
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
289
285
|
_context4.next = 8;
|
290
286
|
break;
|
291
287
|
}
|
292
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
288
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
293
289
|
case 8:
|
294
290
|
_context4.next = 10;
|
295
|
-
return _Api.default.sendRequest(
|
291
|
+
return _Api.default.sendRequest('/public_keys', 'GET', params, options);
|
296
292
|
case 10:
|
297
293
|
response = _context4.sent;
|
298
294
|
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) {
|
@@ -328,21 +324,21 @@ _class = PublicKey;
|
|
328
324
|
}
|
329
325
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
330
326
|
case 4:
|
331
|
-
params
|
332
|
-
if (params
|
327
|
+
params.id = id;
|
328
|
+
if (params.id) {
|
333
329
|
_context5.next = 7;
|
334
330
|
break;
|
335
331
|
}
|
336
332
|
throw new errors.MissingParameterError('Parameter missing: id');
|
337
333
|
case 7:
|
338
|
-
if (!(params
|
334
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
339
335
|
_context5.next = 9;
|
340
336
|
break;
|
341
337
|
}
|
342
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
338
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
343
339
|
case 9:
|
344
340
|
_context5.next = 11;
|
345
|
-
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params
|
341
|
+
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
346
342
|
case 11:
|
347
343
|
response = _context5.sent;
|
348
344
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -375,38 +371,38 @@ _class = PublicKey;
|
|
375
371
|
case 0:
|
376
372
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
377
373
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
378
|
-
if (params
|
374
|
+
if (params.title) {
|
379
375
|
_context6.next = 4;
|
380
376
|
break;
|
381
377
|
}
|
382
378
|
throw new errors.MissingParameterError('Parameter missing: title');
|
383
379
|
case 4:
|
384
|
-
if (params
|
380
|
+
if (params.public_key) {
|
385
381
|
_context6.next = 6;
|
386
382
|
break;
|
387
383
|
}
|
388
384
|
throw new errors.MissingParameterError('Parameter missing: public_key');
|
389
385
|
case 6:
|
390
|
-
if (!(params
|
386
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
391
387
|
_context6.next = 8;
|
392
388
|
break;
|
393
389
|
}
|
394
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
390
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
395
391
|
case 8:
|
396
|
-
if (!(params
|
392
|
+
if (!(params.title && !(0, _utils.isString)(params.title))) {
|
397
393
|
_context6.next = 10;
|
398
394
|
break;
|
399
395
|
}
|
400
|
-
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params
|
396
|
+
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params.title)));
|
401
397
|
case 10:
|
402
|
-
if (!(params
|
398
|
+
if (!(params.public_key && !(0, _utils.isString)(params.public_key))) {
|
403
399
|
_context6.next = 12;
|
404
400
|
break;
|
405
401
|
}
|
406
|
-
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params
|
402
|
+
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params.public_key)));
|
407
403
|
case 12:
|
408
404
|
_context6.next = 14;
|
409
|
-
return _Api.default.sendRequest(
|
405
|
+
return _Api.default.sendRequest('/public_keys', 'POST', params, options);
|
410
406
|
case 14:
|
411
407
|
response = _context6.sent;
|
412
408
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -87,20 +87,20 @@ _class = RemoteBandwidthSnapshot;
|
|
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('/remote_bandwidth_snapshots', '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) {
|