files.com 1.2.24 → 1.2.26

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.24
1
+ 1.2.26
@@ -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",
@@ -194,7 +194,7 @@
194
194
  "admin_group_ids": [
195
195
  1
196
196
  ],
197
- "allowed_ips": "127.0.0.1",
197
+ "allowed_ips": "10.0.0.0/8\n127.0.0.1",
198
198
  "attachments_permission": true,
199
199
  "api_keys_count": 1,
200
200
  "authenticate_until": "2000-01-01T01:00:00Z",
@@ -39,6 +39,7 @@
39
39
  "provision_sftp_permission": true,
40
40
  "provision_time_zone": "Eastern Time (US & Canada)",
41
41
  "provision_company": "ACME Corp.",
42
+ "provision_require_2fa": "always_require",
42
43
  "ldap_base_dn": "example",
43
44
  "ldap_domain": "mysite.com",
44
45
  "enabled": true,
@@ -87,6 +88,7 @@
87
88
  * `provision_sftp_permission` (boolean): Auto-provisioned users get SFTP permission?
88
89
  * `provision_time_zone` (string): Default time zone for auto provisioned users.
89
90
  * `provision_company` (string): Default company for auto provisioned users.
91
+ * `provision_require_2fa` (string): 2FA required setting for auto provisioned users.
90
92
  * `ldap_base_dn` (string): Base DN for looking up users in LDAP server
91
93
  * `ldap_domain` (string): Domain name that will be appended to LDAP usernames
92
94
  * `enabled` (boolean): Is strategy enabled? This may become automatically set to `false` after a high number and duration of failures.
@@ -9,7 +9,7 @@
9
9
  "admin_group_ids": [
10
10
  1
11
11
  ],
12
- "allowed_ips": "127.0.0.1",
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': "127.0.0.1",
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': "127.0.0.1",
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": "127.0.0.1",
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.24';
14
+ var version = '1.2.26';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -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.name && !(0, _utils.isString)(params.name))) {
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: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
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 = 22;
181
+ _context.next = 24;
168
182
  break;
169
183
  }
170
184
  if (!_this.attributes.id) {
171
- _context.next = 21;
185
+ _context.next = 23;
172
186
  break;
173
187
  }
174
188
  params.id = _this.id;
175
- _context.next = 22;
189
+ _context.next = 24;
176
190
  break;
177
- case 21:
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 26:
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.name && !(0, _utils.isString)(params.name))) {
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: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
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
- _context6.next = 14;
441
- return _Api.default.sendRequest('/groups', 'POST', params, options);
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 16:
466
+ case 18:
446
467
  case "end":
447
468
  return _context6.stop();
448
469
  }
@@ -173,6 +173,10 @@ var SsoStrategy = /*#__PURE__*/(0, _createClass2.default)(function SsoStrategy()
173
173
  (0, _defineProperty2.default)(this, "getProvisionCompany", function () {
174
174
  return _this.attributes.provision_company;
175
175
  });
176
+ // string # 2FA required setting for auto provisioned users.
177
+ (0, _defineProperty2.default)(this, "getProvisionRequire2fa", function () {
178
+ return _this.attributes.provision_require_2fa;
179
+ });
176
180
  // string # Base DN for looking up users in LDAP server
177
181
  (0, _defineProperty2.default)(this, "getLdapBaseDn", function () {
178
182
  return _this.attributes.ldap_base_dn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.24'
8
+ const version = '1.2.26'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -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
  }
@@ -133,6 +133,9 @@ class SsoStrategy {
133
133
  // string # Default company for auto provisioned users.
134
134
  getProvisionCompany = () => this.attributes.provision_company
135
135
 
136
+ // string # 2FA required setting for auto provisioned users.
137
+ getProvisionRequire2fa = () => this.attributes.provision_require_2fa
138
+
136
139
  // string # Base DN for looking up users in LDAP server
137
140
  getLdapBaseDn = () => this.attributes.ldap_base_dn
138
141