UNPKG

files.com

Version:
877 lines (876 loc) 78.9 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); exports.__esModule = true; exports.default = void 0; var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _Api = _interopRequireDefault(require("../Api")); var errors = _interopRequireWildcard(require("../Errors")); var _utils = require("../utils"); var _Site; /* eslint-disable no-unused-vars */ 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); } 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; } 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; } /* eslint-enable no-unused-vars */ /** * Class Site */ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() { var _this = this; var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; (0, _classCallCheck2.default)(this, Site); (0, _defineProperty2.default)(this, "attributes", {}); (0, _defineProperty2.default)(this, "options", {}); (0, _defineProperty2.default)(this, "isLoaded", function () { return !!_this.attributes.id; }); // int64 # Site Id (0, _defineProperty2.default)(this, "getId", function () { return _this.attributes.id; }); // string # Site name (0, _defineProperty2.default)(this, "getName", function () { return _this.attributes.name; }); // array(string) # Additional extensions that are considered text files (0, _defineProperty2.default)(this, "getAdditionalTextFileTypes", function () { return _this.attributes.additional_text_file_types; }); // boolean # Is SMS two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodSms", function () { return _this.attributes.allowed_2fa_method_sms; }); // boolean # Is TOTP two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodTotp", function () { return _this.attributes.allowed_2fa_method_totp; }); // boolean # Is WebAuthn two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodWebauthn", function () { return _this.attributes.allowed_2fa_method_webauthn; }); // boolean # Is yubikey two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodYubi", function () { return _this.attributes.allowed_2fa_method_yubi; }); // boolean # Is OTP via email two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodEmail", function () { return _this.attributes.allowed_2fa_method_email; }); // boolean # Is OTP via static codes for two factor authentication allowed? (0, _defineProperty2.default)(this, "getAllowed2faMethodStatic", function () { return _this.attributes.allowed_2fa_method_static; }); // boolean # Are users allowed to configure their two factor authentication to be bypassed for FTP/SFTP/WebDAV? (0, _defineProperty2.default)(this, "getAllowed2faMethodBypassForFtpSftpDav", function () { return _this.attributes.allowed_2fa_method_bypass_for_ftp_sftp_dav; }); // int64 # User ID for the main site administrator (0, _defineProperty2.default)(this, "getAdminUserId", function () { return _this.attributes.admin_user_id; }); // boolean # Allow admins to bypass the locked subfolders setting. (0, _defineProperty2.default)(this, "getAdminsBypassLockedSubfolders", function () { return _this.attributes.admins_bypass_locked_subfolders; }); // boolean # Are manual Bundle names allowed? (0, _defineProperty2.default)(this, "getAllowBundleNames", function () { return _this.attributes.allow_bundle_names; }); // string # Comma separated list of allowed Country codes (0, _defineProperty2.default)(this, "getAllowedCountries", function () { return _this.attributes.allowed_countries; }); // string # List of allowed IP addresses (0, _defineProperty2.default)(this, "getAllowedIps", function () { return _this.attributes.allowed_ips; }); // boolean # Create parent directories if they do not exist during uploads? This is primarily used to work around broken upload clients that assume servers will perform this step. (0, _defineProperty2.default)(this, "getAlwaysMkdirParents", function () { return _this.attributes.always_mkdir_parents; }); // boolean # If false, rename conflicting files instead of asking for overwrite confirmation. Only applies to web interface. (0, _defineProperty2.default)(this, "getAskAboutOverwrites", function () { return _this.attributes.ask_about_overwrites; }); // string # Do Bundle owners receive activity notifications? (0, _defineProperty2.default)(this, "getBundleActivityNotifications", function () { return _this.attributes.bundle_activity_notifications; }); // int64 # Site-wide Bundle expiration in days (0, _defineProperty2.default)(this, "getBundleExpiration", function () { return _this.attributes.bundle_expiration; }); // string # Custom error message to show when bundle is not found. (0, _defineProperty2.default)(this, "getBundleNotFoundMessage", function () { return _this.attributes.bundle_not_found_message; }); // boolean # Do Bundles require password protection? (0, _defineProperty2.default)(this, "getBundlePasswordRequired", function () { return _this.attributes.bundle_password_required; }); // array(string) # List of email domains to disallow when entering a Bundle/Inbox recipients (0, _defineProperty2.default)(this, "getBundleRecipientBlacklistDomains", function () { return _this.attributes.bundle_recipient_blacklist_domains; }); // boolean # Disallow free email domains for Bundle/Inbox recipients? (0, _defineProperty2.default)(this, "getBundleRecipientBlacklistFreeEmailDomains", function () { return _this.attributes.bundle_recipient_blacklist_free_email_domains; }); // string # Do Bundle owners receive registration notification? (0, _defineProperty2.default)(this, "getBundleRegistrationNotifications", function () { return _this.attributes.bundle_registration_notifications; }); // boolean # Do Bundles require registration? (0, _defineProperty2.default)(this, "getBundleRequireRegistration", function () { return _this.attributes.bundle_require_registration; }); // boolean # Do Bundles require recipients for sharing? (0, _defineProperty2.default)(this, "getBundleRequireShareRecipient", function () { return _this.attributes.bundle_require_share_recipient; }); // boolean # Do Bundles require internal notes? (0, _defineProperty2.default)(this, "getBundleRequireNote", function () { return _this.attributes.bundle_require_note; }); // boolean # Do Bundle creators receive receipts of invitations? (0, _defineProperty2.default)(this, "getBundleSendSharedReceipts", function () { return _this.attributes.bundle_send_shared_receipts; }); // string # Do Bundle uploaders receive upload confirmation notifications? (0, _defineProperty2.default)(this, "getBundleUploadReceiptNotifications", function () { return _this.attributes.bundle_upload_receipt_notifications; }); // Image # Preview watermark image applied to all bundle items. (0, _defineProperty2.default)(this, "getBundleWatermarkAttachment", function () { return _this.attributes.bundle_watermark_attachment; }); // object # Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value (0, _defineProperty2.default)(this, "getBundleWatermarkValue", function () { return _this.attributes.bundle_watermark_value; }); // boolean # Calculate CRC32 checksums for files? (0, _defineProperty2.default)(this, "getCalculateFileChecksumsCrc32", function () { return _this.attributes.calculate_file_checksums_crc32; }); // boolean # Calculate MD5 checksums for files? (0, _defineProperty2.default)(this, "getCalculateFileChecksumsMd5", function () { return _this.attributes.calculate_file_checksums_md5; }); // boolean # Calculate SHA1 checksums for files? (0, _defineProperty2.default)(this, "getCalculateFileChecksumsSha1", function () { return _this.attributes.calculate_file_checksums_sha1; }); // boolean # Calculate SHA256 checksums for files? (0, _defineProperty2.default)(this, "getCalculateFileChecksumsSha256", function () { return _this.attributes.calculate_file_checksums_sha256; }); // boolean # Do incoming emails in the Inboxes require checking for SPF/DKIM/DMARC? (0, _defineProperty2.default)(this, "getUploadsViaEmailAuthentication", function () { return _this.attributes.uploads_via_email_authentication; }); // string # Page link and button color (0, _defineProperty2.default)(this, "getColor2Left", function () { return _this.attributes.color2_left; }); // string # Top bar link color (0, _defineProperty2.default)(this, "getColor2Link", function () { return _this.attributes.color2_link; }); // string # Page link and button color (0, _defineProperty2.default)(this, "getColor2Text", function () { return _this.attributes.color2_text; }); // string # Top bar background color (0, _defineProperty2.default)(this, "getColor2Top", function () { return _this.attributes.color2_top; }); // string # Top bar text color (0, _defineProperty2.default)(this, "getColor2TopText", function () { return _this.attributes.color2_top_text; }); // string # Site main contact name (0, _defineProperty2.default)(this, "getContactName", function () { return _this.attributes.contact_name; }); // date-time # Time this site was created (0, _defineProperty2.default)(this, "getCreatedAt", function () { return _this.attributes.created_at; }); // string # Preferred currency (0, _defineProperty2.default)(this, "getCurrency", function () { return _this.attributes.currency; }); // boolean # Is this site using a custom namespace for users? (0, _defineProperty2.default)(this, "getCustomNamespace", function () { return _this.attributes.custom_namespace; }); // boolean # Is WebDAV enabled? (0, _defineProperty2.default)(this, "getDavEnabled", function () { return _this.attributes.dav_enabled; }); // boolean # Use user FTP roots also for WebDAV? (0, _defineProperty2.default)(this, "getDavUserRootEnabled", function () { return _this.attributes.dav_user_root_enabled; }); // int64 # Number of days to keep disabled users before deleting them. If set to 0, disabled users will not be deleted. (0, _defineProperty2.default)(this, "getDaysBeforeDeletingDisabledUsers", function () { return _this.attributes.days_before_deleting_disabled_users; }); // int64 # Number of days to keep deleted files (0, _defineProperty2.default)(this, "getDaysToRetainBackups", function () { return _this.attributes.days_to_retain_backups; }); // boolean # If true, allow public viewers of Bundles with full permissions to use document editing integrations. (0, _defineProperty2.default)(this, "getDocumentEditsInBundleAllowed", function () { return _this.attributes.document_edits_in_bundle_allowed; }); // string # Site default time zone (0, _defineProperty2.default)(this, "getDefaultTimeZone", function () { return _this.attributes.default_time_zone; }); // boolean # Is the desktop app enabled? (0, _defineProperty2.default)(this, "getDesktopApp", function () { return _this.attributes.desktop_app; }); // boolean # Is desktop app session IP pinning enabled? (0, _defineProperty2.default)(this, "getDesktopAppSessionIpPinning", function () { return _this.attributes.desktop_app_session_ip_pinning; }); // int64 # Desktop app session lifetime (in hours) (0, _defineProperty2.default)(this, "getDesktopAppSessionLifetime", function () { return _this.attributes.desktop_app_session_lifetime; }); // boolean # Use legacy checksums mode? (0, _defineProperty2.default)(this, "getLegacyChecksumsMode", function () { return _this.attributes.legacy_checksums_mode; }); // boolean # Is the mobile app enabled? (0, _defineProperty2.default)(this, "getMobileApp", function () { return _this.attributes.mobile_app; }); // boolean # Is mobile app session IP pinning enabled? (0, _defineProperty2.default)(this, "getMobileAppSessionIpPinning", function () { return _this.attributes.mobile_app_session_ip_pinning; }); // int64 # Mobile app session lifetime (in hours) (0, _defineProperty2.default)(this, "getMobileAppSessionLifetime", function () { return _this.attributes.mobile_app_session_lifetime; }); // string # Comma separated list of disallowed Country codes (0, _defineProperty2.default)(this, "getDisallowedCountries", function () { return _this.attributes.disallowed_countries; }); // boolean # If set, Files.com will not set the CAA records required to generate future SSL certificates for this domain. (0, _defineProperty2.default)(this, "getDisableFilesCertificateGeneration", function () { return _this.attributes.disable_files_certificate_generation; }); // boolean # Are notifications disabled? (0, _defineProperty2.default)(this, "getDisableNotifications", function () { return _this.attributes.disable_notifications; }); // boolean # Is password reset disabled? (0, _defineProperty2.default)(this, "getDisablePasswordReset", function () { return _this.attributes.disable_password_reset; }); // string # Custom domain (0, _defineProperty2.default)(this, "getDomain", function () { return _this.attributes.domain; }); // boolean # Send HSTS (HTTP Strict Transport Security) header when visitors access the site via a custom domain? (0, _defineProperty2.default)(this, "getDomainHstsHeader", function () { return _this.attributes.domain_hsts_header; }); // string # Letsencrypt chain to use when registering SSL Certificate for domain. (0, _defineProperty2.default)(this, "getDomainLetsencryptChain", function () { return _this.attributes.domain_letsencrypt_chain; }); // email # Main email for this site (0, _defineProperty2.default)(this, "getEmail", function () { return _this.attributes.email; }); // boolean # Is FTP enabled? (0, _defineProperty2.default)(this, "getFtpEnabled", function () { return _this.attributes.ftp_enabled; }); // email # Reply-to email for this site (0, _defineProperty2.default)(this, "getReplyToEmail", function () { return _this.attributes.reply_to_email; }); // boolean # If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider. (0, _defineProperty2.default)(this, "getNonSsoGroupsAllowed", function () { return _this.attributes.non_sso_groups_allowed; }); // boolean # If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider. (0, _defineProperty2.default)(this, "getNonSsoUsersAllowed", function () { return _this.attributes.non_sso_users_allowed; }); // boolean # If true, permissions for this site must be bound to a group (not a user). (0, _defineProperty2.default)(this, "getFolderPermissionsGroupsOnly", function () { return _this.attributes.folder_permissions_groups_only; }); // boolean # Is there a signed HIPAA BAA between Files.com and this site? (0, _defineProperty2.default)(this, "getHipaa", function () { return _this.attributes.hipaa; }); // Image # Branded icon 128x128 (0, _defineProperty2.default)(this, "getIcon128", function () { return _this.attributes.icon128; }); // Image # Branded icon 16x16 (0, _defineProperty2.default)(this, "getIcon16", function () { return _this.attributes.icon16; }); // Image # Branded icon 32x32 (0, _defineProperty2.default)(this, "getIcon32", function () { return _this.attributes.icon32; }); // Image # Branded icon 48x48 (0, _defineProperty2.default)(this, "getIcon48", function () { return _this.attributes.icon48; }); // date-time # Can files be modified? (0, _defineProperty2.default)(this, "getImmutableFilesSetAt", function () { return _this.attributes.immutable_files_set_at; }); // boolean # Include password in emails to new users? (0, _defineProperty2.default)(this, "getIncludePasswordInWelcomeEmail", function () { return _this.attributes.include_password_in_welcome_email; }); // string # Site default language (0, _defineProperty2.default)(this, "getLanguage", function () { return _this.attributes.language; }); // string # Base DN for looking up users in LDAP server (0, _defineProperty2.default)(this, "getLdapBaseDn", function () { return _this.attributes.ldap_base_dn; }); // string # Domain name that will be appended to usernames (0, _defineProperty2.default)(this, "getLdapDomain", function () { return _this.attributes.ldap_domain; }); // boolean # Main LDAP setting: is LDAP enabled? (0, _defineProperty2.default)(this, "getLdapEnabled", function () { return _this.attributes.ldap_enabled; }); // string # Should we sync groups from LDAP server? (0, _defineProperty2.default)(this, "getLdapGroupAction", function () { return _this.attributes.ldap_group_action; }); // string # Comma or newline separated list of group names (with optional wildcards) to exclude when syncing. (0, _defineProperty2.default)(this, "getLdapGroupExclusion", function () { return _this.attributes.ldap_group_exclusion; }); // string # Comma or newline separated list of group names (with optional wildcards) to include when syncing. (0, _defineProperty2.default)(this, "getLdapGroupInclusion", function () { return _this.attributes.ldap_group_inclusion; }); // string # LDAP host (0, _defineProperty2.default)(this, "getLdapHost", function () { return _this.attributes.ldap_host; }); // string # LDAP backup host (0, _defineProperty2.default)(this, "getLdapHost2", function () { return _this.attributes.ldap_host_2; }); // string # LDAP backup host (0, _defineProperty2.default)(this, "getLdapHost3", function () { return _this.attributes.ldap_host_3; }); // int64 # LDAP port (0, _defineProperty2.default)(this, "getLdapPort", function () { return _this.attributes.ldap_port; }); // boolean # Use secure LDAP? (0, _defineProperty2.default)(this, "getLdapSecure", function () { return _this.attributes.ldap_secure; }); // string # LDAP type (0, _defineProperty2.default)(this, "getLdapType", function () { return _this.attributes.ldap_type; }); // string # Should we sync users from LDAP server? (0, _defineProperty2.default)(this, "getLdapUserAction", function () { return _this.attributes.ldap_user_action; }); // string # Comma or newline separated list of group names (with optional wildcards) - if provided, only users in these groups will be added or synced. (0, _defineProperty2.default)(this, "getLdapUserIncludeGroups", function () { return _this.attributes.ldap_user_include_groups; }); // string # Username for signing in to LDAP server. (0, _defineProperty2.default)(this, "getLdapUsername", function () { return _this.attributes.ldap_username; }); // string # LDAP username field (0, _defineProperty2.default)(this, "getLdapUsernameField", function () { return _this.attributes.ldap_username_field; }); // string # Login help text (0, _defineProperty2.default)(this, "getLoginHelpText", function () { return _this.attributes.login_help_text; }); // Image # Branded logo (0, _defineProperty2.default)(this, "getLogo", function () { return _this.attributes.logo; }); // Image # Branded login page background (0, _defineProperty2.default)(this, "getLoginPageBackgroundImage", function () { return _this.attributes.login_page_background_image; }); // int64 # Number of prior passwords to disallow (0, _defineProperty2.default)(this, "getMaxPriorPasswords", function () { return _this.attributes.max_prior_passwords; }); // string # A message to show users when they connect via FTP or SFTP. (0, _defineProperty2.default)(this, "getMotdText", function () { return _this.attributes.motd_text; }); // boolean # Show message to users connecting via FTP (0, _defineProperty2.default)(this, "getMotdUseForFtp", function () { return _this.attributes.motd_use_for_ftp; }); // boolean # Show message to users connecting via SFTP (0, _defineProperty2.default)(this, "getMotdUseForSftp", function () { return _this.attributes.motd_use_for_sftp; }); // double # Next billing amount (0, _defineProperty2.default)(this, "getNextBillingAmount", function () { return _this.attributes.next_billing_amount; }); // string # Next billing date (0, _defineProperty2.default)(this, "getNextBillingDate", function () { return _this.attributes.next_billing_date; }); // boolean # If true, allows users to use a document editing integration. (0, _defineProperty2.default)(this, "getOfficeIntegrationAvailable", function () { return _this.attributes.office_integration_available; }); // string # Which document editing integration to support. Files.com Editor or Microsoft Office for the Web. (0, _defineProperty2.default)(this, "getOfficeIntegrationType", function () { return _this.attributes.office_integration_type; }); // string # Link to scheduling a meeting with our Sales team (0, _defineProperty2.default)(this, "getOncehubLink", function () { return _this.attributes.oncehub_link; }); // boolean # Use servers in the USA only? (0, _defineProperty2.default)(this, "getOptOutGlobal", function () { return _this.attributes.opt_out_global; }); // boolean # Is this site's billing overdue? (0, _defineProperty2.default)(this, "getOverdue", function () { return _this.attributes.overdue; }); // int64 # Shortest password length for users (0, _defineProperty2.default)(this, "getPasswordMinLength", function () { return _this.attributes.password_min_length; }); // boolean # Require a letter in passwords? (0, _defineProperty2.default)(this, "getPasswordRequireLetter", function () { return _this.attributes.password_require_letter; }); // boolean # Require lower and upper case letters in passwords? (0, _defineProperty2.default)(this, "getPasswordRequireMixed", function () { return _this.attributes.password_require_mixed; }); // boolean # Require a number in passwords? (0, _defineProperty2.default)(this, "getPasswordRequireNumber", function () { return _this.attributes.password_require_number; }); // boolean # Require special characters in password? (0, _defineProperty2.default)(this, "getPasswordRequireSpecial", function () { return _this.attributes.password_require_special; }); // boolean # Require passwords that have not been previously breached? (see https://haveibeenpwned.com/) (0, _defineProperty2.default)(this, "getPasswordRequireUnbreached", function () { return _this.attributes.password_require_unbreached; }); // boolean # Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords? (0, _defineProperty2.default)(this, "getPasswordRequirementsApplyToBundles", function () { return _this.attributes.password_requirements_apply_to_bundles; }); // int64 # Number of days password is valid (0, _defineProperty2.default)(this, "getPasswordValidityDays", function () { return _this.attributes.password_validity_days; }); // string # Site phone number (0, _defineProperty2.default)(this, "getPhone", function () { return _this.attributes.phone; }); // boolean # If true, we will ensure that all internal communications with any remote server are made through the primary region of the site. This setting overrides individual remote server settings. (0, _defineProperty2.default)(this, "getPinAllRemoteServersToSiteRegion", function () { return _this.attributes.pin_all_remote_servers_to_site_region; }); // boolean # If true, we will prevent non-administrators from receiving any permissions directly on the root folder. This is commonly used to prevent the accidental application of permissions. (0, _defineProperty2.default)(this, "getPreventRootPermissionsForNonSiteAdmins", function () { return _this.attributes.prevent_root_permissions_for_non_site_admins; }); // boolean # If true, protocol access permissions on users will be ignored, and only protocol access permissions set on Groups will be honored. Make sure that your current user is a member of a group with API permission when changing this value to avoid locking yourself out of your site. (0, _defineProperty2.default)(this, "getProtocolAccessGroupsOnly", function () { return _this.attributes.protocol_access_groups_only; }); // boolean # Require two-factor authentication for all users? (0, _defineProperty2.default)(this, "getRequire2fa", function () { return _this.attributes.require_2fa; }); // date-time # If set, requirement for two-factor authentication has been scheduled to end on this date-time. (0, _defineProperty2.default)(this, "getRequire2faStopTime", function () { return _this.attributes.require_2fa_stop_time; }); // boolean # Auto-removes bundles for disabled/deleted users and enforces bundle expiry within user access period. (0, _defineProperty2.default)(this, "getRevokeBundleAccessOnDisableOrDelete", function () { return _this.attributes.revoke_bundle_access_on_disable_or_delete; }); // string # What type of user is required to use two-factor authentication (when require_2fa is set to `true` for this site)? (0, _defineProperty2.default)(this, "getRequire2faUserType", function () { return _this.attributes.require_2fa_user_type; }); // boolean # If true, we will hide the 'Remember Me' box on Inbox and Bundle registration pages, requiring that the user logout and log back in every time they visit the page. (0, _defineProperty2.default)(this, "getRequireLogoutFromBundlesAndInboxes", function () { return _this.attributes.require_logout_from_bundles_and_inboxes; }); // Session # Current session (0, _defineProperty2.default)(this, "getSession", function () { return _this.attributes.session; }); // boolean # Is SFTP enabled? (0, _defineProperty2.default)(this, "getSftpEnabled", function () { return _this.attributes.sftp_enabled; }); // string # Sftp Host Key Type (0, _defineProperty2.default)(this, "getSftpHostKeyType", function () { return _this.attributes.sftp_host_key_type; }); // int64 # Id of the currently selected custom SFTP Host Key (0, _defineProperty2.default)(this, "getActiveSftpHostKeyId", function () { return _this.attributes.active_sftp_host_key_id; }); // boolean # If true, we will allow weak and known insecure ciphers to be used for SFTP connections. Enabling this setting severely weakens the security of your site and it is not recommend, except as a last resort for compatibility. (0, _defineProperty2.default)(this, "getSftpInsecureCiphers", function () { return _this.attributes.sftp_insecure_ciphers; }); // boolean # If true, we will allow weak Diffie Hellman parameters to be used within ciphers for SFTP that are otherwise on our secure list. This has the effect of making the cipher weaker than our normal threshold for security, but is required to support certain legacy or broken SSH and MFT clients. Enabling this weakens security, but not nearly as much as enabling the full `sftp_insecure_ciphers` option. (0, _defineProperty2.default)(this, "getSftpInsecureDiffieHellman", function () { return _this.attributes.sftp_insecure_diffie_hellman; }); // boolean # Use user FTP roots also for SFTP? (0, _defineProperty2.default)(this, "getSftpUserRootEnabled", function () { return _this.attributes.sftp_user_root_enabled; }); // boolean # Allow bundle creation (0, _defineProperty2.default)(this, "getSharingEnabled", function () { return _this.attributes.sharing_enabled; }); // boolean # Show log in link in user notifications? (0, _defineProperty2.default)(this, "getShowUserNotificationsLogInLink", function () { return _this.attributes.show_user_notifications_log_in_link; }); // boolean # Show request access link for users without access? Currently unused. (0, _defineProperty2.default)(this, "getShowRequestAccessLink", function () { return _this.attributes.show_request_access_link; }); // string # Custom site footer text (0, _defineProperty2.default)(this, "getSiteFooter", function () { return _this.attributes.site_footer; }); // string # Custom site header text (0, _defineProperty2.default)(this, "getSiteHeader", function () { return _this.attributes.site_header; }); // string # SMTP server hostname or IP (0, _defineProperty2.default)(this, "getSmtpAddress", function () { return _this.attributes.smtp_address; }); // string # SMTP server authentication type (0, _defineProperty2.default)(this, "getSmtpAuthentication", function () { return _this.attributes.smtp_authentication; }); // string # From address to use when mailing through custom SMTP (0, _defineProperty2.default)(this, "getSmtpFrom", function () { return _this.attributes.smtp_from; }); // int64 # SMTP server port (0, _defineProperty2.default)(this, "getSmtpPort", function () { return _this.attributes.smtp_port; }); // string # SMTP server username (0, _defineProperty2.default)(this, "getSmtpUsername", function () { return _this.attributes.smtp_username; }); // double # Session expiry in hours (0, _defineProperty2.default)(this, "getSessionExpiry", function () { return _this.attributes.session_expiry; }); // int64 # Session expiry in minutes (0, _defineProperty2.default)(this, "getSessionExpiryMinutes", function () { return _this.attributes.session_expiry_minutes; }); // boolean # Allow snapshot share links creation (0, _defineProperty2.default)(this, "getSnapshotSharingEnabled", function () { return _this.attributes.snapshot_sharing_enabled; }); // boolean # Is SSL required? Disabling this is insecure. (0, _defineProperty2.default)(this, "getSslRequired", function () { return _this.attributes.ssl_required; }); // string # Site subdomain (0, _defineProperty2.default)(this, "getSubdomain", function () { return _this.attributes.subdomain; }); // date-time # If switching plans, when does the new plan take effect? (0, _defineProperty2.default)(this, "getSwitchToPlanDate", function () { return _this.attributes.switch_to_plan_date; }); // 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. (0, _defineProperty2.default)(this, "getTlsDisabled", function () { return _this.attributes.tls_disabled; }); // int64 # Number of days left in trial (0, _defineProperty2.default)(this, "getTrialDaysLeft", function () { return _this.attributes.trial_days_left; }); // date-time # When does this Site trial expire? (0, _defineProperty2.default)(this, "getTrialUntil", function () { return _this.attributes.trial_until; }); // boolean # If using custom SMTP, should we use dedicated IPs to deliver emails? (0, _defineProperty2.default)(this, "getUseDedicatedIpsForSmtp", function () { return _this.attributes.use_dedicated_ips_for_smtp; }); // boolean # Allow uploaders to set `provided_modified_at` for uploaded files? (0, _defineProperty2.default)(this, "getUseProvidedModifiedAt", function () { return _this.attributes.use_provided_modified_at; }); // User # User of current session (0, _defineProperty2.default)(this, "getUser", function () { return _this.attributes.user; }); // boolean # Will users be locked out after incorrect login attempts? (0, _defineProperty2.default)(this, "getUserLockout", function () { return _this.attributes.user_lockout; }); // int64 # How many hours to lock user out for failed password? (0, _defineProperty2.default)(this, "getUserLockoutLockPeriod", function () { return _this.attributes.user_lockout_lock_period; }); // int64 # Number of login tries within `user_lockout_within` hours before users are locked out (0, _defineProperty2.default)(this, "getUserLockoutTries", function () { return _this.attributes.user_lockout_tries; }); // int64 # Number of hours for user lockout window (0, _defineProperty2.default)(this, "getUserLockoutWithin", function () { return _this.attributes.user_lockout_within; }); // boolean # Enable User Requests feature (0, _defineProperty2.default)(this, "getUserRequestsEnabled", function () { return _this.attributes.user_requests_enabled; }); // boolean # Send email to site admins when a user request is received? (0, _defineProperty2.default)(this, "getUserRequestsNotifyAdmins", function () { return _this.attributes.user_requests_notify_admins; }); // boolean # Allow users to create their own API keys? (0, _defineProperty2.default)(this, "getUsersCanCreateApiKeys", function () { return _this.attributes.users_can_create_api_keys; }); // boolean # Allow users to create their own SSH keys? (0, _defineProperty2.default)(this, "getUsersCanCreateSshKeys", function () { return _this.attributes.users_can_create_ssh_keys; }); // string # Custom text send in user welcome email (0, _defineProperty2.default)(this, "getWelcomeCustomText", function () { return _this.attributes.welcome_custom_text; }); // email # Include this email in welcome emails if enabled (0, _defineProperty2.default)(this, "getWelcomeEmailCc", function () { return _this.attributes.welcome_email_cc; }); // string # Include this email subject in welcome emails if enabled (0, _defineProperty2.default)(this, "getWelcomeEmailSubject", function () { return _this.attributes.welcome_email_subject; }); // boolean # Will the welcome email be sent to new users? (0, _defineProperty2.default)(this, "getWelcomeEmailEnabled", function () { return _this.attributes.welcome_email_enabled; }); // string # Does the welcome screen appear? (0, _defineProperty2.default)(this, "getWelcomeScreen", function () { return _this.attributes.welcome_screen; }); // boolean # Does FTP user Windows emulation mode? (0, _defineProperty2.default)(this, "getWindowsModeFtp", function () { return _this.attributes.windows_mode_ftp; }); // int64 # If greater than zero, users will unable to login if they do not show activity within this number of days. (0, _defineProperty2.default)(this, "getDisableUsersFromInactivityPeriodDays", function () { return _this.attributes.disable_users_from_inactivity_period_days; }); // boolean # Allow group admins set password authentication method (0, _defineProperty2.default)(this, "getGroupAdminsCanSetUserPassword", function () { return _this.attributes.group_admins_can_set_user_password; }); Object.entries(attributes).forEach(function (_ref) { var _ref2 = (0, _slicedToArray2.default)(_ref, 2), key = _ref2[0], value = _ref2[1]; var normalizedKey = key.replace('?', ''); _this.attributes[normalizedKey] = value; Object.defineProperty(_this, normalizedKey, { value: value, writable: false }); }); this.options = _objectSpread({}, options); }); _Site = Site; (0, _defineProperty2.default)(Site, "get", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { var options, response, _args = arguments; return _regenerator.default.wrap(function (_context) { while (1) switch (_context.prev = _context.next) { case 0: options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; _context.next = 1; return _Api.default.sendRequest('/site', 'GET', {}, options); case 1: response = _context.sent; return _context.abrupt("return", new _Site(response === null || response === void 0 ? void 0 : response.data, options)); case 2: case "end": return _context.stop(); } }, _callee); }))); (0, _defineProperty2.default)(Site, "getUsage", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() { var options, response, UsageSnapshot, _args2 = arguments; return _regenerator.default.wrap(function (_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}; _context2.next = 1; return _Api.default.sendRequest('/site/usage', 'GET', {}, options); case 1: response = _context2.sent; UsageSnapshot = require('./UsageSnapshot.js').default; return _context2.abrupt("return", new UsageSnapshot(response === null || response === void 0 ? void 0 : response.data, options)); case 2: case "end": return _context2.stop(); } }, _callee2); }))); // Parameters: // name - string - Site name // subdomain - string - Site subdomain // domain - string - Custom domain // domain_hsts_header - boolean - Send HSTS (HTTP Strict Transport Security) header when visitors access the site via a custom domain? // domain_letsencrypt_chain - string - Letsencrypt chain to use when registering SSL Certificate for domain. // email - string - Main email for this site // reply_to_email - string - Reply-to email for this site // allow_bundle_names - boolean - Are manual Bundle names allowed? // bundle_expiration - int64 - Site-wide Bundle expiration in days // welcome_email_enabled - boolean - Will the welcome email be sent to new users? // ask_about_overwrites - boolean - If false, rename conflicting files instead of asking for overwrite confirmation. Only applies to web interface. // show_request_access_link - boolean - Show request access link for users without access? Currently unused. // always_mkdir_parents - boolean - Create parent directories if they do not exist during uploads? This is primarily used to work around broken upload clients that assume servers will perform this step. // welcome_email_cc - string - Include this email in welcome emails if enabled // welcome_email_subject - string - Include this email subject in welcome emails if enabled // welcome_custom_text - string - Custom text send in user welcome email // language - string - Site default language // windows_mode_ftp - boolean - Does FTP user Windows emulation mode? // default_time_zone - string - Site default time zone // desktop_app - boolean - Is the desktop app enabled? // desktop_app_session_ip_pinning - boolean - Is desktop app session IP pinning enabled? // desktop_app_session_lifetime - int64 - Desktop app session lifetime (in hours) // mobile_app - boolean - Is the mobile app enabled? // mobile_app_session_ip_pinning - boolean - Is mobile app session IP pinning enabled? // mobile_app_session_lifetime - int64 - Mobile app session lifetime (in hours) // folder_permissions_groups_only - boolean - If true, permissions for this site must be bound to a group (not a user). // welcome_screen - string - Does the welcome screen appear? // office_integration_available - boolean - If true, allows users to use a document editing integration. // office_integration_type - string - Which document editing integration to support. Files.com Editor or Microsoft Office for the Web. // pin_all_remote_servers_to_site_region - boolean - If true, we will ensure that all internal communications with any remote server are made through the primary region of the site. This setting overrides individual remote server settings. // motd_text - string - A message to show users when they connect via FTP or SFTP. // motd_use_for_ftp - boolean - Show message to users connecting via FTP // motd_use_for_sftp - boolean - Show message to users connecting via SFTP // left_navigation_visibility - object - Visibility settings for account navigation // additional_text_file_types - array(string) - Additional extensions that are considered text files // bundle_require_note - boolean - Do Bundles require internal notes? // bundle_send_shared_receipts - boolean - Do Bundle creators receive receipts of invitations? // calculate_file_checksums_crc32 - boolean - Calculate CRC32 checksums for files? // calculate_file_checksums_md5 - boolean - Calculate MD5 checksums for files? // calculate_file_checksums_sha1 - boolean - Calculate SHA1 checksums for files? // calculate_file_checksums_sha256 - boolean - Calculate SHA256 checksums for files? // legacy_checksums_mode - boolean - Use legacy checksums mode? // session_expiry - double - Session expiry in hours // ssl_required - boolean - Is SSL required? Disabling this is insecure. // 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. // sftp_insecure_ciphers - boolean - If true, we will allow weak and known insecure ciphers to be used for SFTP connections. Enabling this setting severely weakens the security of your site and it is not recommend, except as a last resort for compatibility. // sftp_insecure_diffie_hellman - boolean - If true, we will allow weak Diffie Hellman parameters to be used within ciphers for SFTP that are otherwise on our secure list. This has the effect of making the cipher weaker than our normal threshold for security, but is required to support certain legacy or broken SSH and MFT clients. Enabling this weakens security, but not nearly as much as enabling the full `sftp_insecure_ciphers` option. // disable_files_certificate_generation - boolean - If set, Files.com will not set the CAA records required to generate future SSL certificates for this domain. // user_lockout - boolean - Will users be locked out after incorrect login attempts? // user_lockout_tries - int64 - Number of login tries within `user_lockout_within` hours before users are locked out // user_lockout_within - int64 - Number of hours for user lockout window // user_lockout_lock_period - int64 - How many hours to lock user out for failed password? // include_password_in_welcome_email - boolean - Include password in emails to new users? // allowed_countries - string - Comma separated list of allowed Country codes // allowed_ips - string - List of allowed IP addresses // disallowed_countries - string - Comma separated list of disallowed Country codes // 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. // days_to_retain_backups - int64 - Number of days to keep deleted files // max_prior_passwords - int64 - Number of prior passwords to disallow // password_validity_days - int64 - Number of days password is valid // password_min_length - int64 - Shortest password length for users // password_require_letter - boolean - Require a letter in passwords? // password_require_mixed - boolean - Require lower and upper case letters in passwords? // password_require_special - boolean - Require special characters in password? // password_require_number - boolean - Require a number in passwords? // password_require_unbreached - boolean - Require passwords that have not been previously breached? (see https://haveibeenpwned.com/) // require_logout_from_bundles_and_inboxes - boolean - If true, we will hide the 'Remember Me' box on Inbox and Bundle registration pages, requiring that the user logout and log back in every time they visit the page. // dav_user_root_enabled - boolean - Use user FTP roots also for WebDAV? // sftp_user_root_enabled - boolean - Use user FTP roots also for SFTP? // disable_password_reset - boolean - Is password reset disabled? // immutable_files - boolean - Are files protected from modification? // bundle_not_found_message - string - Custom error message to show when bundle is not found. // bundle_password_required - boolean - Do Bundles require password protection? // bundle_require_registration - boolean - Do Bundles require registration? // bundle_require_share_recipient - boolean - Do Bundles require recipients for sharing? // bundle_registration_notifications - string - Do Bundle owners receive registration notification? // bundle_activity_notifications - string - Do Bundle owners receive activity notifications? // bundle_upload_receipt_notifications - string - Do Bundle uploaders receive upload confirmation notifications? // document_edits_in_bundle_allowed - boolean - If true, allow public viewers of Bundles with full permissions to use document editing integrations. // password_requirements_apply_to_bundles - boolean - Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords? // prevent_root_permissions_for_non_site_admins - boolean - If true, we will prevent non-administrators from receiving any permissions directly on the root folder. This is commonly used to prevent the accidental application of permissions. // opt_out_global - boolean - Use servers in the USA only? // use_provided_modified_at - boolean - Allow uploaders to set `provided_modified_at` for uploaded files? // custom_namespace - boolean - Is this site using a custom namespace for users? // disable_users_from_inactivity_period_days - int64 - If greater than zero, users will unable to login if they do not show activity within this number of days. // non_sso_groups_allowed - boolean - If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider. // non_sso_users_allowed - boolean - If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider. // sharing_enabled - boolean - Allow bundle creation // snapshot_sharing_enabled - boolean - Allow snapshot share links creation // user_requests_enabled - boolean - Enable User Requests feature // user_requests_notify_admins - boolean - Send email to site admins when a user request is received? // dav_enabled - boolean - Is WebDAV enabled? // ftp_enabled - boolean - Is FTP enabled? // sftp_enabled - boolean - Is SFTP enabled? // users_can_create_api_keys - boolean - Allow users to create their own API keys? // users_can_create_ssh_keys - boolean - Allow users to create their own SSH keys? // show_user_notifications_log_in_link - boolean - Show log in link in user notifications? // sftp_host_key_type - string - Sftp Host Key Type // active_sftp_host_key_id - int64 - Id of the currently selected custom SFTP Host Key // protocol_access_groups_only - boolean - If true, protocol access permissions on users will be ignored, and only protocol access permissions set on Groups will be honored. Make sure that your current user is a member of a group with API permission when changing this value to avoid locking yourself out of your site. // revoke_bundle_access_on_disable_or_delete - boolean - Auto-removes bundles for disabled/deleted users and enforces bundle expiry within user access period. // bundle_watermark_value - object - Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value // group_admins_can_set_user_password - boolean - Allow group admins set password authentication method // bundle_recipient_blacklist_free_email_domains - boolean - Disallow free email domains for Bundle/Inb