files.com 1.2.21 → 1.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.21';
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;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Errors.js CHANGED
@@ -178,6 +178,7 @@ export class NotAuthorized_ReadPermissionRequiredError extends NotAuthorizedErro
178
178
  export class NotAuthorized_ReauthenticationFailedError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_ReauthenticationFailedError' } } errorClasses.NotAuthorized_ReauthenticationFailedError = NotAuthorized_ReauthenticationFailedError
179
179
  export class NotAuthorized_ReauthenticationFailedFinalError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_ReauthenticationFailedFinalError' } } errorClasses.NotAuthorized_ReauthenticationFailedFinalError = NotAuthorized_ReauthenticationFailedFinalError
180
180
  export class NotAuthorized_ReauthenticationNeededActionError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_ReauthenticationNeededActionError' } } errorClasses.NotAuthorized_ReauthenticationNeededActionError = NotAuthorized_ReauthenticationNeededActionError
181
+ export class NotAuthorized_RecaptchaFailedError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_RecaptchaFailedError' } } errorClasses.NotAuthorized_RecaptchaFailedError = NotAuthorized_RecaptchaFailedError
181
182
  export class NotAuthorized_SelfManagedRequiredError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_SelfManagedRequiredError' } } errorClasses.NotAuthorized_SelfManagedRequiredError = NotAuthorized_SelfManagedRequiredError
182
183
  export class NotAuthorized_SiteAdminRequiredError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_SiteAdminRequiredError' } } errorClasses.NotAuthorized_SiteAdminRequiredError = NotAuthorized_SiteAdminRequiredError
183
184
  export class NotAuthorized_SiteFilesAreImmutableError extends NotAuthorizedError { constructor(message, code, errorData) { super(message, code, errorData); this.name = 'NotAuthorized_SiteFilesAreImmutableError' } } errorClasses.NotAuthorized_SiteFilesAreImmutableError = NotAuthorized_SiteFilesAreImmutableError
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.21'
8
+ const version = '1.2.23'
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
  }