files.com 1.2.271 → 1.2.273

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 CHANGED
@@ -1 +1 @@
1
- 1.2.271
1
+ 1.2.273
@@ -86,7 +86,8 @@
86
86
  "value": {
87
87
  "limit": "1"
88
88
  },
89
- "webhook_url": "https://app.files.com/api/webhooks/abc123"
89
+ "webhook_url": "https://app.files.com/api/webhooks/abc123",
90
+ "holiday_region": "us_dc"
90
91
  }
91
92
  ```
92
93
 
@@ -128,6 +129,7 @@
128
129
  * `user_ids` (array(int64)): IDs of Users for the Automation (i.e. who to Request File from)
129
130
  * `value` (object): A Hash of attributes specific to the automation type.
130
131
  * `webhook_url` (string): If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
132
+ * `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
131
133
 
132
134
  ---
133
135
 
@@ -415,7 +417,8 @@ await automation.update({
415
417
  "value": {
416
418
  "limit": "1"
417
419
  },
418
- "webhook_url": "https://app.files.com/api/webhooks/abc123"
420
+ "webhook_url": "https://app.files.com/api/webhooks/abc123",
421
+ "holiday_region": "us_dc"
419
422
  }
420
423
  ```
421
424
 
@@ -0,0 +1,27 @@
1
+ # HolidayRegion
2
+
3
+ ## Example HolidayRegion Object
4
+
5
+ ```
6
+ {
7
+ "code": "us_dc",
8
+ "name": "United States - District of Columbia"
9
+ }
10
+ ```
11
+
12
+ * `code` (string): The code representing a region
13
+ * `name` (string): The name of the region
14
+
15
+ ---
16
+
17
+ ## List all possible holiday regions
18
+
19
+ ```
20
+ await HolidayRegion.getSupported
21
+ ```
22
+
23
+
24
+ ### Parameters
25
+
26
+ * `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.
27
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
@@ -60,7 +60,6 @@
60
60
  "custom_namespace": true,
61
61
  "dav_enabled": true,
62
62
  "dav_user_root_enabled": true,
63
- "days_before_deleting_disabled_users": 30,
64
63
  "days_to_retain_backups": 30,
65
64
  "document_edits_in_bundle_allowed": true,
66
65
  "default_time_zone": "Pacific Time (US & Canada)",
@@ -352,7 +351,6 @@
352
351
  * `custom_namespace` (boolean): Is this site using a custom namespace for users?
353
352
  * `dav_enabled` (boolean): Is WebDAV enabled?
354
353
  * `dav_user_root_enabled` (boolean): Use user FTP roots also for WebDAV?
355
- * `days_before_deleting_disabled_users` (int64): Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
356
354
  * `days_to_retain_backups` (int64): Number of days to keep deleted files
357
355
  * `document_edits_in_bundle_allowed` (boolean): If true, allow public viewers of Bundles with full permissions to use document editing integrations.
358
356
  * `default_time_zone` (string): Site default time zone
@@ -557,7 +555,6 @@ await Site.update({
557
555
  'allowed_countries': "US,DE",
558
556
  'allowed_ips': "example",
559
557
  'disallowed_countries': "US,DE",
560
- 'days_before_deleting_disabled_users': 1,
561
558
  'days_to_retain_backups': 1,
562
559
  'max_prior_passwords': 1,
563
560
  'password_validity_days': 1,
@@ -718,7 +715,6 @@ await Site.update({
718
715
  * `allowed_countries` (string): Comma separated list of allowed Country codes
719
716
  * `allowed_ips` (string): List of allowed IP addresses
720
717
  * `disallowed_countries` (string): Comma separated list of disallowed Country codes
721
- * `days_before_deleting_disabled_users` (int64): Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
722
718
  * `days_to_retain_backups` (int64): Number of days to keep deleted files
723
719
  * `max_prior_passwords` (int64): Number of prior passwords to disallow
724
720
  * `password_validity_days` (int64): Number of days password is valid
@@ -39,7 +39,8 @@
39
39
  "06:30",
40
40
  "14:30"
41
41
  ],
42
- "schedule_time_zone": "Eastern Time (US & Canada)"
42
+ "schedule_time_zone": "Eastern Time (US & Canada)",
43
+ "holiday_region": "us_dc"
43
44
  }
44
45
  ```
45
46
 
@@ -68,6 +69,7 @@
68
69
  * `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
69
70
  * `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
70
71
  * `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
72
+ * `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
71
73
 
72
74
  ---
73
75
 
@@ -255,7 +257,8 @@ await sync.update({
255
257
  "06:30",
256
258
  "14:30"
257
259
  ],
258
- "schedule_time_zone": "Eastern Time (US & Canada)"
260
+ "schedule_time_zone": "Eastern Time (US & Canada)",
261
+ "holiday_region": "us_dc"
259
262
  }
260
263
  ```
261
264
 
@@ -10,6 +10,7 @@
10
10
  "include_folder_admins": true,
11
11
  "include_site_admins": true,
12
12
  "action": "disable",
13
+ "user_state": "inactive",
13
14
  "site_id": 1
14
15
  }
15
16
  ```
@@ -20,6 +21,7 @@
20
21
  * `include_folder_admins` (boolean): Include folder admins in the rule
21
22
  * `include_site_admins` (boolean): Include site admins in the rule
22
23
  * `action` (string): Action to take on inactive users (disable or delete)
24
+ * `user_state` (string): State of the users to apply the rule to (inactive or disabled)
23
25
  * `site_id` (int64): Site ID
24
26
 
25
27
  ---
@@ -59,6 +61,7 @@ await UserLifecycleRule.create({
59
61
  'inactivity_days': 12,
60
62
  'include_site_admins': true,
61
63
  'include_folder_admins': true,
64
+ 'user_state': "inactive",
62
65
  })
63
66
  ```
64
67
 
@@ -70,6 +73,7 @@ await UserLifecycleRule.create({
70
73
  * `inactivity_days` (int64): Required - Number of days of inactivity before the rule applies
71
74
  * `include_site_admins` (boolean): Include site admins in the rule
72
75
  * `include_folder_admins` (boolean): Include folder admins in the rule
76
+ * `user_state` (string): State of the users to apply the rule to (inactive or disabled)
73
77
 
74
78
  ---
75
79
 
@@ -83,6 +87,7 @@ await user_lifecycle_rule.update({
83
87
  'inactivity_days': 12,
84
88
  'include_site_admins': true,
85
89
  'include_folder_admins': true,
90
+ 'user_state': "inactive",
86
91
  })
87
92
  ```
88
93
 
@@ -94,6 +99,7 @@ await user_lifecycle_rule.update({
94
99
  * `inactivity_days` (int64): Required - Number of days of inactivity before the rule applies
95
100
  * `include_site_admins` (boolean): Include site admins in the rule
96
101
  * `include_folder_admins` (boolean): Include folder admins in the rule
102
+ * `user_state` (string): State of the users to apply the rule to (inactive or disabled)
97
103
 
98
104
  ### Example Response
99
105
 
@@ -105,6 +111,7 @@ await user_lifecycle_rule.update({
105
111
  "include_folder_admins": true,
106
112
  "include_site_admins": true,
107
113
  "action": "disable",
114
+ "user_state": "inactive",
108
115
  "site_id": 1
109
116
  }
110
117
  ```
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.271';
15
+ var version = '1.2.273';
16
16
  var userAgent = "Files.com JavaScript SDK v".concat(version);
17
17
  var logLevel = _Logger.LogLevel.INFO;
18
18
  var debugRequest = false;
@@ -298,6 +298,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
298
298
  (0, _defineProperty2.default)(this, "setWebhookUrl", function (value) {
299
299
  _this.attributes.webhook_url = value;
300
300
  });
301
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
302
+ (0, _defineProperty2.default)(this, "getHolidayRegion", function () {
303
+ return _this.attributes.holiday_region;
304
+ });
305
+ (0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
306
+ _this.attributes.holiday_region = value;
307
+ });
301
308
  // Manually Run Automation
302
309
  (0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
303
310
  var params,
@@ -0,0 +1,98 @@
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 _HolidayRegion;
17
+ /* eslint-disable no-unused-vars */
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
+ 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; }
20
+ 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; }
21
+ /* eslint-enable no-unused-vars */
22
+ /**
23
+ * Class HolidayRegion
24
+ */
25
+ var HolidayRegion = /*#__PURE__*/(0, _createClass2.default)(function HolidayRegion() {
26
+ var _this = this;
27
+ var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ (0, _classCallCheck2.default)(this, HolidayRegion);
30
+ (0, _defineProperty2.default)(this, "attributes", {});
31
+ (0, _defineProperty2.default)(this, "options", {});
32
+ (0, _defineProperty2.default)(this, "isLoaded", function () {
33
+ return !!_this.attributes.id;
34
+ });
35
+ // string # The code representing a region
36
+ (0, _defineProperty2.default)(this, "getCode", function () {
37
+ return _this.attributes.code;
38
+ });
39
+ // string # The name of the region
40
+ (0, _defineProperty2.default)(this, "getName", function () {
41
+ return _this.attributes.name;
42
+ });
43
+ Object.entries(attributes).forEach(function (_ref) {
44
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
45
+ key = _ref2[0],
46
+ value = _ref2[1];
47
+ var normalizedKey = key.replace('?', '');
48
+ _this.attributes[normalizedKey] = value;
49
+ Object.defineProperty(_this, normalizedKey, {
50
+ value: value,
51
+ writable: false
52
+ });
53
+ });
54
+ this.options = _objectSpread({}, options);
55
+ });
56
+ _HolidayRegion = HolidayRegion;
57
+ // Parameters:
58
+ // 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.
59
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
+ (0, _defineProperty2.default)(HolidayRegion, "getSupported", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
61
+ var _response$data;
62
+ var params,
63
+ options,
64
+ response,
65
+ _args = arguments;
66
+ return _regenerator.default.wrap(function (_context) {
67
+ while (1) switch (_context.prev = _context.next) {
68
+ case 0:
69
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
70
+ options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
71
+ if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
72
+ _context.next = 1;
73
+ break;
74
+ }
75
+ throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
76
+ case 1:
77
+ if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
78
+ _context.next = 2;
79
+ break;
80
+ }
81
+ throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
82
+ case 2:
83
+ _context.next = 3;
84
+ return _Api.default.sendRequest('/holiday_regions/supported', 'GET', params, options);
85
+ case 3:
86
+ response = _context.sent;
87
+ 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) {
88
+ return new _HolidayRegion(obj, options);
89
+ })) || []);
90
+ case 4:
91
+ case "end":
92
+ return _context.stop();
93
+ }
94
+ }, _callee);
95
+ })));
96
+ var _default = exports.default = HolidayRegion;
97
+ module.exports = HolidayRegion;
98
+ module.exports.default = HolidayRegion;
@@ -220,10 +220,6 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
220
220
  (0, _defineProperty2.default)(this, "getDavUserRootEnabled", function () {
221
221
  return _this.attributes.dav_user_root_enabled;
222
222
  });
223
- // int64 # Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
224
- (0, _defineProperty2.default)(this, "getDaysBeforeDeletingDisabledUsers", function () {
225
- return _this.attributes.days_before_deleting_disabled_users;
226
- });
227
223
  // int64 # Number of days to keep deleted files
228
224
  (0, _defineProperty2.default)(this, "getDaysToRetainBackups", function () {
229
225
  return _this.attributes.days_to_retain_backups;
@@ -828,7 +824,6 @@ _Site = Site;
828
824
  // allowed_countries - string - Comma separated list of allowed Country codes
829
825
  // allowed_ips - string - List of allowed IP addresses
830
826
  // disallowed_countries - string - Comma separated list of disallowed Country codes
831
- // days_before_deleting_disabled_users - int64 - Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
832
827
  // days_to_retain_backups - int64 - Number of days to keep deleted files
833
828
  // max_prior_passwords - int64 - Number of prior passwords to disallow
834
829
  // password_validity_days - int64 - Number of days password is valid
@@ -1090,276 +1085,270 @@ _Site = Site;
1090
1085
  }
1091
1086
  throw new errors.InvalidParameterError("Bad parameter: disallowed_countries must be of type String, received ".concat((0, _utils.getType)(params.disallowed_countries)));
1092
1087
  case 24:
1093
- if (!(params.days_before_deleting_disabled_users && !(0, _utils.isInt)(params.days_before_deleting_disabled_users))) {
1094
- _context3.next = 25;
1095
- break;
1096
- }
1097
- throw new errors.InvalidParameterError("Bad parameter: days_before_deleting_disabled_users must be of type Int, received ".concat((0, _utils.getType)(params.days_before_deleting_disabled_users)));
1098
- case 25:
1099
1088
  if (!(params.days_to_retain_backups && !(0, _utils.isInt)(params.days_to_retain_backups))) {
1100
- _context3.next = 26;
1089
+ _context3.next = 25;
1101
1090
  break;
1102
1091
  }
1103
1092
  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)));
1104
- case 26:
1093
+ case 25:
1105
1094
  if (!(params.max_prior_passwords && !(0, _utils.isInt)(params.max_prior_passwords))) {
1106
- _context3.next = 27;
1095
+ _context3.next = 26;
1107
1096
  break;
1108
1097
  }
1109
1098
  throw new errors.InvalidParameterError("Bad parameter: max_prior_passwords must be of type Int, received ".concat((0, _utils.getType)(params.max_prior_passwords)));
1110
- case 27:
1099
+ case 26:
1111
1100
  if (!(params.password_validity_days && !(0, _utils.isInt)(params.password_validity_days))) {
1112
- _context3.next = 28;
1101
+ _context3.next = 27;
1113
1102
  break;
1114
1103
  }
1115
1104
  throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params.password_validity_days)));
1116
- case 28:
1105
+ case 27:
1117
1106
  if (!(params.password_min_length && !(0, _utils.isInt)(params.password_min_length))) {
1118
- _context3.next = 29;
1107
+ _context3.next = 28;
1119
1108
  break;
1120
1109
  }
1121
1110
  throw new errors.InvalidParameterError("Bad parameter: password_min_length must be of type Int, received ".concat((0, _utils.getType)(params.password_min_length)));
1122
- case 29:
1111
+ case 28:
1123
1112
  if (!(params.bundle_not_found_message && !(0, _utils.isString)(params.bundle_not_found_message))) {
1124
- _context3.next = 30;
1113
+ _context3.next = 29;
1125
1114
  break;
1126
1115
  }
1127
1116
  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)));
1128
- case 30:
1117
+ case 29:
1129
1118
  if (!(params.bundle_registration_notifications && !(0, _utils.isString)(params.bundle_registration_notifications))) {
1130
- _context3.next = 31;
1119
+ _context3.next = 30;
1131
1120
  break;
1132
1121
  }
1133
1122
  throw new errors.InvalidParameterError("Bad parameter: bundle_registration_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_registration_notifications)));
1134
- case 31:
1123
+ case 30:
1135
1124
  if (!(params.bundle_activity_notifications && !(0, _utils.isString)(params.bundle_activity_notifications))) {
1136
- _context3.next = 32;
1125
+ _context3.next = 31;
1137
1126
  break;
1138
1127
  }
1139
1128
  throw new errors.InvalidParameterError("Bad parameter: bundle_activity_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_activity_notifications)));
1140
- case 32:
1129
+ case 31:
1141
1130
  if (!(params.bundle_upload_receipt_notifications && !(0, _utils.isString)(params.bundle_upload_receipt_notifications))) {
1142
- _context3.next = 33;
1131
+ _context3.next = 32;
1143
1132
  break;
1144
1133
  }
1145
1134
  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)));
1146
- case 33:
1135
+ case 32:
1147
1136
  if (!(params.sftp_host_key_type && !(0, _utils.isString)(params.sftp_host_key_type))) {
1148
- _context3.next = 34;
1137
+ _context3.next = 33;
1149
1138
  break;
1150
1139
  }
1151
1140
  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)));
1152
- case 34:
1141
+ case 33:
1153
1142
  if (!(params.active_sftp_host_key_id && !(0, _utils.isInt)(params.active_sftp_host_key_id))) {
1154
- _context3.next = 35;
1143
+ _context3.next = 34;
1155
1144
  break;
1156
1145
  }
1157
1146
  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)));
1158
- case 35:
1147
+ case 34:
1159
1148
  if (!(params.bundle_recipient_blacklist_domains && !(0, _utils.isArray)(params.bundle_recipient_blacklist_domains))) {
1160
- _context3.next = 36;
1149
+ _context3.next = 35;
1161
1150
  break;
1162
1151
  }
1163
1152
  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)));
1164
- case 36:
1153
+ case 35:
1165
1154
  if (!(params.require_2fa_user_type && !(0, _utils.isString)(params.require_2fa_user_type))) {
1166
- _context3.next = 37;
1155
+ _context3.next = 36;
1167
1156
  break;
1168
1157
  }
1169
1158
  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)));
1170
- case 37:
1159
+ case 36:
1171
1160
  if (!(params.color2_top && !(0, _utils.isString)(params.color2_top))) {
1172
- _context3.next = 38;
1161
+ _context3.next = 37;
1173
1162
  break;
1174
1163
  }
1175
1164
  throw new errors.InvalidParameterError("Bad parameter: color2_top must be of type String, received ".concat((0, _utils.getType)(params.color2_top)));
1176
- case 38:
1165
+ case 37:
1177
1166
  if (!(params.color2_left && !(0, _utils.isString)(params.color2_left))) {
1178
- _context3.next = 39;
1167
+ _context3.next = 38;
1179
1168
  break;
1180
1169
  }
1181
1170
  throw new errors.InvalidParameterError("Bad parameter: color2_left must be of type String, received ".concat((0, _utils.getType)(params.color2_left)));
1182
- case 39:
1171
+ case 38:
1183
1172
  if (!(params.color2_link && !(0, _utils.isString)(params.color2_link))) {
1184
- _context3.next = 40;
1173
+ _context3.next = 39;
1185
1174
  break;
1186
1175
  }
1187
1176
  throw new errors.InvalidParameterError("Bad parameter: color2_link must be of type String, received ".concat((0, _utils.getType)(params.color2_link)));
1188
- case 40:
1177
+ case 39:
1189
1178
  if (!(params.color2_text && !(0, _utils.isString)(params.color2_text))) {
1190
- _context3.next = 41;
1179
+ _context3.next = 40;
1191
1180
  break;
1192
1181
  }
1193
1182
  throw new errors.InvalidParameterError("Bad parameter: color2_text must be of type String, received ".concat((0, _utils.getType)(params.color2_text)));
1194
- case 41:
1183
+ case 40:
1195
1184
  if (!(params.color2_top_text && !(0, _utils.isString)(params.color2_top_text))) {
1196
- _context3.next = 42;
1185
+ _context3.next = 41;
1197
1186
  break;
1198
1187
  }
1199
1188
  throw new errors.InvalidParameterError("Bad parameter: color2_top_text must be of type String, received ".concat((0, _utils.getType)(params.color2_top_text)));
1200
- case 42:
1189
+ case 41:
1201
1190
  if (!(params.site_header && !(0, _utils.isString)(params.site_header))) {
1202
- _context3.next = 43;
1191
+ _context3.next = 42;
1203
1192
  break;
1204
1193
  }
1205
1194
  throw new errors.InvalidParameterError("Bad parameter: site_header must be of type String, received ".concat((0, _utils.getType)(params.site_header)));
1206
- case 43:
1195
+ case 42:
1207
1196
  if (!(params.site_footer && !(0, _utils.isString)(params.site_footer))) {
1208
- _context3.next = 44;
1197
+ _context3.next = 43;
1209
1198
  break;
1210
1199
  }
1211
1200
  throw new errors.InvalidParameterError("Bad parameter: site_footer must be of type String, received ".concat((0, _utils.getType)(params.site_footer)));
1212
- case 44:
1201
+ case 43:
1213
1202
  if (!(params.login_help_text && !(0, _utils.isString)(params.login_help_text))) {
1214
- _context3.next = 45;
1203
+ _context3.next = 44;
1215
1204
  break;
1216
1205
  }
1217
1206
  throw new errors.InvalidParameterError("Bad parameter: login_help_text must be of type String, received ".concat((0, _utils.getType)(params.login_help_text)));
1218
- case 45:
1207
+ case 44:
1219
1208
  if (!(params.smtp_address && !(0, _utils.isString)(params.smtp_address))) {
1220
- _context3.next = 46;
1209
+ _context3.next = 45;
1221
1210
  break;
1222
1211
  }
1223
1212
  throw new errors.InvalidParameterError("Bad parameter: smtp_address must be of type String, received ".concat((0, _utils.getType)(params.smtp_address)));
1224
- case 46:
1213
+ case 45:
1225
1214
  if (!(params.smtp_authentication && !(0, _utils.isString)(params.smtp_authentication))) {
1226
- _context3.next = 47;
1215
+ _context3.next = 46;
1227
1216
  break;
1228
1217
  }
1229
1218
  throw new errors.InvalidParameterError("Bad parameter: smtp_authentication must be of type String, received ".concat((0, _utils.getType)(params.smtp_authentication)));
1230
- case 47:
1219
+ case 46:
1231
1220
  if (!(params.smtp_from && !(0, _utils.isString)(params.smtp_from))) {
1232
- _context3.next = 48;
1221
+ _context3.next = 47;
1233
1222
  break;
1234
1223
  }
1235
1224
  throw new errors.InvalidParameterError("Bad parameter: smtp_from must be of type String, received ".concat((0, _utils.getType)(params.smtp_from)));
1236
- case 48:
1225
+ case 47:
1237
1226
  if (!(params.smtp_username && !(0, _utils.isString)(params.smtp_username))) {
1238
- _context3.next = 49;
1227
+ _context3.next = 48;
1239
1228
  break;
1240
1229
  }
1241
1230
  throw new errors.InvalidParameterError("Bad parameter: smtp_username must be of type String, received ".concat((0, _utils.getType)(params.smtp_username)));
1242
- case 49:
1231
+ case 48:
1243
1232
  if (!(params.smtp_port && !(0, _utils.isInt)(params.smtp_port))) {
1244
- _context3.next = 50;
1233
+ _context3.next = 49;
1245
1234
  break;
1246
1235
  }
1247
1236
  throw new errors.InvalidParameterError("Bad parameter: smtp_port must be of type Int, received ".concat((0, _utils.getType)(params.smtp_port)));
1248
- case 50:
1237
+ case 49:
1249
1238
  if (!(params.ldap_type && !(0, _utils.isString)(params.ldap_type))) {
1250
- _context3.next = 51;
1239
+ _context3.next = 50;
1251
1240
  break;
1252
1241
  }
1253
1242
  throw new errors.InvalidParameterError("Bad parameter: ldap_type must be of type String, received ".concat((0, _utils.getType)(params.ldap_type)));
1254
- case 51:
1243
+ case 50:
1255
1244
  if (!(params.ldap_host && !(0, _utils.isString)(params.ldap_host))) {
1256
- _context3.next = 52;
1245
+ _context3.next = 51;
1257
1246
  break;
1258
1247
  }
1259
1248
  throw new errors.InvalidParameterError("Bad parameter: ldap_host must be of type String, received ".concat((0, _utils.getType)(params.ldap_host)));
1260
- case 52:
1249
+ case 51:
1261
1250
  if (!(params.ldap_host_2 && !(0, _utils.isString)(params.ldap_host_2))) {
1262
- _context3.next = 53;
1251
+ _context3.next = 52;
1263
1252
  break;
1264
1253
  }
1265
1254
  throw new errors.InvalidParameterError("Bad parameter: ldap_host_2 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_2)));
1266
- case 53:
1255
+ case 52:
1267
1256
  if (!(params.ldap_host_3 && !(0, _utils.isString)(params.ldap_host_3))) {
1268
- _context3.next = 54;
1257
+ _context3.next = 53;
1269
1258
  break;
1270
1259
  }
1271
1260
  throw new errors.InvalidParameterError("Bad parameter: ldap_host_3 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_3)));
1272
- case 54:
1261
+ case 53:
1273
1262
  if (!(params.ldap_port && !(0, _utils.isInt)(params.ldap_port))) {
1274
- _context3.next = 55;
1263
+ _context3.next = 54;
1275
1264
  break;
1276
1265
  }
1277
1266
  throw new errors.InvalidParameterError("Bad parameter: ldap_port must be of type Int, received ".concat((0, _utils.getType)(params.ldap_port)));
1278
- case 55:
1267
+ case 54:
1279
1268
  if (!(params.ldap_username && !(0, _utils.isString)(params.ldap_username))) {
1280
- _context3.next = 56;
1269
+ _context3.next = 55;
1281
1270
  break;
1282
1271
  }
1283
1272
  throw new errors.InvalidParameterError("Bad parameter: ldap_username must be of type String, received ".concat((0, _utils.getType)(params.ldap_username)));
1284
- case 56:
1273
+ case 55:
1285
1274
  if (!(params.ldap_username_field && !(0, _utils.isString)(params.ldap_username_field))) {
1286
- _context3.next = 57;
1275
+ _context3.next = 56;
1287
1276
  break;
1288
1277
  }
1289
1278
  throw new errors.InvalidParameterError("Bad parameter: ldap_username_field must be of type String, received ".concat((0, _utils.getType)(params.ldap_username_field)));
1290
- case 57:
1279
+ case 56:
1291
1280
  if (!(params.ldap_domain && !(0, _utils.isString)(params.ldap_domain))) {
1292
- _context3.next = 58;
1281
+ _context3.next = 57;
1293
1282
  break;
1294
1283
  }
1295
1284
  throw new errors.InvalidParameterError("Bad parameter: ldap_domain must be of type String, received ".concat((0, _utils.getType)(params.ldap_domain)));
1296
- case 58:
1285
+ case 57:
1297
1286
  if (!(params.ldap_user_action && !(0, _utils.isString)(params.ldap_user_action))) {
1298
- _context3.next = 59;
1287
+ _context3.next = 58;
1299
1288
  break;
1300
1289
  }
1301
1290
  throw new errors.InvalidParameterError("Bad parameter: ldap_user_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_action)));
1302
- case 59:
1291
+ case 58:
1303
1292
  if (!(params.ldap_group_action && !(0, _utils.isString)(params.ldap_group_action))) {
1304
- _context3.next = 60;
1293
+ _context3.next = 59;
1305
1294
  break;
1306
1295
  }
1307
1296
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_action)));
1308
- case 60:
1297
+ case 59:
1309
1298
  if (!(params.ldap_user_include_groups && !(0, _utils.isString)(params.ldap_user_include_groups))) {
1310
- _context3.next = 61;
1299
+ _context3.next = 60;
1311
1300
  break;
1312
1301
  }
1313
1302
  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)));
1314
- case 61:
1303
+ case 60:
1315
1304
  if (!(params.ldap_group_exclusion && !(0, _utils.isString)(params.ldap_group_exclusion))) {
1316
- _context3.next = 62;
1305
+ _context3.next = 61;
1317
1306
  break;
1318
1307
  }
1319
1308
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_exclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_exclusion)));
1320
- case 62:
1309
+ case 61:
1321
1310
  if (!(params.ldap_group_inclusion && !(0, _utils.isString)(params.ldap_group_inclusion))) {
1322
- _context3.next = 63;
1311
+ _context3.next = 62;
1323
1312
  break;
1324
1313
  }
1325
1314
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_inclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_inclusion)));
1326
- case 63:
1315
+ case 62:
1327
1316
  if (!(params.ldap_base_dn && !(0, _utils.isString)(params.ldap_base_dn))) {
1328
- _context3.next = 64;
1317
+ _context3.next = 63;
1329
1318
  break;
1330
1319
  }
1331
1320
  throw new errors.InvalidParameterError("Bad parameter: ldap_base_dn must be of type String, received ".concat((0, _utils.getType)(params.ldap_base_dn)));
1332
- case 64:
1321
+ case 63:
1333
1322
  if (!(params.ldap_password_change && !(0, _utils.isString)(params.ldap_password_change))) {
1334
- _context3.next = 65;
1323
+ _context3.next = 64;
1335
1324
  break;
1336
1325
  }
1337
1326
  throw new errors.InvalidParameterError("Bad parameter: ldap_password_change must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change)));
1338
- case 65:
1327
+ case 64:
1339
1328
  if (!(params.ldap_password_change_confirmation && !(0, _utils.isString)(params.ldap_password_change_confirmation))) {
1340
- _context3.next = 66;
1329
+ _context3.next = 65;
1341
1330
  break;
1342
1331
  }
1343
1332
  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)));
1344
- case 66:
1333
+ case 65:
1345
1334
  if (!(params.smtp_password && !(0, _utils.isString)(params.smtp_password))) {
1346
- _context3.next = 67;
1335
+ _context3.next = 66;
1347
1336
  break;
1348
1337
  }
1349
1338
  throw new errors.InvalidParameterError("Bad parameter: smtp_password must be of type String, received ".concat((0, _utils.getType)(params.smtp_password)));
1350
- case 67:
1339
+ case 66:
1351
1340
  if (!(params.session_expiry_minutes && !(0, _utils.isInt)(params.session_expiry_minutes))) {
1352
- _context3.next = 68;
1341
+ _context3.next = 67;
1353
1342
  break;
1354
1343
  }
1355
1344
  throw new errors.InvalidParameterError("Bad parameter: session_expiry_minutes must be of type Int, received ".concat((0, _utils.getType)(params.session_expiry_minutes)));
1356
- case 68:
1357
- _context3.next = 69;
1345
+ case 67:
1346
+ _context3.next = 68;
1358
1347
  return _Api.default.sendRequest('/site', 'PATCH', params, options);
1359
- case 69:
1348
+ case 68:
1360
1349
  response = _context3.sent;
1361
1350
  return _context3.abrupt("return", new _Site(response === null || response === void 0 ? void 0 : response.data, options));
1362
- case 70:
1351
+ case 69:
1363
1352
  case "end":
1364
1353
  return _context3.stop();
1365
1354
  }
@@ -201,6 +201,13 @@ var Sync = /*#__PURE__*/(0, _createClass2.default)(function Sync() {
201
201
  (0, _defineProperty2.default)(this, "setScheduleTimeZone", function (value) {
202
202
  _this.attributes.schedule_time_zone = value;
203
203
  });
204
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
205
+ (0, _defineProperty2.default)(this, "getHolidayRegion", function () {
206
+ return _this.attributes.holiday_region;
207
+ });
208
+ (0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
209
+ _this.attributes.holiday_region = value;
210
+ });
204
211
  // Manually Run Sync
205
212
  (0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
206
213
  var params,
@@ -74,6 +74,13 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
74
74
  (0, _defineProperty2.default)(this, "setAction", function (value) {
75
75
  _this.attributes.action = value;
76
76
  });
77
+ // string # State of the users to apply the rule to (inactive or disabled)
78
+ (0, _defineProperty2.default)(this, "getUserState", function () {
79
+ return _this.attributes.user_state;
80
+ });
81
+ (0, _defineProperty2.default)(this, "setUserState", function (value) {
82
+ _this.attributes.user_state = value;
83
+ });
77
84
  // int64 # Site ID
78
85
  (0, _defineProperty2.default)(this, "getSiteId", function () {
79
86
  return _this.attributes.site_id;
@@ -87,6 +94,7 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
87
94
  // inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
88
95
  // include_site_admins - boolean - Include site admins in the rule
89
96
  // include_folder_admins - boolean - Include folder admins in the rule
97
+ // user_state - string - State of the users to apply the rule to (inactive or disabled)
90
98
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
91
99
  var params,
92
100
  response,
@@ -132,68 +140,74 @@ var UserLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function UserLif
132
140
  }
133
141
  throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
134
142
  case 6:
143
+ if (!(params.user_state && !(0, _utils.isString)(params.user_state))) {
144
+ _context.next = 7;
145
+ break;
146
+ }
147
+ throw new errors.InvalidParameterError("Bad parameter: user_state must be of type String, received ".concat((0, _utils.getType)(params.user_state)));
148
+ case 7:
135
149
  if (params.id) {
136
- _context.next = 8;
150
+ _context.next = 9;
137
151
  break;
138
152
  }
139
153
  if (!_this.attributes.id) {
140
- _context.next = 7;
154
+ _context.next = 8;
141
155
  break;
142
156
  }
143
157
  params.id = _this.id;
144
- _context.next = 8;
158
+ _context.next = 9;
145
159
  break;
146
- case 7:
147
- throw new errors.MissingParameterError('Parameter missing: id');
148
160
  case 8:
161
+ throw new errors.MissingParameterError('Parameter missing: id');
162
+ case 9:
149
163
  if (params.action) {
150
- _context.next = 10;
164
+ _context.next = 11;
151
165
  break;
152
166
  }
153
167
  if (!_this.attributes.action) {
154
- _context.next = 9;
168
+ _context.next = 10;
155
169
  break;
156
170
  }
157
171
  params.action = _this.action;
158
- _context.next = 10;
172
+ _context.next = 11;
159
173
  break;
160
- case 9:
161
- throw new errors.MissingParameterError('Parameter missing: action');
162
174
  case 10:
175
+ throw new errors.MissingParameterError('Parameter missing: action');
176
+ case 11:
163
177
  if (params.authentication_method) {
164
- _context.next = 12;
178
+ _context.next = 13;
165
179
  break;
166
180
  }
167
181
  if (!_this.attributes.authentication_method) {
168
- _context.next = 11;
182
+ _context.next = 12;
169
183
  break;
170
184
  }
171
185
  params.authentication_method = _this.authentication_method;
172
- _context.next = 12;
186
+ _context.next = 13;
173
187
  break;
174
- case 11:
175
- throw new errors.MissingParameterError('Parameter missing: authentication_method');
176
188
  case 12:
189
+ throw new errors.MissingParameterError('Parameter missing: authentication_method');
190
+ case 13:
177
191
  if (params.inactivity_days) {
178
- _context.next = 14;
192
+ _context.next = 15;
179
193
  break;
180
194
  }
181
195
  if (!_this.attributes.inactivity_days) {
182
- _context.next = 13;
196
+ _context.next = 14;
183
197
  break;
184
198
  }
185
199
  params.inactivity_days = _this.inactivity_days;
186
- _context.next = 14;
200
+ _context.next = 15;
187
201
  break;
188
- case 13:
189
- throw new errors.MissingParameterError('Parameter missing: inactivity_days');
190
202
  case 14:
191
- _context.next = 15;
192
- return _Api.default.sendRequest("/user_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
203
+ throw new errors.MissingParameterError('Parameter missing: inactivity_days');
193
204
  case 15:
205
+ _context.next = 16;
206
+ return _Api.default.sendRequest("/user_lifecycle_rules/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
207
+ case 16:
194
208
  response = _context.sent;
195
209
  return _context.abrupt("return", new UserLifecycleRule(response === null || response === void 0 ? void 0 : response.data, _this.options));
196
- case 16:
210
+ case 17:
197
211
  case "end":
198
212
  return _context.stop();
199
213
  }
@@ -395,6 +409,7 @@ _UserLifecycleRule = UserLifecycleRule;
395
409
  // inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
396
410
  // include_site_admins - boolean - Include site admins in the rule
397
411
  // include_folder_admins - boolean - Include folder admins in the rule
412
+ // user_state - string - State of the users to apply the rule to (inactive or disabled)
398
413
  (0, _defineProperty2.default)(UserLifecycleRule, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
399
414
  var params,
400
415
  options,
@@ -441,12 +456,18 @@ _UserLifecycleRule = UserLifecycleRule;
441
456
  }
442
457
  throw new errors.InvalidParameterError("Bad parameter: inactivity_days must be of type Int, received ".concat((0, _utils.getType)(params.inactivity_days)));
443
458
  case 6:
444
- _context6.next = 7;
445
- return _Api.default.sendRequest('/user_lifecycle_rules', 'POST', params, options);
459
+ if (!(params.user_state && !(0, _utils.isString)(params.user_state))) {
460
+ _context6.next = 7;
461
+ break;
462
+ }
463
+ throw new errors.InvalidParameterError("Bad parameter: user_state must be of type String, received ".concat((0, _utils.getType)(params.user_state)));
446
464
  case 7:
465
+ _context6.next = 8;
466
+ return _Api.default.sendRequest('/user_lifecycle_rules', 'POST', params, options);
467
+ case 8:
447
468
  response = _context6.sent;
448
469
  return _context6.abrupt("return", new _UserLifecycleRule(response === null || response === void 0 ? void 0 : response.data, options));
449
- case 8:
470
+ case 9:
450
471
  case "end":
451
472
  return _context6.stop();
452
473
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.271",
3
+ "version": "1.2.273",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -6,7 +6,7 @@ let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
8
  let language = null
9
- const version = '1.2.271'
9
+ const version = '1.2.273'
10
10
  let userAgent = `Files.com JavaScript SDK v${version}`
11
11
 
12
12
  let logLevel = LogLevel.INFO
@@ -294,6 +294,13 @@ class Automation {
294
294
  this.attributes.webhook_url = value
295
295
  }
296
296
 
297
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
298
+ getHolidayRegion = () => this.attributes.holiday_region
299
+
300
+ setHolidayRegion = value => {
301
+ this.attributes.holiday_region = value
302
+ }
303
+
297
304
  // Manually Run Automation
298
305
  manualRun = async (params = {}) => {
299
306
  if (!this.attributes.id) {
@@ -0,0 +1,58 @@
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 HolidayRegion
11
+ */
12
+ class HolidayRegion {
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 # The code representing a region
32
+ getCode = () => this.attributes.code
33
+
34
+ // string # The name of the region
35
+ getName = () => this.attributes.name
36
+
37
+ // Parameters:
38
+ // 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.
39
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
40
+ static getSupported = async (params = {}, options = {}) => {
41
+ if (params.cursor && !isString(params.cursor)) {
42
+ throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
43
+ }
44
+
45
+ if (params.per_page && !isInt(params.per_page)) {
46
+ throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
47
+ }
48
+
49
+ const response = await Api.sendRequest('/holiday_regions/supported', 'GET', params, options)
50
+
51
+ return response?.data?.map(obj => new HolidayRegion(obj, options)) || []
52
+ }
53
+ }
54
+
55
+ export default HolidayRegion
56
+
57
+ module.exports = HolidayRegion
58
+ module.exports.default = HolidayRegion
@@ -169,9 +169,6 @@ class Site {
169
169
  // boolean # Use user FTP roots also for WebDAV?
170
170
  getDavUserRootEnabled = () => this.attributes.dav_user_root_enabled
171
171
 
172
- // int64 # Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
173
- getDaysBeforeDeletingDisabledUsers = () => this.attributes.days_before_deleting_disabled_users
174
-
175
172
  // int64 # Number of days to keep deleted files
176
173
  getDaysToRetainBackups = () => this.attributes.days_to_retain_backups
177
174
 
@@ -612,7 +609,6 @@ class Site {
612
609
  // allowed_countries - string - Comma separated list of allowed Country codes
613
610
  // allowed_ips - string - List of allowed IP addresses
614
611
  // disallowed_countries - string - Comma separated list of disallowed Country codes
615
- // days_before_deleting_disabled_users - int64 - Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted.
616
612
  // days_to_retain_backups - int64 - Number of days to keep deleted files
617
613
  // max_prior_passwords - int64 - Number of prior passwords to disallow
618
614
  // password_validity_days - int64 - Number of days password is valid
@@ -817,10 +813,6 @@ class Site {
817
813
  throw new errors.InvalidParameterError(`Bad parameter: disallowed_countries must be of type String, received ${getType(params.disallowed_countries)}`)
818
814
  }
819
815
 
820
- if (params.days_before_deleting_disabled_users && !isInt(params.days_before_deleting_disabled_users)) {
821
- throw new errors.InvalidParameterError(`Bad parameter: days_before_deleting_disabled_users must be of type Int, received ${getType(params.days_before_deleting_disabled_users)}`)
822
- }
823
-
824
816
  if (params.days_to_retain_backups && !isInt(params.days_to_retain_backups)) {
825
817
  throw new errors.InvalidParameterError(`Bad parameter: days_to_retain_backups must be of type Int, received ${getType(params.days_to_retain_backups)}`)
826
818
  }
@@ -195,6 +195,13 @@ class Sync {
195
195
  this.attributes.schedule_time_zone = value
196
196
  }
197
197
 
198
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
199
+ getHolidayRegion = () => this.attributes.holiday_region
200
+
201
+ setHolidayRegion = value => {
202
+ this.attributes.holiday_region = value
203
+ }
204
+
198
205
  // Manually Run Sync
199
206
  manualRun = async (params = {}) => {
200
207
  if (!this.attributes.id) {
@@ -70,6 +70,13 @@ class UserLifecycleRule {
70
70
  this.attributes.action = value
71
71
  }
72
72
 
73
+ // string # State of the users to apply the rule to (inactive or disabled)
74
+ getUserState = () => this.attributes.user_state
75
+
76
+ setUserState = value => {
77
+ this.attributes.user_state = value
78
+ }
79
+
73
80
  // int64 # Site ID
74
81
  getSiteId = () => this.attributes.site_id
75
82
 
@@ -83,6 +90,7 @@ class UserLifecycleRule {
83
90
  // inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
84
91
  // include_site_admins - boolean - Include site admins in the rule
85
92
  // include_folder_admins - boolean - Include folder admins in the rule
93
+ // user_state - string - State of the users to apply the rule to (inactive or disabled)
86
94
  update = async (params = {}) => {
87
95
  if (!this.attributes.id) {
88
96
  throw new errors.EmptyPropertyError('Current object has no id')
@@ -109,6 +117,10 @@ class UserLifecycleRule {
109
117
  throw new errors.InvalidParameterError(`Bad parameter: inactivity_days must be of type Int, received ${getType(params.inactivity_days)}`)
110
118
  }
111
119
 
120
+ if (params.user_state && !isString(params.user_state)) {
121
+ throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
122
+ }
123
+
112
124
  if (!params.id) {
113
125
  if (this.attributes.id) {
114
126
  params.id = this.id
@@ -237,6 +249,7 @@ class UserLifecycleRule {
237
249
  // inactivity_days (required) - int64 - Number of days of inactivity before the rule applies
238
250
  // include_site_admins - boolean - Include site admins in the rule
239
251
  // include_folder_admins - boolean - Include folder admins in the rule
252
+ // user_state - string - State of the users to apply the rule to (inactive or disabled)
240
253
  static create = async (params = {}, options = {}) => {
241
254
  if (!params.action) {
242
255
  throw new errors.MissingParameterError('Parameter missing: action')
@@ -262,6 +275,10 @@ class UserLifecycleRule {
262
275
  throw new errors.InvalidParameterError(`Bad parameter: inactivity_days must be of type Int, received ${getType(params.inactivity_days)}`)
263
276
  }
264
277
 
278
+ if (params.user_state && !isString(params.user_state)) {
279
+ throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
280
+ }
281
+
265
282
  const response = await Api.sendRequest('/user_lifecycle_rules', 'POST', params, options)
266
283
 
267
284
  return new UserLifecycleRule(response?.data, options)