Skip to content

Commit 1f333e5

Browse files
[Bot] push changes from Files.com
1 parent a4fd5b2 commit 1f333e5

File tree

13 files changed

+216
-43
lines changed

13 files changed

+216
-43
lines changed

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.587
1+
1.2.588

docs/models/KeyLifecycleRule.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
"id": 1,
88
"key_type": "gpg",
99
"inactivity_days": 12,
10-
"name": "inactive gpg keys"
10+
"apply_to_all_workspaces": true,
11+
"name": "inactive gpg keys",
12+
"workspace_id": 12
1113
}
1214
```
1315

1416
* `id` (int64): Key Lifecycle Rule ID
1517
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
1618
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
19+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
1720
* `name` (string): Key Lifecycle Rule name
21+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
1822

1923
---
2024

@@ -29,8 +33,8 @@ await KeyLifecycleRule.list
2933

3034
* `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
3135
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
32-
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `key_type`.
33-
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `key_type`.
36+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `key_type`.
37+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
3438

3539
---
3640

@@ -51,18 +55,22 @@ await KeyLifecycleRule.find(id)
5155

5256
```
5357
await KeyLifecycleRule.create({
58+
'apply_to_all_workspaces': true,
5459
'key_type': "gpg",
5560
'inactivity_days': 12,
5661
'name': "inactive gpg keys",
62+
'workspace_id': 12,
5763
})
5864
```
5965

6066

6167
### Parameters
6268

69+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
6370
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
6471
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
6572
* `name` (string): Key Lifecycle Rule name
73+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
6674

6775
---
6876

@@ -72,18 +80,22 @@ await KeyLifecycleRule.create({
7280
const key_lifecycle_rule = await KeyLifecycleRule.find(id)
7381
7482
await key_lifecycle_rule.update({
83+
'apply_to_all_workspaces': true,
7584
'key_type': "gpg",
7685
'inactivity_days': 12,
7786
'name': "inactive gpg keys",
87+
'workspace_id': 12,
7888
})
7989
```
8090

8191
### Parameters
8292

8393
* `id` (int64): Required - Key Lifecycle Rule ID.
94+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to keys in all workspaces.
8495
* `key_type` (string): Key type for which the rule will apply (gpg or ssh).
8596
* `inactivity_days` (int64): Number of days of inactivity before the rule applies.
8697
* `name` (string): Key Lifecycle Rule name
98+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
8799

88100
### Example Response
89101

@@ -92,7 +104,9 @@ await key_lifecycle_rule.update({
92104
"id": 1,
93105
"key_type": "gpg",
94106
"inactivity_days": 12,
95-
"name": "inactive gpg keys"
107+
"apply_to_all_workspaces": true,
108+
"name": "inactive gpg keys",
109+
"workspace_id": 12
96110
}
97111
```
98112

docs/models/Restore.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"two_factor_authentication_methods_restored": 1,
2525
"status": "pending",
2626
"update_timestamps": true,
27+
"workspace_id": 12,
2728
"error_messages": [
2829
"example"
2930
]
@@ -50,6 +51,7 @@
5051
* `two_factor_authentication_methods_restored` (int64): Number of two factor authentication methods restored (only present for `restoration_type=users`).
5152
* `status` (string): Status of the restoration process.
5253
* `update_timestamps` (boolean): If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
54+
* `workspace_id` (int64): Workspace ID for a workspace-scoped restore. `0` means the default site-wide scope.
5355
* `error_messages` (array(string)): Error messages received while restoring files and/or directories. Only present if there were errors.
5456

5557
---
@@ -65,7 +67,7 @@ await Restore.list
6567

6668
* `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
6769
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
68-
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
70+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`.
6971
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `restoration_type`.
7072

7173
---
@@ -80,6 +82,7 @@ await Restore.create({
8082
'restore_deleted_permissions': true,
8183
'restore_in_place': true,
8284
'update_timestamps': true,
85+
'workspace_id': 12,
8386
})
8487
```
8588

@@ -92,3 +95,4 @@ await Restore.create({
9295
* `restore_deleted_permissions` (boolean): If true, we will also restore any Permissions that match the same path prefix from the same dates.
9396
* `restore_in_place` (boolean): If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
9497
* `update_timestamps` (boolean): If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
98+
* `workspace_id` (int64): Workspace ID for a workspace-scoped restore. `0` means the default site-wide scope.

docs/models/UserLifecycleRule.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
"inactivity_days": 12,
1616
"include_folder_admins": true,
1717
"include_site_admins": true,
18+
"apply_to_all_workspaces": true,
1819
"name": "password specific rules",
1920
"partner_tag": "guest",
2021
"site_id": 1,
22+
"workspace_id": 12,
2123
"user_state": "inactive",
2224
"user_tag": "guest"
2325
}
@@ -30,9 +32,11 @@
3032
* `inactivity_days` (int64): Number of days of inactivity before the rule applies
3133
* `include_folder_admins` (boolean): If true, the rule will apply to folder admins.
3234
* `include_site_admins` (boolean): If true, the rule will apply to site admins.
35+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to users in all workspaces.
3336
* `name` (string): User Lifecycle Rule name
3437
* `partner_tag` (string): If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
3538
* `site_id` (int64): Site ID
39+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
3640
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
3741
* `user_tag` (string): If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
3842

@@ -49,7 +53,8 @@ await UserLifecycleRule.list
4953

5054
* `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
5155
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
52-
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`.
56+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id` and `workspace_id`.
57+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
5358

5459
---
5560

@@ -70,6 +75,7 @@ await UserLifecycleRule.find(id)
7075

7176
```
7277
await UserLifecycleRule.create({
78+
'apply_to_all_workspaces': true,
7379
'authentication_method': "password",
7480
'group_ids': [1,2,3],
7581
'inactivity_days': 12,
@@ -79,13 +85,15 @@ await UserLifecycleRule.create({
7985
'partner_tag': "guest",
8086
'user_state': "inactive",
8187
'user_tag': "guest",
88+
'workspace_id': 12,
8289
})
8390
```
8491

8592

8693
### Parameters
8794

8895
* `action` (string): Action to take on inactive users (disable or delete)
96+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to users in all workspaces.
8997
* `authentication_method` (string): User authentication method for which the rule will apply.
9098
* `group_ids` (array(int64)): Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
9199
* `inactivity_days` (int64): Number of days of inactivity before the rule applies
@@ -95,6 +103,7 @@ await UserLifecycleRule.create({
95103
* `partner_tag` (string): If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
96104
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
97105
* `user_tag` (string): If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
106+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
98107

99108
---
100109

@@ -104,6 +113,7 @@ await UserLifecycleRule.create({
104113
const user_lifecycle_rule = await UserLifecycleRule.find(id)
105114
106115
await user_lifecycle_rule.update({
116+
'apply_to_all_workspaces': true,
107117
'authentication_method': "password",
108118
'group_ids': [1,2,3],
109119
'inactivity_days': 12,
@@ -113,13 +123,15 @@ await user_lifecycle_rule.update({
113123
'partner_tag': "guest",
114124
'user_state': "inactive",
115125
'user_tag': "guest",
126+
'workspace_id': 12,
116127
})
117128
```
118129

119130
### Parameters
120131

121132
* `id` (int64): Required - User Lifecycle Rule ID.
122133
* `action` (string): Action to take on inactive users (disable or delete)
134+
* `apply_to_all_workspaces` (boolean): If true, a default-workspace rule also applies to users in all workspaces.
123135
* `authentication_method` (string): User authentication method for which the rule will apply.
124136
* `group_ids` (array(int64)): Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
125137
* `inactivity_days` (int64): Number of days of inactivity before the rule applies
@@ -129,6 +141,7 @@ await user_lifecycle_rule.update({
129141
* `partner_tag` (string): If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
130142
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
131143
* `user_tag` (string): If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
144+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
132145

133146
### Example Response
134147

@@ -145,9 +158,11 @@ await user_lifecycle_rule.update({
145158
"inactivity_days": 12,
146159
"include_folder_admins": true,
147160
"include_site_admins": true,
161+
"apply_to_all_workspaces": true,
148162
"name": "password specific rules",
149163
"partner_tag": "guest",
150164
"site_id": 1,
165+
"workspace_id": 12,
151166
"user_state": "inactive",
152167
"user_tag": "guest"
153168
}

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.587';
15+
var version = '1.2.588';
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: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,33 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
5353
(0, _defineProperty2.default)(this, "setInactivityDays", function (value) {
5454
_this.attributes.inactivity_days = value;
5555
});
56+
// boolean # If true, a default-workspace rule also applies to keys in all workspaces.
57+
(0, _defineProperty2.default)(this, "getApplyToAllWorkspaces", function () {
58+
return _this.attributes.apply_to_all_workspaces;
59+
});
60+
(0, _defineProperty2.default)(this, "setApplyToAllWorkspaces", function (value) {
61+
_this.attributes.apply_to_all_workspaces = value;
62+
});
5663
// string # Key Lifecycle Rule name
5764
(0, _defineProperty2.default)(this, "getName", function () {
5865
return _this.attributes.name;
5966
});
6067
(0, _defineProperty2.default)(this, "setName", function (value) {
6168
_this.attributes.name = value;
6269
});
70+
// int64 # Workspace ID. `0` means the default workspace.
71+
(0, _defineProperty2.default)(this, "getWorkspaceId", function () {
72+
return _this.attributes.workspace_id;
73+
});
74+
(0, _defineProperty2.default)(this, "setWorkspaceId", function (value) {
75+
_this.attributes.workspace_id = value;
76+
});
6377
// Parameters:
78+
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
6479
// key_type - string - Key type for which the rule will apply (gpg or ssh).
6580
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
6681
// name - string - Key Lifecycle Rule name
82+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
6783
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
6884
var params,
6985
response,
@@ -109,26 +125,32 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
109125
}
110126
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
111127
case 6:
128+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
129+
_context.next = 7;
130+
break;
131+
}
132+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
133+
case 7:
112134
if (params.id) {
113-
_context.next = 8;
135+
_context.next = 9;
114136
break;
115137
}
116138
if (!_this.attributes.id) {
117-
_context.next = 7;
139+
_context.next = 8;
118140
break;
119141
}
120142
params.id = _this.id;
121-
_context.next = 8;
143+
_context.next = 9;
122144
break;
123-
case 7:
124-
throw new errors.MissingParameterError('Parameter missing: id');
125145
case 8:
126-
_context.next = 9;
127-
return _Api.default.sendRequest("/key_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
146+
throw new errors.MissingParameterError('Parameter missing: id');
128147
case 9:
148+
_context.next = 10;
149+
return _Api.default.sendRequest("/key_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
150+
case 10:
129151
response = _context.sent;
130152
return _context.abrupt("return", new KeyLifecycleRule(response === null || response === void 0 ? void 0 : response.data, _this.options));
131-
case 10:
153+
case 11:
132154
case "end":
133155
return _context.stop();
134156
}
@@ -231,8 +253,8 @@ _KeyLifecycleRule = KeyLifecycleRule;
231253
// Parameters:
232254
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
233255
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
234-
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `key_type`.
235-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `key_type`.
256+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `key_type`.
257+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`.
236258
(0, _defineProperty2.default)(KeyLifecycleRule, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
237259
var _response$data;
238260
var params,
@@ -327,9 +349,11 @@ _KeyLifecycleRule = KeyLifecycleRule;
327349
return _KeyLifecycleRule.find(id, params, options);
328350
});
329351
// Parameters:
352+
// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
330353
// key_type - string - Key type for which the rule will apply (gpg or ssh).
331354
// inactivity_days - int64 - Number of days of inactivity before the rule applies.
332355
// name - string - Key Lifecycle Rule name
356+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
333357
(0, _defineProperty2.default)(KeyLifecycleRule, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
334358
var params,
335359
options,
@@ -358,12 +382,18 @@ _KeyLifecycleRule = KeyLifecycleRule;
358382
}
359383
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
360384
case 3:
361-
_context6.next = 4;
362-
return _Api.default.sendRequest('/key_lifecycle_rules', 'POST', params, options);
385+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
386+
_context6.next = 4;
387+
break;
388+
}
389+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
363390
case 4:
391+
_context6.next = 5;
392+
return _Api.default.sendRequest('/key_lifecycle_rules', 'POST', params, options);
393+
case 5:
364394
response = _context6.sent;
365395
return _context6.abrupt("return", new _KeyLifecycleRule(response === null || response === void 0 ? void 0 : response.data, options));
366-
case 5:
396+
case 6:
367397
case "end":
368398
return _context6.stop();
369399
}

0 commit comments

Comments
 (0)