files.com 1.0.474 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +63 -49
- package/lib/models/ActionWebhookFailure.js +1 -1
- package/lib/models/ApiKey.js +113 -94
- package/lib/models/As2Partner.js +81 -62
- package/lib/models/As2Station.js +79 -60
- package/lib/models/Automation.js +90 -71
- package/lib/models/Behavior.js +114 -95
- package/lib/models/Bundle.js +90 -71
- package/lib/models/BundleNotification.js +75 -56
- package/lib/models/BundleRecipient.js +61 -47
- package/lib/models/Clickwrap.js +77 -58
- package/lib/models/ExternalEvent.js +71 -57
- package/lib/models/File.js +166 -154
- package/lib/models/FileComment.js +65 -46
- package/lib/models/FileCommentReaction.js +44 -30
- package/lib/models/Folder.js +58 -46
- package/lib/models/FormFieldSet.js +76 -57
- package/lib/models/GpgKey.js +79 -60
- package/lib/models/Group.js +78 -59
- package/lib/models/GroupUser.js +63 -44
- package/lib/models/HistoryExport.js +76 -62
- package/lib/models/InboxRecipient.js +61 -47
- package/lib/models/Lock.js +56 -44
- package/lib/models/Message.js +82 -63
- package/lib/models/MessageComment.js +78 -59
- package/lib/models/MessageCommentReaction.js +73 -59
- package/lib/models/MessageReaction.js +73 -59
- package/lib/models/Notification.js +84 -65
- package/lib/models/Permission.js +60 -46
- package/lib/models/Project.js +74 -55
- package/lib/models/PublicKey.js +78 -59
- package/lib/models/RemoteServer.js +147 -128
- package/lib/models/Request.js +76 -62
- package/lib/models/Session.js +53 -39
- package/lib/models/SftpHostKey.js +74 -55
- package/lib/models/ShareGroup.js +79 -60
- package/lib/models/Snapshot.js +75 -56
- package/lib/models/SsoStrategy.js +1 -1
- package/lib/models/Style.js +37 -23
- package/lib/models/User.js +104 -85
- package/lib/models/UserRequest.js +73 -59
- package/lib/models/WebhookTest.js +46 -32
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ActionNotificationExport.js +2 -2
- package/src/models/ActionWebhookFailure.js +1 -1
- package/src/models/ApiKey.js +7 -5
- package/src/models/As2Partner.js +6 -4
- package/src/models/As2Station.js +6 -4
- package/src/models/Automation.js +7 -5
- package/src/models/Behavior.js +7 -5
- package/src/models/Bundle.js +7 -5
- package/src/models/BundleNotification.js +6 -4
- package/src/models/BundleRecipient.js +2 -2
- package/src/models/Clickwrap.js +6 -4
- package/src/models/ExternalEvent.js +2 -2
- package/src/models/File.js +3 -3
- package/src/models/FileComment.js +6 -4
- package/src/models/FileCommentReaction.js +3 -3
- package/src/models/Folder.js +2 -2
- package/src/models/FormFieldSet.js +6 -4
- package/src/models/GpgKey.js +6 -4
- package/src/models/Group.js +6 -4
- package/src/models/GroupUser.js +6 -4
- package/src/models/HistoryExport.js +2 -2
- package/src/models/InboxRecipient.js +2 -2
- package/src/models/Lock.js +3 -3
- package/src/models/Message.js +6 -4
- package/src/models/MessageComment.js +6 -4
- package/src/models/MessageCommentReaction.js +3 -3
- package/src/models/MessageReaction.js +3 -3
- package/src/models/Notification.js +6 -4
- package/src/models/Permission.js +3 -3
- package/src/models/Project.js +6 -4
- package/src/models/PublicKey.js +6 -4
- package/src/models/RemoteServer.js +6 -4
- package/src/models/Request.js +3 -3
- package/src/models/Session.js +3 -3
- package/src/models/SftpHostKey.js +6 -4
- package/src/models/ShareGroup.js +6 -4
- package/src/models/Snapshot.js +6 -4
- package/src/models/SsoStrategy.js +1 -1
- package/src/models/Style.js +6 -3
- package/src/models/User.js +9 -7
- package/src/models/UserRequest.js +3 -3
- package/src/models/WebhookTest.js +2 -2
package/lib/models/Group.js
CHANGED
@@ -201,7 +201,7 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
201
201
|
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
202
202
|
case 16:
|
203
203
|
response = _context2.sent;
|
204
|
-
return _context2.abrupt("return"
|
204
|
+
return _context2.abrupt("return");
|
205
205
|
case 18:
|
206
206
|
case "end":
|
207
207
|
return _context2.stop();
|
@@ -212,19 +212,38 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
212
212
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
213
213
|
return _this.delete(params);
|
214
214
|
});
|
215
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
215
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
216
|
+
var newObject, _newObject;
|
217
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
218
|
+
while (1) switch (_context3.prev = _context3.next) {
|
219
|
+
case 0:
|
220
|
+
if (!_this.attributes['id']) {
|
221
|
+
_context3.next = 8;
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
_context3.next = 3;
|
225
|
+
return _this.update(_this.attributes);
|
226
|
+
case 3:
|
227
|
+
newObject = _context3.sent;
|
228
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
229
|
+
return _context3.abrupt("return", true);
|
230
|
+
case 8:
|
231
|
+
_context3.next = 10;
|
232
|
+
return Group.create(_this.attributes, _this.options);
|
233
|
+
case 10:
|
234
|
+
_newObject = _context3.sent;
|
235
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
236
|
+
return _context3.abrupt("return", true);
|
237
|
+
case 13:
|
238
|
+
case "end":
|
239
|
+
return _context3.stop();
|
240
|
+
}
|
241
|
+
}, _callee3);
|
242
|
+
})));
|
243
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
244
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
245
|
+
key = _ref5[0],
|
246
|
+
value = _ref5[1];
|
228
247
|
var normalizedKey = key.replace('?', '');
|
229
248
|
_this.attributes[normalizedKey] = value;
|
230
249
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -242,47 +261,47 @@ _class = Group;
|
|
242
261
|
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `name`.
|
243
262
|
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.
|
244
263
|
// ids - string - Comma-separated list of group ids to include in results.
|
245
|
-
(0, _defineProperty2.default)(Group, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
264
|
+
(0, _defineProperty2.default)(Group, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
246
265
|
var _response$data;
|
247
266
|
var params,
|
248
267
|
options,
|
249
268
|
response,
|
250
|
-
|
251
|
-
return _regenerator.default.wrap(function
|
252
|
-
while (1) switch (
|
269
|
+
_args4 = arguments;
|
270
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
271
|
+
while (1) switch (_context4.prev = _context4.next) {
|
253
272
|
case 0:
|
254
|
-
params =
|
255
|
-
options =
|
273
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
274
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
256
275
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
257
|
-
|
276
|
+
_context4.next = 4;
|
258
277
|
break;
|
259
278
|
}
|
260
279
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
261
280
|
case 4:
|
262
281
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
263
|
-
|
282
|
+
_context4.next = 6;
|
264
283
|
break;
|
265
284
|
}
|
266
285
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
267
286
|
case 6:
|
268
287
|
if (!(params['ids'] && !(0, _utils.isString)(params['ids']))) {
|
269
|
-
|
288
|
+
_context4.next = 8;
|
270
289
|
break;
|
271
290
|
}
|
272
291
|
throw new errors.InvalidParameterError("Bad parameter: ids must be of type String, received ".concat((0, _utils.getType)(params['ids'])));
|
273
292
|
case 8:
|
274
|
-
|
293
|
+
_context4.next = 10;
|
275
294
|
return _Api.default.sendRequest("/groups", 'GET', params, options);
|
276
295
|
case 10:
|
277
|
-
response =
|
278
|
-
return
|
296
|
+
response = _context4.sent;
|
297
|
+
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) {
|
279
298
|
return new _class(obj, options);
|
280
299
|
})) || []);
|
281
300
|
case 12:
|
282
301
|
case "end":
|
283
|
-
return
|
302
|
+
return _context4.stop();
|
284
303
|
}
|
285
|
-
},
|
304
|
+
}, _callee4);
|
286
305
|
})));
|
287
306
|
(0, _defineProperty2.default)(Group, "all", function () {
|
288
307
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -292,48 +311,48 @@ _class = Group;
|
|
292
311
|
// Parameters:
|
293
312
|
// id (required) - int64 - Group ID.
|
294
313
|
(0, _defineProperty2.default)(Group, "find", /*#__PURE__*/function () {
|
295
|
-
var
|
314
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
|
296
315
|
var params,
|
297
316
|
options,
|
298
317
|
response,
|
299
|
-
|
300
|
-
return _regenerator.default.wrap(function
|
301
|
-
while (1) switch (
|
318
|
+
_args5 = arguments;
|
319
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
320
|
+
while (1) switch (_context5.prev = _context5.next) {
|
302
321
|
case 0:
|
303
|
-
params =
|
304
|
-
options =
|
322
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
323
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
305
324
|
if ((0, _utils.isObject)(params)) {
|
306
|
-
|
325
|
+
_context5.next = 4;
|
307
326
|
break;
|
308
327
|
}
|
309
328
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
310
329
|
case 4:
|
311
330
|
params['id'] = id;
|
312
331
|
if (params['id']) {
|
313
|
-
|
332
|
+
_context5.next = 7;
|
314
333
|
break;
|
315
334
|
}
|
316
335
|
throw new errors.MissingParameterError('Parameter missing: id');
|
317
336
|
case 7:
|
318
337
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
319
|
-
|
338
|
+
_context5.next = 9;
|
320
339
|
break;
|
321
340
|
}
|
322
341
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
323
342
|
case 9:
|
324
|
-
|
343
|
+
_context5.next = 11;
|
325
344
|
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
326
345
|
case 11:
|
327
|
-
response =
|
328
|
-
return
|
346
|
+
response = _context5.sent;
|
347
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
329
348
|
case 13:
|
330
349
|
case "end":
|
331
|
-
return
|
350
|
+
return _context5.stop();
|
332
351
|
}
|
333
|
-
},
|
352
|
+
}, _callee5);
|
334
353
|
}));
|
335
354
|
return function (_x) {
|
336
|
-
return
|
355
|
+
return _ref7.apply(this, arguments);
|
337
356
|
};
|
338
357
|
}());
|
339
358
|
(0, _defineProperty2.default)(Group, "get", function (id) {
|
@@ -346,56 +365,56 @@ _class = Group;
|
|
346
365
|
// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
347
366
|
// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
348
367
|
// name (required) - string - Group name.
|
349
|
-
(0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
368
|
+
(0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
350
369
|
var params,
|
351
370
|
options,
|
352
371
|
response,
|
353
|
-
|
354
|
-
return _regenerator.default.wrap(function
|
355
|
-
while (1) switch (
|
372
|
+
_args6 = arguments;
|
373
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
374
|
+
while (1) switch (_context6.prev = _context6.next) {
|
356
375
|
case 0:
|
357
|
-
params =
|
358
|
-
options =
|
376
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
377
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
359
378
|
if (params['name']) {
|
360
|
-
|
379
|
+
_context6.next = 4;
|
361
380
|
break;
|
362
381
|
}
|
363
382
|
throw new errors.MissingParameterError('Parameter missing: name');
|
364
383
|
case 4:
|
365
384
|
if (!(params['notes'] && !(0, _utils.isString)(params['notes']))) {
|
366
|
-
|
385
|
+
_context6.next = 6;
|
367
386
|
break;
|
368
387
|
}
|
369
388
|
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params['notes'])));
|
370
389
|
case 6:
|
371
390
|
if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
|
372
|
-
|
391
|
+
_context6.next = 8;
|
373
392
|
break;
|
374
393
|
}
|
375
394
|
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
|
376
395
|
case 8:
|
377
396
|
if (!(params['admin_ids'] && !(0, _utils.isString)(params['admin_ids']))) {
|
378
|
-
|
397
|
+
_context6.next = 10;
|
379
398
|
break;
|
380
399
|
}
|
381
400
|
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params['admin_ids'])));
|
382
401
|
case 10:
|
383
402
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
384
|
-
|
403
|
+
_context6.next = 12;
|
385
404
|
break;
|
386
405
|
}
|
387
406
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
388
407
|
case 12:
|
389
|
-
|
408
|
+
_context6.next = 14;
|
390
409
|
return _Api.default.sendRequest("/groups", 'POST', params, options);
|
391
410
|
case 14:
|
392
|
-
response =
|
393
|
-
return
|
411
|
+
response = _context6.sent;
|
412
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
394
413
|
case 16:
|
395
414
|
case "end":
|
396
|
-
return
|
415
|
+
return _context6.stop();
|
397
416
|
}
|
398
|
-
},
|
417
|
+
}, _callee6);
|
399
418
|
})));
|
400
419
|
var _default = exports.default = Group;
|
401
420
|
module.exports = Group;
|
package/lib/models/GroupUser.js
CHANGED
@@ -259,7 +259,7 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
259
259
|
return _Api.default.sendRequest("/group_users/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
260
260
|
case 32:
|
261
261
|
response = _context2.sent;
|
262
|
-
return _context2.abrupt("return"
|
262
|
+
return _context2.abrupt("return");
|
263
263
|
case 34:
|
264
264
|
case "end":
|
265
265
|
return _context2.stop();
|
@@ -270,19 +270,38 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
|
|
270
270
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
271
271
|
return _this.delete(params);
|
272
272
|
});
|
273
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
273
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
274
|
+
var newObject, _newObject;
|
275
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
276
|
+
while (1) switch (_context3.prev = _context3.next) {
|
277
|
+
case 0:
|
278
|
+
if (!_this.attributes['id']) {
|
279
|
+
_context3.next = 8;
|
280
|
+
break;
|
281
|
+
}
|
282
|
+
_context3.next = 3;
|
283
|
+
return _this.update(_this.attributes);
|
284
|
+
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
|
+
_newObject = _context3.sent;
|
293
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
294
|
+
return _context3.abrupt("return", true);
|
295
|
+
case 13:
|
296
|
+
case "end":
|
297
|
+
return _context3.stop();
|
298
|
+
}
|
299
|
+
}, _callee3);
|
300
|
+
})));
|
301
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
302
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
303
|
+
key = _ref5[0],
|
304
|
+
value = _ref5[1];
|
286
305
|
var normalizedKey = key.replace('?', '');
|
287
306
|
_this.attributes[normalizedKey] = value;
|
288
307
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -298,53 +317,53 @@ _class = GroupUser;
|
|
298
317
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
299
318
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
300
319
|
// group_id - int64 - Group ID. If provided, will return group_users of this group.
|
301
|
-
(0, _defineProperty2.default)(GroupUser, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
320
|
+
(0, _defineProperty2.default)(GroupUser, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
302
321
|
var _response$data;
|
303
322
|
var params,
|
304
323
|
options,
|
305
324
|
response,
|
306
|
-
|
307
|
-
return _regenerator.default.wrap(function
|
308
|
-
while (1) switch (
|
325
|
+
_args4 = arguments;
|
326
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
327
|
+
while (1) switch (_context4.prev = _context4.next) {
|
309
328
|
case 0:
|
310
|
-
params =
|
311
|
-
options =
|
329
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
330
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
312
331
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
313
|
-
|
332
|
+
_context4.next = 4;
|
314
333
|
break;
|
315
334
|
}
|
316
335
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
317
336
|
case 4:
|
318
337
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
319
|
-
|
338
|
+
_context4.next = 6;
|
320
339
|
break;
|
321
340
|
}
|
322
341
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
323
342
|
case 6:
|
324
343
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
325
|
-
|
344
|
+
_context4.next = 8;
|
326
345
|
break;
|
327
346
|
}
|
328
347
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
329
348
|
case 8:
|
330
349
|
if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
|
331
|
-
|
350
|
+
_context4.next = 10;
|
332
351
|
break;
|
333
352
|
}
|
334
353
|
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
|
335
354
|
case 10:
|
336
|
-
|
355
|
+
_context4.next = 12;
|
337
356
|
return _Api.default.sendRequest("/group_users", 'GET', params, options);
|
338
357
|
case 12:
|
339
|
-
response =
|
340
|
-
return
|
358
|
+
response = _context4.sent;
|
359
|
+
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) {
|
341
360
|
return new _class(obj, options);
|
342
361
|
})) || []);
|
343
362
|
case 14:
|
344
363
|
case "end":
|
345
|
-
return
|
364
|
+
return _context4.stop();
|
346
365
|
}
|
347
|
-
},
|
366
|
+
}, _callee4);
|
348
367
|
})));
|
349
368
|
(0, _defineProperty2.default)(GroupUser, "all", function () {
|
350
369
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -355,50 +374,50 @@ _class = GroupUser;
|
|
355
374
|
// group_id (required) - int64 - Group ID to add user to.
|
356
375
|
// user_id (required) - int64 - User ID to add to group.
|
357
376
|
// admin - boolean - Is the user a group administrator?
|
358
|
-
(0, _defineProperty2.default)(GroupUser, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
377
|
+
(0, _defineProperty2.default)(GroupUser, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
359
378
|
var params,
|
360
379
|
options,
|
361
380
|
response,
|
362
|
-
|
363
|
-
return _regenerator.default.wrap(function
|
364
|
-
while (1) switch (
|
381
|
+
_args5 = arguments;
|
382
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
383
|
+
while (1) switch (_context5.prev = _context5.next) {
|
365
384
|
case 0:
|
366
|
-
params =
|
367
|
-
options =
|
385
|
+
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
386
|
+
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
368
387
|
if (params['group_id']) {
|
369
|
-
|
388
|
+
_context5.next = 4;
|
370
389
|
break;
|
371
390
|
}
|
372
391
|
throw new errors.MissingParameterError('Parameter missing: group_id');
|
373
392
|
case 4:
|
374
393
|
if (params['user_id']) {
|
375
|
-
|
394
|
+
_context5.next = 6;
|
376
395
|
break;
|
377
396
|
}
|
378
397
|
throw new errors.MissingParameterError('Parameter missing: user_id');
|
379
398
|
case 6:
|
380
399
|
if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
|
381
|
-
|
400
|
+
_context5.next = 8;
|
382
401
|
break;
|
383
402
|
}
|
384
403
|
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
|
385
404
|
case 8:
|
386
405
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
387
|
-
|
406
|
+
_context5.next = 10;
|
388
407
|
break;
|
389
408
|
}
|
390
409
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
391
410
|
case 10:
|
392
|
-
|
411
|
+
_context5.next = 12;
|
393
412
|
return _Api.default.sendRequest("/group_users", 'POST', params, options);
|
394
413
|
case 12:
|
395
|
-
response =
|
396
|
-
return
|
414
|
+
response = _context5.sent;
|
415
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
397
416
|
case 14:
|
398
417
|
case "end":
|
399
|
-
return
|
418
|
+
return _context5.stop();
|
400
419
|
}
|
401
|
-
},
|
420
|
+
}, _callee5);
|
402
421
|
})));
|
403
422
|
var _default = exports.default = GroupUser;
|
404
423
|
module.exports = GroupUser;
|