files.com 1.2.46 → 1.2.48

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.46
1
+ 1.2.48
@@ -247,6 +247,7 @@ file.path = myFilePath
247
247
  await file.copy({
248
248
  'destination': "destination",
249
249
  'structure': true,
250
+ 'overwrite': true,
250
251
  })
251
252
  ```
252
253
 
@@ -255,6 +256,7 @@ await file.copy({
255
256
  * `path` (string): Required - Path to operate on.
256
257
  * `destination` (string): Required - Copy destination path.
257
258
  * `structure` (boolean): Copy structure only?
259
+ * `overwrite` (boolean): Overwrite existing file(s) in the destination?
258
260
 
259
261
  ### Example Response
260
262
 
@@ -275,6 +277,7 @@ file.path = myFilePath
275
277
 
276
278
  await file.move({
277
279
  'destination': "destination",
280
+ 'overwrite': true,
278
281
  })
279
282
  ```
280
283
 
@@ -282,6 +285,7 @@ await file.move({
282
285
 
283
286
  * `path` (string): Required - Path to operate on.
284
287
  * `destination` (string): Required - Move destination path.
288
+ * `overwrite` (boolean): Overwrite existing file(s) in the destination?
285
289
 
286
290
  ### Example Response
287
291
 
@@ -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.46';
14
+ var version = '1.2.48';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -548,6 +548,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
548
548
  // Parameters:
549
549
  // destination (required) - string - Copy destination path.
550
550
  // structure - boolean - Copy structure only?
551
+ // overwrite - boolean - Overwrite existing file(s) in the destination?
551
552
  (0, _defineProperty2.default)(this, "copy", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
552
553
  var params,
553
554
  response,
@@ -626,6 +627,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
626
627
  //
627
628
  // Parameters:
628
629
  // destination (required) - string - Move destination path.
630
+ // overwrite - boolean - Overwrite existing file(s) in the destination?
629
631
  (0, _defineProperty2.default)(this, "move", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
630
632
  var params,
631
633
  response,
@@ -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.user_lockout_tries && !(0, _utils.isInt)(params.user_lockout_tries))) {
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: user_lockout_tries must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_tries)));
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.user_lockout_within && !(0, _utils.isInt)(params.user_lockout_within))) {
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: user_lockout_within must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_within)));
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.user_lockout_lock_period && !(0, _utils.isInt)(params.user_lockout_lock_period))) {
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: user_lockout_lock_period must be of type Int, received ".concat((0, _utils.getType)(params.user_lockout_lock_period)));
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.allowed_countries && !(0, _utils.isString)(params.allowed_countries))) {
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: allowed_countries must be of type String, received ".concat((0, _utils.getType)(params.allowed_countries)));
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.allowed_ips && !(0, _utils.isString)(params.allowed_ips))) {
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: allowed_ips must be of type String, received ".concat((0, _utils.getType)(params.allowed_ips)));
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.disallowed_countries && !(0, _utils.isString)(params.disallowed_countries))) {
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: disallowed_countries must be of type String, received ".concat((0, _utils.getType)(params.disallowed_countries)));
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.days_to_retain_backups && !(0, _utils.isInt)(params.days_to_retain_backups))) {
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: days_to_retain_backups must be of type Int, received ".concat((0, _utils.getType)(params.days_to_retain_backups)));
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.max_prior_passwords && !(0, _utils.isInt)(params.max_prior_passwords))) {
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: max_prior_passwords must be of type Int, received ".concat((0, _utils.getType)(params.max_prior_passwords)));
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.password_validity_days && !(0, _utils.isInt)(params.password_validity_days))) {
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: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params.password_validity_days)));
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.password_min_length && !(0, _utils.isInt)(params.password_min_length))) {
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: password_min_length must be of type Int, received ".concat((0, _utils.getType)(params.password_min_length)));
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.bundle_not_found_message && !(0, _utils.isString)(params.bundle_not_found_message))) {
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: bundle_not_found_message must be of type String, received ".concat((0, _utils.getType)(params.bundle_not_found_message)));
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.bundle_registration_notifications && !(0, _utils.isString)(params.bundle_registration_notifications))) {
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: bundle_registration_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_registration_notifications)));
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.bundle_activity_notifications && !(0, _utils.isString)(params.bundle_activity_notifications))) {
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: bundle_activity_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_activity_notifications)));
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.bundle_upload_receipt_notifications && !(0, _utils.isString)(params.bundle_upload_receipt_notifications))) {
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: bundle_upload_receipt_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_upload_receipt_notifications)));
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.disable_users_from_inactivity_period_days && !(0, _utils.isInt)(params.disable_users_from_inactivity_period_days))) {
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: disable_users_from_inactivity_period_days must be of type Int, received ".concat((0, _utils.getType)(params.disable_users_from_inactivity_period_days)));
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.sftp_host_key_type && !(0, _utils.isString)(params.sftp_host_key_type))) {
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: sftp_host_key_type must be of type String, received ".concat((0, _utils.getType)(params.sftp_host_key_type)));
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.active_sftp_host_key_id && !(0, _utils.isInt)(params.active_sftp_host_key_id))) {
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: active_sftp_host_key_id must be of type Int, received ".concat((0, _utils.getType)(params.active_sftp_host_key_id)));
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.bundle_recipient_blacklist_domains && !(0, _utils.isArray)(params.bundle_recipient_blacklist_domains))) {
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: bundle_recipient_blacklist_domains must be of type Array, received ".concat((0, _utils.getType)(params.bundle_recipient_blacklist_domains)));
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.require_2fa_user_type && !(0, _utils.isString)(params.require_2fa_user_type))) {
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: require_2fa_user_type must be of type String, received ".concat((0, _utils.getType)(params.require_2fa_user_type)));
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.color2_top && !(0, _utils.isString)(params.color2_top))) {
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: color2_top must be of type String, received ".concat((0, _utils.getType)(params.color2_top)));
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.color2_left && !(0, _utils.isString)(params.color2_left))) {
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: color2_left must be of type String, received ".concat((0, _utils.getType)(params.color2_left)));
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.color2_link && !(0, _utils.isString)(params.color2_link))) {
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: color2_link must be of type String, received ".concat((0, _utils.getType)(params.color2_link)));
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.color2_text && !(0, _utils.isString)(params.color2_text))) {
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: color2_text must be of type String, received ".concat((0, _utils.getType)(params.color2_text)));
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.color2_top_text && !(0, _utils.isString)(params.color2_top_text))) {
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: color2_top_text must be of type String, received ".concat((0, _utils.getType)(params.color2_top_text)));
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.site_header && !(0, _utils.isString)(params.site_header))) {
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: site_header must be of type String, received ".concat((0, _utils.getType)(params.site_header)));
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.site_footer && !(0, _utils.isString)(params.site_footer))) {
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: site_footer must be of type String, received ".concat((0, _utils.getType)(params.site_footer)));
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.login_help_text && !(0, _utils.isString)(params.login_help_text))) {
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: login_help_text must be of type String, received ".concat((0, _utils.getType)(params.login_help_text)));
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.smtp_address && !(0, _utils.isString)(params.smtp_address))) {
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: smtp_address must be of type String, received ".concat((0, _utils.getType)(params.smtp_address)));
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.smtp_authentication && !(0, _utils.isString)(params.smtp_authentication))) {
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: smtp_authentication must be of type String, received ".concat((0, _utils.getType)(params.smtp_authentication)));
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.smtp_from && !(0, _utils.isString)(params.smtp_from))) {
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: smtp_from must be of type String, received ".concat((0, _utils.getType)(params.smtp_from)));
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.smtp_username && !(0, _utils.isString)(params.smtp_username))) {
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: smtp_username must be of type String, received ".concat((0, _utils.getType)(params.smtp_username)));
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.smtp_port && !(0, _utils.isInt)(params.smtp_port))) {
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: smtp_port must be of type Int, received ".concat((0, _utils.getType)(params.smtp_port)));
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.ldap_type && !(0, _utils.isString)(params.ldap_type))) {
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: ldap_type must be of type String, received ".concat((0, _utils.getType)(params.ldap_type)));
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.ldap_host && !(0, _utils.isString)(params.ldap_host))) {
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: ldap_host must be of type String, received ".concat((0, _utils.getType)(params.ldap_host)));
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.ldap_host_2 && !(0, _utils.isString)(params.ldap_host_2))) {
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: ldap_host_2 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_2)));
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.ldap_host_3 && !(0, _utils.isString)(params.ldap_host_3))) {
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: ldap_host_3 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_3)));
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.ldap_port && !(0, _utils.isInt)(params.ldap_port))) {
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: ldap_port must be of type Int, received ".concat((0, _utils.getType)(params.ldap_port)));
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.ldap_username && !(0, _utils.isString)(params.ldap_username))) {
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: ldap_username must be of type String, received ".concat((0, _utils.getType)(params.ldap_username)));
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.ldap_username_field && !(0, _utils.isString)(params.ldap_username_field))) {
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: ldap_username_field must be of type String, received ".concat((0, _utils.getType)(params.ldap_username_field)));
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.ldap_domain && !(0, _utils.isString)(params.ldap_domain))) {
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: ldap_domain must be of type String, received ".concat((0, _utils.getType)(params.ldap_domain)));
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.ldap_user_action && !(0, _utils.isString)(params.ldap_user_action))) {
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: ldap_user_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_action)));
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.ldap_group_action && !(0, _utils.isString)(params.ldap_group_action))) {
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: ldap_group_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_action)));
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.ldap_user_include_groups && !(0, _utils.isString)(params.ldap_user_include_groups))) {
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: ldap_user_include_groups must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_include_groups)));
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.ldap_group_exclusion && !(0, _utils.isString)(params.ldap_group_exclusion))) {
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: ldap_group_exclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_exclusion)));
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.ldap_group_inclusion && !(0, _utils.isString)(params.ldap_group_inclusion))) {
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: ldap_group_inclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_inclusion)));
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.ldap_base_dn && !(0, _utils.isString)(params.ldap_base_dn))) {
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: ldap_base_dn must be of type String, received ".concat((0, _utils.getType)(params.ldap_base_dn)));
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.ldap_password_change && !(0, _utils.isString)(params.ldap_password_change))) {
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: ldap_password_change must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change)));
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.ldap_password_change_confirmation && !(0, _utils.isString)(params.ldap_password_change_confirmation))) {
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: ldap_password_change_confirmation must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change_confirmation)));
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.smtp_password && !(0, _utils.isString)(params.smtp_password))) {
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: smtp_password must be of type String, received ".concat((0, _utils.getType)(params.smtp_password)));
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.session_expiry_minutes && !(0, _utils.isInt)(params.session_expiry_minutes))) {
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: session_expiry_minutes must be of type Int, received ".concat((0, _utils.getType)(params.session_expiry_minutes)));
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
- _context3.next = 138;
1279
- return _Api.default.sendRequest('/site', 'PATCH', params, options);
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 140:
1294
+ case 142:
1284
1295
  case "end":
1285
1296
  return _context3.stop();
1286
1297
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.46'
8
+ const version = '1.2.48'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -609,6 +609,7 @@ class File {
609
609
  // Parameters:
610
610
  // destination (required) - string - Copy destination path.
611
611
  // structure - boolean - Copy structure only?
612
+ // overwrite - boolean - Overwrite existing file(s) in the destination?
612
613
  copy = async (params = {}) => {
613
614
  if (!this.attributes.path) {
614
615
  throw new errors.EmptyPropertyError('Current object has no path')
@@ -653,6 +654,7 @@ class File {
653
654
  //
654
655
  // Parameters:
655
656
  // destination (required) - string - Move destination path.
657
+ // overwrite - boolean - Overwrite existing file(s) in the destination?
656
658
  move = async (params = {}) => {
657
659
  if (!this.attributes.path) {
658
660
  throw new errors.EmptyPropertyError('Current object has no path')
@@ -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
  }