files.com 1.2.279 → 1.2.281
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/BundleAction.md +10 -2
- package/docs/models/UserLifecycleRule.md +7 -0
- package/lib/Files.js +1 -1
- package/lib/models/BundleAction.js +17 -1
- package/lib/models/UserLifecycleRule.js +32 -11
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/BundleAction.js +13 -1
- package/src/models/UserLifecycleRule.js +17 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.281
|
|
@@ -25,7 +25,11 @@
|
|
|
25
25
|
"created_at": "2000-01-01T01:00:00Z",
|
|
26
26
|
"destination": "/to_path",
|
|
27
27
|
"path": "",
|
|
28
|
-
"source": "/from_path"
|
|
28
|
+
"source": "/from_path",
|
|
29
|
+
"bundle_registration_id": 1,
|
|
30
|
+
"bundle_registration_name": "John Doe",
|
|
31
|
+
"bundle_registration_email": "john@example.com",
|
|
32
|
+
"bundle_registration_ip": "127.0.0.1"
|
|
29
33
|
}
|
|
30
34
|
```
|
|
31
35
|
|
|
@@ -35,6 +39,10 @@
|
|
|
35
39
|
* `destination` (string): The destination path for this bundle action, if applicable
|
|
36
40
|
* `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
37
41
|
* `source` (string): The source path for this bundle action, if applicable
|
|
42
|
+
* `bundle_registration_id` (int64): Identifier of the associated bundle registration
|
|
43
|
+
* `bundle_registration_name` (string): Name of the registrant who performed the action
|
|
44
|
+
* `bundle_registration_email` (string): Email of the registrant
|
|
45
|
+
* `bundle_registration_ip` (string): IP address of the registrant
|
|
38
46
|
|
|
39
47
|
---
|
|
40
48
|
|
|
@@ -52,7 +60,7 @@ await BundleAction.list({
|
|
|
52
60
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
53
61
|
* `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.
|
|
54
62
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
55
|
-
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
63
|
+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `bundle_registration_id`.
|
|
56
64
|
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`.
|
|
57
65
|
* `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
58
66
|
* `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
@@ -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.281';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -56,6 +56,22 @@ var BundleAction = /*#__PURE__*/(0, _createClass2.default)(function BundleAction
|
|
|
56
56
|
(0, _defineProperty2.default)(this, "getSource", function () {
|
|
57
57
|
return _this.attributes.source;
|
|
58
58
|
});
|
|
59
|
+
// int64 # Identifier of the associated bundle registration
|
|
60
|
+
(0, _defineProperty2.default)(this, "getBundleRegistrationId", function () {
|
|
61
|
+
return _this.attributes.bundle_registration_id;
|
|
62
|
+
});
|
|
63
|
+
// string # Name of the registrant who performed the action
|
|
64
|
+
(0, _defineProperty2.default)(this, "getBundleRegistrationName", function () {
|
|
65
|
+
return _this.attributes.bundle_registration_name;
|
|
66
|
+
});
|
|
67
|
+
// string # Email of the registrant
|
|
68
|
+
(0, _defineProperty2.default)(this, "getBundleRegistrationEmail", function () {
|
|
69
|
+
return _this.attributes.bundle_registration_email;
|
|
70
|
+
});
|
|
71
|
+
// string # IP address of the registrant
|
|
72
|
+
(0, _defineProperty2.default)(this, "getBundleRegistrationIp", function () {
|
|
73
|
+
return _this.attributes.bundle_registration_ip;
|
|
74
|
+
});
|
|
59
75
|
Object.entries(attributes).forEach(function (_ref) {
|
|
60
76
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
61
77
|
key = _ref2[0],
|
|
@@ -74,7 +90,7 @@ _BundleAction = BundleAction;
|
|
|
74
90
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
75
91
|
// 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.
|
|
76
92
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
77
|
-
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
93
|
+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `bundle_registration_id`.
|
|
78
94
|
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`.
|
|
79
95
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
80
96
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
@@ -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
|
@@ -46,11 +46,23 @@ class BundleAction {
|
|
|
46
46
|
// string # The source path for this bundle action, if applicable
|
|
47
47
|
getSource = () => this.attributes.source
|
|
48
48
|
|
|
49
|
+
// int64 # Identifier of the associated bundle registration
|
|
50
|
+
getBundleRegistrationId = () => this.attributes.bundle_registration_id
|
|
51
|
+
|
|
52
|
+
// string # Name of the registrant who performed the action
|
|
53
|
+
getBundleRegistrationName = () => this.attributes.bundle_registration_name
|
|
54
|
+
|
|
55
|
+
// string # Email of the registrant
|
|
56
|
+
getBundleRegistrationEmail = () => this.attributes.bundle_registration_email
|
|
57
|
+
|
|
58
|
+
// string # IP address of the registrant
|
|
59
|
+
getBundleRegistrationIp = () => this.attributes.bundle_registration_ip
|
|
60
|
+
|
|
49
61
|
// Parameters:
|
|
50
62
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
51
63
|
// 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.
|
|
52
64
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
53
|
-
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
65
|
+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at` and `bundle_registration_id`.
|
|
54
66
|
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`.
|
|
55
67
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
56
68
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
@@ -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)
|