UNPKG

whatsapp-crm-common

Version:

Componentes compartidos para servicios de WhatsApp CRM - Common utilities and types for WhatsApp CRM system

39 lines 2.19 kB
import { ResultadoProcesamiento } from "../services/managers/history-manager"; import { WAMessage, WAMessageKey, WAMessageUpdate, MessageUserReceiptUpdate, proto, Chat } from "@whiskeysockets/baileys"; import { Contact } from "@whiskeysockets/baileys"; import { Pool } from "pg"; export declare class WhatsAppDataService { private messageRepo; private chatRepo; private contactRepo; private groupRepo; private syncRepo; private pool; constructor(pool: Pool); bulkInsertMessages(messages: WAMessage[], tenantId: string, agentId: number): Promise<import("..").Messages[]>; handleMessageUpdate(tenantId: string, agentId: number, messageUpdate: WAMessageUpdate): Promise<void>; handleBulkMessageUpdates(tenantId: string, agentId: number, messageUpdates: WAMessageUpdate[]): Promise<void>; handleMessageDelete(tenantId: string, agentId: number, deleteEvent: { keys: WAMessageKey[]; } | { jid: string; all: true; }): Promise<void>; handleMessageReactions(tenantId: string, agentId: number, reactions: { key: WAMessageKey; reaction: proto.IReaction; }[]): Promise<void>; handleMessageReceiptUpdates(updates: MessageUserReceiptUpdate[], tenantId: string, agentId: number): Promise<void>; handleChatUpserts(chats: Chat[], tenantId: string, agentId: number): Promise<void>; handleChatUpdates(tenantId: string, agentId: number, updates: any[]): Promise<void>; handleContactUpserts(contacts: Contact[], tenantId: string, agentId: number): Promise<void>; handleContactUpdates(tenantId: string, agentId: number, updates: Partial<Contact>[]): Promise<void>; bulkInsertContacts(contacts: any[], tenantId: string, agentId: number): Promise<void>; bulkInsertChats(chats: any[], tenantId: string, agentId: number): Promise<void>; guardarChatsEnBD(resultado: ResultadoProcesamiento, tenantId: string, agentId: number): Promise<void>; /** * Actualiza el estado de conexión para un tenant/agente */ updateConnectionStatus(tenantId: string, agentId: number, connected: boolean, reason?: string): Promise<void>; } //# sourceMappingURL=whatsapp-data-service.d.ts.map