files.com 1.2.22 → 1.2.23
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/Group.md +7 -0
- package/docs/models/Site.md +1 -1
- package/docs/models/User.md +4 -4
- package/lib/Files.js +1 -1
- package/lib/models/Group.js +36 -15
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Group.js +17 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.23
|
package/docs/models/Group.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
{
|
7
7
|
"id": 1,
|
8
8
|
"name": "owners",
|
9
|
+
"allowed_ips": "10.0.0.0/8\n127.0.0.1",
|
9
10
|
"admin_ids": "1",
|
10
11
|
"notes": "example",
|
11
12
|
"user_ids": "1",
|
@@ -19,6 +20,7 @@
|
|
19
20
|
|
20
21
|
* `id` (int64): Group ID
|
21
22
|
* `name` (string): Group name
|
23
|
+
* `allowed_ips` (string): A list of allowed IPs if applicable. Newline delimited
|
22
24
|
* `admin_ids` (string): Comma-delimited list of user IDs who are group administrators (separated by commas)
|
23
25
|
* `notes` (string): Notes about this group
|
24
26
|
* `user_ids` (string): Comma-delimited list of user IDs who belong to this group (separated by commas)
|
@@ -74,6 +76,7 @@ await Group.create({
|
|
74
76
|
'sftp_permission': true,
|
75
77
|
'dav_permission': true,
|
76
78
|
'restapi_permission': true,
|
79
|
+
'allowed_ips': "10.0.0.0/8\n127.0.0.1",
|
77
80
|
'name': "name",
|
78
81
|
})
|
79
82
|
```
|
@@ -88,6 +91,7 @@ await Group.create({
|
|
88
91
|
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
89
92
|
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
90
93
|
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
94
|
+
* `allowed_ips` (string): A list of allowed IPs if applicable. Newline delimited
|
91
95
|
* `name` (string): Required - Group name.
|
92
96
|
|
93
97
|
---
|
@@ -105,6 +109,7 @@ await group.update({
|
|
105
109
|
'sftp_permission': true,
|
106
110
|
'dav_permission': true,
|
107
111
|
'restapi_permission': true,
|
112
|
+
'allowed_ips': "10.0.0.0/8\n127.0.0.1",
|
108
113
|
'name': "owners",
|
109
114
|
})
|
110
115
|
```
|
@@ -119,6 +124,7 @@ await group.update({
|
|
119
124
|
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
120
125
|
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
121
126
|
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
127
|
+
* `allowed_ips` (string): A list of allowed IPs if applicable. Newline delimited
|
122
128
|
* `name` (string): Group name.
|
123
129
|
|
124
130
|
### Example Response
|
@@ -127,6 +133,7 @@ await group.update({
|
|
127
133
|
{
|
128
134
|
"id": 1,
|
129
135
|
"name": "owners",
|
136
|
+
"allowed_ips": "10.0.0.0/8\n127.0.0.1",
|
130
137
|
"admin_ids": "1",
|
131
138
|
"notes": "example",
|
132
139
|
"user_ids": "1",
|
package/docs/models/Site.md
CHANGED
package/docs/models/User.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"admin_group_ids": [
|
10
10
|
1
|
11
11
|
],
|
12
|
-
"allowed_ips": "
|
12
|
+
"allowed_ips": "10.0.0.0/8\n127.0.0.1",
|
13
13
|
"attachments_permission": true,
|
14
14
|
"api_keys_count": 1,
|
15
15
|
"authenticate_until": "2000-01-01T01:00:00Z",
|
@@ -189,7 +189,7 @@ await User.create({
|
|
189
189
|
'group_id': 1,
|
190
190
|
'group_ids': "example",
|
191
191
|
'announcements_read': true,
|
192
|
-
'allowed_ips': "
|
192
|
+
'allowed_ips': "10.0.0.0/8\n127.0.0.1",
|
193
193
|
'attachments_permission': true,
|
194
194
|
'authenticate_until': "2000-01-01T01:00:00Z",
|
195
195
|
'authentication_method': "password",
|
@@ -332,7 +332,7 @@ await user.update({
|
|
332
332
|
'group_id': 1,
|
333
333
|
'group_ids': "example",
|
334
334
|
'announcements_read': true,
|
335
|
-
'allowed_ips': "
|
335
|
+
'allowed_ips': "10.0.0.0/8\n127.0.0.1",
|
336
336
|
'attachments_permission': true,
|
337
337
|
'authenticate_until': "2000-01-01T01:00:00Z",
|
338
338
|
'authentication_method': "password",
|
@@ -426,7 +426,7 @@ await user.update({
|
|
426
426
|
"admin_group_ids": [
|
427
427
|
1
|
428
428
|
],
|
429
|
-
"allowed_ips": "
|
429
|
+
"allowed_ips": "10.0.0.0/8\n127.0.0.1",
|
430
430
|
"attachments_permission": true,
|
431
431
|
"api_keys_count": 1,
|
432
432
|
"authenticate_until": "2000-01-01T01:00:00Z",
|
package/lib/Files.js
CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
|
|
11
11
|
var apiKey;
|
12
12
|
var baseUrl = 'https://app.files.com';
|
13
13
|
var sessionId = null;
|
14
|
-
var version = '1.2.
|
14
|
+
var version = '1.2.23';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
package/lib/models/Group.js
CHANGED
@@ -47,6 +47,13 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
47
47
|
(0, _defineProperty2.default)(this, "setName", function (value) {
|
48
48
|
_this.attributes.name = value;
|
49
49
|
});
|
50
|
+
// string # A list of allowed IPs if applicable. Newline delimited
|
51
|
+
(0, _defineProperty2.default)(this, "getAllowedIps", function () {
|
52
|
+
return _this.attributes.allowed_ips;
|
53
|
+
});
|
54
|
+
(0, _defineProperty2.default)(this, "setAllowedIps", function (value) {
|
55
|
+
_this.attributes.allowed_ips = value;
|
56
|
+
});
|
50
57
|
// string # Comma-delimited list of user IDs who are group administrators (separated by commas)
|
51
58
|
(0, _defineProperty2.default)(this, "getAdminIds", function () {
|
52
59
|
return _this.attributes.admin_ids;
|
@@ -111,6 +118,7 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
111
118
|
// sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
112
119
|
// dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
113
120
|
// restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
121
|
+
// allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
|
114
122
|
// name - string - Group name.
|
115
123
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
116
124
|
var params,
|
@@ -157,32 +165,38 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
157
165
|
}
|
158
166
|
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params.admin_ids)));
|
159
167
|
case 14:
|
160
|
-
if (!(params.
|
168
|
+
if (!(params.allowed_ips && !(0, _utils.isString)(params.allowed_ips))) {
|
161
169
|
_context.next = 16;
|
162
170
|
break;
|
163
171
|
}
|
164
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
172
|
+
throw new errors.InvalidParameterError("Bad parameter: allowed_ips must be of type String, received ".concat((0, _utils.getType)(params.allowed_ips)));
|
165
173
|
case 16:
|
174
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
175
|
+
_context.next = 18;
|
176
|
+
break;
|
177
|
+
}
|
178
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
179
|
+
case 18:
|
166
180
|
if (params.id) {
|
167
|
-
_context.next =
|
181
|
+
_context.next = 24;
|
168
182
|
break;
|
169
183
|
}
|
170
184
|
if (!_this.attributes.id) {
|
171
|
-
_context.next =
|
185
|
+
_context.next = 23;
|
172
186
|
break;
|
173
187
|
}
|
174
188
|
params.id = _this.id;
|
175
|
-
_context.next =
|
189
|
+
_context.next = 24;
|
176
190
|
break;
|
177
|
-
case
|
191
|
+
case 23:
|
178
192
|
throw new errors.MissingParameterError('Parameter missing: id');
|
179
|
-
case 22:
|
180
|
-
_context.next = 24;
|
181
|
-
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
182
193
|
case 24:
|
194
|
+
_context.next = 26;
|
195
|
+
return _Api.default.sendRequest("/groups/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
196
|
+
case 26:
|
183
197
|
response = _context.sent;
|
184
198
|
return _context.abrupt("return", new Group(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
185
|
-
case
|
199
|
+
case 28:
|
186
200
|
case "end":
|
187
201
|
return _context.stop();
|
188
202
|
}
|
@@ -396,6 +410,7 @@ _Group = Group;
|
|
396
410
|
// sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
397
411
|
// dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
398
412
|
// restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
413
|
+
// allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
|
399
414
|
// name (required) - string - Group name.
|
400
415
|
(0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
401
416
|
var params,
|
@@ -431,18 +446,24 @@ _Group = Group;
|
|
431
446
|
}
|
432
447
|
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params.admin_ids)));
|
433
448
|
case 10:
|
434
|
-
if (!(params.
|
449
|
+
if (!(params.allowed_ips && !(0, _utils.isString)(params.allowed_ips))) {
|
435
450
|
_context6.next = 12;
|
436
451
|
break;
|
437
452
|
}
|
438
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
453
|
+
throw new errors.InvalidParameterError("Bad parameter: allowed_ips must be of type String, received ".concat((0, _utils.getType)(params.allowed_ips)));
|
439
454
|
case 12:
|
440
|
-
|
441
|
-
|
455
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
456
|
+
_context6.next = 14;
|
457
|
+
break;
|
458
|
+
}
|
459
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
442
460
|
case 14:
|
461
|
+
_context6.next = 16;
|
462
|
+
return _Api.default.sendRequest('/groups', 'POST', params, options);
|
463
|
+
case 16:
|
443
464
|
response = _context6.sent;
|
444
465
|
return _context6.abrupt("return", new _Group(response === null || response === void 0 ? void 0 : response.data, options));
|
445
|
-
case
|
466
|
+
case 18:
|
446
467
|
case "end":
|
447
468
|
return _context6.stop();
|
448
469
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Group.js
CHANGED
@@ -42,6 +42,13 @@ class Group {
|
|
42
42
|
this.attributes.name = value
|
43
43
|
}
|
44
44
|
|
45
|
+
// string # A list of allowed IPs if applicable. Newline delimited
|
46
|
+
getAllowedIps = () => this.attributes.allowed_ips
|
47
|
+
|
48
|
+
setAllowedIps = value => {
|
49
|
+
this.attributes.allowed_ips = value
|
50
|
+
}
|
51
|
+
|
45
52
|
// string # Comma-delimited list of user IDs who are group administrators (separated by commas)
|
46
53
|
getAdminIds = () => this.attributes.admin_ids
|
47
54
|
|
@@ -106,6 +113,7 @@ class Group {
|
|
106
113
|
// sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
107
114
|
// dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
108
115
|
// restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
116
|
+
// allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
|
109
117
|
// name - string - Group name.
|
110
118
|
update = async (params = {}) => {
|
111
119
|
if (!this.attributes.id) {
|
@@ -133,6 +141,10 @@ class Group {
|
|
133
141
|
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(params.admin_ids)}`)
|
134
142
|
}
|
135
143
|
|
144
|
+
if (params.allowed_ips && !isString(params.allowed_ips)) {
|
145
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(params.allowed_ips)}`)
|
146
|
+
}
|
147
|
+
|
136
148
|
if (params.name && !isString(params.name)) {
|
137
149
|
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
138
150
|
}
|
@@ -251,6 +263,7 @@ class Group {
|
|
251
263
|
// sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
252
264
|
// dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
253
265
|
// restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
266
|
+
// allowed_ips - string - A list of allowed IPs if applicable. Newline delimited
|
254
267
|
// name (required) - string - Group name.
|
255
268
|
static create = async (params = {}, options = {}) => {
|
256
269
|
if (!params.name) {
|
@@ -269,6 +282,10 @@ class Group {
|
|
269
282
|
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(params.admin_ids)}`)
|
270
283
|
}
|
271
284
|
|
285
|
+
if (params.allowed_ips && !isString(params.allowed_ips)) {
|
286
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(params.allowed_ips)}`)
|
287
|
+
}
|
288
|
+
|
272
289
|
if (params.name && !isString(params.name)) {
|
273
290
|
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
274
291
|
}
|