files.com 1.2.47 → 1.2.49
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/BundleAction.md +58 -0
- package/docs/models/Site.md +6 -0
- package/lib/Files.js +1 -1
- package/lib/models/BundleAction.js +135 -0
- package/lib/models/Site.js +114 -103
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/BundleAction.js +84 -0
- package/src/models/Site.js +8 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.49
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# BundleAction
|
2
|
+
|
3
|
+
## Example BundleAction Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"action": "create",
|
8
|
+
"bundle_registration": {
|
9
|
+
"code": "abc123",
|
10
|
+
"name": "account",
|
11
|
+
"company": "Action Verb",
|
12
|
+
"email": "john.doe@files.com",
|
13
|
+
"ip": "10.1.1.1",
|
14
|
+
"inbox_code": "abc123",
|
15
|
+
"clickwrap_body": "example",
|
16
|
+
"form_field_set_id": 1,
|
17
|
+
"form_field_data": {
|
18
|
+
"key": "example value"
|
19
|
+
},
|
20
|
+
"bundle_code": "example",
|
21
|
+
"bundle_id": 1,
|
22
|
+
"bundle_recipient_id": 1,
|
23
|
+
"created_at": "2000-01-01T01:00:00Z"
|
24
|
+
},
|
25
|
+
"when": "2000-01-01T01:00:00Z",
|
26
|
+
"destination": "/to_path",
|
27
|
+
"path": "",
|
28
|
+
"source": "/from_path"
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
* `action` (string): Type of action
|
33
|
+
* `bundle_registration` (BundleRegistration): Object that contains bundle registration information
|
34
|
+
* `when` (date-time): Action occurrence date/time
|
35
|
+
* `destination` (string): The destination path for this bundle action, if applicable
|
36
|
+
* `path` (string): Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
37
|
+
* `source` (string): The source path for this bundle action, if applicable
|
38
|
+
|
39
|
+
---
|
40
|
+
|
41
|
+
## List Bundle Actions
|
42
|
+
|
43
|
+
```
|
44
|
+
await BundleAction.list({
|
45
|
+
'per_page': 1,
|
46
|
+
'bundle_id': 1,
|
47
|
+
'bundle_registration_id': 1,
|
48
|
+
})
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
### Parameters
|
53
|
+
|
54
|
+
* `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.
|
55
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
56
|
+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[bundle_registration_id]=desc`). Valid fields are `bundle_registration_id` and `created_at`.
|
57
|
+
* `bundle_id` (int64): Bundle ID
|
58
|
+
* `bundle_registration_id` (int64): BundleRegistration ID
|
package/docs/models/Site.md
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
```
|
6
6
|
{
|
7
7
|
"name": "My Site",
|
8
|
+
"additional_text_file_types": [
|
9
|
+
"example"
|
10
|
+
],
|
8
11
|
"allowed_2fa_method_sms": true,
|
9
12
|
"allowed_2fa_method_totp": true,
|
10
13
|
"allowed_2fa_method_u2f": true,
|
@@ -275,6 +278,7 @@
|
|
275
278
|
```
|
276
279
|
|
277
280
|
* `name` (string): Site name
|
281
|
+
* `additional_text_file_types` (array): Additional extensions that are considered text files
|
278
282
|
* `allowed_2fa_method_sms` (boolean): Is SMS two factor authentication allowed?
|
279
283
|
* `allowed_2fa_method_totp` (boolean): Is TOTP two factor authentication allowed?
|
280
284
|
* `allowed_2fa_method_u2f` (boolean): Is U2F two factor authentication allowed?
|
@@ -487,6 +491,7 @@ await Site.update({
|
|
487
491
|
'motd_text': "example",
|
488
492
|
'motd_use_for_ftp': true,
|
489
493
|
'motd_use_for_sftp': true,
|
494
|
+
'additional_text_file_types': ["example"],
|
490
495
|
'session_expiry': 1.0,
|
491
496
|
'ssl_required': true,
|
492
497
|
'tls_disabled': true,
|
@@ -634,6 +639,7 @@ await Site.update({
|
|
634
639
|
* `motd_use_for_ftp` (boolean): Show message to users connecting via FTP
|
635
640
|
* `motd_use_for_sftp` (boolean): Show message to users connecting via SFTP
|
636
641
|
* `left_navigation_visibility` (object): Visibility settings for account navigation
|
642
|
+
* `additional_text_file_types` (array(string)): Additional extensions that are considered text files
|
637
643
|
* `session_expiry` (double): Session expiry in hours
|
638
644
|
* `ssl_required` (boolean): Is SSL required? Disabling this is insecure.
|
639
645
|
* `tls_disabled` (boolean): DO NOT ENABLE. This setting allows TLSv1.0 and TLSv1.1 to be used on your site. We intend to remove this capability entirely in early 2024. If set, the `sftp_insecure_ciphers` flag will be automatically set to true.
|
package/lib/Files.js
CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
|
|
11
11
|
var apiKey;
|
12
12
|
var baseUrl = 'https://app.files.com';
|
13
13
|
var sessionId = null;
|
14
|
-
var version = '1.2.
|
14
|
+
var version = '1.2.49';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
@@ -0,0 +1,135 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.default = void 0;
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
+
var _Api = _interopRequireDefault(require("../Api"));
|
14
|
+
var errors = _interopRequireWildcard(require("../Errors"));
|
15
|
+
var _utils = require("../utils");
|
16
|
+
var _BundleAction;
|
17
|
+
/* eslint-disable no-unused-vars */
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
22
|
+
/* eslint-enable no-unused-vars */
|
23
|
+
/**
|
24
|
+
* Class BundleAction
|
25
|
+
*/
|
26
|
+
var BundleAction = /*#__PURE__*/(0, _createClass2.default)(function BundleAction() {
|
27
|
+
var _this = this;
|
28
|
+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
29
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
30
|
+
(0, _classCallCheck2.default)(this, BundleAction);
|
31
|
+
(0, _defineProperty2.default)(this, "attributes", {});
|
32
|
+
(0, _defineProperty2.default)(this, "options", {});
|
33
|
+
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
34
|
+
return !!_this.attributes.id;
|
35
|
+
});
|
36
|
+
// string # Type of action
|
37
|
+
(0, _defineProperty2.default)(this, "getAction", function () {
|
38
|
+
return _this.attributes.action;
|
39
|
+
});
|
40
|
+
// BundleRegistration # Object that contains bundle registration information
|
41
|
+
(0, _defineProperty2.default)(this, "getBundleRegistration", function () {
|
42
|
+
return _this.attributes.bundle_registration;
|
43
|
+
});
|
44
|
+
// date-time # Action occurrence date/time
|
45
|
+
(0, _defineProperty2.default)(this, "getWhen", function () {
|
46
|
+
return _this.attributes.when;
|
47
|
+
});
|
48
|
+
// string # The destination path for this bundle action, if applicable
|
49
|
+
(0, _defineProperty2.default)(this, "getDestination", function () {
|
50
|
+
return _this.attributes.destination;
|
51
|
+
});
|
52
|
+
// string # Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
53
|
+
(0, _defineProperty2.default)(this, "getPath", function () {
|
54
|
+
return _this.attributes.path;
|
55
|
+
});
|
56
|
+
// string # The source path for this bundle action, if applicable
|
57
|
+
(0, _defineProperty2.default)(this, "getSource", function () {
|
58
|
+
return _this.attributes.source;
|
59
|
+
});
|
60
|
+
Object.entries(attributes).forEach(function (_ref) {
|
61
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
62
|
+
key = _ref2[0],
|
63
|
+
value = _ref2[1];
|
64
|
+
var normalizedKey = key.replace('?', '');
|
65
|
+
_this.attributes[normalizedKey] = value;
|
66
|
+
Object.defineProperty(_this, normalizedKey, {
|
67
|
+
value: value,
|
68
|
+
writable: false
|
69
|
+
});
|
70
|
+
});
|
71
|
+
this.options = _objectSpread({}, options);
|
72
|
+
});
|
73
|
+
_BundleAction = BundleAction;
|
74
|
+
// Parameters:
|
75
|
+
// 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
|
+
// 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 (e.g. `sort_by[bundle_registration_id]=desc`). Valid fields are `bundle_registration_id` and `created_at`.
|
78
|
+
// bundle_id - int64 - Bundle ID
|
79
|
+
// bundle_registration_id - int64 - BundleRegistration ID
|
80
|
+
(0, _defineProperty2.default)(BundleAction, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
81
|
+
var _response$data;
|
82
|
+
var params,
|
83
|
+
options,
|
84
|
+
response,
|
85
|
+
_args = arguments;
|
86
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
87
|
+
while (1) switch (_context.prev = _context.next) {
|
88
|
+
case 0:
|
89
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
90
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
91
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
92
|
+
_context.next = 4;
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
96
|
+
case 4:
|
97
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
98
|
+
_context.next = 6;
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
102
|
+
case 6:
|
103
|
+
if (!(params.bundle_id && !(0, _utils.isInt)(params.bundle_id))) {
|
104
|
+
_context.next = 8;
|
105
|
+
break;
|
106
|
+
}
|
107
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_id)));
|
108
|
+
case 8:
|
109
|
+
if (!(params.bundle_registration_id && !(0, _utils.isInt)(params.bundle_registration_id))) {
|
110
|
+
_context.next = 10;
|
111
|
+
break;
|
112
|
+
}
|
113
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_registration_id)));
|
114
|
+
case 10:
|
115
|
+
_context.next = 12;
|
116
|
+
return _Api.default.sendRequest('/bundle_actions', 'GET', params, options);
|
117
|
+
case 12:
|
118
|
+
response = _context.sent;
|
119
|
+
return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
120
|
+
return new _BundleAction(obj, options);
|
121
|
+
})) || []);
|
122
|
+
case 14:
|
123
|
+
case "end":
|
124
|
+
return _context.stop();
|
125
|
+
}
|
126
|
+
}, _callee);
|
127
|
+
})));
|
128
|
+
(0, _defineProperty2.default)(BundleAction, "all", function () {
|
129
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
130
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
131
|
+
return _BundleAction.list(params, options);
|
132
|
+
});
|
133
|
+
var _default = exports.default = BundleAction;
|
134
|
+
module.exports = BundleAction;
|
135
|
+
module.exports.default = BundleAction;
|
package/lib/models/Site.js
CHANGED
@@ -37,6 +37,10 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
|
|
37
37
|
(0, _defineProperty2.default)(this, "getName", function () {
|
38
38
|
return _this.attributes.name;
|
39
39
|
});
|
40
|
+
// array # Additional extensions that are considered text files
|
41
|
+
(0, _defineProperty2.default)(this, "getAdditionalTextFileTypes", function () {
|
42
|
+
return _this.attributes.additional_text_file_types;
|
43
|
+
});
|
40
44
|
// boolean # Is SMS two factor authentication allowed?
|
41
45
|
(0, _defineProperty2.default)(this, "getAllowed2faMethodSms", function () {
|
42
46
|
return _this.attributes.allowed_2fa_method_sms;
|
@@ -745,6 +749,7 @@ _Site = Site;
|
|
745
749
|
// motd_use_for_ftp - boolean - Show message to users connecting via FTP
|
746
750
|
// motd_use_for_sftp - boolean - Show message to users connecting via SFTP
|
747
751
|
// left_navigation_visibility - object - Visibility settings for account navigation
|
752
|
+
// additional_text_file_types - array(string) - Additional extensions that are considered text files
|
748
753
|
// session_expiry - double - Session expiry in hours
|
749
754
|
// ssl_required - boolean - Is SSL required? Disabling this is insecure.
|
750
755
|
// tls_disabled - boolean - DO NOT ENABLE. This setting allows TLSv1.0 and TLSv1.1 to be used on your site. We intend to remove this capability entirely in early 2024. If set, the `sftp_insecure_ciphers` flag will be automatically set to true.
|
@@ -975,312 +980,318 @@ _Site = Site;
|
|
975
980
|
}
|
976
981
|
throw new errors.InvalidParameterError("Bad parameter: motd_text must be of type String, received ".concat((0, _utils.getType)(params.motd_text)));
|
977
982
|
case 36:
|
978
|
-
if (!(params.
|
983
|
+
if (!(params.additional_text_file_types && !(0, _utils.isArray)(params.additional_text_file_types))) {
|
979
984
|
_context3.next = 38;
|
980
985
|
break;
|
981
986
|
}
|
982
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
987
|
+
throw new errors.InvalidParameterError("Bad parameter: additional_text_file_types must be of type Array, received ".concat((0, _utils.getType)(params.additional_text_file_types)));
|
983
988
|
case 38:
|
984
|
-
if (!(params.
|
989
|
+
if (!(params.user_lockout_tries && !(0, _utils.isInt)(params.user_lockout_tries))) {
|
985
990
|
_context3.next = 40;
|
986
991
|
break;
|
987
992
|
}
|
988
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
993
|
+
throw new errors.InvalidParameterError("Bad parameter: user_lockout_tries must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_tries)));
|
989
994
|
case 40:
|
990
|
-
if (!(params.
|
995
|
+
if (!(params.user_lockout_within && !(0, _utils.isInt)(params.user_lockout_within))) {
|
991
996
|
_context3.next = 42;
|
992
997
|
break;
|
993
998
|
}
|
994
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
999
|
+
throw new errors.InvalidParameterError("Bad parameter: user_lockout_within must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_within)));
|
995
1000
|
case 42:
|
996
|
-
if (!(params.
|
1001
|
+
if (!(params.user_lockout_lock_period && !(0, _utils.isInt)(params.user_lockout_lock_period))) {
|
997
1002
|
_context3.next = 44;
|
998
1003
|
break;
|
999
1004
|
}
|
1000
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1005
|
+
throw new errors.InvalidParameterError("Bad parameter: user_lockout_lock_period must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_lock_period)));
|
1001
1006
|
case 44:
|
1002
|
-
if (!(params.
|
1007
|
+
if (!(params.allowed_countries && !(0, _utils.isString)(params.allowed_countries))) {
|
1003
1008
|
_context3.next = 46;
|
1004
1009
|
break;
|
1005
1010
|
}
|
1006
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1011
|
+
throw new errors.InvalidParameterError("Bad parameter: allowed_countries must be of type String, received ".concat((0, _utils.getType)(params.allowed_countries)));
|
1007
1012
|
case 46:
|
1008
|
-
if (!(params.
|
1013
|
+
if (!(params.allowed_ips && !(0, _utils.isString)(params.allowed_ips))) {
|
1009
1014
|
_context3.next = 48;
|
1010
1015
|
break;
|
1011
1016
|
}
|
1012
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1017
|
+
throw new errors.InvalidParameterError("Bad parameter: allowed_ips must be of type String, received ".concat((0, _utils.getType)(params.allowed_ips)));
|
1013
1018
|
case 48:
|
1014
|
-
if (!(params.
|
1019
|
+
if (!(params.disallowed_countries && !(0, _utils.isString)(params.disallowed_countries))) {
|
1015
1020
|
_context3.next = 50;
|
1016
1021
|
break;
|
1017
1022
|
}
|
1018
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1023
|
+
throw new errors.InvalidParameterError("Bad parameter: disallowed_countries must be of type String, received ".concat((0, _utils.getType)(params.disallowed_countries)));
|
1019
1024
|
case 50:
|
1020
|
-
if (!(params.
|
1025
|
+
if (!(params.days_to_retain_backups && !(0, _utils.isInt)(params.days_to_retain_backups))) {
|
1021
1026
|
_context3.next = 52;
|
1022
1027
|
break;
|
1023
1028
|
}
|
1024
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1029
|
+
throw new errors.InvalidParameterError("Bad parameter: days_to_retain_backups must be of type Int, received ".concat((0, _utils.getType)(params.days_to_retain_backups)));
|
1025
1030
|
case 52:
|
1026
|
-
if (!(params.
|
1031
|
+
if (!(params.max_prior_passwords && !(0, _utils.isInt)(params.max_prior_passwords))) {
|
1027
1032
|
_context3.next = 54;
|
1028
1033
|
break;
|
1029
1034
|
}
|
1030
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1035
|
+
throw new errors.InvalidParameterError("Bad parameter: max_prior_passwords must be of type Int, received ".concat((0, _utils.getType)(params.max_prior_passwords)));
|
1031
1036
|
case 54:
|
1032
|
-
if (!(params.
|
1037
|
+
if (!(params.password_validity_days && !(0, _utils.isInt)(params.password_validity_days))) {
|
1033
1038
|
_context3.next = 56;
|
1034
1039
|
break;
|
1035
1040
|
}
|
1036
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1041
|
+
throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params.password_validity_days)));
|
1037
1042
|
case 56:
|
1038
|
-
if (!(params.
|
1043
|
+
if (!(params.password_min_length && !(0, _utils.isInt)(params.password_min_length))) {
|
1039
1044
|
_context3.next = 58;
|
1040
1045
|
break;
|
1041
1046
|
}
|
1042
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1047
|
+
throw new errors.InvalidParameterError("Bad parameter: password_min_length must be of type Int, received ".concat((0, _utils.getType)(params.password_min_length)));
|
1043
1048
|
case 58:
|
1044
|
-
if (!(params.
|
1049
|
+
if (!(params.bundle_not_found_message && !(0, _utils.isString)(params.bundle_not_found_message))) {
|
1045
1050
|
_context3.next = 60;
|
1046
1051
|
break;
|
1047
1052
|
}
|
1048
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1053
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_not_found_message must be of type String, received ".concat((0, _utils.getType)(params.bundle_not_found_message)));
|
1049
1054
|
case 60:
|
1050
|
-
if (!(params.
|
1055
|
+
if (!(params.bundle_registration_notifications && !(0, _utils.isString)(params.bundle_registration_notifications))) {
|
1051
1056
|
_context3.next = 62;
|
1052
1057
|
break;
|
1053
1058
|
}
|
1054
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1059
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_registration_notifications)));
|
1055
1060
|
case 62:
|
1056
|
-
if (!(params.
|
1061
|
+
if (!(params.bundle_activity_notifications && !(0, _utils.isString)(params.bundle_activity_notifications))) {
|
1057
1062
|
_context3.next = 64;
|
1058
1063
|
break;
|
1059
1064
|
}
|
1060
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1065
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_activity_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_activity_notifications)));
|
1061
1066
|
case 64:
|
1062
|
-
if (!(params.
|
1067
|
+
if (!(params.bundle_upload_receipt_notifications && !(0, _utils.isString)(params.bundle_upload_receipt_notifications))) {
|
1063
1068
|
_context3.next = 66;
|
1064
1069
|
break;
|
1065
1070
|
}
|
1066
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1071
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_upload_receipt_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_upload_receipt_notifications)));
|
1067
1072
|
case 66:
|
1068
|
-
if (!(params.
|
1073
|
+
if (!(params.disable_users_from_inactivity_period_days && !(0, _utils.isInt)(params.disable_users_from_inactivity_period_days))) {
|
1069
1074
|
_context3.next = 68;
|
1070
1075
|
break;
|
1071
1076
|
}
|
1072
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1077
|
+
throw new errors.InvalidParameterError("Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ".concat((0, _utils.getType)(params.disable_users_from_inactivity_period_days)));
|
1073
1078
|
case 68:
|
1074
|
-
if (!(params.
|
1079
|
+
if (!(params.sftp_host_key_type && !(0, _utils.isString)(params.sftp_host_key_type))) {
|
1075
1080
|
_context3.next = 70;
|
1076
1081
|
break;
|
1077
1082
|
}
|
1078
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1083
|
+
throw new errors.InvalidParameterError("Bad parameter: sftp_host_key_type must be of type String, received ".concat((0, _utils.getType)(params.sftp_host_key_type)));
|
1079
1084
|
case 70:
|
1080
|
-
if (!(params.
|
1085
|
+
if (!(params.active_sftp_host_key_id && !(0, _utils.isInt)(params.active_sftp_host_key_id))) {
|
1081
1086
|
_context3.next = 72;
|
1082
1087
|
break;
|
1083
1088
|
}
|
1084
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1089
|
+
throw new errors.InvalidParameterError("Bad parameter: active_sftp_host_key_id must be of type Int, received ".concat((0, _utils.getType)(params.active_sftp_host_key_id)));
|
1085
1090
|
case 72:
|
1086
|
-
if (!(params.
|
1091
|
+
if (!(params.bundle_recipient_blacklist_domains && !(0, _utils.isArray)(params.bundle_recipient_blacklist_domains))) {
|
1087
1092
|
_context3.next = 74;
|
1088
1093
|
break;
|
1089
1094
|
}
|
1090
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1095
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_recipient_blacklist_domains must be of type Array, received ".concat((0, _utils.getType)(params.bundle_recipient_blacklist_domains)));
|
1091
1096
|
case 74:
|
1092
|
-
if (!(params.
|
1097
|
+
if (!(params.require_2fa_user_type && !(0, _utils.isString)(params.require_2fa_user_type))) {
|
1093
1098
|
_context3.next = 76;
|
1094
1099
|
break;
|
1095
1100
|
}
|
1096
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1101
|
+
throw new errors.InvalidParameterError("Bad parameter: require_2fa_user_type must be of type String, received ".concat((0, _utils.getType)(params.require_2fa_user_type)));
|
1097
1102
|
case 76:
|
1098
|
-
if (!(params.
|
1103
|
+
if (!(params.color2_top && !(0, _utils.isString)(params.color2_top))) {
|
1099
1104
|
_context3.next = 78;
|
1100
1105
|
break;
|
1101
1106
|
}
|
1102
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1107
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_top must be of type String, received ".concat((0, _utils.getType)(params.color2_top)));
|
1103
1108
|
case 78:
|
1104
|
-
if (!(params.
|
1109
|
+
if (!(params.color2_left && !(0, _utils.isString)(params.color2_left))) {
|
1105
1110
|
_context3.next = 80;
|
1106
1111
|
break;
|
1107
1112
|
}
|
1108
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1113
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_left must be of type String, received ".concat((0, _utils.getType)(params.color2_left)));
|
1109
1114
|
case 80:
|
1110
|
-
if (!(params.
|
1115
|
+
if (!(params.color2_link && !(0, _utils.isString)(params.color2_link))) {
|
1111
1116
|
_context3.next = 82;
|
1112
1117
|
break;
|
1113
1118
|
}
|
1114
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1119
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_link must be of type String, received ".concat((0, _utils.getType)(params.color2_link)));
|
1115
1120
|
case 82:
|
1116
|
-
if (!(params.
|
1121
|
+
if (!(params.color2_text && !(0, _utils.isString)(params.color2_text))) {
|
1117
1122
|
_context3.next = 84;
|
1118
1123
|
break;
|
1119
1124
|
}
|
1120
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1125
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_text must be of type String, received ".concat((0, _utils.getType)(params.color2_text)));
|
1121
1126
|
case 84:
|
1122
|
-
if (!(params.
|
1127
|
+
if (!(params.color2_top_text && !(0, _utils.isString)(params.color2_top_text))) {
|
1123
1128
|
_context3.next = 86;
|
1124
1129
|
break;
|
1125
1130
|
}
|
1126
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1131
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_top_text must be of type String, received ".concat((0, _utils.getType)(params.color2_top_text)));
|
1127
1132
|
case 86:
|
1128
|
-
if (!(params.
|
1133
|
+
if (!(params.site_header && !(0, _utils.isString)(params.site_header))) {
|
1129
1134
|
_context3.next = 88;
|
1130
1135
|
break;
|
1131
1136
|
}
|
1132
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1137
|
+
throw new errors.InvalidParameterError("Bad parameter: site_header must be of type String, received ".concat((0, _utils.getType)(params.site_header)));
|
1133
1138
|
case 88:
|
1134
|
-
if (!(params.
|
1139
|
+
if (!(params.site_footer && !(0, _utils.isString)(params.site_footer))) {
|
1135
1140
|
_context3.next = 90;
|
1136
1141
|
break;
|
1137
1142
|
}
|
1138
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1143
|
+
throw new errors.InvalidParameterError("Bad parameter: site_footer must be of type String, received ".concat((0, _utils.getType)(params.site_footer)));
|
1139
1144
|
case 90:
|
1140
|
-
if (!(params.
|
1145
|
+
if (!(params.login_help_text && !(0, _utils.isString)(params.login_help_text))) {
|
1141
1146
|
_context3.next = 92;
|
1142
1147
|
break;
|
1143
1148
|
}
|
1144
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1149
|
+
throw new errors.InvalidParameterError("Bad parameter: login_help_text must be of type String, received ".concat((0, _utils.getType)(params.login_help_text)));
|
1145
1150
|
case 92:
|
1146
|
-
if (!(params.
|
1151
|
+
if (!(params.smtp_address && !(0, _utils.isString)(params.smtp_address))) {
|
1147
1152
|
_context3.next = 94;
|
1148
1153
|
break;
|
1149
1154
|
}
|
1150
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1155
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_address must be of type String, received ".concat((0, _utils.getType)(params.smtp_address)));
|
1151
1156
|
case 94:
|
1152
|
-
if (!(params.
|
1157
|
+
if (!(params.smtp_authentication && !(0, _utils.isString)(params.smtp_authentication))) {
|
1153
1158
|
_context3.next = 96;
|
1154
1159
|
break;
|
1155
1160
|
}
|
1156
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1161
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_authentication must be of type String, received ".concat((0, _utils.getType)(params.smtp_authentication)));
|
1157
1162
|
case 96:
|
1158
|
-
if (!(params.
|
1163
|
+
if (!(params.smtp_from && !(0, _utils.isString)(params.smtp_from))) {
|
1159
1164
|
_context3.next = 98;
|
1160
1165
|
break;
|
1161
1166
|
}
|
1162
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1167
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_from must be of type String, received ".concat((0, _utils.getType)(params.smtp_from)));
|
1163
1168
|
case 98:
|
1164
|
-
if (!(params.
|
1169
|
+
if (!(params.smtp_username && !(0, _utils.isString)(params.smtp_username))) {
|
1165
1170
|
_context3.next = 100;
|
1166
1171
|
break;
|
1167
1172
|
}
|
1168
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1173
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_username must be of type String, received ".concat((0, _utils.getType)(params.smtp_username)));
|
1169
1174
|
case 100:
|
1170
|
-
if (!(params.
|
1175
|
+
if (!(params.smtp_port && !(0, _utils.isInt)(params.smtp_port))) {
|
1171
1176
|
_context3.next = 102;
|
1172
1177
|
break;
|
1173
1178
|
}
|
1174
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1179
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_port must be of type Int, received ".concat((0, _utils.getType)(params.smtp_port)));
|
1175
1180
|
case 102:
|
1176
|
-
if (!(params.
|
1181
|
+
if (!(params.ldap_type && !(0, _utils.isString)(params.ldap_type))) {
|
1177
1182
|
_context3.next = 104;
|
1178
1183
|
break;
|
1179
1184
|
}
|
1180
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1185
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_type must be of type String, received ".concat((0, _utils.getType)(params.ldap_type)));
|
1181
1186
|
case 104:
|
1182
|
-
if (!(params.
|
1187
|
+
if (!(params.ldap_host && !(0, _utils.isString)(params.ldap_host))) {
|
1183
1188
|
_context3.next = 106;
|
1184
1189
|
break;
|
1185
1190
|
}
|
1186
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1191
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host must be of type String, received ".concat((0, _utils.getType)(params.ldap_host)));
|
1187
1192
|
case 106:
|
1188
|
-
if (!(params.
|
1193
|
+
if (!(params.ldap_host_2 && !(0, _utils.isString)(params.ldap_host_2))) {
|
1189
1194
|
_context3.next = 108;
|
1190
1195
|
break;
|
1191
1196
|
}
|
1192
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1197
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host_2 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_2)));
|
1193
1198
|
case 108:
|
1194
|
-
if (!(params.
|
1199
|
+
if (!(params.ldap_host_3 && !(0, _utils.isString)(params.ldap_host_3))) {
|
1195
1200
|
_context3.next = 110;
|
1196
1201
|
break;
|
1197
1202
|
}
|
1198
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1203
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host_3 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_3)));
|
1199
1204
|
case 110:
|
1200
|
-
if (!(params.
|
1205
|
+
if (!(params.ldap_port && !(0, _utils.isInt)(params.ldap_port))) {
|
1201
1206
|
_context3.next = 112;
|
1202
1207
|
break;
|
1203
1208
|
}
|
1204
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1209
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_port must be of type Int, received ".concat((0, _utils.getType)(params.ldap_port)));
|
1205
1210
|
case 112:
|
1206
|
-
if (!(params.
|
1211
|
+
if (!(params.ldap_username && !(0, _utils.isString)(params.ldap_username))) {
|
1207
1212
|
_context3.next = 114;
|
1208
1213
|
break;
|
1209
1214
|
}
|
1210
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1215
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_username must be of type String, received ".concat((0, _utils.getType)(params.ldap_username)));
|
1211
1216
|
case 114:
|
1212
|
-
if (!(params.
|
1217
|
+
if (!(params.ldap_username_field && !(0, _utils.isString)(params.ldap_username_field))) {
|
1213
1218
|
_context3.next = 116;
|
1214
1219
|
break;
|
1215
1220
|
}
|
1216
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1221
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_username_field must be of type String, received ".concat((0, _utils.getType)(params.ldap_username_field)));
|
1217
1222
|
case 116:
|
1218
|
-
if (!(params.
|
1223
|
+
if (!(params.ldap_domain && !(0, _utils.isString)(params.ldap_domain))) {
|
1219
1224
|
_context3.next = 118;
|
1220
1225
|
break;
|
1221
1226
|
}
|
1222
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1227
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_domain must be of type String, received ".concat((0, _utils.getType)(params.ldap_domain)));
|
1223
1228
|
case 118:
|
1224
|
-
if (!(params.
|
1229
|
+
if (!(params.ldap_user_action && !(0, _utils.isString)(params.ldap_user_action))) {
|
1225
1230
|
_context3.next = 120;
|
1226
1231
|
break;
|
1227
1232
|
}
|
1228
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1233
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_user_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_action)));
|
1229
1234
|
case 120:
|
1230
|
-
if (!(params.
|
1235
|
+
if (!(params.ldap_group_action && !(0, _utils.isString)(params.ldap_group_action))) {
|
1231
1236
|
_context3.next = 122;
|
1232
1237
|
break;
|
1233
1238
|
}
|
1234
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1239
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_action)));
|
1235
1240
|
case 122:
|
1236
|
-
if (!(params.
|
1241
|
+
if (!(params.ldap_user_include_groups && !(0, _utils.isString)(params.ldap_user_include_groups))) {
|
1237
1242
|
_context3.next = 124;
|
1238
1243
|
break;
|
1239
1244
|
}
|
1240
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1245
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_user_include_groups must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_include_groups)));
|
1241
1246
|
case 124:
|
1242
|
-
if (!(params.
|
1247
|
+
if (!(params.ldap_group_exclusion && !(0, _utils.isString)(params.ldap_group_exclusion))) {
|
1243
1248
|
_context3.next = 126;
|
1244
1249
|
break;
|
1245
1250
|
}
|
1246
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1251
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_exclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_exclusion)));
|
1247
1252
|
case 126:
|
1248
|
-
if (!(params.
|
1253
|
+
if (!(params.ldap_group_inclusion && !(0, _utils.isString)(params.ldap_group_inclusion))) {
|
1249
1254
|
_context3.next = 128;
|
1250
1255
|
break;
|
1251
1256
|
}
|
1252
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1257
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_inclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_inclusion)));
|
1253
1258
|
case 128:
|
1254
|
-
if (!(params.
|
1259
|
+
if (!(params.ldap_base_dn && !(0, _utils.isString)(params.ldap_base_dn))) {
|
1255
1260
|
_context3.next = 130;
|
1256
1261
|
break;
|
1257
1262
|
}
|
1258
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1263
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_base_dn must be of type String, received ".concat((0, _utils.getType)(params.ldap_base_dn)));
|
1259
1264
|
case 130:
|
1260
|
-
if (!(params.
|
1265
|
+
if (!(params.ldap_password_change && !(0, _utils.isString)(params.ldap_password_change))) {
|
1261
1266
|
_context3.next = 132;
|
1262
1267
|
break;
|
1263
1268
|
}
|
1264
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1269
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_password_change must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change)));
|
1265
1270
|
case 132:
|
1266
|
-
if (!(params.
|
1271
|
+
if (!(params.ldap_password_change_confirmation && !(0, _utils.isString)(params.ldap_password_change_confirmation))) {
|
1267
1272
|
_context3.next = 134;
|
1268
1273
|
break;
|
1269
1274
|
}
|
1270
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1275
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_password_change_confirmation must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change_confirmation)));
|
1271
1276
|
case 134:
|
1272
|
-
if (!(params.
|
1277
|
+
if (!(params.smtp_password && !(0, _utils.isString)(params.smtp_password))) {
|
1273
1278
|
_context3.next = 136;
|
1274
1279
|
break;
|
1275
1280
|
}
|
1276
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1281
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_password must be of type String, received ".concat((0, _utils.getType)(params.smtp_password)));
|
1277
1282
|
case 136:
|
1278
|
-
|
1279
|
-
|
1283
|
+
if (!(params.session_expiry_minutes && !(0, _utils.isInt)(params.session_expiry_minutes))) {
|
1284
|
+
_context3.next = 138;
|
1285
|
+
break;
|
1286
|
+
}
|
1287
|
+
throw new errors.InvalidParameterError("Bad parameter: session_expiry_minutes must be of type Int, received ".concat((0, _utils.getType)(params.session_expiry_minutes)));
|
1280
1288
|
case 138:
|
1289
|
+
_context3.next = 140;
|
1290
|
+
return _Api.default.sendRequest('/site', 'PATCH', params, options);
|
1291
|
+
case 140:
|
1281
1292
|
response = _context3.sent;
|
1282
1293
|
return _context3.abrupt("return", new _Site(response === null || response === void 0 ? void 0 : response.data, options));
|
1283
|
-
case
|
1294
|
+
case 142:
|
1284
1295
|
case "end":
|
1285
1296
|
return _context3.stop();
|
1286
1297
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
@@ -0,0 +1,84 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
2
|
+
import Api from '../Api'
|
3
|
+
import * as errors from '../Errors'
|
4
|
+
import {
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
6
|
+
} from '../utils'
|
7
|
+
/* eslint-enable no-unused-vars */
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Class BundleAction
|
11
|
+
*/
|
12
|
+
class BundleAction {
|
13
|
+
attributes = {}
|
14
|
+
|
15
|
+
options = {}
|
16
|
+
|
17
|
+
constructor(attributes = {}, options = {}) {
|
18
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
19
|
+
const normalizedKey = key.replace('?', '')
|
20
|
+
|
21
|
+
this.attributes[normalizedKey] = value
|
22
|
+
|
23
|
+
Object.defineProperty(this, normalizedKey, { value, writable: false })
|
24
|
+
})
|
25
|
+
|
26
|
+
this.options = { ...options }
|
27
|
+
}
|
28
|
+
|
29
|
+
isLoaded = () => !!this.attributes.id
|
30
|
+
|
31
|
+
// string # Type of action
|
32
|
+
getAction = () => this.attributes.action
|
33
|
+
|
34
|
+
// BundleRegistration # Object that contains bundle registration information
|
35
|
+
getBundleRegistration = () => this.attributes.bundle_registration
|
36
|
+
|
37
|
+
// date-time # Action occurrence date/time
|
38
|
+
getWhen = () => this.attributes.when
|
39
|
+
|
40
|
+
// string # The destination path for this bundle action, if applicable
|
41
|
+
getDestination = () => this.attributes.destination
|
42
|
+
|
43
|
+
// string # Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
44
|
+
getPath = () => this.attributes.path
|
45
|
+
|
46
|
+
// string # The source path for this bundle action, if applicable
|
47
|
+
getSource = () => this.attributes.source
|
48
|
+
|
49
|
+
// Parameters:
|
50
|
+
// 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.
|
51
|
+
// 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 (e.g. `sort_by[bundle_registration_id]=desc`). Valid fields are `bundle_registration_id` and `created_at`.
|
53
|
+
// bundle_id - int64 - Bundle ID
|
54
|
+
// bundle_registration_id - int64 - BundleRegistration ID
|
55
|
+
static list = async (params = {}, options = {}) => {
|
56
|
+
if (params.cursor && !isString(params.cursor)) {
|
57
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
58
|
+
}
|
59
|
+
|
60
|
+
if (params.per_page && !isInt(params.per_page)) {
|
61
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
62
|
+
}
|
63
|
+
|
64
|
+
if (params.bundle_id && !isInt(params.bundle_id)) {
|
65
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(params.bundle_id)}`)
|
66
|
+
}
|
67
|
+
|
68
|
+
if (params.bundle_registration_id && !isInt(params.bundle_registration_id)) {
|
69
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_id must be of type Int, received ${getType(params.bundle_registration_id)}`)
|
70
|
+
}
|
71
|
+
|
72
|
+
const response = await Api.sendRequest('/bundle_actions', 'GET', params, options)
|
73
|
+
|
74
|
+
return response?.data?.map(obj => new BundleAction(obj, options)) || []
|
75
|
+
}
|
76
|
+
|
77
|
+
static all = (params = {}, options = {}) =>
|
78
|
+
BundleAction.list(params, options)
|
79
|
+
}
|
80
|
+
|
81
|
+
export default BundleAction
|
82
|
+
|
83
|
+
module.exports = BundleAction
|
84
|
+
module.exports.default = BundleAction
|
package/src/models/Site.js
CHANGED
@@ -31,6 +31,9 @@ class Site {
|
|
31
31
|
// string # Site name
|
32
32
|
getName = () => this.attributes.name
|
33
33
|
|
34
|
+
// array # Additional extensions that are considered text files
|
35
|
+
getAdditionalTextFileTypes = () => this.attributes.additional_text_file_types
|
36
|
+
|
34
37
|
// boolean # Is SMS two factor authentication allowed?
|
35
38
|
getAllowed2faMethodSms = () => this.attributes.allowed_2fa_method_sms
|
36
39
|
|
@@ -543,6 +546,7 @@ class Site {
|
|
543
546
|
// motd_use_for_ftp - boolean - Show message to users connecting via FTP
|
544
547
|
// motd_use_for_sftp - boolean - Show message to users connecting via SFTP
|
545
548
|
// left_navigation_visibility - object - Visibility settings for account navigation
|
549
|
+
// additional_text_file_types - array(string) - Additional extensions that are considered text files
|
546
550
|
// session_expiry - double - Session expiry in hours
|
547
551
|
// ssl_required - boolean - Is SSL required? Disabling this is insecure.
|
548
552
|
// tls_disabled - boolean - DO NOT ENABLE. This setting allows TLSv1.0 and TLSv1.1 to be used on your site. We intend to remove this capability entirely in early 2024. If set, the `sftp_insecure_ciphers` flag will be automatically set to true.
|
@@ -730,6 +734,10 @@ class Site {
|
|
730
734
|
throw new errors.InvalidParameterError(`Bad parameter: motd_text must be of type String, received ${getType(params.motd_text)}`)
|
731
735
|
}
|
732
736
|
|
737
|
+
if (params.additional_text_file_types && !isArray(params.additional_text_file_types)) {
|
738
|
+
throw new errors.InvalidParameterError(`Bad parameter: additional_text_file_types must be of type Array, received ${getType(params.additional_text_file_types)}`)
|
739
|
+
}
|
740
|
+
|
733
741
|
if (params.user_lockout_tries && !isInt(params.user_lockout_tries)) {
|
734
742
|
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_tries must be of type Int, received ${getType(params.user_lockout_tries)}`)
|
735
743
|
}
|