Skip to content

Commit c298b15

Browse files
[Bot] push changes from Files.com
1 parent 22572e8 commit c298b15

10 files changed

Lines changed: 110 additions & 31 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.619
1+
1.2.620

docs/models/KeyLifecycleRule.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"id": 1,
88
"key_type": "gpg",
99
"inactivity_days": 12,
10+
"expiration_days": 365,
1011
"apply_to_all_workspaces": true,
1112
"name": "inactive gpg keys",
1213
"workspace_id": 12
@@ -16,6 +17,7 @@
1617
* `id` (int64): Key Lifecycle Rule ID
1718
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
1819
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
20+
* `expiration_days` (int64): Number of days after creation before an SSH key expires. Applies only to SSH keys.
1921
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
2022
* `name` (string): Key Lifecycle Rule name
2123
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
@@ -56,6 +58,7 @@ await KeyLifecycleRule.find(id)
5658
```
5759
await KeyLifecycleRule.create({
5860
'apply_to_all_workspaces': true,
61+
'expiration_days': 365,
5962
'key_type': "gpg",
6063
'inactivity_days': 12,
6164
'name': "inactive gpg keys",
@@ -67,6 +70,7 @@ await KeyLifecycleRule.create({
6770
### Parameters
6871

6972
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
73+
* `expiration_days` (int64): Number of days after creation before an SSH key expires. Applies only to SSH keys.
7074
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
7175
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
7276
* `name` (string): Key Lifecycle Rule name
@@ -81,6 +85,7 @@ const key_lifecycle_rule = await KeyLifecycleRule.find(id)
8185
8286
await key_lifecycle_rule.update({
8387
'apply_to_all_workspaces': true,
88+
'expiration_days': 365,
8489
'key_type': "gpg",
8590
'inactivity_days': 12,
8691
'name': "inactive gpg keys",
@@ -92,6 +97,7 @@ await key_lifecycle_rule.update({
9297

9398
* `id` (int64): Required - Key Lifecycle Rule ID.
9499
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
100+
* `expiration_days` (int64): Number of days after creation before an SSH key expires. Applies only to SSH keys.
95101
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
96102
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
97103
* `name` (string): Key Lifecycle Rule name
@@ -104,6 +110,7 @@ await key_lifecycle_rule.update({
104110
"id": 1,
105111
"key_type": "gpg",
106112
"inactivity_days": 12,
113+
"expiration_days": 365,
107114
"apply_to_all_workspaces": true,
108115
"name": "inactive gpg keys",
109116
"workspace_id": 12

docs/models/PublicKey.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"workspace_id": 1,
99
"title": "My public key",
1010
"created_at": "2000-01-01T01:00:00Z",
11+
"expires_at": "2000-01-01T01:00:00Z",
12+
"expired": true,
1113
"fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
1214
"fingerprint_sha256": "V5Q5t/ghT3R8Tol5GX9385bzmpygWVRnLuI9EXNrjCX",
1315
"status": "complete",
@@ -23,6 +25,8 @@
2325
* `workspace_id` (int64): Workspace ID (0 for default workspace).
2426
* `title` (string): Public key title
2527
* `created_at` (date-time): Public key created at date/time
28+
* `expires_at` (date-time): Public key expiration date/time
29+
* `expired` (boolean): Is this public key expired?
2630
* `fingerprint` (string): Public key fingerprint (MD5)
2731
* `fingerprint_sha256` (string): Public key fingerprint (SHA256)
2832
* `status` (string): Only returned when generating keys. Can be invalid, not_generated, generating, complete
@@ -124,6 +128,8 @@ await public_key.update({
124128
"workspace_id": 1,
125129
"title": "My public key",
126130
"created_at": "2000-01-01T01:00:00Z",
131+
"expires_at": "2000-01-01T01:00:00Z",
132+
"expired": true,
127133
"fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
128134
"fingerprint_sha256": "V5Q5t/ghT3R8Tol5GX9385bzmpygWVRnLuI9EXNrjCX",
129135
"status": "complete",

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var apiKey;
1212
var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
1414
var language = null;
15-
var version = '1.2.619';
15+
var version = '1.2.620';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/KeyLifecycleRule.js

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
5353
(0, _defineProperty2.default)(this, "setInactivityDays", function (value) {
5454
_this.attributes.inactivity_days = value;
5555
});
56+
// int64 # Number of days after creation before an SSH key expires. Applies only to SSH keys.
57+
(0, _defineProperty2.default)(this, "getExpirationDays", function () {
58+
return _this.attributes.expiration_days;
59+
});
60+
(0, _defineProperty2.default)(this, "setExpirationDays", function (value) {
61+
_this.attributes.expiration_days = value;
62+
});
5663
// boolean # If true, a default-workspace rule also applies to keys in all workspaces.
5764
(0, _defineProperty2.default)(this, "getApplyToAllWorkspaces", function () {
5865
return _this.attributes.apply_to_all_workspaces;
@@ -76,6 +83,7 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
7683
});
7784
// Parameters:
7885
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
86+
// expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
7987
// key_type - string - Key type for which the rule will apply (gpg or ssh).
8088
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
8189
// name - string - Key Lifecycle Rule name
@@ -107,50 +115,56 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
107115
}
108116
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
109117
case 3:
110-
if (!(params.key_type && !(0, _utils.isString)(params.key_type))) {
118+
if (!(params.expiration_days && !(0, _utils.isInt)(params.expiration_days))) {
111119
_context.next = 4;
112120
break;
113121
}
114-
throw new errors.InvalidParameterError("Bad parameter: key_type must be of type String, received ".concat((0, _utils.getType)(params.key_type)));
122+
throw new errors.InvalidParameterError("Bad parameter: expiration_days must be of type Int, received ".concat((0, _utils.getType)(params.expiration_days)));
115123
case 4:
116-
if (!(params.inactivity_days && !(0, _utils.isInt)(params.inactivity_days))) {
124+
if (!(params.key_type && !(0, _utils.isString)(params.key_type))) {
117125
_context.next = 5;
118126
break;
119127
}
120-
throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
128+
throw new errors.InvalidParameterError("Bad parameter: key_type must be of type String, received ".concat((0, _utils.getType)(params.key_type)));
121129
case 5:
122-
if (!(params.name && !(0, _utils.isString)(params.name))) {
130+
if (!(params.inactivity_days && !(0, _utils.isInt)(params.inactivity_days))) {
123131
_context.next = 6;
124132
break;
125133
}
126-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
134+
throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
127135
case 6:
128-
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
136+
if (!(params.name && !(0, _utils.isString)(params.name))) {
129137
_context.next = 7;
130138
break;
131139
}
132-
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
140+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
133141
case 7:
142+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
143+
_context.next = 8;
144+
break;
145+
}
146+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
147+
case 8:
134148
if (params.id) {
135-
_context.next = 9;
149+
_context.next = 10;
136150
break;
137151
}
138152
if (!_this.attributes.id) {
139-
_context.next = 8;
153+
_context.next = 9;
140154
break;
141155
}
142156
params.id = _this.id;
143-
_context.next = 9;
157+
_context.next = 10;
144158
break;
145-
case 8:
146-
throw new errors.MissingParameterError('Parameter missing: id');
147159
case 9:
148-
_context.next = 10;
149-
return _Api.default.sendRequest("/key_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
160+
throw new errors.MissingParameterError('Parameter missing: id');
150161
case 10:
162+
_context.next = 11;
163+
return _Api.default.sendRequest("/key_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
164+
case 11:
151165
response = _context.sent;
152166
return _context.abrupt("return", new KeyLifecycleRule(response === null || response === void 0 ? void 0 : response.data, _this.options));
153-
case 11:
167+
case 12:
154168
case "end":
155169
return _context.stop();
156170
}
@@ -350,6 +364,7 @@ _KeyLifecycleRule = KeyLifecycleRule;
350364
});
351365
// Parameters:
352366
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
367+
// expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
353368
// key_type - string - Key type for which the rule will apply (gpg or ssh).
354369
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
355370
// name - string - Key Lifecycle Rule name
@@ -364,36 +379,42 @@ _KeyLifecycleRule = KeyLifecycleRule;
364379
case 0:
365380
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
366381
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
367-
if (!(params.key_type && !(0, _utils.isString)(params.key_type))) {
382+
if (!(params.expiration_days && !(0, _utils.isInt)(params.expiration_days))) {
368383
_context6.next = 1;
369384
break;
370385
}
371-
throw new errors.InvalidParameterError("Bad parameter: key_type must be of type String, received ".concat((0, _utils.getType)(params.key_type)));
386+
throw new errors.InvalidParameterError("Bad parameter: expiration_days must be of type Int, received ".concat((0, _utils.getType)(params.expiration_days)));
372387
case 1:
373-
if (!(params.inactivity_days && !(0, _utils.isInt)(params.inactivity_days))) {
388+
if (!(params.key_type && !(0, _utils.isString)(params.key_type))) {
374389
_context6.next = 2;
375390
break;
376391
}
377-
throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
392+
throw new errors.InvalidParameterError("Bad parameter: key_type must be of type String, received ".concat((0, _utils.getType)(params.key_type)));
378393
case 2:
379-
if (!(params.name && !(0, _utils.isString)(params.name))) {
394+
if (!(params.inactivity_days && !(0, _utils.isInt)(params.inactivity_days))) {
380395
_context6.next = 3;
381396
break;
382397
}
383-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
398+
throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
384399
case 3:
385-
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
400+
if (!(params.name && !(0, _utils.isString)(params.name))) {
386401
_context6.next = 4;
387402
break;
388403
}
389-
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
404+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
390405
case 4:
391-
_context6.next = 5;
392-
return _Api.default.sendRequest('/key_lifecycle_rules', 'POST', params, options);
406+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
407+
_context6.next = 5;
408+
break;
409+
}
410+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
393411
case 5:
412+
_context6.next = 6;
413+
return _Api.default.sendRequest('/key_lifecycle_rules', 'POST', params, options);
414+
case 6:
394415
response = _context6.sent;
395416
return _context6.abrupt("return", new _KeyLifecycleRule(response === null || response === void 0 ? void 0 : response.data, options));
396-
case 6:
417+
case 7:
397418
case "end":
398419
return _context6.stop();
399420
}

lib/models/PublicKey.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
5757
(0, _defineProperty2.default)(this, "getCreatedAt", function () {
5858
return _this.attributes.created_at;
5959
});
60+
// date-time # Public key expiration date/time
61+
(0, _defineProperty2.default)(this, "getExpiresAt", function () {
62+
return _this.attributes.expires_at;
63+
});
64+
(0, _defineProperty2.default)(this, "setExpiresAt", function (value) {
65+
_this.attributes.expires_at = value;
66+
});
67+
// boolean # Is this public key expired?
68+
(0, _defineProperty2.default)(this, "getExpired", function () {
69+
return _this.attributes.expired;
70+
});
71+
(0, _defineProperty2.default)(this, "setExpired", function (value) {
72+
_this.attributes.expired = value;
73+
});
6074
// string # Public key fingerprint (MD5)
6175
(0, _defineProperty2.default)(this, "getFingerprint", function () {
6276
return _this.attributes.fingerprint;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "files.com",
3-
"version": "1.2.619",
3+
"version": "1.2.620",
44
"description": "Files.com SDK for JavaScript",
55
"keywords": [
66
"files.com",

src/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let apiKey
66
let baseUrl = 'https://app.files.com'
77
let sessionId = null
88
let language = null
9-
const version = '1.2.619'
9+
const version = '1.2.620'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/KeyLifecycleRule.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ class KeyLifecycleRule {
4949
this.attributes.inactivity_days = value
5050
}
5151

52+
// int64 # Number of days after creation before an SSH key expires. Applies only to SSH keys.
53+
getExpirationDays = () => this.attributes.expiration_days
54+
55+
setExpirationDays = value => {
56+
this.attributes.expiration_days = value
57+
}
58+
5259
// boolean # If true, a default-workspace rule also applies to keys in all workspaces.
5360
getApplyToAllWorkspaces = () => this.attributes.apply_to_all_workspaces
5461

@@ -72,6 +79,7 @@ class KeyLifecycleRule {
7279

7380
// Parameters:
7481
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
82+
// expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
7583
// key_type - string - Key type for which the rule will apply (gpg or ssh).
7684
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
7785
// name - string - Key Lifecycle Rule name
@@ -90,6 +98,10 @@ class KeyLifecycleRule {
9098
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
9199
}
92100

101+
if (params.expiration_days && !isInt(params.expiration_days)) {
102+
throw new errors.InvalidParameterError(`Bad parameter: expiration_days must be of type Int, received ${getType(params.expiration_days)}`)
103+
}
104+
93105
if (params.key_type && !isString(params.key_type)) {
94106
throw new errors.InvalidParameterError(`Bad parameter: key_type must be of type String, received ${getType(params.key_type)}`)
95107
}
@@ -208,11 +220,16 @@ class KeyLifecycleRule {
208220

209221
// Parameters:
210222
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
223+
// expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
211224
// key_type - string - Key type for which the rule will apply (gpg or ssh).
212225
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
213226
// name - string - Key Lifecycle Rule name
214227
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
215228
static create = async (params = {}, options = {}) => {
229+
if (params.expiration_days && !isInt(params.expiration_days)) {
230+
throw new errors.InvalidParameterError(`Bad parameter: expiration_days must be of type Int, received ${getType(params.expiration_days)}`)
231+
}
232+
216233
if (params.key_type && !isString(params.key_type)) {
217234
throw new errors.InvalidParameterError(`Bad parameter: key_type must be of type String, received ${getType(params.key_type)}`)
218235
}

src/models/PublicKey.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ class PublicKey {
5252
// date-time # Public key created at date/time
5353
getCreatedAt = () => this.attributes.created_at
5454

55+
// date-time # Public key expiration date/time
56+
getExpiresAt = () => this.attributes.expires_at
57+
58+
setExpiresAt = value => {
59+
this.attributes.expires_at = value
60+
}
61+
62+
// boolean # Is this public key expired?
63+
getExpired = () => this.attributes.expired
64+
65+
setExpired = value => {
66+
this.attributes.expired = value
67+
}
68+
5569
// string # Public key fingerprint (MD5)
5670
getFingerprint = () => this.attributes.fingerprint
5771

0 commit comments

Comments
 (0)