interface ConnectionHubConfig {
    apiUrl?: string;
    accessToken: string;
}
type ConnectionHubClientType = any;
interface BaseService {
    checkCredentials?(): void;
}
interface ConnectionData {
    pageId: string;
    pageName: string;
    pageAccessToken: string;
    clientBackURL: string;
    clientFrontURL: string;
    type: "facebook" | "instagram" | "email" | "mercadolivre" | "whatsapp" | "telegram";
    active: boolean;
    emailUser?: string;
    emailPassword?: string;
    emailImapHost?: string;
    emailImapPort?: number;
    emailImapTls?: boolean;
    emailSmtpHost?: string;
    emailSmtpPort?: number;
    emailSmtpTls?: boolean;
    accessToken?: string;
    channelToken?: string;
    wabaId?: string;
    businessAccountId?: string;
    whatsappPhoneNumber?: string;
    telegramBotUsername?: string;
}
interface MessageData {
    mid: string;
    fromMe?: boolean;
    from: {
        id: string;
        name?: string;
        email?: string;
    };
    to: {
        id: string;
        name?: string;
        email?: string;
    };
    timestamp?: number;
    message?: {
        mid?: string;
        text?: string;
        subject?: string;
        html?: string;
        textAsHtml?: string;
        references?: string[];
        attachments?: Array<{
            type: string;
            payload: {
                url?: string;
                filename?: string;
                mime_type?: string;
                size?: number;
                content?: string;
            };
        }>;
    };
    reaction?: {
        mid: string;
        action?: string;
        reaction?: string;
        emoji?: string;
    };
    read?: {
        mid: string;
    };
    comment?: {
        commentId: string;
        parentId?: string;
        postId?: string;
        text?: string;
        from?: {
            id?: string;
            name?: string;
        };
        verb?: string;
        mediaType?: string;
    };
    postReaction?: {
        postId?: string;
        reactionType?: string;
        from?: {
            id?: string;
            name?: string;
        };
        verb?: string;
    };
    storyMention?: {
        storyId?: string;
        storyUrl?: string;
        from?: {
            id?: string;
            name?: string;
        };
    };
    storyReply?: {
        storyId?: string;
        storyUrl?: string;
        text?: string;
        from?: {
            id?: string;
            name?: string;
        };
    };
    liveComment?: {
        liveId?: string;
        commentId?: string;
        text?: string;
        from?: {
            id?: string;
            name?: string;
        };
    };
    mention?: {
        mediaId?: string;
        commentId?: string;
        text?: string;
        from?: {
            id?: string;
            name?: string;
        };
    };
    status?: {
        mid: string;
        status: "sent" | "delivered" | "read" | "failed";
        recipientId?: string;
        conversation?: {
            id?: string;
            origin?: {
                type?: string;
            };
            expirationTimestamp?: string;
        };
        pricing?: {
            billable?: boolean;
            category?: string;
            pricingModel?: string;
        };
        errors?: Array<{
            code?: number;
            title?: string;
            message?: string;
            errorData?: {
                details?: string;
            };
        }>;
    };
    template?: {
        name?: string;
        language?: string;
    };
    location?: {
        latitude: number;
        longitude: number;
        name?: string;
        address?: string;
    };
    contacts?: Array<{
        name?: {
            formattedName?: string;
            firstName?: string;
            lastName?: string;
        };
        phones?: Array<{
            phone?: string;
            waId?: string;
            type?: string;
        }>;
    }>;
    interactive?: {
        type: "button_reply" | "list_reply";
        id: string;
        title: string;
        description?: string;
    };
    source: "facebook" | "instagram" | "email" | "telegram" | "mercadolivre" | "whatsapp" | string;
}
interface HubWebhookPayload {
    pageId: string;
    type: "facebook" | "instagram" | "whatsapp" | "telegram";
    messageData: MessageData[];
}
interface EmailWebhookPayload {
    type: "email";
    channelToken: string;
    messageData: MessageData[];
}
interface MercadoLivreWebhookPayload {
    pageId: string;
    messageData: any;
}
type WebhookPayload = HubWebhookPayload | EmailWebhookPayload | MercadoLivreWebhookPayload;
interface AuthResponse {
    success: boolean;
    token?: string;
    error?: string;
}
interface SendMessageResponse {
    success: boolean;
    messageId?: string;
    error?: string;
}
interface AttachmentInstagram {
    type: string;
    payload: {
        url: string;
    };
}
