"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    clientNextRules: function() {
        return clientNextRules;
    },
    credentialSettingPatchRules: function() {
        return credentialSettingPatchRules;
    },
    fileCleanSettingsUpdateRules: function() {
        return fileCleanSettingsUpdateRules;
    },
    frontendSettingsUpdateRules: function() {
        return frontendSettingsUpdateRules;
    },
    moonrakerSupportRules: function() {
        return moonrakerSupportRules;
    },
    sentryDiagnosticsEnabledRules: function() {
        return sentryDiagnosticsEnabledRules;
    },
    serverSettingsUpdateRules: function() {
        return serverSettingsUpdateRules;
    },
    timeoutSettingsUpdateRules: function() {
        return timeoutSettingsUpdateRules;
    },
    whitelistSettingUpdateRules: function() {
        return whitelistSettingUpdateRules;
    },
    wizardUpdateRules: function() {
        return wizardUpdateRules;
    }
});
const _envutils = require("../../utils/env.utils");
const serverSettingsUpdateRules = (whitelistFeatureEnabled)=>({
        registration: "boolean",
        loginRequired: "boolean",
        debugSettings: "object",
        "debugSettings.debugSocketEvents": "boolean",
        "debugSettings.debugSocketReconnect": "boolean",
        whitelistEnabled: whitelistFeatureEnabled ? "boolean" : "not",
        whitelistedIpAddresses: whitelistFeatureEnabled ? "array|minLength:1" : "not",
        "whitelistedIpAddresses.*": whitelistFeatureEnabled ? "required|string" : "not",
        experimentalMoonrakerSupport: "boolean"
    });
const timeoutSettingsUpdateRules = {
    apiTimeout: "integer|min:1000"
};
const frontendSettingsUpdateRules = {
    gridCols: "integer|min:1",
    gridRows: "integer|min:1",
    largeTiles: "boolean"
};
const credentialSettingPatchRules = {
    jwtSecret: "string",
    jwtExpiresIn: (0, _envutils.isProductionEnvironment)() ? "integer|min:120|max:7200" : "integer|min:0",
    refreshTokenAttempts: "integer|min:-1",
    refreshTokenExpiry: (0, _envutils.isProductionEnvironment)() ? "integer|min:240" : "integer|min:0"
};
const whitelistSettingUpdateRules = {
    whitelistedIpAddresses: "required|array|minLength:1",
    "whitelistedIpAddresses.*": "required|string",
    whitelistEnabled: "required|boolean"
};
const wizardUpdateRules = {
    wizardCompleted: "required|boolean",
    wizardCompletedAt: "required|date|nullable",
    wizardVersion: "required|integer|min:0"
};
const fileCleanSettingsUpdateRules = {
    autoRemoveOldFilesBeforeUpload: "required|boolean",
    autoRemoveOldFilesAtBoot: "required|boolean",
    autoRemoveOldFilesCriteriumDays: "required|integer|min:0"
};
const sentryDiagnosticsEnabledRules = {
    enabled: "required|boolean"
};
const moonrakerSupportRules = {
    enabled: "required|boolean"
};
const clientNextRules = {
    enabled: "required|boolean"
};

//# sourceMappingURL=settings-service.validation.js.map