files.com 1.2.250 → 1.2.252
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/ApiRequestLog.md +3 -1
- package/docs/models/Site.md +2 -1
- package/docs/models/User.md +4 -1
- package/lib/Files.js +1 -1
- package/lib/models/ApiRequestLog.js +4 -0
- package/lib/models/User.js +15 -7
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ApiRequestLog.js +3 -0
- package/src/models/User.js +6 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.252
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"error_message": "example",
|
|
23
23
|
"response_code": 1,
|
|
24
24
|
"success": true,
|
|
25
|
-
"duration_ms": 1
|
|
25
|
+
"duration_ms": 1,
|
|
26
|
+
"impersonator_user_id": 1
|
|
26
27
|
}
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
* `response_code` (int64): HTTP Response Code
|
|
46
47
|
* `success` (boolean): `false` if HTTP Response Code is 4xx or 5xx
|
|
47
48
|
* `duration_ms` (int64): Duration (in milliseconds)
|
|
49
|
+
* `impersonator_user_id` (int64): User ID of Site Admin user impersonating this user via a Read-Only session.
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
package/docs/models/Site.md
CHANGED
|
@@ -184,7 +184,8 @@
|
|
|
184
184
|
"legacy_checksums_mode": true,
|
|
185
185
|
"use_provided_modified_at": true,
|
|
186
186
|
"windows_mode_ftp": false,
|
|
187
|
-
"user_belongs_to_parent_site": false
|
|
187
|
+
"user_belongs_to_parent_site": false,
|
|
188
|
+
"impersonator_user_id": 1
|
|
188
189
|
},
|
|
189
190
|
"sftp_enabled": true,
|
|
190
191
|
"sftp_host_key_type": "default",
|
package/docs/models/User.md
CHANGED
|
@@ -520,10 +520,13 @@ await user.update({
|
|
|
520
520
|
```
|
|
521
521
|
const user = await User.find(id)
|
|
522
522
|
|
|
523
|
-
await user.delete(
|
|
523
|
+
await user.delete({
|
|
524
|
+
'new_owner_id': 1,
|
|
525
|
+
})
|
|
524
526
|
```
|
|
525
527
|
|
|
526
528
|
### Parameters
|
|
527
529
|
|
|
528
530
|
* `id` (int64): Required - User ID.
|
|
531
|
+
* `new_owner_id` (int64): Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
|
|
529
532
|
|
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.252';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -108,6 +108,10 @@ var ApiRequestLog = /*#__PURE__*/(0, _createClass2.default)(function ApiRequestL
|
|
|
108
108
|
(0, _defineProperty2.default)(this, "getDurationMs", function () {
|
|
109
109
|
return _this.attributes.duration_ms;
|
|
110
110
|
});
|
|
111
|
+
// int64 # User ID of Site Admin user impersonating this user via a Read-Only session.
|
|
112
|
+
(0, _defineProperty2.default)(this, "getImpersonatorUserId", function () {
|
|
113
|
+
return _this.attributes.impersonator_user_id;
|
|
114
|
+
});
|
|
111
115
|
Object.entries(attributes).forEach(function (_ref) {
|
|
112
116
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
113
117
|
key = _ref2[0],
|
package/lib/models/User.js
CHANGED
|
@@ -970,6 +970,8 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
|
970
970
|
}
|
|
971
971
|
}, _callee4);
|
|
972
972
|
})));
|
|
973
|
+
// Parameters:
|
|
974
|
+
// new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
|
|
973
975
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
974
976
|
var params,
|
|
975
977
|
_args5 = arguments;
|
|
@@ -996,23 +998,29 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
|
996
998
|
}
|
|
997
999
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
998
1000
|
case 3:
|
|
1001
|
+
if (!(params.new_owner_id && !(0, _utils.isInt)(params.new_owner_id))) {
|
|
1002
|
+
_context5.next = 4;
|
|
1003
|
+
break;
|
|
1004
|
+
}
|
|
1005
|
+
throw new errors.InvalidParameterError("Bad parameter: new_owner_id must be of type Int, received ".concat((0, _utils.getType)(params.new_owner_id)));
|
|
1006
|
+
case 4:
|
|
999
1007
|
if (params.id) {
|
|
1000
|
-
_context5.next =
|
|
1008
|
+
_context5.next = 6;
|
|
1001
1009
|
break;
|
|
1002
1010
|
}
|
|
1003
1011
|
if (!_this.attributes.id) {
|
|
1004
|
-
_context5.next =
|
|
1012
|
+
_context5.next = 5;
|
|
1005
1013
|
break;
|
|
1006
1014
|
}
|
|
1007
1015
|
params.id = _this.id;
|
|
1008
|
-
_context5.next =
|
|
1016
|
+
_context5.next = 6;
|
|
1009
1017
|
break;
|
|
1010
|
-
case 4:
|
|
1011
|
-
throw new errors.MissingParameterError('Parameter missing: id');
|
|
1012
1018
|
case 5:
|
|
1013
|
-
|
|
1014
|
-
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
1019
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
|
1015
1020
|
case 6:
|
|
1021
|
+
_context5.next = 7;
|
|
1022
|
+
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
1023
|
+
case 7:
|
|
1016
1024
|
case "end":
|
|
1017
1025
|
return _context5.stop();
|
|
1018
1026
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -85,6 +85,9 @@ class ApiRequestLog {
|
|
|
85
85
|
// int64 # Duration (in milliseconds)
|
|
86
86
|
getDurationMs = () => this.attributes.duration_ms
|
|
87
87
|
|
|
88
|
+
// int64 # User ID of Site Admin user impersonating this user via a Read-Only session.
|
|
89
|
+
getImpersonatorUserId = () => this.attributes.impersonator_user_id
|
|
90
|
+
|
|
88
91
|
// Parameters:
|
|
89
92
|
// 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.
|
|
90
93
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
package/src/models/User.js
CHANGED
|
@@ -817,6 +817,8 @@ class User {
|
|
|
817
817
|
return new User(response?.data, this.options)
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
+
// Parameters:
|
|
821
|
+
// new_owner_id - int64 - Provide a User ID here to transfer ownership of certain resources such as Automations and Share Links (Bundles) to that new user.
|
|
820
822
|
delete = async (params = {}) => {
|
|
821
823
|
if (!this.attributes.id) {
|
|
822
824
|
throw new errors.EmptyPropertyError('Current object has no id')
|
|
@@ -831,6 +833,10 @@ class User {
|
|
|
831
833
|
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
832
834
|
}
|
|
833
835
|
|
|
836
|
+
if (params.new_owner_id && !isInt(params.new_owner_id)) {
|
|
837
|
+
throw new errors.InvalidParameterError(`Bad parameter: new_owner_id must be of type Int, received ${getType(params.new_owner_id)}`)
|
|
838
|
+
}
|
|
839
|
+
|
|
834
840
|
if (!params.id) {
|
|
835
841
|
if (this.attributes.id) {
|
|
836
842
|
params.id = this.id
|