/** * AI Actions Schema * * This file defines all administrative actions the AI Co-Pilot can perform. * Each action corresponds to a setting or feature toggle in the WAWP plugin. * * Logic Guide for AI: * - Master Toggles (Dashboard): Use 1 to enable, 0 to disable. * - Section Settings: Use 'yes' or 'no' unless specified as number (1/0). * - Colors: Use Hex codes (e.g., #004449). * - Enums: Use specified values exactly. */ export const AI_ACTIONS_SCHEMA = { // ─── MASTER MODULE TOGGLES (DASHBOARD) ────────────────────────────────────── TOGGLE_DASHBOARD_FEATURE: { action: "update_settings", description: "Master Toggle: Enable or disable a core module from the main dashboard. Values: 1 (Enabled), 0 (Disabled).", keys: { "abandoned_cart": "wawp_master_abandoned_cart", "otp_verification": "wawp_master_otp_verification", "whatsapp_sender": "wawp_master_whatsapp_sender", "email_sender": "wawp_master_email_sender", "sms_sender": "wawp_master_sms_sender", "chat_widget": "wawp_master_chat_widget", "notifications": "wawp_master_notifications" } }, // ─── ABANDONED CART SETTINGS ──────────────────────────────────────────────── ABANDONED_CART: { action: "update_settings", description: "Manage abandoned cart recovery popup and coupon settings.", keys: { "enable_popup": "wawp_ac_enable_popup", // 1/0 "title": "wawp_ac_popup_title", "description": "wawp_ac_popup_description", "display": "wawp_ac_popup_display", // both, desktop, mobile "where": "wawp_ac_popup_where", // all, shop_only "exclude_pages": "wawp_ac_popup_exclude_pages", // array of ids "data_cleaner": "wawp_ac_enable_data_cleaner", // 1/0 "trigger_cart": "wawp_ac_popup_trigger_cart", // 1/0 "trigger_exit": "wawp_ac_popup_trigger_exit", // 1/0 "hide_duration": "wawp_ac_popup_close_hide_duration", // number "initial_delay": "wawp_ac_popup_initial_delay", // number "frequency": "wawp_ac_popup_frequency", // once, limit "frequency_limit": "wawp_ac_popup_frequency_limit", // number "autofill_frontend": "wawp_ac_popup_autofill_frontend", // 1/0 "checkout_autofill": "wawp_ac_checkout_autofill", // 1/0 "hide_incomplete": "wawp_ac_hide_incomplete", // 1/0 "coupon_enable": "wawp_ac_coupon_enable", // 1/0 "coupon_amount": "wawp_ac_coupon_amount", "coupon_type": "wawp_ac_coupon_discount_type", // percent, fixed_cart "coupon_expiry": "wawp_ac_coupon_expiry_value", "coupon_unit": "wawp_ac_coupon_expiry_unit", // days, hours "coupon_free_shipping": "wawp_ac_coupon_free_shipping", // 1/0 "coupon_individual_use": "wawp_ac_coupon_individual_use", // 1/0 "coupon_min_spend": "wawp_ac_coupon_minimum_spend", "coupon_exclude_sale": "wawp_ac_coupon_exclude_sale_items" // 1/0 } }, // ─── PASSWORDLESS LOGIN & REGISTRATION ────────────────────────────────────── PASSWORDLESS_LOGIN: { action: "update_settings", description: "Manage passwordless login methods (Phone/Email), session lifetime, and visual branding.", keys: { "method": "wawp_pl_login_method", // phone_login, email_login, both "session_type": "wawp_pl_session_lifetime_type", // lifetime, minutes, hours, days "session_value": "wawp_pl_session_lifetime_value", // number "primary_email": "wawp_pl_primary_email_method", // otp, magic_link "email_password": "wawp_pl_enable_email_password", // 1/0 "enable_email": "wawp_pl_enable_email", // 1/0 "email_subject": "wawp_pl_otp_subject_email", "email_template": "wawp_pl_otp_email_template_id", "email_message": "wawp_pl_otp_message_email", "primary_phone": "wawp_pl_primary_phone_method", // whatsapp, firebase_sms "enable_whatsapp": "wawp_pl_enable_whatsapp", // 1/0 "whatsapp_message": "wawp_pl_otp_message_whatsapp", "enable_firebase": "wawp_pl_enable_firebase_sms", // 1/0 "logo": "wawp_pl_login_logo", "title": "wawp_pl_login_title", "description": "wawp_pl_login_description", "theme": "wawp_pl_login_color_theme", "css": "wawp_pl_login_custom_css" } }, REGISTRATION_FORM: { action: "update_settings", description: "Configure registration form fields, OTP verification, and redirection.", keys: { "enable_otp": "wawp_signup_enable_otp", // 1/0 "otp_method": "wawp_signup_otp_method", // whatsapp, firebase_sms, email "logo": "wawp_signup_logo", "title": "wawp_signup_title", "description": "wawp_signup_description", "theme": "wawp_signup_color_theme", "css": "wawp_signup_custom_css", "redirect_url": "wawp_signup_redirect_url", "strong_password": "wawp_signup_enable_strong_password", // 1/0 "auto_login": "wawp_signup_auto_login", // 1/0 "premium_design": "wawp_signup_enable_premium_design" // 1/0 } }, CHECKOUT_VERIFICATION: { action: "update_settings", description: "Manage OTP verification during WooCommerce checkout.", keys: { "enable": "wawp_enable_checkout_otp", // yes/no "mode": "wawp_otp_mode", // enable_for_all, enable_for_guests, enable_for_loggedin "method": "wawp_checkout_otp_method", // whatsapp, firebase, email "auto_verify": "wawp_auto_verify", // yes/no "excluded_payments": "wawp_excluded_payment_methods", // array "excluded_shipping": "wawp_excluded_shipping_methods", // array "min_amount": "wawp_min_order_amount", "max_amount": "wawp_max_order_amount", "logo": "wawp_checkout_logo", "title": "wawp_checkout_title", "description": "wawp_checkout_description" } }, CHAT_WIDGET: { action: "update_settings", description: "Configure the floating WhatsApp chat widget appearance and behavior.", keys: { "enable": "wawp_enable_button", // yes/no "header_title": "wawp_whatsapp_header", "welcome_msg": "wawp_welcome_message", "reply_time": "wawp_reply_time_text", "avatar_url": "wawp_avatar_url", "position": "wawp_button_position", // left/right "display_desktop": "wawp_display_desktop", // yes/no "display_mobile": "wawp_display_mobile", // yes/no "bg_color": "wawp_button_bg_color", "icon_color": "wawp_icon_color", "btn_size": "wawp_button_size", "corner_radius": "wawp_corner_radius", "trigger_all": "wawp_trigger_on_all_pages" // yes/no } }, SECURITY_RECAPTCHA: { action: "update_settings", description: "Manage Google reCAPTCHA v2/v3 integration for forms.", keys: { "site_key": "wawp_recaptcha_site_key", "secret_key": "wawp_recaptcha_secret_key", "type": "wawp_recaptcha_type", // v2_checkbox, v2_invisible, v3 "score": "wawp_recaptcha_score", // 0.1 to 1.0 "login": "wawp_recaptcha_enable_login", // 1/0 "register": "wawp_recaptcha_enable_register", // 1/0 "lostpassword": "wawp_recaptcha_enable_lostpassword", // 1/0 "checkout": "wawp_recaptcha_enable_checkout", // 1/0 "wawp_login": "wawp_recaptcha_enable_wawp_login", // 1/0 "wawp_signup": "wawp_recaptcha_enable_wawp_signup" // 1/0 } }, PHONE_FIELD: { action: "update_settings", description: "Advanced country code and phone field validation settings.", keys: { "default_country": "wawp_default_country_code", "ip_detection": "wawp_enable_ip_detection", // 1/0 "carrier_lookup": "wawp_enable_carrier_lookup", // 1/0 "whatsapp_check": "wawp_enable_whatsapp_check", // 1/0 "alignment": "wawp_country_code_alignment" // auto, left, right } }, BLOCK_MANAGER: { action: "update_settings", description: "Manage the list of blocked phone numbers.", keys: { "block_list": "wawp_block_list" // newline separated string } }, META_API_SENDER: { action: "update_settings", description: "Configure Meta (Facebook) Cloud API for official WhatsApp messaging.", keys: { "app_id": "wawp_mws_app_id", "app_secret": "wawp_mws_app_secret", "api_token": "wawp_mws_api_token", "waba_id": "wawp_mws_waba_id", "phone_id": "wawp_mws_phone_number_id", "verify_token": "wawp_mws_verify_token" } }, FIREBASE_SENDER: { action: "update_settings", description: "Configure Firebase for global SMS verification.", keys: { "api_key": "wawp_firebase_api_key", "project_id": "wawp_firebase_project_id", "auth_domain": "wawp_firebase_auth_domain", "app_id": "wawp_firebase_app_id", "storage_bucket": "wawp_firebase_storage_bucket", "sender_id": "wawp_firebase_messaging_sender_id" } }, WHATSAPP_WEB_SENDER: { action: "update_settings", description: "Manage feature routing for WhatsApp Web instances.", keys: { "otp_login_instance": "wawp_otp_instance", "otp_signup_instance": "wawp_signup_selected_instance", "otp_checkout_instance": "wawp_checkout_selected_instance", "general_instance": "wawp_general_instance", "notif_user_instances": "wawp_notif_selected_instance_ids", "notif_admin_instances": "wawp_notif_admin_selected_instance_ids" } }, AUTH_PAGES: { action: "update_settings", description: "Manage custom login/signup page assignments and redirections.", keys: { "login_page": "wawp_login_page", // page id "signup_page": "wawp_signup_page", // page id "redirect_wp_login": "wawp_redirect_wp_login", // 1/0 "replace_wc_forms": "wawp_replace_wc_forms", // 1/0 "phone_bar": "wawp_show_phone_bar", // 1/0 "phone_bar_text": "wawp_phone_bar_text" } }, SYSTEM_OPERATIONS: { action: "system_action", description: "Perform system-level maintenance and diagnostic operations.", keys: { "refresh_status": "refresh", "sync_users": "sync-users", "repair_all": "repair", "repair_table": "db/repair", "create_table": "db/create", "truncate_table": "db/truncate", "run_cron": "schedule-cron" } } }; export type AiAction = keyof typeof AI_ACTIONS_SCHEMA;