import { O } from 'ts-toolbelt'; import * as clientEntities from './types/clientEntities'; import * as serverEntities from './types/serverEntities'; import { DirectResponse, IncomingWelcomeMessagePush, Push, Request } from './types/frames'; export declare const parseIncomingWelcomeMessagePush: (payload: IncomingWelcomeMessagePush['payload']) => { id: string; event: clientEntities.PredictedWelcomeMessageEvent; }; export declare const parseForm: (form: { id: string; fields: serverEntities.FormField[]; }) => { id: string; fields: clientEntities.FormField[]; }; export declare const parsePush: (push: Push) => { action: "chat_deactivated"; payload: { chatId: string; }; } | { action: "chat_properties_deleted"; payload: { chatId: string; properties: Record; }; } | { action: "chat_properties_updated"; payload: { chatId: string; properties: serverEntities.Properties; }; } | { action: "chat_transferred"; payload: { reason: "manual"; requesterId: string | undefined; chatId: string; threadId: string; transferredTo: { groupIds?: number[] | undefined; agentIds?: number[] | undefined; }; queue: { queuedAt: string; position: number; waitTime: number; } | null; } | { reason: "routing.inactive" | "routing.assigned"; chatId: string; threadId: string; transferredTo: { groupIds?: number[] | undefined; agentIds?: number[] | undefined; }; queue: { queuedAt: string; position: number; waitTime: number; } | null; }; } | { action: "customer_side_storage_updated"; payload: { customer_side_storage: serverEntities.SideStorage; }; } | { action: "customer_disconnected"; payload: { reason: "access_token_expired" | "connection_timeout" | "customer_banned" | "customer_temporarily_blocked" | "inactivity_timeout" | "internal_error" | "license_expired" | "license_not_found" | "misdirected_connection" | "product_version_changed" | "service_temporarily_unavailable" | "too_many_connections" | "too_many_unauthorized_connections" | "unsupported_version" | "logged_out_remotely"; data?: any; }; } | { action: "customer_updated"; payload: { name?: string | undefined; email?: string | undefined; avatar?: string | undefined; sessionFields?: clientEntities.CustomerSessionFields | undefined; id: string; }; } | { action: "event_properties_deleted"; payload: { chatId: string; threadId: string; eventId: string; properties: Record; }; } | { action: "event_properties_updated"; payload: { chatId: string; threadId: string; eventId: string; properties: serverEntities.Properties; }; } | { action: "event_updated"; payload: { chatId: string; threadId: string; event: clientEntities.Event | null; }; } | { action: "events_marked_as_seen"; payload: { chatId: string; userId: string; seenUpTo: string; }; } | { action: "greeting_accepted"; payload: { uniqueId: string; }; } | { action: "greeting_canceled"; payload: { uniqueId: string; }; } | { action: "groups_status_updated"; payload: { groups: { id: number; status: serverEntities.GroupStatus; }[]; }; } | { action: "incoming_chat"; payload: { chat: { thread: clientEntities.Thread; id: string; access: clientEntities.Access; users: clientEntities.ChatUser[]; properties: serverEntities.Properties; eventsSeenUpToMap: clientEntities.EventsSeenUpToMap; }; }; } | { action: "incoming_event"; payload: { chatId: string; event: clientEntities.Event | null; }; } | { action: "incoming_greeting"; payload: clientEntities.Greeting; } | { action: "incoming_multicast"; payload: { type?: string | undefined; content: any; }; } | { action: "incoming_rich_message_postback"; payload: { userId: string; chatId: string; threadId: string; eventId: string; postback: { id: string; toggled: boolean; }; }; } | { action: "incoming_typing_indicator"; payload: { chatId: string; typingIndicator: { authorId: string; isTyping: boolean; }; }; } | { action: "incoming_thinking_indicator"; payload: { description?: string | undefined; title?: string | undefined; customId?: string | undefined; chatId: string; threadId: string; authorId: string; sentAt: string; }; } | { action: "incoming_event_preview"; payload: { chatId: string; threadId: string; event: clientEntities.Event | null; }; } | { action: "incoming_welcome_message"; payload: { id: string; event: clientEntities.PredictedWelcomeMessageEvent; }; } | { action: "queue_position_updated"; payload: { chatId: string; threadId: string; queue: { position: number; waitTime: number; }; }; } | { action: "thread_properties_deleted"; payload: { chatId: string; threadId: string; properties: Record; }; } | { action: "thread_properties_updated"; payload: { chatId: string; threadId: string; properties: serverEntities.Properties; }; } | { action: "user_added_to_chat"; payload: { chatId: string; user: clientEntities.ChatUser; present: boolean; }; } | { action: "user_removed_from_chat"; payload: { chatId: string; userId: string; reason: "chat_deactivated" | "disconnected" | "manual" | "signed_out" | "remotely_signed_out" | "deleted" | "inactive" | "other"; }; }; export declare const parseResponse: ({ request, response, }: { request: O.Pick; response: DirectResponse; }) => { action: "accept_greeting"; payload: Readonly<{ readonly success: true; }>; } | { action: "cancel_greeting"; payload: Readonly<{ readonly success: true; }>; } | { action: "delete_chat_properties"; payload: Readonly<{ readonly success: true; }>; } | { action: "delete_event_properties"; payload: Readonly<{ readonly success: true; }>; } | { action: "delete_thread_properties"; payload: Readonly<{ readonly success: true; }>; } | { action: "get_chat"; payload: { thread: clientEntities.Thread | null; id: string; access: clientEntities.Access; users: clientEntities.ChatUser[]; properties: serverEntities.Properties; eventsSeenUpToMap: clientEntities.EventsSeenUpToMap; }; } | { action: "get_customer"; payload: { type: "customer"; id: string; name?: string | undefined; email?: string | undefined; avatar?: string | undefined; sessionFields: clientEntities.CustomerSessionFields; statistics: { chatsCount: number; threadsCount: number; visitsCount: number; pageViewsCount: number; greetingsShownCount: number; greetingsAcceptedCount: number; }; }; } | { action: "get_form"; payload: { enabled: false; } | { form: { id: string; fields: clientEntities.FormField[]; }; enabled: true; }; } | { action: "get_url_info"; payload: clientEntities.UrlInfo; } | { action: "list_chats"; payload: { chatsSummary: clientEntities.ChatSummary[]; totalChats: number; users: clientEntities.ChatUser[]; previousPageId: string | null; nextPageId: string | null; }; } | { action: "list_group_statuses"; payload: Record; } | { action: "list_threads"; payload: { threads: clientEntities.Thread[]; previousPageId: string | null; nextPageId: string | null; }; } | { action: "login"; payload: { greeting?: clientEntities.Greeting | undefined; dynamicConfig: serverEntities.DynamicConfig; customer: { type: "customer"; id: string; name?: string | undefined; email?: string | undefined; avatar?: string | undefined; sessionFields: clientEntities.CustomerSessionFields; statistics: { chatsCount: number; threadsCount: number; visitsCount: number; pageViewsCount: number; greetingsShownCount: number; greetingsAcceptedCount: number; }; }; availability: clientEntities.AvailabilityStatus; chats: { id: string; active: boolean | undefined; hasUnreadEvents: boolean; }[]; }; } | { action: "mark_events_as_seen"; payload: Readonly<{ readonly success: true; }>; } | { action: "request_welcome_message"; payload: { id: string; predictedAgent: clientEntities.PredictedAgent['agent'] & { botType: 'chatbot' | 'ai_agent'; }; queue: boolean; }; } | { action: "send_sneak_peek"; payload: Readonly<{ readonly success: true; }>; } | { action: "set_customer_session_fields"; payload: Readonly<{ readonly success: true; }>; } | { action: "send_greeting_button_clicked"; payload: Readonly<{ readonly success: true; }>; } | { action: "send_rich_message_postback"; payload: Readonly<{ readonly success: true; }>; } | { action: "update_chat_properties"; payload: Readonly<{ readonly success: true; }>; } | { action: "update_customer"; payload: Readonly<{ readonly success: true; }>; } | { action: "update_customer_page"; payload: Readonly<{ readonly success: true; }>; } | { action: "update_event_properties"; payload: Readonly<{ readonly success: true; }>; } | { action: "update_thread_properties"; payload: Readonly<{ readonly success: true; }>; }; export declare const parseServerError: (error: { type: string; message: string; }) => { code: string; message: string; }; //# sourceMappingURL=serverFrameParser.d.ts.map