Skip to content

Commit 50f76bd

Browse files
[Bot] push changes from Files.com
1 parent 9ea90f8 commit 50f76bd

7 files changed

Lines changed: 20 additions & 20 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.639
1+
1.2.640

docs/models/GroupUser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525

2626
```
2727
await GroupUser.list({
28-
'user_id': 1,
2928
'group_id': 1,
29+
'user_id': 1,
3030
})
3131
```
3232

3333

3434
### Parameters
3535

36-
* `user_id` (int64): User ID. If provided, will return group_users of this user.
3736
* `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.
3837
* `per_page` (int64): Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
3938
* `group_id` (int64): Group ID. If provided, will return group_users of this group.
39+
* `user_id` (int64): User ID. If provided, will return group_users of this user.
4040

4141
---
4242

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var apiKey;
1212
var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
1414
var language = null;
15-
var version = '1.2.639';
15+
var version = '1.2.640';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/GroupUser.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ var GroupUser = /*#__PURE__*/(0, _createClass2.default)(function GroupUser() {
308308
});
309309
_GroupUser = GroupUser;
310310
// Parameters:
311-
// user_id - int64 - User ID. If provided, will return group_users of this user.
312311
// 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.
313312
// per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
314313
// group_id - int64 - Group ID. If provided, will return group_users of this group.
314+
// user_id - int64 - User ID. If provided, will return group_users of this user.
315315
(0, _defineProperty2.default)(GroupUser, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
316316
var _response$data;
317317
var params,
@@ -323,29 +323,29 @@ _GroupUser = GroupUser;
323323
case 0:
324324
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
325325
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
326-
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
326+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
327327
_context4.next = 1;
328328
break;
329329
}
330-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
330+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
331331
case 1:
332-
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
332+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
333333
_context4.next = 2;
334334
break;
335335
}
336-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
336+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
337337
case 2:
338-
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
338+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
339339
_context4.next = 3;
340340
break;
341341
}
342-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
342+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
343343
case 3:
344-
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
344+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
345345
_context4.next = 4;
346346
break;
347347
}
348-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
348+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
349349
case 4:
350350
_context4.next = 5;
351351
return _Api.default.sendRequest('/group_users', 'GET', params, options);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "files.com",
3-
"version": "1.2.639",
3+
"version": "1.2.640",
44
"description": "Files.com SDK for JavaScript",
55
"keywords": [
66
"files.com",

src/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let apiKey
66
let baseUrl = 'https://app.files.com'
77
let sessionId = null
88
let language = null
9-
const version = '1.2.639'
9+
const version = '1.2.640'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/GroupUser.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,11 @@ class GroupUser {
193193
}
194194

195195
// Parameters:
196-
// user_id - int64 - User ID. If provided, will return group_users of this user.
197196
// 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.
198197
// per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
199198
// group_id - int64 - Group ID. If provided, will return group_users of this group.
199+
// user_id - int64 - User ID. If provided, will return group_users of this user.
200200
static list = async (params = {}, options = {}) => {
201-
if (params.user_id && !isInt(params.user_id)) {
202-
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
203-
}
204-
205201
if (params.cursor && !isString(params.cursor)) {
206202
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
207203
}
@@ -214,6 +210,10 @@ class GroupUser {
214210
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(params.group_id)}`)
215211
}
216212

213+
if (params.user_id && !isInt(params.user_id)) {
214+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
215+
}
216+
217217
const response = await Api.sendRequest('/group_users', 'GET', params, options)
218218

219219
return response?.data?.map(obj => new GroupUser(obj, options)) || []

0 commit comments

Comments
 (0)