files.com 1.0.301 → 1.0.303

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.301
1
+ 1.0.303
@@ -7,7 +7,9 @@
7
7
  "id": 1,
8
8
  "title": "My public key",
9
9
  "created_at": "2000-01-01T01:00:00Z",
10
- "fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8"
10
+ "fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
11
+ "username": "User",
12
+ "user_id": 1
11
13
  }
12
14
  ```
13
15
 
@@ -15,7 +17,8 @@
15
17
  * `title` (string): Public key title
16
18
  * `created_at` (date-time): Public key created at date/time
17
19
  * `fingerprint` (string): Public key fingerprint
18
- * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
20
+ * `username` (string): Username of the user this public key is associated with
21
+ * `user_id` (int64): User ID this public key is associated with
19
22
  * `public_key` (string): Actual contents of SSH key.
20
23
 
21
24
  ---
@@ -92,7 +95,9 @@ await public_key.update({
92
95
  "id": 1,
93
96
  "title": "My public key",
94
97
  "created_at": "2000-01-01T01:00:00Z",
95
- "fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8"
98
+ "fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
99
+ "username": "User",
100
+ "user_id": 1
96
101
  }
97
102
  ```
98
103
 
@@ -185,6 +185,7 @@
185
185
  "public_keys_count": 1,
186
186
  "receive_admin_alerts": true,
187
187
  "require_2fa": "always_require",
188
+ "require_login_by": "2000-01-01T01:00:00Z",
188
189
  "active_2fa": true,
189
190
  "require_password_change": true,
190
191
  "password_expired": true,
@@ -48,6 +48,7 @@
48
48
  "public_keys_count": 1,
49
49
  "receive_admin_alerts": true,
50
50
  "require_2fa": "always_require",
51
+ "require_login_by": "2000-01-01T01:00:00Z",
51
52
  "active_2fa": true,
52
53
  "require_password_change": true,
53
54
  "password_expired": true,
@@ -110,6 +111,7 @@
110
111
  * `public_keys_count` (int64): Number of public keys associated with this user
111
112
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
112
113
  * `require_2fa` (string): 2FA required setting
114
+ * `require_login_by` (date-time): Require user to login by specified date otherwise it will be disabled.
113
115
  * `active_2fa` (boolean): Is 2fa active for the user?
114
116
  * `require_password_change` (boolean): Is a password change required upon next user login?
115
117
  * `password_expired` (boolean): Is user's password expired?
@@ -213,6 +215,7 @@ await User.create({
213
215
  'office_integration_enabled': true,
214
216
  'password_validity_days': 1,
215
217
  'receive_admin_alerts': true,
218
+ 'require_login_by': "2000-01-01T01:00:00Z",
216
219
  'require_password_change': true,
217
220
  'restapi_permission': true,
218
221
  'self_managed': true,
@@ -263,6 +266,7 @@ await User.create({
263
266
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
264
267
  * `password_validity_days` (int64): Number of days to allow user to use the same password
265
268
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
269
+ * `require_login_by` (string): Require user to login by specified date otherwise it will be disabled.
266
270
  * `require_password_change` (boolean): Is a password change required upon next user login?
267
271
  * `restapi_permission` (boolean): Can this user access the REST API?
268
272
  * `self_managed` (boolean): Does this user manage it's own credentials or is it a shared/bot user?
@@ -354,6 +358,7 @@ await user.update({
354
358
  'office_integration_enabled': true,
355
359
  'password_validity_days': 1,
356
360
  'receive_admin_alerts': true,
361
+ 'require_login_by': "2000-01-01T01:00:00Z",
357
362
  'require_password_change': true,
358
363
  'restapi_permission': true,
359
364
  'self_managed': true,
@@ -404,6 +409,7 @@ await user.update({
404
409
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
405
410
  * `password_validity_days` (int64): Number of days to allow user to use the same password
406
411
  * `receive_admin_alerts` (boolean): Should the user receive admin alerts such a certificate expiration notifications and overages?
412
+ * `require_login_by` (string): Require user to login by specified date otherwise it will be disabled.
407
413
  * `require_password_change` (boolean): Is a password change required upon next user login?
408
414
  * `restapi_permission` (boolean): Can this user access the REST API?
409
415
  * `self_managed` (boolean): Does this user manage it's own credentials or is it a shared/bot user?
@@ -466,6 +472,7 @@ await user.update({
466
472
  "public_keys_count": 1,
467
473
  "receive_admin_alerts": true,
468
474
  "require_2fa": "always_require",
475
+ "require_login_by": "2000-01-01T01:00:00Z",
469
476
  "active_2fa": true,
470
477
  "require_password_change": true,
471
478
  "password_expired": true,
@@ -56,7 +56,14 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
56
56
  (0, _defineProperty2.default)(this, "setFingerprint", function (value) {
57
57
  _this.attributes.fingerprint = value;
58
58
  });
59
- // int64 # User ID. Provide a value of `0` to operate the current session's user.
59
+ // string # Username of the user this public key is associated with
60
+ (0, _defineProperty2.default)(this, "getUsername", function () {
61
+ return _this.attributes.username;
62
+ });
63
+ (0, _defineProperty2.default)(this, "setUsername", function (value) {
64
+ _this.attributes.username = value;
65
+ });
66
+ // int64 # User ID this public key is associated with
60
67
  (0, _defineProperty2.default)(this, "getUserId", function () {
61
68
  return _this.attributes.user_id;
62
69
  });
@@ -322,6 +322,13 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
322
322
  (0, _defineProperty2.default)(this, "setRequire2fa", function (value) {
323
323
  _this.attributes.require_2fa = value;
324
324
  });
325
+ // date-time # Require user to login by specified date otherwise it will be disabled.
326
+ (0, _defineProperty2.default)(this, "getRequireLoginBy", function () {
327
+ return _this.attributes.require_login_by;
328
+ });
329
+ (0, _defineProperty2.default)(this, "setRequireLoginBy", function (value) {
330
+ _this.attributes.require_login_by = value;
331
+ });
325
332
  // boolean # Is 2fa active for the user?
326
333
  (0, _defineProperty2.default)(this, "getActive2fa", function () {
327
334
  return _this.attributes.active_2fa;
@@ -702,6 +709,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
702
709
  // office_integration_enabled - boolean - Enable integration with Office for the web?
703
710
  // password_validity_days - int64 - Number of days to allow user to use the same password
704
711
  // receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
712
+ // require_login_by - string - Require user to login by specified date otherwise it will be disabled.
705
713
  // require_password_change - boolean - Is a password change required upon next user login?
706
714
  // restapi_permission - boolean - Can this user access the REST API?
707
715
  // self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
@@ -856,62 +864,68 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
856
864
  }
857
865
  throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(password_validity_days)));
858
866
  case 46:
859
- if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
867
+ if (!(params['require_login_by'] && !(0, _utils.isString)(params['require_login_by']))) {
860
868
  _context4.next = 48;
861
869
  break;
862
870
  }
863
- throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(ssl_required)));
871
+ throw new errors.InvalidParameterError("Bad parameter: require_login_by must be of type String, received ".concat((0, _utils.getType)(require_login_by)));
864
872
  case 48:
865
- if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
873
+ if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
866
874
  _context4.next = 50;
867
875
  break;
868
876
  }
869
- throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(sso_strategy_id)));
877
+ throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(ssl_required)));
870
878
  case 50:
871
- if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
879
+ if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
872
880
  _context4.next = 52;
873
881
  break;
874
882
  }
875
- throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(require_2fa)));
883
+ throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(sso_strategy_id)));
876
884
  case 52:
877
- if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
885
+ if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
878
886
  _context4.next = 54;
879
887
  break;
880
888
  }
881
- throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(time_zone)));
889
+ throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(require_2fa)));
882
890
  case 54:
883
- if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
891
+ if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
884
892
  _context4.next = 56;
885
893
  break;
886
894
  }
887
- throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(user_root)));
895
+ throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(time_zone)));
888
896
  case 56:
889
- if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
897
+ if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
890
898
  _context4.next = 58;
891
899
  break;
892
900
  }
893
- throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(username)));
901
+ throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(user_root)));
894
902
  case 58:
903
+ if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
904
+ _context4.next = 60;
905
+ break;
906
+ }
907
+ throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(username)));
908
+ case 60:
895
909
  if (params['id']) {
896
- _context4.next = 64;
910
+ _context4.next = 66;
897
911
  break;
898
912
  }
899
913
  if (!_this.attributes.id) {
900
- _context4.next = 63;
914
+ _context4.next = 65;
901
915
  break;
902
916
  }
903
917
  params['id'] = _this.id;
904
- _context4.next = 64;
918
+ _context4.next = 66;
905
919
  break;
906
- case 63:
920
+ case 65:
907
921
  throw new errors.MissingParameterError('Parameter missing: id');
908
- case 64:
909
- _context4.next = 66;
910
- return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
911
922
  case 66:
923
+ _context4.next = 68;
924
+ return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
925
+ case 68:
912
926
  response = _context4.sent;
913
927
  return _context4.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, _this.options));
914
- case 68:
928
+ case 70:
915
929
  case "end":
916
930
  return _context4.stop();
917
931
  }
@@ -1151,6 +1165,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
1151
1165
  // office_integration_enabled - boolean - Enable integration with Office for the web?
1152
1166
  // password_validity_days - int64 - Number of days to allow user to use the same password
1153
1167
  // receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
1168
+ // require_login_by - string - Require user to login by specified date otherwise it will be disabled.
1154
1169
  // require_password_change - boolean - Is a password change required upon next user login?
1155
1170
  // restapi_permission - boolean - Can this user access the REST API?
1156
1171
  // self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
@@ -1288,48 +1303,54 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
1288
1303
  }
1289
1304
  throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params['password_validity_days'])));
1290
1305
  case 40:
1291
- if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
1306
+ if (!(params['require_login_by'] && !(0, _utils.isString)(params['require_login_by']))) {
1292
1307
  _context8.next = 42;
1293
1308
  break;
1294
1309
  }
1295
- throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(params['ssl_required'])));
1310
+ throw new errors.InvalidParameterError("Bad parameter: require_login_by must be of type String, received ".concat((0, _utils.getType)(params['require_login_by'])));
1296
1311
  case 42:
1297
- if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
1312
+ if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
1298
1313
  _context8.next = 44;
1299
1314
  break;
1300
1315
  }
1301
- throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(params['sso_strategy_id'])));
1316
+ throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(params['ssl_required'])));
1302
1317
  case 44:
1303
- if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
1318
+ if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
1304
1319
  _context8.next = 46;
1305
1320
  break;
1306
1321
  }
1307
- throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(params['require_2fa'])));
1322
+ throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(params['sso_strategy_id'])));
1308
1323
  case 46:
1309
- if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
1324
+ if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
1310
1325
  _context8.next = 48;
1311
1326
  break;
1312
1327
  }
1313
- throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(params['time_zone'])));
1328
+ throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(params['require_2fa'])));
1314
1329
  case 48:
1315
- if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
1330
+ if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
1316
1331
  _context8.next = 50;
1317
1332
  break;
1318
1333
  }
1319
- throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params['user_root'])));
1334
+ throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(params['time_zone'])));
1320
1335
  case 50:
1321
- if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
1336
+ if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
1322
1337
  _context8.next = 52;
1323
1338
  break;
1324
1339
  }
1325
- throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params['username'])));
1340
+ throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params['user_root'])));
1326
1341
  case 52:
1327
- _context8.next = 54;
1328
- return _Api.default.sendRequest("/users", 'POST', params, options);
1342
+ if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
1343
+ _context8.next = 54;
1344
+ break;
1345
+ }
1346
+ throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params['username'])));
1329
1347
  case 54:
1348
+ _context8.next = 56;
1349
+ return _Api.default.sendRequest("/users", 'POST', params, options);
1350
+ case 56:
1330
1351
  response = _context8.sent;
1331
1352
  return _context8.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, options));
1332
- case 56:
1353
+ case 58:
1333
1354
  case "end":
1334
1355
  return _context8.stop();
1335
1356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.301",
3
+ "version": "1.0.303",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -47,7 +47,14 @@ class PublicKey {
47
47
  this.attributes.fingerprint = value
48
48
  }
49
49
 
50
- // int64 # User ID. Provide a value of `0` to operate the current session's user.
50
+ // string # Username of the user this public key is associated with
51
+ getUsername = () => this.attributes.username
52
+
53
+ setUsername = value => {
54
+ this.attributes.username = value
55
+ }
56
+
57
+ // int64 # User ID this public key is associated with
51
58
  getUserId = () => this.attributes.user_id
52
59
 
53
60
  setUserId = value => {
@@ -313,6 +313,13 @@ class User {
313
313
  this.attributes.require_2fa = value
314
314
  }
315
315
 
316
+ // date-time # Require user to login by specified date otherwise it will be disabled.
317
+ getRequireLoginBy = () => this.attributes.require_login_by
318
+
319
+ setRequireLoginBy = value => {
320
+ this.attributes.require_login_by = value
321
+ }
322
+
316
323
  // boolean # Is 2fa active for the user?
317
324
  getActive2fa = () => this.attributes.active_2fa
318
325
 
@@ -619,6 +626,7 @@ class User {
619
626
  // office_integration_enabled - boolean - Enable integration with Office for the web?
620
627
  // password_validity_days - int64 - Number of days to allow user to use the same password
621
628
  // receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
629
+ // require_login_by - string - Require user to login by specified date otherwise it will be disabled.
622
630
  // require_password_change - boolean - Is a password change required upon next user login?
623
631
  // restapi_permission - boolean - Can this user access the REST API?
624
632
  // self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
@@ -702,6 +710,9 @@ class User {
702
710
  if (params['password_validity_days'] && !isInt(params['password_validity_days'])) {
703
711
  throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(password_validity_days)}`)
704
712
  }
713
+ if (params['require_login_by'] && !isString(params['require_login_by'])) {
714
+ throw new errors.InvalidParameterError(`Bad parameter: require_login_by must be of type String, received ${getType(require_login_by)}`)
715
+ }
705
716
  if (params['ssl_required'] && !isString(params['ssl_required'])) {
706
717
  throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(ssl_required)}`)
707
718
  }
@@ -875,6 +886,7 @@ class User {
875
886
  // office_integration_enabled - boolean - Enable integration with Office for the web?
876
887
  // password_validity_days - int64 - Number of days to allow user to use the same password
877
888
  // receive_admin_alerts - boolean - Should the user receive admin alerts such a certificate expiration notifications and overages?
889
+ // require_login_by - string - Require user to login by specified date otherwise it will be disabled.
878
890
  // require_password_change - boolean - Is a password change required upon next user login?
879
891
  // restapi_permission - boolean - Can this user access the REST API?
880
892
  // self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
@@ -965,6 +977,10 @@ class User {
965
977
  throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(params['password_validity_days'])}`)
966
978
  }
967
979
 
980
+ if (params['require_login_by'] && !isString(params['require_login_by'])) {
981
+ throw new errors.InvalidParameterError(`Bad parameter: require_login_by must be of type String, received ${getType(params['require_login_by'])}`)
982
+ }
983
+
968
984
  if (params['ssl_required'] && !isString(params['ssl_required'])) {
969
985
  throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(params['ssl_required'])}`)
970
986
  }