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
@@ -116,25 +116,25 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
116
116
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
117
117
|
case 5:
|
118
118
|
params.id = _this.attributes.id;
|
119
|
-
if (!(params
|
119
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
120
120
|
_context.next = 8;
|
121
121
|
break;
|
122
122
|
}
|
123
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
123
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
124
124
|
case 8:
|
125
|
-
if (!(params
|
125
|
+
if (!(params.title && !(0, _utils.isString)(params.title))) {
|
126
126
|
_context.next = 10;
|
127
127
|
break;
|
128
128
|
}
|
129
|
-
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params
|
129
|
+
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params.title)));
|
130
130
|
case 10:
|
131
|
-
if (!(params
|
131
|
+
if (!(params.form_fields && !(0, _utils.isArray)(params.form_fields))) {
|
132
132
|
_context.next = 12;
|
133
133
|
break;
|
134
134
|
}
|
135
|
-
throw new errors.InvalidParameterError("Bad parameter: form_fields must be of type Array, received ".concat((0, _utils.getType)(params
|
135
|
+
throw new errors.InvalidParameterError("Bad parameter: form_fields must be of type Array, received ".concat((0, _utils.getType)(params.form_fields)));
|
136
136
|
case 12:
|
137
|
-
if (params
|
137
|
+
if (params.id) {
|
138
138
|
_context.next = 18;
|
139
139
|
break;
|
140
140
|
}
|
@@ -142,14 +142,14 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
142
142
|
_context.next = 17;
|
143
143
|
break;
|
144
144
|
}
|
145
|
-
params
|
145
|
+
params.id = _this.id;
|
146
146
|
_context.next = 18;
|
147
147
|
break;
|
148
148
|
case 17:
|
149
149
|
throw new errors.MissingParameterError('Parameter missing: id');
|
150
150
|
case 18:
|
151
151
|
_context.next = 20;
|
152
|
-
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params
|
152
|
+
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
153
153
|
case 20:
|
154
154
|
response = _context.sent;
|
155
155
|
return _context.abrupt("return", new FormFieldSet(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -161,7 +161,6 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
161
161
|
})));
|
162
162
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
163
163
|
var params,
|
164
|
-
response,
|
165
164
|
_args2 = arguments;
|
166
165
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
167
166
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -180,13 +179,13 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
180
179
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
181
180
|
case 5:
|
182
181
|
params.id = _this.attributes.id;
|
183
|
-
if (!(params
|
182
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
184
183
|
_context2.next = 8;
|
185
184
|
break;
|
186
185
|
}
|
187
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
186
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
188
187
|
case 8:
|
189
|
-
if (params
|
188
|
+
if (params.id) {
|
190
189
|
_context2.next = 14;
|
191
190
|
break;
|
192
191
|
}
|
@@ -194,18 +193,15 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
194
193
|
_context2.next = 13;
|
195
194
|
break;
|
196
195
|
}
|
197
|
-
params
|
196
|
+
params.id = _this.id;
|
198
197
|
_context2.next = 14;
|
199
198
|
break;
|
200
199
|
case 13:
|
201
200
|
throw new errors.MissingParameterError('Parameter missing: id');
|
202
201
|
case 14:
|
203
202
|
_context2.next = 16;
|
204
|
-
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params
|
203
|
+
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
205
204
|
case 16:
|
206
|
-
response = _context2.sent;
|
207
|
-
return _context2.abrupt("return");
|
208
|
-
case 18:
|
209
205
|
case "end":
|
210
206
|
return _context2.stop();
|
211
207
|
}
|
@@ -216,28 +212,28 @@ var FormFieldSet = /*#__PURE__*/(0, _createClass2.default)(function FormFieldSet
|
|
216
212
|
return _this.delete(params);
|
217
213
|
});
|
218
214
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
219
|
-
var
|
215
|
+
var _newObject, newObject;
|
220
216
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
221
217
|
while (1) switch (_context3.prev = _context3.next) {
|
222
218
|
case 0:
|
223
|
-
if (!_this.attributes
|
224
|
-
_context3.next =
|
219
|
+
if (!_this.attributes.id) {
|
220
|
+
_context3.next = 6;
|
225
221
|
break;
|
226
222
|
}
|
227
223
|
_context3.next = 3;
|
228
224
|
return _this.update(_this.attributes);
|
229
225
|
case 3:
|
230
|
-
newObject = _context3.sent;
|
231
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
232
|
-
return _context3.abrupt("return", true);
|
233
|
-
case 8:
|
234
|
-
_context3.next = 10;
|
235
|
-
return FormFieldSet.create(_this.attributes, _this.options);
|
236
|
-
case 10:
|
237
226
|
_newObject = _context3.sent;
|
238
227
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
239
228
|
return _context3.abrupt("return", true);
|
240
|
-
case
|
229
|
+
case 6:
|
230
|
+
_context3.next = 8;
|
231
|
+
return FormFieldSet.create(_this.attributes, _this.options);
|
232
|
+
case 8:
|
233
|
+
newObject = _context3.sent;
|
234
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
235
|
+
return _context3.abrupt("return", true);
|
236
|
+
case 11:
|
241
237
|
case "end":
|
242
238
|
return _context3.stop();
|
243
239
|
}
|
@@ -272,26 +268,26 @@ _class = FormFieldSet;
|
|
272
268
|
case 0:
|
273
269
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
274
270
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
275
|
-
if (!(params
|
271
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
276
272
|
_context4.next = 4;
|
277
273
|
break;
|
278
274
|
}
|
279
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
275
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
280
276
|
case 4:
|
281
|
-
if (!(params
|
277
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
282
278
|
_context4.next = 6;
|
283
279
|
break;
|
284
280
|
}
|
285
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
281
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
286
282
|
case 6:
|
287
|
-
if (!(params
|
283
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
288
284
|
_context4.next = 8;
|
289
285
|
break;
|
290
286
|
}
|
291
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
287
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
292
288
|
case 8:
|
293
289
|
_context4.next = 10;
|
294
|
-
return _Api.default.sendRequest(
|
290
|
+
return _Api.default.sendRequest('/form_field_sets', 'GET', params, options);
|
295
291
|
case 10:
|
296
292
|
response = _context4.sent;
|
297
293
|
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) {
|
@@ -327,21 +323,21 @@ _class = FormFieldSet;
|
|
327
323
|
}
|
328
324
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
329
325
|
case 4:
|
330
|
-
params
|
331
|
-
if (params
|
326
|
+
params.id = id;
|
327
|
+
if (params.id) {
|
332
328
|
_context5.next = 7;
|
333
329
|
break;
|
334
330
|
}
|
335
331
|
throw new errors.MissingParameterError('Parameter missing: id');
|
336
332
|
case 7:
|
337
|
-
if (!(params
|
333
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
338
334
|
_context5.next = 9;
|
339
335
|
break;
|
340
336
|
}
|
341
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
337
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
342
338
|
case 9:
|
343
339
|
_context5.next = 11;
|
344
|
-
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params
|
340
|
+
return _Api.default.sendRequest("/form_field_sets/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
345
341
|
case 11:
|
346
342
|
response = _context5.sent;
|
347
343
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -377,26 +373,26 @@ _class = FormFieldSet;
|
|
377
373
|
case 0:
|
378
374
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
379
375
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
380
|
-
if (!(params
|
376
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
381
377
|
_context6.next = 4;
|
382
378
|
break;
|
383
379
|
}
|
384
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
380
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
385
381
|
case 4:
|
386
|
-
if (!(params
|
382
|
+
if (!(params.title && !(0, _utils.isString)(params.title))) {
|
387
383
|
_context6.next = 6;
|
388
384
|
break;
|
389
385
|
}
|
390
|
-
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params
|
386
|
+
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params.title)));
|
391
387
|
case 6:
|
392
|
-
if (!(params
|
388
|
+
if (!(params.form_fields && !(0, _utils.isArray)(params.form_fields))) {
|
393
389
|
_context6.next = 8;
|
394
390
|
break;
|
395
391
|
}
|
396
|
-
throw new errors.InvalidParameterError("Bad parameter: form_fields must be of type Array, received ".concat((0, _utils.getType)(params
|
392
|
+
throw new errors.InvalidParameterError("Bad parameter: form_fields must be of type Array, received ".concat((0, _utils.getType)(params.form_fields)));
|
397
393
|
case 8:
|
398
394
|
_context6.next = 10;
|
399
|
-
return _Api.default.sendRequest(
|
395
|
+
return _Api.default.sendRequest('/form_field_sets', 'POST', params, options);
|
400
396
|
case 10:
|
401
397
|
response = _context6.sent;
|
402
398
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/GpgKey.js
CHANGED
@@ -108,37 +108,37 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
108
108
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
109
109
|
case 5:
|
110
110
|
params.id = _this.attributes.id;
|
111
|
-
if (!(params
|
111
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
112
112
|
_context.next = 8;
|
113
113
|
break;
|
114
114
|
}
|
115
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
115
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
116
116
|
case 8:
|
117
|
-
if (!(params
|
117
|
+
if (!(params.public_key && !(0, _utils.isString)(params.public_key))) {
|
118
118
|
_context.next = 10;
|
119
119
|
break;
|
120
120
|
}
|
121
|
-
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params
|
121
|
+
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params.public_key)));
|
122
122
|
case 10:
|
123
|
-
if (!(params
|
123
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
124
124
|
_context.next = 12;
|
125
125
|
break;
|
126
126
|
}
|
127
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
127
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
128
128
|
case 12:
|
129
|
-
if (!(params
|
129
|
+
if (!(params.private_key_password && !(0, _utils.isString)(params.private_key_password))) {
|
130
130
|
_context.next = 14;
|
131
131
|
break;
|
132
132
|
}
|
133
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params
|
133
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params.private_key_password)));
|
134
134
|
case 14:
|
135
|
-
if (!(params
|
135
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
136
136
|
_context.next = 16;
|
137
137
|
break;
|
138
138
|
}
|
139
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
139
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
140
140
|
case 16:
|
141
|
-
if (params
|
141
|
+
if (params.id) {
|
142
142
|
_context.next = 22;
|
143
143
|
break;
|
144
144
|
}
|
@@ -146,14 +146,14 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
146
146
|
_context.next = 21;
|
147
147
|
break;
|
148
148
|
}
|
149
|
-
params
|
149
|
+
params.id = _this.id;
|
150
150
|
_context.next = 22;
|
151
151
|
break;
|
152
152
|
case 21:
|
153
153
|
throw new errors.MissingParameterError('Parameter missing: id');
|
154
154
|
case 22:
|
155
155
|
_context.next = 24;
|
156
|
-
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params
|
156
|
+
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
157
157
|
case 24:
|
158
158
|
response = _context.sent;
|
159
159
|
return _context.abrupt("return", new GpgKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -165,7 +165,6 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
165
165
|
})));
|
166
166
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
167
167
|
var params,
|
168
|
-
response,
|
169
168
|
_args2 = arguments;
|
170
169
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
171
170
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -184,13 +183,13 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
184
183
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
185
184
|
case 5:
|
186
185
|
params.id = _this.attributes.id;
|
187
|
-
if (!(params
|
186
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
188
187
|
_context2.next = 8;
|
189
188
|
break;
|
190
189
|
}
|
191
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
190
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
192
191
|
case 8:
|
193
|
-
if (params
|
192
|
+
if (params.id) {
|
194
193
|
_context2.next = 14;
|
195
194
|
break;
|
196
195
|
}
|
@@ -198,18 +197,15 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
198
197
|
_context2.next = 13;
|
199
198
|
break;
|
200
199
|
}
|
201
|
-
params
|
200
|
+
params.id = _this.id;
|
202
201
|
_context2.next = 14;
|
203
202
|
break;
|
204
203
|
case 13:
|
205
204
|
throw new errors.MissingParameterError('Parameter missing: id');
|
206
205
|
case 14:
|
207
206
|
_context2.next = 16;
|
208
|
-
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params
|
207
|
+
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
209
208
|
case 16:
|
210
|
-
response = _context2.sent;
|
211
|
-
return _context2.abrupt("return");
|
212
|
-
case 18:
|
213
209
|
case "end":
|
214
210
|
return _context2.stop();
|
215
211
|
}
|
@@ -220,28 +216,28 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
220
216
|
return _this.delete(params);
|
221
217
|
});
|
222
218
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
223
|
-
var
|
219
|
+
var _newObject, newObject;
|
224
220
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
225
221
|
while (1) switch (_context3.prev = _context3.next) {
|
226
222
|
case 0:
|
227
|
-
if (!_this.attributes
|
228
|
-
_context3.next =
|
223
|
+
if (!_this.attributes.id) {
|
224
|
+
_context3.next = 6;
|
229
225
|
break;
|
230
226
|
}
|
231
227
|
_context3.next = 3;
|
232
228
|
return _this.update(_this.attributes);
|
233
229
|
case 3:
|
234
|
-
newObject = _context3.sent;
|
235
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
236
|
-
return _context3.abrupt("return", true);
|
237
|
-
case 8:
|
238
|
-
_context3.next = 10;
|
239
|
-
return GpgKey.create(_this.attributes, _this.options);
|
240
|
-
case 10:
|
241
230
|
_newObject = _context3.sent;
|
242
231
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
243
232
|
return _context3.abrupt("return", true);
|
244
|
-
case
|
233
|
+
case 6:
|
234
|
+
_context3.next = 8;
|
235
|
+
return GpgKey.create(_this.attributes, _this.options);
|
236
|
+
case 8:
|
237
|
+
newObject = _context3.sent;
|
238
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
239
|
+
return _context3.abrupt("return", true);
|
240
|
+
case 11:
|
245
241
|
case "end":
|
246
242
|
return _context3.stop();
|
247
243
|
}
|
@@ -277,26 +273,26 @@ _class = GpgKey;
|
|
277
273
|
case 0:
|
278
274
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
279
275
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
280
|
-
if (!(params
|
276
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
281
277
|
_context4.next = 4;
|
282
278
|
break;
|
283
279
|
}
|
284
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
280
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
285
281
|
case 4:
|
286
|
-
if (!(params
|
282
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
287
283
|
_context4.next = 6;
|
288
284
|
break;
|
289
285
|
}
|
290
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
286
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
291
287
|
case 6:
|
292
|
-
if (!(params
|
288
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
293
289
|
_context4.next = 8;
|
294
290
|
break;
|
295
291
|
}
|
296
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
292
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
297
293
|
case 8:
|
298
294
|
_context4.next = 10;
|
299
|
-
return _Api.default.sendRequest(
|
295
|
+
return _Api.default.sendRequest('/gpg_keys', 'GET', params, options);
|
300
296
|
case 10:
|
301
297
|
response = _context4.sent;
|
302
298
|
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) {
|
@@ -332,21 +328,21 @@ _class = GpgKey;
|
|
332
328
|
}
|
333
329
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
334
330
|
case 4:
|
335
|
-
params
|
336
|
-
if (params
|
331
|
+
params.id = id;
|
332
|
+
if (params.id) {
|
337
333
|
_context5.next = 7;
|
338
334
|
break;
|
339
335
|
}
|
340
336
|
throw new errors.MissingParameterError('Parameter missing: id');
|
341
337
|
case 7:
|
342
|
-
if (!(params
|
338
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
343
339
|
_context5.next = 9;
|
344
340
|
break;
|
345
341
|
}
|
346
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
342
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
347
343
|
case 9:
|
348
344
|
_context5.next = 11;
|
349
|
-
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params
|
345
|
+
return _Api.default.sendRequest("/gpg_keys/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
350
346
|
case 11:
|
351
347
|
response = _context5.sent;
|
352
348
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -381,44 +377,44 @@ _class = GpgKey;
|
|
381
377
|
case 0:
|
382
378
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
383
379
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
384
|
-
if (params
|
380
|
+
if (params.name) {
|
385
381
|
_context6.next = 4;
|
386
382
|
break;
|
387
383
|
}
|
388
384
|
throw new errors.MissingParameterError('Parameter missing: name');
|
389
385
|
case 4:
|
390
|
-
if (!(params
|
386
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
391
387
|
_context6.next = 6;
|
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 6:
|
396
|
-
if (!(params
|
392
|
+
if (!(params.public_key && !(0, _utils.isString)(params.public_key))) {
|
397
393
|
_context6.next = 8;
|
398
394
|
break;
|
399
395
|
}
|
400
|
-
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params
|
396
|
+
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params.public_key)));
|
401
397
|
case 8:
|
402
|
-
if (!(params
|
398
|
+
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
403
399
|
_context6.next = 10;
|
404
400
|
break;
|
405
401
|
}
|
406
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params
|
402
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
407
403
|
case 10:
|
408
|
-
if (!(params
|
404
|
+
if (!(params.private_key_password && !(0, _utils.isString)(params.private_key_password))) {
|
409
405
|
_context6.next = 12;
|
410
406
|
break;
|
411
407
|
}
|
412
|
-
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params
|
408
|
+
throw new errors.InvalidParameterError("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(params.private_key_password)));
|
413
409
|
case 12:
|
414
|
-
if (!(params
|
410
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
415
411
|
_context6.next = 14;
|
416
412
|
break;
|
417
413
|
}
|
418
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
414
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
419
415
|
case 14:
|
420
416
|
_context6.next = 16;
|
421
|
-
return _Api.default.sendRequest(
|
417
|
+
return _Api.default.sendRequest('/gpg_keys', 'POST', params, options);
|
422
418
|
case 16:
|
423
419
|
response = _context6.sent;
|
424
420
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|