Skip to content

Commit 040ceda

Browse files
[Bot] push changes from Files.com
1 parent fe25d03 commit 040ceda

7 files changed

Lines changed: 69 additions & 19 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.589
1+
1.2.590

docs/models/Permission.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
"username": "user",
1111
"group_id": 1,
1212
"group_name": "example",
13+
"group_ids": [
14+
1
15+
],
16+
"group_names": [
17+
"example"
18+
],
1319
"partner_id": 1,
1420
"partner_name": "Acme Corp.",
1521
"permission": "full",
@@ -24,6 +30,8 @@
2430
* `username` (string): Username (if applicable)
2531
* `group_id` (int64): Group ID
2632
* `group_name` (string): Group name (if applicable)
33+
* `group_ids` (array(int64)): Group IDs when this permission requires multiple groups
34+
* `group_names` (array(string)): Group names when this permission requires multiple groups
2735
* `partner_id` (int64): Partner ID (if applicable)
2836
* `partner_name` (string): Partner name (if applicable)
2937
* `permission` (string): Permission type. See the table referenced in the documentation for an explanation of each permission.
@@ -66,6 +74,7 @@ await Permission.list({
6674
await Permission.create({
6775
'path': "path",
6876
'group_id': 1,
77+
'group_ids': [1],
6978
'permission': "full",
7079
'recursive': false,
7180
'partner_id': 1,
@@ -81,6 +90,7 @@ await Permission.create({
8190

8291
* `path` (string): Required - Folder path
8392
* `group_id` (int64): Group ID. Provide `group_name` or `group_id`
93+
* `group_ids` (string): Group IDs when the permission requires multiple groups. If sent as a string, it should be comma-delimited.
8494
* `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
8595
* `recursive` (boolean): Apply to subfolders recursively?
8696
* `partner_id` (int64): Partner ID if this Permission belongs to a partner.

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.589';
15+
var version = '1.2.590';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/Permission.js

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ var Permission = /*#__PURE__*/(0, _createClass2.default)(function Permission() {
7474
(0, _defineProperty2.default)(this, "setGroupName", function (value) {
7575
_this.attributes.group_name = value;
7676
});
77+
// array(int64) # Group IDs when this permission requires multiple groups
78+
(0, _defineProperty2.default)(this, "getGroupIds", function () {
79+
return _this.attributes.group_ids;
80+
});
81+
(0, _defineProperty2.default)(this, "setGroupIds", function (value) {
82+
_this.attributes.group_ids = value;
83+
});
84+
// array(string) # Group names when this permission requires multiple groups
85+
(0, _defineProperty2.default)(this, "getGroupNames", function () {
86+
return _this.attributes.group_names;
87+
});
88+
(0, _defineProperty2.default)(this, "setGroupNames", function (value) {
89+
_this.attributes.group_names = value;
90+
});
7791
// int64 # Partner ID (if applicable)
7892
(0, _defineProperty2.default)(this, "getPartnerId", function () {
7993
return _this.attributes.partner_id;
@@ -277,6 +291,7 @@ _Permission = Permission;
277291
// Parameters:
278292
// path (required) - string - Folder path
279293
// group_id - int64 - Group ID. Provide `group_name` or `group_id`
294+
// group_ids - string - Group IDs when the permission requires multiple groups. If sent as a string, it should be comma-delimited.
280295
// permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
281296
// recursive - boolean - Apply to subfolders recursively?
282297
// partner_id - int64 - Partner ID if this Permission belongs to a partner.
@@ -312,48 +327,54 @@ _Permission = Permission;
312327
}
313328
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
314329
case 3:
315-
if (!(params.permission && !(0, _utils.isString)(params.permission))) {
330+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
316331
_context4.next = 4;
317332
break;
318333
}
319-
throw new errors.InvalidParameterError("Bad parameter: permission must be of type String, received ".concat((0, _utils.getType)(params.permission)));
334+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
320335
case 4:
321-
if (!(params.partner_id && !(0, _utils.isInt)(params.partner_id))) {
336+
if (!(params.permission && !(0, _utils.isString)(params.permission))) {
322337
_context4.next = 5;
323338
break;
324339
}
325-
throw new errors.InvalidParameterError("Bad parameter: partner_id must be of type Int, received ".concat((0, _utils.getType)(params.partner_id)));
340+
throw new errors.InvalidParameterError("Bad parameter: permission must be of type String, received ".concat((0, _utils.getType)(params.permission)));
326341
case 5:
327-
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
342+
if (!(params.partner_id && !(0, _utils.isInt)(params.partner_id))) {
328343
_context4.next = 6;
329344
break;
330345
}
331-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
346+
throw new errors.InvalidParameterError("Bad parameter: partner_id must be of type Int, received ".concat((0, _utils.getType)(params.partner_id)));
332347
case 6:
333-
if (!(params.username && !(0, _utils.isString)(params.username))) {
348+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
334349
_context4.next = 7;
335350
break;
336351
}
337-
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
352+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
338353
case 7:
339-
if (!(params.group_name && !(0, _utils.isString)(params.group_name))) {
354+
if (!(params.username && !(0, _utils.isString)(params.username))) {
340355
_context4.next = 8;
341356
break;
342357
}
343-
throw new errors.InvalidParameterError("Bad parameter: group_name must be of type String, received ".concat((0, _utils.getType)(params.group_name)));
358+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
344359
case 8:
345-
if (!(params.site_id && !(0, _utils.isInt)(params.site_id))) {
360+
if (!(params.group_name && !(0, _utils.isString)(params.group_name))) {
346361
_context4.next = 9;
347362
break;
348363
}
349-
throw new errors.InvalidParameterError("Bad parameter: site_id must be of type Int, received ".concat((0, _utils.getType)(params.site_id)));
364+
throw new errors.InvalidParameterError("Bad parameter: group_name must be of type String, received ".concat((0, _utils.getType)(params.group_name)));
350365
case 9:
351-
_context4.next = 10;
352-
return _Api.default.sendRequest('/permissions', 'POST', params, options);
366+
if (!(params.site_id && !(0, _utils.isInt)(params.site_id))) {
367+
_context4.next = 10;
368+
break;
369+
}
370+
throw new errors.InvalidParameterError("Bad parameter: site_id must be of type Int, received ".concat((0, _utils.getType)(params.site_id)));
353371
case 10:
372+
_context4.next = 11;
373+
return _Api.default.sendRequest('/permissions', 'POST', params, options);
374+
case 11:
354375
response = _context4.sent;
355376
return _context4.abrupt("return", new _Permission(response === null || response === void 0 ? void 0 : response.data, options));
356-
case 11:
377+
case 12:
357378
case "end":
358379
return _context4.stop();
359380
}

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.589",
3+
"version": "1.2.590",
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.589'
9+
const version = '1.2.590'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/Permission.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ class Permission {
7070
this.attributes.group_name = value
7171
}
7272

73+
// array(int64) # Group IDs when this permission requires multiple groups
74+
getGroupIds = () => this.attributes.group_ids
75+
76+
setGroupIds = value => {
77+
this.attributes.group_ids = value
78+
}
79+
80+
// array(string) # Group names when this permission requires multiple groups
81+
getGroupNames = () => this.attributes.group_names
82+
83+
setGroupNames = value => {
84+
this.attributes.group_names = value
85+
}
86+
7387
// int64 # Partner ID (if applicable)
7488
getPartnerId = () => this.attributes.partner_id
7589

@@ -190,6 +204,7 @@ class Permission {
190204
// Parameters:
191205
// path (required) - string - Folder path
192206
// group_id - int64 - Group ID. Provide `group_name` or `group_id`
207+
// group_ids - string - Group IDs when the permission requires multiple groups. If sent as a string, it should be comma-delimited.
193208
// permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
194209
// recursive - boolean - Apply to subfolders recursively?
195210
// partner_id - int64 - Partner ID if this Permission belongs to a partner.
@@ -210,6 +225,10 @@ class Permission {
210225
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(params.group_id)}`)
211226
}
212227

228+
if (params.group_ids && !isString(params.group_ids)) {
229+
throw new errors.InvalidParameterError(`Bad parameter: group_ids must be of type String, received ${getType(params.group_ids)}`)
230+
}
231+
213232
if (params.permission && !isString(params.permission)) {
214233
throw new errors.InvalidParameterError(`Bad parameter: permission must be of type String, received ${getType(params.permission)}`)
215234
}

0 commit comments

Comments
 (0)