files.com 1.2.279 → 1.2.280
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/UserLifecycleRule.md +7 -0
- package/lib/Files.js +1 -1
- package/lib/models/UserLifecycleRule.js +32 -11
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/UserLifecycleRule.js +17 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.280
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"include_site_admins": true,
|
|
12
12
|
"action": "disable",
|
|
13
13
|
"user_state": "inactive",
|
|
14
|
+
"name": "password specific rules",
|
|
14
15
|
"site_id": 1
|
|
15
16
|
}
|
|
16
17
|
```
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
* `include_site_admins` (boolean): Include site admins in the rule
|
|
23
24
|
* `action` (string): Action to take on inactive users (disable or delete)
|
|
24
25
|
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
|
|
26
|
+
* `name` (string): User Lifecycle Rule name
|
|
25
27
|
* `site_id` (int64): Site ID
|
|
26
28
|
|
|
27
29
|
---
|
|
@@ -62,6 +64,7 @@ await UserLifecycleRule.create({
|
|
|
62
64
|
'include_site_admins': true,
|
|
63
65
|
'include_folder_admins': true,
|
|
64
66
|
'user_state': "inactive",
|
|
67
|
+
'name': "password specific rules",
|
|
65
68
|
})
|
|
66
69
|
```
|
|
67
70
|
|
|
@@ -74,6 +77,7 @@ await UserLifecycleRule.create({
|
|
|
74
77
|
* `include_site_admins` (boolean): Include site admins in the rule
|
|
75
78
|
* `include_folder_admins` (boolean): Include folder admins in the rule
|
|
76
79
|
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
|
|
80
|
+
* `name` (string): User Lifecycle Rule name
|
|
77
81
|
|
|
78
82
|
---
|
|
79
83
|
|
|
@@ -88,6 +92,7 @@ await user_lifecycle_rule.update({
|
|
|
88
92
|
'include_site_admins': true,
|
|
89
93
|
'include_folder_admins': true,
|
|
90
94
|
'user_state': "inactive",
|
|
95
|
+
'name': "password specific rules",
|
|
91
96
|
})
|
|
92
97
|
```
|
|
93
98
|
|
|
@@ -100,6 +105,7 @@ await user_lifecycle_rule.update({
|
|
|
100
105
|
* `include_site_admins` (boolean): Include site admins in the rule
|
|
101
106
|
* `include_folder_admins` (boolean): Include folder admins in the rule
|
|
102
107
|
* `user_state` (string): State of the users to apply the rule to (inactive or disabled)
|
|
108
|
+
* `name` (string): User Lifecycle Rule name
|
|
103
109
|
|
|
104
110
|
### Example Response
|
|
105
111
|
|
|
@@ -112,6 +118,7 @@ await user_lifecycle_rule.update({
|
|
|
112
118
|
"include_site_admins": true,
|
|
113
119
|
"action": "disable",
|
|
114
120
|
"user_state": "inactive",
|
|
121
|
+
"name": "password specific rules",
|
|
115
122
|
"site_id": 1
|
|
116
123
|
}
|
|
117
124
|
```
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.280';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -81,6 +81,13 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
|
|
|
81
81
|
(0, _defineProperty2.default)(this, "setUserState", function (value) {
|
|
82
82
|
_this.attributes.user_state = value;
|
|
83
83
|
});
|
|
84
|
+
// string # User Lifecycle Rule name
|
|
85
|
+
(0, _defineProperty2.default)(this, "getName", function () {
|
|
86
|
+
return _this.attributes.name;
|
|
87
|
+
});
|
|
88
|
+
(0, _defineProperty2.default)(this, "setName", function (value) {
|
|
89
|
+
_this.attributes.name = value;
|
|
90
|
+
});
|
|
84
91
|
// int64 # Site ID
|
|
85
92
|
(0, _defineProperty2.default)(this, "getSiteId", function () {
|
|
86
93
|
return _this.attributes.site_id;
|
|
@@ -95,6 +102,7 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
|
|
|
95
102
|
// include_site_admins - boolean - Include site admins in the rule
|
|
96
103
|
// include_folder_admins - boolean - Include folder admins in the rule
|
|
97
104
|
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
105
|
+
// name - string - User Lifecycle Rule name
|
|
98
106
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
99
107
|
var params,
|
|
100
108
|
response,
|
|
@@ -146,26 +154,32 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
|
|
|
146
154
|
}
|
|
147
155
|
throw new errors.InvalidParameterError("Bad parameter: user_state must be of type String, received ".concat((0, _utils.getType)(params.user_state)));
|
|
148
156
|
case 7:
|
|
157
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
158
|
+
_context.next = 8;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
162
|
+
case 8:
|
|
149
163
|
if (params.id) {
|
|
150
|
-
_context.next =
|
|
164
|
+
_context.next = 10;
|
|
151
165
|
break;
|
|
152
166
|
}
|
|
153
167
|
if (!_this.attributes.id) {
|
|
154
|
-
_context.next =
|
|
168
|
+
_context.next = 9;
|
|
155
169
|
break;
|
|
156
170
|
}
|
|
157
171
|
params.id = _this.id;
|
|
158
|
-
_context.next =
|
|
172
|
+
_context.next = 10;
|
|
159
173
|
break;
|
|
160
|
-
case 8:
|
|
161
|
-
throw new errors.MissingParameterError('Parameter missing: id');
|
|
162
174
|
case 9:
|
|
163
|
-
|
|
164
|
-
return _Api.default.sendRequest("/user_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
175
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
|
165
176
|
case 10:
|
|
177
|
+
_context.next = 11;
|
|
178
|
+
return _Api.default.sendRequest("/user_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
179
|
+
case 11:
|
|
166
180
|
response = _context.sent;
|
|
167
181
|
return _context.abrupt("return", new UserLifecycleRule(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
168
|
-
case
|
|
182
|
+
case 12:
|
|
169
183
|
case "end":
|
|
170
184
|
return _context.stop();
|
|
171
185
|
}
|
|
@@ -368,6 +382,7 @@ _UserLifecycleRule = UserLifecycleRule;
|
|
|
368
382
|
// include_site_admins - boolean - Include site admins in the rule
|
|
369
383
|
// include_folder_admins - boolean - Include folder admins in the rule
|
|
370
384
|
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
385
|
+
// name - string - User Lifecycle Rule name
|
|
371
386
|
(0, _defineProperty2.default)(UserLifecycleRule, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
372
387
|
var params,
|
|
373
388
|
options,
|
|
@@ -402,12 +417,18 @@ _UserLifecycleRule = UserLifecycleRule;
|
|
|
402
417
|
}
|
|
403
418
|
throw new errors.InvalidParameterError("Bad parameter: user_state must be of type String, received ".concat((0, _utils.getType)(params.user_state)));
|
|
404
419
|
case 4:
|
|
405
|
-
|
|
406
|
-
|
|
420
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
421
|
+
_context6.next = 5;
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
407
425
|
case 5:
|
|
426
|
+
_context6.next = 6;
|
|
427
|
+
return _Api.default.sendRequest('/user_lifecycle_rules', 'POST', params, options);
|
|
428
|
+
case 6:
|
|
408
429
|
response = _context6.sent;
|
|
409
430
|
return _context6.abrupt("return", new _UserLifecycleRule(response === null || response === void 0 ? void 0 : response.data, options));
|
|
410
|
-
case
|
|
431
|
+
case 7:
|
|
411
432
|
case "end":
|
|
412
433
|
return _context6.stop();
|
|
413
434
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -77,6 +77,13 @@ class UserLifecycleRule {
|
|
|
77
77
|
this.attributes.user_state = value
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// string # User Lifecycle Rule name
|
|
81
|
+
getName = () => this.attributes.name
|
|
82
|
+
|
|
83
|
+
setName = value => {
|
|
84
|
+
this.attributes.name = value
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
// int64 # Site ID
|
|
81
88
|
getSiteId = () => this.attributes.site_id
|
|
82
89
|
|
|
@@ -91,6 +98,7 @@ class UserLifecycleRule {
|
|
|
91
98
|
// include_site_admins - boolean - Include site admins in the rule
|
|
92
99
|
// include_folder_admins - boolean - Include folder admins in the rule
|
|
93
100
|
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
101
|
+
// name - string - User Lifecycle Rule name
|
|
94
102
|
update = async (params = {}) => {
|
|
95
103
|
if (!this.attributes.id) {
|
|
96
104
|
throw new errors.EmptyPropertyError('Current object has no id')
|
|
@@ -121,6 +129,10 @@ class UserLifecycleRule {
|
|
|
121
129
|
throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
|
|
122
130
|
}
|
|
123
131
|
|
|
132
|
+
if (params.name && !isString(params.name)) {
|
|
133
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
if (!params.id) {
|
|
125
137
|
if (this.attributes.id) {
|
|
126
138
|
params.id = this.id
|
|
@@ -226,6 +238,7 @@ class UserLifecycleRule {
|
|
|
226
238
|
// include_site_admins - boolean - Include site admins in the rule
|
|
227
239
|
// include_folder_admins - boolean - Include folder admins in the rule
|
|
228
240
|
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
241
|
+
// name - string - User Lifecycle Rule name
|
|
229
242
|
static create = async (params = {}, options = {}) => {
|
|
230
243
|
if (params.action && !isString(params.action)) {
|
|
231
244
|
throw new errors.InvalidParameterError(`Bad parameter: action must be of type String, received ${getType(params.action)}`)
|
|
@@ -243,6 +256,10 @@ class UserLifecycleRule {
|
|
|
243
256
|
throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
|
|
244
257
|
}
|
|
245
258
|
|
|
259
|
+
if (params.name && !isString(params.name)) {
|
|
260
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
261
|
+
}
|
|
262
|
+
|
|
246
263
|
const response = await Api.sendRequest('/user_lifecycle_rules', 'POST', params, options)
|
|
247
264
|
|
|
248
265
|
return new UserLifecycleRule(response?.data, options)
|