files.com 1.0.302 → 1.0.303
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/_VERSION +1 -1
- package/docs/models/PublicKey.md +8 -3
- package/docs/models/User.md +4 -0
- package/lib/models/PublicKey.js +8 -1
- package/lib/models/User.js +49 -35
- package/package.json +1 -1
- package/src/models/PublicKey.js +8 -1
- package/src/models/User.js +9 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.303
|
package/docs/models/PublicKey.md
CHANGED
@@ -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
|
-
* `
|
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
|
|
package/docs/models/User.md
CHANGED
@@ -215,6 +215,7 @@ await User.create({
|
|
215
215
|
'office_integration_enabled': true,
|
216
216
|
'password_validity_days': 1,
|
217
217
|
'receive_admin_alerts': true,
|
218
|
+
'require_login_by': "2000-01-01T01:00:00Z",
|
218
219
|
'require_password_change': true,
|
219
220
|
'restapi_permission': true,
|
220
221
|
'self_managed': true,
|
@@ -265,6 +266,7 @@ await User.create({
|
|
265
266
|
* `office_integration_enabled` (boolean): Enable integration with Office for the web?
|
266
267
|
* `password_validity_days` (int64): Number of days to allow user to use the same password
|
267
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.
|
268
270
|
* `require_password_change` (boolean): Is a password change required upon next user login?
|
269
271
|
* `restapi_permission` (boolean): Can this user access the REST API?
|
270
272
|
* `self_managed` (boolean): Does this user manage it's own credentials or is it a shared/bot user?
|
@@ -356,6 +358,7 @@ await user.update({
|
|
356
358
|
'office_integration_enabled': true,
|
357
359
|
'password_validity_days': 1,
|
358
360
|
'receive_admin_alerts': true,
|
361
|
+
'require_login_by': "2000-01-01T01:00:00Z",
|
359
362
|
'require_password_change': true,
|
360
363
|
'restapi_permission': true,
|
361
364
|
'self_managed': true,
|
@@ -406,6 +409,7 @@ await user.update({
|
|
406
409
|
* `office_integration_enabled` (boolean): Enable integration with Office for the web?
|
407
410
|
* `password_validity_days` (int64): Number of days to allow user to use the same password
|
408
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.
|
409
413
|
* `require_password_change` (boolean): Is a password change required upon next user login?
|
410
414
|
* `restapi_permission` (boolean): Can this user access the REST API?
|
411
415
|
* `self_managed` (boolean): Does this user manage it's own credentials or is it a shared/bot user?
|
package/lib/models/PublicKey.js
CHANGED
@@ -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
|
-
//
|
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
|
});
|
package/lib/models/User.js
CHANGED
@@ -709,6 +709,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
709
709
|
// office_integration_enabled - boolean - Enable integration with Office for the web?
|
710
710
|
// password_validity_days - int64 - Number of days to allow user to use the same password
|
711
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.
|
712
713
|
// require_password_change - boolean - Is a password change required upon next user login?
|
713
714
|
// restapi_permission - boolean - Can this user access the REST API?
|
714
715
|
// self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
|
@@ -863,62 +864,68 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
863
864
|
}
|
864
865
|
throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(password_validity_days)));
|
865
866
|
case 46:
|
866
|
-
if (!(params['
|
867
|
+
if (!(params['require_login_by'] && !(0, _utils.isString)(params['require_login_by']))) {
|
867
868
|
_context4.next = 48;
|
868
869
|
break;
|
869
870
|
}
|
870
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
871
|
+
throw new errors.InvalidParameterError("Bad parameter: require_login_by must be of type String, received ".concat((0, _utils.getType)(require_login_by)));
|
871
872
|
case 48:
|
872
|
-
if (!(params['
|
873
|
+
if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
|
873
874
|
_context4.next = 50;
|
874
875
|
break;
|
875
876
|
}
|
876
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
877
|
+
throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(ssl_required)));
|
877
878
|
case 50:
|
878
|
-
if (!(params['
|
879
|
+
if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
|
879
880
|
_context4.next = 52;
|
880
881
|
break;
|
881
882
|
}
|
882
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
883
|
+
throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(sso_strategy_id)));
|
883
884
|
case 52:
|
884
|
-
if (!(params['
|
885
|
+
if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
|
885
886
|
_context4.next = 54;
|
886
887
|
break;
|
887
888
|
}
|
888
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
889
|
+
throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(require_2fa)));
|
889
890
|
case 54:
|
890
|
-
if (!(params['
|
891
|
+
if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
|
891
892
|
_context4.next = 56;
|
892
893
|
break;
|
893
894
|
}
|
894
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
895
|
+
throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(time_zone)));
|
895
896
|
case 56:
|
896
|
-
if (!(params['
|
897
|
+
if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
|
897
898
|
_context4.next = 58;
|
898
899
|
break;
|
899
900
|
}
|
900
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
901
|
+
throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(user_root)));
|
901
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:
|
902
909
|
if (params['id']) {
|
903
|
-
_context4.next =
|
910
|
+
_context4.next = 66;
|
904
911
|
break;
|
905
912
|
}
|
906
913
|
if (!_this.attributes.id) {
|
907
|
-
_context4.next =
|
914
|
+
_context4.next = 65;
|
908
915
|
break;
|
909
916
|
}
|
910
917
|
params['id'] = _this.id;
|
911
|
-
_context4.next =
|
918
|
+
_context4.next = 66;
|
912
919
|
break;
|
913
|
-
case
|
920
|
+
case 65:
|
914
921
|
throw new errors.MissingParameterError('Parameter missing: id');
|
915
|
-
case 64:
|
916
|
-
_context4.next = 66;
|
917
|
-
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
918
922
|
case 66:
|
923
|
+
_context4.next = 68;
|
924
|
+
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
925
|
+
case 68:
|
919
926
|
response = _context4.sent;
|
920
927
|
return _context4.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
921
|
-
case
|
928
|
+
case 70:
|
922
929
|
case "end":
|
923
930
|
return _context4.stop();
|
924
931
|
}
|
@@ -1158,6 +1165,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
1158
1165
|
// office_integration_enabled - boolean - Enable integration with Office for the web?
|
1159
1166
|
// password_validity_days - int64 - Number of days to allow user to use the same password
|
1160
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.
|
1161
1169
|
// require_password_change - boolean - Is a password change required upon next user login?
|
1162
1170
|
// restapi_permission - boolean - Can this user access the REST API?
|
1163
1171
|
// self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
|
@@ -1295,48 +1303,54 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
1295
1303
|
}
|
1296
1304
|
throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params['password_validity_days'])));
|
1297
1305
|
case 40:
|
1298
|
-
if (!(params['
|
1306
|
+
if (!(params['require_login_by'] && !(0, _utils.isString)(params['require_login_by']))) {
|
1299
1307
|
_context8.next = 42;
|
1300
1308
|
break;
|
1301
1309
|
}
|
1302
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1310
|
+
throw new errors.InvalidParameterError("Bad parameter: require_login_by must be of type String, received ".concat((0, _utils.getType)(params['require_login_by'])));
|
1303
1311
|
case 42:
|
1304
|
-
if (!(params['
|
1312
|
+
if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
|
1305
1313
|
_context8.next = 44;
|
1306
1314
|
break;
|
1307
1315
|
}
|
1308
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1316
|
+
throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(params['ssl_required'])));
|
1309
1317
|
case 44:
|
1310
|
-
if (!(params['
|
1318
|
+
if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
|
1311
1319
|
_context8.next = 46;
|
1312
1320
|
break;
|
1313
1321
|
}
|
1314
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1322
|
+
throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(params['sso_strategy_id'])));
|
1315
1323
|
case 46:
|
1316
|
-
if (!(params['
|
1324
|
+
if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
|
1317
1325
|
_context8.next = 48;
|
1318
1326
|
break;
|
1319
1327
|
}
|
1320
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1328
|
+
throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(params['require_2fa'])));
|
1321
1329
|
case 48:
|
1322
|
-
if (!(params['
|
1330
|
+
if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
|
1323
1331
|
_context8.next = 50;
|
1324
1332
|
break;
|
1325
1333
|
}
|
1326
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1334
|
+
throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(params['time_zone'])));
|
1327
1335
|
case 50:
|
1328
|
-
if (!(params['
|
1336
|
+
if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
|
1329
1337
|
_context8.next = 52;
|
1330
1338
|
break;
|
1331
1339
|
}
|
1332
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1340
|
+
throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params['user_root'])));
|
1333
1341
|
case 52:
|
1334
|
-
|
1335
|
-
|
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'])));
|
1336
1347
|
case 54:
|
1348
|
+
_context8.next = 56;
|
1349
|
+
return _Api.default.sendRequest("/users", 'POST', params, options);
|
1350
|
+
case 56:
|
1337
1351
|
response = _context8.sent;
|
1338
1352
|
return _context8.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, options));
|
1339
|
-
case
|
1353
|
+
case 58:
|
1340
1354
|
case "end":
|
1341
1355
|
return _context8.stop();
|
1342
1356
|
}
|
package/package.json
CHANGED
package/src/models/PublicKey.js
CHANGED
@@ -47,7 +47,14 @@ class PublicKey {
|
|
47
47
|
this.attributes.fingerprint = value
|
48
48
|
}
|
49
49
|
|
50
|
-
//
|
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 => {
|
package/src/models/User.js
CHANGED
@@ -626,6 +626,7 @@ class User {
|
|
626
626
|
// office_integration_enabled - boolean - Enable integration with Office for the web?
|
627
627
|
// password_validity_days - int64 - Number of days to allow user to use the same password
|
628
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.
|
629
630
|
// require_password_change - boolean - Is a password change required upon next user login?
|
630
631
|
// restapi_permission - boolean - Can this user access the REST API?
|
631
632
|
// self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
|
@@ -709,6 +710,9 @@ class User {
|
|
709
710
|
if (params['password_validity_days'] && !isInt(params['password_validity_days'])) {
|
710
711
|
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(password_validity_days)}`)
|
711
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
|
+
}
|
712
716
|
if (params['ssl_required'] && !isString(params['ssl_required'])) {
|
713
717
|
throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(ssl_required)}`)
|
714
718
|
}
|
@@ -882,6 +886,7 @@ class User {
|
|
882
886
|
// office_integration_enabled - boolean - Enable integration with Office for the web?
|
883
887
|
// password_validity_days - int64 - Number of days to allow user to use the same password
|
884
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.
|
885
890
|
// require_password_change - boolean - Is a password change required upon next user login?
|
886
891
|
// restapi_permission - boolean - Can this user access the REST API?
|
887
892
|
// self_managed - boolean - Does this user manage it's own credentials or is it a shared/bot user?
|
@@ -972,6 +977,10 @@ class User {
|
|
972
977
|
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(params['password_validity_days'])}`)
|
973
978
|
}
|
974
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
|
+
|
975
984
|
if (params['ssl_required'] && !isString(params['ssl_required'])) {
|
976
985
|
throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(params['ssl_required'])}`)
|
977
986
|
}
|