"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SolidCoreDefaultSettingsProvider = exports.DEFAULT_MEDIA_FILE_STORAGE_DIR = exports.DEFAULT_MEDIA_UPLOAD_DIR = void 0;
const common_1 = require("@nestjs/common");
const disallow_in_production_decorator_1 = require("../../decorators/disallow-in-production.decorator");
const settings_provider_decorator_1 = require("../../decorators/settings-provider.decorator");
const interfaces_1 = require("../../interfaces");
exports.DEFAULT_MEDIA_UPLOAD_DIR = "media-uploads";
exports.DEFAULT_MEDIA_FILE_STORAGE_DIR = "media-files-storage";
const getSolidCoreSettings = (isProd) => [
    {
        moduleName: "solid-core",
        key: "iamGoogleOAuthEnabled",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Allow Login / Signup With Google",
        group: "authentication-settings",
        sortOrder: 50,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "iamFacebookOAuthEnabled",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Allow Login / Signup With Facebook",
        group: "authentication-settings",
        sortOrder: 50,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "iamMicrosoftOAuthEnabled",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Allow Login / Signup With Microsoft",
        group: "authentication-settings",
        sortOrder: 50,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "authPagesLayout",
        value: "center",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Authentication Screen Layout",
        group: "authentication-settings",
        sortOrder: 80,
        controlType: "selectionStatic",
        options: [
            { label: "Left", value: "left" },
            { label: "Center", value: "center" },
            { label: "Right", value: "right" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "appLogo",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "App Logo",
        group: "app-settings",
        sortOrder: 10,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "companylogo",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Company Logo",
        group: "app-settings",
        sortOrder: 20,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "favicon",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Favicon",
        group: "app-settings",
        sortOrder: 30,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "appLogoPosition",
        value: "in_form_view",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "App Logo Position",
        group: "app-settings",
        sortOrder: 40,
        controlType: "selectionStatic",
        options: [
            { label: "In Form View", value: "in_form_view" },
            { label: "In Image View", value: "in_image_view" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "showAuthContent",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Show Details On Authentication Screen",
        group: "app-settings",
        sortOrder: 50,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "appTitle",
        value: process.env.SOLID_APP_NAME || "Solid App",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "App Title",
        group: "app-settings",
        sortOrder: 60,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "appSubtitle",
        value: process.env.SOLID_APP_SUBTITLE || "",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "App Subtitle",
        group: "app-settings",
        sortOrder: 70,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "appDescription",
        value: process.env.SOLID_APP_DESCRIPTION || "",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Description",
        group: "app-settings",
        sortOrder: 80,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "showLegalLinks",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Show Legal Links",
        group: "app-settings",
        sortOrder: 90,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "appTnc",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Terms And Conditions Link",
        group: "app-settings",
        sortOrder: 100,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "appPrivacyPolicy",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Privacy Policy Link",
        group: "app-settings",
        sortOrder: 110,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "enableDarkMode",
        value: true,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Enable Dark Mode",
        group: "app-settings",
        sortOrder: 120,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "copyright",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Copyright",
        group: "app-settings",
        sortOrder: 130,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "enableUsername",
        value: true,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Enable Username",
        group: "misc-settings",
        sortOrder: 10,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "enabledNotification",
        value: true,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Enable Notification",
        group: "misc-settings",
        sortOrder: 20,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "contactSupportEmail",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Contact Support Email",
        group: "misc-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "contactSupportDisplayName",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Contact Support Display Name",
        group: "misc-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "contactSupportIcon",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Contact Support Icon",
        group: "misc-settings",
        sortOrder: 50,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "authScreenRightBackgroundImage",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Authentication Right Banner Image",
        group: "authentication-settings",
        sortOrder: 90,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "authScreenLeftBackgroundImage",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Authentication Left Banner Image",
        group: "authentication-settings",
        sortOrder: 100,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "authScreenCenterBackgroundImage",
        value: null,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Authentication Center Background Image",
        group: "authentication-settings",
        sortOrder: 110,
        controlType: "mediaSingle",
    },
    {
        moduleName: "solid-core",
        key: "solidXGenAiCodeBuilderConfig",
        value: JSON.stringify({
            models: {
                default: {
                    providerId: "",
                    model: "",
                    behavior: { streaming: false, custom: "" },
                },
                fast: {
                    providerId: "",
                    model: "",
                    behavior: { streaming: false, custom: "" },
                },
            },
            providers: {},
        }),
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        encrypted: true,
        label: "AI Code Builder Configuration",
        description: "Structured configuration for AI providers and model assignments.",
        group: "ai-settings",
        sortOrder: 10,
        controlType: "custom",
        settingsWidget: "solidXGenAiCodeBuilderConfigWidget",
    },
    {
        moduleName: "solid-core",
        key: "appEncryptionKey",
        value: process.env.APP_ENCRYPTION_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "mcpEnabled",
        value: process.env.MCP_ENABLED || false,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "MCP Enabled",
        group: "ai-settings",
        sortOrder: 20,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "mcpServerUrl",
        value: process.env.MCP_SERVER_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "MCP Server URL",
        group: "ai-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "mcpApiKey",
        value: process.env.MCP_API_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "dateTimeFormat",
        value: process.env.DATE_TIME_FORMAT || "YYYY-MM-DD HH:mm:ss",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Date Time Format",
        group: "system-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "dateFormat",
        value: process.env.DATE_FORMAT || "YYYY-MM-DD",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Date Format",
        group: "system-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "baseUrl",
        value: process.env.BASE_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Base URL",
        group: "system-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "solidAppWebsiteUrl",
        value: process.env.SOLID_APP_WEBSITE_URL,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Solid App Website URL",
        group: "system-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "moduleMetadataSeederFiles",
        value: process.env.AB_MODULE_METADATA_SEEDER_FILES ?? "",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Module Metadata Seeder Files",
        group: "storage-settings",
        sortOrder: 10,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "uploadDir",
        value: process.env.AB_MEDIA_UPLOAD_DIR ?? exports.DEFAULT_MEDIA_UPLOAD_DIR,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Upload Directory",
        group: "storage-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "fileStorageDir",
        value: process.env.AB_MEDIA_FILE_STORAGE_DIR ?? exports.DEFAULT_MEDIA_FILE_STORAGE_DIR,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "File Storage Directory",
        group: "storage-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "defaultFileService",
        value: process.env.DEFAULT_FILE_SERVICE ?? "disk",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Default File Service",
        group: "storage-settings",
        sortOrder: 40,
        controlType: "selectionStatic",
        options: [
            { label: "Disk", value: "disk" },
            { label: "S3", value: "s3" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "S3_AWS_ACCESS_KEY",
        value: process.env.S3_AWS_ACCESS_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "S3_AWS_SECRET_KEY",
        value: process.env.S3_AWS_SECRET_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "S3_AWS_REGION_NAME",
        value: process.env.S3_AWS_REGION_NAME,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "AWS Region Name",
        group: "storage-settings",
        sortOrder: 50,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "S3_DEFAULT_BUCKET",
        value: process.env.S3_DEFAULT_BUCKET,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "S3 Default Bucket",
        group: "storage-settings",
        sortOrder: 60,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "emailProvider",
        value: process.env.COMMON_EMAIL_PROVIDER ?? "SMTPEMailService",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Email Provider",
        group: "email-settings",
        sortOrder: 10,
        controlType: "selectionStatic",
        options: [
            { label: "SMTP Email Service", value: "SMTPEMailService" },
            { label: "Elastic Email Service", value: "ElasticEmailService" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "emailTemplateSeederFiles",
        value: process.env.COMMON_EMAIL_TEMPLATE_SEEDER_FILES,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Email Template Seeder Files",
        group: "email-settings",
        sortOrder: 20,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "shouldQueueEmails",
        value: (process.env.COMMON_EMAIL_SHOULD_QUEUE ?? "false") === "true",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Queue Emails",
        group: "email-settings",
        sortOrder: 30,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "smtpMailHost",
        value: process.env.COMMON_SMTP_EMAIL_SMTP_HOST,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMTP Mail Host",
        group: "email-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "smtpMailPort",
        value: +(process.env.COMMON_SMTP_EMAIL_SMTP_PORT ?? 587),
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMTP Mail Port",
        group: "email-settings",
        sortOrder: 50,
        controlType: "numeric",
    },
    {
        moduleName: "solid-core",
        key: "smtpMailUsername",
        value: process.env.COMMON_SMTP_EMAIL_USERNAME,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMTP Mail Username",
        group: "email-settings",
        sortOrder: 60,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "smtpMailPassword",
        value: process.env.COMMON_SMTP_EMAIL_PASSWORD,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "smtpMailFrom",
        value: process.env.COMMON_SMTP_EMAIL_FROM ?? process.env.COMMON_EMAIL_FROM,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMTP Mail From",
        group: "email-settings",
        sortOrder: 70,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "apiMailKey",
        value: process.env.COMMON_API_EMAIL_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "apiMailFrom",
        value: process.env.COMMON_EMAIL_FROM,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "API Mail From",
        group: "email-settings",
        sortOrder: 80,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "ragServerUrl",
        value: process.env.GENAI_RAG_SERVER_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "RAG Server URL",
        group: "ai-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "ragServerLogin",
        value: process.env.GENAI_RAG_SERVER_LOGIN,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "ragServerPassword",
        value: process.env.GENAI_RAG_SERVER_PASSWORD,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "mcpPythonExecutable",
        value: process.env.MCP_PYTHON_EXECUTABLE,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "mcpClient",
        value: process.env.MCP_CLIENT,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "mcpRestartTouchFile",
        value: process.env.MCP_RESTART_TOUCH_FILE || "tmp/restart.touch",
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "clientID",
        value: process.env.IAM_GOOGLE_OAUTH_CLIENT_ID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Google OAuth Client ID",
        group: "oauth-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "clientSecret",
        value: process.env.IAM_GOOGLE_OAUTH_CLIENT_SECRET,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "callbackURL",
        value: process.env.IAM_GOOGLE_OAUTH_CALLBACK_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Google OAuth Callback URL",
        group: "oauth-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "redirectURL",
        value: process.env.IAM_GOOGLE_OAUTH_REDIRECT_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Google OAuth Redirect URL",
        group: "oauth-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "FACEBOOK_CLIENT_ID",
        value: process.env.IAM_FACEBOOK_OAUTH_CLIENT_ID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "FACEBOOK_CLIENT_SECRET",
        value: process.env.IAM_FACEBOOK_OAUTH_CLIENT_SECRET,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "FACEBOOK_CALLBACK_URL",
        value: process.env.IAM_FACEBOOK_OAUTH_CALLBACK_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "FACEBOOK_REDIRECT_URL",
        value: process.env.IAM_FACEBOOK_OAUTH_REDIRECT_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "MICROSOFT_CLIENT_ID",
        value: process.env.IAM_MICROSOFT_OAUTH_CLIENT_ID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "MICROSOFT_CLIENT_SECRET",
        value: process.env.IAM_MICROSOFT_OAUTH_CLIENT_SECRET,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "MICROSOFT_TENANT_ID",
        value: process.env.IAM_MICROSOFT_OAUTH_TENANT_ID || "common",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "MICROSOFT_CALLBACK_URL",
        value: process.env.IAM_MICROSOFT_OAUTH_CALLBACK_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "MICROSOFT_REDIRECT_URL",
        value: process.env.IAM_MICROSOFT_OAUTH_REDIRECT_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
    },
    {
        moduleName: "solid-core",
        key: "passwordLessAuth",
        value: (process.env.IAM_PASSWORD_LESS_AUTH?.trim() ?? "false") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Password Less Authentication",
        group: "authentication-settings",
        sortOrder: 20,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "passwordBasedAuth",
        value: (process.env.IAM_PASSWORD_BASED_AUTH?.trim() ?? "true") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Password Based Authentication",
        group: "authentication-settings",
        sortOrder: 10,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "passwordlessRegistrationValidateWhat",
        value: (process.env.IAM_PASSWORD_LESS_REGISTRATION_VALIDATE_WHAT ?? "email").trim(),
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Registration Validation Type",
        group: "authentication-settings",
        sortOrder: 30,
        controlType: "selectionStatic",
        options: [
            { label: "Email", value: "email" },
            { label: "Mobile", value: "mobile" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "passwordlessLoginValidateWhat",
        value: process.env.IAM_PASSWORD_LESS_LOGIN_VALIDATE_WHAT ?? "email",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Login Validation Type",
        group: "authentication-settings",
        sortOrder: 40,
        controlType: "selectionStatic",
        options: [
            { label: "Email", value: "email" },
            { label: "Mobile", value: "mobile" },
            { label: "Selectable", value: "selectable" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "allowPublicRegistration",
        value: (process.env.IAM_ALLOW_PUBLIC_REGISTRATION ?? "true") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Public Registration",
        group: "authentication-settings",
        sortOrder: 60,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "activateUserOnRegistration",
        value: (process.env.IAM_ACTIVATE_USER_ON_REGISTRATION ?? "true") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Auto Activate User On Registration",
        group: "authentication-settings",
        sortOrder: 70,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "autoLoginUserOnRegistration",
        value: (process.env.IAM_AUTO_LOGIN_USER_ON_REGISTRATION ?? "false") === "true",
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "otpExpiry",
        value: parseInt(process.env.IAM_OTP_EXPIRY ?? "10"),
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "otpWhatsappFallbackEnabled",
        value: (process.env.IAM_OTP_WHATSAPP_FALLBACK_ENABLED ?? "true") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "OTP WhatsApp Fallback Enabled",
        group: "authentication-settings",
        sortOrder: 85,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "otpWhatsappTemplateId",
        value: process.env.IAM_OTP_WHATSAPP_TEMPLATE_ID ?? "common_otp",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "OTP WhatsApp Template ID",
        group: "authentication-settings",
        sortOrder: 86,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "otpWhatsappIndependentEnabled",
        value: (process.env.IAM_OTP_WHATSAPP_INDEPENDENT_ENABLED ?? "true") === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "OTP WhatsApp Independent Enabled",
        group: "authentication-settings",
        sortOrder: 87,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "otpDefaultCountryDialCode",
        value: process.env.IAM_OTP_DEFAULT_COUNTRY_DIAL_CODE ?? "",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "OTP Default Country Dial Code",
        group: "authentication-settings",
        sortOrder: 88,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "forgotPasswordVerificationTokenExpiry",
        value: parseInt(process.env.IAM_FORGOT_PASSWORD_VERIFICATION_TOKEN_EXPIRY ?? "10"),
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "defaultRole",
        value: process.env.IAM_DEFAULT_ROLE ?? "Public",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Default Role",
        group: "authentication-settings",
        sortOrder: 75,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "dummyOtp",
        value: process.env.IAM_OTP_DUMMY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "dummyOtpUsers",
        value: process.env.IAM_OTP_DUMMY_USERS,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "forgotPasswordSendVerificationTokenOn",
        value: process.env.IAM_FORGOT_PASSWORD_SEND_VERIFICATION_TOKEN_ON ?? "email",
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "maxFailedLoginAttempts",
        value: parseInt(process.env.IAM_MAX_FAILED_LOGIN_ATTEMPTS ?? "0"),
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Max Failed Login Attempts",
        group: "authentication-settings",
        sortOrder: 110,
        controlType: "numeric",
    },
    {
        moduleName: "solid-core",
        key: "forceChangePasswordOnFirstLogin",
        value: false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Force Change Password On First Login",
        group: "authentication-settings",
        sortOrder: 120,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "authenticationPasswordRegex",
        value: process.env.PASSWORD_REGEX ||
            "^$|^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[^\\da-zA-Z]).*$",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Authentication Password Regex",
        group: "authentication-settings",
        sortOrder: 130,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "authenticationPasswordRegexErrorMessage",
        value: process.env.PASSWORD_REGEX_ERROR_MESSAGE ||
            "Password must contain at least one uppercase, one lowercase, one number, and one special character.",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Password Regex Error Message",
        group: "authentication-settings",
        sortOrder: 140,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "authenticationPasswordComplexityDescription",
        value: process.env.PASSWORD_COMPLEXITY_DESC ||
            "Password must contain at least one uppercase, one lowercase, one number, and one special character.",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Password Complexity Description",
        group: "authentication-settings",
        sortOrder: 150,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "iamAutoGeneratedPassword",
        value: process.env.IAM_AUTOGENERATED_PASSWORD || true,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Auto Generate Password",
        group: "authentication-settings",
        sortOrder: 160,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "passwordPepper",
        value: process.env.IAM_PASSWORD_PEPPER || "",
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "showNameFieldsForRegistration",
        value: process.env.IAM_SHOW_NAME_FIELDS_FOR_REGISTRATION === "true"
            ? true
            : false,
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Show Name Fields For Registration",
        group: "authentication-settings",
        sortOrder: 170,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "sendWelcomeEmailOnSignup",
        value: (process.env.IAM_SEND_WELCOME_EMAIL_ON_SIGNUP ?? "false").toLowerCase() === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Send Welcome Email On Signup",
        group: "authentication-settings",
        sortOrder: 180,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "sendWelcomeSmsOnSignup",
        value: (process.env.IAM_SEND_WELCOME_SMS_ON_SIGNUP ?? "false").toLowerCase() === "true",
        level: interfaces_1.SettingLevel.SystemAdminEditable,
        label: "Send Welcome SMS On Signup",
        group: "authentication-settings",
        sortOrder: 190,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "frontendLoginPageUrl",
        value: process.env.IAM_FRONTEND_APP_LOGIN_PAGE_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Frontend Login Page URL",
        group: "authentication-settings",
        sortOrder: 180,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "frontendForgotPasswordPageUrl",
        value: process.env.IAM_FRONTEND_APP_FORGOT_PASSWORD_PAGE_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Frontend Forgot Password Page URL",
        group: "authentication-settings",
        sortOrder: 190,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "secret",
        value: process.env.IAM_JWT_SECRET,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "audience",
        value: process.env.IAM_JWT_TOKEN_AUDIENCE,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "JWT Audience",
        group: "jwt-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "issuer",
        value: process.env.IAM_JWT_TOKEN_ISSUER,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "JWT Issuer",
        group: "jwt-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "accessTokenTtl",
        value: parseInt(process.env.IAM_JWT_ACCESS_TOKEN_TTL ?? (isProd ? "1200" : "86400"), 10),
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "refreshTokenTtl",
        value: parseInt(process.env.IAM_JWT_REFRESH_TOKEN_TTL ?? "604800", 10),
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "queuesDefaultBroker",
        value: process.env.QUEUES_DEFAULT_BROKER || "database",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Queues Default Broker",
        group: "queue-settings",
        sortOrder: 10,
        controlType: "selectionStatic",
        options: [
            { label: "Database", value: "database" },
            { label: "RabbitMQ", value: "rabbitmq" },
        ],
    },
    {
        moduleName: "solid-core",
        key: "queuesServiceRole",
        value: process.env.QUEUES_SERVICE_ROLE,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Queues Service Role",
        group: "queue-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "queuesRabbitMqUrl",
        value: process.env.QUEUES_RABBIT_MQ_URL,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "solidCliRunning",
        value: process.env.SOLID_CLI_RUNNING || "false",
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "smsProvider",
        value: process.env.COMMON_SMS_PROVIDER,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMS Provider",
        group: "sms-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "smsTemplateSeederFiles",
        value: process.env.COMMON_SMS_TEMPLATE_SEEDER_FILES,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "SMS Template Seeder Files",
        group: "sms-settings",
        sortOrder: 20,
        controlType: "longText",
    },
    {
        moduleName: "solid-core",
        key: "shouldQueueSms",
        value: (process.env.COMMON_SMS_SHOULD_QUEUE ?? "false") === "true",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Queue SMS",
        group: "sms-settings",
        sortOrder: 30,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "msg91SmsUrl",
        value: process.env.COMMON_MSG91_SMS_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "MSG91 SMS URL",
        group: "sms-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "msg91SmsApiKey",
        value: process.env.COMMON_MSG91_SMS_API_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "twilioAccountSid",
        value: process.env.COMMON_TWILIO_ACCOUNT_SID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Twilio Account SID",
        group: "sms-settings",
        sortOrder: 50,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "twilioAuthToken",
        value: process.env.COMMON_TWILIO_AUTH_TOKEN,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "twilioNumber",
        value: process.env.COMMON_TWILIO_NUMBER,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Twilio Number",
        group: "sms-settings",
        sortOrder: 60,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "tinyUrlApiUrl",
        value: process.env.COMMON_SHORT_URL_API_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Tiny URL API URL",
        group: "short-url-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "tinyUrlApiKey",
        value: process.env.COMMON_SHORT_URL_API_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "tinyUrlDomain",
        value: process.env.COMMON_SHORT_URL_DOMAIN,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Tiny URL Domain",
        group: "short-url-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "tinyUrlEnabled",
        value: (process.env.COMMON_SHORT_URL_ENABLED ?? "false") === "true",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Tiny URL Enabled",
        group: "short-url-settings",
        sortOrder: 30,
        controlType: "boolean",
    },
    {
        moduleName: "solid-core",
        key: "whatsappProvider",
        value: process.env.COMMON_WHATSAPP_PROVIDER,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "WhatsApp Provider",
        group: "whatsapp-settings",
        sortOrder: 10,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "msg91WhatsappUrl",
        value: process.env.COMMON_WHATSAPP_API_URL,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "MSG91 WhatsApp URL",
        group: "whatsapp-settings",
        sortOrder: 20,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "msg91WhatsappApiKey",
        value: process.env.COMMON_WHATSAPP_API_KEY,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "msg91WhatsappIntegratedNumber",
        value: process.env.COMMON_WHATSAPP_INTEGRATED_NUMBER,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "MSG91 WhatsApp Integrated Number",
        group: "whatsapp-settings",
        sortOrder: 30,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappApiUrl",
        value: process.env.COMMON_META_WHATSAPP_API_URL || "https://graph.facebook.com",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Meta WhatsApp API URL",
        group: "whatsapp-settings",
        sortOrder: 40,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappApiVersion",
        value: process.env.COMMON_META_WHATSAPP_API_VERSION || "v23.0",
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Meta WhatsApp API Version",
        group: "whatsapp-settings",
        sortOrder: 50,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappPhoneNumberId",
        value: process.env.COMMON_META_WHATSAPP_PHONE_NUMBER_ID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Meta WhatsApp Phone Number ID",
        group: "whatsapp-settings",
        sortOrder: 60,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappBusinessAccountId",
        value: process.env.COMMON_META_WHATSAPP_BUSINESS_ACCOUNT_ID,
        level: interfaces_1.SettingLevel.SystemAdminReadonly,
        label: "Meta WhatsApp Business Account ID",
        group: "whatsapp-settings",
        sortOrder: 70,
        controlType: "shortText",
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappAccessToken",
        value: process.env.COMMON_META_WHATSAPP_ACCESS_TOKEN,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappWebhookVerifyToken",
        value: process.env.COMMON_META_WHATSAPP_WEBHOOK_VERIFY_TOKEN,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
    {
        moduleName: "solid-core",
        key: "metaWhatsappAppSecret",
        value: process.env.COMMON_META_WHATSAPP_APP_SECRET,
        level: interfaces_1.SettingLevel.SystemEnv,
    },
];
let SolidCoreDefaultSettingsProvider = class SolidCoreDefaultSettingsProvider {
    getSettings() {
        const isProd = process.env.ENV === disallow_in_production_decorator_1.Environment.Production;
        return getSolidCoreSettings(isProd);
    }
};
exports.SolidCoreDefaultSettingsProvider = SolidCoreDefaultSettingsProvider;
exports.SolidCoreDefaultSettingsProvider = SolidCoreDefaultSettingsProvider = __decorate([
    (0, settings_provider_decorator_1.SettingsProvider)(),
    (0, common_1.Injectable)()
], SolidCoreDefaultSettingsProvider);
//# sourceMappingURL=default-settings-provider.service.js.map