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/Group.js
CHANGED
|
@@ -133,37 +133,37 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
133
133
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
134
134
|
case 5:
|
|
135
135
|
params.id = _this.attributes.id;
|
|
136
|
-
if (!(params
|
|
136
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
137
137
|
_context.next = 8;
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
140
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
141
141
|
case 8:
|
|
142
|
-
if (!(params
|
|
142
|
+
if (!(params.notes && !(0, _utils.isString)(params.notes))) {
|
|
143
143
|
_context.next = 10;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
|
-
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params
|
|
146
|
+
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params.notes)));
|
|
147
147
|
case 10:
|
|
148
|
-
if (!(params
|
|
148
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
149
149
|
_context.next = 12;
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
|
-
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
152
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
153
153
|
case 12:
|
|
154
|
-
if (!(params
|
|
154
|
+
if (!(params.admin_ids && !(0, _utils.isString)(params.admin_ids))) {
|
|
155
155
|
_context.next = 14;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
|
-
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
158
|
+
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params.admin_ids)));
|
|
159
159
|
case 14:
|
|
160
|
-
if (!(params
|
|
160
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
161
161
|
_context.next = 16;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
164
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
165
165
|
case 16:
|
|
166
|
-
if (params
|
|
166
|
+
if (params.id) {
|
|
167
167
|
_context.next = 22;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
@@ -171,14 +171,14 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
171
171
|
_context.next = 21;
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
|
-
params
|
|
174
|
+
params.id = _this.id;
|
|
175
175
|
_context.next = 22;
|
|
176
176
|
break;
|
|
177
177
|
case 21:
|
|
178
178
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
179
179
|
case 22:
|
|
180
180
|
_context.next = 24;
|
|
181
|
-
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params
|
|
181
|
+
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
182
182
|
case 24:
|
|
183
183
|
response = _context.sent;
|
|
184
184
|
return _context.abrupt("return", new Group(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -190,7 +190,6 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
190
190
|
})));
|
|
191
191
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
192
192
|
var params,
|
|
193
|
-
response,
|
|
194
193
|
_args2 = arguments;
|
|
195
194
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
196
195
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -209,13 +208,13 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
209
208
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
210
209
|
case 5:
|
|
211
210
|
params.id = _this.attributes.id;
|
|
212
|
-
if (!(params
|
|
211
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
213
212
|
_context2.next = 8;
|
|
214
213
|
break;
|
|
215
214
|
}
|
|
216
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
215
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
217
216
|
case 8:
|
|
218
|
-
if (params
|
|
217
|
+
if (params.id) {
|
|
219
218
|
_context2.next = 14;
|
|
220
219
|
break;
|
|
221
220
|
}
|
|
@@ -223,18 +222,15 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
223
222
|
_context2.next = 13;
|
|
224
223
|
break;
|
|
225
224
|
}
|
|
226
|
-
params
|
|
225
|
+
params.id = _this.id;
|
|
227
226
|
_context2.next = 14;
|
|
228
227
|
break;
|
|
229
228
|
case 13:
|
|
230
229
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
231
230
|
case 14:
|
|
232
231
|
_context2.next = 16;
|
|
233
|
-
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params
|
|
232
|
+
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
234
233
|
case 16:
|
|
235
|
-
response = _context2.sent;
|
|
236
|
-
return _context2.abrupt("return");
|
|
237
|
-
case 18:
|
|
238
234
|
case "end":
|
|
239
235
|
return _context2.stop();
|
|
240
236
|
}
|
|
@@ -245,28 +241,28 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
|
245
241
|
return _this.delete(params);
|
|
246
242
|
});
|
|
247
243
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
248
|
-
var
|
|
244
|
+
var _newObject, newObject;
|
|
249
245
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
250
246
|
while (1) switch (_context3.prev = _context3.next) {
|
|
251
247
|
case 0:
|
|
252
|
-
if (!_this.attributes
|
|
253
|
-
_context3.next =
|
|
248
|
+
if (!_this.attributes.id) {
|
|
249
|
+
_context3.next = 6;
|
|
254
250
|
break;
|
|
255
251
|
}
|
|
256
252
|
_context3.next = 3;
|
|
257
253
|
return _this.update(_this.attributes);
|
|
258
254
|
case 3:
|
|
259
|
-
newObject = _context3.sent;
|
|
260
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
261
|
-
return _context3.abrupt("return", true);
|
|
262
|
-
case 8:
|
|
263
|
-
_context3.next = 10;
|
|
264
|
-
return Group.create(_this.attributes, _this.options);
|
|
265
|
-
case 10:
|
|
266
255
|
_newObject = _context3.sent;
|
|
267
256
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
268
257
|
return _context3.abrupt("return", true);
|
|
269
|
-
case
|
|
258
|
+
case 6:
|
|
259
|
+
_context3.next = 8;
|
|
260
|
+
return Group.create(_this.attributes, _this.options);
|
|
261
|
+
case 8:
|
|
262
|
+
newObject = _context3.sent;
|
|
263
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
264
|
+
return _context3.abrupt("return", true);
|
|
265
|
+
case 11:
|
|
270
266
|
case "end":
|
|
271
267
|
return _context3.stop();
|
|
272
268
|
}
|
|
@@ -304,26 +300,26 @@ _class = Group;
|
|
|
304
300
|
case 0:
|
|
305
301
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
306
302
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
307
|
-
if (!(params
|
|
303
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
308
304
|
_context4.next = 4;
|
|
309
305
|
break;
|
|
310
306
|
}
|
|
311
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
307
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
312
308
|
case 4:
|
|
313
|
-
if (!(params
|
|
309
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
314
310
|
_context4.next = 6;
|
|
315
311
|
break;
|
|
316
312
|
}
|
|
317
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
313
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
318
314
|
case 6:
|
|
319
|
-
if (!(params
|
|
315
|
+
if (!(params.ids && !(0, _utils.isString)(params.ids))) {
|
|
320
316
|
_context4.next = 8;
|
|
321
317
|
break;
|
|
322
318
|
}
|
|
323
|
-
throw new errors.InvalidParameterError("Bad parameter: ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
319
|
+
throw new errors.InvalidParameterError("Bad parameter: ids must be of type String, received ".concat((0, _utils.getType)(params.ids)));
|
|
324
320
|
case 8:
|
|
325
321
|
_context4.next = 10;
|
|
326
|
-
return _Api.default.sendRequest(
|
|
322
|
+
return _Api.default.sendRequest('/groups', 'GET', params, options);
|
|
327
323
|
case 10:
|
|
328
324
|
response = _context4.sent;
|
|
329
325
|
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) {
|
|
@@ -359,21 +355,21 @@ _class = Group;
|
|
|
359
355
|
}
|
|
360
356
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
361
357
|
case 4:
|
|
362
|
-
params
|
|
363
|
-
if (params
|
|
358
|
+
params.id = id;
|
|
359
|
+
if (params.id) {
|
|
364
360
|
_context5.next = 7;
|
|
365
361
|
break;
|
|
366
362
|
}
|
|
367
363
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
368
364
|
case 7:
|
|
369
|
-
if (!(params
|
|
365
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
370
366
|
_context5.next = 9;
|
|
371
367
|
break;
|
|
372
368
|
}
|
|
373
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
369
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
374
370
|
case 9:
|
|
375
371
|
_context5.next = 11;
|
|
376
|
-
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params
|
|
372
|
+
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
377
373
|
case 11:
|
|
378
374
|
response = _context5.sent;
|
|
379
375
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -411,38 +407,38 @@ _class = Group;
|
|
|
411
407
|
case 0:
|
|
412
408
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
413
409
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
414
|
-
if (params
|
|
410
|
+
if (params.name) {
|
|
415
411
|
_context6.next = 4;
|
|
416
412
|
break;
|
|
417
413
|
}
|
|
418
414
|
throw new errors.MissingParameterError('Parameter missing: name');
|
|
419
415
|
case 4:
|
|
420
|
-
if (!(params
|
|
416
|
+
if (!(params.notes && !(0, _utils.isString)(params.notes))) {
|
|
421
417
|
_context6.next = 6;
|
|
422
418
|
break;
|
|
423
419
|
}
|
|
424
|
-
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params
|
|
420
|
+
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params.notes)));
|
|
425
421
|
case 6:
|
|
426
|
-
if (!(params
|
|
422
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
427
423
|
_context6.next = 8;
|
|
428
424
|
break;
|
|
429
425
|
}
|
|
430
|
-
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
426
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
431
427
|
case 8:
|
|
432
|
-
if (!(params
|
|
428
|
+
if (!(params.admin_ids && !(0, _utils.isString)(params.admin_ids))) {
|
|
433
429
|
_context6.next = 10;
|
|
434
430
|
break;
|
|
435
431
|
}
|
|
436
|
-
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params
|
|
432
|
+
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params.admin_ids)));
|
|
437
433
|
case 10:
|
|
438
|
-
if (!(params
|
|
434
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
439
435
|
_context6.next = 12;
|
|
440
436
|
break;
|
|
441
437
|
}
|
|
442
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
438
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
443
439
|
case 12:
|
|
444
440
|
_context6.next = 14;
|
|
445
|
-
return _Api.default.sendRequest(
|
|
441
|
+
return _Api.default.sendRequest('/groups', 'POST', params, options);
|
|
446
442
|
case 14:
|
|
447
443
|
response = _context6.sent;
|
|
448
444
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/GroupUser.js
CHANGED
|
@@ -100,25 +100,25 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
100
100
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
101
101
|
case 5:
|
|
102
102
|
params.id = _this.attributes.id;
|
|
103
|
-
if (!(params
|
|
103
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
104
104
|
_context.next = 8;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
107
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
108
108
|
case 8:
|
|
109
|
-
if (!(params
|
|
109
|
+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
|
|
110
110
|
_context.next = 10;
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
|
-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
113
|
+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
|
|
114
114
|
case 10:
|
|
115
|
-
if (!(params
|
|
115
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
116
116
|
_context.next = 12;
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
119
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
120
120
|
case 12:
|
|
121
|
-
if (params
|
|
121
|
+
if (params.id) {
|
|
122
122
|
_context.next = 18;
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
@@ -126,13 +126,13 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
126
126
|
_context.next = 17;
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
|
-
params
|
|
129
|
+
params.id = _this.id;
|
|
130
130
|
_context.next = 18;
|
|
131
131
|
break;
|
|
132
132
|
case 17:
|
|
133
133
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
134
134
|
case 18:
|
|
135
|
-
if (params
|
|
135
|
+
if (params.group_id) {
|
|
136
136
|
_context.next = 24;
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
@@ -140,13 +140,13 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
140
140
|
_context.next = 23;
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
|
-
params
|
|
143
|
+
params.group_id = _this.group_id;
|
|
144
144
|
_context.next = 24;
|
|
145
145
|
break;
|
|
146
146
|
case 23:
|
|
147
147
|
throw new errors.MissingParameterError('Parameter missing: group_id');
|
|
148
148
|
case 24:
|
|
149
|
-
if (params
|
|
149
|
+
if (params.user_id) {
|
|
150
150
|
_context.next = 30;
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
@@ -154,14 +154,14 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
154
154
|
_context.next = 29;
|
|
155
155
|
break;
|
|
156
156
|
}
|
|
157
|
-
params
|
|
157
|
+
params.user_id = _this.user_id;
|
|
158
158
|
_context.next = 30;
|
|
159
159
|
break;
|
|
160
160
|
case 29:
|
|
161
161
|
throw new errors.MissingParameterError('Parameter missing: user_id');
|
|
162
162
|
case 30:
|
|
163
163
|
_context.next = 32;
|
|
164
|
-
return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params
|
|
164
|
+
return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
165
165
|
case 32:
|
|
166
166
|
response = _context.sent;
|
|
167
167
|
return _context.abrupt("return", new GroupUser(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -176,7 +176,6 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
176
176
|
// user_id (required) - int64 - User ID to remove from group.
|
|
177
177
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
178
178
|
var params,
|
|
179
|
-
response,
|
|
180
179
|
_args2 = arguments;
|
|
181
180
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
182
181
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -195,25 +194,25 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
195
194
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
196
195
|
case 5:
|
|
197
196
|
params.id = _this.attributes.id;
|
|
198
|
-
if (!(params
|
|
197
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
199
198
|
_context2.next = 8;
|
|
200
199
|
break;
|
|
201
200
|
}
|
|
202
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
201
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
203
202
|
case 8:
|
|
204
|
-
if (!(params
|
|
203
|
+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
|
|
205
204
|
_context2.next = 10;
|
|
206
205
|
break;
|
|
207
206
|
}
|
|
208
|
-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
207
|
+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
|
|
209
208
|
case 10:
|
|
210
|
-
if (!(params
|
|
209
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
211
210
|
_context2.next = 12;
|
|
212
211
|
break;
|
|
213
212
|
}
|
|
214
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
213
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
215
214
|
case 12:
|
|
216
|
-
if (params
|
|
215
|
+
if (params.id) {
|
|
217
216
|
_context2.next = 18;
|
|
218
217
|
break;
|
|
219
218
|
}
|
|
@@ -221,13 +220,13 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
221
220
|
_context2.next = 17;
|
|
222
221
|
break;
|
|
223
222
|
}
|
|
224
|
-
params
|
|
223
|
+
params.id = _this.id;
|
|
225
224
|
_context2.next = 18;
|
|
226
225
|
break;
|
|
227
226
|
case 17:
|
|
228
227
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
229
228
|
case 18:
|
|
230
|
-
if (params
|
|
229
|
+
if (params.group_id) {
|
|
231
230
|
_context2.next = 24;
|
|
232
231
|
break;
|
|
233
232
|
}
|
|
@@ -235,13 +234,13 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
235
234
|
_context2.next = 23;
|
|
236
235
|
break;
|
|
237
236
|
}
|
|
238
|
-
params
|
|
237
|
+
params.group_id = _this.group_id;
|
|
239
238
|
_context2.next = 24;
|
|
240
239
|
break;
|
|
241
240
|
case 23:
|
|
242
241
|
throw new errors.MissingParameterError('Parameter missing: group_id');
|
|
243
242
|
case 24:
|
|
244
|
-
if (params
|
|
243
|
+
if (params.user_id) {
|
|
245
244
|
_context2.next = 30;
|
|
246
245
|
break;
|
|
247
246
|
}
|
|
@@ -249,18 +248,15 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
249
248
|
_context2.next = 29;
|
|
250
249
|
break;
|
|
251
250
|
}
|
|
252
|
-
params
|
|
251
|
+
params.user_id = _this.user_id;
|
|
253
252
|
_context2.next = 30;
|
|
254
253
|
break;
|
|
255
254
|
case 29:
|
|
256
255
|
throw new errors.MissingParameterError('Parameter missing: user_id');
|
|
257
256
|
case 30:
|
|
258
257
|
_context2.next = 32;
|
|
259
|
-
return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params
|
|
258
|
+
return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
260
259
|
case 32:
|
|
261
|
-
response = _context2.sent;
|
|
262
|
-
return _context2.abrupt("return");
|
|
263
|
-
case 34:
|
|
264
260
|
case "end":
|
|
265
261
|
return _context2.stop();
|
|
266
262
|
}
|
|
@@ -271,28 +267,28 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
|
271
267
|
return _this.delete(params);
|
|
272
268
|
});
|
|
273
269
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
274
|
-
var
|
|
270
|
+
var _newObject, newObject;
|
|
275
271
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
276
272
|
while (1) switch (_context3.prev = _context3.next) {
|
|
277
273
|
case 0:
|
|
278
|
-
if (!_this.attributes
|
|
279
|
-
_context3.next =
|
|
274
|
+
if (!_this.attributes.id) {
|
|
275
|
+
_context3.next = 6;
|
|
280
276
|
break;
|
|
281
277
|
}
|
|
282
278
|
_context3.next = 3;
|
|
283
279
|
return _this.update(_this.attributes);
|
|
284
280
|
case 3:
|
|
285
|
-
newObject = _context3.sent;
|
|
286
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
287
|
-
return _context3.abrupt("return", true);
|
|
288
|
-
case 8:
|
|
289
|
-
_context3.next = 10;
|
|
290
|
-
return GroupUser.create(_this.attributes, _this.options);
|
|
291
|
-
case 10:
|
|
292
281
|
_newObject = _context3.sent;
|
|
293
282
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
294
283
|
return _context3.abrupt("return", true);
|
|
295
|
-
case
|
|
284
|
+
case 6:
|
|
285
|
+
_context3.next = 8;
|
|
286
|
+
return GroupUser.create(_this.attributes, _this.options);
|
|
287
|
+
case 8:
|
|
288
|
+
newObject = _context3.sent;
|
|
289
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
290
|
+
return _context3.abrupt("return", true);
|
|
291
|
+
case 11:
|
|
296
292
|
case "end":
|
|
297
293
|
return _context3.stop();
|
|
298
294
|
}
|
|
@@ -328,32 +324,32 @@ _class = GroupUser;
|
|
|
328
324
|
case 0:
|
|
329
325
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
330
326
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
331
|
-
if (!(params
|
|
327
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
332
328
|
_context4.next = 4;
|
|
333
329
|
break;
|
|
334
330
|
}
|
|
335
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
331
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
336
332
|
case 4:
|
|
337
|
-
if (!(params
|
|
333
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
338
334
|
_context4.next = 6;
|
|
339
335
|
break;
|
|
340
336
|
}
|
|
341
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
337
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
342
338
|
case 6:
|
|
343
|
-
if (!(params
|
|
339
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
344
340
|
_context4.next = 8;
|
|
345
341
|
break;
|
|
346
342
|
}
|
|
347
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
343
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
348
344
|
case 8:
|
|
349
|
-
if (!(params
|
|
345
|
+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
|
|
350
346
|
_context4.next = 10;
|
|
351
347
|
break;
|
|
352
348
|
}
|
|
353
|
-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
349
|
+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
|
|
354
350
|
case 10:
|
|
355
351
|
_context4.next = 12;
|
|
356
|
-
return _Api.default.sendRequest(
|
|
352
|
+
return _Api.default.sendRequest('/group_users', 'GET', params, options);
|
|
357
353
|
case 12:
|
|
358
354
|
response = _context4.sent;
|
|
359
355
|
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) {
|
|
@@ -384,32 +380,32 @@ _class = GroupUser;
|
|
|
384
380
|
case 0:
|
|
385
381
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
386
382
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
387
|
-
if (params
|
|
383
|
+
if (params.group_id) {
|
|
388
384
|
_context5.next = 4;
|
|
389
385
|
break;
|
|
390
386
|
}
|
|
391
387
|
throw new errors.MissingParameterError('Parameter missing: group_id');
|
|
392
388
|
case 4:
|
|
393
|
-
if (params
|
|
389
|
+
if (params.user_id) {
|
|
394
390
|
_context5.next = 6;
|
|
395
391
|
break;
|
|
396
392
|
}
|
|
397
393
|
throw new errors.MissingParameterError('Parameter missing: user_id');
|
|
398
394
|
case 6:
|
|
399
|
-
if (!(params
|
|
395
|
+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
|
|
400
396
|
_context5.next = 8;
|
|
401
397
|
break;
|
|
402
398
|
}
|
|
403
|
-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
399
|
+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
|
|
404
400
|
case 8:
|
|
405
|
-
if (!(params
|
|
401
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
406
402
|
_context5.next = 10;
|
|
407
403
|
break;
|
|
408
404
|
}
|
|
409
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
405
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
410
406
|
case 10:
|
|
411
407
|
_context5.next = 12;
|
|
412
|
-
return _Api.default.sendRequest(
|
|
408
|
+
return _Api.default.sendRequest('/group_users', 'POST', params, options);
|
|
413
409
|
case 12:
|
|
414
410
|
response = _context5.sent;
|
|
415
411
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|