import { User } from './users'; export interface MessageListParams { created_after?: string; created_before?: string; chat_id?: string; case_id?: string; chat_provider_id?: string; bot_id?: string; type?: MessageType[]; action?: MessageAction; whatsapp_template_name?: string; order?: string; cursor?: string; page_size?: number; } export type MessageType = 'audio' | 'botevent' | 'button_message' | 'carousel' | 'chatevent' | 'contact' | 'custom' | 'deleted' | 'document' | 'form' | 'image' | 'list' | 'location' | 'missed' | 'other' | 'postback' | 'raw' | 'receipt' | 'text' | 'video' | 'webchat_client_settings' | 'webevent' | 'whatsapp_button_list' | 'whatsapp_cta_url_button' | 'whatsapp_template'; export type MessageAction = 'message_sent_by_enduser' | 'message_sent_by_agent' | 'message_sent_by_bot' | 'message_sent_by_campaign' | 'missed_enduser_msg' | 'case_created' | 'case_assigned_to' | 'case_reopened' | 'case_transferred_to' | 'case_status_changed' | 'case_contact_reasons_changed' | 'queue_closed' | 'queue_opened' | 'chat_closed_by_enduser' | 'chat_online' | 'chat_offline' | 'note' | 'bot_agent_rating' | 'bot_channel_rating' | 'bot_faq_useful' | 'bot_rating' | 'bot_faq' | 'bot_start' | 'bot_open' | 'bot_ai_model' | 'bot_ai_knowledge_base' | 'bot_keywords_model' | 'fallback' | 'handoff_option' | 'handoff_success' | 'handoff_fail' | 'flow_node' | 'nlu_intent' | 'nlu_intent_smart' | 'nlu_keyword' | 'knowledgebase' | 'custom' | 'feedback_message' | 'feedback_conversation' | 'feedback_knowledgebase' | 'feedback_webview' | 'feedback_case' | 'webview_step' | 'webview_end'; export type MessageAck = 'sent_attempt' | 'sent' | 'delivered' | 'read' | 'error'; export type MessageProvider = 'apple' | 'facebook' | 'generic' | 'instagram' | 'telegram' | 'twitter' | 'webchat' | 'whatsapp'; export interface Message { id: string; created_at: string; deleted_at: string | null; chat_id: string; provider: MessageProvider; chat_provider_id: string; type: MessageType; action: MessageAction; bot_id: string | null; queue_id: string | null; case_id: string | null; agent_id: string | null; agent: User; text: string | null; attachment_url: string | null; location: Record | null; contact: Record | null; extra_data: Record | null; whatsapp_template_message: Record | null; ack: MessageAck | null; error_message: string | null; carousel: Record | null; buttons: Record | null; list: Record | null; raw: Record | null; payload: string | null; event_data: Record; translations: { written_language: string | null; swapped_language: string | null; messages: Record; }; }