UNPKG

skailan-conversations

Version:

Servicio de conversaciones y mensajería para Skailan

173 lines 3.85 kB
export interface AIResponse { response: string; intent?: string; confidence?: number; metadata?: { model?: string; tokens_used?: number; processing_time?: number; }; } export interface AIProcessRequest { organizationId: string; text: string; promptName: string; llmConfigName: string; parameters?: any; } export interface ContactResponse { id: string; externalId: string; name: string; email?: string; phone?: string; organizationId: string; createdAt: Date; updatedAt: Date; } export interface CreateContactRequest { externalId: string; name: string; email?: string; phone?: string; } export interface TelegramResponse { ok: boolean; result?: any; description?: string; error_code?: number; } export interface TelegramMessage { message_id: number; from: { id: number; is_bot: boolean; first_name: string; username?: string; language_code?: string; }; chat: { id: number; type: string; first_name?: string; username?: string; }; date: number; text?: string; } export interface TelegramCallbackQuery { id: string; from: { id: number; is_bot: boolean; first_name: string; username?: string; }; message: { message_id: number; chat: { id: number; type: string; }; date: number; }; data: string; } export interface TelegramUpdate { update_id: number; message?: TelegramMessage; callback_query?: TelegramCallbackQuery; } export interface ChannelConfig { telegram?: { botToken: string; webhookUrl?: string; botUsername?: string; }; whatsapp?: { phoneNumberId: string; accessToken: string; webhookVerifyToken?: string; }; email?: { smtpHost: string; smtpPort: number; username: string; password: string; }; } export type ConversationStatus = "open" | "closed" | "pending" | "assigned"; export interface ConversationState { status: ConversationStatus; assignedToUserId?: string; lastMessageAt: Date; tags?: string[]; } export type MessageType = "text" | "image" | "video" | "audio" | "document" | "callback"; export type SenderType = "contact" | "user" | "system" | "ai_system"; export interface MessageData { id: string; organizationId: string; conversationId: string; senderType: SenderType; senderId: string; type: MessageType; content?: string; mediaUrl?: string; externalMessageId?: string; status: string; timestamp: Date; createdAt: Date; } export interface ErrorResponse { error: string; code?: string; details?: any; timestamp: Date; } export interface ValidationError { field: string; message: string; value?: any; } export interface ValidationErrorResponse extends ErrorResponse { validationErrors: ValidationError[]; } export interface SuccessResponse<T = any> { success: boolean; data: T; message?: string; timestamp: Date; } export interface WebhookResponse { ok: boolean; message?: string; timestamp: Date; } export interface OrganizationData { id: string; name: string; domain?: string; settings?: any; createdAt: Date; updatedAt: Date; } export interface RepositoryResponse<T> { success: boolean; data?: T; error?: string; } export interface UseCaseRequest { organizationId: string; [key: string]: any; } export interface UseCaseResponse<T = any> { success: boolean; data?: T; error?: string; metadata?: { processingTime?: number; timestamp?: Date; }; } //# sourceMappingURL=api.d.ts.map