redai-automation-web-sdk 1.9.16 → 1.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils/http.utils.ts","../src/types/common.types.ts","../src/utils/validation.utils.ts","../src/utils/event.utils.ts","../src/types/webhook.types.ts","../src/services/auth/auth.service.ts","../src/services/messaging/messaging.service.ts","../src/services/advanced-messaging/advanced-messaging.service.ts","../src/services/webhook/webhook.service.ts","../src/services/groups/groups.service.ts","../src/services/friends/friends.service.ts","../src/services/user-info/user-info.service.ts","../src/services/profile/profile.service.ts","../src/services/search/search.service.ts","../src/services/session-proxy/session-proxy.service.ts","../src/services/zalo-me/zalo-me.service.ts","../src/services/zalo-poll/zalo-poll.service.ts","../src/services/zalo-utils/zalo-utils.service.ts","../src/services/proxy/proxy.service.ts","../src/services/user-proxy/user-proxy.service.ts","../src/services/zalo-tool/zalo-tool.service.ts","../src/services/health/health.service.ts","../src/services/instance-manager/instance-manager.service.ts","../src/client/AutomationWebClient.ts","../src/types/auth.types.ts","../src/types/webhook/enums.ts","../src/types/webhook/message.ts","../src/types/webhook/typing.ts","../src/types/webhook/reaction.ts","../src/types/webhook/seen-message.ts","../src/types/webhook/delivered-message.ts","../src/types/webhook/undo.ts","../src/types/job/webhook-job.types.ts","../src/types/job/index.ts","../src/types/dto/profile.type.ts","../src/types/dto/proxy.type.ts","../src/types/dto/messaging.type.ts","../src/types/dto/session-proxy.type.ts","../src/utils/format.utils.ts"],"sourcesContent":["/**\n * Main entry point for RedAI Automation Web SDK\n */\n\n// Export main client\nexport { AutomationWebClient } from './client';\n\n// Export all types\nexport * from './types';\nexport { WebhookEvent } from './types/webhook.types';\n\n// Export webhook types specifically for convenience\nexport {\n Message,\n UserMessage,\n GroupMessage,\n Typing,\n UserTyping,\n GroupTyping,\n Reaction,\n SeenMessage,\n UserSeenMessage,\n GroupSeenMessage,\n DeliveredMessage,\n UserDeliveredMessage,\n GroupDeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n ThreadType,\n FriendEventType,\n GroupEventType,\n Reactions,\n DestType,\n ReminderRepeatMode,\n Gender as WebhookGender,\n BoardType,\n} from './types/webhook';\n\n// Export job types specifically for convenience\nexport {\n // Base job types\n ZaloWebhookEvent,\n ZaloWebhookEventType,\n BaseZaloWebhookEvent,\n WebhookQueueJob,\n JobPriority,\n JobStatus,\n QueueJobConfig,\n BaseQueueJob,\n AllQueueJobs,\n\n // Message job types\n ZaloMessageEvent,\n ZaloTextMessageEvent,\n ZaloImageMessageEvent,\n ZaloVideoMessageEvent,\n ZaloVoiceMessageEvent,\n ZaloFileMessageEvent,\n ZaloStickerMessageEvent,\n ZaloLocationMessageEvent,\n ZaloGifMessageEvent,\n ZaloLinkMessageEvent,\n ZaloDoodleMessageEvent,\n ZaloRecommendedMessageEvent,\n MessageQueueJob,\n MessageQueueJobUnion,\n\n // Event job types\n ZaloTypingEvent,\n ZaloSeenMessagesEvent,\n ZaloDeliveredMessagesEvent,\n ZaloReactionEvent,\n ZaloUndoEvent,\n\n // Friend & Group job types\n ZaloFriendEvent,\n ZaloGroupEvent,\n FriendEventQueueJob,\n GroupEventQueueJob,\n\n // System job types\n ZaloConnectionStatusEvent,\n ZaloUploadAttachmentEvent,\n ZaloCipherKeyEvent,\n ZaloErrorEvent,\n ZaloOldMessagesEvent,\n ZaloSystemEvent,\n ConnectionStatusQueueJob,\n UploadAttachmentQueueJob,\n CipherKeyQueueJob,\n ErrorQueueJob,\n OldMessagesQueueJob,\n SystemQueueJobUnion,\n\n // Helper functions\n isMessageEvent,\n isTypingEvent,\n isReactionEvent,\n isFriendEvent,\n isGroupEvent,\n isSystemEvent,\n isSelfEvent,\n isOtherEvent,\n isUserThreadEvent,\n isGroupThreadEvent,\n getEventCategory,\n getThreadTypeFromEvent,\n getActorTypeFromEvent,\n\n // Message direction helper functions\n isMessageReceivedFromUser,\n isMessageReceivedFromGroup,\n isMessageSentToGroup,\n isMessageSentToUser,\n\n // Constants\n MESSAGE_EVENT_TYPES,\n FRIEND_EVENT_TYPES,\n GROUP_EVENT_TYPES,\n} from './types/job';\n\n// Export services\nexport { AuthService } from './services/auth';\nexport { MessagingService } from './services/messaging';\nexport { AdvancedMessagingService } from './services/advanced-messaging';\nexport { WebhookService } from './services/webhook';\nexport { GroupService } from './services/groups';\nexport { FriendService } from './services/friends';\nexport { UserInfoService } from './services/user-info';\nexport { ProfileService } from './services/profile';\nexport { SearchService } from './services/search';\nexport { SessionProxyService } from './services/session-proxy';\nexport { ZaloMeService } from './services/zalo-me';\nexport { ZaloPollService } from './services/zalo-poll';\nexport { ZaloUtilsService } from './services/zalo-utils';\nexport { ProxyService } from './services/proxy';\nexport { UserProxyService } from './services/user-proxy';\nexport { ZaloToolService } from './services/zalo-tool';\nexport { HealthService } from './services/health';\nexport { InstanceManagerService } from './services/instance-manager';\n\n// Export all friends types\nexport type * from './services/friends';\n\n// Export utilities\nexport * from './utils';\n\n// Export validation error\nexport { ValidationError } from './utils/validation.utils';\n\n// Default export\nexport { AutomationWebClient as default } from './client';\n","/**\n * HTTP utility functions for making API requests\n */\n\nimport axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { AutomationWebConfig, AutomationWebResponse, RequestOptions } from '../types/common.types';\n\n/**\n * HTTP client class for making requests to automation-web API\n */\nexport class HttpClient {\n private axiosInstance: AxiosInstance;\n private config: AutomationWebConfig;\n\n constructor(config: AutomationWebConfig) {\n this.config = config;\n this.axiosInstance = this.createAxiosInstance();\n }\n\n /**\n * Create axios instance with default configuration\n */\n private createAxiosInstance(): AxiosInstance {\n const instance = axios.create({\n baseURL: this.config.baseUrl,\n timeout: this.config.timeout || 30000,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': this.config.userAgent || '@redai/automation-web-sdk/1.9.11',\n ...(this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }),\n },\n });\n\n // Request interceptor\n instance.interceptors.request.use(\n (config: any) => {\n if (this.config.logging) {\n console.log(`[HTTP] ${config.method?.toUpperCase()} ${config.url}`, {\n params: config.params,\n data: config.data,\n });\n }\n return config;\n },\n (error: any) => {\n if (this.config.logging) {\n console.error('[HTTP] Request error:', error);\n }\n return Promise.reject(error);\n }\n );\n\n // Response interceptor\n instance.interceptors.response.use(\n (response: AxiosResponse) => {\n if (this.config.logging) {\n console.log(`[HTTP] ${response.status} ${response.config.url}`, {\n data: response.data,\n });\n }\n return response;\n },\n (error: unknown) => {\n if (this.config.logging) {\n if (axios.isAxiosError(error)) {\n console.error('[HTTP] Response error:', error.response?.data || error.message);\n } else {\n console.error('[HTTP] Response error:', error);\n }\n }\n return Promise.reject(error);\n }\n );\n\n return instance;\n }\n\n /**\n * Make HTTP request (single attempt, no retry)\n */\n private async makeRequestWithRetry<T>(\n requestConfig: AxiosRequestConfig\n ): Promise<AxiosResponse<AutomationWebResponse<T>>> {\n return this.axiosInstance.request(requestConfig);\n }\n\n /**\n * Generic request method\n */\n async request<T = any>(options: RequestOptions): Promise<T> {\n const requestConfig: AxiosRequestConfig = {\n method: options.method,\n url: options.url,\n data: options.data,\n params: options.params,\n headers: options.headers,\n timeout: options.timeout || this.config.timeout,\n };\n\n const response = await this.makeRequestWithRetry<T>(requestConfig);\n return response.data as T;\n }\n\n /**\n * GET request\n */\n async get<T = any>(\n url: string,\n params?: Record<string, any>,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'GET',\n url,\n params,\n headers,\n });\n }\n\n /**\n * POST request\n */\n async post<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'POST',\n url,\n data,\n headers,\n });\n }\n\n /**\n * PUT request\n */\n async put<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'PUT',\n url,\n data,\n headers,\n });\n }\n\n /**\n * DELETE request\n */\n async delete<T = any>(\n url: string,\n params?: Record<string, any>,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'DELETE',\n url,\n params,\n headers,\n });\n }\n\n async deleteWithBody<T = any>(\n url: string,\n data?: any,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'DELETE',\n url,\n data,\n headers,\n });\n }\n\n /**\n * PATCH request\n */\n async patch<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'PATCH',\n url,\n data,\n headers,\n });\n }\n\n /**\n * Update configuration\n */\n updateConfig(newConfig: Partial<AutomationWebConfig>): void {\n this.config = { ...this.config, ...newConfig };\n this.axiosInstance = this.createAxiosInstance();\n }\n\n /**\n * Get current configuration\n */\n getConfig(): AutomationWebConfig {\n return { ...this.config };\n }\n}\n\n/**\n * Utility functions for HTTP operations\n */\nexport class HttpUtils {\n /**\n * Build query string from parameters\n */\n static buildQueryString(params: Record<string, any>): string {\n const searchParams = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach(item => searchParams.append(key, String(item)));\n } else {\n searchParams.append(key, String(value));\n }\n }\n });\n\n return searchParams.toString();\n }\n\n /**\n * Parse response headers\n */\n static parseHeaders(headers: Record<string, string>): Record<string, string> {\n const parsed: Record<string, string> = {};\n\n Object.entries(headers).forEach(([key, value]) => {\n parsed[key.toLowerCase()] = value;\n });\n\n return parsed;\n }\n\n /**\n * Check if URL is absolute\n */\n static isAbsoluteUrl(url: string): boolean {\n return /^https?:\\/\\//.test(url);\n }\n\n /**\n * Join URL paths\n */\n static joinPaths(...paths: string[]): string {\n return paths\n .map(path => path.replace(/^\\/+|\\/+$/g, ''))\n .filter(path => path.length > 0)\n .join('/');\n }\n\n /**\n * Validate URL format\n */\n static isValidUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Extract domain from URL\n */\n static extractDomain(url: string): string | null {\n try {\n const urlObj = new URL(url);\n return urlObj.hostname;\n } catch {\n return null;\n }\n }\n\n /**\n * Format file size in human readable format\n */\n static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n if (bytes === 0) return '0 Bytes';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];\n }\n\n /**\n * Get MIME type from file extension\n */\n static getMimeType(filename: string): string {\n const ext = filename.split('.').pop()?.toLowerCase();\n const mimeTypes: Record<string, string> = {\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n avi: 'video/avi',\n mov: 'video/quicktime',\n mp3: 'audio/mpeg',\n wav: 'audio/wav',\n pdf: 'application/pdf',\n doc: 'application/msword',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n txt: 'text/plain',\n json: 'application/json',\n xml: 'application/xml',\n zip: 'application/zip',\n rar: 'application/x-rar-compressed',\n };\n\n return mimeTypes[ext || ''] || 'application/octet-stream';\n }\n}\n","/**\n * Common types and interfaces used across the SDK\n */\n\n/**\n * Base response interface from automation-web API\n */\nexport interface AutomationWebResponse<T = any> {\n /**\n * Result data from the API\n */\n result?: T;\n\n /**\n * HTTP status code\n */\n code?: number;\n\n /**\n * Response message\n */\n message?: string;\n\n /**\n * Error message (if any)\n */\n error?: string;\n}\n\n/**\n * SDK Configuration interface\n */\nexport interface AutomationWebConfig {\n /**\n * Base URL of the automation-web API\n * @default 'http://localhost:3000'\n */\n baseUrl: string;\n\n /**\n * Request timeout in milliseconds\n * @default 30000\n */\n timeout?: number;\n\n /**\n * Number of retry attempts for failed requests (deprecated, no-op)\n * @default 0\n */\n retryCount?: number;\n\n /**\n * Delay between retry attempts in milliseconds (deprecated, no-op)\n * @default 0\n */\n retryDelay?: number;\n\n /**\n * API key for authentication (if required)\n */\n apiKey?: string;\n\n /**\n * Custom user agent string\n */\n userAgent?: string;\n\n /**\n * Enable debug logging\n * @default false\n */\n logging?: boolean;\n}\n\n/**\n * Default SDK configuration\n */\nexport const DEFAULT_CONFIG: Required<Omit<AutomationWebConfig, 'apiKey'>> = {\n baseUrl: 'http://localhost:3000',\n timeout: 30000,\n retryCount: 0,\n retryDelay: 0,\n userAgent: '@redai/automation-web-sdk/1.9.11',\n logging: false,\n};\n\n/**\n * Thread type enum for messaging\n */\nexport enum ThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Message urgency levels\n */\nexport enum Urgency {\n LOW = 1,\n NORMAL = 2,\n HIGH = 3,\n}\n\n/**\n * Text style types for message formatting\n */\nexport enum TextStyle {\n BOLD = 'font-weight:bold',\n ITALIC = 'font-style:italic',\n UNDERLINE = 'text-decoration:underline',\n STRIKETHROUGH = 'text-decoration:line-through',\n}\n\n/**\n * Zalo reactions enum\n */\nexport enum ZaloReactions {\n LIKE = '/-heart',\n LOVE = '/-heart',\n HAHA = ':))',\n WOW = ':-o',\n SAD = ':(',\n ANGRY = '>-|',\n HANDCLAP = ':handclap',\n}\n\n/**\n * Style object for message text formatting\n */\nexport interface StyleDto {\n /**\n * Start position of the style\n */\n start: number;\n\n /**\n * Length of the styled text\n */\n len: number;\n\n /**\n * Style type\n */\n st: string;\n}\n\n/**\n * Mention object for tagging users in messages\n */\nexport interface MentionDto {\n /**\n * User ID to mention\n */\n uid: string;\n\n /**\n * Start position of the mention\n */\n start: number;\n\n /**\n * Length of the mention text\n */\n len: number;\n}\n\n/**\n * Quote object for replying to messages\n */\nexport interface SendMessageQuoteDto {\n /**\n * ID of the message being quoted\n */\n msgId: string;\n\n /**\n * Content of the quoted message\n */\n content: string;\n\n /**\n * Author of the quoted message\n */\n author: string;\n}\n\n/**\n * Attachment metadata\n */\nexport interface AttachmentDto {\n /**\n * URL of the attachment\n */\n url: string;\n\n /**\n * File name\n */\n fileName?: string;\n\n /**\n * File size in bytes\n */\n fileSize?: number;\n\n /**\n * MIME type\n */\n mimeType?: string;\n\n /**\n * Duration for audio/video files\n */\n duration?: number;\n\n /**\n * Thumbnail URL for images/videos\n */\n thumbnail?: string;\n}\n\n/**\n * Pagination parameters\n */\nexport interface PaginationParams {\n /**\n * Page number (1-based)\n */\n page?: number;\n\n /**\n * Number of items per page\n */\n limit?: number;\n\n /**\n * Sort field\n */\n sortBy?: string;\n\n /**\n * Sort order\n */\n sortOrder?: 'asc' | 'desc';\n}\n\n/**\n * Paginated response\n */\nexport interface PaginatedResponse<T> {\n /**\n * Array of items\n */\n items: T[];\n\n /**\n * Total number of items\n */\n total: number;\n\n /**\n * Current page number\n */\n page: number;\n\n /**\n * Number of items per page\n */\n limit: number;\n\n /**\n * Total number of pages\n */\n totalPages: number;\n\n /**\n * Whether there are more pages\n */\n hasNext: boolean;\n\n /**\n * Whether there are previous pages\n */\n hasPrev: boolean;\n}\n\n/**\n * Operation result for batch operations\n */\nexport interface OperationResult {\n /**\n * Whether the operation was successful\n */\n success: boolean;\n\n /**\n * Error message if operation failed\n */\n error?: string;\n\n /**\n * Additional data\n */\n data?: any;\n}\n\n/**\n * Batch operation result\n */\nexport interface BatchOperationResult {\n /**\n * Total number of operations attempted\n */\n total: number;\n\n /**\n * Number of successful operations\n */\n successful: number;\n\n /**\n * Number of failed operations\n */\n failed: number;\n\n /**\n * Individual operation results\n */\n results: OperationResult[];\n\n /**\n * Summary of the batch operation\n */\n summary: {\n successRate: number;\n errors: string[];\n };\n}\n\n/**\n * Event handler function type\n */\nexport type EventHandler<T = any> = (data: T) => Promise<void> | void;\n\n/**\n * HTTP method types\n */\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n\n/**\n * Request options for HTTP client\n */\nexport interface RequestOptions {\n method: HttpMethod;\n url: string;\n data?: any;\n params?: Record<string, any>;\n headers?: Record<string, string>;\n timeout?: number;\n}\n","/**\n * Validation utility functions\n */\n\nimport { AutomationWebConfig, ThreadType, Urgency } from '../types/common.types';\n\n/**\n * Validation error class\n */\nexport class ValidationError extends Error {\n constructor(\n message: string,\n public field?: string\n ) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Validation utility class\n */\nexport class ValidationUtils {\n /**\n * Validate session ID format\n */\n static validateSessionId(sessionId: string): void {\n if (!sessionId || typeof sessionId !== 'string') {\n throw new ValidationError('Session ID is required and must be a string', 'sessionId');\n }\n\n if (sessionId.trim().length === 0) {\n throw new ValidationError('Session ID cannot be empty', 'sessionId');\n }\n\n // Check if it matches expected format (session-uuid)\n const sessionIdPattern =\n /^session-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!sessionIdPattern.test(sessionId)) {\n throw new ValidationError('Session ID format is invalid', 'sessionId');\n }\n }\n\n /**\n * Validate creator UUID format\n */\n static validateCreatedBy(createdBy: string): void {\n if (!createdBy || typeof createdBy !== 'string') {\n throw new ValidationError('CreatedBy UUID is required and must be a string', 'createdBy');\n }\n\n const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!uuidPattern.test(createdBy)) {\n throw new ValidationError('CreatedBy UUID format is invalid', 'createdBy');\n }\n }\n\n /**\n * Validate user UUID format (deprecated: use validateCreatedBy)\n */\n static validateUserUuid(userUuid: string): void {\n if (!userUuid || typeof userUuid !== 'string') {\n throw new ValidationError('User UUID is required and must be a string', 'userUuid');\n }\n\n const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!uuidPattern.test(userUuid)) {\n throw new ValidationError('User UUID format is invalid', 'userUuid');\n }\n }\n\n /**\n * Validate thread ID\n */\n static validateThreadId(threadId: string): void {\n if (!threadId || typeof threadId !== 'string') {\n throw new ValidationError('Thread ID is required and must be a string', 'threadId');\n }\n\n if (threadId.trim().length === 0) {\n throw new ValidationError('Thread ID cannot be empty', 'threadId');\n }\n }\n\n /**\n * Validate thread type\n */\n static validateThreadType(threadType: ThreadType): void {\n if (!Object.values(ThreadType).includes(threadType)) {\n throw new ValidationError(\n `Thread type must be one of: ${Object.values(ThreadType).join(', ')}`,\n 'threadType'\n );\n }\n }\n\n /**\n * Validate message content\n */\n static validateMessageContent(content: string): void {\n if (!content || typeof content !== 'string') {\n throw new ValidationError('Message content is required and must be a string', 'content');\n }\n\n if (content.trim().length === 0) {\n throw new ValidationError('Message content cannot be empty', 'content');\n }\n\n // Check maximum length (Zalo limit is typically 2000 characters)\n if (content.length > 2000) {\n throw new ValidationError(\n 'Message content exceeds maximum length of 2000 characters',\n 'content'\n );\n }\n }\n\n /**\n * Validate URL format\n */\n static validateUrl(url: string, fieldName: string = 'url'): void {\n if (!url || typeof url !== 'string') {\n throw new ValidationError(`${fieldName} is required and must be a string`, fieldName);\n }\n\n try {\n new URL(url);\n } catch {\n throw new ValidationError(`${fieldName} must be a valid URL`, fieldName);\n }\n }\n\n /**\n * Validate urgency level\n */\n static validateUrgency(urgency: Urgency): void {\n if (!Object.values(Urgency).includes(urgency)) {\n throw new ValidationError(\n `Urgency must be one of: ${Object.values(Urgency).join(', ')}`,\n 'urgency'\n );\n }\n }\n\n /**\n * Validate phone number format (Vietnamese)\n */\n static validatePhoneNumber(phoneNumber: string): void {\n if (!phoneNumber || typeof phoneNumber !== 'string') {\n throw new ValidationError('Phone number is required and must be a string', 'phoneNumber');\n }\n\n // Vietnamese phone number patterns\n const patterns = [\n /^(\\+84|84|0)(3[2-9]|5[6|8|9]|7[0|6-9]|8[1-6|8|9]|9[0-4|6-9])[0-9]{7}$/, // Mobile\n /^(\\+84|84|0)(2[0-9])[0-9]{8}$/, // Landline\n ];\n\n const isValid = patterns.some(pattern => pattern.test(phoneNumber.replace(/\\s/g, '')));\n if (!isValid) {\n throw new ValidationError('Phone number format is invalid', 'phoneNumber');\n }\n }\n\n /**\n * Validate email format\n */\n static validateEmail(email: string): void {\n if (!email || typeof email !== 'string') {\n throw new ValidationError('Email is required and must be a string', 'email');\n }\n\n const emailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailPattern.test(email)) {\n throw new ValidationError('Email format is invalid', 'email');\n }\n }\n\n /**\n * Validate array of IDs\n */\n static validateIdArray(ids: string[], fieldName: string, minLength: number = 1): void {\n if (!Array.isArray(ids)) {\n throw new ValidationError(`${fieldName} must be an array`, fieldName);\n }\n\n if (ids.length < minLength) {\n throw new ValidationError(\n `${fieldName} must contain at least ${minLength} item(s)`,\n fieldName\n );\n }\n\n ids.forEach((id, index) => {\n if (!id || typeof id !== 'string' || id.trim().length === 0) {\n throw new ValidationError(`${fieldName}[${index}] must be a non-empty string`, fieldName);\n }\n });\n }\n\n /**\n * Validate pagination parameters\n */\n static validatePagination(page?: number, limit?: number): void {\n if (page !== undefined) {\n if (!Number.isInteger(page) || page < 1) {\n throw new ValidationError('Page must be a positive integer', 'page');\n }\n }\n\n if (limit !== undefined) {\n if (!Number.isInteger(limit) || limit < 1 || limit > 100) {\n throw new ValidationError('Limit must be an integer between 1 and 100', 'limit');\n }\n }\n }\n\n /**\n * Validate file size\n */\n static validateFileSize(size: number, maxSize: number = 50 * 1024 * 1024): void {\n // 50MB default\n if (!Number.isInteger(size) || size < 0) {\n throw new ValidationError('File size must be a non-negative integer', 'fileSize');\n }\n\n if (size > maxSize) {\n throw new ValidationError(\n `File size exceeds maximum allowed size of ${this.formatFileSize(maxSize)}`,\n 'fileSize'\n );\n }\n }\n\n /**\n * Validate timeout value\n */\n static validateTimeout(timeout: number): void {\n if (!Number.isInteger(timeout) || timeout < 1000 || timeout > 300000) {\n // 1s to 5min\n throw new ValidationError(\n 'Timeout must be an integer between 1000 and 300000 milliseconds',\n 'timeout'\n );\n }\n }\n\n /**\n * Validate delay value\n */\n static validateDelay(delay: number): void {\n if (!Number.isInteger(delay) || delay < 0 || delay > 60000) {\n // 0 to 1 minute\n throw new ValidationError(\n 'Delay must be an integer between 0 and 60000 milliseconds',\n 'delay'\n );\n }\n }\n\n /**\n * Validate batch size\n */\n static validateBatchSize(batchSize: number): void {\n if (!Number.isInteger(batchSize) || batchSize < 1 || batchSize > 100) {\n throw new ValidationError('Batch size must be an integer between 1 and 100', 'batchSize');\n }\n }\n\n /**\n * Validate retry count\n */\n static validateRetryCount(retryCount: number): void {\n if (!Number.isInteger(retryCount) || retryCount < 0 || retryCount > 10) {\n throw new ValidationError('Retry count must be an integer between 0 and 10', 'retryCount');\n }\n }\n\n /**\n * Validate SDK configuration\n */\n static validateConfig(config: AutomationWebConfig): void {\n // Validate base URL\n this.validateUrl(config.baseUrl, 'baseUrl');\n\n // Validate optional numeric fields\n if (config.timeout !== undefined) {\n this.validateTimeout(config.timeout);\n }\n\n if (config.retryCount !== undefined) {\n this.validateRetryCount(config.retryCount);\n }\n\n if (config.retryDelay !== undefined) {\n this.validateDelay(config.retryDelay);\n }\n\n // Validate user agent\n if (config.userAgent !== undefined && typeof config.userAgent !== 'string') {\n throw new ValidationError('User agent must be a string', 'userAgent');\n }\n\n // Validate logging flag\n if (config.logging !== undefined && typeof config.logging !== 'boolean') {\n throw new ValidationError('Logging must be a boolean', 'logging');\n }\n }\n\n /**\n * Validate date string format\n */\n static validateDateString(dateString: string, fieldName: string = 'date'): void {\n if (!dateString || typeof dateString !== 'string') {\n throw new ValidationError(`${fieldName} is required and must be a string`, fieldName);\n }\n\n const date = new Date(dateString);\n if (isNaN(date.getTime())) {\n throw new ValidationError(`${fieldName} must be a valid date string`, fieldName);\n }\n }\n\n /**\n * Validate date range\n */\n static validateDateRange(startDate: string, endDate: string): void {\n this.validateDateString(startDate, 'startDate');\n this.validateDateString(endDate, 'endDate');\n\n const start = new Date(startDate);\n const end = new Date(endDate);\n\n if (start >= end) {\n throw new ValidationError('Start date must be before end date');\n }\n }\n\n /**\n * Format file size for error messages\n */\n private static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n if (bytes === 0) return '0 Bytes';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];\n }\n\n /**\n * Sanitize string input\n */\n static sanitizeString(input: string): string {\n if (typeof input !== 'string') {\n return '';\n }\n\n return input\n .trim()\n .replace(/[\\x00-\\x1F\\x7F]/g, '') // Remove control characters\n .replace(/\\s+/g, ' '); // Normalize whitespace\n }\n\n /**\n * Validate and sanitize message content\n */\n static sanitizeMessageContent(content: string): string {\n const sanitized = this.sanitizeString(content);\n this.validateMessageContent(sanitized);\n return sanitized;\n }\n\n /**\n * Check if value is empty\n */\n static isEmpty(value: any): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string') {\n return value.trim().length === 0;\n }\n\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n }\n\n /**\n * Validate required field\n */\n static validateRequired(value: any, fieldName: string): void {\n if (this.isEmpty(value)) {\n throw new ValidationError(`${fieldName} is required`, fieldName);\n }\n }\n}\n","/**\n * Event handling utility functions\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { WebhookEvent, WebhookEventHandler } from '../types/webhook.types';\n\n/**\n * Event manager class for handling webhook events\n */\nexport class EventManager extends EventEmitter {\n private handlers: Map<string, Set<WebhookEventHandler>> = new Map();\n\n /**\n * Register event handler\n */\n addHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.on(eventType, handler);\n\n if (!this.handlers.has(eventType)) {\n this.handlers.set(eventType, new Set());\n }\n this.handlers.get(eventType)!.add(handler as WebhookEventHandler);\n\n return this;\n }\n\n /**\n * Register one-time event handler\n */\n addOnceHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.once(eventType, handler);\n return this;\n }\n\n /**\n * Remove event handler\n */\n removeHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.off(eventType, handler);\n\n const handlers = this.handlers.get(eventType);\n if (handlers) {\n handlers.delete(handler as WebhookEventHandler);\n if (handlers.size === 0) {\n this.handlers.delete(eventType);\n }\n }\n\n return this;\n }\n\n /**\n * Remove all handlers for event type\n */\n removeAllListeners(eventType?: string): this {\n if (eventType) {\n super.removeAllListeners(eventType);\n this.handlers.delete(eventType);\n } else {\n super.removeAllListeners();\n this.handlers.clear();\n }\n\n return this;\n }\n\n /**\n * Emit event to all handlers\n */\n async emitAsync<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n event: T\n ): Promise<void> {\n const handlers = this.handlers.get(eventType);\n if (!handlers || handlers.size === 0) {\n return;\n }\n\n const promises = Array.from(handlers).map(async handler => {\n try {\n await handler(event);\n } catch (error) {\n console.error(`Error in event handler for ${eventType}:`, error);\n this.emit('error', error, eventType, event);\n }\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Get registered event types\n */\n getEventTypes(): string[] {\n return Array.from(this.handlers.keys());\n }\n\n /**\n * Get handler count for event type\n */\n getHandlerCount(eventType: string): number {\n return this.handlers.get(eventType)?.size || 0;\n }\n\n /**\n * Check if event type has handlers\n */\n hasHandlers(eventType: string): boolean {\n return this.getHandlerCount(eventType) > 0;\n }\n}\n\n/**\n * Event utilities class\n */\nexport class EventUtils {\n /**\n * Check if event is a message event\n */\n static isMessageEvent(eventType: string): boolean {\n return eventType.includes('message') && !eventType.includes('reaction');\n }\n\n /**\n * Check if event is a group event\n */\n static isGroupEvent(eventType: string): boolean {\n return (\n eventType.includes('group') ||\n eventType.includes('from-group') ||\n eventType.includes('to-group')\n );\n }\n\n /**\n * Check if event is a friend event\n */\n static isFriendEvent(eventType: string): boolean {\n return (\n eventType.includes('friend') ||\n eventType.includes('user-online') ||\n eventType.includes('user-offline')\n );\n }\n\n /**\n * Check if event is a connection event\n */\n static isConnectionEvent(eventType: string): boolean {\n return eventType.includes('connection') || eventType.includes('session');\n }\n\n /**\n * Check if event is an error event\n */\n static isErrorEvent(eventType: string): boolean {\n return eventType.includes('error') || eventType.includes('rate-limit');\n }\n\n /**\n * Extract message type from event type\n */\n static extractMessageType(eventType: string): string | null {\n const match = eventType.match(\n /^(text|image|video|voice|file|sticker|location|link|gif|doodle)-message/\n );\n return match ? match[1] : null;\n }\n\n /**\n * Extract direction from event type (sent/received)\n */\n static extractDirection(eventType: string): 'sent' | 'received' | null {\n if (eventType.includes('sent-to')) return 'sent';\n if (eventType.includes('received-from')) return 'received';\n return null;\n }\n\n /**\n * Extract target type from event type (user/group)\n */\n static extractTargetType(eventType: string): 'user' | 'group' | null {\n if (eventType.includes('to-user') || eventType.includes('from-user')) return 'user';\n if (eventType.includes('to-group') || eventType.includes('from-group')) return 'group';\n return null;\n }\n\n /**\n * Normalize event type\n */\n static normalizeEventType(eventType: string): string {\n return eventType.toLowerCase().replace(/[_\\s]+/g, '-');\n }\n\n /**\n * Create event filter function\n */\n static createEventFilter(criteria: {\n messageTypes?: string[];\n directions?: ('sent' | 'received')[];\n targetTypes?: ('user' | 'group')[];\n sessionIds?: string[];\n createdBys?: string[];\n userUuids?: string[];\n }) {\n return (event: WebhookEvent): boolean => {\n // Filter by message type\n if (criteria.messageTypes && criteria.messageTypes.length > 0) {\n const messageType = this.extractMessageType(event.eventType);\n if (!messageType || !criteria.messageTypes.includes(messageType)) {\n return false;\n }\n }\n\n // Filter by direction\n if (criteria.directions && criteria.directions.length > 0) {\n const direction = this.extractDirection(event.eventType);\n if (!direction || !criteria.directions.includes(direction)) {\n return false;\n }\n }\n\n // Filter by target type\n if (criteria.targetTypes && criteria.targetTypes.length > 0) {\n const targetType = this.extractTargetType(event.eventType);\n if (!targetType || !criteria.targetTypes.includes(targetType)) {\n return false;\n }\n }\n\n // Filter by session ID\n if (criteria.sessionIds && criteria.sessionIds.length > 0) {\n if (!criteria.sessionIds.includes(event.sessionId)) {\n return false;\n }\n }\n\n // Filter by createdBy / user UUID\n const userFilterList = criteria.createdBys || criteria.userUuids;\n if (userFilterList && userFilterList.length > 0) {\n const creator = (event as any).createdBy || (event as any).userUuid;\n if (!creator || !userFilterList.includes(creator)) {\n return false;\n }\n }\n\n return true;\n };\n }\n\n /**\n * Debounce function for event handling\n */\n static debounce<T extends any[]>(\n func: (...args: T) => void,\n delay: number\n ): (...args: T) => void {\n let timeoutId: NodeJS.Timeout;\n\n return (...args: T) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => func(...args), delay);\n };\n }\n\n /**\n * Throttle function for event handling\n */\n static throttle<T extends any[]>(\n func: (...args: T) => void,\n delay: number\n ): (...args: T) => void {\n let lastCall = 0;\n\n return (...args: T) => {\n const now = Date.now();\n if (now - lastCall >= delay) {\n lastCall = now;\n func(...args);\n }\n };\n }\n\n /**\n * Create rate limiter for events\n */\n static createRateLimiter(maxEvents: number, windowMs: number) {\n const events: number[] = [];\n\n return {\n canProcess(): boolean {\n const now = Date.now();\n const windowStart = now - windowMs;\n\n // Remove old events outside the window\n while (events.length > 0 && events[0] < windowStart) {\n events.shift();\n }\n\n // Check if we can add another event\n if (events.length < maxEvents) {\n events.push(now);\n return true;\n }\n\n return false;\n },\n\n getRemainingEvents(): number {\n const now = Date.now();\n const windowStart = now - windowMs;\n\n // Remove old events\n while (events.length > 0 && events[0] < windowStart) {\n events.shift();\n }\n\n return Math.max(0, maxEvents - events.length);\n },\n\n getResetTime(): number {\n if (events.length === 0) {\n return 0;\n }\n\n return events[0] + windowMs;\n },\n };\n }\n\n /**\n * Create event aggregator\n */\n static createEventAggregator<T>(windowMs: number, processor: (events: T[]) => void) {\n const events: T[] = [];\n let timeoutId: NodeJS.Timeout | null = null;\n\n return {\n add(event: T): void {\n events.push(event);\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n timeoutId = setTimeout(() => {\n if (events.length > 0) {\n processor([...events]);\n events.length = 0;\n }\n timeoutId = null;\n }, windowMs);\n },\n\n flush(): void {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n if (events.length > 0) {\n processor([...events]);\n events.length = 0;\n }\n },\n\n getQueuedCount(): number {\n return events.length;\n },\n };\n }\n}\n","/**\n * Zalo Personal Webhook Events SDK\n * Chuẩn hóa types cho tất cả webhook events từ automation-web\n * Source: automation-web/src/shared/types/zalo-webhook-events.types.ts\n */\n\n// ==================== BASE TYPES ====================\n\n/**\n * Thread Type enum\n */\nexport enum ZaloThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Event Type enum - Chuẩn hóa tất cả event types\n */\nexport enum ZaloWebhookEventType {\n // ==================== TIN NHẮN TEXT (4 events) ====================\n TEXT_MESSAGE_SENT_TO_USER = 'text-message-sent-to-user', // Gửi tin nhắn text cho user cá nhân\n TEXT_MESSAGE_SENT_TO_GROUP = 'text-message-sent-to-group', // Gửi tin nhắn text vào nhóm\n TEXT_MESSAGE_RECEIVED_FROM_USER = 'text-message-received-from-user', // Nhận tin nhắn text từ user cá nhân\n TEXT_MESSAGE_RECEIVED_FROM_GROUP = 'text-message-received-from-group', // Nhận tin nhắn text từ nhóm\n\n // ==================== TIN NHẮN HÌNH ẢNH (4 events) ====================\n IMAGE_MESSAGE_SENT_TO_USER = 'image-message-sent-to-user', // Gửi hình ảnh cho user cá nhân\n IMAGE_MESSAGE_SENT_TO_GROUP = 'image-message-sent-to-group', // Gửi hình ảnh vào nhóm\n IMAGE_MESSAGE_RECEIVED_FROM_USER = 'image-message-received-from-user', // Nhận hình ảnh từ user cá nhân\n IMAGE_MESSAGE_RECEIVED_FROM_GROUP = 'image-message-received-from-group', // Nhận hình ảnh từ nhóm\n\n // ==================== TIN NHẮN VIDEO (4 events) ====================\n VIDEO_MESSAGE_SENT_TO_USER = 'video-message-sent-to-user', // Gửi video cho user cá nhân\n VIDEO_MESSAGE_SENT_TO_GROUP = 'video-message-sent-to-group', // Gửi video vào nhóm\n VIDEO_MESSAGE_RECEIVED_FROM_USER = 'video-message-received-from-user', // Nhận video từ user cá nhân\n VIDEO_MESSAGE_RECEIVED_FROM_GROUP = 'video-message-received-from-group', // Nhận video từ nhóm\n\n // ==================== TIN NHẮN VOICE/AUDIO (4 events) ====================\n VOICE_MESSAGE_SENT_TO_USER = 'voice-message-sent-to-user', // Gửi voice/audio cho user cá nhân\n VOICE_MESSAGE_SENT_TO_GROUP = 'voice-message-sent-to-group', // Gửi voice/audio vào nhóm\n VOICE_MESSAGE_RECEIVED_FROM_USER = 'voice-message-received-from-user', // Nhận voice/audio từ user cá nhân\n VOICE_MESSAGE_RECEIVED_FROM_GROUP = 'voice-message-received-from-group', // Nhận voice/audio từ nhóm\n\n // ==================== TIN NHẮN FILE (4 events) ====================\n FILE_MESSAGE_SENT_TO_USER = 'file-message-sent-to-user', // Gửi file cho user cá nhân\n FILE_MESSAGE_SENT_TO_GROUP = 'file-message-sent-to-group', // Gửi file vào nhóm\n FILE_MESSAGE_RECEIVED_FROM_USER = 'file-message-received-from-user', // Nhận file từ user cá nhân\n FILE_MESSAGE_RECEIVED_FROM_GROUP = 'file-message-received-from-group', // Nhận file từ nhóm\n\n // ==================== TIN NHẮN STICKER (4 events) ====================\n STICKER_MESSAGE_SENT_TO_USER = 'sticker-message-sent-to-user', // Gửi sticker cho user cá nhân\n STICKER_MESSAGE_SENT_TO_GROUP = 'sticker-message-sent-to-group', // Gửi sticker vào nhóm\n STICKER_MESSAGE_RECEIVED_FROM_USER = 'sticker-message-received-from-user', // Nhận sticker từ user cá nhân\n STICKER_MESSAGE_RECEIVED_FROM_GROUP = 'sticker-message-received-from-group', // Nhận sticker từ nhóm\n\n // ==================== TIN NHẮN VỊ TRÍ (4 events) ====================\n LOCATION_MESSAGE_SENT_TO_USER = 'location-message-sent-to-user', // Gửi vị trí cho user cá nhân\n LOCATION_MESSAGE_SENT_TO_GROUP = 'location-message-sent-to-group', // Gửi vị trí vào nhóm\n LOCATION_MESSAGE_RECEIVED_FROM_USER = 'location-message-received-from-user', // Nhận vị trí từ user cá nhân\n LOCATION_MESSAGE_RECEIVED_FROM_GROUP = 'location-message-received-from-group', // Nhận vị trí từ nhóm\n\n // ==================== TIN NHẮN GIF (4 events) ====================\n GIF_MESSAGE_SENT_TO_USER = 'gif-message-sent-to-user', // Gửi GIF cho user cá nhân\n GIF_MESSAGE_SENT_TO_GROUP = 'gif-message-sent-to-group', // Gửi GIF vào nhóm\n GIF_MESSAGE_RECEIVED_FROM_USER = 'gif-message-received-from-user', // Nhận GIF từ user cá nhân\n GIF_MESSAGE_RECEIVED_FROM_GROUP = 'gif-message-received-from-group', // Nhận GIF từ nhóm\n\n // ==================== TIN NHẮN LINK (4 events) ====================\n LINK_MESSAGE_SENT_TO_USER = 'link-message-sent-to-user', // Gửi link cho user cá nhân\n LINK_MESSAGE_SENT_TO_GROUP = 'link-message-sent-to-group', // Gửi link vào nhóm\n LINK_MESSAGE_RECEIVED_FROM_USER = 'link-message-received-from-user', // Nhận link từ user cá nhân\n LINK_MESSAGE_RECEIVED_FROM_GROUP = 'link-message-received-from-group', // Nhận link từ nhóm\n\n // ==================== TIN NHẮN VẼ DOODLE (4 events) ====================\n DOODLE_MESSAGE_SENT_TO_USER = 'doodle-message-sent-to-user', // Gửi doodle/vẽ cho user cá nhân\n DOODLE_MESSAGE_SENT_TO_GROUP = 'doodle-message-sent-to-group', // Gửi doodle/vẽ vào nhóm\n DOODLE_MESSAGE_RECEIVED_FROM_USER = 'doodle-message-received-from-user', // Nhận doodle/vẽ từ user cá nhân\n DOODLE_MESSAGE_RECEIVED_FROM_GROUP = 'doodle-message-received-from-group', // Nhận doodle/vẽ từ nhóm\n\n // Message events - RECOMMENDED (4 events)\n RECOMMENDED_MESSAGE_SENT_TO_USER = 'recommended-message-sent-to-user',\n RECOMMENDED_MESSAGE_SENT_TO_GROUP = 'recommended-message-sent-to-group',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_USER = 'recommended-message-received-from-user',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP = 'recommended-message-received-from-group',\n\n // ==================== TIN NHẮN CŨ (1 event) ====================\n OLD_MESSAGES = 'old-messages', // Lấy tin nhắn cũ từ lịch sử\n\n // ==================== TRẠNG THÁI TYPING - ĐANG SOẠN TIN (4 events) ====================\n TYPING_BY_SELF_IN_USER = 'typing-by-self-in-user', // Mình đang soạn tin trong chat cá nhân\n TYPING_BY_SELF_IN_GROUP = 'typing-by-self-in-group', // Mình đang soạn tin trong nhóm\n TYPING_BY_OTHER_IN_USER = 'typing-by-other-in-user', // Người khác đang soạn tin trong chat cá nhân\n TYPING_BY_OTHER_IN_GROUP = 'typing-by-other-in-group', // Người khác đang soạn tin trong nhóm\n\n // ==================== TRẠNG THÁI Đà XEM TIN NHẮN (4 events) ====================\n SEEN_MESSAGES_BY_SELF_IN_USER = 'seen-messages-by-self-in-user', // Mình đã xem tin nhắn trong chat cá nhân\n SEEN_MESSAGES_BY_SELF_IN_GROUP = 'seen-messages-by-self-in-group', // Mình đã xem tin nhắn trong nhóm\n SEEN_MESSAGES_BY_OTHER_IN_USER = 'seen-messages-by-other-in-user', // Người khác đã xem tin nhắn trong chat cá nhân\n SEEN_MESSAGES_BY_OTHER_IN_GROUP = 'seen-messages-by-other-in-group', // Người khác đã xem tin nhắn trong nhóm\n\n // ==================== TRẠNG THÁI Đà NHẬN TIN NHẮN (4 events) ====================\n DELIVERED_MESSAGES_BY_SELF_IN_USER = 'delivered-messages-by-self-in-user', // Tin nhắn của mình đã được gửi đến user cá nhân\n DELIVERED_MESSAGES_BY_SELF_IN_GROUP = 'delivered-messages-by-self-in-group', // Tin nhắn của mình đã được gửi đến nhóm\n DELIVERED_MESSAGES_BY_OTHER_IN_USER = 'delivered-messages-by-other-in-user', // Tin nhắn của người khác đã được gửi đến mình (chat cá nhân)\n DELIVERED_MESSAGES_BY_OTHER_IN_GROUP = 'delivered-messages-by-other-in-group', // Tin nhắn của người khác đã được gửi đến nhóm\n\n // ==================== REACTION - BIỂU CẢM TIN NHẮN (4 events) ====================\n REACTION_BY_SELF_IN_USER = 'reaction-by-self-in-user', // Mình react tin nhắn trong chat cá nhân\n REACTION_BY_SELF_IN_GROUP = 'reaction-by-self-in-group', // Mình react tin nhắn trong nhóm\n REACTION_BY_OTHER_IN_USER = 'reaction-by-other-in-user', // Người khác react tin nhắn trong chat cá nhân\n REACTION_BY_OTHER_IN_GROUP = 'reaction-by-other-in-group', // Người khác react tin nhắn trong nhóm\n\n // ==================== REACTION CŨ - BIỂU CẢM TIN NHẮN CŨ (4 events) ====================\n OLD_REACTIONS_BY_SELF_IN_USER = 'old-reactions-by-self-in-user', // Lấy reaction cũ của mình trong chat cá nhân\n OLD_REACTIONS_BY_SELF_IN_GROUP = 'old-reactions-by-self-in-group', // Lấy reaction cũ của mình trong nhóm\n OLD_REACTIONS_BY_OTHER_IN_USER = 'old-reactions-by-other-in-user', // Lấy reaction cũ của người khác trong chat cá nhân\n OLD_REACTIONS_BY_OTHER_IN_GROUP = 'old-reactions-by-other-in-group', // Lấy reaction cũ của người khác trong nhóm\n\n // ==================== SỰ KIỆN BẠN BÈ (13 events) ====================\n FRIEND_EVENT_ADD = 'friend-event-add', // Thêm bạn bè\n FRIEND_EVENT_REMOVE = 'friend-event-remove', // Xóa bạn bè\n FRIEND_EVENT_REQUEST = 'friend-event-request', // Gửi lời mời kết bạn\n FRIEND_EVENT_UNDO_REQUEST = 'friend-event-undo-request', // Hủy lời mời kết bạn\n FRIEND_EVENT_REJECT_REQUEST = 'friend-event-reject-request', // Từ chối lời mời kết bạn\n FRIEND_EVENT_SEEN_REQUEST = 'friend-event-seen-request', // Đã xem lời mời kết bạn\n FRIEND_EVENT_BLOCK = 'friend-event-block', // Chặn bạn bè\n FRIEND_EVENT_UNBLOCK = 'friend-event-unblock', // Bỏ chặn bạn bè\n FRIEND_EVENT_BLOCK_CALL = 'friend-event-block-call', // Chặn cuộc gọi từ bạn bè\n FRIEND_EVENT_UNBLOCK_CALL = 'friend-event-unblock-call', // Bỏ chặn cuộc gọi từ bạn bè\n FRIEND_EVENT_PIN_UNPIN = 'friend-event-pin-unpin', // Ghim/bỏ ghim bạn bè\n FRIEND_EVENT_PIN_CREATE = 'friend-event-pin-create', // Tạo ghim bạn bè\n FRIEND_EVENT_UNKNOWN = 'friend-event-unknown', // Sự kiện bạn bè không xác định\n\n // ==================== SỰ KIỆN NHÓM (23 events) ====================\n GROUP_EVENT_JOIN_REQUEST = 'group-event-join-request', // Yêu cầu tham gia nhóm\n GROUP_EVENT_JOIN = 'group-event-join', // Tham gia nhóm\n GROUP_EVENT_LEAVE = 'group-event-leave', // Rời khỏi nhóm\n GROUP_EVENT_REMOVE_MEMBER = 'group-event-remove-member', // Xóa thành viên khỏi nhóm\n GROUP_EVENT_BLOCK_MEMBER = 'group-event-block-member', // Chặn thành viên trong nhóm\n GROUP_EVENT_UPDATE_SETTING = 'group-event-update-setting', // Cập nhật cài đặt nhóm\n GROUP_EVENT_UPDATE = 'group-event-update', // Cập nhật thông tin nhóm\n GROUP_EVENT_NEW_LINK = 'group-event-new-link', // Tạo link mời nhóm mới\n GROUP_EVENT_ADD_ADMIN = 'group-event-add-admin', // Thêm admin nhóm\n GROUP_EVENT_REMOVE_ADMIN = 'group-event-remove-admin', // Xóa admin nhóm\n GROUP_EVENT_NEW_PIN_TOPIC = 'group-event-new-pin-topic', // Tạo chủ đề ghim mới\n GROUP_EVENT_UPDATE_PIN_TOPIC = 'group-event-update-pin-topic', // Cập nhật chủ đề ghim\n GROUP_EVENT_REORDER_PIN_TOPIC = 'group-event-reorder-pin-topic', // Sắp xếp lại chủ đề ghim\n GROUP_EVENT_UPDATE_BOARD = 'group-event-update-board', // Cập nhật bảng nhóm\n GROUP_EVENT_REMOVE_BOARD = 'group-event-remove-board', // Xóa bảng nhóm\n GROUP_EVENT_UPDATE_TOPIC = 'group-event-update-topic', // Cập nhật chủ đề\n GROUP_EVENT_UNPIN_TOPIC = 'group-event-unpin-topic', // Bỏ ghim chủ đề\n GROUP_EVENT_REMOVE_TOPIC = 'group-event-remove-topic', // Xóa chủ đề\n GROUP_EVENT_ACCEPT_REMIND = 'group-event-accept-remind', // Chấp nhận nhắc nhở\n GROUP_EVENT_REJECT_REMIND = 'group-event-reject-remind', // Từ chối nhắc nhở\n GROUP_EVENT_REMIND_TOPIC = 'group-event-remind-topic', // Nhắc nhở về chủ đề\n GROUP_EVENT_UPDATE_AVATAR = 'group-event-update-avatar', // Cập nhật avatar nhóm\n GROUP_EVENT_UNKNOWN = 'group-event-unknown', // Sự kiện nhóm không xác định\n\n // ==================== THU HỒI TIN NHẮN (4 events) ====================\n UNDO_BY_SELF_IN_USER = 'undo-by-self-in-user', // Mình thu hồi tin nhắn trong chat cá nhân\n UNDO_BY_SELF_IN_GROUP = 'undo-by-self-in-group', // Mình thu hồi tin nhắn trong nhóm\n UNDO_BY_OTHER_IN_USER = 'undo-by-other-in-user', // Người khác thu hồi tin nhắn trong chat cá nhân\n UNDO_BY_OTHER_IN_GROUP = 'undo-by-other-in-group', // Người khác thu hồi tin nhắn trong nhóm\n\n // ==================== TRẠNG THÁI KẾT NỐI (4 events) ====================\n CONNECTION_STATUS_CONNECTED = 'connection-status-connected', // Đã kết nối thành công\n CONNECTION_STATUS_DISCONNECTED = 'connection-status-disconnected', // Mất kết nối\n CONNECTION_STATUS_RECONNECTING = 'connection-status-reconnecting', // Đang kết nối lại\n CONNECTION_STATUS_LOGGED_OUT = 'connection-status-logged-out', // Đã đăng xuất\n\n // ==================== UPLOAD FILE ĐÍNH KÈM (3 events) ====================\n UPLOAD_ATTACHMENT_IN_PROGRESS = 'upload-attachment-in-progress', // Đang upload file\n UPLOAD_ATTACHMENT_COMPLETED = 'upload-attachment-completed', // Upload file thành công\n UPLOAD_ATTACHMENT_FAILED = 'upload-attachment-failed', // Upload file thất bại\n\n // ==================== Mà HÓA CIPHER KEY (4 events) ====================\n CIPHER_KEY_UPDATED_IN_USER = 'cipher-key-updated-in-user', // Cập nhật cipher key trong chat cá nhân\n CIPHER_KEY_UPDATED_IN_GROUP = 'cipher-key-updated-in-group', // Cập nhật cipher key trong nhóm\n CIPHER_KEY_EXPIRED_IN_USER = 'cipher-key-expired-in-user', // Cipher key hết hạn trong chat cá nhân\n CIPHER_KEY_EXPIRED_IN_GROUP = 'cipher-key-expired-in-group', // Cipher key hết hạn trong nhóm\n\n // ==================== LỖI HỆ THỐNG (6 events) ====================\n ERROR_SYSTEM = 'error-system', // Lỗi hệ thống\n ERROR_NETWORK = 'error-network', // Lỗi mạng\n ERROR_AUTHENTICATION = 'error-authentication', // Lỗi xác thực\n ERROR_VALIDATION = 'error-validation', // Lỗi validation dữ liệu\n ERROR_BUSINESS_LOGIC = 'error-business-logic', // Lỗi logic nghiệp vụ\n ERROR_UNKNOWN = 'error-unknown', // Lỗi không xác định\n}\n\n/**\n * Base webhook event interface\n */\nexport interface BaseZaloWebhookEvent {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n timestamp: number;\n eventType: ZaloWebhookEventType;\n metadata?: Record<string, any>;\n}\n\n// ==================== MESSAGE TYPES ====================\n\n/**\n * Attachment content interface\n */\nexport interface ZaloAttachmentContent {\n title: string;\n description: string;\n href: string;\n thumb: string;\n childnumber: number;\n action: string;\n params: string;\n type: string;\n}\n\n/**\n * Message mention interface\n */\nexport interface ZaloMessageMention {\n uid: string;\n name: string;\n startIndex: number;\n length: number;\n}\n\n/**\n * Message quote interface\n */\nexport interface ZaloMessageQuote {\n ownerId: number;\n cliMsgId: number;\n globalMsgId: number;\n cliMsgType: number;\n ts: number;\n msg: string;\n attach: string;\n fromD: string;\n ttl: number;\n}\n\n/**\n * Complete message data từ SDK - FULL FIELDS\n */\nexport interface ZaloMessageData {\n // Core message fields\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: string | ZaloAttachmentContent | Record<string, any>;\n\n // Metadata fields\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n realMsgId: string;\n\n // Timeout fields - THIẾU trong automation-web\n topOut: string;\n topOutTimeOut: string;\n topOutImprTimeOut: string;\n\n // Property extension\n propertyExt?: {\n color: number;\n size: number;\n type: number;\n subType: number;\n ext: string;\n };\n\n // Parameters extension\n paramsExt: {\n countUnread: number;\n containType: number;\n platformType: number;\n };\n\n // Command info\n cmd: number;\n st: number;\n at: number;\n\n // Group-specific fields\n mentions?: ZaloMessageMention[];\n quote?: ZaloMessageQuote;\n}\n\n// ==================== MESSAGE TYPE ENUMS ====================\n\n/**\n * Message Type enum từ SDK - đồng nhất với automation-web\n */\nexport enum ZaloMessageType {\n TEXT = 'webchat',\n VOICE = 'chat.voice',\n PHOTO = 'chat.photo',\n STICKER = 'chat.sticker',\n DOODLE = 'chat.doodle',\n RECOMMENDED = 'chat.recommended',\n LINK = 'chat.link',\n VIDEO = 'chat.video.msg',\n FILE = 'share.file',\n GIF = 'chat.gif',\n LOCATION = 'chat.location.new',\n}\n\n/**\n * Message Category enum\n */\nexport enum ZaloMessageCategory {\n TEXT = 'text',\n MEDIA = 'media',\n FILE = 'file',\n SOCIAL = 'social',\n OTHER = 'other',\n}\n\n// ==================== SPECIFIC MESSAGE EVENT DATA TYPES ====================\n\n/**\n * Base message event data - chứa tất cả fields từ SDK\n */\nexport interface BaseMessageEventData extends ZaloMessageData {\n threadId: string;\n threadType: ZaloThreadType;\n isSelf: boolean;\n messageType: ZaloMessageType;\n messageCategory: ZaloMessageCategory;\n hasAttachment: boolean;\n}\n\n/**\n * TEXT message data - chỉ chứa text content\n */\nexport interface ZaloTextMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.TEXT;\n messageCategory: ZaloMessageCategory.TEXT;\n hasAttachment: false;\n content: string; // Plain text content\n}\n\n/**\n * IMAGE message data - chứa thông tin hình ảnh\n */\nexport interface ZaloImageMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.PHOTO;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'image';\n width?: number;\n height?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * VIDEO message data - chứa thông tin video\n */\nexport interface ZaloVideoMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.VIDEO;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'video';\n duration?: number;\n width?: number;\n height?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * VOICE message data - chứa thông tin voice/audio\n */\nexport interface ZaloVoiceMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.VOICE;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'voice' | 'audio';\n duration?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * FILE message data - chứa thông tin file\n */\nexport interface ZaloFileMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.FILE;\n messageCategory: ZaloMessageCategory.FILE;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'file';\n fileName?: string;\n fileSize?: number;\n mimeType?: string;\n extension?: string;\n };\n}\n\n/**\n * STICKER message data - chứa thông tin sticker\n */\nexport interface ZaloStickerMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.STICKER;\n messageCategory: ZaloMessageCategory.SOCIAL;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'sticker';\n stickerId?: string;\n stickerPackId?: string;\n width?: number;\n height?: number;\n };\n}\n\n// ==================== NON-MESSAGE EVENT DATA TYPES ====================\n\n/**\n * TYPING event data - chứa thông tin typing status\n */\nexport interface ZaloTypingEventData {\n uid: string; // User ID đang typing\n ts: string; // Timestamp\n isPC: number; // 0 = mobile, 1 = PC\n gid?: string; // Group ID (chỉ có trong group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người gửi\n fromName: string; // Tên người gửi\n isTyping: boolean; // Trạng thái typing\n}\n\n/**\n * REACTION event data - chứa thông tin reaction\n */\nexport interface ZaloReactionEventData {\n msgId: string; // ID tin nhắn được react\n uidFrom: string; // User ID người react\n dName: string; // Display name người react\n ts: string; // Timestamp\n content: {\n rIcon: ZaloReactionType; // Loại reaction\n rType: number; // Reaction type number\n };\n realMsgId: string; // Real message ID\n groupId?: string; // Group ID (nếu là group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người react\n fromName: string; // Tên người react\n reaction: string; // Reaction string\n timestamp: number; // Timestamp number\n}\n\n/**\n * Reaction types enum từ SDK\n */\nexport enum ZaloReactionType {\n LIKE = '/-heart',\n LOVE = '/-heart',\n HAHA = ':))',\n WOW = ':-o',\n SAD = ':(',\n ANGRY = ':-@',\n NONE = '',\n}\n\n/**\n * UNDO event data - chứa thông tin thu hồi tin nhắn\n */\nexport interface ZaloUndoEventData {\n msgId: string; // ID tin nhắn bị thu hồi\n cliMsgId: string; // Client message ID\n uidFrom: string; // User ID người thu hồi\n idTo: string; // ID người nhận\n dName: string; // Display name người thu hồi\n ts: string; // Timestamp\n realMsgId: string; // Real message ID\n groupId?: string; // Group ID (nếu là group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người thu hồi\n fromName: string; // Tên người thu hồi\n undoMsgId: string; // ID tin nhắn bị thu hồi\n timestamp: number; // Timestamp number\n}\n\n/**\n * CONNECTION STATUS event data - chứa thông tin trạng thái kết nối\n */\nexport interface ZaloConnectionStatusEventData {\n status: ZaloConnectionStatus; // Trạng thái kết nối\n reason?: string; // Lý do (nếu có)\n timestamp: number; // Timestamp\n sessionInfo?: {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n userId?: string;\n };\n}\n\n/**\n * Connection Status enum\n */\nexport enum ZaloConnectionStatus {\n CONNECTED = 'connected',\n DISCONNECTED = 'disconnected',\n RECONNECTING = 'reconnecting',\n LOGGED_OUT = 'logged_out',\n}\n\n// ==================== SIMPLIFIED TYPES FOR SDK ====================\n\n/**\n * Simplified webhook event for SDK usage\n * Updated to match automation-web WebhookJobData interface\n */\nexport interface WebhookEvent extends BaseZaloWebhookEvent {\n eventData:\n | ZaloMessageData\n | ZaloTypingEventData\n | ZaloReactionEventData\n | ZaloUndoEventData\n | any;\n}\n\n/**\n * Webhook event handler function type\n */\nexport type WebhookEventHandler<T extends WebhookEvent = WebhookEvent> = (\n event: T\n) => void | Promise<void>;\n\n// Legacy compatibility exports\nexport const WebhookEventType = ZaloWebhookEventType;\nexport type MessageEventData = ZaloMessageData;\nexport type BaseWebhookEvent = BaseZaloWebhookEvent;\nexport type TypingEventData = ZaloTypingEventData;\nexport type ReactionEventData = ZaloReactionEventData;\n","/**\n * Authentication service for managing Zalo sessions\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n QRLoginRequest,\n QRLoginResponse,\n CredentialsLoginRequest,\n CredentialsLoginResponse,\n SessionDeleteResponse,\n BulkDeleteSessionsRequest,\n BulkDeleteSessionsResponse,\n LoginStatusResponse,\n SessionListResponse,\n SessionDebugInfo,\n} from '../../types/auth.types';\n\n/**\n * Authentication service class\n */\nexport class AuthService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Generate QR Code for Zalo login\n */\n async generateQRCode(request: QRLoginRequest): Promise<AutomationWebResponse<QRLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<QRLoginResponse>>(\n '/auth/zalo/qr-code',\n {\n createdBy: request.createdBy !== undefined ? Number(request.createdBy) : (request.userUuid ? Number(request.userUuid) || request.userUuid : undefined),\n workspaceId: request.workspaceId,\n baseId: request.baseId,\n sessionId: request.sessionId,\n options: request.options,\n }\n );\n\n return response;\n }\n\n /**\n * Get login status for a session\n */\n async getLoginStatus(\n sessionId: string,\n timeout?: number\n ): Promise<AutomationWebResponse<LoginStatusResponse>> {\n const queryParams = timeout ? { timeout } : {};\n const response = await this.httpClient.get<AutomationWebResponse<LoginStatusResponse>>(\n `/auth/zalo/status/${sessionId}`,\n queryParams\n );\n\n return response;\n }\n\n /**\n * Login with credentials\n */\n async loginWithCredentials(\n request: CredentialsLoginRequest\n ): Promise<AutomationWebResponse<CredentialsLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CredentialsLoginResponse>>(\n '/auth/zalo/login-with-credentials',\n {\n createdBy: request.createdBy !== undefined ? Number(request.createdBy) : (request.userUuid ? Number(request.userUuid) || request.userUuid : undefined),\n credentials: {\n cookie: request.credentials.cookie,\n imei: request.credentials.imei,\n userAgent: request.credentials.userAgent,\n language: request.credentials.language || 'vi',\n },\n options: request.options,\n }\n );\n\n return response;\n }\n\n /**\n * Get list of sessions for a user\n */\n async getSessionsByUser(createdBy: number | string): Promise<AutomationWebResponse<SessionListResponse>> {\n const response = await this.httpClient.get<AutomationWebResponse<SessionListResponse>>(\n `/auth/zalo/sessions/${createdBy}`\n );\n\n return response;\n }\n\n /**\n * Delete a specific session\n */\n async deleteSession(sessionId: string): Promise<AutomationWebResponse<SessionDeleteResponse>> {\n const response = await this.httpClient.delete<AutomationWebResponse<SessionDeleteResponse>>(\n `/auth/zalo/session/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Delete multiple sessions\n */\n async bulkDeleteSessions(\n request: BulkDeleteSessionsRequest\n ): Promise<AutomationWebResponse<BulkDeleteSessionsResponse>> {\n const response = await this.httpClient.request<\n AutomationWebResponse<BulkDeleteSessionsResponse>\n >({\n method: 'DELETE',\n url: '/auth/zalo/sessions/bulk',\n data: {\n sessionIds: request.sessionIds || [],\n },\n });\n\n return response;\n }\n\n /**\n * Get debug information for a session\n */\n async debugSession(sessionId: string): Promise<AutomationWebResponse<SessionDebugInfo>> {\n const response = await this.httpClient.get<AutomationWebResponse<SessionDebugInfo>>(\n `/auth/zalo/debug/session/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Relogin with existing session - Chuẩn theo automation-web controller\n */\n async reloginWithSession(sessionId: string): Promise<AutomationWebResponse<QRLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<QRLoginResponse>>(\n `/auth/zalo/relogin/${sessionId}`,\n {}\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Messaging Service\n * 100% khớp với automation-web/src/module/zalo-messaging\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n SendMessageRequest,\n SendStickerRequest,\n SendVoiceRequest,\n SendVideoRequest,\n SendFileRequest,\n SendLinkRequest,\n SendCardRequest,\n ForwardMessageRequest,\n DeleteMessageRequest,\n UndoMessageRequest,\n AddReactionRequest,\n SendMessageResponse,\n SendStickerResponse,\n SendVoiceResponse,\n SendVideoResponse,\n SendLinkResponse,\n SendCardResponse,\n ForwardMessageResponse,\n DeleteMessageResponse,\n UndoResponse,\n AddReactionResponse,\n AddQuickMessageRequest,\n AddQuickMessageResponse,\n GetQuickMessageListRequest,\n GetQuickMessageListResponse,\n UpdateQuickMessageRequest,\n CreateAutoReplyRequest,\n CreateAutoReplyResponse,\n GetAutoReplyListRequest,\n GetAutoReplyListResponse,\n DeleteAutoReplyRequest,\n StandardResponse,\n DeleteChatRequest,\n GetLabelsRequest,\n GetLabelsResponse,\n UpdateLabelsRequest,\n UpdateLabelsResponse,\n UpdateConversationLabelRequest,\n UpdateConversationLabelResponse,\n GetMuteRequest,\n GetMuteResponse,\n MessagingParseLinkRequest,\n MessagingParseLinkResponse,\n AddUnreadMarkRequest,\n AddUnreadMarkResponse,\n GetSearchStickerRequest,\n GetSearchStickerResponse,\n GetStickerCategoryDetailRequest,\n GetStickerCategoryDetailResponse,\n GetStickersRequest,\n GetStickersResponse,\n GetStickersDetailRequest,\n GetStickersDetailResponse,\n GetArchivedChatListRequest,\n GetArchivedChatListResponse,\n GetAutoDeleteChatRequest,\n GetAutoDeleteChatResponse,\n GetHiddenConversationsRequest,\n GetHiddenConversationsResponse,\n GetPinConversationsRequest,\n GetPinConversationsResponse,\n RemoveQuickMessageRequest,\n RemoveQuickMessageResponse,\n} from '../../types/dto/messaging.type';\n\n/**\n * Zalo Personal Messaging Service Class\n * 100% khớp với automation-web ZaloMessagingController\n */\nexport class MessagingService {\n constructor(private httpClient: HttpClient) { }\n\n /**\n * Gửi tin nhắn qua Zalo Personal\n * POST /zalo-personal/messaging/send\n */\n async sendMessage(\n request: SendMessageRequest\n ): Promise<AutomationWebResponse<SendMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendMessageResponse>>(\n '/zalo-personal/messaging/send',\n {\n msg: request.msg,\n threadId: request.threadId,\n type: request.type,\n sessionId: request.sessionId,\n styles: request.styles,\n mentions: request.mentions,\n quote: request.quote,\n attachments: request.attachments,\n urgency: request.urgency,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sticker\n * POST /zalo-personal/messaging/sticker\n */\n async sendSticker(\n request: SendStickerRequest\n ): Promise<AutomationWebResponse<SendStickerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendStickerResponse>>(\n '/zalo-personal/messaging/sticker',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n stickerId: request.stickerId,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi voice message\n * POST /zalo-personal/messaging/voice\n */\n async sendVoice(request: SendVoiceRequest): Promise<AutomationWebResponse<SendVoiceResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendVoiceResponse>>(\n '/zalo-personal/messaging/voice',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n fileUrl: request.fileUrl,\n duration: request.duration,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi video message\n * POST /zalo-personal/messaging/video\n */\n async sendVideo(request: SendVideoRequest): Promise<AutomationWebResponse<SendVideoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendVideoResponse>>(\n '/zalo-personal/messaging/video',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n videoUrl: request.videoUrl,\n duration: request.duration,\n width: request.width,\n height: request.height,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi link message\n * POST /zalo-personal/messaging/link\n */\n async sendFile(request: SendFileRequest): Promise<AutomationWebResponse<SendMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendMessageResponse>>(\n '/zalo-personal/messaging/file',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n fileUrl: request.fileUrl,\n fileName: request.fileName,\n msg: request.msg,\n headers: request.headers,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n async sendLink(request: SendLinkRequest): Promise<AutomationWebResponse<SendLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendLinkResponse>>(\n '/zalo-personal/messaging/link',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n link: request.link,\n msg: request.msg,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi contact card\n * POST /zalo-personal/messaging/card\n */\n async sendCard(request: SendCardRequest): Promise<AutomationWebResponse<SendCardResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendCardResponse>>(\n '/zalo-personal/messaging/card',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n userId: request.userId,\n phoneNumber: request.phoneNumber,\n }\n );\n\n return response;\n }\n\n /**\n * Chuyển tiếp tin nhắn\n * POST /zalo-personal/messaging/forward\n */\n async forwardMessage(\n request: ForwardMessageRequest\n ): Promise<AutomationWebResponse<ForwardMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ForwardMessageResponse>>(\n '/zalo-personal/messaging/forward',\n {\n sessionId: request.sessionId,\n message: request.message,\n threadIds: request.threadIds,\n type: request.type,\n reference: request.reference,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa tin nhắn\n * DELETE /zalo-personal/messaging/delete\n */\n async deleteMessage(\n request: DeleteMessageRequest\n ): Promise<AutomationWebResponse<DeleteMessageResponse>> {\n const response = await this.httpClient.deleteWithBody<AutomationWebResponse<DeleteMessageResponse>>(\n '/zalo-personal/messaging/delete',\n {\n sessionId: request.sessionId,\n messageId: request.messageId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Thu hồi tin nhắn (undo)\n * POST /zalo-personal/messaging/undo\n */\n async undoMessage(request: UndoMessageRequest): Promise<AutomationWebResponse<UndoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UndoResponse>>(\n '/zalo-personal/messaging/undo',\n {\n sessionId: request.sessionId,\n msgId: request.msgId,\n cliMsgId: request.cliMsgId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Thêm reaction vào tin nhắn\n * POST /zalo-personal/messaging/reaction\n */\n async addReaction(\n request: AddReactionRequest\n ): Promise<AutomationWebResponse<AddReactionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddReactionResponse>>(\n '/zalo-personal/messaging/reaction',\n {\n sessionId: request.sessionId,\n reaction: request.reaction,\n msgId: request.msgId,\n cliMsgId: request.cliMsgId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n async addQuickMessage(\n request: AddQuickMessageRequest\n ): Promise<AutomationWebResponse<AddQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/add',\n request\n );\n\n return response;\n }\n\n async getQuickMessageList(\n request: GetQuickMessageListRequest\n ): Promise<AutomationWebResponse<GetQuickMessageListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetQuickMessageListResponse>>(\n '/zalo-personal/messaging/quick-message/list',\n request\n );\n\n return response;\n }\n\n async updateQuickMessage(\n request: UpdateQuickMessageRequest\n ): Promise<AutomationWebResponse<AddQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/update',\n request\n );\n\n return response;\n }\n\n async createAutoReply(\n request: CreateAutoReplyRequest\n ): Promise<AutomationWebResponse<CreateAutoReplyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CreateAutoReplyResponse>>(\n '/zalo-personal/messaging/auto-reply/create',\n request\n );\n\n return response;\n }\n\n async getAutoReplyList(\n request: GetAutoReplyListRequest\n ): Promise<AutomationWebResponse<GetAutoReplyListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAutoReplyListResponse>>(\n '/zalo-personal/messaging/auto-reply/list',\n request\n );\n\n return response;\n }\n\n async deleteAutoReply(\n request: DeleteAutoReplyRequest\n ): Promise<AutomationWebResponse<StandardResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<StandardResponse>>(\n '/zalo-personal/messaging/auto-reply/delete',\n request\n );\n\n return response;\n }\n\n async deleteChat(request: DeleteChatRequest): Promise<AutomationWebResponse<any>> {\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/messaging/chat/delete-convers',\n request\n );\n\n return response;\n }\n\n async getLabels(request: GetLabelsRequest): Promise<AutomationWebResponse<GetLabelsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetLabelsResponse>>(\n '/zalo-personal/messaging/labels/list',\n request\n );\n\n return response;\n }\n\n async updateLabels(\n request: UpdateLabelsRequest\n ): Promise<AutomationWebResponse<UpdateLabelsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UpdateLabelsResponse>>(\n '/zalo-personal/messaging/labels/update',\n request\n );\n\n return response;\n }\n\n async assignConversationLabel(\n request: UpdateConversationLabelRequest\n ): Promise<AutomationWebResponse<UpdateConversationLabelResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<UpdateConversationLabelResponse>\n >('/zalo-personal/messaging/labels/assign-conversation', request);\n\n return response;\n }\n\n async unassignConversationLabel(\n request: UpdateConversationLabelRequest\n ): Promise<AutomationWebResponse<UpdateConversationLabelResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<UpdateConversationLabelResponse>\n >('/zalo-personal/messaging/labels/unassign-conversation', request);\n\n return response;\n }\n\n async getMute(request: GetMuteRequest): Promise<AutomationWebResponse<GetMuteResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetMuteResponse>>(\n '/zalo-personal/messaging/mute/get',\n request\n );\n\n return response;\n }\n\n async parseLink(\n request: MessagingParseLinkRequest\n ): Promise<AutomationWebResponse<MessagingParseLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<MessagingParseLinkResponse>>(\n '/zalo-personal/messaging/link/parse',\n request\n );\n\n return response;\n }\n\n async addUnreadMark(\n request: AddUnreadMarkRequest\n ): Promise<AutomationWebResponse<AddUnreadMarkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddUnreadMarkResponse>>(\n '/zalo-personal/messaging/unread/add',\n request\n );\n\n return response;\n }\n\n async getSearchSticker(\n request: GetSearchStickerRequest\n ): Promise<AutomationWebResponse<GetSearchStickerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetSearchStickerResponse>>(\n '/zalo-personal/messaging/sticker/search',\n request\n );\n\n return response;\n }\n\n async getStickerCategoryDetail(\n request: GetStickerCategoryDetailRequest\n ): Promise<AutomationWebResponse<GetStickerCategoryDetailResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<GetStickerCategoryDetailResponse>\n >('/zalo-personal/messaging/sticker/category-detail', request);\n\n return response;\n }\n\n async getStickers(\n request: GetStickersRequest\n ): Promise<AutomationWebResponse<GetStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersResponse>>(\n '/zalo-personal/messaging/sticker/list',\n request\n );\n\n return response;\n }\n\n async getStickersDetail(\n request: GetStickersDetailRequest\n ): Promise<AutomationWebResponse<GetStickersDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersDetailResponse>>(\n '/zalo-personal/messaging/sticker/detail',\n request\n );\n\n return response;\n }\n\n async getArchivedChatList(\n request: GetArchivedChatListRequest\n ): Promise<AutomationWebResponse<GetArchivedChatListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetArchivedChatListResponse>>(\n '/zalo-personal/messaging/chat/list-archived',\n request\n );\n\n return response;\n }\n\n async getAutoDeleteChat(\n request: GetAutoDeleteChatRequest\n ): Promise<AutomationWebResponse<GetAutoDeleteChatResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAutoDeleteChatResponse>>(\n '/zalo-personal/messaging/chat/get-auto-delete',\n request\n );\n\n return response;\n }\n\n async getHiddenConversations(\n request: GetHiddenConversationsRequest\n ): Promise<AutomationWebResponse<GetHiddenConversationsResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<GetHiddenConversationsResponse>\n >('/zalo-personal/messaging/chat/list-hidden', request);\n\n return response;\n }\n\n async getPinConversations(\n request: GetPinConversationsRequest\n ): Promise<AutomationWebResponse<GetPinConversationsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPinConversationsResponse>>(\n '/zalo-personal/messaging/chat/list-pinned',\n request\n );\n\n return response;\n }\n\n async removeQuickMessage(\n request: RemoveQuickMessageRequest\n ): Promise<AutomationWebResponse<RemoveQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/remove',\n request\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Advanced Messaging Service\n * 100% khớp với automation-web/src/module/zalo-advanced-messaging\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n SendDeliveredEventRequest,\n SendDeliveredEventResponse,\n SendSeenEventRequest,\n SendSeenEventResponse,\n SendTypingEventRequest,\n SendTypingEventResponse,\n UploadAttachmentRequest,\n UploadAttachmentResponse,\n UploadProductPhotoRequest,\n UploadProductPhotoResponse,\n} from '../../types/dto/advanced-messaging.type';\n\n/**\n * Zalo Personal Advanced Messaging Service Class\n * 100% khớp với automation-web ZaloAdvancedMessagingController\n */\nexport class AdvancedMessagingService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Gửi sự kiện đã nhận tin nhắn\n * POST /zalo-personal/advanced-messaging/send-delivered-event\n */\n async sendDeliveredEvent(\n request: SendDeliveredEventRequest\n ): Promise<AutomationWebResponse<SendDeliveredEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendDeliveredEventResponse>>(\n '/zalo-personal/advanced-messaging/send-delivered-event',\n {\n sessionId: request.sessionId,\n isSeen: request.isSeen,\n messages: request.messages,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sự kiện đã xem tin nhắn\n * POST /zalo-personal/advanced-messaging/send-seen-event\n */\n async sendSeenEvent(\n request: SendSeenEventRequest\n ): Promise<AutomationWebResponse<SendSeenEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendSeenEventResponse>>(\n '/zalo-personal/advanced-messaging/send-seen-event',\n {\n sessionId: request.sessionId,\n messages: request.messages,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sự kiện đang gõ\n * POST /zalo-personal/advanced-messaging/send-typing-event\n */\n async sendTypingEvent(\n request: SendTypingEventRequest\n ): Promise<AutomationWebResponse<SendTypingEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendTypingEventResponse>>(\n '/zalo-personal/advanced-messaging/send-typing-event',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n destType: request.destType,\n }\n );\n\n return response;\n }\n\n /**\n * Upload file đính kèm\n * POST /zalo-personal/advanced-messaging/upload-attachment\n */\n async uploadAttachment(\n request: UploadAttachmentRequest\n ): Promise<AutomationWebResponse<UploadAttachmentResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UploadAttachmentResponse>>(\n '/zalo-personal/advanced-messaging/upload-attachment',\n {\n sessionId: request.sessionId,\n sources: request.sources,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Upload ảnh sản phẩm\n * POST /zalo-personal/advanced-messaging/upload-product-photo\n */\n async uploadProductPhoto(\n request: UploadProductPhotoRequest\n ): Promise<AutomationWebResponse<UploadProductPhotoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UploadProductPhotoResponse>>(\n '/zalo-personal/advanced-messaging/upload-product-photo',\n {\n sessionId: request.sessionId,\n file: request.file,\n }\n );\n\n return response;\n }\n}\n","/**\n * Webhook management service\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n Message,\n Typing,\n Reaction,\n SeenMessage,\n DeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n ThreadType,\n FriendEventType,\n GroupEventType,\n Reactions,\n} from '../../types/webhook';\n\n/**\n * Webhook listener options\n */\nexport interface WebhookListenerOptions {\n /**\n * Enable self listen for own messages\n * @default false\n */\n selfListen?: boolean;\n\n /**\n * Enable debug logging\n * @default false\n */\n logging?: boolean;\n\n /**\n * Auto reconnect on disconnect\n * @default true\n */\n autoReconnect?: boolean;\n\n /**\n * Reconnect delay in milliseconds\n * @default 5000\n */\n reconnectDelay?: number;\n}\n\n/**\n * Start webhook listener request\n */\nexport interface StartWebhookListenerRequest {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Webhook listener options\n */\n options?: WebhookListenerOptions;\n}\n\n/**\n * Stop webhook listener request\n */\nexport interface StopWebhookListenerRequest {\n /**\n * Session ID\n */\n sessionId: string;\n}\n\n/**\n * Webhook listener status\n */\nexport type WebhookListenerStatus = 'active' | 'inactive' | 'error' | 'connecting';\n\n/**\n * Webhook listener status response\n */\nexport interface WebhookListenerStatusResponse {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Current status\n */\n status: WebhookListenerStatus;\n\n /**\n * Error message if status is error\n */\n error?: string;\n\n /**\n * Timestamp when connected\n */\n connectedAt?: number;\n\n /**\n * Timestamp of last event\n */\n lastEventAt?: number;\n\n /**\n * Total event count\n */\n eventCount?: number;\n}\n\n/**\n * Webhook statistics\n */\nexport interface WebhookStatistics {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Total events processed\n */\n totalEvents: number;\n\n /**\n * Events processed today\n */\n eventsToday: number;\n\n /**\n * Last event timestamp\n */\n lastEventTimestamp: number;\n\n /**\n * Events count by type\n */\n eventsByType: Record<string, number>;\n\n /**\n * Queue statistics\n */\n queueStats: {\n waiting: number;\n active: number;\n completed: number;\n failed: number;\n };\n}\n\n/**\n * Webhook event response\n */\nexport interface WebhookEventResponse {\n /**\n * Event ID\n */\n eventId: string;\n\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Event type\n */\n eventType: string;\n\n /**\n * Event timestamp\n */\n timestamp: number;\n\n /**\n * Processing status\n */\n status: 'queued' | 'processing' | 'completed' | 'failed';\n\n /**\n * Job ID for tracking\n */\n jobId?: string;\n\n /**\n * Error message if failed\n */\n error?: string;\n}\n\n/**\n * Response DTO cho validate session\n */\nexport interface ValidateSessionResponse {\n sessionId: string;\n isValid: boolean;\n reason?: string;\n statusUpdated: boolean;\n newStatus?: string;\n}\n\n/**\n * Response DTO cho validate all sessions\n */\nexport interface ValidateAllSessionsResponse {\n total: number;\n valid: number;\n invalid: number;\n updated: string[];\n}\n\n/**\n * Response DTO cho cleanup expired sessions\n */\nexport interface CleanupExpiredSessionsResponse {\n cleanupCount: number;\n}\n\n/**\n * Request old messages request\n */\nexport interface RequestOldMessagesRequest {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thread type ('user' or 'group')\n * @default 'user'\n */\n threadType?: 'user' | 'group';\n\n /**\n * Last message ID to get older messages\n * If null, get from latest messages\n * @default null\n */\n lastMsgId?: string | null;\n}\n\n/**\n * Request old messages response\n */\nexport interface RequestOldMessagesResponse {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thread type\n */\n threadType: 'user' | 'group';\n\n /**\n * Last message ID used in request\n */\n lastMsgId: string | null;\n}\n\n/**\n * Webhook Event Handlers\n */\nexport interface WebhookEventHandlers {\n /**\n * Message received handler\n */\n onMessage?: (event: Message) => void;\n\n /**\n * Typing event handler\n */\n onTyping?: (event: Typing) => void;\n\n /**\n * Reaction event handler\n */\n onReaction?: (event: Reaction) => void;\n\n /**\n * Message seen handler\n */\n onMessageSeen?: (event: SeenMessage) => void;\n\n /**\n * Message delivered handler\n */\n onMessageDelivered?: (event: DeliveredMessage) => void;\n\n /**\n * Friend event handler\n */\n onFriendEvent?: (event: FriendEvent) => void;\n\n /**\n * Group event handler\n */\n onGroupEvent?: (event: GroupEvent) => void;\n\n /**\n * Message undo handler\n */\n onUndo?: (event: Undo) => void;\n\n /**\n * Generic event handler for unknown events\n */\n onUnknownEvent?: (eventType: string, data: any) => void;\n\n /**\n * Error handler\n */\n onError?: (error: Error) => void;\n\n /**\n * Connection status handler\n */\n onConnectionChange?: (status: 'connected' | 'disconnected' | 'reconnecting') => void;\n}\n\n/**\n * Webhook management service class\n */\nexport class WebhookService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Start webhook listener for a session\n */\n async startWebhookListener(request: StartWebhookListenerRequest): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/start',\n {\n sessionId: request.sessionId,\n options: request.options || {},\n }\n );\n\n return response;\n }\n\n /**\n * Stop webhook listener for a session\n */\n async stopWebhookListener(request: StopWebhookListenerRequest): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/stop',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Get webhook listener status for a session\n */\n async getWebhookListenerStatus(sessionId: string): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<WebhookListenerStatusResponse>(\n `/webhook/status/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Get webhook statistics for a session\n */\n async getWebhookStatistics(sessionId: string): Promise<WebhookStatistics> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<WebhookStatistics>(\n `/webhook/stats/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Get all active webhook listeners\n */\n async getActiveWebhookListeners(): Promise<{\n activeListeners: string[];\n count: number;\n }> {\n const response = await this.httpClient.get<{\n success: boolean;\n data: {\n activeListeners: string[];\n count: number;\n };\n }>('/webhook/listeners');\n\n return response.data;\n }\n\n /**\n * Restart webhook listener for a session\n */\n async restartWebhookListener(\n request: StartWebhookListenerRequest\n ): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/restart',\n {\n sessionId: request.sessionId,\n options: request.options || {},\n }\n );\n\n return response;\n }\n\n /**\n * Check if webhook listener is active\n */\n async isWebhookListenerActive(sessionId: string): Promise<boolean> {\n try {\n const status = await this.getWebhookListenerStatus(sessionId);\n return status.status === 'active';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Get webhook health status\n */\n async getWebhookHealth(): Promise<{\n status: 'healthy' | 'unhealthy';\n activeListeners: number;\n totalEvents: number;\n queueHealth: {\n waiting: number;\n active: number;\n failed: number;\n };\n }> {\n const response = await this.httpClient.get<{\n success: boolean;\n data: {\n status: string;\n activeListeners: number;\n totalEvents: number;\n queueHealth: {\n waiting: number;\n active: number;\n failed: number;\n };\n };\n }>('/webhook/health');\n\n return {\n status: response.data.status === 'ok' ? 'healthy' : 'unhealthy',\n activeListeners: response.data.activeListeners,\n totalEvents: response.data.totalEvents,\n queueHealth: response.data.queueHealth,\n };\n }\n\n /**\n * Stop all webhook listeners\n */\n async stopAllWebhookListeners(): Promise<{\n stoppedListeners: string[];\n count: number;\n }> {\n const response = await this.httpClient.delete<{\n success: boolean;\n data: {\n stoppedListeners: string[];\n count: number;\n };\n }>('/webhook/listeners/all');\n\n return response.data;\n }\n\n /**\n * Validate session\n * GET /webhook/validate/:sessionId\n */\n async validateSession(sessionId: string): Promise<AutomationWebResponse<ValidateSessionResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<AutomationWebResponse<ValidateSessionResponse>>(\n `/webhook/validate/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Validate all sessions\n * POST /webhook/validate-all\n */\n async validateAllSessions(): Promise<AutomationWebResponse<ValidateAllSessionsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ValidateAllSessionsResponse>>(\n '/webhook/validate-all',\n {}\n );\n\n return response;\n }\n\n /**\n * Cleanup expired sessions\n * DELETE /webhook/cleanup-expired\n */\n async cleanupExpiredSessions(): Promise<AutomationWebResponse<CleanupExpiredSessionsResponse>> {\n const response = await this.httpClient.delete<AutomationWebResponse<CleanupExpiredSessionsResponse>>(\n '/webhook/cleanup-expired'\n );\n\n return response;\n }\n\n /**\n * Request old messages from a thread\n * Pattern: Request-Response via WebSocket\n *\n * How it works:\n * 1. Call this API to SEND REQUEST\n * 2. Server processes and SENDS RESPONSE via 'old_messages' event\n * 3. Results will be received via webhook event handler\n *\n * @param request - Request old messages parameters\n * @returns Response with request confirmation\n *\n * @example\n * ```typescript\n * // Request latest messages for a user thread\n * await webhookService.requestOldMessages({\n * sessionId: 'your-session-id',\n * threadType: 'user',\n * lastMsgId: null\n * });\n *\n * // Request older messages using last message ID\n * await webhookService.requestOldMessages({\n * sessionId: 'your-session-id',\n * threadType: 'group',\n * lastMsgId: 'msg-id-123'\n * });\n * ```\n */\n async requestOldMessages(\n request: RequestOldMessagesRequest\n ): Promise<AutomationWebResponse<RequestOldMessagesResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<RequestOldMessagesResponse>>(\n '/webhook/request-old-messages',\n {\n sessionId: request.sessionId,\n threadType: request.threadType || 'user',\n lastMsgId: request.lastMsgId ?? null,\n }\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Group Management Service\n * 100% khớp với automation-web/src/module/zalo-group/controllers/zalo-group.controller.ts\n * Đã thêm đầy đủ 19 methods để đồng bộ hoàn toàn với backend controller\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetGroupInfoRequest,\n CreateGroupRequest,\n AddMemberToGroupRequest,\n RemoveMemberFromGroupRequest,\n ChangeGroupNameRequest,\n GetGroupMembersRequest,\n GetGroupMembersBasicRequest,\n LeaveGroupRequest,\n DisperseGroupRequest,\n JoinGroupRequest,\n ChangeGroupAvatarRequest,\n UpdateGroupSettingsRequest,\n ChangeGroupOwnerRequest,\n AddGroupDeputyRequest,\n RemoveGroupDeputyRequest,\n EnableGroupLinkRequest,\n DisableGroupLinkRequest,\n GetGroupLinkInfoRequest,\n InviteUserToGroupsRequest,\n GetAllGroupsResponse,\n GetGroupInfoResponse,\n CreateGroupResponse,\n AddMemberResponse,\n RemoveMemberResponse,\n ChangeGroupNameResponse,\n GetGroupMembersResponse,\n GetGroupMembersBasicResponse,\n GroupActionResponse,\n ChangeGroupAvatarResponse,\n UpdateGroupSettingsResponse,\n ChangeGroupOwnerResponse,\n AddGroupDeputyResponse,\n RemoveGroupDeputyResponse,\n EnableGroupLinkResponse,\n DisableGroupLinkResponse,\n GetGroupLinkInfoResponse,\n InviteUserToGroupsResponse,\n GetAllGroupsDto,\n\n AddGroupBlockedMemberRequest,\n DeleteGroupInviteBoxRequest,\n GetGroupBlockedMemberRequest,\n GetGroupChatHistoryRequest,\n GetGroupInviteBoxInfoRequest,\n GetGroupInviteBoxListRequest,\n GetGroupLinkDetailRequest,\n GetPendingGroupMembersRequest,\n JoinGroupInviteBoxRequest,\n RemoveGroupBlockedMemberRequest,\n ReviewPendingMemberRequest,\n UpgradeGroupCommunityRequest,\n GetGroupMembersInfoDirectRequest,\n GetGroupMembersInfoDirectResponse,\n\n DeleteGroupInviteBoxResponse,\n GetGroupBlockedMemberResponse,\n GetGroupChatHistoryResponse,\n GetGroupInviteBoxInfoResponse,\n GetGroupInviteBoxListResponse,\n GetGroupLinkDetailResponse,\n GetPendingGroupMembersResponse,\n ReviewPendingMemberRequestResponse,\n} from '../../types/dto/groups.type';\n\n/**\n * Zalo Personal Group Management Service Class\n * 100% khớp với automation-web ZaloGroupController\n * Bao gồm đầy đủ 19 methods: 15 cơ bản + 4 advanced link/invite\n */\nexport class GroupService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy tất cả groups\n * POST /zalo-personal/groups/all\n */\n async getAllGroups(\n request: GetAllGroupsDto\n ): Promise<AutomationWebResponse<GetAllGroupsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAllGroupsResponse>>(\n '/zalo-personal/groups/all',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n async getGroupMembersBasic(\n request: GetGroupMembersBasicRequest\n ): Promise<AutomationWebResponse<GetGroupMembersBasicResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersBasicResponse>>(\n '/zalo-personal/groups/members-basic',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n batchSize: request.batchSize,\n delayMs: request.delayMs,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin chi tiết của group\n * POST /zalo-personal/groups/info\n */\n async getGroupInfo(\n request: GetGroupInfoRequest\n ): Promise<AutomationWebResponse<GetGroupInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInfoResponse>>(\n '/zalo-personal/groups/info',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Tạo group mới\n * POST /zalo-personal/groups/create\n */\n async createGroup(\n request: CreateGroupRequest\n ): Promise<AutomationWebResponse<CreateGroupResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CreateGroupResponse>>(\n '/zalo-personal/groups/create',\n request\n );\n\n return response;\n }\n\n /**\n * Thêm member vào group\n * POST /zalo-personal/groups/add-members\n */\n async addMemberToGroup(\n request: AddMemberToGroupRequest\n ): Promise<AutomationWebResponse<AddMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddMemberResponse>>(\n '/zalo-personal/groups/add-members',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Remove member khỏi group\n * POST /zalo-personal/groups/remove-member\n */\n async removeMemberFromGroup(\n request: RemoveMemberFromGroupRequest\n ): Promise<AutomationWebResponse<RemoveMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveMemberResponse>>(\n '/zalo-personal/groups/remove-member',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberId: request.memberId,\n }\n );\n\n return response;\n }\n\n /**\n * Đổi tên group\n * PUT /zalo-personal/groups/change-name\n */\n async changeGroupName(\n request: ChangeGroupNameRequest\n ): Promise<AutomationWebResponse<ChangeGroupNameResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<ChangeGroupNameResponse>>(\n '/zalo-personal/groups/change-name',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n newName: request.newName,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách members của group\n * POST /zalo-personal/groups/members\n * Nếu không truyền page/limit thì sẽ lấy tất cả members\n * 100% khớp với automation-web controller\n */\n async getGroupMembers(\n request: GetGroupMembersRequest\n ): Promise<AutomationWebResponse<GetGroupMembersResponse>> {\n const requestBody: any = {\n sessionId: request.sessionId,\n groupId: request.groupId,\n };\n\n // Chỉ thêm các optional fields nếu user có truyền\n if (request.page !== undefined) {\n requestBody.page = request.page;\n }\n if (request.limit !== undefined) {\n requestBody.limit = request.limit;\n }\n if (request.batchSize !== undefined) {\n requestBody.batchSize = request.batchSize;\n }\n if (request.delayMs !== undefined) {\n requestBody.delayMs = request.delayMs;\n }\n if (request.randomMaxDelayMs !== undefined) {\n requestBody.randomMaxDelayMs = request.randomMaxDelayMs;\n }\n\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersResponse>>(\n '/zalo-personal/groups/members',\n requestBody\n );\n\n return response;\n }\n\n /**\n * Rời nhóm\n * POST /zalo-personal/groups/leave\n */\n async leaveGroup(\n request: LeaveGroupRequest\n ): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/leave',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Giải tán nhóm\n * DELETE /zalo-personal/groups/disperse\n */\n async disperseGroup(\n request: DisperseGroupRequest\n ): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.deleteWithBody<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/disperse',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Tham gia nhóm qua link\n * POST /zalo-personal/groups/join\n * 100% khớp với automation-web controller\n */\n async joinGroup(request: JoinGroupRequest): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/join',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n /**\n * Đổi avatar nhóm\n * PUT /zalo-personal/groups/change-avatar\n */\n async changeGroupAvatar(\n request: ChangeGroupAvatarRequest\n ): Promise<AutomationWebResponse<ChangeGroupAvatarResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<ChangeGroupAvatarResponse>>(\n '/zalo-personal/groups/change-avatar',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n avatarPath: request.avatarPath,\n }\n );\n\n return response;\n }\n\n /**\n * Cập nhật cài đặt nhóm\n * PUT /zalo-personal/groups/update-settings\n */\n async updateGroupSettings(\n request: UpdateGroupSettingsRequest\n ): Promise<AutomationWebResponse<UpdateGroupSettingsResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<UpdateGroupSettingsResponse>>(\n '/zalo-personal/groups/update-settings',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n settings: request.settings,\n }\n );\n\n return response;\n }\n\n /**\n * Chuyển quyền owner nhóm\n * POST /zalo-personal/groups/change-owner\n */\n async changeGroupOwner(\n request: ChangeGroupOwnerRequest\n ): Promise<AutomationWebResponse<ChangeGroupOwnerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ChangeGroupOwnerResponse>>(\n '/zalo-personal/groups/change-owner',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n newOwnerId: request.newOwnerId,\n }\n );\n\n return response;\n }\n\n /**\n * Thêm phó admin\n * POST /zalo-personal/groups/add-deputy\n */\n async addGroupDeputy(\n request: AddGroupDeputyRequest\n ): Promise<AutomationWebResponse<AddGroupDeputyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddGroupDeputyResponse>>(\n '/zalo-personal/groups/add-deputy',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa phó admin\n * POST /zalo-personal/groups/remove-deputy\n */\n async removeGroupDeputy(\n request: RemoveGroupDeputyRequest\n ): Promise<AutomationWebResponse<RemoveGroupDeputyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveGroupDeputyResponse>>(\n '/zalo-personal/groups/remove-deputy',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Enable group link\n * POST /zalo-personal/groups/enable-link\n */\n async enableGroupLink(\n request: EnableGroupLinkRequest\n ): Promise<AutomationWebResponse<EnableGroupLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<EnableGroupLinkResponse>>(\n '/zalo-personal/groups/enable-link',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Disable group link\n * POST /zalo-personal/groups/disable-link\n */\n async disableGroupLink(\n request: DisableGroupLinkRequest\n ): Promise<AutomationWebResponse<DisableGroupLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<DisableGroupLinkResponse>>(\n '/zalo-personal/groups/disable-link',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Get group link info\n * POST /zalo-personal/groups/link-info\n * 100% khớp với automation-web controller\n */\n async getGroupLinkInfo(\n request: GetGroupLinkInfoRequest\n ): Promise<AutomationWebResponse<GetGroupLinkInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupLinkInfoResponse>>(\n '/zalo-personal/groups/link-info',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n\n /**\n * Invite user to multiple groups\n * POST /zalo-personal/groups/invite-to-groups\n */\n async inviteUserToGroups(\n request: InviteUserToGroupsRequest\n ): Promise<AutomationWebResponse<InviteUserToGroupsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<InviteUserToGroupsResponse>>(\n '/zalo-personal/groups/invite-to-groups',\n {\n sessionId: request.sessionId,\n memberId: request.memberId,\n groupIds: request.groupIds,\n }\n );\n\n return response;\n }\n\n async addGroupBlockedMember(\n request: AddGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/block/add',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n async deleteGroupInviteBox(\n request: DeleteGroupInviteBoxRequest\n ): Promise<AutomationWebResponse<DeleteGroupInviteBoxResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<DeleteGroupInviteBoxResponse>>(\n '/zalo-personal/groups/invite-box/delete',\n {\n sessionId: request.sessionId,\n groupIds: request.groupIds,\n }\n );\n\n return response;\n }\n\n async getGroupBlockedMember(\n request: GetGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<GetGroupBlockedMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupBlockedMemberResponse>>(\n '/zalo-personal/groups/block/list',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async getGroupChatHistory(\n request: GetGroupChatHistoryRequest\n ): Promise<AutomationWebResponse<GetGroupChatHistoryResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupChatHistoryResponse>>(\n '/zalo-personal/groups/chat-history',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n count: request.count,\n page: request.page,\n }\n );\n\n return response;\n }\n\n async getGroupInviteBoxInfo(\n request: GetGroupInviteBoxInfoRequest\n ): Promise<AutomationWebResponse<GetGroupInviteBoxInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInviteBoxInfoResponse>>(\n '/zalo-personal/groups/invite-box/info',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async getGroupInviteBoxList(\n request: GetGroupInviteBoxListRequest\n ): Promise<AutomationWebResponse<GetGroupInviteBoxListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInviteBoxListResponse>>(\n '/zalo-personal/groups/invite-box/list',\n {\n sessionId: request.sessionId,\n page: request.page,\n limit: request.limit,\n }\n );\n\n return response;\n }\n\n async getGroupLinkDetail(\n request: GetGroupLinkDetailRequest\n ): Promise<AutomationWebResponse<GetGroupLinkDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupLinkDetailResponse>>(\n '/zalo-personal/groups/link/detail',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n async getPendingGroupMembers(\n request: GetPendingGroupMembersRequest\n ): Promise<AutomationWebResponse<GetPendingGroupMembersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPendingGroupMembersResponse>>(\n '/zalo-personal/groups/pending/list',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async joinGroupInviteBox(request: JoinGroupInviteBoxRequest): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/invite-box/join',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async removeGroupBlockedMember(\n request: RemoveGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/block/remove',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n async reviewPendingMemberRequest(\n request: ReviewPendingMemberRequest\n ): Promise<AutomationWebResponse<ReviewPendingMemberRequestResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ReviewPendingMemberRequestResponse>>(\n '/zalo-personal/groups/pending/review',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberId: request.memberId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n async upgradeGroupCommunity(\n request: UpgradeGroupCommunityRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/upgrade/community',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Gọi trực tiếp api.getGroupMembersInfo từ Zalo Web SDK mà không qua vòng lặp hay batching\n * POST /zalo-personal/groups/members-info-direct\n */\n async getGroupMembersInfoDirect(\n request: GetGroupMembersInfoDirectRequest\n ): Promise<AutomationWebResponse<GetGroupMembersInfoDirectResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersInfoDirectResponse>>(\n '/zalo-personal/groups/members-info-direct',\n {\n sessionId: request.sessionId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n}\n","/**\r\n * Zalo Personal Friend Management Service\r\n * 100% khá»›p vá»›i automation-web/src/module/zalo-friend\r\n * Đã hợp nhất DTOs và Service class trong 1 file duy nhất\r\n */\r\n\r\nimport { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n // Request DTOs\r\n GetAllFriendsDto,\r\n SearchFriendsDto,\r\n GetFriendsInfoDto,\r\n GetOnlineFriendsDto,\r\n SendFriendRequestDto,\r\n AcceptFriendRequestDto,\r\n GetSentFriendRequestsDto,\r\n UndoFriendRequestDto,\r\n RemoveFriendDto,\r\n FindUserDto,\r\n FindMultiUsersDto,\r\n BlockUserDto,\r\n UnblockUserDto,\r\n ChangeFriendAliasDto,\r\n RemoveFriendAliasDto,\r\n GetAliasListDto,\r\n GetSettingsDto,\r\n GetLastOnlineDto,\r\n GetOwnIdDto,\r\n FetchAccountInfoDto,\r\n\r\n FindUserByUsernameDto,\r\n GetFriendRecommendationsDto,\r\n RejectFriendRequestDto,\r\n GetFriendRequestStatusDto,\r\n BlockViewFeedDto,\r\n UpdateStatusDto,\r\n GetFriendOnlinesDto,\r\n GetFriendBoardListDto,\r\n GetQRDto,\r\n\r\n // Response DTOs\r\n GetAllFriendsResponseDto,\r\n SearchFriendsResponseDto,\r\n OperationResultDto,\r\n GetSentFriendRequestsResponseDto,\r\n FindUserResponseDto,\r\n FindMultiUsersResponseDto,\r\n GetSettingsResponseDto,\r\n GetLastOnlineResponseDto,\r\n GetOwnIdResponseDto,\r\n AccountInfoDto,\r\n FriendStats,\r\n UserInfoResponse,\r\n FriendDto,\r\n\r\n UserBasicDto,\r\n GetFriendRecommendationsResponseDto,\r\n GetFriendRequestStatusResponseDto,\r\n GetFriendOnlinesResponseDto,\r\n GetFriendBoardListResponseDto,\r\n GetQRResponseDto,\r\n PaginatedResult,\r\n AliasInfoDto,\r\n \r\n // SDK Types\r\n ZaloGetAllFriendsResponse,\r\n ZaloFriendItem,\r\n} from '../../types/dto/friends.type';\r\n\r\n/**\r\n * Zalo Personal Friend Management Service Class\r\n * 100% khá»›p vá»›i automation-web ZaloFriendController\r\n */\r\nexport class FriendService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n // ==================== BASIC FRIEND METHODS ====================\r\n\r\n /**\r\n * Lấy tất cả friends\r\n * POST /zalo-personal/friends/all\r\n * @returns ZaloGetAllFriendsResponse - Array cá»§a ZaloFriendItem từ SDK (dữ liệu thô)\r\n */\r\n async getAllFriends(\r\n request: GetAllFriendsDto\r\n ): Promise<AutomationWebResponse<ZaloGetAllFriendsResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ZaloGetAllFriendsResponse>>(\r\n '/zalo-personal/friends/all',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Tìm kiếm friends\r\n * POST /zalo-personal/friends/search\r\n */\r\n async searchFriends(\r\n request: SearchFriendsDto\r\n ): Promise<AutomationWebResponse<SearchFriendsResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<SearchFriendsResponseDto>>(\r\n '/zalo-personal/friends/search',\r\n {\r\n sessionId: request.sessionId,\r\n keyword: request.keyword,\r\n limit: request.limit,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thông tin chi tiết friends\r\n * POST /zalo-personal/friends/info\r\n */\r\n async getFriendsInfo(\r\n request: GetFriendsInfoDto\r\n ): Promise<AutomationWebResponse<UserInfoResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<UserInfoResponse>>(\r\n '/zalo-personal/friends/info',\r\n {\r\n sessionId: request.sessionId,\r\n friendIds: request.friendIds,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy friends Ä‘ang online\r\n * POST /zalo-personal/friends/online\r\n */\r\n async getOnlineFriends(\r\n request: GetOnlineFriendsDto\r\n ): Promise<AutomationWebResponse<FriendDto[]>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FriendDto[]>>(\r\n '/zalo-personal/friends/online',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thống kê friends\r\n * GET /zalo-personal/friends/stats\r\n */\r\n async getFriendsStats(sessionId: string): Promise<AutomationWebResponse<FriendStats>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<FriendStats>>(\r\n `/zalo-personal/friends/stats?sessionId=${sessionId}`\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== FRIEND REQUEST METHODS ====================\r\n\r\n /**\r\n * Gá»­i lời mời kết bạn\r\n * POST /zalo-personal/friends/request/send\r\n */\r\n async sendFriendRequest(\r\n request: SendFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/send',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n message: request.message,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Chấp nhận lời mời kết bạn\r\n * POST /zalo-personal/friends/request/accept\r\n */\r\n async acceptFriendRequest(\r\n request: AcceptFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/accept',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy danh sách lời mời đã gá»­i\r\n * POST /zalo-personal/friends/request/sent\r\n */\r\n async getSentFriendRequests(\r\n request: GetSentFriendRequestsDto\r\n ): Promise<AutomationWebResponse<GetSentFriendRequestsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetSentFriendRequestsResponseDto>\r\n >('/zalo-personal/friends/request/sent', {\r\n sessionId: request.sessionId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Há»§y lời mời đã gá»­i\r\n * POST /zalo-personal/friends/request/undo\r\n */\r\n async undoFriendRequest(\r\n request: UndoFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/undo',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== FRIEND MANAGEMENT METHODS ====================\r\n\r\n /**\r\n * Xóa bạn bè\r\n * POST /zalo-personal/friends/remove\r\n */\r\n async removeFriend(request: RemoveFriendDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/remove',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Chặn user\r\n * POST /zalo-personal/friends/block\r\n */\r\n async blockUser(request: BlockUserDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/block',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Bỏ chặn user\r\n * POST /zalo-personal/friends/unblock\r\n */\r\n async unblockUser(request: UnblockUserDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/unblock',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Thay đổi biệt danh friend\r\n * POST /zalo-personal/friends/alias/change\r\n */\r\n async changeFriendAlias(\r\n request: ChangeFriendAliasDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/alias/change',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n alias: request.alias,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Xóa biệt danh friend\r\n * POST /zalo-personal/friends/alias/remove\r\n */\r\n async removeFriendAlias(\r\n request: RemoveFriendAliasDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/alias/remove',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy danh sách biệt danh\r\n * POST /zalo-personal/friends/alias/list\r\n */\r\n async getAliasList(\r\n request: GetAliasListDto\r\n ): Promise<AutomationWebResponse<PaginatedResult<AliasInfoDto>>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<PaginatedResult<AliasInfoDto>>\r\n >(\r\n '/zalo-personal/friends/alias/list',\r\n {\r\n sessionId: request.sessionId,\r\n count: request.count,\r\n page: request.page,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== USER SEARCH & ACCOUNT METHODS ====================\r\n\r\n /**\r\n * Tìm kiếm user theo số Ä‘iện thoại\r\n * POST /zalo-personal/friends/find-user\r\n */\r\n async findUser(request: FindUserDto): Promise<AutomationWebResponse<FindUserResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FindUserResponseDto>>(\r\n '/zalo-personal/friends/find-user',\r\n {\r\n sessionId: request.sessionId,\r\n phoneNumber: request.phoneNumber,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * TAªm ki §¨m nhi ¯?u user theo danh sA­ch s ¯` Ž`i ¯Øn tho §­i\r\n * POST /zalo-personal/friends/find-multi-users\r\n */\r\n async findMultiUsers(\r\n request: FindMultiUsersDto\r\n ): Promise<AutomationWebResponse<FindMultiUsersResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FindMultiUsersResponseDto>>(\r\n '/zalo-personal/friends/find-multi-users',\r\n {\r\n sessionId: request.sessionId,\r\n phoneNumbers: request.phoneNumbers,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thời gian last online\r\n * POST /zalo-personal/friends/last-online\r\n */\r\n async getLastOnline(\r\n request: GetLastOnlineDto\r\n ): Promise<AutomationWebResponse<GetLastOnlineResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetLastOnlineResponseDto>>(\r\n '/zalo-personal/friends/last-online',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy own ID\r\n * POST /zalo-personal/friends/own-id\r\n */\r\n async getOwnId(request: GetOwnIdDto): Promise<AutomationWebResponse<GetOwnIdResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetOwnIdResponseDto>>(\r\n '/zalo-personal/friends/own-id',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy cài đặt tài khoản\r\n * POST /zalo-personal/friends/settings\r\n */\r\n async getSettings(\r\n request: GetSettingsDto\r\n ): Promise<AutomationWebResponse<GetSettingsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetSettingsResponseDto>\r\n >('/zalo-personal/friends/settings', {\r\n sessionId: request.sessionId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thông tin tài khoản\r\n * POST /zalo-personal/friends/account-info\r\n */\r\n async fetchAccountInfo(\r\n request: FetchAccountInfoDto\r\n ): Promise<AutomationWebResponse<AccountInfoDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<AccountInfoDto>>(\r\n '/zalo-personal/friends/account-info',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findUserByUsername(\r\n request: FindUserByUsernameDto\r\n ): Promise<AutomationWebResponse<UserBasicDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<UserBasicDto>>(\r\n '/zalo-personal/friends/find-username',\r\n {\r\n sessionId: request.sessionId,\r\n username: request.username,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendRecommendations(\r\n request: GetFriendRecommendationsDto\r\n ): Promise<AutomationWebResponse<GetFriendRecommendationsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendRecommendationsResponseDto>\r\n >('/zalo-personal/friends/recommendations', {\r\n sessionId: request.sessionId,\r\n limit: request.limit,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async rejectFriendRequest(\r\n request: RejectFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/reject',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendRequestStatus(\r\n request: GetFriendRequestStatusDto\r\n ): Promise<AutomationWebResponse<GetFriendRequestStatusResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendRequestStatusResponseDto>\r\n >('/zalo-personal/friends/request/status', {\r\n sessionId: request.sessionId,\r\n userIds: request.userIds,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async blockViewFeed(\r\n request: BlockViewFeedDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/block/feed',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async updateStatus(\r\n request: UpdateStatusDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/status/update',\r\n {\r\n sessionId: request.sessionId,\r\n status: request.status,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendOnlines(\r\n request: GetFriendOnlinesDto\r\n ): Promise<AutomationWebResponse<GetFriendOnlinesResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetFriendOnlinesResponseDto>>(\r\n '/zalo-personal/friends/friend-onlines',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendBoardList(\r\n request: GetFriendBoardListDto\r\n ): Promise<AutomationWebResponse<GetFriendBoardListResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendBoardListResponseDto>\r\n >('/zalo-personal/friends/friend-board-list', {\r\n sessionId: request.sessionId,\r\n conversationId: request.conversationId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async getQR(request: GetQRDto): Promise<AutomationWebResponse<GetQRResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetQRResponseDto>>(\r\n '/zalo-personal/friends/qr',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","/**\n * Zalo Personal User Info Management Service\n * 100% khớp với automation-web/src/module/zalo-personal/controllers/zalo-user-info.controller.ts\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetUserInfoRequest,\n GetSingleUserInfoRequest,\n GetBasicUserInfoRequest,\n CheckUserExistsRequest,\n GetMultipleUsersInfoRequest,\n GetMultiUsersByPhoneRequest,\n GetUserInfoResponse,\n GetSingleUserInfoResponse,\n GetBasicUserInfoResponse,\n CheckUserExistsResponse,\n GetMultipleUsersInfoResponse,\n GetMultiUsersByPhoneResponse,\n} from '../../types/dto/user-info.type';\n\n/**\n * Zalo Personal User Info Management Service Class\n * 100% khớp với automation-web ZaloUserInfoController\n */\nexport class UserInfoService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy thông tin user theo ID\n * POST /zalo-personal/user-info/get\n */\n async getUserInfo(\n request: GetUserInfoRequest\n ): Promise<AutomationWebResponse<GetUserInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetUserInfoResponse>>(\n '/zalo-personal/user-info/get',\n {\n sessionId: request.sessionId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin user đơn lẻ\n * GET /zalo-personal/user-info/single/:sessionId/:userId\n */\n async getSingleUserInfo(\n request: GetSingleUserInfoRequest\n ): Promise<AutomationWebResponse<GetSingleUserInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<GetSingleUserInfoResponse>>(\n `/zalo-personal/user-info/single/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin cơ bản của user\n * GET /zalo-personal/user-info/basic/:sessionId/:userId\n */\n async getBasicUserInfo(\n request: GetBasicUserInfoRequest\n ): Promise<AutomationWebResponse<GetBasicUserInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<GetBasicUserInfoResponse>>(\n `/zalo-personal/user-info/basic/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Kiểm tra user có tồn tại không\n * GET /zalo-personal/user-info/exists/:sessionId/:userId\n */\n async checkUserExists(\n request: CheckUserExistsRequest\n ): Promise<AutomationWebResponse<CheckUserExistsResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<CheckUserExistsResponse>>(\n `/zalo-personal/user-info/exists/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin nhiều users cùng lúc\n * POST /zalo-personal/user-info/multiple\n */\n async getMultipleUsersInfo(\n request: GetMultipleUsersInfoRequest\n ): Promise<AutomationWebResponse<GetMultipleUsersInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateIdArray(request.userIds, 'userIds', 1);\n\n const response = await this.httpClient.post<\n AutomationWebResponse<GetMultipleUsersInfoResponse>\n >('/zalo-personal/user-info/multiple', {\n sessionId: request.sessionId,\n userIds: request.userIds,\n });\n\n return response;\n }\n\n /**\n * Tìm kiếm user theo danh sách số điện thoại\n * POST /zalo-personal/user-info/get-multi-users-by-phone\n */\n async getMultiUsersByPhone(\n request: GetMultiUsersByPhoneRequest\n ): Promise<AutomationWebResponse<GetMultiUsersByPhoneResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateIdArray(request.phoneNumbers, 'phoneNumbers', 1);\n\n const response = await this.httpClient.post<\n AutomationWebResponse<GetMultiUsersByPhoneResponse>\n >('/zalo-personal/user-info/get-multi-users-by-phone', {\n sessionId: request.sessionId,\n phoneNumbers: request.phoneNumbers,\n isAvatarSizeMax: request.isAvatarSizeMax,\n });\n\n return response;\n }\n}\n","/**\n * Zalo Personal Profile & Account Management Service\n * 100% khớp với automation-web/src/module/zalo-profile/controllers/profile.controller.ts\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n FetchAccountInfoRequest,\n FetchAccountInfoResponse,\n ChangeAccountAvatarRequest,\n ChangeAccountAvatarResponse,\n DeleteAvatarRequest,\n DeleteAvatarResponse,\n ReuseAvatarRequest,\n ReuseAvatarResponse,\n GetAvatarListRequest,\n GetAvatarListResponse,\n UpdateProfileRequest,\n UpdateProfileResponse,\n GetAvatarUrlProfileRequest,\n GetAvatarUrlProfileResponse,\n GetFullAvatarRequest,\n GetFullAvatarResponse,\n GetSettingsRequest,\n GetSettingsResponse,\n UpdateSettingsRequest,\n UpdateLangRequest,\n} from '../../types/dto/profile.type';\n\n/**\n * Zalo Personal Profile & Account Management Service Class\n * 100% khớp với automation-web ZaloProfileController\n * Bao gồm đầy đủ 6 methods: fetch-account-info, change-avatar, delete-avatar, reuse-avatar, avatar-list, update\n */\nexport class ProfileService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy thông tin tài khoản\n * POST /zalo-personal/profile/fetch-account-info\n */\n async fetchAccountInfo(\n request: FetchAccountInfoRequest\n ): Promise<AutomationWebResponse<FetchAccountInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<FetchAccountInfoResponse>>(\n '/zalo-personal/profile/fetch-account-info',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Thay đổi avatar tài khoản\n * POST /zalo-personal/profile/change-avatar\n */\n async changeAccountAvatar(\n request: ChangeAccountAvatarRequest\n ): Promise<AutomationWebResponse<ChangeAccountAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.avatarSource, 'avatarSource');\n ValidationUtils.validateRequired(request.avatarSource.data, 'avatarSource.data');\n ValidationUtils.validateRequired(request.avatarSource.filename, 'avatarSource.filename');\n ValidationUtils.validateRequired(request.avatarSource.metadata, 'avatarSource.metadata');\n\n const response = await this.httpClient.post<AutomationWebResponse<ChangeAccountAvatarResponse>>(\n '/zalo-personal/profile/change-account-avatar',\n {\n sessionId: request.sessionId,\n avatarSource: request.avatarSource,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa avatar\n * POST /zalo-personal/profile/delete-avatar\n */\n async deleteAvatar(\n request: DeleteAvatarRequest\n ): Promise<AutomationWebResponse<DeleteAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.photoId, 'photoId');\n\n const response = await this.httpClient.post<AutomationWebResponse<DeleteAvatarResponse>>(\n '/zalo-personal/profile/delete-avatar',\n {\n sessionId: request.sessionId,\n photoId: request.photoId,\n }\n );\n\n return response;\n }\n\n /**\n * Sử dụng lại avatar\n * POST /zalo-personal/profile/reuse-avatar\n */\n async reuseAvatar(\n request: ReuseAvatarRequest\n ): Promise<AutomationWebResponse<ReuseAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.avatarId, 'avatarId');\n\n const response = await this.httpClient.post<AutomationWebResponse<ReuseAvatarResponse>>(\n '/zalo-personal/profile/reuse-avatar',\n {\n sessionId: request.sessionId,\n avatarId: request.avatarId,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách avatar\n * POST /zalo-personal/profile/avatar-list\n */\n async getAvatarList(\n request: GetAvatarListRequest\n ): Promise<AutomationWebResponse<GetAvatarListResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<GetAvatarListResponse>>(\n '/zalo-personal/profile/get-avatar-list',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Cập nhật profile\n * POST /zalo-personal/profile/update\n */\n async updateProfile(\n request: UpdateProfileRequest\n ): Promise<AutomationWebResponse<UpdateProfileResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.name, 'name');\n ValidationUtils.validateRequired(request.dob, 'dob');\n ValidationUtils.validateRequired(request.gender, 'gender');\n\n const response = await this.httpClient.post<AutomationWebResponse<UpdateProfileResponse>>(\n '/zalo-personal/profile/update-profile',\n {\n sessionId: request.sessionId,\n name: request.name,\n dob: request.dob,\n gender: request.gender,\n }\n );\n\n return response;\n }\n\n async getAvatarUrlProfile(\n request: GetAvatarUrlProfileRequest\n ): Promise<AutomationWebResponse<GetAvatarUrlProfileResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.friendIds, 'friendIds');\n\n const response = await this.httpClient.post<AutomationWebResponse<GetAvatarUrlProfileResponse>>(\n '/zalo-personal/profile/get-avatar-url-profile',\n {\n sessionId: request.sessionId,\n friendIds: request.friendIds,\n isAvatarSizeMax: request.isAvatarSizeMax,\n }\n );\n\n return response;\n }\n\n async getFullAvatar(\n request: GetFullAvatarRequest\n ): Promise<AutomationWebResponse<GetFullAvatarResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.friendId, 'friendId');\n\n const response = await this.httpClient.post<AutomationWebResponse<GetFullAvatarResponse>>(\n '/zalo-personal/profile/get-full-avatar',\n {\n sessionId: request.sessionId,\n friendId: request.friendId,\n }\n );\n\n return response;\n }\n\n async getSettings(\n request: GetSettingsRequest\n ): Promise<AutomationWebResponse<GetSettingsResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<GetSettingsResponse>>(\n '/zalo-personal/profile/get-settings',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n async updateSettings(request: UpdateSettingsRequest): Promise<AutomationWebResponse<any>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.type, 'type');\n ValidationUtils.validateRequired(request.value, 'value');\n\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/profile/update-settings',\n {\n sessionId: request.sessionId,\n type: request.type,\n value: request.value,\n }\n );\n\n return response;\n }\n\n async updateLang(request: UpdateLangRequest): Promise<AutomationWebResponse<any>> {\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/profile/update-lang',\n {\n sessionId: request.sessionId,\n language: request.language,\n }\n );\n\n return response;\n }\n}\n","import { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetStickersRequest,\n GetStickersResponse,\n GetStickersDetailRequest,\n GetStickersDetailResponse,\n ParseLinkRequest,\n ParseLinkResponse,\n SearchStickersWithDetailsRequest,\n SearchStickersWithDetailsResponse,\n GetPopularStickersRequest,\n GetPopularStickersResponse,\n} from '../../types/dto/search.types';\n\n/**\n * Zalo Personal Search Service Class\n * 100% khớp với automation-web ZaloSearchController\n */\nexport class SearchService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Tìm sticker theo từ khóa (cải tiến)\n * POST /zalo-personal/search/get-stickers\n *\n * @param request - Search stickers request\n * @returns Promise<AutomationWebResponse<GetStickersResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getStickers({\n * sessionId: \"session-123\",\n * keyword: \"hello\",\n * limit: 20,\n * includeDetails: false\n * });\n *\n * if (result.success) {\n * console.log(`Found ${result.data.total} stickers (returned ${result.data.result.length})`);\n * console.log('Sticker IDs:', result.data.result);\n * if (result.data.details) {\n * console.log('Sticker details:', result.data.details);\n * }\n * }\n * ```\n */\n async getStickers(\n request: GetStickersRequest\n ): Promise<AutomationWebResponse<GetStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersResponse>>(\n '/zalo-personal/search/get-stickers',\n {\n sessionId: request.sessionId,\n keyword: request.keyword,\n limit: request.limit,\n includeDetails: request.includeDetails,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy chi tiết sticker theo IDs\n * POST /zalo-personal/search/get-stickers-detail\n *\n * @param request - Get stickers detail request\n * @returns Promise<AutomationWebResponse<GetStickersDetailResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getStickersDetail({\n * sessionId: \"session-123\",\n * stickerIds: [123, 456, 789]\n * });\n *\n * if (result.success) {\n * result.data.result.forEach(sticker => {\n * console.log(`Sticker ${sticker.id}: ${sticker.name}`);\n * console.log(`Image: ${sticker.imageUrl}`);\n * });\n * }\n * ```\n */\n async getStickersDetail(\n request: GetStickersDetailRequest\n ): Promise<AutomationWebResponse<GetStickersDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersDetailResponse>>(\n '/zalo-personal/search/get-stickers-detail',\n {\n sessionId: request.sessionId,\n stickerIds: request.stickerIds,\n }\n );\n\n return response;\n }\n\n /**\n * Parse thông tin metadata từ URL\n * POST /zalo-personal/search/parse-link\n *\n * @param request - Parse link request\n * @returns Promise<AutomationWebResponse<ParseLinkResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.parseLink({\n * sessionId: \"session-123\",\n * url: \"https://example.com/article\"\n * });\n *\n * if (result.success) {\n * const metadata = result.data.result;\n * console.log('Title:', metadata.title);\n * console.log('Description:', metadata.description);\n * console.log('Image:', metadata.image);\n * console.log('Site:', metadata.siteName);\n * }\n * ```\n */\n async parseLink(request: ParseLinkRequest): Promise<AutomationWebResponse<ParseLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ParseLinkResponse>>(\n '/zalo-personal/search/parse-link',\n {\n sessionId: request.sessionId,\n url: request.url,\n }\n );\n\n return response;\n }\n\n /**\n * Tìm sticker và lấy chi tiết trong một lần gọi (API mới)\n * POST /zalo-personal/search/search-with-details\n *\n * @param request - Search stickers with details request\n * @returns Promise<AutomationWebResponse<SearchStickersWithDetailsResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.searchStickersWithDetails({\n * sessionId: \"session-123\",\n * keyword: \"hello\",\n * limit: 10\n * });\n *\n * if (result.success) {\n * console.log(`Found ${result.data.total} stickers with details in ${result.data.searchTime}ms`);\n * result.data.stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * }\n * ```\n */\n async searchStickersWithDetails(\n request: SearchStickersWithDetailsRequest\n ): Promise<AutomationWebResponse<SearchStickersWithDetailsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SearchStickersWithDetailsResponse>>(\n '/zalo-personal/search/search-with-details',\n {\n sessionId: request.sessionId,\n keyword: request.keyword,\n limit: request.limit,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách sticker phổ biến (API mới)\n * POST /zalo-personal/search/popular-stickers\n *\n * @param request - Get popular stickers request\n * @returns Promise<AutomationWebResponse<GetPopularStickersResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getPopularStickers({\n * sessionId: \"session-123\",\n * limit: 20,\n * categoryId: 1\n * });\n *\n * if (result.success) {\n * console.log(`Retrieved ${result.data.stickers.length} popular stickers`);\n * result.data.stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * }\n * ```\n */\n async getPopularStickers(\n request: GetPopularStickersRequest\n ): Promise<AutomationWebResponse<GetPopularStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPopularStickersResponse>>(\n '/zalo-personal/search/popular-stickers',\n {\n sessionId: request.sessionId,\n limit: request.limit,\n categoryId: request.categoryId,\n }\n );\n\n return response;\n }\n\n // ==================== CONVENIENCE METHODS ====================\n\n /**\n * Tìm stickers và lấy chi tiết (convenience method - sử dụng API mới)\n * Sử dụng API mới search-with-details thay vì gọi 2 API riêng biệt\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 10)\n * @returns Promise với sticker details\n *\n * @example\n * ```typescript\n * const stickers = await searchService.searchStickersWithDetailsConvenience(\n * \"session-123\",\n * \"hello\",\n * 10\n * );\n *\n * stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * ```\n */\n async searchStickersWithDetailsConvenience(\n sessionId: string,\n keyword: string,\n limit: number = 10\n ): Promise<SearchStickersWithDetailsResponse['stickers']> {\n const result = await this.searchStickersWithDetails({\n sessionId,\n keyword,\n limit,\n });\n\n if (!result.result?.stickers) {\n return [];\n }\n\n return result.result.stickers;\n }\n\n /**\n * Tìm stickers và lấy chi tiết (legacy method - backward compatibility)\n * Sử dụng cách cũ: gọi getStickers + getStickersDetail\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @returns Promise với sticker details\n *\n * @deprecated Sử dụng searchStickersWithDetailsConvenience() thay thế\n */\n async searchStickersWithDetailsLegacy(\n sessionId: string,\n keyword: string\n ): Promise<GetStickersDetailResponse['result']> {\n // Step 1: Search for stickers\n const searchResult = await this.getStickers({ sessionId, keyword });\n\n if (!searchResult.result?.result?.length) {\n return [];\n }\n\n // Step 2: Get details for found stickers\n const detailResult = await this.getStickersDetail({\n sessionId,\n stickerIds: searchResult.result.result,\n });\n\n if (!detailResult.result?.result) {\n return [];\n }\n\n return detailResult.result.result;\n }\n\n /**\n * Batch parse multiple links\n * Parse nhiều links cùng lúc\n *\n * @param sessionId - Session ID\n * @param urls - Array of URLs to parse\n * @returns Promise với array of parsed metadata\n *\n * @example\n * ```typescript\n * const results = await searchService.parseMultipleLinks(\n * \"session-123\",\n * [\"https://example1.com\", \"https://example2.com\"]\n * );\n *\n * results.forEach((metadata, index) => {\n * if (metadata) {\n * console.log(`Link ${index + 1}: ${metadata.title}`);\n * }\n * });\n * ```\n */\n async parseMultipleLinks(\n sessionId: string,\n urls: string[]\n ): Promise<(ParseLinkResponse['result'] | null)[]> {\n const promises = urls.map(async url => {\n try {\n const result = await this.parseLink({ sessionId, url });\n return result.result?.result || null;\n } catch (error) {\n console.warn(`Failed to parse link ${url}:`, error);\n return null;\n }\n });\n\n return Promise.all(promises);\n }\n\n /**\n * Lấy sticker phổ biến (convenience method)\n *\n * @param sessionId - Session ID\n * @param limit - Số lượng sticker (default: 20)\n * @param categoryId - Category ID để lọc (optional)\n * @returns Promise với popular stickers\n *\n * @example\n * ```typescript\n * const stickers = await searchService.getPopularStickersConvenience(\n * \"session-123\",\n * 20,\n * 1\n * );\n *\n * stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * ```\n */\n async getPopularStickersConvenience(\n sessionId: string,\n limit: number = 20,\n categoryId?: number\n ): Promise<GetPopularStickersResponse['stickers']> {\n const result = await this.getPopularStickers({\n sessionId,\n limit,\n categoryId,\n });\n\n if (!result.result?.stickers) {\n return [];\n }\n\n return result.result.stickers;\n }\n\n /**\n * Tìm kiếm sticker nhanh (chỉ trả về IDs)\n * Sử dụng API cải tiến với includeDetails = false\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 20)\n * @returns Promise với sticker IDs\n *\n * @example\n * ```typescript\n * const stickerIds = await searchService.quickSearchStickers(\n * \"session-123\",\n * \"hello\",\n * 20\n * );\n *\n * console.log('Found sticker IDs:', stickerIds);\n * ```\n */\n async quickSearchStickers(\n sessionId: string,\n keyword: string,\n limit: number = 20\n ): Promise<number[]> {\n const result = await this.getStickers({\n sessionId,\n keyword,\n limit,\n includeDetails: false,\n });\n\n if (!result.result?.result) {\n return [];\n }\n\n return result.result.result;\n }\n\n /**\n * Tìm kiếm sticker với chi tiết và metadata đầy đủ\n * Trả về response đầy đủ bao gồm metadata như searchTime, total, etc.\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 10)\n * @returns Promise với full search response\n *\n * @example\n * ```typescript\n * const response = await searchService.fullSearchStickers(\n * \"session-123\",\n * \"hello\",\n * 10\n * );\n *\n * console.log(`Found ${response.total} stickers in ${response.searchTime}ms`);\n * console.log('Stickers:', response.stickers);\n * ```\n */\n async fullSearchStickers(\n sessionId: string,\n keyword: string,\n limit: number = 10\n ): Promise<SearchStickersWithDetailsResponse | null> {\n const result = await this.searchStickersWithDetails({\n sessionId,\n keyword,\n limit,\n });\n\n return result.result || null;\n }\n}\n","/**\r\n * Session Proxy service for managing proxy assignments to sessions\r\n */\r\n\r\nimport { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n AssignProxyToSessionRequest,\r\n AssignProxyToSessionResponse,\r\n} from '../../types/dto/session-proxy.type';\r\n\r\n/**\r\n * Session Proxy service class\r\n */\r\nexport class SessionProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n /**\r\n * Assign proxy cho session và kích hoạt lại instance với proxy mới\r\n *\r\n * Flow:\r\n * 1. Kiểm tra session và proxy tồn tại\r\n * 2. Cập nhật proxy cho session trong database\r\n * 3. Dừng listener cũ (nếu đang chạy)\r\n * 4. Xóa instance cũ khỏi instance manager\r\n * 5. Tạo instance mới với proxy được chỉ định\r\n * 6. Khởi động listener mới với proxy\r\n *\r\n * @param request - Session ID và Proxy ID\r\n * @returns Response với thông tin assign proxy\r\n * @throws Error nếu session chưa đăng nhập hoặc proxy không khả dụng\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = await sessionProxyService.assignProxyToSession({\r\n * sessionId: 'session-175ae5b3-7c5c-4ee4-991f-67dc63156736',\r\n * proxyId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\r\n * });\r\n *\r\n * if (result.code === 200 && result.result?.success) {\r\n * console.log('Proxy đã được gắn thành công:', result.result.message);\r\n * } else {\r\n * console.error('Gắn proxy thất bại:', result.error || result.message);\r\n * }\r\n * ```\r\n */\r\n async assignProxyToSession(\r\n request: AssignProxyToSessionRequest\r\n ): Promise<AutomationWebResponse<AssignProxyToSessionResponse>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<AssignProxyToSessionResponse>\r\n >('/proxy/session/assign', {\r\n sessionId: request.sessionId,\r\n proxyId: request.proxyId,\r\n });\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport { ScrapeZaloMeRequest, ScrapeZaloMeResult } from '../../types/dto/zalo-me.type';\r\n\r\nexport class ZaloMeService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async scrape(request: ScrapeZaloMeRequest): Promise<AutomationWebResponse<ScrapeZaloMeResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ScrapeZaloMeResult>>(\r\n '/zalo-me/scrape',\r\n {\r\n sessionId: request.sessionId,\r\n url: request.url,\r\n timeoutMs: request.timeoutMs,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport {\r\n AddPollOptionsRequest,\r\n AddPollOptionsResponse,\r\n CreatePollRequest,\r\n GetPollDetailRequest,\r\n LockPollRequest,\r\n PollDetailResponse,\r\n SharePollRequest,\r\n VotePollRequest,\r\n VotePollResponse,\r\n} from '../../types/dto/zalo-poll.type';\r\n\r\nexport class ZaloPollService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async createPoll(request: CreatePollRequest): Promise<PollDetailResponse> {\r\n const response = await this.httpClient.post<PollDetailResponse>('/zalo-poll/create', {\r\n sessionId: request.sessionId,\r\n groupId: request.groupId,\r\n question: request.question,\r\n options: request.options,\r\n expiredTime: request.expiredTime,\r\n allowMultiChoices: request.allowMultiChoices,\r\n allowAddNewOption: request.allowAddNewOption,\r\n hideVotePreview: request.hideVotePreview,\r\n isAnonymous: request.isAnonymous,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async votePoll(request: VotePollRequest): Promise<VotePollResponse> {\r\n const response = await this.httpClient.post<VotePollResponse>('/zalo-poll/vote', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n optionIds: request.optionIds,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async addPollOptions(request: AddPollOptionsRequest): Promise<AddPollOptionsResponse> {\r\n const response = await this.httpClient.post<AddPollOptionsResponse>('/zalo-poll/add-options', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n newOptions: request.newOptions,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async getPollDetail(request: GetPollDetailRequest): Promise<PollDetailResponse> {\r\n const response = await this.httpClient.post<PollDetailResponse>('/zalo-poll/detail', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async lockPoll(request: LockPollRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-poll/lock', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async sharePoll(request: SharePollRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-poll/share', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n CustomRequest,\r\n CustomResponse,\r\n GetContextRequest,\r\n GetContextResponse,\r\n GetCookieRequest,\r\n GetCookieResponse,\r\n KeepAliveRequest,\r\n KeepAliveResponse,\r\n} from '../../types/dto/zalo-utils.type';\r\n\r\nexport class ZaloUtilsService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async getContext(request: GetContextRequest): Promise<AutomationWebResponse<GetContextResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetContextResponse>>(\r\n '/zalo-personal/utils/context',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getCookie(request: GetCookieRequest): Promise<AutomationWebResponse<GetCookieResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetCookieResponse>>(\r\n '/zalo-personal/utils/cookie',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async keepAlive(request: KeepAliveRequest): Promise<AutomationWebResponse<KeepAliveResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<KeepAliveResponse>>(\r\n '/zalo-personal/utils/keep-alive',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async custom(request: CustomRequest): Promise<AutomationWebResponse<CustomResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<CustomResponse>>(\r\n '/zalo-personal/utils/custom',\r\n {\r\n sessionId: request.sessionId,\r\n name: request.name,\r\n props: request.props,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n BulkImportProxyRequest,\r\n BulkImportResult,\r\n CreateProxyRequest,\r\n DisableProxyRequest,\r\n ProxyFilterRequest,\r\n ProxyListResponse,\r\n ProxyResponse,\r\n ProxyStatsResponse,\r\n TestRedaiApiResult,\r\n UpdateProxyRequest,\r\n VerifyProxyIpResult,\r\n} from '../../types/dto/proxy.type';\r\n\r\nexport class ProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async create(request: CreateProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>('/proxy', request);\r\n return response;\r\n }\r\n\r\n async findAll(filter?: ProxyFilterRequest): Promise<AutomationWebResponse<ProxyListResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyListResponse>>('/proxy', filter as any);\r\n return response;\r\n }\r\n\r\n async findAvailable(): Promise<AutomationWebResponse<ProxyResponse[]>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse[]>>('/proxy/available');\r\n return response;\r\n }\r\n\r\n async getStats(): Promise<AutomationWebResponse<ProxyStatsResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyStatsResponse>>('/proxy/stats');\r\n return response;\r\n }\r\n\r\n async bulkImport(request: BulkImportProxyRequest): Promise<AutomationWebResponse<BulkImportResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<BulkImportResult>>(\r\n '/proxy/bulk-import',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async findById(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}`);\r\n return response;\r\n }\r\n\r\n async update(id: string, request: UpdateProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.put<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}`, request);\r\n return response;\r\n }\r\n\r\n async delete(id: string): Promise<AutomationWebResponse<null>> {\r\n const response = await this.httpClient.delete<AutomationWebResponse<null>>(`/proxy/${id}`);\r\n return response;\r\n }\r\n\r\n async enable(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/enable`);\r\n return response;\r\n }\r\n\r\n async disable(id: string, request: DisableProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/disable`, request);\r\n return response;\r\n }\r\n\r\n async ban(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/ban`);\r\n return response;\r\n }\r\n\r\n async verifyIp(id: string): Promise<AutomationWebResponse<VerifyProxyIpResult>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<VerifyProxyIpResult>>(`/proxy/${id}/verify-ip`);\r\n return response;\r\n }\r\n\r\n async testRedaiApi(id: string): Promise<AutomationWebResponse<TestRedaiApiResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<TestRedaiApiResult>>(`/proxy/${id}/test-redai-api`);\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n BulkImportProxyRequest,\r\n BulkImportResult,\r\n CreateProxyRequest,\r\n DisableProxyRequest,\r\n ProxyFilterRequest,\r\n ProxyListResponse,\r\n ProxyResponse,\r\n ProxyStatsResponse,\r\n UpdateProxyRequest,\r\n} from '../../types/dto/proxy.type';\r\n\r\nexport class UserProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n private buildHeaders(userId: number | string): Record<string, string> {\r\n return { 'x-user-id': String(userId) };\r\n }\r\n\r\n async create(\r\n userId: number | string,\r\n request: CreateProxyRequest\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\r\n '/user/proxy',\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findAll(\r\n userId: number | string,\r\n filter?: ProxyFilterRequest\r\n ): Promise<AutomationWebResponse<ProxyListResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyListResponse>>(\r\n '/user/proxy',\r\n filter as any,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findAvailable(userId: number | string): Promise<AutomationWebResponse<ProxyResponse[]>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse[]>>(\r\n '/user/proxy/available',\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getStats(userId: number | string): Promise<AutomationWebResponse<ProxyStatsResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyStatsResponse>>(\r\n '/user/proxy/stats',\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async bulkImport(\r\n userId: number | string,\r\n request: BulkImportProxyRequest\r\n ): Promise<AutomationWebResponse<BulkImportResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<BulkImportResult>>(\r\n '/user/proxy/bulk-import',\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findById(\r\n userId: number | string,\r\n id: string\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async update(\r\n userId: number | string,\r\n id: string,\r\n request: UpdateProxyRequest\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.put<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}`,\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async delete(userId: number | string, id: string): Promise<AutomationWebResponse<null>> {\r\n const response = await this.httpClient.delete<AutomationWebResponse<null>>(\r\n `/user/proxy/${id}`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async enable(userId: number | string, id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}/enable`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async disable(\n userId: number | string,\n id: string,\n request: DisableProxyRequest\n ): Promise<AutomationWebResponse<ProxyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\n `/user/proxy/${id}/disable`,\n request,\n this.buildHeaders(userId)\n );\n\n return response;\n }\n}\n","import { HttpClient } from '../../utils/http.utils';\r\nimport {\r\n CatalogMutationResponse,\r\n CreateCatalogRequest,\r\n CreateNoteRequest,\r\n CreateProductCatalogRequest,\r\n CreateReminderRequest,\r\n CreateReminderResponse,\r\n DeleteCatalogRequest,\r\n DeleteProductCatalogRequest,\r\n DeleteProductCatalogResponse,\r\n EditNoteRequest,\r\n EditReminderRequest,\r\n EditReminderResponse,\r\n GetCatalogListRequest,\r\n GetCatalogListResponse,\r\n GetListBoardRequest,\r\n GetListBoardResponse,\r\n GetListReminderRequest,\r\n GetListReminderResponse,\r\n GetProductCatalogListRequest,\r\n GetProductCatalogListResponse,\r\n GetReminderRequest,\r\n GetReminderResponse,\r\n GetReminderResponsesRequest,\r\n GetReminderResponsesResponse,\r\n NoteDetailResponse,\r\n ProductCatalogMutationResponse,\r\n RemoveReminderRequest,\r\n RemoveReminderResponse,\r\n UpdateCatalogRequest,\r\n UpdateProductCatalogRequest,\r\n} from '../../types/dto/zalo-tool.type';\r\n\r\nexport class ZaloToolService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async createCatalog(request: CreateCatalogRequest): Promise<CatalogMutationResponse> {\r\n const response = await this.httpClient.post<CatalogMutationResponse>('/zalo-tool/catalog/create', request);\r\n return response;\r\n }\r\n\r\n async deleteCatalog(request: DeleteCatalogRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-tool/catalog/delete', request);\r\n return response;\r\n }\r\n\r\n async updateCatalog(request: UpdateCatalogRequest): Promise<CatalogMutationResponse> {\r\n const response = await this.httpClient.post<CatalogMutationResponse>('/zalo-tool/catalog/update', request);\r\n return response;\r\n }\r\n\r\n async getCatalogList(request: GetCatalogListRequest): Promise<GetCatalogListResponse> {\r\n const response = await this.httpClient.post<GetCatalogListResponse>('/zalo-tool/catalog/list', request);\r\n return response;\r\n }\r\n\r\n async createProductCatalog(\r\n request: CreateProductCatalogRequest\r\n ): Promise<ProductCatalogMutationResponse> {\r\n const response = await this.httpClient.post<ProductCatalogMutationResponse>(\r\n '/zalo-tool/product-catalog/create',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async deleteProductCatalog(\r\n request: DeleteProductCatalogRequest\r\n ): Promise<DeleteProductCatalogResponse> {\r\n const response = await this.httpClient.post<DeleteProductCatalogResponse>(\r\n '/zalo-tool/product-catalog/delete',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async updateProductCatalog(\r\n request: UpdateProductCatalogRequest\r\n ): Promise<ProductCatalogMutationResponse> {\r\n const response = await this.httpClient.post<ProductCatalogMutationResponse>(\r\n '/zalo-tool/product-catalog/update',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async getProductCatalogList(\r\n request: GetProductCatalogListRequest\r\n ): Promise<GetProductCatalogListResponse> {\r\n const response = await this.httpClient.post<GetProductCatalogListResponse>(\r\n '/zalo-tool/product-catalog/list',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async createNote(request: CreateNoteRequest): Promise<NoteDetailResponse> {\r\n const response = await this.httpClient.post<NoteDetailResponse>('/zalo-tool/note/create', request);\r\n return response;\r\n }\r\n\r\n async editNote(request: EditNoteRequest): Promise<NoteDetailResponse> {\r\n const response = await this.httpClient.post<NoteDetailResponse>('/zalo-tool/note/edit', request);\r\n return response;\r\n }\r\n\r\n async createReminder(request: CreateReminderRequest): Promise<CreateReminderResponse> {\r\n const response = await this.httpClient.post<CreateReminderResponse>('/zalo-tool/reminder/create', request);\r\n return response;\r\n }\r\n\r\n async editReminder(request: EditReminderRequest): Promise<EditReminderResponse> {\r\n const response = await this.httpClient.post<EditReminderResponse>('/zalo-tool/reminder/edit', request);\r\n return response;\r\n }\r\n\r\n async getListReminder(request: GetListReminderRequest): Promise<GetListReminderResponse> {\r\n const response = await this.httpClient.post<GetListReminderResponse>('/zalo-tool/reminder/list', request);\r\n return response;\r\n }\r\n\r\n async getReminder(request: GetReminderRequest): Promise<GetReminderResponse> {\r\n const response = await this.httpClient.post<GetReminderResponse>('/zalo-tool/reminder/detail', request);\r\n return response;\r\n }\r\n\r\n async getReminderResponses(\r\n request: GetReminderResponsesRequest\r\n ): Promise<GetReminderResponsesResponse> {\r\n const response = await this.httpClient.post<GetReminderResponsesResponse>(\r\n '/zalo-tool/reminder/responses',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async removeReminder(request: RemoveReminderRequest): Promise<RemoveReminderResponse> {\r\n const response = await this.httpClient.post<RemoveReminderResponse>('/zalo-tool/reminder/delete', request);\r\n return response;\r\n }\r\n\r\n async getListBoard(request: GetListBoardRequest): Promise<GetListBoardResponse> {\r\n const response = await this.httpClient.post<GetListBoardResponse>('/zalo-tool/board/list', request);\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\nimport {\n HealthCheckResponse,\n LivenessResponse,\n ReadinessResponse,\n} from '../../types/dto/health.type';\n\n/**\n * Health check service\n */\nexport class HealthService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Check application health\n * GET /health\n */\n async checkHealth(): Promise<HealthCheckResponse> {\n const response = await this.httpClient.get<HealthCheckResponse>('/health');\n return response;\n }\n\n /**\n * Liveness probe\n * GET /health/liveness\n */\n async liveness(): Promise<LivenessResponse> {\n const response = await this.httpClient.get<LivenessResponse>('/health/liveness');\n return response;\n }\n\n /**\n * Readiness probe\n * GET /health/readiness\n */\n async readiness(): Promise<ReadinessResponse> {\n const response = await this.httpClient.get<ReadinessResponse>('/health/readiness');\n return response;\n }\n}\r\n","import { HttpClient } from '../../utils/http.utils';\nimport {\n InstanceManagerStats,\n InstanceManagerSessionsResponse,\n InstanceManagerInstanceDataResponse,\n InstanceManagerListeningResponse,\n InstanceManagerCleanupResult,\n InstanceManagerRemoveResult,\n} from '../../types/dto/instance-manager.type';\n\n/**\n * Instance manager service\n */\nexport class InstanceManagerService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Get instance statistics\n * GET /instance-manager/stats\n */\n async getStats(): Promise<InstanceManagerStats> {\n const response = await this.httpClient.get<InstanceManagerStats>('/instance-manager/stats');\n return response;\n }\n\n /**\n * Get all active session IDs\n * GET /instance-manager/sessions\n */\n async getAllSessions(): Promise<InstanceManagerSessionsResponse> {\n const response = await this.httpClient.get<InstanceManagerSessionsResponse>(\n '/instance-manager/sessions'\n );\n return response;\n }\n\n /**\n * Get instance data for a session\n * GET /instance-manager/sessions/:sessionId\n */\n async getInstanceData(sessionId: string): Promise<InstanceManagerInstanceDataResponse> {\n const response = await this.httpClient.get<InstanceManagerInstanceDataResponse>(\n `/instance-manager/sessions/${sessionId}`\n );\n return response;\n }\n\n /**\n * Check if instance is listening\n * GET /instance-manager/sessions/:sessionId/listening\n */\n async isListening(sessionId: string): Promise<InstanceManagerListeningResponse> {\n const response = await this.httpClient.get<InstanceManagerListeningResponse>(\n `/instance-manager/sessions/${sessionId}/listening`\n );\n return response;\n }\n\n /**\n * Force cleanup expired instances\n * POST /instance-manager/cleanup\n */\n async cleanupExpired(): Promise<InstanceManagerCleanupResult> {\n const response = await this.httpClient.post<InstanceManagerCleanupResult>(\n '/instance-manager/cleanup',\n {}\n );\n return response;\n }\n\n /**\n * Remove specific instance\n * DELETE /instance-manager/sessions/:sessionId\n */\n async removeInstance(sessionId: string): Promise<InstanceManagerRemoveResult> {\n const response = await this.httpClient.delete<InstanceManagerRemoveResult>(\n `/instance-manager/sessions/${sessionId}`\n );\n return response;\n }\n\n /**\n * Force cleanup all instances\n * DELETE /instance-manager/all\n */\n async cleanupAll(): Promise<InstanceManagerCleanupResult> {\n const response = await this.httpClient.delete<InstanceManagerCleanupResult>(\n '/instance-manager/all'\n );\n return response;\n }\n}\r\n","/**\n * Main SDK client for automation-web API\n */\n\nimport { HttpClient } from '../utils/http.utils';\nimport { ValidationUtils } from '../utils/validation.utils';\nimport { EventManager } from '../utils/event.utils';\nimport { AutomationWebConfig, DEFAULT_CONFIG } from '../types/common.types';\nimport { WebhookEvent, WebhookEventHandler, ZaloWebhookEventType } from '../types/webhook.types';\nimport {\n Message,\n Typing,\n Reaction,\n SeenMessage,\n DeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n} from '../types/webhook';\n\n// Import services\nimport { AuthService } from '../services/auth/auth.service';\nimport { MessagingService } from '../services/messaging/messaging.service';\nimport { AdvancedMessagingService } from '../services/advanced-messaging/advanced-messaging.service';\nimport { WebhookService } from '../services/webhook/webhook.service';\nimport { GroupService } from '../services/groups/groups.service';\nimport { FriendService } from '../services/friends/friends.service';\nimport { UserInfoService } from '../services/user-info/user-info.service';\nimport { ProfileService } from '../services/profile/profile.service';\nimport { SearchService } from '../services/search/search.service';\nimport { SessionProxyService } from '../services/session-proxy/session-proxy.service';\nimport { ZaloMeService } from '../services/zalo-me/zalo-me.service';\nimport { ZaloPollService } from '../services/zalo-poll/zalo-poll.service';\nimport { ZaloUtilsService } from '../services/zalo-utils/zalo-utils.service';\nimport { ProxyService } from '../services/proxy/proxy.service';\nimport { UserProxyService } from '../services/user-proxy/user-proxy.service';\nimport { ZaloToolService } from '../services/zalo-tool/zalo-tool.service';\nimport { HealthService } from '../services/health/health.service';\nimport { InstanceManagerService } from '../services/instance-manager/instance-manager.service';\n\n/**\n * Main automation-web SDK client\n */\nexport class AutomationWebClient {\n private httpClient: HttpClient;\n private eventManager: EventManager;\n private config: AutomationWebConfig;\n\n // Service instances\n private _auth: AuthService;\n private _messaging: MessagingService;\n private _advancedMessaging: AdvancedMessagingService;\n private _webhook: WebhookService;\n private _groups: GroupService;\n private _friends: FriendService;\n private _userInfo: UserInfoService;\n private _profile: ProfileService;\n private _search: SearchService;\n private _sessionProxy: SessionProxyService;\n private _zaloMe: ZaloMeService;\n private _zaloPoll: ZaloPollService;\n private _zaloUtils: ZaloUtilsService;\n private _proxy: ProxyService;\n private _userProxy: UserProxyService;\n private _zaloTool: ZaloToolService;\n private _health: HealthService;\n private _instanceManager: InstanceManagerService;\n\n constructor(config: Partial<AutomationWebConfig>) {\n // Merge with default config\n this.config = { ...DEFAULT_CONFIG, ...config };\n\n // Validate configuration\n ValidationUtils.validateConfig(this.config);\n\n // Initialize HTTP client\n this.httpClient = new HttpClient(this.config);\n\n // Initialize event manager\n this.eventManager = new EventManager();\n\n // Initialize services\n this._auth = new AuthService(this.httpClient);\n this._messaging = new MessagingService(this.httpClient);\n this._advancedMessaging = new AdvancedMessagingService(this.httpClient);\n this._webhook = new WebhookService(this.httpClient);\n this._groups = new GroupService(this.httpClient);\n this._friends = new FriendService(this.httpClient);\n this._userInfo = new UserInfoService(this.httpClient);\n this._profile = new ProfileService(this.httpClient);\n this._search = new SearchService(this.httpClient);\n this._sessionProxy = new SessionProxyService(this.httpClient);\n this._zaloMe = new ZaloMeService(this.httpClient);\n this._zaloPoll = new ZaloPollService(this.httpClient);\n this._zaloUtils = new ZaloUtilsService(this.httpClient);\n this._proxy = new ProxyService(this.httpClient);\n this._userProxy = new UserProxyService(this.httpClient);\n this._zaloTool = new ZaloToolService(this.httpClient);\n this._health = new HealthService(this.httpClient);\n this._instanceManager = new InstanceManagerService(this.httpClient);\n\n // Setup error handling\n this.setupErrorHandling();\n }\n\n /**\n * Get authentication service\n */\n get auth(): AuthService {\n return this._auth;\n }\n\n /**\n * Get messaging service\n */\n get messaging(): MessagingService {\n return this._messaging;\n }\n\n /**\n * Get advanced messaging service\n */\n get advancedMessaging(): AdvancedMessagingService {\n return this._advancedMessaging;\n }\n\n /**\n * Get groups service\n */\n get groups(): GroupService {\n return this._groups;\n }\n\n /**\n * Get friends service\n */\n get friends(): FriendService {\n return this._friends;\n }\n\n /**\n * Get user info service\n */\n get userInfo(): UserInfoService {\n return this._userInfo;\n }\n\n /**\n * Get profile service\n */\n get profile(): ProfileService {\n return this._profile;\n }\n\n /**\n * Get webhook service\n */\n get webhook(): WebhookService {\n return this._webhook;\n }\n\n /**\n * Get search service\n */\n get search(): SearchService {\n return this._search;\n }\n\n\n /**\n * Get session proxy service\n */\n get sessionProxy(): SessionProxyService {\n return this._sessionProxy;\n }\n\n get zaloMe(): ZaloMeService {\n return this._zaloMe;\n }\n\n get zaloPoll(): ZaloPollService {\n return this._zaloPoll;\n }\n\n get zaloUtils(): ZaloUtilsService {\n return this._zaloUtils;\n }\n\n get proxy(): ProxyService {\n return this._proxy;\n }\n\n get userProxy(): UserProxyService {\n return this._userProxy;\n }\n\n get zaloTool(): ZaloToolService {\n return this._zaloTool;\n }\n\n get health(): HealthService {\n return this._health;\n }\n\n get instanceManager(): InstanceManagerService {\n return this._instanceManager;\n }\n\n /**\n * Register webhook event handler\n */\n onEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.addHandler(eventType, handler);\n return this;\n }\n\n /**\n * Register one-time webhook event handler\n */\n onceEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.addOnceHandler(eventType, handler);\n return this;\n }\n\n /**\n * Remove webhook event handler\n */\n offEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.removeHandler(eventType, handler);\n return this;\n }\n\n /**\n * Remove all handlers for event type\n */\n removeAllEventListeners(eventType?: ZaloWebhookEventType | string): this {\n this.eventManager.removeAllListeners(eventType);\n return this;\n }\n\n /**\n * Process incoming webhook event\n */\n async processWebhookEvent(event: WebhookEvent): Promise<void> {\n await this.eventManager.emitAsync(event.eventType, event);\n }\n\n /**\n * Convenience methods for common events\n */\n\n /**\n * Listen for message received events\n */\n onMessageReceived(handler: WebhookEventHandler): this {\n // Listen for all message received events\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message sent events\n */\n onMessageSent(handler: WebhookEventHandler): this {\n // Listen for all message sent events\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for typing events\n */\n onTyping(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message seen events\n */\n onMessageSeen(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message reaction events\n */\n onMessageReaction(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for friend events\n */\n onFriendAdded(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.FRIEND_EVENT_ADD, handler);\n }\n\n /**\n * Listen for group events\n */\n onGroupMemberAdded(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.GROUP_EVENT_JOIN, handler);\n }\n\n /**\n * Listen for connection events\n */\n onConnectionLost(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED, handler);\n }\n\n /**\n * Listen for error events\n */\n onError(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.ERROR_SYSTEM, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_NETWORK, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_AUTHENTICATION, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_VALIDATION, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_BUSINESS_LOGIC, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_UNKNOWN, handler);\n return this;\n }\n\n // ==================== TYPED EVENT HANDLERS ====================\n\n /**\n * Listen for typed message events\n */\n onTypedMessage(handler: (message: Message) => void): this {\n // Convert generic webhook events to typed Message events\n this.onMessageReceived(event => {\n // Here you would parse the event data into Message type\n // For now, we'll pass the raw event data\n handler(event.eventData as unknown as Message);\n });\n return this;\n }\n\n /**\n * Listen for typing events\n */\n onTypedTyping(handler: (typing: Typing) => void): this {\n this.onEvent('typing', event => {\n handler(event.eventData as unknown as Typing);\n });\n return this;\n }\n\n /**\n * Listen for typed reaction events\n */\n onTypedReaction(handler: (reaction: Reaction) => void): this {\n this.onMessageReaction(event => {\n handler(event.eventData as unknown as Reaction);\n });\n return this;\n }\n\n /**\n * Listen for typed seen message events\n */\n onTypedMessageSeen(handler: (seenMessage: SeenMessage) => void): this {\n this.onMessageSeen(event => {\n handler(event.eventData as unknown as SeenMessage);\n });\n return this;\n }\n\n /**\n * Listen for typed delivered message events\n */\n onTypedMessageDelivered(handler: (deliveredMessage: DeliveredMessage) => void): this {\n this.onEvent('message_delivered', event => {\n handler(event.eventData as unknown as DeliveredMessage);\n });\n return this;\n }\n\n /**\n * Listen for typed friend events\n */\n onTypedFriendEvent(handler: (friendEvent: FriendEvent) => void): this {\n this.onFriendAdded(event => {\n handler(event.eventData as unknown as FriendEvent);\n });\n return this;\n }\n\n /**\n * Listen for typed group events\n */\n onTypedGroupEvent(handler: (groupEvent: GroupEvent) => void): this {\n this.onGroupMemberAdded(event => {\n handler(event.eventData as unknown as GroupEvent);\n });\n return this;\n }\n\n /**\n * Listen for typed undo events\n */\n onTypedUndo(handler: (undo: Undo) => void): this {\n this.onEvent('message_undo', event => {\n handler(event.eventData as unknown as Undo);\n });\n return this;\n }\n\n /**\n * Update SDK configuration\n */\n updateConfig(newConfig: Partial<AutomationWebConfig>): void {\n this.config = { ...this.config, ...newConfig };\n ValidationUtils.validateConfig(this.config);\n this.httpClient.updateConfig(this.config);\n }\n\n /**\n * Get current configuration\n */\n getConfig(): AutomationWebConfig {\n return { ...this.config };\n }\n\n /**\n * Get SDK version\n */\n getVersion(): string {\n return '1.9.8';\n }\n\n /**\n * Test connection to automation-web API\n */\n async testConnection(): Promise<boolean> {\n try {\n await this.httpClient.get('/health');\n return true;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Get API health status\n */\n async getHealthStatus(): Promise<{\n status: 'healthy' | 'unhealthy';\n timestamp: string;\n version?: string;\n uptime?: number;\n }> {\n try {\n const response = await this.httpClient.get<{\n status: string;\n timestamp: string;\n version?: string;\n uptime?: number;\n }>('/health');\n\n return {\n status: response.status === 'ok' ? 'healthy' : 'unhealthy',\n timestamp: response.timestamp,\n version: response.version,\n uptime: response.uptime,\n };\n } catch (error) {\n return {\n status: 'unhealthy',\n timestamp: new Date().toISOString(),\n };\n }\n }\n\n /**\n * Setup error handling\n */\n private setupErrorHandling(): void {\n // Handle internal errors using EventEmitter's built-in error event\n (this.eventManager as any).addListener('error', (error: Error) => {\n if (this.config.logging) {\n console.error('[AutomationWebClient] Error occurred:', error.message);\n }\n });\n }\n\n /**\n * Cleanup resources\n */\n destroy(): void {\n this.eventManager.removeAllListeners();\n }\n}\n","/**\n * Authentication related types and interfaces\n */\n\n/**\n * Session status enum - Chuẩn theo automation-web controller\n */\nexport enum SessionStatus {\n PENDING = 'pending',\n SCANNING = 'scanning',\n SUCCESS = 'success',\n FAILED = 'failed',\n EXPIRED = 'expired',\n QR_EXPIRED = 'qr_expired',\n}\n\n/**\n * Zalo credentials for login - Chuẩn theo automation-web shared types\n */\nexport interface ZaloCredentials {\n /**\n * Cookie array from browser - as received from SDK login\n */\n cookie: Array<Record<string, unknown>>;\n\n /**\n * Device IMEI\n */\n imei: string;\n\n /**\n * Browser user agent\n */\n userAgent: string;\n\n /**\n * Language preference\n * @default 'vi'\n */\n language?: string;\n}\n\n/**\n * Zalo user data - Chuẩn theo automation-web shared types\n */\nexport interface ZaloUserData {\n /**\n * Zalo platform user ID (stringified number)\n */\n userId: string;\n\n /**\n * Display name\n */\n displayName: string;\n\n /**\n * Avatar URL\n */\n avatar: string;\n\n /**\n * Optional details, may be absent depending on SDK method\n */\n username?: string;\n\n /**\n * Phone number (if available)\n */\n phoneNumber?: string;\n\n /**\n * Gender (0/1)\n */\n gender?: number;\n\n /**\n * Status\n */\n status?: string;\n\n /**\n * Cover image URL\n */\n cover?: string;\n\n /**\n * Global ID\n */\n globalId?: string;\n\n /**\n * Is active (0/1)\n */\n isActive?: number;\n\n /**\n * Last action time (epoch millis)\n */\n lastActionTime?: number;\n\n /**\n * Created timestamp (epoch seconds)\n */\n createdTs?: number;\n\n /**\n * Email (rarely present)\n */\n email?: string;\n\n /**\n * Additional properties\n */\n [key: string]: unknown;\n}\n\n/**\n * QR Login Options - Tùy chọn cho QR login\n */\nexport interface QRLoginOptions {\n /**\n * Thời gian timeout cho QR code (giây)\n * @default 120\n * @min 30\n * @max 300\n */\n timeout?: number;\n\n /**\n * Tự động đăng nhập sau khi quét QR\n * @default true\n */\n autoLogin?: boolean;\n\n /**\n * ID của proxy muốn sử dụng (nếu muốn chỉ định cụ thể)\n */\n proxyId?: string;\n\n /**\n * Region của proxy muốn sử dụng (nếu không chỉ định proxyId)\n */\n proxyRegion?: string;\n}\n\n/**\n * QR Code login request - Chuẩn theo automation-web QRLoginRequestDto\n */\nexport interface QRLoginRequest {\n /**\n * ID của user tạo session (userId từ redai-v201-be-app)\n */\n createdBy?: number | string;\n\n /**\n * @deprecated Dùng createdBy (number) thay thế\n */\n userUuid?: string;\n\n workspaceId: string;\n\n baseId?: string;\n\n /**\n * Session ID tùy chọn, sẽ auto-generate nếu không cung cấp\n */\n sessionId?: string;\n\n /**\n * Tùy chọn cho QR login\n */\n options?: QRLoginOptions;\n}\n\n/**\n * QR Login Data - Dữ liệu QR Code\n */\nexport interface QRLoginData {\n /**\n * Session ID để tracking\n */\n sessionId: string;\n\n /**\n * QR Code dưới dạng base64\n */\n qrCode: string;\n\n /**\n * Thời gian hết hạn QR code (timestamp)\n */\n expiresAt: number;\n\n /**\n * URL để polling status\n */\n pollUrl: string;\n}\n\n/**\n * QR Code login response - Chuẩn theo automation-web QRLoginResponseDto\n */\nexport interface QRLoginResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu response\n */\n data?: QRLoginData;\n}\n\n/**\n * Session Info - Thông tin session\n */\nexport interface SessionInfo {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thời gian tạo session (timestamp)\n */\n createdAt: number;\n\n /**\n * Thời gian hết hạn session (timestamp)\n */\n expiresAt: number;\n\n /**\n * Thời gian hết hạn QR code (timestamp)\n */\n qrExpiresAt?: number;\n\n /**\n * Lần hoạt động cuối (timestamp)\n */\n lastActivity: number;\n}\n\n/**\n * Login Status Data - Dữ liệu trạng thái đăng nhập\n */\nexport interface LoginStatusData {\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * Thông tin user Zalo (khi đăng nhập thành công)\n */\n userData?: ZaloUserData;\n\n /**\n * Credentials để reuse (khi đăng nhập thành công)\n */\n credentials?: ZaloCredentials;\n\n /**\n * Thông tin session\n */\n sessionInfo: SessionInfo;\n}\n\n/**\n * Login status response - Chuẩn theo automation-web LoginStatusResponseDto\n */\nexport interface LoginStatusResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu status\n */\n data?: LoginStatusData;\n}\n\n/**\n * Credentials Login Options - Chuẩn theo automation-web CredentialsLoginOptionsDto\n */\nexport interface CredentialsLoginOptions {\n /**\n * Chỉ validate credentials, không tạo session\n * @default false\n */\n validateOnly?: boolean;\n}\n\n/**\n * Credentials login request - Chuẩn theo automation-web CredentialsLoginRequestDto\n */\nexport interface CredentialsLoginRequest {\n /**\n * ID của user tạo session (userId từ redai-v201-be-app)\n */\n createdBy?: number | string;\n\n /**\n * @deprecated Dùng createdBy (number) thay thế\n */\n userUuid?: string;\n\n /**\n * Zalo credentials để đăng nhập\n */\n credentials: ZaloCredentials;\n\n /**\n * Tùy chọn cho credentials login\n */\n options?: CredentialsLoginOptions;\n}\n\n/**\n * Credentials Login Data - Dữ liệu credentials login\n */\nexport interface CredentialsLoginData {\n /**\n * Session ID được tạo\n */\n sessionId: string;\n\n /**\n * Thông tin user Zalo\n */\n userData: ZaloUserData;\n\n /**\n * Credentials có hợp lệ không\n */\n isValid: boolean;\n}\n\n/**\n * Credentials login response - Chuẩn theo automation-web CredentialsLoginResponseDto\n */\nexport interface CredentialsLoginResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu response\n */\n data?: CredentialsLoginData;\n}\n\n/**\n * Session Item - Chuẩn theo automation-web SessionItemDto\n */\nexport interface SessionItem {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * Thông tin user (nếu đã đăng nhập thành công)\n */\n userData?: ZaloUserData;\n\n /**\n * Thời gian tạo (timestamp)\n */\n createdAt: number;\n\n /**\n * Lần hoạt động cuối (timestamp)\n */\n lastActivity: number;\n\n /**\n * Thời gian hết hạn (timestamp)\n */\n expiresAt: number;\n\n /**\n * Session có hết hạn chưa\n */\n isExpired: boolean;\n}\n\n/**\n * Session List Data - Dữ liệu danh sách sessions\n */\nexport interface SessionListData {\n /**\n * Danh sách sessions\n */\n sessions: SessionItem[];\n\n /**\n * Tổng số sessions\n */\n total: number;\n\n /**\n * Số sessions đang active\n */\n activeCount: number;\n}\n\n/**\n * Session list response - Chuẩn theo automation-web SessionListResponseDto\n */\nexport interface SessionListResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu sessions\n */\n data?: SessionListData;\n}\n\n/**\n * Session delete response - Chuẩn theo automation-web SessionDeleteResponseDto\n */\nexport interface SessionDeleteResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n}\n\n/**\n * Bulk delete sessions request - Chuẩn theo automation-web BulkDeleteSessionsDto\n */\nexport interface BulkDeleteSessionsRequest {\n /**\n * Danh sách session IDs cần xóa\n */\n sessionIds: string[];\n}\n\n/**\n * Bulk delete sessions response - Chuẩn theo automation-web BulkDeleteSessionsResponseDto\n */\nexport interface BulkDeleteSessionsResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Số lượng sessions đã xóa thành công\n */\n deletedCount: number;\n\n /**\n * Danh sách session IDs đã xóa thành công\n */\n deletedIds: string[];\n\n /**\n * Số lượng sessions xóa thất bại\n */\n failedCount?: number;\n\n /**\n * Danh sách session IDs xóa thất bại\n */\n failedIds?: string[];\n\n /**\n * Danh sách lỗi chi tiết\n */\n errors?: string[];\n}\n\n/**\n * Session Debug Data - Dữ liệu debug session\n */\nexport interface SessionDebugData {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Creator ID\n */\n createdBy?: number | string;\n\n /**\n * User UUID\n */\n userUuid?: string;\n\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * QR Code (truncated)\n */\n qrCode: string | null;\n\n /**\n * Thời gian hết hạn QR code\n */\n qrExpiresAt?: number;\n\n /**\n * Có credentials không\n */\n hasCredentials: boolean;\n\n /**\n * Thông tin credentials\n */\n credentialsInfo?: {\n cookieCount: number;\n hasImei: boolean;\n hasUserAgent: boolean;\n language?: string;\n };\n\n /**\n * Có user data không\n */\n hasUserData: boolean;\n\n /**\n * Thông tin user data\n */\n userDataInfo?: {\n userId?: string;\n displayName?: string;\n hasAvatar: boolean;\n };\n\n /**\n * Thông tin timestamps\n */\n timestamps: {\n createdAt: number;\n expiresAt: number;\n lastActivity: number;\n };\n\n /**\n * Trạng thái hết hạn\n */\n isExpired: boolean;\n\n /**\n * Trạng thái QR hết hạn\n */\n isQRExpired: boolean;\n\n /**\n * Thông tin instance\n */\n instanceInfo?: {\n hasInstance: boolean;\n isConnected?: boolean;\n lastPing?: number;\n };\n}\n\n/**\n * Session debug information - Chuẩn theo automation-web debugSession response\n */\nexport interface SessionDebugInfo {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu debug (nếu thành công)\n */\n data?: SessionDebugData;\n\n /**\n * Thông tin lỗi (nếu thất bại)\n */\n error?: string;\n\n /**\n * Timestamp\n */\n timestamp?: number;\n}\n","/**\n * Webhook Event Enums\n * 100% khớp với zalo-personal-sdk/src/models/Enum.ts\n */\n\n/**\n * Thread Type enum - loại cuộc trò chuyện\n */\nexport enum ThreadType {\n USER = 0,\n GROUP = 1,\n}\n\n/**\n * Destination Type enum\n */\nexport enum DestType {\n USER = 3,\n PAGE = 5,\n}\n\n/**\n * Reminder Repeat Mode enum\n */\nexport enum ReminderRepeatMode {\n NONE = 0,\n DAILY = 1,\n WEEKLY = 2,\n MONTHLY = 3,\n}\n\n/**\n * Gender enum\n */\nexport enum Gender {\n MALE = 0,\n FEMALE = 1,\n}\n\n/**\n * Board Type enum\n */\nexport enum BoardType {\n NOTE = 1,\n PINNED_MESSAGE = 2,\n POLL = 3,\n}\n\n/**\n * Reaction Types enum - các loại phản ứng\n */\nexport enum Reactions {\n HEART = \"/-heart\",\n LIKE = \"/-strong\",\n HAHA = \":>\",\n WOW = \":o\",\n CRY = \":-((\",\n ANGRY = \":-h\",\n KISS = \":-*\",\n TEARS_OF_JOY = \":')\",\n SHIT = \"/-shit\",\n ROSE = \"/-rose\",\n BROKEN_HEART = \"/-break\",\n DISLIKE = \"/-weak\",\n LOVE = \";xx\",\n CONFUSED = \";-/\",\n WINK = \";-)\",\n FADE = \"/-fade\",\n SUN = \"/-li\",\n BIRTHDAY = \"/-bd\",\n BOMB = \"/-bome\",\n OK = \"/-ok\",\n PEACE = \"/-v\",\n THANKS = \"/-thanks\",\n PUNCH = \"/-punch\",\n SHARE = \"/-share\",\n PRAY = \"_()_\",\n NO = \"/-no\",\n BAD = \"/-bad\",\n LOVE_YOU = \"/-loveu\",\n SAD = \"--b\",\n VERY_SAD = \":((\",\n COOL = \"x-)\",\n NERD = \"8-)\",\n BIG_SMILE = \";-d\",\n SUNGLASSES = \"b-)\",\n NEUTRAL = \":--|\",\n SAD_FACE = \"p-(\",\n BYE = \":-bye\",\n SLEEPY = \"|-)\",\n WIPE = \":wipe\",\n DIG = \":-dig\",\n ANGUISH = \"&-(\",\n HANDCLAP = \":handclap\",\n ANGRY_FACE = \">-|\",\n F_CHAIR = \":-f\",\n L_CHAIR = \":-l\",\n R_CHAIR = \":-r\",\n SILENT = \";-x\",\n SURPRISE = \":-o\",\n EMBARRASSED = \";-s\",\n AFRAID = \";-a\",\n SAD2 = \":-<\",\n BIG_LAUGH = \":))\",\n RICH = \"$-)\",\n BEER = \"/-beer\",\n NONE = \"\",\n}\n\n/**\n * Friend Event Type enum - các loại sự kiện bạn bè\n */\nexport enum FriendEventType {\n ADD = 0,\n REMOVE = 1,\n REQUEST = 2,\n UNDO_REQUEST = 3,\n REJECT_REQUEST = 4,\n SEEN_FRIEND_REQUEST = 5,\n BLOCK = 6,\n UNBLOCK = 7,\n BLOCK_CALL = 8,\n UNBLOCK_CALL = 9,\n PIN_UNPIN = 10,\n PIN_CREATE = 11,\n UNKNOWN = 12,\n}\n\n/**\n * Group Event Type enum - các loại sự kiện nhóm\n */\nexport enum GroupEventType {\n JOIN_REQUEST = 0,\n JOIN = 1,\n LEAVE = 2,\n REMOVE_MEMBER = 3,\n BLOCK_MEMBER = 4,\n UPDATE_SETTING = 5,\n UPDATE = 6,\n NEW_LINK = 7,\n ADD_ADMIN = 8,\n REMOVE_ADMIN = 9,\n NEW_PIN_TOPIC = 10,\n UPDATE_PIN_TOPIC = 11,\n REORDER_PIN_TOPIC = 12,\n UPDATE_BOARD = 13,\n REMOVE_BOARD = 14,\n UPDATE_TOPIC = 15,\n UNPIN_TOPIC = 16,\n REMOVE_TOPIC = 17,\n ACCEPT_REMIND = 18,\n REJECT_REMIND = 19,\n REMIND_TOPIC = 20,\n UPDATE_AVATAR = 21,\n UNKNOWN = 22,\n}\n","/**\n * Message Types\n * 100% khớp với zalo-personal-sdk/src/models/Message.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Attachment Content Type\n */\nexport interface TAttachmentContent {\n title: string;\n description: string;\n href: string;\n thumb: string;\n childnumber: number;\n action: string;\n params: string;\n type: string;\n}\n\n/**\n * Other Content Type\n */\nexport interface TOtherContent {\n [key: string]: any;\n}\n\n/**\n * Quote Type\n */\nexport interface TQuote {\n ownerId: number;\n cliMsgId: number;\n globalMsgId: number;\n cliMsgType: number;\n ts: number;\n msg: string;\n attach: string;\n fromD: string;\n ttl: number;\n}\n\n/**\n * Mention Type\n */\nexport interface TMention {\n uid: string;\n pos: number;\n len: number;\n type: 0 | 1;\n}\n\n/**\n * Base Message Type\n */\nexport interface TMessage {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: string | TAttachmentContent | TOtherContent;\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n topOut: string;\n topOutTimeOut: string;\n topOutImprTimeOut: string;\n propertyExt:\n | {\n color: number;\n size: number;\n type: number;\n subType: number;\n ext: string;\n }\n | undefined;\n paramsExt: {\n countUnread: number;\n containType: number;\n platformType: number;\n };\n cmd: number;\n st: number;\n at: number;\n realMsgId: string;\n quote: TQuote | undefined;\n}\n\n/**\n * Group Message Type (extends TMessage with mentions)\n */\nexport interface TGroupMessage extends TMessage {\n mentions: TMention[] | undefined;\n}\n\n/**\n * User Message Class\n */\nexport class UserMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TMessage;\n threadId: string;\n /**\n * true if the message is sent by the logged in account\n */\n isSelf: boolean;\n\n constructor(uid: string, data: TMessage) {\n this.data = data;\n this.threadId = data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n\n/**\n * Group Message Class\n */\nexport class GroupMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupMessage;\n threadId: string;\n /**\n * true if the message is sent by the logged in account\n */\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupMessage) {\n this.data = data;\n this.threadId = data.idTo;\n this.isSelf = data.uidFrom === \"0\";\n\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n\n/**\n * Message Union Type\n */\nexport type Message = UserMessage | GroupMessage;\n","/**\n * Typing Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Typing.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Base Typing Type\n */\nexport interface TTyping {\n uid: string;\n ts: string;\n isPC: 0 | 1;\n}\n\n/**\n * Group Typing Type (extends TTyping with group ID)\n */\nexport interface TGroupTyping extends TTyping {\n gid: string;\n}\n\n/**\n * User Typing Class\n */\nexport class UserTyping {\n type: ThreadType.USER = ThreadType.USER;\n data: TTyping;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TTyping) {\n this.data = data;\n this.threadId = data.uid;\n this.isSelf = false;\n }\n}\n\n/**\n * Group Typing Class\n */\nexport class GroupTyping {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupTyping;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TGroupTyping) {\n this.data = data;\n this.threadId = data.gid;\n this.isSelf = false;\n }\n}\n\n/**\n * Typing Union Type\n */\nexport type Typing = UserTyping | GroupTyping;\n","/**\n * Reaction Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Reaction.ts\n */\n\nimport { Reactions } from './enums';\n\n/**\n * Reaction Type\n */\nexport interface TReaction {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName?: string;\n content: {\n rMsg: { gMsgID: string; cMsgID: string; msgType: number }[];\n rIcon: Reactions;\n rType: number;\n source: number;\n };\n ts: string;\n ttl: number;\n}\n\n/**\n * Reaction Class\n */\nexport class Reaction {\n data: TReaction;\n threadId: string;\n isSelf: boolean;\n isGroup: boolean;\n\n constructor(uid: string, data: TReaction, isGroup: boolean) {\n this.data = data;\n this.threadId = isGroup || data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n this.isGroup = isGroup;\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n","/**\n * Seen Message Event Types\n * 100% khớp với zalo-personal-sdk/src/models/SeenMessage.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * User Seen Message Type\n */\nexport interface TUserSeenMessage {\n idTo: string;\n msgId: string;\n realMsgId: string;\n}\n\n/**\n * Group Seen Message Type\n */\nexport interface TGroupSeenMessage {\n msgId: string;\n groupId: string;\n seenUids: string[];\n}\n\n/**\n * User Seen Message Class\n */\nexport class UserSeenMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TUserSeenMessage;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TUserSeenMessage) {\n this.data = data;\n this.threadId = data.idTo;\n this.isSelf = false;\n }\n}\n\n/**\n * Group Seen Message Class\n */\nexport class GroupSeenMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupSeenMessage;\n threadId: string;\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupSeenMessage) {\n this.data = data;\n this.threadId = data.groupId;\n this.isSelf = data.seenUids.includes(uid);\n }\n}\n\n/**\n * Seen Message Union Type\n */\nexport type SeenMessage = UserSeenMessage | GroupSeenMessage;\n","/**\n * Delivered Message Event Types\n * 100% khớp với zalo-personal-sdk/src/models/DeliveredMessage.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Delivered Message Type\n */\nexport interface TDeliveredMessage {\n msgId: string;\n seen: number;\n deliveredUids: string[];\n seenUids: string[];\n realMsgId: string;\n mSTs: number;\n}\n\n/**\n * Group Delivered Message Type (extends TDeliveredMessage with group ID)\n */\nexport interface TGroupDeliveredMessage extends TDeliveredMessage {\n groupId: string;\n}\n\n/**\n * User Delivered Message Class\n */\nexport class UserDeliveredMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TDeliveredMessage;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TDeliveredMessage) {\n this.data = data;\n this.threadId = data.deliveredUids[0];\n this.isSelf = false;\n }\n}\n\n/**\n * Group Delivered Message Class\n */\nexport class GroupDeliveredMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupDeliveredMessage;\n threadId: string;\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupDeliveredMessage) {\n this.data = data;\n this.threadId = data.groupId;\n this.isSelf = data.deliveredUids.includes(uid);\n }\n}\n\n/**\n * Delivered Message Union Type\n */\nexport type DeliveredMessage = UserDeliveredMessage | GroupDeliveredMessage;\n","/**\n * Undo Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Undo.ts\n */\n\n/**\n * Undo Content Type\n */\nexport interface TUndoContent {\n globalMsgId: number;\n cliMsgId: number;\n deleteMsg: number;\n srcId: number;\n destId: number;\n}\n\n/**\n * Undo Type\n */\nexport interface TUndo {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: TUndoContent;\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n cmd: number;\n st: number;\n at: number;\n realMsgId: string;\n}\n\n/**\n * Undo Class\n */\nexport class Undo {\n data: TUndo;\n threadId: string;\n isSelf: boolean;\n isGroup: boolean;\n\n constructor(uid: string, data: TUndo, isGroup: boolean) {\n this.data = data;\n this.threadId = isGroup || data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n this.isGroup = isGroup;\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n","/**\n * Webhook Job Types\n * 100% khớp với automation-web/src/shared/types/zalo-webhook-events.types.ts\n * Cấu trúc job khi đưa vào queue\n */\n\n// ==================== BASE TYPES ====================\n\n/**\n * Thread Type enum\n */\nexport enum ZaloThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Connection Status enum\n */\nexport enum ZaloConnectionStatus {\n CONNECTED = 'connected',\n DISCONNECTED = 'disconnected',\n RECONNECTING = 'reconnecting',\n LOGGED_OUT = 'logged_out',\n}\n\n/**\n * Event Type enum - Chuẩn hóa tất cả event types\n */\nexport enum ZaloWebhookEventType {\n // ==================== TIN NHẮN TEXT (4 events) ====================\n TEXT_MESSAGE_SENT_TO_USER = 'text-message-sent-to-user',\n TEXT_MESSAGE_SENT_TO_GROUP = 'text-message-sent-to-group',\n TEXT_MESSAGE_RECEIVED_FROM_USER = 'text-message-received-from-user',\n TEXT_MESSAGE_RECEIVED_FROM_GROUP = 'text-message-received-from-group',\n\n // ==================== TIN NHẮN HÌNH ẢNH (4 events) ====================\n IMAGE_MESSAGE_SENT_TO_USER = 'image-message-sent-to-user',\n IMAGE_MESSAGE_SENT_TO_GROUP = 'image-message-sent-to-group',\n IMAGE_MESSAGE_RECEIVED_FROM_USER = 'image-message-received-from-user',\n IMAGE_MESSAGE_RECEIVED_FROM_GROUP = 'image-message-received-from-group',\n\n // ==================== TIN NHẮN VIDEO (4 events) ====================\n VIDEO_MESSAGE_SENT_TO_USER = 'video-message-sent-to-user',\n VIDEO_MESSAGE_SENT_TO_GROUP = 'video-message-sent-to-group',\n VIDEO_MESSAGE_RECEIVED_FROM_USER = 'video-message-received-from-user',\n VIDEO_MESSAGE_RECEIVED_FROM_GROUP = 'video-message-received-from-group',\n\n // ==================== TIN NHẮN VOICE/AUDIO (4 events) ====================\n VOICE_MESSAGE_SENT_TO_USER = 'voice-message-sent-to-user',\n VOICE_MESSAGE_SENT_TO_GROUP = 'voice-message-sent-to-group',\n VOICE_MESSAGE_RECEIVED_FROM_USER = 'voice-message-received-from-user',\n VOICE_MESSAGE_RECEIVED_FROM_GROUP = 'voice-message-received-from-group',\n\n // ==================== TIN NHẮN FILE (4 events) ====================\n FILE_MESSAGE_SENT_TO_USER = 'file-message-sent-to-user',\n FILE_MESSAGE_SENT_TO_GROUP = 'file-message-sent-to-group',\n FILE_MESSAGE_RECEIVED_FROM_USER = 'file-message-received-from-user',\n FILE_MESSAGE_RECEIVED_FROM_GROUP = 'file-message-received-from-group',\n\n // ==================== TIN NHẮN STICKER (4 events) ====================\n STICKER_MESSAGE_SENT_TO_USER = 'sticker-message-sent-to-user',\n STICKER_MESSAGE_SENT_TO_GROUP = 'sticker-message-sent-to-group',\n STICKER_MESSAGE_RECEIVED_FROM_USER = 'sticker-message-received-from-user',\n STICKER_MESSAGE_RECEIVED_FROM_GROUP = 'sticker-message-received-from-group',\n\n // ==================== TIN NHẮN VỊ TRÍ (4 events) ====================\n LOCATION_MESSAGE_SENT_TO_USER = 'location-message-sent-to-user',\n LOCATION_MESSAGE_SENT_TO_GROUP = 'location-message-sent-to-group',\n LOCATION_MESSAGE_RECEIVED_FROM_USER = 'location-message-received-from-user',\n LOCATION_MESSAGE_RECEIVED_FROM_GROUP = 'location-message-received-from-group',\n\n // ==================== TIN NHẮN GIF (4 events) ====================\n GIF_MESSAGE_SENT_TO_USER = 'gif-message-sent-to-user',\n GIF_MESSAGE_SENT_TO_GROUP = 'gif-message-sent-to-group',\n GIF_MESSAGE_RECEIVED_FROM_USER = 'gif-message-received-from-user',\n GIF_MESSAGE_RECEIVED_FROM_GROUP = 'gif-message-received-from-group',\n\n // ==================== TIN NHẮN LINK (4 events) ====================\n LINK_MESSAGE_SENT_TO_USER = 'link-message-sent-to-user',\n LINK_MESSAGE_SENT_TO_GROUP = 'link-message-sent-to-group',\n LINK_MESSAGE_RECEIVED_FROM_USER = 'link-message-received-from-user',\n LINK_MESSAGE_RECEIVED_FROM_GROUP = 'link-message-received-from-group',\n\n // ==================== TIN NHẮN VẼ DOODLE (4 events) ====================\n DOODLE_MESSAGE_SENT_TO_USER = 'doodle-message-sent-to-user',\n DOODLE_MESSAGE_SENT_TO_GROUP = 'doodle-message-sent-to-group',\n DOODLE_MESSAGE_RECEIVED_FROM_USER = 'doodle-message-received-from-user',\n DOODLE_MESSAGE_RECEIVED_FROM_GROUP = 'doodle-message-received-from-group',\n\n // Message events - RECOMMENDED (4 events)\n RECOMMENDED_MESSAGE_SENT_TO_USER = 'recommended-message-sent-to-user',\n RECOMMENDED_MESSAGE_SENT_TO_GROUP = 'recommended-message-sent-to-group',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_USER = 'recommended-message-received-from-user',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP = 'recommended-message-received-from-group',\n\n // ==================== TIN NHẮN CŨ (1 event) ====================\n OLD_MESSAGES = 'old-messages',\n\n // ==================== TRẠNG THÁI TYPING - ĐANG SOẠN TIN (4 events) ====================\n TYPING_BY_SELF_IN_USER = 'typing-by-self-in-user',\n TYPING_BY_SELF_IN_GROUP = 'typing-by-self-in-group',\n TYPING_BY_OTHER_IN_USER = 'typing-by-other-in-user',\n TYPING_BY_OTHER_IN_GROUP = 'typing-by-other-in-group',\n\n // ==================== TRẠNG THÁI Đà XEM TIN NHẮN (4 events) ====================\n SEEN_MESSAGES_BY_SELF_IN_USER = 'seen-messages-by-self-in-user',\n SEEN_MESSAGES_BY_SELF_IN_GROUP = 'seen-messages-by-self-in-group',\n SEEN_MESSAGES_BY_OTHER_IN_USER = 'seen-messages-by-other-in-user',\n SEEN_MESSAGES_BY_OTHER_IN_GROUP = 'seen-messages-by-other-in-group',\n\n // ==================== TRẠNG THÁI Đà NHẬN TIN NHẮN (4 events) ====================\n DELIVERED_MESSAGES_BY_SELF_IN_USER = 'delivered-messages-by-self-in-user',\n DELIVERED_MESSAGES_BY_SELF_IN_GROUP = 'delivered-messages-by-self-in-group',\n DELIVERED_MESSAGES_BY_OTHER_IN_USER = 'delivered-messages-by-other-in-user',\n DELIVERED_MESSAGES_BY_OTHER_IN_GROUP = 'delivered-messages-by-other-in-group',\n\n // ==================== PHẢN ỨNG TIN NHẮN (4 events) ====================\n REACTION_BY_SELF_IN_USER = 'reaction-by-self-in-user',\n REACTION_BY_SELF_IN_GROUP = 'reaction-by-self-in-group',\n REACTION_BY_OTHER_IN_USER = 'reaction-by-other-in-user',\n REACTION_BY_OTHER_IN_GROUP = 'reaction-by-other-in-group',\n\n // ==================== PHẢN ỨNG CŨ (4 events) ====================\n OLD_REACTIONS_BY_SELF_IN_USER = 'old-reactions-by-self-in-user',\n OLD_REACTIONS_BY_SELF_IN_GROUP = 'old-reactions-by-self-in-group',\n OLD_REACTIONS_BY_OTHER_IN_USER = 'old-reactions-by-other-in-user',\n OLD_REACTIONS_BY_OTHER_IN_GROUP = 'old-reactions-by-other-in-group',\n\n // ==================== SỰ KIỆN BẠN BÈ (12 events) ====================\n FRIEND_EVENT_ADD = 'friend-event-add',\n FRIEND_EVENT_REMOVE = 'friend-event-remove',\n FRIEND_EVENT_REQUEST = 'friend-event-request',\n FRIEND_EVENT_UNDO_REQUEST = 'friend-event-undo-request',\n FRIEND_EVENT_REJECT_REQUEST = 'friend-event-reject-request',\n FRIEND_EVENT_SEEN_REQUEST = 'friend-event-seen-request',\n FRIEND_EVENT_BLOCK = 'friend-event-block',\n FRIEND_EVENT_UNBLOCK = 'friend-event-unblock',\n FRIEND_EVENT_BLOCK_CALL = 'friend-event-block-call',\n FRIEND_EVENT_UNBLOCK_CALL = 'friend-event-unblock-call',\n FRIEND_EVENT_PIN_UNPIN = 'friend-event-pin-unpin',\n FRIEND_EVENT_PIN_CREATE = 'friend-event-pin-create',\n FRIEND_EVENT_UNKNOWN = 'friend-event-unknown',\n\n // ==================== SỰ KIỆN NHÓM (22 events) ====================\n GROUP_EVENT_JOIN_REQUEST = 'group-event-join-request',\n GROUP_EVENT_JOIN = 'group-event-join',\n GROUP_EVENT_LEAVE = 'group-event-leave',\n GROUP_EVENT_REMOVE_MEMBER = 'group-event-remove-member',\n GROUP_EVENT_BLOCK_MEMBER = 'group-event-block-member',\n GROUP_EVENT_UPDATE_SETTING = 'group-event-update-setting',\n GROUP_EVENT_UPDATE = 'group-event-update',\n GROUP_EVENT_NEW_LINK = 'group-event-new-link',\n GROUP_EVENT_ADD_ADMIN = 'group-event-add-admin',\n GROUP_EVENT_REMOVE_ADMIN = 'group-event-remove-admin',\n GROUP_EVENT_NEW_PIN_TOPIC = 'group-event-new-pin-topic',\n GROUP_EVENT_UPDATE_PIN_TOPIC = 'group-event-update-pin-topic',\n GROUP_EVENT_REORDER_PIN_TOPIC = 'group-event-reorder-pin-topic',\n GROUP_EVENT_UPDATE_BOARD = 'group-event-update-board',\n GROUP_EVENT_REMOVE_BOARD = 'group-event-remove-board',\n GROUP_EVENT_UPDATE_TOPIC = 'group-event-update-topic',\n GROUP_EVENT_UNPIN_TOPIC = 'group-event-unpin-topic',\n GROUP_EVENT_REMOVE_TOPIC = 'group-event-remove-topic',\n GROUP_EVENT_ACCEPT_REMIND = 'group-event-accept-remind',\n GROUP_EVENT_REJECT_REMIND = 'group-event-reject-remind',\n GROUP_EVENT_REMIND_TOPIC = 'group-event-remind-topic',\n GROUP_EVENT_UPDATE_AVATAR = 'group-event-update-avatar',\n GROUP_EVENT_UNKNOWN = 'group-event-unknown',\n\n // ==================== THU HỒI TIN NHẮN (4 events) ====================\n UNDO_BY_SELF_IN_USER = 'undo-by-self-in-user',\n UNDO_BY_SELF_IN_GROUP = 'undo-by-self-in-group',\n UNDO_BY_OTHER_IN_USER = 'undo-by-other-in-user',\n UNDO_BY_OTHER_IN_GROUP = 'undo-by-other-in-group',\n\n // ==================== TRẠNG THÁI KẾT NỐI (4 events) ====================\n CONNECTION_STATUS_CONNECTED = 'connection-status-connected',\n CONNECTION_STATUS_DISCONNECTED = 'connection-status-disconnected',\n CONNECTION_STATUS_RECONNECTING = 'connection-status-reconnecting',\n CONNECTION_STATUS_LOGGED_OUT = 'connection-status-logged-out',\n\n // ==================== UPLOAD ATTACHMENT (3 events) ====================\n UPLOAD_ATTACHMENT_IN_PROGRESS = 'upload-attachment-in-progress',\n UPLOAD_ATTACHMENT_COMPLETED = 'upload-attachment-completed',\n UPLOAD_ATTACHMENT_FAILED = 'upload-attachment-failed',\n\n // ==================== CIPHER KEY (4 events) ====================\n CIPHER_KEY_UPDATED_IN_USER = 'cipher-key-updated-in-user',\n CIPHER_KEY_UPDATED_IN_GROUP = 'cipher-key-updated-in-group',\n CIPHER_KEY_EXPIRED_IN_USER = 'cipher-key-expired-in-user',\n CIPHER_KEY_EXPIRED_IN_GROUP = 'cipher-key-expired-in-group',\n\n // ==================== LỖI HỆ THỐNG (6 events) ====================\n ERROR_SYSTEM = 'error-system',\n ERROR_NETWORK = 'error-network',\n ERROR_AUTHENTICATION = 'error-authentication',\n ERROR_VALIDATION = 'error-validation',\n ERROR_BUSINESS_LOGIC = 'error-business-logic',\n ERROR_UNKNOWN = 'error-unknown',\n}\n\n/**\n * Base webhook event interface - Cấu trúc job chuẩn\n */\nexport interface BaseZaloWebhookEvent {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n timestamp: number;\n eventType: ZaloWebhookEventType;\n metadata?: Record<string, any>;\n}\n\n/**\n * Job Priority enum\n */\nexport enum JobPriority {\n LOW = 1,\n NORMAL = 2,\n HIGH = 3,\n CRITICAL = 4,\n}\n\n/**\n * Job Status enum\n */\nexport enum JobStatus {\n WAITING = 'waiting',\n ACTIVE = 'active',\n COMPLETED = 'completed',\n FAILED = 'failed',\n DELAYED = 'delayed',\n PAUSED = 'paused',\n}\n\n/**\n * Queue Job Configuration\n */\nexport interface QueueJobConfig {\n priority?: JobPriority;\n delay?: number;\n attempts?: number;\n backoff?: {\n type: 'fixed' | 'exponential';\n delay: number;\n };\n removeOnComplete?: number | boolean;\n removeOnFail?: number | boolean;\n jobId?: string;\n}\n\n/**\n * Base Queue Job Interface - Cấu trúc job khi đưa vào queue\n */\nexport interface BaseQueueJob<T = any> {\n id?: string;\n name: string;\n data: T;\n opts?: QueueJobConfig;\n progress?: number;\n returnvalue?: any;\n failedReason?: string;\n stacktrace?: string[];\n attemptsMade?: number;\n delay?: number;\n timestamp?: number;\n processedOn?: number;\n finishedOn?: number;\n}\n\n/**\n * Webhook Queue Job - Job cụ thể cho webhook events\n */\nexport interface WebhookQueueJob extends BaseQueueJob<BaseZaloWebhookEvent> {\n name: 'webhook-event';\n data: BaseZaloWebhookEvent;\n}\n","/**\n * Job Types Index\n * Export tất cả job/queue types\n * 100% khớp với automation-web job structure\n */\n\n// ==================== BASE TYPES ====================\nexport * from './webhook-job.types';\n\n// ==================== MESSAGE JOB TYPES ====================\nexport * from './message-job.types';\n\n// ==================== EVENT JOB TYPES ====================\nexport * from './event-job.types';\n\n// ==================== FRIEND & GROUP JOB TYPES ====================\nexport * from './friend-group-job.types';\n\n// ==================== SYSTEM JOB TYPES ====================\nexport * from './system-job.types';\n\n// ==================== UNION TYPES FOR CONVENIENCE ====================\n\nimport {\n ZaloMessageEvent,\n MessageQueueJobUnion,\n} from './message-job.types';\n\nimport {\n ZaloTypingEvent,\n ZaloSeenMessagesEvent,\n ZaloDeliveredMessagesEvent,\n ZaloReactionEvent,\n ZaloUndoEvent,\n} from './event-job.types';\n\nimport {\n ZaloFriendEvent,\n ZaloGroupEvent,\n FriendEventQueueJob,\n GroupEventQueueJob,\n} from './friend-group-job.types';\n\nimport {\n ZaloSystemEvent,\n SystemQueueJobUnion,\n} from './system-job.types';\n\nimport {\n BaseZaloWebhookEvent,\n WebhookQueueJob,\n ZaloWebhookEventType,\n} from './webhook-job.types';\n\n/**\n * Union type for ALL Zalo webhook events\n */\nexport type ZaloWebhookEvent =\n | ZaloMessageEvent\n | ZaloTypingEvent\n | ZaloSeenMessagesEvent\n | ZaloDeliveredMessagesEvent\n | ZaloReactionEvent\n | ZaloUndoEvent\n | ZaloFriendEvent\n | ZaloGroupEvent\n | ZaloSystemEvent;\n\n/**\n * Union type for ALL queue jobs\n */\nexport type AllQueueJobs =\n | WebhookQueueJob\n | MessageQueueJobUnion\n | FriendEventQueueJob\n | GroupEventQueueJob\n | SystemQueueJobUnion;\n\n// ==================== HELPER FUNCTIONS ====================\n\n/**\n * Type guard to check if event is a message event\n */\nexport function isMessageEvent(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n return MESSAGE_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a typing event\n */\nexport function isTypingEvent(event: ZaloWebhookEvent): event is ZaloTypingEvent {\n return event.eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is a reaction event\n */\nexport function isReactionEvent(event: ZaloWebhookEvent): event is ZaloReactionEvent {\n return event.eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is a friend event\n */\nexport function isFriendEvent(event: ZaloWebhookEvent): event is ZaloFriendEvent {\n return FRIEND_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a group event\n */\nexport function isGroupEvent(event: ZaloWebhookEvent): event is ZaloGroupEvent {\n return GROUP_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a system event\n */\nexport function isSystemEvent(event: ZaloWebhookEvent): event is ZaloSystemEvent {\n return event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_CONNECTED ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_RECONNECTING ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_LOGGED_OUT ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_IN_PROGRESS ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_COMPLETED ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_FAILED ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.ERROR_SYSTEM ||\n event.eventType === ZaloWebhookEventType.ERROR_NETWORK ||\n event.eventType === ZaloWebhookEventType.ERROR_AUTHENTICATION ||\n event.eventType === ZaloWebhookEventType.ERROR_VALIDATION ||\n event.eventType === ZaloWebhookEventType.ERROR_BUSINESS_LOGIC ||\n event.eventType === ZaloWebhookEventType.ERROR_UNKNOWN ||\n event.eventType === ZaloWebhookEventType.OLD_MESSAGES;\n}\n\n/**\n * Type guard to check if event is sent by self\n */\nexport function isSelfEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events sent by self\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n // Typing events by self\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n // Seen events by self\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n // Delivered events by self\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n // Reaction events by self\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n // Undo events by self\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is from other users\n */\nexport function isOtherEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events received from others\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n // Typing events by others\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n // Seen events by others\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n // Delivered events by others\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n // Reaction events by others\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n // Undo events by others\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is in user thread\n */\nexport function isUserThreadEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events in user threads\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n // Other events in user threads\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER;\n}\n\n/**\n * Type guard to check if event is in group thread\n */\nexport function isGroupThreadEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events in group threads\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n // Other events in group threads\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n // Group events\n GROUP_EVENT_TYPES.includes(eventType as any);\n}\n\n/**\n * Get event category from event type\n */\nexport function getEventCategory(eventType: ZaloWebhookEventType): string {\n // Message events\n if (MESSAGE_EVENT_TYPES.includes(eventType as any)) return 'message';\n\n // Typing events\n if (eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP) {\n return 'typing';\n }\n\n // Seen events\n if (eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP) {\n return 'seen';\n }\n\n // Delivered events\n if (eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP) {\n return 'delivered';\n }\n\n // Reaction events\n if (eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_OTHER_IN_GROUP) {\n return 'reaction';\n }\n\n // Undo events\n if (eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP) {\n return 'undo';\n }\n\n // Friend events\n if (FRIEND_EVENT_TYPES.includes(eventType as any)) return 'friend';\n\n // Group events\n if (GROUP_EVENT_TYPES.includes(eventType as any)) return 'group';\n\n // Connection events\n if (eventType === ZaloWebhookEventType.CONNECTION_STATUS_CONNECTED ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_RECONNECTING ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_LOGGED_OUT) {\n return 'connection';\n }\n\n // Upload events\n if (eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_IN_PROGRESS ||\n eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_COMPLETED ||\n eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_FAILED) {\n return 'upload';\n }\n\n // Cipher events\n if (eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP) {\n return 'cipher';\n }\n\n // Error events\n if (eventType === ZaloWebhookEventType.ERROR_SYSTEM ||\n eventType === ZaloWebhookEventType.ERROR_NETWORK ||\n eventType === ZaloWebhookEventType.ERROR_AUTHENTICATION ||\n eventType === ZaloWebhookEventType.ERROR_VALIDATION ||\n eventType === ZaloWebhookEventType.ERROR_BUSINESS_LOGIC ||\n eventType === ZaloWebhookEventType.ERROR_UNKNOWN) {\n return 'error';\n }\n\n // Old messages\n if (eventType === ZaloWebhookEventType.OLD_MESSAGES) return 'old-messages';\n\n return 'unknown';\n}\n\n/**\n * Get thread type from event type\n */\nexport function getThreadTypeFromEvent(eventType: ZaloWebhookEventType): 'user' | 'group' | 'unknown' {\n // User thread events\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER) {\n return 'user';\n }\n\n // Group thread events\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n GROUP_EVENT_TYPES.includes(eventType as any)) {\n return 'group';\n }\n\n return 'unknown';\n}\n\n/**\n * Get actor type from event type (self or other)\n */\nexport function getActorTypeFromEvent(eventType: ZaloWebhookEventType): 'self' | 'other' | 'unknown' {\n // Self events (sent by self)\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP) {\n return 'self';\n }\n\n // Other events (received from others)\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP) {\n return 'other';\n }\n\n return 'unknown';\n}\n\n// ==================== MESSAGE DIRECTION TYPE GUARDS ====================\n\n/**\n * Type guard to check if event is a message received from user to self\n * Tin nhắn được gửi từ user tới mình\n */\nexport function isMessageReceivedFromUser(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER;\n}\n\n/**\n * Type guard to check if event is a message received from group (sent by others)\n * Tin nhắn được gửi từ người khác tới group\n */\nexport function isMessageReceivedFromGroup(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP;\n}\n\n/**\n * Type guard to check if event is a message sent from self to group\n * Tin nhắn được gửi từ mình tới group\n */\nexport function isMessageSentToGroup(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP;\n}\n\n/**\n * Type guard to check if event is a message sent from self to user\n * Tin nhắn được chính mình gửi tới người khác\n */\nexport function isMessageSentToUser(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER;\n}\n\n// ==================== CONSTANTS ====================\n\n/**\n * All message event types\n */\nexport const MESSAGE_EVENT_TYPES = [\n ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP,\n] as const;\n\n/**\n * All friend event types\n */\nexport const FRIEND_EVENT_TYPES = [\n ZaloWebhookEventType.FRIEND_EVENT_ADD,\n ZaloWebhookEventType.FRIEND_EVENT_REMOVE,\n ZaloWebhookEventType.FRIEND_EVENT_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_UNDO_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_REJECT_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_SEEN_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_BLOCK,\n ZaloWebhookEventType.FRIEND_EVENT_UNBLOCK,\n ZaloWebhookEventType.FRIEND_EVENT_BLOCK_CALL,\n ZaloWebhookEventType.FRIEND_EVENT_UNBLOCK_CALL,\n ZaloWebhookEventType.FRIEND_EVENT_PIN_UNPIN,\n ZaloWebhookEventType.FRIEND_EVENT_PIN_CREATE,\n ZaloWebhookEventType.FRIEND_EVENT_UNKNOWN,\n] as const;\n\n/**\n * All group event types\n */\nexport const GROUP_EVENT_TYPES = [\n ZaloWebhookEventType.GROUP_EVENT_JOIN_REQUEST,\n ZaloWebhookEventType.GROUP_EVENT_JOIN,\n ZaloWebhookEventType.GROUP_EVENT_LEAVE,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_MEMBER,\n ZaloWebhookEventType.GROUP_EVENT_BLOCK_MEMBER,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_SETTING,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE,\n ZaloWebhookEventType.GROUP_EVENT_NEW_LINK,\n ZaloWebhookEventType.GROUP_EVENT_ADD_ADMIN,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_ADMIN,\n ZaloWebhookEventType.GROUP_EVENT_NEW_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_REORDER_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_BOARD,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_BOARD,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UNPIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_ACCEPT_REMIND,\n ZaloWebhookEventType.GROUP_EVENT_REJECT_REMIND,\n ZaloWebhookEventType.GROUP_EVENT_REMIND_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_AVATAR,\n ZaloWebhookEventType.GROUP_EVENT_UNKNOWN,\n] as const;\n","/**\n * Profile DTOs for Zalo Personal Profile & Account Management\n * 100% khớp với automation-web/src/module/zalo-profile/dto/profile.dto.ts\n */\n\n// ==================== ENUMS ====================\n\nexport enum Gender {\n Male = 0,\n Female = 1,\n}\n\n// ==================== FETCH ACCOUNT INFO DTOs ====================\n\nexport interface FetchAccountInfoRequest {\n sessionId: string;\n}\n\n export interface BusinessPackage {\n label?: Record<string, string> | null;\n pkgId: number;\n }\n \nexport interface AccountInfo {\n userId: string;\n username: string;\n displayName: string;\n zaloName: string;\n avatar: string;\n bgavatar: string;\n cover: string;\n gender: Gender;\n dob: number;\n sdob: string;\n status: string;\n phoneNumber: string;\n isFr: number;\n isBlocked: number;\n lastActionTime: number;\n lastUpdateTime: number;\n isActive: number;\n key: number;\n type: number;\n isActivePC: number;\n isActiveWeb: number;\n isValid: number;\n userKey: string;\n accountStatus: number;\n oaInfo: any;\n user_mode: number;\n globalId: string;\n bizPkg: BusinessPackage;\n createdTs: number;\n oa_status: any;\n}\n\nexport type FetchAccountInfoResponse = AccountInfo;\n\n// ==================== CHANGE ACCOUNT AVATAR DTOs ====================\n\nexport interface AvatarMetadata {\n width: number;\n height: number;\n totalSize: number;\n size?: number;\n type?: string;\n}\n\nexport interface AvatarSource {\n data: string; // base64 encoded\n filename: string;\n metadata: AvatarMetadata;\n}\n\nexport interface ChangeAccountAvatarRequest {\n sessionId: string;\n avatarSource: AvatarSource;\n}\n\nexport interface ChangeAccountAvatarResponse {\n result: string;\n}\n\n// ==================== DELETE AVATAR DTOs ====================\n\nexport interface DeleteAvatarRequest {\n sessionId: string;\n photoId: string | string[];\n}\n\nexport interface DeleteAvatarResponse {\n result: any;\n}\n\n// ==================== REUSE AVATAR DTOs ====================\n\nexport interface ReuseAvatarRequest {\n sessionId: string;\n avatarId: string;\n}\n\nexport interface ReuseAvatarResponse {\n result: any;\n}\n\n// ==================== GET AVATAR LIST DTOs ====================\n\nexport interface GetAvatarListRequest {\n sessionId: string;\n}\n\nexport interface AvatarPhoto {\n photoId: string;\n thumbnail: string;\n url: string;\n bkUrl: string;\n}\n\nexport interface GetAvatarListResponse {\n albumId: string;\n nextPhotoId: string;\n hasMore: number;\n photos: AvatarPhoto[];\n}\n\n// ==================== UPDATE PROFILE DTOs ====================\n\nexport interface UpdateProfileRequest {\n sessionId: string;\n name: string;\n dob: `${string}-${string}-${string}`; // format: year-month-day\n gender: Gender;\n}\n\nexport interface UpdateProfileResponse {\n result: string;\n}\n\nexport interface GetAvatarUrlProfileRequest {\n sessionId: string;\n friendIds: string[];\n isAvatarSizeMax?: boolean;\n}\n\nexport interface GetAvatarUrlProfileResponse {\n results: Record<string, { avatar: string }>;\n}\n\nexport interface GetFullAvatarRequest {\n sessionId: string;\n friendId: string;\n}\n\nexport interface GetFullAvatarResponse {\n full_avatar: string;\n bk_full_avatar: string;\n}\n\nexport interface GetSettingsRequest {\n sessionId: string;\n}\n\nexport interface UserSetting {\n add_friend_via_contact: number;\n display_on_recommend_friend: number;\n add_friend_via_group: number;\n add_friend_via_qr: number;\n quick_message_status: number;\n show_online_status: boolean;\n accept_stranger_call: number;\n archived_chat_status: number;\n receive_message: number;\n add_friend_via_phone: number;\n display_seen_status: number;\n view_birthday: number;\n}\n\nexport interface GetSettingsResponse {\n settings: UserSetting;\n}\n\nexport enum UpdateSettingsType {\n ViewBirthday = 'view_birthday',\n ShowOnlineStatus = 'show_online_status',\n DisplaySeenStatus = 'display_seen_status',\n ReceiveMessage = 'receive_message',\n AcceptCall = 'accept_stranger_call',\n AddFriendViaPhone = 'add_friend_via_phone',\n AddFriendViaQR = 'add_friend_via_qr',\n AddFriendViaGroup = 'add_friend_via_group',\n AddFriendViaContact = 'add_friend_via_contact',\n DisplayOnRecommendFriend = 'display_on_recommend_friend',\n ArchivedChat = 'archivedChatStatus',\n QuickMessage = 'quickMessageStatus',\n}\n\nexport interface UpdateSettingsRequest {\n sessionId: string;\n type: UpdateSettingsType;\n value: number;\n}\n\nexport enum UpdateLangAvailableLanguages {\n VI = 'VI',\n EN = 'EN',\n}\n\nexport interface UpdateLangRequest {\n sessionId: string;\n language?: UpdateLangAvailableLanguages;\n}\n","import { ProxyProtocol, ProxyStatus } from './session-proxy.type';\r\n\r\nexport enum SortOrder {\r\n ASC = 'asc',\r\n DESC = 'desc',\r\n}\r\n\r\nexport enum SortByField {\r\n ID = 'id',\r\n CREATED_AT = 'createdAt',\r\n SUCCESS_RATE = 'successRate',\r\n LATENCY_MS = 'latencyMs',\r\n}\r\n\r\nexport interface CreateProxyRequest {\r\n host: string;\r\n port: number;\r\n username?: string;\r\n password?: string;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n weight?: number;\r\n note?: string;\r\n}\r\n\r\nexport interface UpdateProxyRequest {\r\n host?: string;\r\n port?: number;\r\n username?: string;\r\n password?: string;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n weight?: number;\r\n note?: string;\r\n status?: ProxyStatus;\r\n}\r\n\r\nexport interface ProxyFilterRequest {\r\n status?: ProxyStatus;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n availableOnly?: boolean;\r\n page?: number;\r\n limit?: number;\r\n sortBy?: SortByField;\r\n sortOrder?: SortOrder;\r\n}\r\n\r\nexport interface BulkImportProxyRequest {\r\n proxies: CreateProxyRequest[];\r\n}\r\n\r\nexport interface TestProxyRequest {\r\n timeout?: number;\r\n}\r\n\r\nexport interface DisableProxyRequest {\r\n durationMs?: number;\r\n reason?: string;\r\n}\r\n\r\nexport interface ProxyResponse {\r\n id: string;\r\n host: string;\r\n port: number;\r\n username?: string;\r\n protocol: string;\r\n region?: string;\r\n weight: number;\r\n successCount: number;\r\n failureCount: number;\r\n successRate: number;\r\n lastUsedAt?: string;\r\n lastFailedAt?: string;\r\n status: string;\r\n disabledUntil?: string;\r\n healthCheckedAt?: string;\r\n latencyMs?: number;\r\n note?: string;\r\n resourceType?: string;\r\n ownedBy?: number;\r\n createdAt: string;\r\n updatedAt: string;\r\n}\r\n\r\nexport interface ProxyListResponse {\r\n data: ProxyResponse[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n totalPages: number;\r\n}\r\n\r\nexport interface ProxyStatsResponse {\r\n totalProxies: number;\r\n activeProxies: number;\r\n disabledProxies: number;\r\n bannedProxies: number;\r\n averageSuccessRate: number;\r\n averageLatency?: number;\r\n}\r\n\r\nexport interface BulkImportResult {\r\n success: number;\r\n failed: number;\r\n errors: Array<{ index: number; error: string }>;\r\n}\r\n\r\nexport interface VerifyProxyIpResult {\r\n success: boolean;\r\n proxyIP?: string;\r\n error?: string;\r\n}\r\n\r\nexport interface TestRedaiApiResult {\r\n success: boolean;\r\n statusCode?: number;\r\n latencyMs?: number;\r\n proxyIP?: string;\r\n responseData?: any;\r\n error?: string;\r\n}\r\n","// ==================== ENUMS & TYPES ====================\r\n\r\n/**\r\n * Thread Type Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum ThreadType {\r\n User = 0,\r\n Group = 1,\r\n}\r\n\r\n/**\r\n * Text Style Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum TextStyle {\r\n Bold = 'b',\r\n Italic = 'i',\r\n Underline = 'u',\r\n StrikeThrough = 's',\r\n Red = 'c_db342e',\r\n Orange = 'c_f27806',\r\n Yellow = 'c_f7b503',\r\n Green = 'c_15a85f',\r\n Small = 'f_13',\r\n Big = 'f_18',\r\n UnorderedList = 'lst_1',\r\n OrderedList = 'lst_2',\r\n Indent = 'ind_$',\r\n}\r\n\r\n/**\r\n * Urgency Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum Urgency {\r\n Default = 0,\r\n Important = 1,\r\n Urgent = 2,\r\n}\r\n\r\n/**\r\n * Message Type Enum - chuẩn theo automation-web\r\n */\r\nexport enum MessageType {\r\n WebChat = 'webchat',\r\n Photo = 'chat.photo',\r\n Video = 'chat.video',\r\n File = 'chat.file',\r\n Sticker = 'chat.sticker',\r\n Link = 'chat.link',\r\n Location = 'chat.location',\r\n Contact = 'chat.contact',\r\n Todo = 'chat.todo',\r\n GroupPoll = 'group.poll',\r\n}\r\n\r\n/**\r\n * Zalo Reactions Enum - chuẩn theo automation-web\r\n */\r\nexport enum ZaloReactions {\n HEART = '/-heart',\r\n LIKE = '/-strong',\r\n HAHA = ':>',\r\n WOW = ':o',\r\n CRY = ':-((',\r\n ANGRY = ':-h',\r\n KISS = ':-*',\r\n TEARS_OF_JOY = \":')\",\r\n SHIT = '/-shit',\r\n ROSE = '/-rose',\r\n BROKEN_HEART = '/-break',\r\n DISLIKE = '/-weak',\r\n LOVE = ';xx',\r\n CONFUSED = ';-/',\r\n WINK = ';-)',\r\n FADE = '/-fade',\r\n SUN = '/-li',\r\n BIRTHDAY = '/-bd',\r\n BOMB = '/-bome',\r\n OK = '/-ok',\r\n PEACE = '/-v',\r\n THANKS = '/-thanks',\r\n PUNCH = '/-punch',\r\n SHARE = '/-share',\r\n PRAY = '_()_',\r\n NO = '/-no',\r\n BAD = '/-bad',\r\n LOVE_YOU = '/-loveu',\r\n SAD = '--b',\r\n VERY_SAD = ':((',\r\n COOL = 'x-)',\r\n NERD = '8-)',\r\n BIG_SMILE = ';-d',\r\n SUNGLASSES = 'b-)',\r\n NEUTRAL = ':--|',\r\n SAD_FACE = 'p-(',\r\n BYE = ':-bye',\r\n SLEEPY = '|-)',\r\n WIPE = ':wipe',\r\n DIG = ':-dig',\r\n ANGUISH = '&-(',\r\n HANDCLAP = ':handclap',\r\n ANGRY_FACE = '>-|',\r\n F_CHAIR = ':-f',\r\n L_CHAIR = ':-l',\r\n R_CHAIR = ':-r',\r\n SILENT = ';-x',\r\n SURPRISE = ':-o',\r\n EMBARRASSED = ';-s',\r\n AFRAID = ';-a',\r\n SAD2 = ':-<',\r\n BIG_LAUGH = ':))',\r\n RICH = '$-)',\r\n BEER = '/-beer',\n}\n\nexport enum AttachmentMediaType {\n Image = 'image',\n Video = 'video',\n Audio = 'audio',\n File = 'file',\n}\n\r\n// ==================== TYPED INTERFACES ====================\r\n\r\n/**\r\n * Style interface - chuẩn theo automation-web StyleDto\r\n */\r\nexport interface Style {\r\n /**\r\n * Vị trí bắt đầu của style\r\n */\r\n start: number;\r\n\r\n /**\r\n * Độ dài của text được style\r\n */\r\n len: number;\r\n\r\n /**\r\n * Loại style\r\n */\r\n st: TextStyle;\r\n}\r\n\r\n/**\r\n * Mention interface - chuẩn theo automation-web MentionDto\r\n */\r\nexport interface Mention {\r\n /**\r\n * Vị trí của mention trong text\r\n */\r\n pos: number;\r\n\r\n /**\r\n * User ID được mention\r\n */\r\n uid: string;\r\n\r\n /**\r\n * Độ dài của mention text\r\n */\r\n len: number;\r\n}\r\n\r\n/**\r\n * Attachment Content interface - chuẩn theo automation-web AttachmentContentDto\r\n */\r\nexport interface AttachmentContent {\r\n /**\r\n * Tiêu đề attachment\r\n */\r\n title?: string;\r\n\r\n /**\r\n * Mô tả attachment\r\n */\r\n description?: string;\r\n\r\n /**\r\n * Link href của attachment\r\n */\r\n href?: string;\r\n\r\n /**\r\n * Link thumbnail\r\n */\r\n thumb?: string;\r\n\r\n /**\r\n * Số lượng children\r\n */\r\n childnumber?: number;\r\n\r\n /**\r\n * Action type\r\n */\r\n action?: string;\r\n\r\n /**\r\n * Parameters JSON string\r\n */\r\n params?: string;\r\n\r\n /**\r\n * Content type\r\n */\r\n type?: string;\r\n}\r\n\r\n/**\r\n * Property Extension interface - chuẩn theo automation-web PropertyExtDto\r\n */\r\nexport interface PropertyExt {\r\n /**\r\n * Màu sắc\r\n */\r\n color?: number;\r\n\r\n /**\r\n * Kích thước\r\n */\r\n size?: number;\r\n\r\n /**\r\n * Loại\r\n */\r\n type?: number;\r\n\r\n /**\r\n * Loại phụ\r\n */\r\n subType?: number;\r\n\r\n /**\r\n * Extension data\r\n */\r\n ext?: string;\r\n}\r\n\r\n/**\r\n * Send Message Quote interface - chuẩn theo automation-web SendMessageQuoteDto\r\n */\r\nexport interface SendMessageQuote {\r\n /**\r\n * Nội dung tin nhắn được quote\r\n */\r\n content: string | AttachmentContent | Record<string, any>;\r\n\r\n /**\r\n * Loại tin nhắn được quote\r\n */\r\n msgType: MessageType;\r\n\r\n /**\r\n * Property extension của tin nhắn được quote\r\n */\r\n propertyExt?: PropertyExt;\r\n\r\n /**\r\n * User ID người gửi tin nhắn được quote\r\n */\r\n uidFrom: string;\r\n\r\n /**\r\n * Message ID được quote\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client Message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * Timestamp (string format)\r\n */\r\n ts: string;\r\n\r\n /**\r\n * Time to live (seconds)\r\n */\r\n ttl: number;\r\n}\r\n\r\n/**\r\n * Attachment Metadata interface - chuẩn theo automation-web AttachmentMetadataDto\r\n */\r\nexport interface AttachmentMetadata {\r\n /**\r\n * Kích thước file (bytes)\r\n */\r\n totalSize: number;\r\n\r\n /**\r\n * Chiều rộng (cho ảnh/video)\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Chiều cao (cho ảnh/video)\r\n */\r\n height?: number;\r\n}\r\n\r\n/**\r\n * Attachment interface - chuẩn theo automation-web AttachmentDto\r\n */\r\nexport interface Attachment {\n /**\r\n * URL để tải file từ internet\r\n */\r\n url?: string;\r\n\r\n /**\r\n * Tên file (bắt buộc khi dùng URL hoặc Buffer)\r\n */\r\n filename?: string;\n\n mediaType?: AttachmentMediaType;\n\r\n /**\r\n * HTTP headers cho download (khi dùng URL)\r\n */\r\n headers?: Record<string, string>;\r\n\r\n /**\r\n * Đường dẫn file local\r\n */\r\n filePath?: string;\r\n\r\n /**\r\n * Base64 encoded file data\r\n */\r\n base64Data?: string;\r\n\r\n /**\r\n * Metadata của file (bắt buộc khi dùng base64Data)\r\n */\r\n metadata?: AttachmentMetadata;\r\n}\r\n\r\n// ==================== REQUEST DTOs ====================\r\n\r\n/**\r\n * DTO để gửi tin nhắn - chuẩn theo automation-web SendMessageDto\r\n */\r\nexport interface SendMessageRequest {\r\n /**\r\n * Nội dung tin nhắn\r\n */\r\n msg: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Text styles - định dạng văn bản\r\n */\r\n styles?: Style[];\r\n\r\n /**\r\n * Mentions trong tin nhắn\r\n */\r\n mentions?: Mention[];\r\n\r\n /**\r\n * Quote message - tin nhắn được trả lời\r\n */\r\n quote?: SendMessageQuote;\r\n\r\n /**\r\n * Danh sách file đính kèm\r\n */\r\n attachments?: Attachment[];\r\n\r\n /**\r\n * Mức độ ưu tiên tin nhắn\r\n */\r\n urgency?: Urgency;\r\n\r\n /**\r\n * Time to live - thời gian tự hủy tin nhắn (milliseconds)\r\n */\r\n ttl?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi sticker - chuẩn theo automation-web SendStickerDto\r\n */\r\nexport interface SendStickerRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * ID của sticker\r\n */\r\n stickerId: string;\r\n}\r\n\r\n/**\r\n * DTO để gửi voice message - chuẩn theo automation-web SendVoiceDto\r\n */\r\nexport interface SendVoiceRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * URL của file voice\r\n */\r\n fileUrl: string;\r\n\r\n /**\r\n * Thời lượng voice (giây)\r\n */\r\n duration?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi video message - chuẩn theo automation-web SendVideoDto\r\n */\r\nexport interface SendVideoRequest {\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * URL của video\r\n */\r\n videoUrl: string;\r\n\r\n /**\r\n * Thời lượng video (giây)\r\n */\r\n duration?: number;\r\n\r\n /**\r\n * Chiều rộng video\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Chiều cao video\r\n */\r\n height?: number;\n}\n\nexport interface SendFileRequest {\n sessionId: string;\n threadId: string;\n type: ThreadType;\n fileUrl: string;\n fileName: string;\n msg?: string;\n headers?: Record<string, string>;\n ttl?: number;\n}\n\r\n/**\r\n * DTO để gửi link message - chuẩn theo automation-web SendLinkDto\r\n */\r\nexport interface SendLinkRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Link cần gửi\r\n */\r\n link: string;\r\n\r\n /**\r\n * Tin nhắn kèm theo link\r\n */\r\n msg?: string;\r\n\r\n /**\r\n * Time to live (giây)\r\n */\r\n ttl?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi contact card - chuẩn theo automation-web SendCardDto\r\n */\r\nexport interface SendCardRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * User ID của người cần chia sẻ thông tin\r\n */\r\n userId: string;\r\n\r\n /**\r\n * Số điện thoại của người cần chia sẻ thông tin\r\n */\r\n phoneNumber?: string;\r\n}\r\n\r\n/**\r\n * DTO để chuyển tiếp tin nhắn - chuẩn theo automation-web ForwardMessageDto\r\n */\r\nexport interface ForwardMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Tin nhắn cần chuyển tiếp\r\n */\r\n message: any;\r\n\r\n /**\r\n * Danh sách thread IDs đích\r\n */\r\n threadIds: string[];\r\n\r\n /**\r\n * Loại thread đích\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Reference message (optional)\r\n */\r\n reference?: any;\r\n}\r\n\r\n/**\r\n * DTO để xóa tin nhắn - chuẩn theo automation-web DeleteMessageDto\r\n */\r\nexport interface DeleteMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID tin nhắn cần xóa\r\n */\r\n messageId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n/**\r\n * DTO để thu hồi tin nhắn (undo) - chuẩn theo automation-web UndoMessageDto\r\n */\r\nexport interface UndoMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID tin nhắn cần thu hồi\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n/**\r\n * DTO để thêm reaction - chuẩn theo automation-web AddReactionDto\r\n */\r\nexport interface AddReactionRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Loại reaction (sử dụng ZaloReactions enum)\r\n */\r\n reaction: ZaloReactions;\r\n\r\n /**\r\n * Message ID (global message ID)\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n// ==================== RESPONSE DTOs ====================\r\n\r\n/**\r\n * Send Message Result từ Zalo SDK\r\n */\r\nexport interface SendMessageResult {\r\n msgId: number;\r\n}\r\n\r\n/**\r\n * Response DTO cho send message - chuẩn theo automation-web SendMessageResponseDto\r\n */\r\nexport interface SendMessageResponse {\r\n /**\r\n * Thông tin tin nhắn đã gửi (null nếu không có tin nhắn text)\r\n */\r\n message: SendMessageResult | null;\r\n\r\n /**\r\n * Thông tin attachments đã gửi\r\n */\r\n attachment: SendMessageResult[];\r\n\r\n /**\r\n * Trạng thái thành công\r\n */\r\n success?: boolean;\r\n\r\n /**\r\n * Thông báo lỗi nếu có\r\n */\r\n error?: string;\r\n}\r\n\r\n/**\r\n * Response types từ zalo-personal SDK - import từ automation-web\r\n */\r\nexport interface SendStickerResponse {\r\n success: boolean;\r\n messageId?: string;\r\n error?: string;\r\n}\r\n\r\nexport interface SendVoiceResponse {\r\n success: boolean;\r\n messageId?: string;\r\n error?: string;\r\n}\r\n\r\nexport type SendVideoResponse = {\r\n msgId: number;\r\n};\r\n\r\nexport type SendLinkResponse = {\r\n msgId: string;\r\n};\r\n\r\nexport type SendCardResponse = {\r\n msgId: number;\r\n};\r\n\r\nexport type Success = {\r\n clientId: string;\r\n msgId: string;\r\n};\r\nexport type Failed = {\r\n clientId: string;\r\n errorCode: number;\r\n errorMessage: string;\r\n};\r\n\r\nexport interface ForwardMessageResponse {\r\n success: boolean;\r\n messageIds?: string[];\r\n error?: string;\r\n}\r\n\r\nexport type DeleteMessageResponse = {\r\n status: number;\r\n};\r\n\r\nexport type UndoResponse = {\r\n status: number;\r\n};\r\n\r\nexport interface AddReactionResponse {\r\n success: boolean;\r\n error?: string;\r\n}\r\n\r\nexport interface AddQuickMessageRequest {\r\n sessionId: string;\r\n shortMessage: string;\r\n longMessage: string;\r\n}\r\n\r\nexport interface QuickMessageItem {\r\n id: number;\r\n keyword: string;\r\n type: number;\r\n createdTime: number;\r\n lastModified: number;\r\n message: {\r\n title: string;\r\n params: string | null;\r\n };\r\n media: any;\r\n}\r\n\r\nexport interface AddQuickMessageResponse {\r\n item: QuickMessageItem;\r\n version: number;\r\n}\r\n\r\nexport interface UpdateQuickMessageRequest {\r\n sessionId: string;\r\n quickMessageId: string;\r\n shortMessage: string;\r\n longMessage: string;\r\n}\r\n\r\nexport interface GetQuickMessageListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetQuickMessageListResponse {\r\n cursor: number;\r\n items: QuickMessageItem[];\r\n version: number;\r\n}\r\n\r\nexport interface CreateAutoReplyRequest {\r\n sessionId: string;\r\n message: string;\r\n}\r\n\r\nexport interface AutoReplyItem {\r\n id: number;\r\n enable: boolean;\r\n content: string;\r\n startTime: number;\r\n endTime: number;\r\n scope: number;\r\n}\r\n\r\nexport interface CreateAutoReplyResponse {\r\n item: AutoReplyItem;\r\n version: number;\r\n}\r\n\r\nexport interface GetAutoReplyListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetAutoReplyListResponse {\r\n item: AutoReplyItem[];\r\n version: number;\r\n}\r\n\r\nexport interface DeleteAutoReplyRequest {\r\n sessionId: string;\r\n autoReplyId: string;\r\n}\r\n\r\nexport interface StandardResponse {\r\n item: any;\r\n version: number;\r\n}\r\n\r\nexport interface DeleteChatRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface GetLabelsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface LabelItem {\n id: number;\n text: string;\n textKey: string;\n conversations: string[];\n color: string;\n offset: number;\n emoji: string;\n createTime: number;\n}\n\nexport interface GetLabelsResponse {\n labelData: LabelItem[];\n version: number;\n lastUpdateTime: number;\n}\n\nexport interface UpdateLabelsRequest {\n sessionId: string;\n labelData: LabelItem[];\n version: number;\n}\n\nexport type UpdateLabelsResponse = GetLabelsResponse;\n\nexport interface UpdateConversationLabelRequest {\n sessionId: string;\n labelId: number;\n threadId: string;\n type: ThreadType;\n}\n\nexport type UpdateConversationLabelResponse = GetLabelsResponse;\n\nexport interface GetMuteRequest {\n sessionId: string;\n}\n\r\nexport interface MuteEntriesInfo {\r\n id: string;\r\n duration: number;\r\n startTime: number;\r\n systemTime: number;\r\n currentTime: number;\r\n muteMode: number;\r\n}\r\n\r\nexport interface GetMuteResponse {\r\n chatEntries: MuteEntriesInfo[];\r\n groupChatEntries: MuteEntriesInfo[];\r\n}\r\n\r\nexport interface MessagingParseLinkRequest {\r\n sessionId: string;\r\n link: string;\r\n}\r\n\r\nexport interface MessagingParseLinkResponse {\r\n data: {\r\n thumb: string;\r\n title: string;\r\n desc: string;\r\n src: string;\r\n href: string;\r\n media: any;\r\n stream_icon: string;\r\n };\r\n error_maps: Record<string, number>;\r\n}\r\n\r\nexport interface AddUnreadMarkRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface AddUnreadMarkResponse {\r\n data: {\r\n updateId: number;\r\n };\r\n status: number;\r\n}\r\n\r\n// ==================== NEW BATCH TYPES ====================\r\n\r\nexport interface GetSearchStickerRequest {\r\n sessionId: string;\r\n keyword: string;\r\n}\r\n\r\nexport interface GetSearchStickerResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetStickerCategoryDetailRequest {\r\n sessionId: string;\r\n categoryId: string;\r\n}\r\n\r\nexport interface GetStickerCategoryDetailResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetStickersRequest {\r\n sessionId: string;\r\n keyword: string;\r\n}\r\n\r\nexport interface GetStickersResponse {\r\n items: number[];\r\n}\r\n\r\nexport interface GetStickersDetailRequest {\r\n sessionId: string;\r\n stickerIds: string[];\r\n}\r\n\r\nexport interface GetStickersDetailResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetArchivedChatListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetArchivedChatListResponse {\r\n items: any[];\r\n version: number;\r\n}\r\n\r\nexport interface GetAutoDeleteChatRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface GetAutoDeleteChatResponse {\r\n convers: {\r\n destId: string;\r\n isGroup: boolean;\r\n ttl: number;\r\n createdAt: number;\r\n }[];\r\n}\r\n\r\nexport interface GetHiddenConversationsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetHiddenConversationsResponse {\r\n pin: string;\r\n threads: {\r\n is_group: number;\r\n thread_id: string;\r\n }[];\r\n}\r\n\r\nexport interface GetPinConversationsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetPinConversationsResponse {\r\n conversations: string[];\r\n version: number;\r\n}\r\n\r\nexport interface RemoveQuickMessageRequest {\r\n sessionId: string;\r\n quickMessageId: string;\r\n}\r\n\r\nexport interface RemoveQuickMessageResponse {\r\n itemIds: number[];\r\n version: number;\r\n}\r\n","/**\r\n * Session Proxy types and DTOs\r\n */\r\n\r\nexport enum ProxyProtocol {\r\n HTTP = 'http',\r\n HTTPS = 'https',\r\n SOCKS5 = 'socks5',\r\n}\r\n\r\nexport enum ProxyStatus {\r\n ACTIVE = 'active',\r\n DISABLED = 'disabled',\r\n BANNED = 'banned',\r\n}\r\n\r\n/**\r\n * Request DTO for assigning proxy to session\r\n */\r\nexport interface AssignProxyToSessionRequest {\r\n /**\r\n * ID của session cần gắn proxy\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID của proxy cần gắn\r\n */\r\n proxyId: string;\r\n}\r\n\r\n/**\r\n * Response DTO for assign proxy operation\r\n */\r\nexport interface AssignProxyToSessionResponse {\r\n /**\r\n * Trạng thái thành công\r\n */\r\n success: boolean;\r\n\r\n /**\r\n * ID của session đã được gắn proxy\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID của proxy đã được gắn\r\n */\r\n proxyId: string;\r\n\r\n /**\r\n * Thông báo kết quả\r\n */\r\n message?: string;\r\n\r\n /**\r\n * Thông báo lỗi (nếu có)\r\n */\r\n error?: string;\r\n}\r\n","/**\n * Formatting utility functions\n */\n\nimport { StyleDto, MentionDto } from '../types/common.types';\n\n/**\n * Formatting utilities class\n */\nexport class FormatUtils {\n /**\n * Format timestamp to readable string\n */\n static formatTimestamp(timestamp: string | number): string {\n const date = new Date(typeof timestamp === 'string' ? parseInt(timestamp) : timestamp);\n return date.toLocaleString();\n }\n\n /**\n * Format duration in milliseconds to human readable format\n */\n static formatDuration(ms: number): string {\n if (ms < 1000) {\n return `${ms}ms`;\n }\n\n const seconds = Math.floor(ms / 1000);\n if (seconds < 60) {\n return `${seconds}s`;\n }\n\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) {\n return remainingSeconds > 0 ? `${minutes}m ${remainingSeconds}s` : `${minutes}m`;\n }\n\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return remainingMinutes > 0 ? `${hours}h ${remainingMinutes}m` : `${hours}h`;\n }\n\n /**\n * Format file size in bytes to human readable format\n */\n static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n if (bytes === 0) return '0 Bytes';\n \n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n const size = bytes / Math.pow(1024, i);\n \n return `${Math.round(size * 100) / 100} ${sizes[i]}`;\n }\n\n /**\n * Format phone number for display\n */\n static formatPhoneNumber(phoneNumber: string): string {\n // Remove all non-digit characters\n const cleaned = phoneNumber.replace(/\\D/g, '');\n \n // Vietnamese phone number formatting\n if (cleaned.startsWith('84')) {\n // International format\n const number = cleaned.substring(2);\n if (number.length === 9) {\n return `+84 ${number.substring(0, 3)} ${number.substring(3, 6)} ${number.substring(6)}`;\n }\n } else if (cleaned.startsWith('0')) {\n // Domestic format\n if (cleaned.length === 10) {\n return `${cleaned.substring(0, 4)} ${cleaned.substring(4, 7)} ${cleaned.substring(7)}`;\n }\n }\n \n return phoneNumber; // Return original if can't format\n }\n\n /**\n * Truncate text with ellipsis\n */\n static truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) {\n return text;\n }\n \n return text.substring(0, maxLength - 3) + '...';\n }\n\n /**\n * Capitalize first letter of each word\n */\n static capitalizeWords(text: string): string {\n return text.replace(/\\b\\w/g, char => char.toUpperCase());\n }\n\n /**\n * Convert camelCase to kebab-case\n */\n static camelToKebab(text: string): string {\n return text.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n }\n\n /**\n * Convert kebab-case to camelCase\n */\n static kebabToCamel(text: string): string {\n return text.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n }\n\n /**\n * Format percentage\n */\n static formatPercentage(value: number, decimals: number = 1): string {\n return `${(value * 100).toFixed(decimals)}%`;\n }\n\n /**\n * Format number with thousand separators\n */\n static formatNumber(num: number): string {\n return num.toLocaleString();\n }\n\n /**\n * Create styled text with formatting\n */\n static createStyledText(text: string, styles: Array<{\n start: number;\n length: number;\n style: 'bold' | 'italic' | 'underline' | 'strikethrough';\n }>): { content: string; styles: StyleDto[] } {\n const styleMap = {\n bold: 'font-weight:bold',\n italic: 'font-style:italic',\n underline: 'text-decoration:underline',\n strikethrough: 'text-decoration:line-through',\n };\n\n const formattedStyles: StyleDto[] = styles.map(style => ({\n start: style.start,\n len: style.length,\n st: styleMap[style.style],\n }));\n\n return {\n content: text,\n styles: formattedStyles,\n };\n }\n\n /**\n * Create mentions in text\n */\n static createMentions(text: string, mentions: Array<{\n userId: string;\n displayName: string;\n start: number;\n }>): { content: string; mentions: MentionDto[] } {\n const formattedMentions: MentionDto[] = mentions.map(mention => ({\n uid: mention.userId,\n start: mention.start,\n len: mention.displayName.length,\n }));\n\n return {\n content: text,\n mentions: formattedMentions,\n };\n }\n\n /**\n * Extract mentions from text (e.g., @username)\n */\n static extractMentions(text: string): Array<{\n username: string;\n start: number;\n length: number;\n }> {\n const mentionRegex = /@(\\w+)/g;\n const mentions: Array<{ username: string; start: number; length: number }> = [];\n let match;\n\n while ((match = mentionRegex.exec(text)) !== null) {\n mentions.push({\n username: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return mentions;\n }\n\n /**\n * Extract hashtags from text\n */\n static extractHashtags(text: string): Array<{\n hashtag: string;\n start: number;\n length: number;\n }> {\n const hashtagRegex = /#(\\w+)/g;\n const hashtags: Array<{ hashtag: string; start: number; length: number }> = [];\n let match;\n\n while ((match = hashtagRegex.exec(text)) !== null) {\n hashtags.push({\n hashtag: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return hashtags;\n }\n\n /**\n * Extract URLs from text\n */\n static extractUrls(text: string): Array<{\n url: string;\n start: number;\n length: number;\n }> {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const urls: Array<{ url: string; start: number; length: number }> = [];\n let match;\n\n while ((match = urlRegex.exec(text)) !== null) {\n urls.push({\n url: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return urls;\n }\n\n /**\n * Clean text by removing special characters\n */\n static cleanText(text: string): string {\n return text\n .replace(/[^\\w\\s\\u00C0-\\u024F\\u1E00-\\u1EFF]/g, '') // Keep alphanumeric, spaces, and Vietnamese characters\n .replace(/\\s+/g, ' ') // Normalize whitespace\n .trim();\n }\n\n /**\n * Generate random string\n */\n static generateRandomString(length: number): string {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n \n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n \n return result;\n }\n\n /**\n * Generate UUID v4\n */\n static generateUuid(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0;\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n /**\n * Escape HTML characters\n */\n static escapeHtml(text: string): string {\n const htmlEscapes: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#x27;',\n '/': '&#x2F;',\n };\n\n return text.replace(/[&<>\"'/]/g, (char) => htmlEscapes[char]);\n }\n\n /**\n * Unescape HTML characters\n */\n static unescapeHtml(text: string): string {\n const htmlUnescapes: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#x27;': \"'\",\n '&#x2F;': '/',\n };\n\n return text.replace(/&(?:amp|lt|gt|quot|#x27|#x2F);/g, (entity) => htmlUnescapes[entity]);\n }\n\n /**\n * Convert text to slug format\n */\n static toSlug(text: string): string {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove diacritics\n .replace(/[^a-z0-9\\s-]/g, '') // Remove special characters\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/-+/g, '-') // Replace multiple hyphens with single\n .trim()\n .replace(/^-+|-+$/g, ''); // Remove leading/trailing hyphens\n }\n\n /**\n * Format relative time (e.g., \"2 hours ago\")\n */\n static formatRelativeTime(timestamp: string | number): string {\n const now = Date.now();\n const time = typeof timestamp === 'string' ? parseInt(timestamp) : timestamp;\n const diff = now - time;\n\n const seconds = Math.floor(diff / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const weeks = Math.floor(days / 7);\n const months = Math.floor(days / 30);\n const years = Math.floor(days / 365);\n\n if (seconds < 60) return 'just now';\n if (minutes < 60) return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;\n if (hours < 24) return `${hours} hour${hours > 1 ? 's' : ''} ago`;\n if (days < 7) return `${days} day${days > 1 ? 's' : ''} ago`;\n if (weeks < 4) return `${weeks} week${weeks > 1 ? 's' : ''} ago`;\n if (months < 12) return `${months} month${months > 1 ? 's' : ''} ago`;\n return `${years} year${years > 1 ? 's' : ''} ago`;\n }\n\n /**\n * Mask sensitive information\n */\n static maskSensitiveInfo(text: string, type: 'phone' | 'email' | 'custom', customPattern?: RegExp): string {\n switch (type) {\n case 'phone':\n return text.replace(/(\\d{3})\\d{4}(\\d{3})/, '$1****$2');\n case 'email':\n return text.replace(/(.{2}).*@(.*)/, '$1***@$2');\n case 'custom':\n if (customPattern) {\n return text.replace(customPattern, '***');\n }\n return text;\n default:\n return text;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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,qFACN,MAAM,iFACN,MAAM,2EACN,MAAM,+EACN,MAAM,iFACN,MAAM,+EACN,MAAM,iFACN,MAAM,mDACN,MAAM,qDACN,MAAM,mEACN,MAAM,2DACN,MAAM,mEACN,MAAM,qDACN,MAAM;AACf;AAKO,SAAS,YAAY,OAAkC;AAC5D,QAAM,YAAY,MAAM;AAGxB,SAAO,6EACA,+EACA,+EACA,iFACA,+EACA,iFACA,+EACA,iFACA,6EACA,+EACA,mFACA,qFACA,qFACA,uFACA,2EACA,6EACA,6EACA,+EACA,iFACA,mFACA,2FACA;AAAA,EAEA,uEACA;AAAA,EAEA,qFACA;AAAA,EAEA,+FACA;AAAA,EAEA,2EACA;AAAA,EAEA,mEACA;AACT;AAKO,SAAS,aAAa,OAAkC;AAC7D,QAAM,YAAY,MAAM;AAGxB,SAAO,yFACA,2FACA,2FACA,6FACA,2FACA,6FACA,2FACA,6FACA,yFACA,2FACA,+FACA,iGACA,iGACA,mGACA,uFACA,yFACA,yFACA,2FACA,6FACA,+FACA,uGACA;AAAA,EAEA,yEACA;AAAA,EAEA,uFACA;AAAA,EAEA,iGACA;AAAA,EAEA,6EACA;AAAA,EAEA,qEACA;AACT;AAKO,SAAS,kBAAkB,OAAkC;AAClE,QAAM,YAAY,MAAM;AAGxB,SAAO,6EACA,yFACA,+EACA,2FACA,+EACA,2FACA,+EACA,2FACA,6EACA,yFACA,mFACA,+FACA,qFACA,iGACA,2EACA,uFACA,6EACA,yFACA,iFACA,6FACA,2FACA;AAAA,EAEA,uEACA,yEACA,qFACA,uFACA,+FACA,iGACA,2EACA,6EACA,mEACA,qEACA,+EACA;AACT;AAKO,SAAS,mBAAmB,OAAkC;AACnE,QAAM,YAAY,MAAM;AAGxB,SAAO,+EACA,2FACA,iFACA,6FACA,iFACA,6FACA,iFACA,6FACA,+EACA,2FACA,qFACA,iGACA,uFACA,mGACA,6EACA,yFACA,+EACA,2FACA,mFACA,+FACA,6FACA;AAAA,EAEA,yEACA,2EACA,uFACA,yFAC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,iGACA,uFACA,mGACA,6EACA,yFACA,+EACA,2FACA,mFACA,+FACA,6FACA,yGACA,yEACA,2EACA,uFACA,yFACA,iGACA,mGACA,6EACA,+EACA,qEACA,uEACA,iFACA,iFACA,kBAAkB,SAAS,SAAgB,GAAG;AAChD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,SAAS,sBAAsB,WAA+D;AAEnG,MAAI,6EACA,+EACA,+EACA,iFACA,+EACA,iFACA,+EACA,iFACA,6EACA,+EACA,mFACA,qFACA,qFACA,uFACA,2EACA,6EACA,6EACA,+EACA,iFACA,mFACA,2FACA,6FACA,uEACA,yEACA,qFACA,uFACA,+FACA,iGACA,2EACA,6EACA,mEACA,mEAA0D;AAC5D,WAAO;AAAA,EACT;AAGA,MAAI,yFACA,2FACA,2FACA,6FACA,2FACA,6FACA,2FACA,6FACA,yFACA,2FACA,+FACA,iGACA,iGACA,mGACA,uFACA,yFACA,yFACA,2FACA,6FACA,+FACA,uGACA,yGACA,yEACA,2EACA,uFACA,yFACA,iGACA,mGACA,6EACA,+EACA,qEACA,qEAA2D;AAC7D,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAQO,SAAS,0BAA0B,OAAoD;AAC5F,QAAM,YAAY,MAAM;AAExB,SAAO,yFACA,2FACA,2FACA,2FACA,yFACA,+FACA,iGACA,uFACA,yFACA,6FACA;AACT;AAMO,SAAS,2BAA2B,OAAoD;AAC7F,QAAM,YAAY,MAAM;AAExB,SAAO,2FACA,6FACA,6FACA,6FACA,2FACA,iGACA,mGACA,yFACA,2FACA,+FACA;AACT;AAMO,SAAS,qBAAqB,OAAoD;AACvF,QAAM,YAAY,MAAM;AAExB,SAAO,+EACA,iFACA,iFACA,iFACA,+EACA,qFACA,uFACA,6EACA,+EACA,mFACA;AACT;AAMO,SAAS,oBAAoB,OAAoD;AACtF,QAAM,YAAY,MAAM;AAExB,SAAO,6EACA,+EACA,+EACA,+EACA,6EACA,mFACA,qFACA,2EACA,6EACA,iFACA;AACT;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AAU,EAAE;AACvC,UAAM,QAAQ,KAAK,MAAM,UAAU,EAAE;AACrC,UAAM,OAAO,KAAK,MAAM,QAAQ,EAAE;AAClC,UAAM,QAAQ,KAAK,MAAM,OAAO,CAAC;AACjC,UAAM,SAAS,KAAK,MAAM,OAAO,EAAE;AACnC,UAAM,QAAQ,KAAK,MAAM,OAAO,GAAG;AAEnC,QAAI,UAAU,GAAI,QAAO;AACzB,QAAI,UAAU,GAAI,QAAO,GAAG,OAAO,UAAU,UAAU,IAAI,MAAM,EAAE;AACnE,QAAI,QAAQ,GAAI,QAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAC3D,QAAI,OAAO,EAAG,QAAO,GAAG,IAAI,OAAO,OAAO,IAAI,MAAM,EAAE;AACtD,QAAI,QAAQ,EAAG,QAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAC1D,QAAI,SAAS,GAAI,QAAO,GAAG,MAAM,SAAS,SAAS,IAAI,MAAM,EAAE;AAC/D,WAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,kBAAkB,MAAc,MAAoC,eAAgC;AACzG,YAAQ,MAAM;AAAA,MACZ,KAAK;AACH,eAAO,KAAK,QAAQ,uBAAuB,UAAU;AAAA,MACvD,KAAK;AACH,eAAO,KAAK,QAAQ,iBAAiB,UAAU;AAAA,MACjD,KAAK;AACH,YAAI,eAAe;AACjB,iBAAO,KAAK,QAAQ,eAAe,KAAK;AAAA,QAC1C;AACA,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IACX;AAAA,EACF;AACF;","names":["Gender","ThreadType","Urgency","ZaloWebhookEventType","axios","ThreadType","Urgency","ZaloMessageType","ZaloMessageCategory","SessionStatus","ThreadType","DestType","ReminderRepeatMode","Gender","BoardType","Reactions","FriendEventType","GroupEventType","ZaloThreadType","ZaloConnectionStatus","ZaloWebhookEventType","JobPriority","JobStatus","Gender","UpdateSettingsType","UpdateLangAvailableLanguages","SortOrder","SortByField","ThreadType","TextStyle","Urgency","MessageType","ZaloReactions","AttachmentMediaType","ProxyProtocol","ProxyStatus"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/http.utils.ts","../src/types/common.types.ts","../src/utils/validation.utils.ts","../src/utils/event.utils.ts","../src/types/webhook.types.ts","../src/services/auth/auth.service.ts","../src/services/messaging/messaging.service.ts","../src/services/advanced-messaging/advanced-messaging.service.ts","../src/services/webhook/webhook.service.ts","../src/services/groups/groups.service.ts","../src/services/friends/friends.service.ts","../src/services/user-info/user-info.service.ts","../src/services/profile/profile.service.ts","../src/services/search/search.service.ts","../src/services/session-proxy/session-proxy.service.ts","../src/services/zalo-me/zalo-me.service.ts","../src/services/zalo-poll/zalo-poll.service.ts","../src/services/zalo-utils/zalo-utils.service.ts","../src/services/proxy/proxy.service.ts","../src/services/user-proxy/user-proxy.service.ts","../src/services/zalo-tool/zalo-tool.service.ts","../src/services/health/health.service.ts","../src/services/instance-manager/instance-manager.service.ts","../src/client/AutomationWebClient.ts","../src/types/auth.types.ts","../src/types/webhook/enums.ts","../src/types/webhook/message.ts","../src/types/webhook/typing.ts","../src/types/webhook/reaction.ts","../src/types/webhook/seen-message.ts","../src/types/webhook/delivered-message.ts","../src/types/webhook/undo.ts","../src/types/job/webhook-job.types.ts","../src/types/job/index.ts","../src/types/dto/profile.type.ts","../src/types/dto/proxy.type.ts","../src/types/dto/messaging.type.ts","../src/types/dto/session-proxy.type.ts","../src/utils/format.utils.ts"],"sourcesContent":["/**\n * Main entry point for RedAI Automation Web SDK\n */\n\n// Export main client\nexport { AutomationWebClient } from './client';\n\n// Export all types\nexport * from './types';\nexport { WebhookEvent } from './types/webhook.types';\n\n// Export webhook types specifically for convenience\nexport {\n Message,\n UserMessage,\n GroupMessage,\n Typing,\n UserTyping,\n GroupTyping,\n Reaction,\n SeenMessage,\n UserSeenMessage,\n GroupSeenMessage,\n DeliveredMessage,\n UserDeliveredMessage,\n GroupDeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n ThreadType,\n FriendEventType,\n GroupEventType,\n Reactions,\n DestType,\n ReminderRepeatMode,\n Gender as WebhookGender,\n BoardType,\n} from './types/webhook';\n\n// Export job types specifically for convenience\nexport {\n // Base job types\n ZaloWebhookEvent,\n ZaloWebhookEventType,\n BaseZaloWebhookEvent,\n WebhookQueueJob,\n JobPriority,\n JobStatus,\n QueueJobConfig,\n BaseQueueJob,\n AllQueueJobs,\n\n // Message job types\n ZaloMessageEvent,\n ZaloTextMessageEvent,\n ZaloImageMessageEvent,\n ZaloVideoMessageEvent,\n ZaloVoiceMessageEvent,\n ZaloFileMessageEvent,\n ZaloStickerMessageEvent,\n ZaloLocationMessageEvent,\n ZaloGifMessageEvent,\n ZaloLinkMessageEvent,\n ZaloDoodleMessageEvent,\n ZaloRecommendedMessageEvent,\n MessageQueueJob,\n MessageQueueJobUnion,\n\n // Event job types\n ZaloTypingEvent,\n ZaloSeenMessagesEvent,\n ZaloDeliveredMessagesEvent,\n ZaloReactionEvent,\n ZaloUndoEvent,\n\n // Friend & Group job types\n ZaloFriendEvent,\n ZaloGroupEvent,\n FriendEventQueueJob,\n GroupEventQueueJob,\n\n // System job types\n ZaloConnectionStatusEvent,\n ZaloUploadAttachmentEvent,\n ZaloCipherKeyEvent,\n ZaloErrorEvent,\n ZaloOldMessagesEvent,\n ZaloSystemEvent,\n ConnectionStatusQueueJob,\n UploadAttachmentQueueJob,\n CipherKeyQueueJob,\n ErrorQueueJob,\n OldMessagesQueueJob,\n SystemQueueJobUnion,\n\n // Helper functions\n isMessageEvent,\n isTypingEvent,\n isReactionEvent,\n isFriendEvent,\n isGroupEvent,\n isSystemEvent,\n isSelfEvent,\n isOtherEvent,\n isUserThreadEvent,\n isGroupThreadEvent,\n getEventCategory,\n getThreadTypeFromEvent,\n getActorTypeFromEvent,\n\n // Message direction helper functions\n isMessageReceivedFromUser,\n isMessageReceivedFromGroup,\n isMessageSentToGroup,\n isMessageSentToUser,\n\n // Constants\n MESSAGE_EVENT_TYPES,\n FRIEND_EVENT_TYPES,\n GROUP_EVENT_TYPES,\n} from './types/job';\n\n// Export services\nexport { AuthService } from './services/auth';\nexport { MessagingService } from './services/messaging';\nexport { AdvancedMessagingService } from './services/advanced-messaging';\nexport { WebhookService } from './services/webhook';\nexport { GroupService } from './services/groups';\nexport { FriendService } from './services/friends';\nexport { UserInfoService } from './services/user-info';\nexport { ProfileService } from './services/profile';\nexport { SearchService } from './services/search';\nexport { SessionProxyService } from './services/session-proxy';\nexport { ZaloMeService } from './services/zalo-me';\nexport { ZaloPollService } from './services/zalo-poll';\nexport { ZaloUtilsService } from './services/zalo-utils';\nexport { ProxyService } from './services/proxy';\nexport { UserProxyService } from './services/user-proxy';\nexport { ZaloToolService } from './services/zalo-tool';\nexport { HealthService } from './services/health';\nexport { InstanceManagerService } from './services/instance-manager';\n\n// Export all friends types\nexport type * from './services/friends';\n\n// Export utilities\nexport * from './utils';\n\n// Export validation error\nexport { ValidationError } from './utils/validation.utils';\n\n// Default export\nexport { AutomationWebClient as default } from './client';\n","/**\n * HTTP utility functions for making API requests\n */\n\nimport axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { AutomationWebConfig, AutomationWebResponse, RequestOptions } from '../types/common.types';\n\n/**\n * HTTP client class for making requests to automation-web API\n */\nexport class HttpClient {\n private axiosInstance: AxiosInstance;\n private config: AutomationWebConfig;\n\n constructor(config: AutomationWebConfig) {\n this.config = config;\n this.axiosInstance = this.createAxiosInstance();\n }\n\n /**\n * Create axios instance with default configuration\n */\n private createAxiosInstance(): AxiosInstance {\n const instance = axios.create({\n baseURL: this.config.baseUrl,\n timeout: this.config.timeout || 30000,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': this.config.userAgent || '@redai/automation-web-sdk/1.9.11',\n ...(this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }),\n },\n });\n\n // Request interceptor\n instance.interceptors.request.use(\n (config: any) => {\n if (this.config.logging) {\n console.log(`[HTTP] ${config.method?.toUpperCase()} ${config.url}`, {\n params: config.params,\n data: config.data,\n });\n }\n return config;\n },\n (error: any) => {\n if (this.config.logging) {\n console.error('[HTTP] Request error:', error);\n }\n return Promise.reject(error);\n }\n );\n\n // Response interceptor\n instance.interceptors.response.use(\n (response: AxiosResponse) => {\n if (this.config.logging) {\n console.log(`[HTTP] ${response.status} ${response.config.url}`, {\n data: response.data,\n });\n }\n return response;\n },\n (error: unknown) => {\n if (this.config.logging) {\n if (axios.isAxiosError(error)) {\n console.error('[HTTP] Response error:', error.response?.data || error.message);\n } else {\n console.error('[HTTP] Response error:', error);\n }\n }\n return Promise.reject(error);\n }\n );\n\n return instance;\n }\n\n /**\n * Make HTTP request (single attempt, no retry)\n */\n private async makeRequestWithRetry<T>(\n requestConfig: AxiosRequestConfig\n ): Promise<AxiosResponse<AutomationWebResponse<T>>> {\n return this.axiosInstance.request(requestConfig);\n }\n\n /**\n * Generic request method\n */\n async request<T = any>(options: RequestOptions): Promise<T> {\n const requestConfig: AxiosRequestConfig = {\n method: options.method,\n url: options.url,\n data: options.data,\n params: options.params,\n headers: options.headers,\n timeout: options.timeout || this.config.timeout,\n };\n\n const response = await this.makeRequestWithRetry<T>(requestConfig);\n return response.data as T;\n }\n\n /**\n * GET request\n */\n async get<T = any>(\n url: string,\n params?: Record<string, any>,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'GET',\n url,\n params,\n headers,\n });\n }\n\n /**\n * POST request\n */\n async post<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'POST',\n url,\n data,\n headers,\n });\n }\n\n /**\n * PUT request\n */\n async put<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'PUT',\n url,\n data,\n headers,\n });\n }\n\n /**\n * DELETE request\n */\n async delete<T = any>(\n url: string,\n params?: Record<string, any>,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'DELETE',\n url,\n params,\n headers,\n });\n }\n\n async deleteWithBody<T = any>(\n url: string,\n data?: any,\n headers?: Record<string, string>\n ): Promise<T> {\n return this.request<T>({\n method: 'DELETE',\n url,\n data,\n headers,\n });\n }\n\n /**\n * PATCH request\n */\n async patch<T = any>(url: string, data?: any, headers?: Record<string, string>): Promise<T> {\n return this.request<T>({\n method: 'PATCH',\n url,\n data,\n headers,\n });\n }\n\n /**\n * Update configuration\n */\n updateConfig(newConfig: Partial<AutomationWebConfig>): void {\n this.config = { ...this.config, ...newConfig };\n this.axiosInstance = this.createAxiosInstance();\n }\n\n /**\n * Get current configuration\n */\n getConfig(): AutomationWebConfig {\n return { ...this.config };\n }\n}\n\n/**\n * Utility functions for HTTP operations\n */\nexport class HttpUtils {\n /**\n * Build query string from parameters\n */\n static buildQueryString(params: Record<string, any>): string {\n const searchParams = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach(item => searchParams.append(key, String(item)));\n } else {\n searchParams.append(key, String(value));\n }\n }\n });\n\n return searchParams.toString();\n }\n\n /**\n * Parse response headers\n */\n static parseHeaders(headers: Record<string, string>): Record<string, string> {\n const parsed: Record<string, string> = {};\n\n Object.entries(headers).forEach(([key, value]) => {\n parsed[key.toLowerCase()] = value;\n });\n\n return parsed;\n }\n\n /**\n * Check if URL is absolute\n */\n static isAbsoluteUrl(url: string): boolean {\n return /^https?:\\/\\//.test(url);\n }\n\n /**\n * Join URL paths\n */\n static joinPaths(...paths: string[]): string {\n return paths\n .map(path => path.replace(/^\\/+|\\/+$/g, ''))\n .filter(path => path.length > 0)\n .join('/');\n }\n\n /**\n * Validate URL format\n */\n static isValidUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Extract domain from URL\n */\n static extractDomain(url: string): string | null {\n try {\n const urlObj = new URL(url);\n return urlObj.hostname;\n } catch {\n return null;\n }\n }\n\n /**\n * Format file size in human readable format\n */\n static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n if (bytes === 0) return '0 Bytes';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];\n }\n\n /**\n * Get MIME type from file extension\n */\n static getMimeType(filename: string): string {\n const ext = filename.split('.').pop()?.toLowerCase();\n const mimeTypes: Record<string, string> = {\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n avi: 'video/avi',\n mov: 'video/quicktime',\n mp3: 'audio/mpeg',\n wav: 'audio/wav',\n pdf: 'application/pdf',\n doc: 'application/msword',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n txt: 'text/plain',\n json: 'application/json',\n xml: 'application/xml',\n zip: 'application/zip',\n rar: 'application/x-rar-compressed',\n };\n\n return mimeTypes[ext || ''] || 'application/octet-stream';\n }\n}\n","/**\n * Common types and interfaces used across the SDK\n */\n\n/**\n * Base response interface from automation-web API\n */\nexport interface AutomationWebResponse<T = any> {\n /**\n * Result data from the API\n */\n result?: T;\n\n /**\n * HTTP status code\n */\n code?: number;\n\n /**\n * Response message\n */\n message?: string;\n\n /**\n * Error message (if any)\n */\n error?: string;\n}\n\n/**\n * SDK Configuration interface\n */\nexport interface AutomationWebConfig {\n /**\n * Base URL of the automation-web API\n * @default 'http://localhost:3000'\n */\n baseUrl: string;\n\n /**\n * Request timeout in milliseconds\n * @default 30000\n */\n timeout?: number;\n\n /**\n * Number of retry attempts for failed requests (deprecated, no-op)\n * @default 0\n */\n retryCount?: number;\n\n /**\n * Delay between retry attempts in milliseconds (deprecated, no-op)\n * @default 0\n */\n retryDelay?: number;\n\n /**\n * API key for authentication (if required)\n */\n apiKey?: string;\n\n /**\n * Custom user agent string\n */\n userAgent?: string;\n\n /**\n * Enable debug logging\n * @default false\n */\n logging?: boolean;\n}\n\n/**\n * Default SDK configuration\n */\nexport const DEFAULT_CONFIG: Required<Omit<AutomationWebConfig, 'apiKey'>> = {\n baseUrl: 'http://localhost:3000',\n timeout: 30000,\n retryCount: 0,\n retryDelay: 0,\n userAgent: '@redai/automation-web-sdk/1.9.11',\n logging: false,\n};\n\n/**\n * Thread type enum for messaging\n */\nexport enum ThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Message urgency levels\n */\nexport enum Urgency {\n LOW = 1,\n NORMAL = 2,\n HIGH = 3,\n}\n\n/**\n * Text style types for message formatting\n */\nexport enum TextStyle {\n BOLD = 'font-weight:bold',\n ITALIC = 'font-style:italic',\n UNDERLINE = 'text-decoration:underline',\n STRIKETHROUGH = 'text-decoration:line-through',\n}\n\n/**\n * Zalo reactions enum\n */\nexport enum ZaloReactions {\n LIKE = '/-heart',\n LOVE = '/-heart',\n HAHA = ':))',\n WOW = ':-o',\n SAD = ':(',\n ANGRY = '>-|',\n HANDCLAP = ':handclap',\n}\n\n/**\n * Style object for message text formatting\n */\nexport interface StyleDto {\n /**\n * Start position of the style\n */\n start: number;\n\n /**\n * Length of the styled text\n */\n len: number;\n\n /**\n * Style type\n */\n st: string;\n}\n\n/**\n * Mention object for tagging users in messages\n */\nexport interface MentionDto {\n /**\n * User ID to mention\n */\n uid: string;\n\n /**\n * Start position of the mention\n */\n start: number;\n\n /**\n * Length of the mention text\n */\n len: number;\n}\n\n/**\n * Quote object for replying to messages\n */\nexport interface SendMessageQuoteDto {\n /**\n * ID of the message being quoted\n */\n msgId: string;\n\n /**\n * Content of the quoted message\n */\n content: string;\n\n /**\n * Author of the quoted message\n */\n author: string;\n}\n\n/**\n * Attachment metadata\n */\nexport interface AttachmentDto {\n /**\n * URL of the attachment\n */\n url: string;\n\n /**\n * File name\n */\n fileName?: string;\n\n /**\n * File size in bytes\n */\n fileSize?: number;\n\n /**\n * MIME type\n */\n mimeType?: string;\n\n /**\n * Duration for audio/video files\n */\n duration?: number;\n\n /**\n * Thumbnail URL for images/videos\n */\n thumbnail?: string;\n}\n\n/**\n * Pagination parameters\n */\nexport interface PaginationParams {\n /**\n * Page number (1-based)\n */\n page?: number;\n\n /**\n * Number of items per page\n */\n limit?: number;\n\n /**\n * Sort field\n */\n sortBy?: string;\n\n /**\n * Sort order\n */\n sortOrder?: 'asc' | 'desc';\n}\n\n/**\n * Paginated response\n */\nexport interface PaginatedResponse<T> {\n /**\n * Array of items\n */\n items: T[];\n\n /**\n * Total number of items\n */\n total: number;\n\n /**\n * Current page number\n */\n page: number;\n\n /**\n * Number of items per page\n */\n limit: number;\n\n /**\n * Total number of pages\n */\n totalPages: number;\n\n /**\n * Whether there are more pages\n */\n hasNext: boolean;\n\n /**\n * Whether there are previous pages\n */\n hasPrev: boolean;\n}\n\n/**\n * Operation result for batch operations\n */\nexport interface OperationResult {\n /**\n * Whether the operation was successful\n */\n success: boolean;\n\n /**\n * Error message if operation failed\n */\n error?: string;\n\n /**\n * Additional data\n */\n data?: any;\n}\n\n/**\n * Batch operation result\n */\nexport interface BatchOperationResult {\n /**\n * Total number of operations attempted\n */\n total: number;\n\n /**\n * Number of successful operations\n */\n successful: number;\n\n /**\n * Number of failed operations\n */\n failed: number;\n\n /**\n * Individual operation results\n */\n results: OperationResult[];\n\n /**\n * Summary of the batch operation\n */\n summary: {\n successRate: number;\n errors: string[];\n };\n}\n\n/**\n * Event handler function type\n */\nexport type EventHandler<T = any> = (data: T) => Promise<void> | void;\n\n/**\n * HTTP method types\n */\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n\n/**\n * Request options for HTTP client\n */\nexport interface RequestOptions {\n method: HttpMethod;\n url: string;\n data?: any;\n params?: Record<string, any>;\n headers?: Record<string, string>;\n timeout?: number;\n}\n","/**\n * Validation utility functions\n */\n\nimport { AutomationWebConfig, ThreadType, Urgency } from '../types/common.types';\n\n/**\n * Validation error class\n */\nexport class ValidationError extends Error {\n constructor(\n message: string,\n public field?: string\n ) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Validation utility class\n */\nexport class ValidationUtils {\n /**\n * Validate session ID format\n */\n static validateSessionId(sessionId: string): void {\n if (!sessionId || typeof sessionId !== 'string') {\n throw new ValidationError('Session ID is required and must be a string', 'sessionId');\n }\n\n if (sessionId.trim().length === 0) {\n throw new ValidationError('Session ID cannot be empty', 'sessionId');\n }\n\n // Check if it matches expected format (session-uuid)\n const sessionIdPattern =\n /^session-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!sessionIdPattern.test(sessionId)) {\n throw new ValidationError('Session ID format is invalid', 'sessionId');\n }\n }\n\n /**\n * Validate creator UUID format\n */\n static validateCreatedBy(createdBy: string): void {\n if (!createdBy || typeof createdBy !== 'string') {\n throw new ValidationError('CreatedBy UUID is required and must be a string', 'createdBy');\n }\n\n const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!uuidPattern.test(createdBy)) {\n throw new ValidationError('CreatedBy UUID format is invalid', 'createdBy');\n }\n }\n\n /**\n * Validate user UUID format (deprecated: use validateCreatedBy)\n */\n static validateUserUuid(userUuid: string): void {\n if (!userUuid || typeof userUuid !== 'string') {\n throw new ValidationError('User UUID is required and must be a string', 'userUuid');\n }\n\n const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n if (!uuidPattern.test(userUuid)) {\n throw new ValidationError('User UUID format is invalid', 'userUuid');\n }\n }\n\n /**\n * Validate thread ID\n */\n static validateThreadId(threadId: string): void {\n if (!threadId || typeof threadId !== 'string') {\n throw new ValidationError('Thread ID is required and must be a string', 'threadId');\n }\n\n if (threadId.trim().length === 0) {\n throw new ValidationError('Thread ID cannot be empty', 'threadId');\n }\n }\n\n /**\n * Validate thread type\n */\n static validateThreadType(threadType: ThreadType): void {\n if (!Object.values(ThreadType).includes(threadType)) {\n throw new ValidationError(\n `Thread type must be one of: ${Object.values(ThreadType).join(', ')}`,\n 'threadType'\n );\n }\n }\n\n /**\n * Validate message content\n */\n static validateMessageContent(content: string): void {\n if (!content || typeof content !== 'string') {\n throw new ValidationError('Message content is required and must be a string', 'content');\n }\n\n if (content.trim().length === 0) {\n throw new ValidationError('Message content cannot be empty', 'content');\n }\n\n // Check maximum length (Zalo limit is typically 2000 characters)\n if (content.length > 2000) {\n throw new ValidationError(\n 'Message content exceeds maximum length of 2000 characters',\n 'content'\n );\n }\n }\n\n /**\n * Validate URL format\n */\n static validateUrl(url: string, fieldName: string = 'url'): void {\n if (!url || typeof url !== 'string') {\n throw new ValidationError(`${fieldName} is required and must be a string`, fieldName);\n }\n\n try {\n new URL(url);\n } catch {\n throw new ValidationError(`${fieldName} must be a valid URL`, fieldName);\n }\n }\n\n /**\n * Validate urgency level\n */\n static validateUrgency(urgency: Urgency): void {\n if (!Object.values(Urgency).includes(urgency)) {\n throw new ValidationError(\n `Urgency must be one of: ${Object.values(Urgency).join(', ')}`,\n 'urgency'\n );\n }\n }\n\n /**\n * Validate phone number format (Vietnamese)\n */\n static validatePhoneNumber(phoneNumber: string): void {\n if (!phoneNumber || typeof phoneNumber !== 'string') {\n throw new ValidationError('Phone number is required and must be a string', 'phoneNumber');\n }\n\n // Vietnamese phone number patterns\n const patterns = [\n /^(\\+84|84|0)(3[2-9]|5[6|8|9]|7[0|6-9]|8[1-6|8|9]|9[0-4|6-9])[0-9]{7}$/, // Mobile\n /^(\\+84|84|0)(2[0-9])[0-9]{8}$/, // Landline\n ];\n\n const isValid = patterns.some(pattern => pattern.test(phoneNumber.replace(/\\s/g, '')));\n if (!isValid) {\n throw new ValidationError('Phone number format is invalid', 'phoneNumber');\n }\n }\n\n /**\n * Validate email format\n */\n static validateEmail(email: string): void {\n if (!email || typeof email !== 'string') {\n throw new ValidationError('Email is required and must be a string', 'email');\n }\n\n const emailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailPattern.test(email)) {\n throw new ValidationError('Email format is invalid', 'email');\n }\n }\n\n /**\n * Validate array of IDs\n */\n static validateIdArray(ids: string[], fieldName: string, minLength: number = 1): void {\n if (!Array.isArray(ids)) {\n throw new ValidationError(`${fieldName} must be an array`, fieldName);\n }\n\n if (ids.length < minLength) {\n throw new ValidationError(\n `${fieldName} must contain at least ${minLength} item(s)`,\n fieldName\n );\n }\n\n ids.forEach((id, index) => {\n if (!id || typeof id !== 'string' || id.trim().length === 0) {\n throw new ValidationError(`${fieldName}[${index}] must be a non-empty string`, fieldName);\n }\n });\n }\n\n /**\n * Validate pagination parameters\n */\n static validatePagination(page?: number, limit?: number): void {\n if (page !== undefined) {\n if (!Number.isInteger(page) || page < 1) {\n throw new ValidationError('Page must be a positive integer', 'page');\n }\n }\n\n if (limit !== undefined) {\n if (!Number.isInteger(limit) || limit < 1 || limit > 100) {\n throw new ValidationError('Limit must be an integer between 1 and 100', 'limit');\n }\n }\n }\n\n /**\n * Validate file size\n */\n static validateFileSize(size: number, maxSize: number = 50 * 1024 * 1024): void {\n // 50MB default\n if (!Number.isInteger(size) || size < 0) {\n throw new ValidationError('File size must be a non-negative integer', 'fileSize');\n }\n\n if (size > maxSize) {\n throw new ValidationError(\n `File size exceeds maximum allowed size of ${this.formatFileSize(maxSize)}`,\n 'fileSize'\n );\n }\n }\n\n /**\n * Validate timeout value\n */\n static validateTimeout(timeout: number): void {\n if (!Number.isInteger(timeout) || timeout < 1000 || timeout > 300000) {\n // 1s to 5min\n throw new ValidationError(\n 'Timeout must be an integer between 1000 and 300000 milliseconds',\n 'timeout'\n );\n }\n }\n\n /**\n * Validate delay value\n */\n static validateDelay(delay: number): void {\n if (!Number.isInteger(delay) || delay < 0 || delay > 60000) {\n // 0 to 1 minute\n throw new ValidationError(\n 'Delay must be an integer between 0 and 60000 milliseconds',\n 'delay'\n );\n }\n }\n\n /**\n * Validate batch size\n */\n static validateBatchSize(batchSize: number): void {\n if (!Number.isInteger(batchSize) || batchSize < 1 || batchSize > 100) {\n throw new ValidationError('Batch size must be an integer between 1 and 100', 'batchSize');\n }\n }\n\n /**\n * Validate retry count\n */\n static validateRetryCount(retryCount: number): void {\n if (!Number.isInteger(retryCount) || retryCount < 0 || retryCount > 10) {\n throw new ValidationError('Retry count must be an integer between 0 and 10', 'retryCount');\n }\n }\n\n /**\n * Validate SDK configuration\n */\n static validateConfig(config: AutomationWebConfig): void {\n // Validate base URL\n this.validateUrl(config.baseUrl, 'baseUrl');\n\n // Validate optional numeric fields\n if (config.timeout !== undefined) {\n this.validateTimeout(config.timeout);\n }\n\n if (config.retryCount !== undefined) {\n this.validateRetryCount(config.retryCount);\n }\n\n if (config.retryDelay !== undefined) {\n this.validateDelay(config.retryDelay);\n }\n\n // Validate user agent\n if (config.userAgent !== undefined && typeof config.userAgent !== 'string') {\n throw new ValidationError('User agent must be a string', 'userAgent');\n }\n\n // Validate logging flag\n if (config.logging !== undefined && typeof config.logging !== 'boolean') {\n throw new ValidationError('Logging must be a boolean', 'logging');\n }\n }\n\n /**\n * Validate date string format\n */\n static validateDateString(dateString: string, fieldName: string = 'date'): void {\n if (!dateString || typeof dateString !== 'string') {\n throw new ValidationError(`${fieldName} is required and must be a string`, fieldName);\n }\n\n const date = new Date(dateString);\n if (isNaN(date.getTime())) {\n throw new ValidationError(`${fieldName} must be a valid date string`, fieldName);\n }\n }\n\n /**\n * Validate date range\n */\n static validateDateRange(startDate: string, endDate: string): void {\n this.validateDateString(startDate, 'startDate');\n this.validateDateString(endDate, 'endDate');\n\n const start = new Date(startDate);\n const end = new Date(endDate);\n\n if (start >= end) {\n throw new ValidationError('Start date must be before end date');\n }\n }\n\n /**\n * Format file size for error messages\n */\n private static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n if (bytes === 0) return '0 Bytes';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];\n }\n\n /**\n * Sanitize string input\n */\n static sanitizeString(input: string): string {\n if (typeof input !== 'string') {\n return '';\n }\n\n return input\n .trim()\n .replace(/[\\x00-\\x1F\\x7F]/g, '') // Remove control characters\n .replace(/\\s+/g, ' '); // Normalize whitespace\n }\n\n /**\n * Validate and sanitize message content\n */\n static sanitizeMessageContent(content: string): string {\n const sanitized = this.sanitizeString(content);\n this.validateMessageContent(sanitized);\n return sanitized;\n }\n\n /**\n * Check if value is empty\n */\n static isEmpty(value: any): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string') {\n return value.trim().length === 0;\n }\n\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (typeof value === 'object') {\n return Object.keys(value).length === 0;\n }\n\n return false;\n }\n\n /**\n * Validate required field\n */\n static validateRequired(value: any, fieldName: string): void {\n if (this.isEmpty(value)) {\n throw new ValidationError(`${fieldName} is required`, fieldName);\n }\n }\n}\n","/**\n * Event handling utility functions\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { WebhookEvent, WebhookEventHandler } from '../types/webhook.types';\n\n/**\n * Event manager class for handling webhook events\n */\nexport class EventManager extends EventEmitter {\n private handlers: Map<string, Set<WebhookEventHandler>> = new Map();\n\n /**\n * Register event handler\n */\n addHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.on(eventType, handler);\n\n if (!this.handlers.has(eventType)) {\n this.handlers.set(eventType, new Set());\n }\n this.handlers.get(eventType)!.add(handler as WebhookEventHandler);\n\n return this;\n }\n\n /**\n * Register one-time event handler\n */\n addOnceHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.once(eventType, handler);\n return this;\n }\n\n /**\n * Remove event handler\n */\n removeHandler<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n handler: WebhookEventHandler<T>\n ): this {\n super.off(eventType, handler);\n\n const handlers = this.handlers.get(eventType);\n if (handlers) {\n handlers.delete(handler as WebhookEventHandler);\n if (handlers.size === 0) {\n this.handlers.delete(eventType);\n }\n }\n\n return this;\n }\n\n /**\n * Remove all handlers for event type\n */\n removeAllListeners(eventType?: string): this {\n if (eventType) {\n super.removeAllListeners(eventType);\n this.handlers.delete(eventType);\n } else {\n super.removeAllListeners();\n this.handlers.clear();\n }\n\n return this;\n }\n\n /**\n * Emit event to all handlers\n */\n async emitAsync<T extends WebhookEvent = WebhookEvent>(\n eventType: string,\n event: T\n ): Promise<void> {\n const handlers = this.handlers.get(eventType);\n if (!handlers || handlers.size === 0) {\n return;\n }\n\n const promises = Array.from(handlers).map(async handler => {\n try {\n await handler(event);\n } catch (error) {\n console.error(`Error in event handler for ${eventType}:`, error);\n this.emit('error', error, eventType, event);\n }\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Get registered event types\n */\n getEventTypes(): string[] {\n return Array.from(this.handlers.keys());\n }\n\n /**\n * Get handler count for event type\n */\n getHandlerCount(eventType: string): number {\n return this.handlers.get(eventType)?.size || 0;\n }\n\n /**\n * Check if event type has handlers\n */\n hasHandlers(eventType: string): boolean {\n return this.getHandlerCount(eventType) > 0;\n }\n}\n\n/**\n * Event utilities class\n */\nexport class EventUtils {\n /**\n * Check if event is a message event\n */\n static isMessageEvent(eventType: string): boolean {\n return eventType.includes('message') && !eventType.includes('reaction');\n }\n\n /**\n * Check if event is a group event\n */\n static isGroupEvent(eventType: string): boolean {\n return (\n eventType.includes('group') ||\n eventType.includes('from-group') ||\n eventType.includes('to-group')\n );\n }\n\n /**\n * Check if event is a friend event\n */\n static isFriendEvent(eventType: string): boolean {\n return (\n eventType.includes('friend') ||\n eventType.includes('user-online') ||\n eventType.includes('user-offline')\n );\n }\n\n /**\n * Check if event is a connection event\n */\n static isConnectionEvent(eventType: string): boolean {\n return eventType.includes('connection') || eventType.includes('session');\n }\n\n /**\n * Check if event is an error event\n */\n static isErrorEvent(eventType: string): boolean {\n return eventType.includes('error') || eventType.includes('rate-limit');\n }\n\n /**\n * Extract message type from event type\n */\n static extractMessageType(eventType: string): string | null {\n const match = eventType.match(\n /^(text|image|video|voice|file|sticker|location|link|gif|doodle)-message/\n );\n return match ? match[1] : null;\n }\n\n /**\n * Extract direction from event type (sent/received)\n */\n static extractDirection(eventType: string): 'sent' | 'received' | null {\n if (eventType.includes('sent-to')) return 'sent';\n if (eventType.includes('received-from')) return 'received';\n return null;\n }\n\n /**\n * Extract target type from event type (user/group)\n */\n static extractTargetType(eventType: string): 'user' | 'group' | null {\n if (eventType.includes('to-user') || eventType.includes('from-user')) return 'user';\n if (eventType.includes('to-group') || eventType.includes('from-group')) return 'group';\n return null;\n }\n\n /**\n * Normalize event type\n */\n static normalizeEventType(eventType: string): string {\n return eventType.toLowerCase().replace(/[_\\s]+/g, '-');\n }\n\n /**\n * Create event filter function\n */\n static createEventFilter(criteria: {\n messageTypes?: string[];\n directions?: ('sent' | 'received')[];\n targetTypes?: ('user' | 'group')[];\n sessionIds?: string[];\n createdBys?: string[];\n userUuids?: string[];\n }) {\n return (event: WebhookEvent): boolean => {\n // Filter by message type\n if (criteria.messageTypes && criteria.messageTypes.length > 0) {\n const messageType = this.extractMessageType(event.eventType);\n if (!messageType || !criteria.messageTypes.includes(messageType)) {\n return false;\n }\n }\n\n // Filter by direction\n if (criteria.directions && criteria.directions.length > 0) {\n const direction = this.extractDirection(event.eventType);\n if (!direction || !criteria.directions.includes(direction)) {\n return false;\n }\n }\n\n // Filter by target type\n if (criteria.targetTypes && criteria.targetTypes.length > 0) {\n const targetType = this.extractTargetType(event.eventType);\n if (!targetType || !criteria.targetTypes.includes(targetType)) {\n return false;\n }\n }\n\n // Filter by session ID\n if (criteria.sessionIds && criteria.sessionIds.length > 0) {\n if (!criteria.sessionIds.includes(event.sessionId)) {\n return false;\n }\n }\n\n // Filter by createdBy / user UUID\n const userFilterList = criteria.createdBys || criteria.userUuids;\n if (userFilterList && userFilterList.length > 0) {\n const creator = (event as any).createdBy || (event as any).userUuid;\n if (!creator || !userFilterList.includes(creator)) {\n return false;\n }\n }\n\n return true;\n };\n }\n\n /**\n * Debounce function for event handling\n */\n static debounce<T extends any[]>(\n func: (...args: T) => void,\n delay: number\n ): (...args: T) => void {\n let timeoutId: NodeJS.Timeout;\n\n return (...args: T) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => func(...args), delay);\n };\n }\n\n /**\n * Throttle function for event handling\n */\n static throttle<T extends any[]>(\n func: (...args: T) => void,\n delay: number\n ): (...args: T) => void {\n let lastCall = 0;\n\n return (...args: T) => {\n const now = Date.now();\n if (now - lastCall >= delay) {\n lastCall = now;\n func(...args);\n }\n };\n }\n\n /**\n * Create rate limiter for events\n */\n static createRateLimiter(maxEvents: number, windowMs: number) {\n const events: number[] = [];\n\n return {\n canProcess(): boolean {\n const now = Date.now();\n const windowStart = now - windowMs;\n\n // Remove old events outside the window\n while (events.length > 0 && events[0] < windowStart) {\n events.shift();\n }\n\n // Check if we can add another event\n if (events.length < maxEvents) {\n events.push(now);\n return true;\n }\n\n return false;\n },\n\n getRemainingEvents(): number {\n const now = Date.now();\n const windowStart = now - windowMs;\n\n // Remove old events\n while (events.length > 0 && events[0] < windowStart) {\n events.shift();\n }\n\n return Math.max(0, maxEvents - events.length);\n },\n\n getResetTime(): number {\n if (events.length === 0) {\n return 0;\n }\n\n return events[0] + windowMs;\n },\n };\n }\n\n /**\n * Create event aggregator\n */\n static createEventAggregator<T>(windowMs: number, processor: (events: T[]) => void) {\n const events: T[] = [];\n let timeoutId: NodeJS.Timeout | null = null;\n\n return {\n add(event: T): void {\n events.push(event);\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n timeoutId = setTimeout(() => {\n if (events.length > 0) {\n processor([...events]);\n events.length = 0;\n }\n timeoutId = null;\n }, windowMs);\n },\n\n flush(): void {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n if (events.length > 0) {\n processor([...events]);\n events.length = 0;\n }\n },\n\n getQueuedCount(): number {\n return events.length;\n },\n };\n }\n}\n","/**\n * Zalo Personal Webhook Events SDK\n * Chuẩn hóa types cho tất cả webhook events từ automation-web\n * Source: automation-web/src/shared/types/zalo-webhook-events.types.ts\n */\n\n// ==================== BASE TYPES ====================\n\n/**\n * Thread Type enum\n */\nexport enum ZaloThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Event Type enum - Chuẩn hóa tất cả event types\n */\nexport enum ZaloWebhookEventType {\n // ==================== TIN NHẮN TEXT (4 events) ====================\n TEXT_MESSAGE_SENT_TO_USER = 'text-message-sent-to-user', // Gửi tin nhắn text cho user cá nhân\n TEXT_MESSAGE_SENT_TO_GROUP = 'text-message-sent-to-group', // Gửi tin nhắn text vào nhóm\n TEXT_MESSAGE_RECEIVED_FROM_USER = 'text-message-received-from-user', // Nhận tin nhắn text từ user cá nhân\n TEXT_MESSAGE_RECEIVED_FROM_GROUP = 'text-message-received-from-group', // Nhận tin nhắn text từ nhóm\n\n // ==================== TIN NHẮN HÌNH ẢNH (4 events) ====================\n IMAGE_MESSAGE_SENT_TO_USER = 'image-message-sent-to-user', // Gửi hình ảnh cho user cá nhân\n IMAGE_MESSAGE_SENT_TO_GROUP = 'image-message-sent-to-group', // Gửi hình ảnh vào nhóm\n IMAGE_MESSAGE_RECEIVED_FROM_USER = 'image-message-received-from-user', // Nhận hình ảnh từ user cá nhân\n IMAGE_MESSAGE_RECEIVED_FROM_GROUP = 'image-message-received-from-group', // Nhận hình ảnh từ nhóm\n\n // ==================== TIN NHẮN VIDEO (4 events) ====================\n VIDEO_MESSAGE_SENT_TO_USER = 'video-message-sent-to-user', // Gửi video cho user cá nhân\n VIDEO_MESSAGE_SENT_TO_GROUP = 'video-message-sent-to-group', // Gửi video vào nhóm\n VIDEO_MESSAGE_RECEIVED_FROM_USER = 'video-message-received-from-user', // Nhận video từ user cá nhân\n VIDEO_MESSAGE_RECEIVED_FROM_GROUP = 'video-message-received-from-group', // Nhận video từ nhóm\n\n // ==================== TIN NHẮN VOICE/AUDIO (4 events) ====================\n VOICE_MESSAGE_SENT_TO_USER = 'voice-message-sent-to-user', // Gửi voice/audio cho user cá nhân\n VOICE_MESSAGE_SENT_TO_GROUP = 'voice-message-sent-to-group', // Gửi voice/audio vào nhóm\n VOICE_MESSAGE_RECEIVED_FROM_USER = 'voice-message-received-from-user', // Nhận voice/audio từ user cá nhân\n VOICE_MESSAGE_RECEIVED_FROM_GROUP = 'voice-message-received-from-group', // Nhận voice/audio từ nhóm\n\n // ==================== TIN NHẮN FILE (4 events) ====================\n FILE_MESSAGE_SENT_TO_USER = 'file-message-sent-to-user', // Gửi file cho user cá nhân\n FILE_MESSAGE_SENT_TO_GROUP = 'file-message-sent-to-group', // Gửi file vào nhóm\n FILE_MESSAGE_RECEIVED_FROM_USER = 'file-message-received-from-user', // Nhận file từ user cá nhân\n FILE_MESSAGE_RECEIVED_FROM_GROUP = 'file-message-received-from-group', // Nhận file từ nhóm\n\n // ==================== TIN NHẮN STICKER (4 events) ====================\n STICKER_MESSAGE_SENT_TO_USER = 'sticker-message-sent-to-user', // Gửi sticker cho user cá nhân\n STICKER_MESSAGE_SENT_TO_GROUP = 'sticker-message-sent-to-group', // Gửi sticker vào nhóm\n STICKER_MESSAGE_RECEIVED_FROM_USER = 'sticker-message-received-from-user', // Nhận sticker từ user cá nhân\n STICKER_MESSAGE_RECEIVED_FROM_GROUP = 'sticker-message-received-from-group', // Nhận sticker từ nhóm\n\n // ==================== TIN NHẮN VỊ TRÍ (4 events) ====================\n LOCATION_MESSAGE_SENT_TO_USER = 'location-message-sent-to-user', // Gửi vị trí cho user cá nhân\n LOCATION_MESSAGE_SENT_TO_GROUP = 'location-message-sent-to-group', // Gửi vị trí vào nhóm\n LOCATION_MESSAGE_RECEIVED_FROM_USER = 'location-message-received-from-user', // Nhận vị trí từ user cá nhân\n LOCATION_MESSAGE_RECEIVED_FROM_GROUP = 'location-message-received-from-group', // Nhận vị trí từ nhóm\n\n // ==================== TIN NHẮN GIF (4 events) ====================\n GIF_MESSAGE_SENT_TO_USER = 'gif-message-sent-to-user', // Gửi GIF cho user cá nhân\n GIF_MESSAGE_SENT_TO_GROUP = 'gif-message-sent-to-group', // Gửi GIF vào nhóm\n GIF_MESSAGE_RECEIVED_FROM_USER = 'gif-message-received-from-user', // Nhận GIF từ user cá nhân\n GIF_MESSAGE_RECEIVED_FROM_GROUP = 'gif-message-received-from-group', // Nhận GIF từ nhóm\n\n // ==================== TIN NHẮN LINK (4 events) ====================\n LINK_MESSAGE_SENT_TO_USER = 'link-message-sent-to-user', // Gửi link cho user cá nhân\n LINK_MESSAGE_SENT_TO_GROUP = 'link-message-sent-to-group', // Gửi link vào nhóm\n LINK_MESSAGE_RECEIVED_FROM_USER = 'link-message-received-from-user', // Nhận link từ user cá nhân\n LINK_MESSAGE_RECEIVED_FROM_GROUP = 'link-message-received-from-group', // Nhận link từ nhóm\n\n // ==================== TIN NHẮN VẼ DOODLE (4 events) ====================\n DOODLE_MESSAGE_SENT_TO_USER = 'doodle-message-sent-to-user', // Gửi doodle/vẽ cho user cá nhân\n DOODLE_MESSAGE_SENT_TO_GROUP = 'doodle-message-sent-to-group', // Gửi doodle/vẽ vào nhóm\n DOODLE_MESSAGE_RECEIVED_FROM_USER = 'doodle-message-received-from-user', // Nhận doodle/vẽ từ user cá nhân\n DOODLE_MESSAGE_RECEIVED_FROM_GROUP = 'doodle-message-received-from-group', // Nhận doodle/vẽ từ nhóm\n\n // Message events - RECOMMENDED (4 events)\n RECOMMENDED_MESSAGE_SENT_TO_USER = 'recommended-message-sent-to-user',\n RECOMMENDED_MESSAGE_SENT_TO_GROUP = 'recommended-message-sent-to-group',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_USER = 'recommended-message-received-from-user',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP = 'recommended-message-received-from-group',\n\n // ==================== TIN NHẮN CŨ (1 event) ====================\n OLD_MESSAGES = 'old-messages', // Lấy tin nhắn cũ từ lịch sử\n\n // ==================== TRẠNG THÁI TYPING - ĐANG SOẠN TIN (4 events) ====================\n TYPING_BY_SELF_IN_USER = 'typing-by-self-in-user', // Mình đang soạn tin trong chat cá nhân\n TYPING_BY_SELF_IN_GROUP = 'typing-by-self-in-group', // Mình đang soạn tin trong nhóm\n TYPING_BY_OTHER_IN_USER = 'typing-by-other-in-user', // Người khác đang soạn tin trong chat cá nhân\n TYPING_BY_OTHER_IN_GROUP = 'typing-by-other-in-group', // Người khác đang soạn tin trong nhóm\n\n // ==================== TRẠNG THÁI Đà XEM TIN NHẮN (4 events) ====================\n SEEN_MESSAGES_BY_SELF_IN_USER = 'seen-messages-by-self-in-user', // Mình đã xem tin nhắn trong chat cá nhân\n SEEN_MESSAGES_BY_SELF_IN_GROUP = 'seen-messages-by-self-in-group', // Mình đã xem tin nhắn trong nhóm\n SEEN_MESSAGES_BY_OTHER_IN_USER = 'seen-messages-by-other-in-user', // Người khác đã xem tin nhắn trong chat cá nhân\n SEEN_MESSAGES_BY_OTHER_IN_GROUP = 'seen-messages-by-other-in-group', // Người khác đã xem tin nhắn trong nhóm\n\n // ==================== TRẠNG THÁI Đà NHẬN TIN NHẮN (4 events) ====================\n DELIVERED_MESSAGES_BY_SELF_IN_USER = 'delivered-messages-by-self-in-user', // Tin nhắn của mình đã được gửi đến user cá nhân\n DELIVERED_MESSAGES_BY_SELF_IN_GROUP = 'delivered-messages-by-self-in-group', // Tin nhắn của mình đã được gửi đến nhóm\n DELIVERED_MESSAGES_BY_OTHER_IN_USER = 'delivered-messages-by-other-in-user', // Tin nhắn của người khác đã được gửi đến mình (chat cá nhân)\n DELIVERED_MESSAGES_BY_OTHER_IN_GROUP = 'delivered-messages-by-other-in-group', // Tin nhắn của người khác đã được gửi đến nhóm\n\n // ==================== REACTION - BIỂU CẢM TIN NHẮN (4 events) ====================\n REACTION_BY_SELF_IN_USER = 'reaction-by-self-in-user', // Mình react tin nhắn trong chat cá nhân\n REACTION_BY_SELF_IN_GROUP = 'reaction-by-self-in-group', // Mình react tin nhắn trong nhóm\n REACTION_BY_OTHER_IN_USER = 'reaction-by-other-in-user', // Người khác react tin nhắn trong chat cá nhân\n REACTION_BY_OTHER_IN_GROUP = 'reaction-by-other-in-group', // Người khác react tin nhắn trong nhóm\n\n // ==================== REACTION CŨ - BIỂU CẢM TIN NHẮN CŨ (4 events) ====================\n OLD_REACTIONS_BY_SELF_IN_USER = 'old-reactions-by-self-in-user', // Lấy reaction cũ của mình trong chat cá nhân\n OLD_REACTIONS_BY_SELF_IN_GROUP = 'old-reactions-by-self-in-group', // Lấy reaction cũ của mình trong nhóm\n OLD_REACTIONS_BY_OTHER_IN_USER = 'old-reactions-by-other-in-user', // Lấy reaction cũ của người khác trong chat cá nhân\n OLD_REACTIONS_BY_OTHER_IN_GROUP = 'old-reactions-by-other-in-group', // Lấy reaction cũ của người khác trong nhóm\n\n // ==================== SỰ KIỆN BẠN BÈ (13 events) ====================\n FRIEND_EVENT_ADD = 'friend-event-add', // Thêm bạn bè\n FRIEND_EVENT_REMOVE = 'friend-event-remove', // Xóa bạn bè\n FRIEND_EVENT_REQUEST = 'friend-event-request', // Gửi lời mời kết bạn\n FRIEND_EVENT_UNDO_REQUEST = 'friend-event-undo-request', // Hủy lời mời kết bạn\n FRIEND_EVENT_REJECT_REQUEST = 'friend-event-reject-request', // Từ chối lời mời kết bạn\n FRIEND_EVENT_SEEN_REQUEST = 'friend-event-seen-request', // Đã xem lời mời kết bạn\n FRIEND_EVENT_BLOCK = 'friend-event-block', // Chặn bạn bè\n FRIEND_EVENT_UNBLOCK = 'friend-event-unblock', // Bỏ chặn bạn bè\n FRIEND_EVENT_BLOCK_CALL = 'friend-event-block-call', // Chặn cuộc gọi từ bạn bè\n FRIEND_EVENT_UNBLOCK_CALL = 'friend-event-unblock-call', // Bỏ chặn cuộc gọi từ bạn bè\n FRIEND_EVENT_PIN_UNPIN = 'friend-event-pin-unpin', // Ghim/bỏ ghim bạn bè\n FRIEND_EVENT_PIN_CREATE = 'friend-event-pin-create', // Tạo ghim bạn bè\n FRIEND_EVENT_UNKNOWN = 'friend-event-unknown', // Sự kiện bạn bè không xác định\n\n // ==================== SỰ KIỆN NHÓM (23 events) ====================\n GROUP_EVENT_JOIN_REQUEST = 'group-event-join-request', // Yêu cầu tham gia nhóm\n GROUP_EVENT_JOIN = 'group-event-join', // Tham gia nhóm\n GROUP_EVENT_LEAVE = 'group-event-leave', // Rời khỏi nhóm\n GROUP_EVENT_REMOVE_MEMBER = 'group-event-remove-member', // Xóa thành viên khỏi nhóm\n GROUP_EVENT_BLOCK_MEMBER = 'group-event-block-member', // Chặn thành viên trong nhóm\n GROUP_EVENT_UPDATE_SETTING = 'group-event-update-setting', // Cập nhật cài đặt nhóm\n GROUP_EVENT_UPDATE = 'group-event-update', // Cập nhật thông tin nhóm\n GROUP_EVENT_NEW_LINK = 'group-event-new-link', // Tạo link mời nhóm mới\n GROUP_EVENT_ADD_ADMIN = 'group-event-add-admin', // Thêm admin nhóm\n GROUP_EVENT_REMOVE_ADMIN = 'group-event-remove-admin', // Xóa admin nhóm\n GROUP_EVENT_NEW_PIN_TOPIC = 'group-event-new-pin-topic', // Tạo chủ đề ghim mới\n GROUP_EVENT_UPDATE_PIN_TOPIC = 'group-event-update-pin-topic', // Cập nhật chủ đề ghim\n GROUP_EVENT_REORDER_PIN_TOPIC = 'group-event-reorder-pin-topic', // Sắp xếp lại chủ đề ghim\n GROUP_EVENT_UPDATE_BOARD = 'group-event-update-board', // Cập nhật bảng nhóm\n GROUP_EVENT_REMOVE_BOARD = 'group-event-remove-board', // Xóa bảng nhóm\n GROUP_EVENT_UPDATE_TOPIC = 'group-event-update-topic', // Cập nhật chủ đề\n GROUP_EVENT_UNPIN_TOPIC = 'group-event-unpin-topic', // Bỏ ghim chủ đề\n GROUP_EVENT_REMOVE_TOPIC = 'group-event-remove-topic', // Xóa chủ đề\n GROUP_EVENT_ACCEPT_REMIND = 'group-event-accept-remind', // Chấp nhận nhắc nhở\n GROUP_EVENT_REJECT_REMIND = 'group-event-reject-remind', // Từ chối nhắc nhở\n GROUP_EVENT_REMIND_TOPIC = 'group-event-remind-topic', // Nhắc nhở về chủ đề\n GROUP_EVENT_UPDATE_AVATAR = 'group-event-update-avatar', // Cập nhật avatar nhóm\n GROUP_EVENT_UNKNOWN = 'group-event-unknown', // Sự kiện nhóm không xác định\n\n // ==================== THU HỒI TIN NHẮN (4 events) ====================\n UNDO_BY_SELF_IN_USER = 'undo-by-self-in-user', // Mình thu hồi tin nhắn trong chat cá nhân\n UNDO_BY_SELF_IN_GROUP = 'undo-by-self-in-group', // Mình thu hồi tin nhắn trong nhóm\n UNDO_BY_OTHER_IN_USER = 'undo-by-other-in-user', // Người khác thu hồi tin nhắn trong chat cá nhân\n UNDO_BY_OTHER_IN_GROUP = 'undo-by-other-in-group', // Người khác thu hồi tin nhắn trong nhóm\n\n // ==================== TRẠNG THÁI KẾT NỐI (4 events) ====================\n CONNECTION_STATUS_CONNECTED = 'connection-status-connected', // Đã kết nối thành công\n CONNECTION_STATUS_DISCONNECTED = 'connection-status-disconnected', // Mất kết nối\n CONNECTION_STATUS_RECONNECTING = 'connection-status-reconnecting', // Đang kết nối lại\n CONNECTION_STATUS_LOGGED_OUT = 'connection-status-logged-out', // Đã đăng xuất\n\n // ==================== UPLOAD FILE ĐÍNH KÈM (3 events) ====================\n UPLOAD_ATTACHMENT_IN_PROGRESS = 'upload-attachment-in-progress', // Đang upload file\n UPLOAD_ATTACHMENT_COMPLETED = 'upload-attachment-completed', // Upload file thành công\n UPLOAD_ATTACHMENT_FAILED = 'upload-attachment-failed', // Upload file thất bại\n\n // ==================== Mà HÓA CIPHER KEY (4 events) ====================\n CIPHER_KEY_UPDATED_IN_USER = 'cipher-key-updated-in-user', // Cập nhật cipher key trong chat cá nhân\n CIPHER_KEY_UPDATED_IN_GROUP = 'cipher-key-updated-in-group', // Cập nhật cipher key trong nhóm\n CIPHER_KEY_EXPIRED_IN_USER = 'cipher-key-expired-in-user', // Cipher key hết hạn trong chat cá nhân\n CIPHER_KEY_EXPIRED_IN_GROUP = 'cipher-key-expired-in-group', // Cipher key hết hạn trong nhóm\n\n // ==================== LỖI HỆ THỐNG (6 events) ====================\n ERROR_SYSTEM = 'error-system', // Lỗi hệ thống\n ERROR_NETWORK = 'error-network', // Lỗi mạng\n ERROR_AUTHENTICATION = 'error-authentication', // Lỗi xác thực\n ERROR_VALIDATION = 'error-validation', // Lỗi validation dữ liệu\n ERROR_BUSINESS_LOGIC = 'error-business-logic', // Lỗi logic nghiệp vụ\n ERROR_UNKNOWN = 'error-unknown', // Lỗi không xác định\n}\n\n/**\n * Base webhook event interface\n */\nexport interface BaseZaloWebhookEvent {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n timestamp: number;\n eventType: ZaloWebhookEventType;\n metadata?: Record<string, any>;\n}\n\n// ==================== MESSAGE TYPES ====================\n\n/**\n * Attachment content interface\n */\nexport interface ZaloAttachmentContent {\n title: string;\n description: string;\n href: string;\n thumb: string;\n childnumber: number;\n action: string;\n params: string;\n type: string;\n}\n\n/**\n * Message mention interface\n */\nexport interface ZaloMessageMention {\n uid: string;\n name: string;\n startIndex: number;\n length: number;\n}\n\n/**\n * Message quote interface\n */\nexport interface ZaloMessageQuote {\n ownerId: number;\n cliMsgId: number;\n globalMsgId: number;\n cliMsgType: number;\n ts: number;\n msg: string;\n attach: string;\n fromD: string;\n ttl: number;\n}\n\n/**\n * Complete message data từ SDK - FULL FIELDS\n */\nexport interface ZaloMessageData {\n // Core message fields\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: string | ZaloAttachmentContent | Record<string, any>;\n\n // Metadata fields\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n realMsgId: string;\n\n // Timeout fields - THIẾU trong automation-web\n topOut: string;\n topOutTimeOut: string;\n topOutImprTimeOut: string;\n\n // Property extension\n propertyExt?: {\n color: number;\n size: number;\n type: number;\n subType: number;\n ext: string;\n };\n\n // Parameters extension\n paramsExt: {\n countUnread: number;\n containType: number;\n platformType: number;\n };\n\n // Command info\n cmd: number;\n st: number;\n at: number;\n\n // Group-specific fields\n mentions?: ZaloMessageMention[];\n quote?: ZaloMessageQuote;\n}\n\n// ==================== MESSAGE TYPE ENUMS ====================\n\n/**\n * Message Type enum từ SDK - đồng nhất với automation-web\n */\nexport enum ZaloMessageType {\n TEXT = 'webchat',\n VOICE = 'chat.voice',\n PHOTO = 'chat.photo',\n STICKER = 'chat.sticker',\n DOODLE = 'chat.doodle',\n RECOMMENDED = 'chat.recommended',\n LINK = 'chat.link',\n VIDEO = 'chat.video.msg',\n FILE = 'share.file',\n GIF = 'chat.gif',\n LOCATION = 'chat.location.new',\n}\n\n/**\n * Message Category enum\n */\nexport enum ZaloMessageCategory {\n TEXT = 'text',\n MEDIA = 'media',\n FILE = 'file',\n SOCIAL = 'social',\n OTHER = 'other',\n}\n\n// ==================== SPECIFIC MESSAGE EVENT DATA TYPES ====================\n\n/**\n * Base message event data - chứa tất cả fields từ SDK\n */\nexport interface BaseMessageEventData extends ZaloMessageData {\n threadId: string;\n threadType: ZaloThreadType;\n isSelf: boolean;\n messageType: ZaloMessageType;\n messageCategory: ZaloMessageCategory;\n hasAttachment: boolean;\n}\n\n/**\n * TEXT message data - chỉ chứa text content\n */\nexport interface ZaloTextMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.TEXT;\n messageCategory: ZaloMessageCategory.TEXT;\n hasAttachment: false;\n content: string; // Plain text content\n}\n\n/**\n * IMAGE message data - chứa thông tin hình ảnh\n */\nexport interface ZaloImageMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.PHOTO;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'image';\n width?: number;\n height?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * VIDEO message data - chứa thông tin video\n */\nexport interface ZaloVideoMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.VIDEO;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'video';\n duration?: number;\n width?: number;\n height?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * VOICE message data - chứa thông tin voice/audio\n */\nexport interface ZaloVoiceMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.VOICE;\n messageCategory: ZaloMessageCategory.MEDIA;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'voice' | 'audio';\n duration?: number;\n fileSize?: number;\n mimeType?: string;\n };\n}\n\n/**\n * FILE message data - chứa thông tin file\n */\nexport interface ZaloFileMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.FILE;\n messageCategory: ZaloMessageCategory.FILE;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'file';\n fileName?: string;\n fileSize?: number;\n mimeType?: string;\n extension?: string;\n };\n}\n\n/**\n * STICKER message data - chứa thông tin sticker\n */\nexport interface ZaloStickerMessageData extends BaseMessageEventData {\n messageType: ZaloMessageType.STICKER;\n messageCategory: ZaloMessageCategory.SOCIAL;\n hasAttachment: true;\n content: ZaloAttachmentContent & {\n type: 'sticker';\n stickerId?: string;\n stickerPackId?: string;\n width?: number;\n height?: number;\n };\n}\n\n// ==================== NON-MESSAGE EVENT DATA TYPES ====================\n\n/**\n * TYPING event data - chứa thông tin typing status\n */\nexport interface ZaloTypingEventData {\n uid: string; // User ID đang typing\n ts: string; // Timestamp\n isPC: number; // 0 = mobile, 1 = PC\n gid?: string; // Group ID (chỉ có trong group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người gửi\n fromName: string; // Tên người gửi\n isTyping: boolean; // Trạng thái typing\n}\n\n/**\n * REACTION event data - chứa thông tin reaction\n */\nexport interface ZaloReactionEventData {\n msgId: string; // ID tin nhắn được react\n uidFrom: string; // User ID người react\n dName: string; // Display name người react\n ts: string; // Timestamp\n content: {\n rIcon: ZaloReactionType; // Loại reaction\n rType: number; // Reaction type number\n };\n realMsgId: string; // Real message ID\n groupId?: string; // Group ID (nếu là group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người react\n fromName: string; // Tên người react\n reaction: string; // Reaction string\n timestamp: number; // Timestamp number\n}\n\n/**\n * Reaction types enum từ SDK\n */\nexport enum ZaloReactionType {\n LIKE = '/-heart',\n LOVE = '/-heart',\n HAHA = ':))',\n WOW = ':-o',\n SAD = ':(',\n ANGRY = ':-@',\n NONE = '',\n}\n\n/**\n * UNDO event data - chứa thông tin thu hồi tin nhắn\n */\nexport interface ZaloUndoEventData {\n msgId: string; // ID tin nhắn bị thu hồi\n cliMsgId: string; // Client message ID\n uidFrom: string; // User ID người thu hồi\n idTo: string; // ID người nhận\n dName: string; // Display name người thu hồi\n ts: string; // Timestamp\n realMsgId: string; // Real message ID\n groupId?: string; // Group ID (nếu là group)\n threadId: string; // Thread ID\n threadType: ZaloThreadType; // USER hoặc GROUP\n fromId: string; // ID người thu hồi\n fromName: string; // Tên người thu hồi\n undoMsgId: string; // ID tin nhắn bị thu hồi\n timestamp: number; // Timestamp number\n}\n\n/**\n * CONNECTION STATUS event data - chứa thông tin trạng thái kết nối\n */\nexport interface ZaloConnectionStatusEventData {\n status: ZaloConnectionStatus; // Trạng thái kết nối\n reason?: string; // Lý do (nếu có)\n timestamp: number; // Timestamp\n sessionInfo?: {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n userId?: string;\n };\n}\n\n/**\n * Connection Status enum\n */\nexport enum ZaloConnectionStatus {\n CONNECTED = 'connected',\n DISCONNECTED = 'disconnected',\n RECONNECTING = 'reconnecting',\n LOGGED_OUT = 'logged_out',\n}\n\n// ==================== SIMPLIFIED TYPES FOR SDK ====================\n\n/**\n * Simplified webhook event for SDK usage\n * Updated to match automation-web WebhookJobData interface\n */\nexport interface WebhookEvent extends BaseZaloWebhookEvent {\n eventData:\n | ZaloMessageData\n | ZaloTypingEventData\n | ZaloReactionEventData\n | ZaloUndoEventData\n | any;\n}\n\n/**\n * Webhook event handler function type\n */\nexport type WebhookEventHandler<T extends WebhookEvent = WebhookEvent> = (\n event: T\n) => void | Promise<void>;\n\n// Legacy compatibility exports\nexport const WebhookEventType = ZaloWebhookEventType;\nexport type MessageEventData = ZaloMessageData;\nexport type BaseWebhookEvent = BaseZaloWebhookEvent;\nexport type TypingEventData = ZaloTypingEventData;\nexport type ReactionEventData = ZaloReactionEventData;\n","/**\n * Authentication service for managing Zalo sessions\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n QRLoginRequest,\n QRLoginResponse,\n CredentialsLoginRequest,\n CredentialsLoginResponse,\n SessionDeleteResponse,\n BulkDeleteSessionsRequest,\n BulkDeleteSessionsResponse,\n LoginStatusResponse,\n SessionListResponse,\n SessionDebugInfo,\n} from '../../types/auth.types';\n\n/**\n * Authentication service class\n */\nexport class AuthService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Generate QR Code for Zalo login\n */\n async generateQRCode(request: QRLoginRequest): Promise<AutomationWebResponse<QRLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<QRLoginResponse>>(\n '/auth/zalo/qr-code',\n {\n createdBy: request.createdBy !== undefined ? Number(request.createdBy) : (request.userUuid ? Number(request.userUuid) || request.userUuid : undefined),\n workspaceId: request.workspaceId,\n baseId: request.baseId,\n sessionId: request.sessionId,\n options: request.options,\n }\n );\n\n return response;\n }\n\n /**\n * Get login status for a session\n */\n async getLoginStatus(\n sessionId: string,\n timeout?: number\n ): Promise<AutomationWebResponse<LoginStatusResponse>> {\n const queryParams = timeout ? { timeout } : {};\n const response = await this.httpClient.get<AutomationWebResponse<LoginStatusResponse>>(\n `/auth/zalo/status/${sessionId}`,\n queryParams\n );\n\n return response;\n }\n\n /**\n * Login with credentials\n */\n async loginWithCredentials(\n request: CredentialsLoginRequest\n ): Promise<AutomationWebResponse<CredentialsLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CredentialsLoginResponse>>(\n '/auth/zalo/login-with-credentials',\n {\n createdBy: request.createdBy !== undefined ? Number(request.createdBy) : (request.userUuid ? Number(request.userUuid) || request.userUuid : undefined),\n credentials: {\n cookie: request.credentials.cookie,\n imei: request.credentials.imei,\n userAgent: request.credentials.userAgent,\n language: request.credentials.language || 'vi',\n },\n options: request.options,\n }\n );\n\n return response;\n }\n\n /**\n * Get list of sessions for a user\n */\n async getSessionsByUser(createdBy: number | string): Promise<AutomationWebResponse<SessionListResponse>> {\n const response = await this.httpClient.get<AutomationWebResponse<SessionListResponse>>(\n `/auth/zalo/sessions/${createdBy}`\n );\n\n return response;\n }\n\n /**\n * Delete a specific session\n */\n async deleteSession(sessionId: string): Promise<AutomationWebResponse<SessionDeleteResponse>> {\n const response = await this.httpClient.delete<AutomationWebResponse<SessionDeleteResponse>>(\n `/auth/zalo/session/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Delete multiple sessions\n */\n async bulkDeleteSessions(\n request: BulkDeleteSessionsRequest\n ): Promise<AutomationWebResponse<BulkDeleteSessionsResponse>> {\n const response = await this.httpClient.request<\n AutomationWebResponse<BulkDeleteSessionsResponse>\n >({\n method: 'DELETE',\n url: '/auth/zalo/sessions/bulk',\n data: {\n sessionIds: request.sessionIds || [],\n },\n });\n\n return response;\n }\n\n /**\n * Get debug information for a session\n */\n async debugSession(sessionId: string): Promise<AutomationWebResponse<SessionDebugInfo>> {\n const response = await this.httpClient.get<AutomationWebResponse<SessionDebugInfo>>(\n `/auth/zalo/debug/session/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Relogin with existing session - Chuẩn theo automation-web controller\n */\n async reloginWithSession(sessionId: string): Promise<AutomationWebResponse<QRLoginResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<QRLoginResponse>>(\n `/auth/zalo/relogin/${sessionId}`,\n {}\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Messaging Service\n * 100% khớp với automation-web/src/module/zalo-messaging\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n SendMessageRequest,\n SendStickerRequest,\n SendVoiceRequest,\n SendVideoRequest,\n SendFileRequest,\n SendLinkRequest,\n SendCardRequest,\n ForwardMessageRequest,\n DeleteMessageRequest,\n UndoMessageRequest,\n AddReactionRequest,\n SendMessageResponse,\n SendStickerResponse,\n SendVoiceResponse,\n SendVideoResponse,\n SendLinkResponse,\n SendCardResponse,\n ForwardMessageResponse,\n DeleteMessageResponse,\n UndoResponse,\n AddReactionResponse,\n AddQuickMessageRequest,\n AddQuickMessageResponse,\n GetQuickMessageListRequest,\n GetQuickMessageListResponse,\n UpdateQuickMessageRequest,\n CreateAutoReplyRequest,\n CreateAutoReplyResponse,\n GetAutoReplyListRequest,\n GetAutoReplyListResponse,\n DeleteAutoReplyRequest,\n StandardResponse,\n DeleteChatRequest,\n GetLabelsRequest,\n GetLabelsResponse,\n UpdateLabelsRequest,\n UpdateLabelsResponse,\n UpdateConversationLabelRequest,\n UpdateConversationLabelResponse,\n GetMuteRequest,\n GetMuteResponse,\n MessagingParseLinkRequest,\n MessagingParseLinkResponse,\n AddUnreadMarkRequest,\n AddUnreadMarkResponse,\n GetSearchStickerRequest,\n GetSearchStickerResponse,\n GetStickerCategoryDetailRequest,\n GetStickerCategoryDetailResponse,\n GetStickersRequest,\n GetStickersResponse,\n GetStickersDetailRequest,\n GetStickersDetailResponse,\n GetArchivedChatListRequest,\n GetArchivedChatListResponse,\n GetAutoDeleteChatRequest,\n GetAutoDeleteChatResponse,\n GetHiddenConversationsRequest,\n GetHiddenConversationsResponse,\n GetPinConversationsRequest,\n GetPinConversationsResponse,\n RemoveQuickMessageRequest,\n RemoveQuickMessageResponse,\n} from '../../types/dto/messaging.type';\n\n/**\n * Zalo Personal Messaging Service Class\n * 100% khớp với automation-web ZaloMessagingController\n */\nexport class MessagingService {\n constructor(private httpClient: HttpClient) { }\n\n /**\n * Gửi tin nhắn qua Zalo Personal\n * POST /zalo-personal/messaging/send\n */\n async sendMessage(\n request: SendMessageRequest\n ): Promise<AutomationWebResponse<SendMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendMessageResponse>>(\n '/zalo-personal/messaging/send',\n {\n msg: request.msg,\n threadId: request.threadId,\n type: request.type,\n sessionId: request.sessionId,\n styles: request.styles,\n mentions: request.mentions,\n quote: request.quote,\n attachments: request.attachments,\n urgency: request.urgency,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sticker\n * POST /zalo-personal/messaging/sticker\n */\n async sendSticker(\n request: SendStickerRequest\n ): Promise<AutomationWebResponse<SendStickerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendStickerResponse>>(\n '/zalo-personal/messaging/sticker',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n stickerId: request.stickerId,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi voice message\n * POST /zalo-personal/messaging/voice\n */\n async sendVoice(request: SendVoiceRequest): Promise<AutomationWebResponse<SendVoiceResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendVoiceResponse>>(\n '/zalo-personal/messaging/voice',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n fileUrl: request.fileUrl,\n duration: request.duration,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi video message\n * POST /zalo-personal/messaging/video\n */\n async sendVideo(request: SendVideoRequest): Promise<AutomationWebResponse<SendVideoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendVideoResponse>>(\n '/zalo-personal/messaging/video',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n videoUrl: request.videoUrl,\n duration: request.duration,\n width: request.width,\n height: request.height,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi link message\n * POST /zalo-personal/messaging/link\n */\n async sendFile(request: SendFileRequest): Promise<AutomationWebResponse<SendMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendMessageResponse>>(\n '/zalo-personal/messaging/file',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n fileUrl: request.fileUrl,\n fileName: request.fileName,\n msg: request.msg,\n headers: request.headers,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n async sendLink(request: SendLinkRequest): Promise<AutomationWebResponse<SendLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendLinkResponse>>(\n '/zalo-personal/messaging/link',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n link: request.link,\n msg: request.msg,\n ttl: request.ttl,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi contact card\n * POST /zalo-personal/messaging/card\n */\n async sendCard(request: SendCardRequest): Promise<AutomationWebResponse<SendCardResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendCardResponse>>(\n '/zalo-personal/messaging/card',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n userId: request.userId,\n phoneNumber: request.phoneNumber,\n }\n );\n\n return response;\n }\n\n /**\n * Chuyển tiếp tin nhắn\n * POST /zalo-personal/messaging/forward\n */\n async forwardMessage(\n request: ForwardMessageRequest\n ): Promise<AutomationWebResponse<ForwardMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ForwardMessageResponse>>(\n '/zalo-personal/messaging/forward',\n {\n sessionId: request.sessionId,\n message: request.message,\n threadIds: request.threadIds,\n type: request.type,\n reference: request.reference,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa tin nhắn\n * DELETE /zalo-personal/messaging/delete\n */\n async deleteMessage(\n request: DeleteMessageRequest\n ): Promise<AutomationWebResponse<DeleteMessageResponse>> {\n const response = await this.httpClient.deleteWithBody<AutomationWebResponse<DeleteMessageResponse>>(\n '/zalo-personal/messaging/delete',\n {\n sessionId: request.sessionId,\n messageId: request.messageId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Thu hồi tin nhắn (undo)\n * POST /zalo-personal/messaging/undo\n */\n async undoMessage(request: UndoMessageRequest): Promise<AutomationWebResponse<UndoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UndoResponse>>(\n '/zalo-personal/messaging/undo',\n {\n sessionId: request.sessionId,\n msgId: request.msgId,\n cliMsgId: request.cliMsgId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Thêm reaction vào tin nhắn\n * POST /zalo-personal/messaging/reaction\n */\n async addReaction(\n request: AddReactionRequest\n ): Promise<AutomationWebResponse<AddReactionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddReactionResponse>>(\n '/zalo-personal/messaging/reaction',\n {\n sessionId: request.sessionId,\n reaction: request.reaction,\n msgId: request.msgId,\n cliMsgId: request.cliMsgId,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n async addQuickMessage(\n request: AddQuickMessageRequest\n ): Promise<AutomationWebResponse<AddQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/add',\n request\n );\n\n return response;\n }\n\n async getQuickMessageList(\n request: GetQuickMessageListRequest\n ): Promise<AutomationWebResponse<GetQuickMessageListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetQuickMessageListResponse>>(\n '/zalo-personal/messaging/quick-message/list',\n request\n );\n\n return response;\n }\n\n async updateQuickMessage(\n request: UpdateQuickMessageRequest\n ): Promise<AutomationWebResponse<AddQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/update',\n request\n );\n\n return response;\n }\n\n async createAutoReply(\n request: CreateAutoReplyRequest\n ): Promise<AutomationWebResponse<CreateAutoReplyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CreateAutoReplyResponse>>(\n '/zalo-personal/messaging/auto-reply/create',\n request\n );\n\n return response;\n }\n\n async getAutoReplyList(\n request: GetAutoReplyListRequest\n ): Promise<AutomationWebResponse<GetAutoReplyListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAutoReplyListResponse>>(\n '/zalo-personal/messaging/auto-reply/list',\n request\n );\n\n return response;\n }\n\n async deleteAutoReply(\n request: DeleteAutoReplyRequest\n ): Promise<AutomationWebResponse<StandardResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<StandardResponse>>(\n '/zalo-personal/messaging/auto-reply/delete',\n request\n );\n\n return response;\n }\n\n async deleteChat(request: DeleteChatRequest): Promise<AutomationWebResponse<any>> {\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/messaging/chat/delete-convers',\n request\n );\n\n return response;\n }\n\n async getLabels(request: GetLabelsRequest): Promise<AutomationWebResponse<GetLabelsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetLabelsResponse>>(\n '/zalo-personal/messaging/labels/list',\n request\n );\n\n return response;\n }\n\n async updateLabels(\n request: UpdateLabelsRequest\n ): Promise<AutomationWebResponse<UpdateLabelsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UpdateLabelsResponse>>(\n '/zalo-personal/messaging/labels/update',\n request\n );\n\n return response;\n }\n\n async assignConversationLabel(\n request: UpdateConversationLabelRequest\n ): Promise<AutomationWebResponse<UpdateConversationLabelResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<UpdateConversationLabelResponse>\n >('/zalo-personal/messaging/labels/assign-conversation', request);\n\n return response;\n }\n\n async unassignConversationLabel(\n request: UpdateConversationLabelRequest\n ): Promise<AutomationWebResponse<UpdateConversationLabelResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<UpdateConversationLabelResponse>\n >('/zalo-personal/messaging/labels/unassign-conversation', request);\n\n return response;\n }\n\n async getMute(request: GetMuteRequest): Promise<AutomationWebResponse<GetMuteResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetMuteResponse>>(\n '/zalo-personal/messaging/mute/get',\n request\n );\n\n return response;\n }\n\n async parseLink(\n request: MessagingParseLinkRequest\n ): Promise<AutomationWebResponse<MessagingParseLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<MessagingParseLinkResponse>>(\n '/zalo-personal/messaging/link/parse',\n request\n );\n\n return response;\n }\n\n async addUnreadMark(\n request: AddUnreadMarkRequest\n ): Promise<AutomationWebResponse<AddUnreadMarkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddUnreadMarkResponse>>(\n '/zalo-personal/messaging/unread/add',\n request\n );\n\n return response;\n }\n\n async getSearchSticker(\n request: GetSearchStickerRequest\n ): Promise<AutomationWebResponse<GetSearchStickerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetSearchStickerResponse>>(\n '/zalo-personal/messaging/sticker/search',\n request\n );\n\n return response;\n }\n\n async getStickerCategoryDetail(\n request: GetStickerCategoryDetailRequest\n ): Promise<AutomationWebResponse<GetStickerCategoryDetailResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<GetStickerCategoryDetailResponse>\n >('/zalo-personal/messaging/sticker/category-detail', request);\n\n return response;\n }\n\n async getStickers(\n request: GetStickersRequest\n ): Promise<AutomationWebResponse<GetStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersResponse>>(\n '/zalo-personal/messaging/sticker/list',\n request\n );\n\n return response;\n }\n\n async getStickersDetail(\n request: GetStickersDetailRequest\n ): Promise<AutomationWebResponse<GetStickersDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersDetailResponse>>(\n '/zalo-personal/messaging/sticker/detail',\n request\n );\n\n return response;\n }\n\n async getArchivedChatList(\n request: GetArchivedChatListRequest\n ): Promise<AutomationWebResponse<GetArchivedChatListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetArchivedChatListResponse>>(\n '/zalo-personal/messaging/chat/list-archived',\n request\n );\n\n return response;\n }\n\n async getAutoDeleteChat(\n request: GetAutoDeleteChatRequest\n ): Promise<AutomationWebResponse<GetAutoDeleteChatResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAutoDeleteChatResponse>>(\n '/zalo-personal/messaging/chat/get-auto-delete',\n request\n );\n\n return response;\n }\n\n async getHiddenConversations(\n request: GetHiddenConversationsRequest\n ): Promise<AutomationWebResponse<GetHiddenConversationsResponse>> {\n const response = await this.httpClient.post<\n AutomationWebResponse<GetHiddenConversationsResponse>\n >('/zalo-personal/messaging/chat/list-hidden', request);\n\n return response;\n }\n\n async getPinConversations(\n request: GetPinConversationsRequest\n ): Promise<AutomationWebResponse<GetPinConversationsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPinConversationsResponse>>(\n '/zalo-personal/messaging/chat/list-pinned',\n request\n );\n\n return response;\n }\n\n async removeQuickMessage(\n request: RemoveQuickMessageRequest\n ): Promise<AutomationWebResponse<RemoveQuickMessageResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveQuickMessageResponse>>(\n '/zalo-personal/messaging/quick-message/remove',\n request\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Advanced Messaging Service\n * 100% khớp với automation-web/src/module/zalo-advanced-messaging\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n SendDeliveredEventRequest,\n SendDeliveredEventResponse,\n SendSeenEventRequest,\n SendSeenEventResponse,\n SendTypingEventRequest,\n SendTypingEventResponse,\n UploadAttachmentRequest,\n UploadAttachmentResponse,\n UploadProductPhotoRequest,\n UploadProductPhotoResponse,\n} from '../../types/dto/advanced-messaging.type';\n\n/**\n * Zalo Personal Advanced Messaging Service Class\n * 100% khớp với automation-web ZaloAdvancedMessagingController\n */\nexport class AdvancedMessagingService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Gửi sự kiện đã nhận tin nhắn\n * POST /zalo-personal/advanced-messaging/send-delivered-event\n */\n async sendDeliveredEvent(\n request: SendDeliveredEventRequest\n ): Promise<AutomationWebResponse<SendDeliveredEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendDeliveredEventResponse>>(\n '/zalo-personal/advanced-messaging/send-delivered-event',\n {\n sessionId: request.sessionId,\n isSeen: request.isSeen,\n messages: request.messages,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sự kiện đã xem tin nhắn\n * POST /zalo-personal/advanced-messaging/send-seen-event\n */\n async sendSeenEvent(\n request: SendSeenEventRequest\n ): Promise<AutomationWebResponse<SendSeenEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendSeenEventResponse>>(\n '/zalo-personal/advanced-messaging/send-seen-event',\n {\n sessionId: request.sessionId,\n messages: request.messages,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Gửi sự kiện đang gõ\n * POST /zalo-personal/advanced-messaging/send-typing-event\n */\n async sendTypingEvent(\n request: SendTypingEventRequest\n ): Promise<AutomationWebResponse<SendTypingEventResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SendTypingEventResponse>>(\n '/zalo-personal/advanced-messaging/send-typing-event',\n {\n sessionId: request.sessionId,\n threadId: request.threadId,\n type: request.type,\n destType: request.destType,\n }\n );\n\n return response;\n }\n\n /**\n * Upload file đính kèm\n * POST /zalo-personal/advanced-messaging/upload-attachment\n */\n async uploadAttachment(\n request: UploadAttachmentRequest\n ): Promise<AutomationWebResponse<UploadAttachmentResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UploadAttachmentResponse>>(\n '/zalo-personal/advanced-messaging/upload-attachment',\n {\n sessionId: request.sessionId,\n sources: request.sources,\n threadId: request.threadId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n /**\n * Upload ảnh sản phẩm\n * POST /zalo-personal/advanced-messaging/upload-product-photo\n */\n async uploadProductPhoto(\n request: UploadProductPhotoRequest\n ): Promise<AutomationWebResponse<UploadProductPhotoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<UploadProductPhotoResponse>>(\n '/zalo-personal/advanced-messaging/upload-product-photo',\n {\n sessionId: request.sessionId,\n file: request.file,\n }\n );\n\n return response;\n }\n}\n","/**\n * Webhook management service\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n Message,\n Typing,\n Reaction,\n SeenMessage,\n DeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n ThreadType,\n FriendEventType,\n GroupEventType,\n Reactions,\n} from '../../types/webhook';\n\n/**\n * Webhook listener options\n */\nexport interface WebhookListenerOptions {\n /**\n * Enable self listen for own messages\n * @default false\n */\n selfListen?: boolean;\n\n /**\n * Enable debug logging\n * @default false\n */\n logging?: boolean;\n\n /**\n * Auto reconnect on disconnect\n * @default true\n */\n autoReconnect?: boolean;\n\n /**\n * Reconnect delay in milliseconds\n * @default 5000\n */\n reconnectDelay?: number;\n}\n\n/**\n * Start webhook listener request\n */\nexport interface StartWebhookListenerRequest {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Webhook listener options\n */\n options?: WebhookListenerOptions;\n}\n\n/**\n * Stop webhook listener request\n */\nexport interface StopWebhookListenerRequest {\n /**\n * Session ID\n */\n sessionId: string;\n}\n\n/**\n * Webhook listener status\n */\nexport type WebhookListenerStatus = 'active' | 'inactive' | 'error' | 'connecting';\n\n/**\n * Webhook listener status response\n */\nexport interface WebhookListenerStatusResponse {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Current status\n */\n status: WebhookListenerStatus;\n\n /**\n * Error message if status is error\n */\n error?: string;\n\n /**\n * Timestamp when connected\n */\n connectedAt?: number;\n\n /**\n * Timestamp of last event\n */\n lastEventAt?: number;\n\n /**\n * Total event count\n */\n eventCount?: number;\n}\n\n/**\n * Webhook statistics\n */\nexport interface WebhookStatistics {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Total events processed\n */\n totalEvents: number;\n\n /**\n * Events processed today\n */\n eventsToday: number;\n\n /**\n * Last event timestamp\n */\n lastEventTimestamp: number;\n\n /**\n * Events count by type\n */\n eventsByType: Record<string, number>;\n\n /**\n * Queue statistics\n */\n queueStats: {\n waiting: number;\n active: number;\n completed: number;\n failed: number;\n };\n}\n\n/**\n * Webhook event response\n */\nexport interface WebhookEventResponse {\n /**\n * Event ID\n */\n eventId: string;\n\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Event type\n */\n eventType: string;\n\n /**\n * Event timestamp\n */\n timestamp: number;\n\n /**\n * Processing status\n */\n status: 'queued' | 'processing' | 'completed' | 'failed';\n\n /**\n * Job ID for tracking\n */\n jobId?: string;\n\n /**\n * Error message if failed\n */\n error?: string;\n}\n\n/**\n * Response DTO cho validate session\n */\nexport interface ValidateSessionResponse {\n sessionId: string;\n isValid: boolean;\n reason?: string;\n statusUpdated: boolean;\n newStatus?: string;\n}\n\n/**\n * Response DTO cho validate all sessions\n */\nexport interface ValidateAllSessionsResponse {\n total: number;\n valid: number;\n invalid: number;\n updated: string[];\n}\n\n/**\n * Response DTO cho cleanup expired sessions\n */\nexport interface CleanupExpiredSessionsResponse {\n cleanupCount: number;\n}\n\n/**\n * Request old messages request\n */\nexport interface RequestOldMessagesRequest {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thread type ('user' or 'group')\n * @default 'user'\n */\n threadType?: 'user' | 'group';\n\n /**\n * Last message ID to get older messages\n * If null, get from latest messages\n * @default null\n */\n lastMsgId?: string | null;\n}\n\n/**\n * Request old messages response\n */\nexport interface RequestOldMessagesResponse {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thread type\n */\n threadType: 'user' | 'group';\n\n /**\n * Last message ID used in request\n */\n lastMsgId: string | null;\n}\n\n/**\n * Webhook Event Handlers\n */\nexport interface WebhookEventHandlers {\n /**\n * Message received handler\n */\n onMessage?: (event: Message) => void;\n\n /**\n * Typing event handler\n */\n onTyping?: (event: Typing) => void;\n\n /**\n * Reaction event handler\n */\n onReaction?: (event: Reaction) => void;\n\n /**\n * Message seen handler\n */\n onMessageSeen?: (event: SeenMessage) => void;\n\n /**\n * Message delivered handler\n */\n onMessageDelivered?: (event: DeliveredMessage) => void;\n\n /**\n * Friend event handler\n */\n onFriendEvent?: (event: FriendEvent) => void;\n\n /**\n * Group event handler\n */\n onGroupEvent?: (event: GroupEvent) => void;\n\n /**\n * Message undo handler\n */\n onUndo?: (event: Undo) => void;\n\n /**\n * Generic event handler for unknown events\n */\n onUnknownEvent?: (eventType: string, data: any) => void;\n\n /**\n * Error handler\n */\n onError?: (error: Error) => void;\n\n /**\n * Connection status handler\n */\n onConnectionChange?: (status: 'connected' | 'disconnected' | 'reconnecting') => void;\n}\n\n/**\n * Webhook management service class\n */\nexport class WebhookService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Start webhook listener for a session\n */\n async startWebhookListener(request: StartWebhookListenerRequest): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/start',\n {\n sessionId: request.sessionId,\n options: request.options || {},\n }\n );\n\n return response;\n }\n\n /**\n * Stop webhook listener for a session\n */\n async stopWebhookListener(request: StopWebhookListenerRequest): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/stop',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Get webhook listener status for a session\n */\n async getWebhookListenerStatus(sessionId: string): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<WebhookListenerStatusResponse>(\n `/webhook/status/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Get webhook statistics for a session\n */\n async getWebhookStatistics(sessionId: string): Promise<WebhookStatistics> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<WebhookStatistics>(\n `/webhook/stats/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Get all active webhook listeners\n */\n async getActiveWebhookListeners(): Promise<{\n activeListeners: string[];\n count: number;\n }> {\n const response = await this.httpClient.get<{\n success: boolean;\n data: {\n activeListeners: string[];\n count: number;\n };\n }>('/webhook/listeners');\n\n return response.data;\n }\n\n /**\n * Restart webhook listener for a session\n */\n async restartWebhookListener(\n request: StartWebhookListenerRequest\n ): Promise<WebhookListenerStatusResponse> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<WebhookListenerStatusResponse>(\n '/webhook/restart',\n {\n sessionId: request.sessionId,\n options: request.options || {},\n }\n );\n\n return response;\n }\n\n /**\n * Check if webhook listener is active\n */\n async isWebhookListenerActive(sessionId: string): Promise<boolean> {\n try {\n const status = await this.getWebhookListenerStatus(sessionId);\n return status.status === 'active';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Get webhook health status\n */\n async getWebhookHealth(): Promise<{\n status: 'healthy' | 'unhealthy';\n activeListeners: number;\n totalEvents: number;\n queueHealth: {\n waiting: number;\n active: number;\n failed: number;\n };\n }> {\n const response = await this.httpClient.get<{\n success: boolean;\n data: {\n status: string;\n activeListeners: number;\n totalEvents: number;\n queueHealth: {\n waiting: number;\n active: number;\n failed: number;\n };\n };\n }>('/webhook/health');\n\n return {\n status: response.data.status === 'ok' ? 'healthy' : 'unhealthy',\n activeListeners: response.data.activeListeners,\n totalEvents: response.data.totalEvents,\n queueHealth: response.data.queueHealth,\n };\n }\n\n /**\n * Stop all webhook listeners\n */\n async stopAllWebhookListeners(): Promise<{\n stoppedListeners: string[];\n count: number;\n }> {\n const response = await this.httpClient.delete<{\n success: boolean;\n data: {\n stoppedListeners: string[];\n count: number;\n };\n }>('/webhook/listeners/all');\n\n return response.data;\n }\n\n /**\n * Validate session\n * GET /webhook/validate/:sessionId\n */\n async validateSession(sessionId: string): Promise<AutomationWebResponse<ValidateSessionResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(sessionId);\n\n const response = await this.httpClient.get<AutomationWebResponse<ValidateSessionResponse>>(\n `/webhook/validate/${sessionId}`\n );\n\n return response;\n }\n\n /**\n * Validate all sessions\n * POST /webhook/validate-all\n */\n async validateAllSessions(): Promise<AutomationWebResponse<ValidateAllSessionsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ValidateAllSessionsResponse>>(\n '/webhook/validate-all',\n {}\n );\n\n return response;\n }\n\n /**\n * Cleanup expired sessions\n * DELETE /webhook/cleanup-expired\n */\n async cleanupExpiredSessions(): Promise<AutomationWebResponse<CleanupExpiredSessionsResponse>> {\n const response = await this.httpClient.delete<AutomationWebResponse<CleanupExpiredSessionsResponse>>(\n '/webhook/cleanup-expired'\n );\n\n return response;\n }\n\n /**\n * Request old messages from a thread\n * Pattern: Request-Response via WebSocket\n *\n * How it works:\n * 1. Call this API to SEND REQUEST\n * 2. Server processes and SENDS RESPONSE via 'old_messages' event\n * 3. Results will be received via webhook event handler\n *\n * @param request - Request old messages parameters\n * @returns Response with request confirmation\n *\n * @example\n * ```typescript\n * // Request latest messages for a user thread\n * await webhookService.requestOldMessages({\n * sessionId: 'your-session-id',\n * threadType: 'user',\n * lastMsgId: null\n * });\n *\n * // Request older messages using last message ID\n * await webhookService.requestOldMessages({\n * sessionId: 'your-session-id',\n * threadType: 'group',\n * lastMsgId: 'msg-id-123'\n * });\n * ```\n */\n async requestOldMessages(\n request: RequestOldMessagesRequest\n ): Promise<AutomationWebResponse<RequestOldMessagesResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<RequestOldMessagesResponse>>(\n '/webhook/request-old-messages',\n {\n sessionId: request.sessionId,\n threadType: request.threadType || 'user',\n lastMsgId: request.lastMsgId ?? null,\n }\n );\n\n return response;\n }\n}\n","/**\n * Zalo Personal Group Management Service\n * 100% khớp với automation-web/src/module/zalo-group/controllers/zalo-group.controller.ts\n * Đã thêm đầy đủ 19 methods để đồng bộ hoàn toàn với backend controller\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetGroupInfoRequest,\n CreateGroupRequest,\n AddMemberToGroupRequest,\n RemoveMemberFromGroupRequest,\n ChangeGroupNameRequest,\n GetGroupMembersRequest,\n GetGroupMembersBasicRequest,\n LeaveGroupRequest,\n DisperseGroupRequest,\n JoinGroupRequest,\n ChangeGroupAvatarRequest,\n UpdateGroupSettingsRequest,\n ChangeGroupOwnerRequest,\n AddGroupDeputyRequest,\n RemoveGroupDeputyRequest,\n EnableGroupLinkRequest,\n DisableGroupLinkRequest,\n GetGroupLinkInfoRequest,\n InviteUserToGroupsRequest,\n GetAllGroupsResponse,\n GetGroupInfoResponse,\n CreateGroupResponse,\n AddMemberResponse,\n RemoveMemberResponse,\n ChangeGroupNameResponse,\n GetGroupMembersResponse,\n GetGroupMembersBasicResponse,\n GroupActionResponse,\n ChangeGroupAvatarResponse,\n UpdateGroupSettingsResponse,\n ChangeGroupOwnerResponse,\n AddGroupDeputyResponse,\n RemoveGroupDeputyResponse,\n EnableGroupLinkResponse,\n DisableGroupLinkResponse,\n GetGroupLinkInfoResponse,\n InviteUserToGroupsResponse,\n GetAllGroupsDto,\n\n AddGroupBlockedMemberRequest,\n DeleteGroupInviteBoxRequest,\n GetGroupBlockedMemberRequest,\n GetGroupChatHistoryRequest,\n GetGroupInviteBoxInfoRequest,\n GetGroupInviteBoxListRequest,\n GetGroupLinkDetailRequest,\n GetPendingGroupMembersRequest,\n JoinGroupInviteBoxRequest,\n RemoveGroupBlockedMemberRequest,\n ReviewPendingMemberRequest,\n UpgradeGroupCommunityRequest,\n GetGroupMembersInfoDirectRequest,\n GetGroupMembersInfoDirectResponse,\n\n DeleteGroupInviteBoxResponse,\n GetGroupBlockedMemberResponse,\n GetGroupChatHistoryResponse,\n GetGroupInviteBoxInfoResponse,\n GetGroupInviteBoxListResponse,\n GetGroupLinkDetailResponse,\n GetPendingGroupMembersResponse,\n ReviewPendingMemberRequestResponse,\n} from '../../types/dto/groups.type';\n\n/**\n * Zalo Personal Group Management Service Class\n * 100% khớp với automation-web ZaloGroupController\n * Bao gồm đầy đủ 19 methods: 15 cơ bản + 4 advanced link/invite\n */\nexport class GroupService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy tất cả groups\n * POST /zalo-personal/groups/all\n */\n async getAllGroups(\n request: GetAllGroupsDto\n ): Promise<AutomationWebResponse<GetAllGroupsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetAllGroupsResponse>>(\n '/zalo-personal/groups/all',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n async getGroupMembersBasic(\n request: GetGroupMembersBasicRequest\n ): Promise<AutomationWebResponse<GetGroupMembersBasicResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersBasicResponse>>(\n '/zalo-personal/groups/members-basic',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n batchSize: request.batchSize,\n delayMs: request.delayMs,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin chi tiết của group\n * POST /zalo-personal/groups/info\n */\n async getGroupInfo(\n request: GetGroupInfoRequest\n ): Promise<AutomationWebResponse<GetGroupInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInfoResponse>>(\n '/zalo-personal/groups/info',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Tạo group mới\n * POST /zalo-personal/groups/create\n */\n async createGroup(\n request: CreateGroupRequest\n ): Promise<AutomationWebResponse<CreateGroupResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<CreateGroupResponse>>(\n '/zalo-personal/groups/create',\n request\n );\n\n return response;\n }\n\n /**\n * Thêm member vào group\n * POST /zalo-personal/groups/add-members\n */\n async addMemberToGroup(\n request: AddMemberToGroupRequest\n ): Promise<AutomationWebResponse<AddMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddMemberResponse>>(\n '/zalo-personal/groups/add-members',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Remove member khỏi group\n * POST /zalo-personal/groups/remove-member\n */\n async removeMemberFromGroup(\n request: RemoveMemberFromGroupRequest\n ): Promise<AutomationWebResponse<RemoveMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveMemberResponse>>(\n '/zalo-personal/groups/remove-member',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberId: request.memberId,\n }\n );\n\n return response;\n }\n\n /**\n * Đổi tên group\n * PUT /zalo-personal/groups/change-name\n */\n async changeGroupName(\n request: ChangeGroupNameRequest\n ): Promise<AutomationWebResponse<ChangeGroupNameResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<ChangeGroupNameResponse>>(\n '/zalo-personal/groups/change-name',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n newName: request.newName,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách members của group\n * POST /zalo-personal/groups/members\n * Nếu không truyền page/limit thì sẽ lấy tất cả members\n * 100% khớp với automation-web controller\n */\n async getGroupMembers(\n request: GetGroupMembersRequest\n ): Promise<AutomationWebResponse<GetGroupMembersResponse>> {\n const requestBody: any = {\n sessionId: request.sessionId,\n groupId: request.groupId,\n };\n\n // Chỉ thêm các optional fields nếu user có truyền\n if (request.page !== undefined) {\n requestBody.page = request.page;\n }\n if (request.limit !== undefined) {\n requestBody.limit = request.limit;\n }\n if (request.batchSize !== undefined) {\n requestBody.batchSize = request.batchSize;\n }\n if (request.delayMs !== undefined) {\n requestBody.delayMs = request.delayMs;\n }\n if (request.randomMaxDelayMs !== undefined) {\n requestBody.randomMaxDelayMs = request.randomMaxDelayMs;\n }\n\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersResponse>>(\n '/zalo-personal/groups/members',\n requestBody\n );\n\n return response;\n }\n\n /**\n * Rời nhóm\n * POST /zalo-personal/groups/leave\n */\n async leaveGroup(\n request: LeaveGroupRequest\n ): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/leave',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Giải tán nhóm\n * DELETE /zalo-personal/groups/disperse\n */\n async disperseGroup(\n request: DisperseGroupRequest\n ): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.deleteWithBody<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/disperse',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Tham gia nhóm qua link\n * POST /zalo-personal/groups/join\n * 100% khớp với automation-web controller\n */\n async joinGroup(request: JoinGroupRequest): Promise<AutomationWebResponse<GroupActionResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GroupActionResponse>>(\n '/zalo-personal/groups/join',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n /**\n * Đổi avatar nhóm\n * PUT /zalo-personal/groups/change-avatar\n */\n async changeGroupAvatar(\n request: ChangeGroupAvatarRequest\n ): Promise<AutomationWebResponse<ChangeGroupAvatarResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<ChangeGroupAvatarResponse>>(\n '/zalo-personal/groups/change-avatar',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n avatarPath: request.avatarPath,\n }\n );\n\n return response;\n }\n\n /**\n * Cập nhật cài đặt nhóm\n * PUT /zalo-personal/groups/update-settings\n */\n async updateGroupSettings(\n request: UpdateGroupSettingsRequest\n ): Promise<AutomationWebResponse<UpdateGroupSettingsResponse>> {\n const response = await this.httpClient.put<AutomationWebResponse<UpdateGroupSettingsResponse>>(\n '/zalo-personal/groups/update-settings',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n settings: request.settings,\n }\n );\n\n return response;\n }\n\n /**\n * Chuyển quyền owner nhóm\n * POST /zalo-personal/groups/change-owner\n */\n async changeGroupOwner(\n request: ChangeGroupOwnerRequest\n ): Promise<AutomationWebResponse<ChangeGroupOwnerResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ChangeGroupOwnerResponse>>(\n '/zalo-personal/groups/change-owner',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n newOwnerId: request.newOwnerId,\n }\n );\n\n return response;\n }\n\n /**\n * Thêm phó admin\n * POST /zalo-personal/groups/add-deputy\n */\n async addGroupDeputy(\n request: AddGroupDeputyRequest\n ): Promise<AutomationWebResponse<AddGroupDeputyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<AddGroupDeputyResponse>>(\n '/zalo-personal/groups/add-deputy',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa phó admin\n * POST /zalo-personal/groups/remove-deputy\n */\n async removeGroupDeputy(\n request: RemoveGroupDeputyRequest\n ): Promise<AutomationWebResponse<RemoveGroupDeputyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<RemoveGroupDeputyResponse>>(\n '/zalo-personal/groups/remove-deputy',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n\n /**\n * Enable group link\n * POST /zalo-personal/groups/enable-link\n */\n async enableGroupLink(\n request: EnableGroupLinkRequest\n ): Promise<AutomationWebResponse<EnableGroupLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<EnableGroupLinkResponse>>(\n '/zalo-personal/groups/enable-link',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Disable group link\n * POST /zalo-personal/groups/disable-link\n */\n async disableGroupLink(\n request: DisableGroupLinkRequest\n ): Promise<AutomationWebResponse<DisableGroupLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<DisableGroupLinkResponse>>(\n '/zalo-personal/groups/disable-link',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Get group link info\n * POST /zalo-personal/groups/link-info\n * 100% khớp với automation-web controller\n */\n async getGroupLinkInfo(\n request: GetGroupLinkInfoRequest\n ): Promise<AutomationWebResponse<GetGroupLinkInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupLinkInfoResponse>>(\n '/zalo-personal/groups/link-info',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n\n /**\n * Invite user to multiple groups\n * POST /zalo-personal/groups/invite-to-groups\n */\n async inviteUserToGroups(\n request: InviteUserToGroupsRequest\n ): Promise<AutomationWebResponse<InviteUserToGroupsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<InviteUserToGroupsResponse>>(\n '/zalo-personal/groups/invite-to-groups',\n {\n sessionId: request.sessionId,\n memberId: request.memberId,\n groupIds: request.groupIds,\n }\n );\n\n return response;\n }\n\n async addGroupBlockedMember(\n request: AddGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/block/add',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n async deleteGroupInviteBox(\n request: DeleteGroupInviteBoxRequest\n ): Promise<AutomationWebResponse<DeleteGroupInviteBoxResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<DeleteGroupInviteBoxResponse>>(\n '/zalo-personal/groups/invite-box/delete',\n {\n sessionId: request.sessionId,\n groupIds: request.groupIds,\n }\n );\n\n return response;\n }\n\n async getGroupBlockedMember(\n request: GetGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<GetGroupBlockedMemberResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupBlockedMemberResponse>>(\n '/zalo-personal/groups/block/list',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async getGroupChatHistory(\n request: GetGroupChatHistoryRequest\n ): Promise<AutomationWebResponse<GetGroupChatHistoryResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupChatHistoryResponse>>(\n '/zalo-personal/groups/chat-history',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n count: request.count,\n page: request.page,\n }\n );\n\n return response;\n }\n\n async getGroupInviteBoxInfo(\n request: GetGroupInviteBoxInfoRequest\n ): Promise<AutomationWebResponse<GetGroupInviteBoxInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInviteBoxInfoResponse>>(\n '/zalo-personal/groups/invite-box/info',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async getGroupInviteBoxList(\n request: GetGroupInviteBoxListRequest\n ): Promise<AutomationWebResponse<GetGroupInviteBoxListResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupInviteBoxListResponse>>(\n '/zalo-personal/groups/invite-box/list',\n {\n sessionId: request.sessionId,\n page: request.page,\n limit: request.limit,\n }\n );\n\n return response;\n }\n\n async getGroupLinkDetail(\n request: GetGroupLinkDetailRequest\n ): Promise<AutomationWebResponse<GetGroupLinkDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupLinkDetailResponse>>(\n '/zalo-personal/groups/link/detail',\n {\n sessionId: request.sessionId,\n link: request.link,\n }\n );\n\n return response;\n }\n\n async getPendingGroupMembers(\n request: GetPendingGroupMembersRequest\n ): Promise<AutomationWebResponse<GetPendingGroupMembersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPendingGroupMembersResponse>>(\n '/zalo-personal/groups/pending/list',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async joinGroupInviteBox(request: JoinGroupInviteBoxRequest): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/invite-box/join',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n async removeGroupBlockedMember(\n request: RemoveGroupBlockedMemberRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/block/remove',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n async reviewPendingMemberRequest(\n request: ReviewPendingMemberRequest\n ): Promise<AutomationWebResponse<ReviewPendingMemberRequestResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ReviewPendingMemberRequestResponse>>(\n '/zalo-personal/groups/pending/review',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n memberId: request.memberId,\n type: request.type,\n }\n );\n\n return response;\n }\n\n async upgradeGroupCommunity(\n request: UpgradeGroupCommunityRequest\n ): Promise<AutomationWebResponse<string>> {\n const response = await this.httpClient.post<AutomationWebResponse<string>>(\n '/zalo-personal/groups/upgrade/community',\n {\n sessionId: request.sessionId,\n groupId: request.groupId,\n }\n );\n\n return response;\n }\n\n /**\n * Gọi trực tiếp api.getGroupMembersInfo từ Zalo Web SDK mà không qua vòng lặp hay batching\n * POST /zalo-personal/groups/members-info-direct\n */\n async getGroupMembersInfoDirect(\n request: GetGroupMembersInfoDirectRequest\n ): Promise<AutomationWebResponse<GetGroupMembersInfoDirectResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetGroupMembersInfoDirectResponse>>(\n '/zalo-personal/groups/members-info-direct',\n {\n sessionId: request.sessionId,\n memberIds: request.memberIds,\n }\n );\n\n return response;\n }\n}\n","/**\r\n * Zalo Personal Friend Management Service\r\n * 100% khá»›p vá»›i automation-web/src/module/zalo-friend\r\n * Đã hợp nhất DTOs và Service class trong 1 file duy nhất\r\n */\r\n\r\nimport { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n // Request DTOs\r\n GetAllFriendsDto,\r\n SearchFriendsDto,\r\n GetFriendsInfoDto,\r\n GetOnlineFriendsDto,\r\n SendFriendRequestDto,\r\n AcceptFriendRequestDto,\r\n GetSentFriendRequestsDto,\r\n UndoFriendRequestDto,\r\n RemoveFriendDto,\r\n FindUserDto,\r\n FindMultiUsersDto,\r\n BlockUserDto,\r\n UnblockUserDto,\r\n ChangeFriendAliasDto,\r\n RemoveFriendAliasDto,\r\n GetAliasListDto,\r\n GetSettingsDto,\r\n GetLastOnlineDto,\r\n GetOwnIdDto,\r\n FetchAccountInfoDto,\r\n\r\n FindUserByUsernameDto,\r\n GetFriendRecommendationsDto,\r\n RejectFriendRequestDto,\r\n GetFriendRequestStatusDto,\r\n BlockViewFeedDto,\r\n UpdateStatusDto,\r\n GetFriendOnlinesDto,\r\n GetFriendBoardListDto,\r\n GetQRDto,\r\n\r\n // Response DTOs\r\n GetAllFriendsResponseDto,\r\n SearchFriendsResponseDto,\r\n OperationResultDto,\r\n GetSentFriendRequestsResponseDto,\r\n FindUserResponseDto,\r\n FindMultiUsersResponseDto,\r\n GetSettingsResponseDto,\r\n GetLastOnlineResponseDto,\r\n GetOwnIdResponseDto,\r\n AccountInfoDto,\r\n FriendStats,\r\n UserInfoResponse,\r\n FriendDto,\r\n\r\n UserBasicDto,\r\n GetFriendRecommendationsResponseDto,\r\n GetFriendRequestStatusResponseDto,\r\n GetFriendOnlinesResponseDto,\r\n GetFriendBoardListResponseDto,\r\n GetQRResponseDto,\r\n PaginatedResult,\r\n AliasInfoDto,\r\n \r\n // SDK Types\r\n ZaloGetAllFriendsResponse,\r\n ZaloFriendItem,\r\n} from '../../types/dto/friends.type';\r\n\r\n/**\r\n * Zalo Personal Friend Management Service Class\r\n * 100% khá»›p vá»›i automation-web ZaloFriendController\r\n */\r\nexport class FriendService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n // ==================== BASIC FRIEND METHODS ====================\r\n\r\n /**\r\n * Lấy tất cả friends\r\n * POST /zalo-personal/friends/all\r\n * @returns ZaloGetAllFriendsResponse - Array cá»§a ZaloFriendItem từ SDK (dữ liệu thô)\r\n */\r\n async getAllFriends(\r\n request: GetAllFriendsDto\r\n ): Promise<AutomationWebResponse<ZaloGetAllFriendsResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ZaloGetAllFriendsResponse>>(\r\n '/zalo-personal/friends/all',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Tìm kiếm friends\r\n * POST /zalo-personal/friends/search\r\n */\r\n async searchFriends(\r\n request: SearchFriendsDto\r\n ): Promise<AutomationWebResponse<SearchFriendsResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<SearchFriendsResponseDto>>(\r\n '/zalo-personal/friends/search',\r\n {\r\n sessionId: request.sessionId,\r\n keyword: request.keyword,\r\n limit: request.limit,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thông tin chi tiết friends\r\n * POST /zalo-personal/friends/info\r\n */\r\n async getFriendsInfo(\r\n request: GetFriendsInfoDto\r\n ): Promise<AutomationWebResponse<UserInfoResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<UserInfoResponse>>(\r\n '/zalo-personal/friends/info',\r\n {\r\n sessionId: request.sessionId,\r\n friendIds: request.friendIds,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy friends Ä‘ang online\r\n * POST /zalo-personal/friends/online\r\n */\r\n async getOnlineFriends(\r\n request: GetOnlineFriendsDto\r\n ): Promise<AutomationWebResponse<FriendDto[]>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FriendDto[]>>(\r\n '/zalo-personal/friends/online',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thống kê friends\r\n * GET /zalo-personal/friends/stats\r\n */\r\n async getFriendsStats(sessionId: string): Promise<AutomationWebResponse<FriendStats>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<FriendStats>>(\r\n `/zalo-personal/friends/stats?sessionId=${sessionId}`\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== FRIEND REQUEST METHODS ====================\r\n\r\n /**\r\n * Gá»­i lời mời kết bạn\r\n * POST /zalo-personal/friends/request/send\r\n */\r\n async sendFriendRequest(\r\n request: SendFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/send',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n message: request.message,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Chấp nhận lời mời kết bạn\r\n * POST /zalo-personal/friends/request/accept\r\n */\r\n async acceptFriendRequest(\r\n request: AcceptFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/accept',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy danh sách lời mời đã gá»­i\r\n * POST /zalo-personal/friends/request/sent\r\n */\r\n async getSentFriendRequests(\r\n request: GetSentFriendRequestsDto\r\n ): Promise<AutomationWebResponse<GetSentFriendRequestsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetSentFriendRequestsResponseDto>\r\n >('/zalo-personal/friends/request/sent', {\r\n sessionId: request.sessionId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Há»§y lời mời đã gá»­i\r\n * POST /zalo-personal/friends/request/undo\r\n */\r\n async undoFriendRequest(\r\n request: UndoFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/undo',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== FRIEND MANAGEMENT METHODS ====================\r\n\r\n /**\r\n * Xóa bạn bè\r\n * POST /zalo-personal/friends/remove\r\n */\r\n async removeFriend(request: RemoveFriendDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/remove',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Chặn user\r\n * POST /zalo-personal/friends/block\r\n */\r\n async blockUser(request: BlockUserDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/block',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Bỏ chặn user\r\n * POST /zalo-personal/friends/unblock\r\n */\r\n async unblockUser(request: UnblockUserDto): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/unblock',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Thay đổi biệt danh friend\r\n * POST /zalo-personal/friends/alias/change\r\n */\r\n async changeFriendAlias(\r\n request: ChangeFriendAliasDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/alias/change',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n alias: request.alias,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Xóa biệt danh friend\r\n * POST /zalo-personal/friends/alias/remove\r\n */\r\n async removeFriendAlias(\r\n request: RemoveFriendAliasDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/alias/remove',\r\n {\r\n sessionId: request.sessionId,\r\n friendId: request.friendId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy danh sách biệt danh\r\n * POST /zalo-personal/friends/alias/list\r\n */\r\n async getAliasList(\r\n request: GetAliasListDto\r\n ): Promise<AutomationWebResponse<PaginatedResult<AliasInfoDto>>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<PaginatedResult<AliasInfoDto>>\r\n >(\r\n '/zalo-personal/friends/alias/list',\r\n {\r\n sessionId: request.sessionId,\r\n count: request.count,\r\n page: request.page,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n // ==================== USER SEARCH & ACCOUNT METHODS ====================\r\n\r\n /**\r\n * Tìm kiếm user theo số Ä‘iện thoại\r\n * POST /zalo-personal/friends/find-user\r\n */\r\n async findUser(request: FindUserDto): Promise<AutomationWebResponse<FindUserResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FindUserResponseDto>>(\r\n '/zalo-personal/friends/find-user',\r\n {\r\n sessionId: request.sessionId,\r\n phoneNumber: request.phoneNumber,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * TAªm ki §¨m nhi ¯?u user theo danh sA­ch s ¯` Ž`i ¯Øn tho §­i\r\n * POST /zalo-personal/friends/find-multi-users\r\n */\r\n async findMultiUsers(\r\n request: FindMultiUsersDto\r\n ): Promise<AutomationWebResponse<FindMultiUsersResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<FindMultiUsersResponseDto>>(\r\n '/zalo-personal/friends/find-multi-users',\r\n {\r\n sessionId: request.sessionId,\r\n phoneNumbers: request.phoneNumbers,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thời gian last online\r\n * POST /zalo-personal/friends/last-online\r\n */\r\n async getLastOnline(\r\n request: GetLastOnlineDto\r\n ): Promise<AutomationWebResponse<GetLastOnlineResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetLastOnlineResponseDto>>(\r\n '/zalo-personal/friends/last-online',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy own ID\r\n * POST /zalo-personal/friends/own-id\r\n */\r\n async getOwnId(request: GetOwnIdDto): Promise<AutomationWebResponse<GetOwnIdResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetOwnIdResponseDto>>(\r\n '/zalo-personal/friends/own-id',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy cài đặt tài khoản\r\n * POST /zalo-personal/friends/settings\r\n */\r\n async getSettings(\r\n request: GetSettingsDto\r\n ): Promise<AutomationWebResponse<GetSettingsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetSettingsResponseDto>\r\n >('/zalo-personal/friends/settings', {\r\n sessionId: request.sessionId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Lấy thông tin tài khoản\r\n * POST /zalo-personal/friends/account-info\r\n */\r\n async fetchAccountInfo(\r\n request: FetchAccountInfoDto\r\n ): Promise<AutomationWebResponse<AccountInfoDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<AccountInfoDto>>(\r\n '/zalo-personal/friends/account-info',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findUserByUsername(\r\n request: FindUserByUsernameDto\r\n ): Promise<AutomationWebResponse<UserBasicDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<UserBasicDto>>(\r\n '/zalo-personal/friends/find-username',\r\n {\r\n sessionId: request.sessionId,\r\n username: request.username,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendRecommendations(\r\n request: GetFriendRecommendationsDto\r\n ): Promise<AutomationWebResponse<GetFriendRecommendationsResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendRecommendationsResponseDto>\r\n >('/zalo-personal/friends/recommendations', {\r\n sessionId: request.sessionId,\r\n limit: request.limit,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async rejectFriendRequest(\r\n request: RejectFriendRequestDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/request/reject',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendRequestStatus(\r\n request: GetFriendRequestStatusDto\r\n ): Promise<AutomationWebResponse<GetFriendRequestStatusResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendRequestStatusResponseDto>\r\n >('/zalo-personal/friends/request/status', {\r\n sessionId: request.sessionId,\r\n userIds: request.userIds,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async blockViewFeed(\r\n request: BlockViewFeedDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/block/feed',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async updateStatus(\r\n request: UpdateStatusDto\r\n ): Promise<AutomationWebResponse<OperationResultDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<OperationResultDto>>(\r\n '/zalo-personal/friends/status/update',\r\n {\r\n sessionId: request.sessionId,\r\n status: request.status,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendOnlines(\r\n request: GetFriendOnlinesDto\r\n ): Promise<AutomationWebResponse<GetFriendOnlinesResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetFriendOnlinesResponseDto>>(\r\n '/zalo-personal/friends/friend-onlines',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getFriendBoardList(\r\n request: GetFriendBoardListDto\r\n ): Promise<AutomationWebResponse<GetFriendBoardListResponseDto>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<GetFriendBoardListResponseDto>\r\n >('/zalo-personal/friends/friend-board-list', {\r\n sessionId: request.sessionId,\r\n conversationId: request.conversationId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async getQR(request: GetQRDto): Promise<AutomationWebResponse<GetQRResponseDto>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetQRResponseDto>>(\r\n '/zalo-personal/friends/qr',\r\n {\r\n sessionId: request.sessionId,\r\n userId: request.userId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","/**\n * Zalo Personal User Info Management Service\n * 100% khớp với automation-web/src/module/zalo-personal/controllers/zalo-user-info.controller.ts\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetUserInfoRequest,\n GetSingleUserInfoRequest,\n GetBasicUserInfoRequest,\n CheckUserExistsRequest,\n GetMultipleUsersInfoRequest,\n GetMultiUsersByPhoneRequest,\n GetUserInfoResponse,\n GetSingleUserInfoResponse,\n GetBasicUserInfoResponse,\n CheckUserExistsResponse,\n GetMultipleUsersInfoResponse,\n GetMultiUsersByPhoneResponse,\n} from '../../types/dto/user-info.type';\n\n/**\n * Zalo Personal User Info Management Service Class\n * 100% khớp với automation-web ZaloUserInfoController\n */\nexport class UserInfoService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy thông tin user theo ID\n * POST /zalo-personal/user-info/get\n */\n async getUserInfo(\n request: GetUserInfoRequest\n ): Promise<AutomationWebResponse<GetUserInfoResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetUserInfoResponse>>(\n '/zalo-personal/user-info/get',\n {\n sessionId: request.sessionId,\n userId: request.userId,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin user đơn lẻ\n * GET /zalo-personal/user-info/single/:sessionId/:userId\n */\n async getSingleUserInfo(\n request: GetSingleUserInfoRequest\n ): Promise<AutomationWebResponse<GetSingleUserInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<GetSingleUserInfoResponse>>(\n `/zalo-personal/user-info/single/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin cơ bản của user\n * GET /zalo-personal/user-info/basic/:sessionId/:userId\n */\n async getBasicUserInfo(\n request: GetBasicUserInfoRequest\n ): Promise<AutomationWebResponse<GetBasicUserInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<GetBasicUserInfoResponse>>(\n `/zalo-personal/user-info/basic/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Kiểm tra user có tồn tại không\n * GET /zalo-personal/user-info/exists/:sessionId/:userId\n */\n async checkUserExists(\n request: CheckUserExistsRequest\n ): Promise<AutomationWebResponse<CheckUserExistsResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.userId, 'userId');\n\n const response = await this.httpClient.get<AutomationWebResponse<CheckUserExistsResponse>>(\n `/zalo-personal/user-info/exists/${request.sessionId}/${request.userId}`\n );\n\n return response;\n }\n\n /**\n * Lấy thông tin nhiều users cùng lúc\n * POST /zalo-personal/user-info/multiple\n */\n async getMultipleUsersInfo(\n request: GetMultipleUsersInfoRequest\n ): Promise<AutomationWebResponse<GetMultipleUsersInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateIdArray(request.userIds, 'userIds', 1);\n\n const response = await this.httpClient.post<\n AutomationWebResponse<GetMultipleUsersInfoResponse>\n >('/zalo-personal/user-info/multiple', {\n sessionId: request.sessionId,\n userIds: request.userIds,\n });\n\n return response;\n }\n\n /**\n * Tìm kiếm user theo danh sách số điện thoại\n * POST /zalo-personal/user-info/get-multi-users-by-phone\n */\n async getMultiUsersByPhone(\n request: GetMultiUsersByPhoneRequest\n ): Promise<AutomationWebResponse<GetMultiUsersByPhoneResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateIdArray(request.phoneNumbers, 'phoneNumbers', 1);\n\n const response = await this.httpClient.post<\n AutomationWebResponse<GetMultiUsersByPhoneResponse>\n >('/zalo-personal/user-info/get-multi-users-by-phone', {\n sessionId: request.sessionId,\n phoneNumbers: request.phoneNumbers,\n isAvatarSizeMax: request.isAvatarSizeMax,\n });\n\n return response;\n }\n}\n","/**\n * Zalo Personal Profile & Account Management Service\n * 100% khớp với automation-web/src/module/zalo-profile/controllers/profile.controller.ts\n */\n\nimport { HttpClient } from '../../utils/http.utils';\nimport { ValidationUtils } from '../../utils/validation.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n FetchAccountInfoRequest,\n FetchAccountInfoResponse,\n ChangeAccountAvatarRequest,\n ChangeAccountAvatarResponse,\n DeleteAvatarRequest,\n DeleteAvatarResponse,\n ReuseAvatarRequest,\n ReuseAvatarResponse,\n GetAvatarListRequest,\n GetAvatarListResponse,\n UpdateProfileRequest,\n UpdateProfileResponse,\n GetAvatarUrlProfileRequest,\n GetAvatarUrlProfileResponse,\n GetFullAvatarRequest,\n GetFullAvatarResponse,\n GetSettingsRequest,\n GetSettingsResponse,\n UpdateSettingsRequest,\n UpdateLangRequest,\n} from '../../types/dto/profile.type';\n\n/**\n * Zalo Personal Profile & Account Management Service Class\n * 100% khớp với automation-web ZaloProfileController\n * Bao gồm đầy đủ 6 methods: fetch-account-info, change-avatar, delete-avatar, reuse-avatar, avatar-list, update\n */\nexport class ProfileService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Lấy thông tin tài khoản\n * POST /zalo-personal/profile/fetch-account-info\n */\n async fetchAccountInfo(\n request: FetchAccountInfoRequest\n ): Promise<AutomationWebResponse<FetchAccountInfoResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<FetchAccountInfoResponse>>(\n '/zalo-personal/profile/fetch-account-info',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Thay đổi avatar tài khoản\n * POST /zalo-personal/profile/change-avatar\n */\n async changeAccountAvatar(\n request: ChangeAccountAvatarRequest\n ): Promise<AutomationWebResponse<ChangeAccountAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.avatarSource, 'avatarSource');\n ValidationUtils.validateRequired(request.avatarSource.data, 'avatarSource.data');\n ValidationUtils.validateRequired(request.avatarSource.filename, 'avatarSource.filename');\n ValidationUtils.validateRequired(request.avatarSource.metadata, 'avatarSource.metadata');\n\n const response = await this.httpClient.post<AutomationWebResponse<ChangeAccountAvatarResponse>>(\n '/zalo-personal/profile/change-account-avatar',\n {\n sessionId: request.sessionId,\n avatarSource: request.avatarSource,\n }\n );\n\n return response;\n }\n\n /**\n * Xóa avatar\n * POST /zalo-personal/profile/delete-avatar\n */\n async deleteAvatar(\n request: DeleteAvatarRequest\n ): Promise<AutomationWebResponse<DeleteAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.photoId, 'photoId');\n\n const response = await this.httpClient.post<AutomationWebResponse<DeleteAvatarResponse>>(\n '/zalo-personal/profile/delete-avatar',\n {\n sessionId: request.sessionId,\n photoId: request.photoId,\n }\n );\n\n return response;\n }\n\n /**\n * Sử dụng lại avatar\n * POST /zalo-personal/profile/reuse-avatar\n */\n async reuseAvatar(\n request: ReuseAvatarRequest\n ): Promise<AutomationWebResponse<ReuseAvatarResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.avatarId, 'avatarId');\n\n const response = await this.httpClient.post<AutomationWebResponse<ReuseAvatarResponse>>(\n '/zalo-personal/profile/reuse-avatar',\n {\n sessionId: request.sessionId,\n avatarId: request.avatarId,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách avatar\n * POST /zalo-personal/profile/avatar-list\n */\n async getAvatarList(\n request: GetAvatarListRequest\n ): Promise<AutomationWebResponse<GetAvatarListResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<GetAvatarListResponse>>(\n '/zalo-personal/profile/get-avatar-list',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n /**\n * Cập nhật profile\n * POST /zalo-personal/profile/update\n */\n async updateProfile(\n request: UpdateProfileRequest\n ): Promise<AutomationWebResponse<UpdateProfileResponse>> {\n // Validate input\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.name, 'name');\n ValidationUtils.validateRequired(request.dob, 'dob');\n ValidationUtils.validateRequired(request.gender, 'gender');\n\n const response = await this.httpClient.post<AutomationWebResponse<UpdateProfileResponse>>(\n '/zalo-personal/profile/update-profile',\n {\n sessionId: request.sessionId,\n name: request.name,\n dob: request.dob,\n gender: request.gender,\n }\n );\n\n return response;\n }\n\n async getAvatarUrlProfile(\n request: GetAvatarUrlProfileRequest\n ): Promise<AutomationWebResponse<GetAvatarUrlProfileResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.friendIds, 'friendIds');\n\n const response = await this.httpClient.post<AutomationWebResponse<GetAvatarUrlProfileResponse>>(\n '/zalo-personal/profile/get-avatar-url-profile',\n {\n sessionId: request.sessionId,\n friendIds: request.friendIds,\n isAvatarSizeMax: request.isAvatarSizeMax,\n }\n );\n\n return response;\n }\n\n async getFullAvatar(\n request: GetFullAvatarRequest\n ): Promise<AutomationWebResponse<GetFullAvatarResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.friendId, 'friendId');\n\n const response = await this.httpClient.post<AutomationWebResponse<GetFullAvatarResponse>>(\n '/zalo-personal/profile/get-full-avatar',\n {\n sessionId: request.sessionId,\n friendId: request.friendId,\n }\n );\n\n return response;\n }\n\n async getSettings(\n request: GetSettingsRequest\n ): Promise<AutomationWebResponse<GetSettingsResponse>> {\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<GetSettingsResponse>>(\n '/zalo-personal/profile/get-settings',\n {\n sessionId: request.sessionId,\n }\n );\n\n return response;\n }\n\n async updateSettings(request: UpdateSettingsRequest): Promise<AutomationWebResponse<any>> {\n ValidationUtils.validateSessionId(request.sessionId);\n ValidationUtils.validateRequired(request.type, 'type');\n ValidationUtils.validateRequired(request.value, 'value');\n\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/profile/update-settings',\n {\n sessionId: request.sessionId,\n type: request.type,\n value: request.value,\n }\n );\n\n return response;\n }\n\n async updateLang(request: UpdateLangRequest): Promise<AutomationWebResponse<any>> {\n ValidationUtils.validateSessionId(request.sessionId);\n\n const response = await this.httpClient.post<AutomationWebResponse<any>>(\n '/zalo-personal/profile/update-lang',\n {\n sessionId: request.sessionId,\n language: request.language,\n }\n );\n\n return response;\n }\n}\n","import { HttpClient } from '../../utils/http.utils';\nimport { AutomationWebResponse } from '../../types/common.types';\nimport {\n GetStickersRequest,\n GetStickersResponse,\n GetStickersDetailRequest,\n GetStickersDetailResponse,\n ParseLinkRequest,\n ParseLinkResponse,\n SearchStickersWithDetailsRequest,\n SearchStickersWithDetailsResponse,\n GetPopularStickersRequest,\n GetPopularStickersResponse,\n} from '../../types/dto/search.types';\n\n/**\n * Zalo Personal Search Service Class\n * 100% khớp với automation-web ZaloSearchController\n */\nexport class SearchService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Tìm sticker theo từ khóa (cải tiến)\n * POST /zalo-personal/search/get-stickers\n *\n * @param request - Search stickers request\n * @returns Promise<AutomationWebResponse<GetStickersResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getStickers({\n * sessionId: \"session-123\",\n * keyword: \"hello\",\n * limit: 20,\n * includeDetails: false\n * });\n *\n * if (result.success) {\n * console.log(`Found ${result.data.total} stickers (returned ${result.data.result.length})`);\n * console.log('Sticker IDs:', result.data.result);\n * if (result.data.details) {\n * console.log('Sticker details:', result.data.details);\n * }\n * }\n * ```\n */\n async getStickers(\n request: GetStickersRequest\n ): Promise<AutomationWebResponse<GetStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersResponse>>(\n '/zalo-personal/search/get-stickers',\n {\n sessionId: request.sessionId,\n keyword: request.keyword,\n limit: request.limit,\n includeDetails: request.includeDetails,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy chi tiết sticker theo IDs\n * POST /zalo-personal/search/get-stickers-detail\n *\n * @param request - Get stickers detail request\n * @returns Promise<AutomationWebResponse<GetStickersDetailResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getStickersDetail({\n * sessionId: \"session-123\",\n * stickerIds: [123, 456, 789]\n * });\n *\n * if (result.success) {\n * result.data.result.forEach(sticker => {\n * console.log(`Sticker ${sticker.id}: ${sticker.name}`);\n * console.log(`Image: ${sticker.imageUrl}`);\n * });\n * }\n * ```\n */\n async getStickersDetail(\n request: GetStickersDetailRequest\n ): Promise<AutomationWebResponse<GetStickersDetailResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetStickersDetailResponse>>(\n '/zalo-personal/search/get-stickers-detail',\n {\n sessionId: request.sessionId,\n stickerIds: request.stickerIds,\n }\n );\n\n return response;\n }\n\n /**\n * Parse thông tin metadata từ URL\n * POST /zalo-personal/search/parse-link\n *\n * @param request - Parse link request\n * @returns Promise<AutomationWebResponse<ParseLinkResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.parseLink({\n * sessionId: \"session-123\",\n * url: \"https://example.com/article\"\n * });\n *\n * if (result.success) {\n * const metadata = result.data.result;\n * console.log('Title:', metadata.title);\n * console.log('Description:', metadata.description);\n * console.log('Image:', metadata.image);\n * console.log('Site:', metadata.siteName);\n * }\n * ```\n */\n async parseLink(request: ParseLinkRequest): Promise<AutomationWebResponse<ParseLinkResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ParseLinkResponse>>(\n '/zalo-personal/search/parse-link',\n {\n sessionId: request.sessionId,\n url: request.url,\n }\n );\n\n return response;\n }\n\n /**\n * Tìm sticker và lấy chi tiết trong một lần gọi (API mới)\n * POST /zalo-personal/search/search-with-details\n *\n * @param request - Search stickers with details request\n * @returns Promise<AutomationWebResponse<SearchStickersWithDetailsResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.searchStickersWithDetails({\n * sessionId: \"session-123\",\n * keyword: \"hello\",\n * limit: 10\n * });\n *\n * if (result.success) {\n * console.log(`Found ${result.data.total} stickers with details in ${result.data.searchTime}ms`);\n * result.data.stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * }\n * ```\n */\n async searchStickersWithDetails(\n request: SearchStickersWithDetailsRequest\n ): Promise<AutomationWebResponse<SearchStickersWithDetailsResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<SearchStickersWithDetailsResponse>>(\n '/zalo-personal/search/search-with-details',\n {\n sessionId: request.sessionId,\n keyword: request.keyword,\n limit: request.limit,\n }\n );\n\n return response;\n }\n\n /**\n * Lấy danh sách sticker phổ biến (API mới)\n * POST /zalo-personal/search/popular-stickers\n *\n * @param request - Get popular stickers request\n * @returns Promise<AutomationWebResponse<GetPopularStickersResponse>>\n *\n * @example\n * ```typescript\n * const result = await searchService.getPopularStickers({\n * sessionId: \"session-123\",\n * limit: 20,\n * categoryId: 1\n * });\n *\n * if (result.success) {\n * console.log(`Retrieved ${result.data.stickers.length} popular stickers`);\n * result.data.stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * }\n * ```\n */\n async getPopularStickers(\n request: GetPopularStickersRequest\n ): Promise<AutomationWebResponse<GetPopularStickersResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<GetPopularStickersResponse>>(\n '/zalo-personal/search/popular-stickers',\n {\n sessionId: request.sessionId,\n limit: request.limit,\n categoryId: request.categoryId,\n }\n );\n\n return response;\n }\n\n // ==================== CONVENIENCE METHODS ====================\n\n /**\n * Tìm stickers và lấy chi tiết (convenience method - sử dụng API mới)\n * Sử dụng API mới search-with-details thay vì gọi 2 API riêng biệt\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 10)\n * @returns Promise với sticker details\n *\n * @example\n * ```typescript\n * const stickers = await searchService.searchStickersWithDetailsConvenience(\n * \"session-123\",\n * \"hello\",\n * 10\n * );\n *\n * stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * ```\n */\n async searchStickersWithDetailsConvenience(\n sessionId: string,\n keyword: string,\n limit: number = 10\n ): Promise<SearchStickersWithDetailsResponse['stickers']> {\n const result = await this.searchStickersWithDetails({\n sessionId,\n keyword,\n limit,\n });\n\n if (!result.result?.stickers) {\n return [];\n }\n\n return result.result.stickers;\n }\n\n /**\n * Tìm stickers và lấy chi tiết (legacy method - backward compatibility)\n * Sử dụng cách cũ: gọi getStickers + getStickersDetail\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @returns Promise với sticker details\n *\n * @deprecated Sử dụng searchStickersWithDetailsConvenience() thay thế\n */\n async searchStickersWithDetailsLegacy(\n sessionId: string,\n keyword: string\n ): Promise<GetStickersDetailResponse['result']> {\n // Step 1: Search for stickers\n const searchResult = await this.getStickers({ sessionId, keyword });\n\n if (!searchResult.result?.result?.length) {\n return [];\n }\n\n // Step 2: Get details for found stickers\n const detailResult = await this.getStickersDetail({\n sessionId,\n stickerIds: searchResult.result.result,\n });\n\n if (!detailResult.result?.result) {\n return [];\n }\n\n return detailResult.result.result;\n }\n\n /**\n * Batch parse multiple links\n * Parse nhiều links cùng lúc\n *\n * @param sessionId - Session ID\n * @param urls - Array of URLs to parse\n * @returns Promise với array of parsed metadata\n *\n * @example\n * ```typescript\n * const results = await searchService.parseMultipleLinks(\n * \"session-123\",\n * [\"https://example1.com\", \"https://example2.com\"]\n * );\n *\n * results.forEach((metadata, index) => {\n * if (metadata) {\n * console.log(`Link ${index + 1}: ${metadata.title}`);\n * }\n * });\n * ```\n */\n async parseMultipleLinks(\n sessionId: string,\n urls: string[]\n ): Promise<(ParseLinkResponse['result'] | null)[]> {\n const promises = urls.map(async url => {\n try {\n const result = await this.parseLink({ sessionId, url });\n return result.result?.result || null;\n } catch (error) {\n console.warn(`Failed to parse link ${url}:`, error);\n return null;\n }\n });\n\n return Promise.all(promises);\n }\n\n /**\n * Lấy sticker phổ biến (convenience method)\n *\n * @param sessionId - Session ID\n * @param limit - Số lượng sticker (default: 20)\n * @param categoryId - Category ID để lọc (optional)\n * @returns Promise với popular stickers\n *\n * @example\n * ```typescript\n * const stickers = await searchService.getPopularStickersConvenience(\n * \"session-123\",\n * 20,\n * 1\n * );\n *\n * stickers.forEach(sticker => {\n * console.log(`${sticker.text}: ${sticker.stickerUrl}`);\n * });\n * ```\n */\n async getPopularStickersConvenience(\n sessionId: string,\n limit: number = 20,\n categoryId?: number\n ): Promise<GetPopularStickersResponse['stickers']> {\n const result = await this.getPopularStickers({\n sessionId,\n limit,\n categoryId,\n });\n\n if (!result.result?.stickers) {\n return [];\n }\n\n return result.result.stickers;\n }\n\n /**\n * Tìm kiếm sticker nhanh (chỉ trả về IDs)\n * Sử dụng API cải tiến với includeDetails = false\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 20)\n * @returns Promise với sticker IDs\n *\n * @example\n * ```typescript\n * const stickerIds = await searchService.quickSearchStickers(\n * \"session-123\",\n * \"hello\",\n * 20\n * );\n *\n * console.log('Found sticker IDs:', stickerIds);\n * ```\n */\n async quickSearchStickers(\n sessionId: string,\n keyword: string,\n limit: number = 20\n ): Promise<number[]> {\n const result = await this.getStickers({\n sessionId,\n keyword,\n limit,\n includeDetails: false,\n });\n\n if (!result.result?.result) {\n return [];\n }\n\n return result.result.result;\n }\n\n /**\n * Tìm kiếm sticker với chi tiết và metadata đầy đủ\n * Trả về response đầy đủ bao gồm metadata như searchTime, total, etc.\n *\n * @param sessionId - Session ID\n * @param keyword - Search keyword\n * @param limit - Số lượng sticker tối đa (default: 10)\n * @returns Promise với full search response\n *\n * @example\n * ```typescript\n * const response = await searchService.fullSearchStickers(\n * \"session-123\",\n * \"hello\",\n * 10\n * );\n *\n * console.log(`Found ${response.total} stickers in ${response.searchTime}ms`);\n * console.log('Stickers:', response.stickers);\n * ```\n */\n async fullSearchStickers(\n sessionId: string,\n keyword: string,\n limit: number = 10\n ): Promise<SearchStickersWithDetailsResponse | null> {\n const result = await this.searchStickersWithDetails({\n sessionId,\n keyword,\n limit,\n });\n\n return result.result || null;\n }\n}\n","/**\r\n * Session Proxy service for managing proxy assignments to sessions\r\n */\r\n\r\nimport { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n AssignProxyToSessionRequest,\r\n AssignProxyToSessionResponse,\r\n} from '../../types/dto/session-proxy.type';\r\n\r\n/**\r\n * Session Proxy service class\r\n */\r\nexport class SessionProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n /**\r\n * Assign proxy cho session và kích hoạt lại instance với proxy mới\r\n *\r\n * Flow:\r\n * 1. Kiểm tra session và proxy tồn tại\r\n * 2. Cập nhật proxy cho session trong database\r\n * 3. Dừng listener cũ (nếu đang chạy)\r\n * 4. Xóa instance cũ khỏi instance manager\r\n * 5. Tạo instance mới với proxy được chỉ định\r\n * 6. Khởi động listener mới với proxy\r\n *\r\n * @param request - Session ID và Proxy ID\r\n * @returns Response với thông tin assign proxy\r\n * @throws Error nếu session chưa đăng nhập hoặc proxy không khả dụng\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = await sessionProxyService.assignProxyToSession({\r\n * sessionId: 'session-175ae5b3-7c5c-4ee4-991f-67dc63156736',\r\n * proxyId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\r\n * });\r\n *\r\n * if (result.code === 200 && result.result?.success) {\r\n * console.log('Proxy đã được gắn thành công:', result.result.message);\r\n * } else {\r\n * console.error('Gắn proxy thất bại:', result.error || result.message);\r\n * }\r\n * ```\r\n */\r\n async assignProxyToSession(\r\n request: AssignProxyToSessionRequest\r\n ): Promise<AutomationWebResponse<AssignProxyToSessionResponse>> {\r\n const response = await this.httpClient.post<\r\n AutomationWebResponse<AssignProxyToSessionResponse>\r\n >('/proxy/session/assign', {\r\n sessionId: request.sessionId,\r\n proxyId: request.proxyId,\r\n });\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport { ScrapeZaloMeRequest, ScrapeZaloMeResult } from '../../types/dto/zalo-me.type';\r\n\r\nexport class ZaloMeService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async scrape(request: ScrapeZaloMeRequest): Promise<AutomationWebResponse<ScrapeZaloMeResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ScrapeZaloMeResult>>(\r\n '/zalo-me/scrape',\r\n {\r\n sessionId: request.sessionId,\r\n url: request.url,\r\n timeoutMs: request.timeoutMs,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport {\r\n AddPollOptionsRequest,\r\n AddPollOptionsResponse,\r\n CreatePollRequest,\r\n GetPollDetailRequest,\r\n LockPollRequest,\r\n PollDetailResponse,\r\n SharePollRequest,\r\n VotePollRequest,\r\n VotePollResponse,\r\n} from '../../types/dto/zalo-poll.type';\r\n\r\nexport class ZaloPollService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async createPoll(request: CreatePollRequest): Promise<PollDetailResponse> {\r\n const response = await this.httpClient.post<PollDetailResponse>('/zalo-poll/create', {\r\n sessionId: request.sessionId,\r\n groupId: request.groupId,\r\n question: request.question,\r\n options: request.options,\r\n expiredTime: request.expiredTime,\r\n allowMultiChoices: request.allowMultiChoices,\r\n allowAddNewOption: request.allowAddNewOption,\r\n hideVotePreview: request.hideVotePreview,\r\n isAnonymous: request.isAnonymous,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async votePoll(request: VotePollRequest): Promise<VotePollResponse> {\r\n const response = await this.httpClient.post<VotePollResponse>('/zalo-poll/vote', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n optionIds: request.optionIds,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async addPollOptions(request: AddPollOptionsRequest): Promise<AddPollOptionsResponse> {\r\n const response = await this.httpClient.post<AddPollOptionsResponse>('/zalo-poll/add-options', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n newOptions: request.newOptions,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async getPollDetail(request: GetPollDetailRequest): Promise<PollDetailResponse> {\r\n const response = await this.httpClient.post<PollDetailResponse>('/zalo-poll/detail', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async lockPoll(request: LockPollRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-poll/lock', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n\r\n async sharePoll(request: SharePollRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-poll/share', {\r\n sessionId: request.sessionId,\r\n pollId: request.pollId,\r\n });\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n CustomRequest,\r\n CustomResponse,\r\n GetContextRequest,\r\n GetContextResponse,\r\n GetCookieRequest,\r\n GetCookieResponse,\r\n KeepAliveRequest,\r\n KeepAliveResponse,\r\n} from '../../types/dto/zalo-utils.type';\r\n\r\nexport class ZaloUtilsService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async getContext(request: GetContextRequest): Promise<AutomationWebResponse<GetContextResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetContextResponse>>(\r\n '/zalo-personal/utils/context',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getCookie(request: GetCookieRequest): Promise<AutomationWebResponse<GetCookieResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<GetCookieResponse>>(\r\n '/zalo-personal/utils/cookie',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async keepAlive(request: KeepAliveRequest): Promise<AutomationWebResponse<KeepAliveResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<KeepAliveResponse>>(\r\n '/zalo-personal/utils/keep-alive',\r\n {\r\n sessionId: request.sessionId,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async custom(request: CustomRequest): Promise<AutomationWebResponse<CustomResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<CustomResponse>>(\r\n '/zalo-personal/utils/custom',\r\n {\r\n sessionId: request.sessionId,\r\n name: request.name,\r\n props: request.props,\r\n }\r\n );\r\n\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n BulkImportProxyRequest,\r\n BulkImportResult,\r\n CreateProxyRequest,\r\n DisableProxyRequest,\r\n ProxyFilterRequest,\r\n ProxyListResponse,\r\n ProxyResponse,\r\n ProxyStatsResponse,\r\n TestRedaiApiResult,\r\n UpdateProxyRequest,\r\n VerifyProxyIpResult,\r\n} from '../../types/dto/proxy.type';\r\n\r\nexport class ProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async create(request: CreateProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>('/proxy', request);\r\n return response;\r\n }\r\n\r\n async findAll(filter?: ProxyFilterRequest): Promise<AutomationWebResponse<ProxyListResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyListResponse>>('/proxy', filter as any);\r\n return response;\r\n }\r\n\r\n async findAvailable(): Promise<AutomationWebResponse<ProxyResponse[]>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse[]>>('/proxy/available');\r\n return response;\r\n }\r\n\r\n async getStats(): Promise<AutomationWebResponse<ProxyStatsResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyStatsResponse>>('/proxy/stats');\r\n return response;\r\n }\r\n\r\n async bulkImport(request: BulkImportProxyRequest): Promise<AutomationWebResponse<BulkImportResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<BulkImportResult>>(\r\n '/proxy/bulk-import',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async findById(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}`);\r\n return response;\r\n }\r\n\r\n async update(id: string, request: UpdateProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.put<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}`, request);\r\n return response;\r\n }\r\n\r\n async delete(id: string): Promise<AutomationWebResponse<null>> {\r\n const response = await this.httpClient.delete<AutomationWebResponse<null>>(`/proxy/${id}`);\r\n return response;\r\n }\r\n\r\n async enable(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/enable`);\r\n return response;\r\n }\r\n\r\n async disable(id: string, request: DisableProxyRequest): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/disable`, request);\r\n return response;\r\n }\r\n\r\n async ban(id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(`/proxy/${id}/ban`);\r\n return response;\r\n }\r\n\r\n async verifyIp(id: string): Promise<AutomationWebResponse<VerifyProxyIpResult>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<VerifyProxyIpResult>>(`/proxy/${id}/verify-ip`);\r\n return response;\r\n }\r\n\r\n async testRedaiApi(id: string): Promise<AutomationWebResponse<TestRedaiApiResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<TestRedaiApiResult>>(`/proxy/${id}/test-redai-api`);\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\r\nimport { AutomationWebResponse } from '../../types/common.types';\r\nimport {\r\n BulkImportProxyRequest,\r\n BulkImportResult,\r\n CreateProxyRequest,\r\n DisableProxyRequest,\r\n ProxyFilterRequest,\r\n ProxyListResponse,\r\n ProxyResponse,\r\n ProxyStatsResponse,\r\n UpdateProxyRequest,\r\n} from '../../types/dto/proxy.type';\r\n\r\nexport class UserProxyService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n private buildHeaders(userId: number | string): Record<string, string> {\r\n return { 'x-user-id': String(userId) };\r\n }\r\n\r\n async create(\r\n userId: number | string,\r\n request: CreateProxyRequest\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\r\n '/user/proxy',\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findAll(\r\n userId: number | string,\r\n filter?: ProxyFilterRequest\r\n ): Promise<AutomationWebResponse<ProxyListResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyListResponse>>(\r\n '/user/proxy',\r\n filter as any,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findAvailable(userId: number | string): Promise<AutomationWebResponse<ProxyResponse[]>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse[]>>(\r\n '/user/proxy/available',\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async getStats(userId: number | string): Promise<AutomationWebResponse<ProxyStatsResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyStatsResponse>>(\r\n '/user/proxy/stats',\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async bulkImport(\r\n userId: number | string,\r\n request: BulkImportProxyRequest\r\n ): Promise<AutomationWebResponse<BulkImportResult>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<BulkImportResult>>(\r\n '/user/proxy/bulk-import',\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async findById(\r\n userId: number | string,\r\n id: string\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.get<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async update(\r\n userId: number | string,\r\n id: string,\r\n request: UpdateProxyRequest\r\n ): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.put<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}`,\r\n request,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async delete(userId: number | string, id: string): Promise<AutomationWebResponse<null>> {\r\n const response = await this.httpClient.delete<AutomationWebResponse<null>>(\r\n `/user/proxy/${id}`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async enable(userId: number | string, id: string): Promise<AutomationWebResponse<ProxyResponse>> {\r\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\r\n `/user/proxy/${id}/enable`,\r\n undefined,\r\n this.buildHeaders(userId)\r\n );\r\n\r\n return response;\r\n }\r\n\r\n async disable(\n userId: number | string,\n id: string,\n request: DisableProxyRequest\n ): Promise<AutomationWebResponse<ProxyResponse>> {\n const response = await this.httpClient.post<AutomationWebResponse<ProxyResponse>>(\n `/user/proxy/${id}/disable`,\n request,\n this.buildHeaders(userId)\n );\n\n return response;\n }\n}\n","import { HttpClient } from '../../utils/http.utils';\r\nimport {\r\n CatalogMutationResponse,\r\n CreateCatalogRequest,\r\n CreateNoteRequest,\r\n CreateProductCatalogRequest,\r\n CreateReminderRequest,\r\n CreateReminderResponse,\r\n DeleteCatalogRequest,\r\n DeleteProductCatalogRequest,\r\n DeleteProductCatalogResponse,\r\n EditNoteRequest,\r\n EditReminderRequest,\r\n EditReminderResponse,\r\n GetCatalogListRequest,\r\n GetCatalogListResponse,\r\n GetListBoardRequest,\r\n GetListBoardResponse,\r\n GetListReminderRequest,\r\n GetListReminderResponse,\r\n GetProductCatalogListRequest,\r\n GetProductCatalogListResponse,\r\n GetReminderRequest,\r\n GetReminderResponse,\r\n GetReminderResponsesRequest,\r\n GetReminderResponsesResponse,\r\n NoteDetailResponse,\r\n ProductCatalogMutationResponse,\r\n RemoveReminderRequest,\r\n RemoveReminderResponse,\r\n UpdateCatalogRequest,\r\n UpdateProductCatalogRequest,\r\n} from '../../types/dto/zalo-tool.type';\r\n\r\nexport class ZaloToolService {\r\n constructor(private httpClient: HttpClient) {}\r\n\r\n async createCatalog(request: CreateCatalogRequest): Promise<CatalogMutationResponse> {\r\n const response = await this.httpClient.post<CatalogMutationResponse>('/zalo-tool/catalog/create', request);\r\n return response;\r\n }\r\n\r\n async deleteCatalog(request: DeleteCatalogRequest): Promise<string> {\r\n const response = await this.httpClient.post<string>('/zalo-tool/catalog/delete', request);\r\n return response;\r\n }\r\n\r\n async updateCatalog(request: UpdateCatalogRequest): Promise<CatalogMutationResponse> {\r\n const response = await this.httpClient.post<CatalogMutationResponse>('/zalo-tool/catalog/update', request);\r\n return response;\r\n }\r\n\r\n async getCatalogList(request: GetCatalogListRequest): Promise<GetCatalogListResponse> {\r\n const response = await this.httpClient.post<GetCatalogListResponse>('/zalo-tool/catalog/list', request);\r\n return response;\r\n }\r\n\r\n async createProductCatalog(\r\n request: CreateProductCatalogRequest\r\n ): Promise<ProductCatalogMutationResponse> {\r\n const response = await this.httpClient.post<ProductCatalogMutationResponse>(\r\n '/zalo-tool/product-catalog/create',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async deleteProductCatalog(\r\n request: DeleteProductCatalogRequest\r\n ): Promise<DeleteProductCatalogResponse> {\r\n const response = await this.httpClient.post<DeleteProductCatalogResponse>(\r\n '/zalo-tool/product-catalog/delete',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async updateProductCatalog(\r\n request: UpdateProductCatalogRequest\r\n ): Promise<ProductCatalogMutationResponse> {\r\n const response = await this.httpClient.post<ProductCatalogMutationResponse>(\r\n '/zalo-tool/product-catalog/update',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async getProductCatalogList(\r\n request: GetProductCatalogListRequest\r\n ): Promise<GetProductCatalogListResponse> {\r\n const response = await this.httpClient.post<GetProductCatalogListResponse>(\r\n '/zalo-tool/product-catalog/list',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async createNote(request: CreateNoteRequest): Promise<NoteDetailResponse> {\r\n const response = await this.httpClient.post<NoteDetailResponse>('/zalo-tool/note/create', request);\r\n return response;\r\n }\r\n\r\n async editNote(request: EditNoteRequest): Promise<NoteDetailResponse> {\r\n const response = await this.httpClient.post<NoteDetailResponse>('/zalo-tool/note/edit', request);\r\n return response;\r\n }\r\n\r\n async createReminder(request: CreateReminderRequest): Promise<CreateReminderResponse> {\r\n const response = await this.httpClient.post<CreateReminderResponse>('/zalo-tool/reminder/create', request);\r\n return response;\r\n }\r\n\r\n async editReminder(request: EditReminderRequest): Promise<EditReminderResponse> {\r\n const response = await this.httpClient.post<EditReminderResponse>('/zalo-tool/reminder/edit', request);\r\n return response;\r\n }\r\n\r\n async getListReminder(request: GetListReminderRequest): Promise<GetListReminderResponse> {\r\n const response = await this.httpClient.post<GetListReminderResponse>('/zalo-tool/reminder/list', request);\r\n return response;\r\n }\r\n\r\n async getReminder(request: GetReminderRequest): Promise<GetReminderResponse> {\r\n const response = await this.httpClient.post<GetReminderResponse>('/zalo-tool/reminder/detail', request);\r\n return response;\r\n }\r\n\r\n async getReminderResponses(\r\n request: GetReminderResponsesRequest\r\n ): Promise<GetReminderResponsesResponse> {\r\n const response = await this.httpClient.post<GetReminderResponsesResponse>(\r\n '/zalo-tool/reminder/responses',\r\n request\r\n );\r\n return response;\r\n }\r\n\r\n async removeReminder(request: RemoveReminderRequest): Promise<RemoveReminderResponse> {\r\n const response = await this.httpClient.post<RemoveReminderResponse>('/zalo-tool/reminder/delete', request);\r\n return response;\r\n }\r\n\r\n async getListBoard(request: GetListBoardRequest): Promise<GetListBoardResponse> {\r\n const response = await this.httpClient.post<GetListBoardResponse>('/zalo-tool/board/list', request);\r\n return response;\r\n }\r\n}\r\n","import { HttpClient } from '../../utils/http.utils';\nimport {\n HealthCheckResponse,\n LivenessResponse,\n ReadinessResponse,\n} from '../../types/dto/health.type';\n\n/**\n * Health check service\n */\nexport class HealthService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Check application health\n * GET /health\n */\n async checkHealth(): Promise<HealthCheckResponse> {\n const response = await this.httpClient.get<HealthCheckResponse>('/health');\n return response;\n }\n\n /**\n * Liveness probe\n * GET /health/liveness\n */\n async liveness(): Promise<LivenessResponse> {\n const response = await this.httpClient.get<LivenessResponse>('/health/liveness');\n return response;\n }\n\n /**\n * Readiness probe\n * GET /health/readiness\n */\n async readiness(): Promise<ReadinessResponse> {\n const response = await this.httpClient.get<ReadinessResponse>('/health/readiness');\n return response;\n }\n}\r\n","import { HttpClient } from '../../utils/http.utils';\nimport {\n InstanceManagerStats,\n InstanceManagerSessionsResponse,\n InstanceManagerInstanceDataResponse,\n InstanceManagerListeningResponse,\n InstanceManagerCleanupResult,\n InstanceManagerRemoveResult,\n} from '../../types/dto/instance-manager.type';\n\n/**\n * Instance manager service\n */\nexport class InstanceManagerService {\n constructor(private httpClient: HttpClient) {}\n\n /**\n * Get instance statistics\n * GET /instance-manager/stats\n */\n async getStats(): Promise<InstanceManagerStats> {\n const response = await this.httpClient.get<InstanceManagerStats>('/instance-manager/stats');\n return response;\n }\n\n /**\n * Get all active session IDs\n * GET /instance-manager/sessions\n */\n async getAllSessions(): Promise<InstanceManagerSessionsResponse> {\n const response = await this.httpClient.get<InstanceManagerSessionsResponse>(\n '/instance-manager/sessions'\n );\n return response;\n }\n\n /**\n * Get instance data for a session\n * GET /instance-manager/sessions/:sessionId\n */\n async getInstanceData(sessionId: string): Promise<InstanceManagerInstanceDataResponse> {\n const response = await this.httpClient.get<InstanceManagerInstanceDataResponse>(\n `/instance-manager/sessions/${sessionId}`\n );\n return response;\n }\n\n /**\n * Check if instance is listening\n * GET /instance-manager/sessions/:sessionId/listening\n */\n async isListening(sessionId: string): Promise<InstanceManagerListeningResponse> {\n const response = await this.httpClient.get<InstanceManagerListeningResponse>(\n `/instance-manager/sessions/${sessionId}/listening`\n );\n return response;\n }\n\n /**\n * Force cleanup expired instances\n * POST /instance-manager/cleanup\n */\n async cleanupExpired(): Promise<InstanceManagerCleanupResult> {\n const response = await this.httpClient.post<InstanceManagerCleanupResult>(\n '/instance-manager/cleanup',\n {}\n );\n return response;\n }\n\n /**\n * Remove specific instance\n * DELETE /instance-manager/sessions/:sessionId\n */\n async removeInstance(sessionId: string): Promise<InstanceManagerRemoveResult> {\n const response = await this.httpClient.delete<InstanceManagerRemoveResult>(\n `/instance-manager/sessions/${sessionId}`\n );\n return response;\n }\n\n /**\n * Force cleanup all instances\n * DELETE /instance-manager/all\n */\n async cleanupAll(): Promise<InstanceManagerCleanupResult> {\n const response = await this.httpClient.delete<InstanceManagerCleanupResult>(\n '/instance-manager/all'\n );\n return response;\n }\n}\r\n","/**\n * Main SDK client for automation-web API\n */\n\nimport { HttpClient } from '../utils/http.utils';\nimport { ValidationUtils } from '../utils/validation.utils';\nimport { EventManager } from '../utils/event.utils';\nimport { AutomationWebConfig, DEFAULT_CONFIG } from '../types/common.types';\nimport { WebhookEvent, WebhookEventHandler, ZaloWebhookEventType } from '../types/webhook.types';\nimport {\n Message,\n Typing,\n Reaction,\n SeenMessage,\n DeliveredMessage,\n FriendEvent,\n GroupEvent,\n Undo,\n} from '../types/webhook';\n\n// Import services\nimport { AuthService } from '../services/auth/auth.service';\nimport { MessagingService } from '../services/messaging/messaging.service';\nimport { AdvancedMessagingService } from '../services/advanced-messaging/advanced-messaging.service';\nimport { WebhookService } from '../services/webhook/webhook.service';\nimport { GroupService } from '../services/groups/groups.service';\nimport { FriendService } from '../services/friends/friends.service';\nimport { UserInfoService } from '../services/user-info/user-info.service';\nimport { ProfileService } from '../services/profile/profile.service';\nimport { SearchService } from '../services/search/search.service';\nimport { SessionProxyService } from '../services/session-proxy/session-proxy.service';\nimport { ZaloMeService } from '../services/zalo-me/zalo-me.service';\nimport { ZaloPollService } from '../services/zalo-poll/zalo-poll.service';\nimport { ZaloUtilsService } from '../services/zalo-utils/zalo-utils.service';\nimport { ProxyService } from '../services/proxy/proxy.service';\nimport { UserProxyService } from '../services/user-proxy/user-proxy.service';\nimport { ZaloToolService } from '../services/zalo-tool/zalo-tool.service';\nimport { HealthService } from '../services/health/health.service';\nimport { InstanceManagerService } from '../services/instance-manager/instance-manager.service';\n\n/**\n * Main automation-web SDK client\n */\nexport class AutomationWebClient {\n private httpClient: HttpClient;\n private eventManager: EventManager;\n private config: AutomationWebConfig;\n\n // Service instances\n private _auth: AuthService;\n private _messaging: MessagingService;\n private _advancedMessaging: AdvancedMessagingService;\n private _webhook: WebhookService;\n private _groups: GroupService;\n private _friends: FriendService;\n private _userInfo: UserInfoService;\n private _profile: ProfileService;\n private _search: SearchService;\n private _sessionProxy: SessionProxyService;\n private _zaloMe: ZaloMeService;\n private _zaloPoll: ZaloPollService;\n private _zaloUtils: ZaloUtilsService;\n private _proxy: ProxyService;\n private _userProxy: UserProxyService;\n private _zaloTool: ZaloToolService;\n private _health: HealthService;\n private _instanceManager: InstanceManagerService;\n\n constructor(config: Partial<AutomationWebConfig>) {\n // Merge with default config\n this.config = { ...DEFAULT_CONFIG, ...config };\n\n // Validate configuration\n ValidationUtils.validateConfig(this.config);\n\n // Initialize HTTP client\n this.httpClient = new HttpClient(this.config);\n\n // Initialize event manager\n this.eventManager = new EventManager();\n\n // Initialize services\n this._auth = new AuthService(this.httpClient);\n this._messaging = new MessagingService(this.httpClient);\n this._advancedMessaging = new AdvancedMessagingService(this.httpClient);\n this._webhook = new WebhookService(this.httpClient);\n this._groups = new GroupService(this.httpClient);\n this._friends = new FriendService(this.httpClient);\n this._userInfo = new UserInfoService(this.httpClient);\n this._profile = new ProfileService(this.httpClient);\n this._search = new SearchService(this.httpClient);\n this._sessionProxy = new SessionProxyService(this.httpClient);\n this._zaloMe = new ZaloMeService(this.httpClient);\n this._zaloPoll = new ZaloPollService(this.httpClient);\n this._zaloUtils = new ZaloUtilsService(this.httpClient);\n this._proxy = new ProxyService(this.httpClient);\n this._userProxy = new UserProxyService(this.httpClient);\n this._zaloTool = new ZaloToolService(this.httpClient);\n this._health = new HealthService(this.httpClient);\n this._instanceManager = new InstanceManagerService(this.httpClient);\n\n // Setup error handling\n this.setupErrorHandling();\n }\n\n /**\n * Get authentication service\n */\n get auth(): AuthService {\n return this._auth;\n }\n\n /**\n * Get messaging service\n */\n get messaging(): MessagingService {\n return this._messaging;\n }\n\n /**\n * Get advanced messaging service\n */\n get advancedMessaging(): AdvancedMessagingService {\n return this._advancedMessaging;\n }\n\n /**\n * Get groups service\n */\n get groups(): GroupService {\n return this._groups;\n }\n\n /**\n * Get friends service\n */\n get friends(): FriendService {\n return this._friends;\n }\n\n /**\n * Get user info service\n */\n get userInfo(): UserInfoService {\n return this._userInfo;\n }\n\n /**\n * Get profile service\n */\n get profile(): ProfileService {\n return this._profile;\n }\n\n /**\n * Get webhook service\n */\n get webhook(): WebhookService {\n return this._webhook;\n }\n\n /**\n * Get search service\n */\n get search(): SearchService {\n return this._search;\n }\n\n\n /**\n * Get session proxy service\n */\n get sessionProxy(): SessionProxyService {\n return this._sessionProxy;\n }\n\n get zaloMe(): ZaloMeService {\n return this._zaloMe;\n }\n\n get zaloPoll(): ZaloPollService {\n return this._zaloPoll;\n }\n\n get zaloUtils(): ZaloUtilsService {\n return this._zaloUtils;\n }\n\n get proxy(): ProxyService {\n return this._proxy;\n }\n\n get userProxy(): UserProxyService {\n return this._userProxy;\n }\n\n get zaloTool(): ZaloToolService {\n return this._zaloTool;\n }\n\n get health(): HealthService {\n return this._health;\n }\n\n get instanceManager(): InstanceManagerService {\n return this._instanceManager;\n }\n\n /**\n * Register webhook event handler\n */\n onEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.addHandler(eventType, handler);\n return this;\n }\n\n /**\n * Register one-time webhook event handler\n */\n onceEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.addOnceHandler(eventType, handler);\n return this;\n }\n\n /**\n * Remove webhook event handler\n */\n offEvent<T extends WebhookEvent = WebhookEvent>(\n eventType: ZaloWebhookEventType | string,\n handler: WebhookEventHandler<T>\n ): this {\n this.eventManager.removeHandler(eventType, handler);\n return this;\n }\n\n /**\n * Remove all handlers for event type\n */\n removeAllEventListeners(eventType?: ZaloWebhookEventType | string): this {\n this.eventManager.removeAllListeners(eventType);\n return this;\n }\n\n /**\n * Process incoming webhook event\n */\n async processWebhookEvent(event: WebhookEvent): Promise<void> {\n await this.eventManager.emitAsync(event.eventType, event);\n }\n\n /**\n * Convenience methods for common events\n */\n\n /**\n * Listen for message received events\n */\n onMessageReceived(handler: WebhookEventHandler): this {\n // Listen for all message received events\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message sent events\n */\n onMessageSent(handler: WebhookEventHandler): this {\n // Listen for all message sent events\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER, handler);\n this.onEvent(ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for typing events\n */\n onTyping(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message seen events\n */\n onMessageSeen(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for message reaction events\n */\n onMessageReaction(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER, handler);\n this.onEvent(ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP, handler);\n return this;\n }\n\n /**\n * Listen for friend events\n */\n onFriendAdded(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.FRIEND_EVENT_ADD, handler);\n }\n\n /**\n * Listen for group events\n */\n onGroupMemberAdded(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.GROUP_EVENT_JOIN, handler);\n }\n\n /**\n * Listen for connection events\n */\n onConnectionLost(handler: WebhookEventHandler): this {\n return this.onEvent(ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED, handler);\n }\n\n /**\n * Listen for error events\n */\n onError(handler: WebhookEventHandler): this {\n this.onEvent(ZaloWebhookEventType.ERROR_SYSTEM, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_NETWORK, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_AUTHENTICATION, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_VALIDATION, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_BUSINESS_LOGIC, handler);\n this.onEvent(ZaloWebhookEventType.ERROR_UNKNOWN, handler);\n return this;\n }\n\n // ==================== TYPED EVENT HANDLERS ====================\n\n /**\n * Listen for typed message events\n */\n onTypedMessage(handler: (message: Message) => void): this {\n // Convert generic webhook events to typed Message events\n this.onMessageReceived(event => {\n // Here you would parse the event data into Message type\n // For now, we'll pass the raw event data\n handler(event.eventData as unknown as Message);\n });\n return this;\n }\n\n /**\n * Listen for typing events\n */\n onTypedTyping(handler: (typing: Typing) => void): this {\n this.onEvent('typing', event => {\n handler(event.eventData as unknown as Typing);\n });\n return this;\n }\n\n /**\n * Listen for typed reaction events\n */\n onTypedReaction(handler: (reaction: Reaction) => void): this {\n this.onMessageReaction(event => {\n handler(event.eventData as unknown as Reaction);\n });\n return this;\n }\n\n /**\n * Listen for typed seen message events\n */\n onTypedMessageSeen(handler: (seenMessage: SeenMessage) => void): this {\n this.onMessageSeen(event => {\n handler(event.eventData as unknown as SeenMessage);\n });\n return this;\n }\n\n /**\n * Listen for typed delivered message events\n */\n onTypedMessageDelivered(handler: (deliveredMessage: DeliveredMessage) => void): this {\n this.onEvent('message_delivered', event => {\n handler(event.eventData as unknown as DeliveredMessage);\n });\n return this;\n }\n\n /**\n * Listen for typed friend events\n */\n onTypedFriendEvent(handler: (friendEvent: FriendEvent) => void): this {\n this.onFriendAdded(event => {\n handler(event.eventData as unknown as FriendEvent);\n });\n return this;\n }\n\n /**\n * Listen for typed group events\n */\n onTypedGroupEvent(handler: (groupEvent: GroupEvent) => void): this {\n this.onGroupMemberAdded(event => {\n handler(event.eventData as unknown as GroupEvent);\n });\n return this;\n }\n\n /**\n * Listen for typed undo events\n */\n onTypedUndo(handler: (undo: Undo) => void): this {\n this.onEvent('message_undo', event => {\n handler(event.eventData as unknown as Undo);\n });\n return this;\n }\n\n /**\n * Update SDK configuration\n */\n updateConfig(newConfig: Partial<AutomationWebConfig>): void {\n this.config = { ...this.config, ...newConfig };\n ValidationUtils.validateConfig(this.config);\n this.httpClient.updateConfig(this.config);\n }\n\n /**\n * Get current configuration\n */\n getConfig(): AutomationWebConfig {\n return { ...this.config };\n }\n\n /**\n * Get SDK version\n */\n getVersion(): string {\n return '1.9.8';\n }\n\n /**\n * Test connection to automation-web API\n */\n async testConnection(): Promise<boolean> {\n try {\n await this.httpClient.get('/health');\n return true;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Get API health status\n */\n async getHealthStatus(): Promise<{\n status: 'healthy' | 'unhealthy';\n timestamp: string;\n version?: string;\n uptime?: number;\n }> {\n try {\n const response = await this.httpClient.get<{\n status: string;\n timestamp: string;\n version?: string;\n uptime?: number;\n }>('/health');\n\n return {\n status: response.status === 'ok' ? 'healthy' : 'unhealthy',\n timestamp: response.timestamp,\n version: response.version,\n uptime: response.uptime,\n };\n } catch (error) {\n return {\n status: 'unhealthy',\n timestamp: new Date().toISOString(),\n };\n }\n }\n\n /**\n * Setup error handling\n */\n private setupErrorHandling(): void {\n // Handle internal errors using EventEmitter's built-in error event\n (this.eventManager as any).addListener('error', (error: Error) => {\n if (this.config.logging) {\n console.error('[AutomationWebClient] Error occurred:', error.message);\n }\n });\n }\n\n /**\n * Cleanup resources\n */\n destroy(): void {\n this.eventManager.removeAllListeners();\n }\n}\n","/**\n * Authentication related types and interfaces\n */\n\n/**\n * Session status enum - Chuẩn theo automation-web controller\n */\nexport enum SessionStatus {\n PENDING = 'pending',\n SCANNING = 'scanning',\n SUCCESS = 'success',\n FAILED = 'failed',\n EXPIRED = 'expired',\n QR_EXPIRED = 'qr_expired',\n}\n\n/**\n * Zalo credentials for login - Chuẩn theo automation-web shared types\n */\nexport interface ZaloCredentials {\n /**\n * Cookie array from browser - as received from SDK login\n */\n cookie: Array<Record<string, unknown>>;\n\n /**\n * Device IMEI\n */\n imei: string;\n\n /**\n * Browser user agent\n */\n userAgent: string;\n\n /**\n * Language preference\n * @default 'vi'\n */\n language?: string;\n}\n\n/**\n * Zalo user data - Chuẩn theo automation-web shared types\n */\nexport interface ZaloUserData {\n /**\n * Zalo platform user ID (stringified number)\n */\n userId: string;\n\n /**\n * Display name\n */\n displayName: string;\n\n /**\n * Avatar URL\n */\n avatar: string;\n\n /**\n * Optional details, may be absent depending on SDK method\n */\n username?: string;\n\n /**\n * Phone number (if available)\n */\n phoneNumber?: string;\n\n /**\n * Gender (0/1)\n */\n gender?: number;\n\n /**\n * Status\n */\n status?: string;\n\n /**\n * Cover image URL\n */\n cover?: string;\n\n /**\n * Global ID\n */\n globalId?: string;\n\n /**\n * Is active (0/1)\n */\n isActive?: number;\n\n /**\n * Last action time (epoch millis)\n */\n lastActionTime?: number;\n\n /**\n * Created timestamp (epoch seconds)\n */\n createdTs?: number;\n\n /**\n * Email (rarely present)\n */\n email?: string;\n\n /**\n * Additional properties\n */\n [key: string]: unknown;\n}\n\n/**\n * QR Login Options - Tùy chọn cho QR login\n */\nexport interface QRLoginOptions {\n /**\n * Thời gian timeout cho QR code (giây)\n * @default 120\n * @min 30\n * @max 300\n */\n timeout?: number;\n\n /**\n * Tự động đăng nhập sau khi quét QR\n * @default true\n */\n autoLogin?: boolean;\n\n /**\n * ID của proxy muốn sử dụng (nếu muốn chỉ định cụ thể)\n */\n proxyId?: string;\n\n /**\n * Region của proxy muốn sử dụng (nếu không chỉ định proxyId)\n */\n proxyRegion?: string;\n}\n\n/**\n * QR Code login request - Chuẩn theo automation-web QRLoginRequestDto\n */\nexport interface QRLoginRequest {\n /**\n * ID của user tạo session (userId từ redai-v201-be-app)\n */\n createdBy?: number | string;\n\n /**\n * @deprecated Dùng createdBy (number) thay thế\n */\n userUuid?: string;\n\n workspaceId: string;\n\n baseId?: string;\n\n /**\n * Session ID tùy chọn, sẽ auto-generate nếu không cung cấp\n */\n sessionId?: string;\n\n /**\n * Tùy chọn cho QR login\n */\n options?: QRLoginOptions;\n}\n\n/**\n * QR Login Data - Dữ liệu QR Code\n */\nexport interface QRLoginData {\n /**\n * Session ID để tracking\n */\n sessionId: string;\n\n /**\n * QR Code dưới dạng base64\n */\n qrCode: string;\n\n /**\n * Thời gian hết hạn QR code (timestamp)\n */\n expiresAt: number;\n\n /**\n * URL để polling status\n */\n pollUrl: string;\n}\n\n/**\n * QR Code login response - Chuẩn theo automation-web QRLoginResponseDto\n */\nexport interface QRLoginResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu response\n */\n data?: QRLoginData;\n}\n\n/**\n * Session Info - Thông tin session\n */\nexport interface SessionInfo {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Thời gian tạo session (timestamp)\n */\n createdAt: number;\n\n /**\n * Thời gian hết hạn session (timestamp)\n */\n expiresAt: number;\n\n /**\n * Thời gian hết hạn QR code (timestamp)\n */\n qrExpiresAt?: number;\n\n /**\n * Lần hoạt động cuối (timestamp)\n */\n lastActivity: number;\n}\n\n/**\n * Login Status Data - Dữ liệu trạng thái đăng nhập\n */\nexport interface LoginStatusData {\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * Thông tin user Zalo (khi đăng nhập thành công)\n */\n userData?: ZaloUserData;\n\n /**\n * Credentials để reuse (khi đăng nhập thành công)\n */\n credentials?: ZaloCredentials;\n\n /**\n * Thông tin session\n */\n sessionInfo: SessionInfo;\n}\n\n/**\n * Login status response - Chuẩn theo automation-web LoginStatusResponseDto\n */\nexport interface LoginStatusResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu status\n */\n data?: LoginStatusData;\n}\n\n/**\n * Credentials Login Options - Chuẩn theo automation-web CredentialsLoginOptionsDto\n */\nexport interface CredentialsLoginOptions {\n /**\n * Chỉ validate credentials, không tạo session\n * @default false\n */\n validateOnly?: boolean;\n}\n\n/**\n * Credentials login request - Chuẩn theo automation-web CredentialsLoginRequestDto\n */\nexport interface CredentialsLoginRequest {\n /**\n * ID của user tạo session (userId từ redai-v201-be-app)\n */\n createdBy?: number | string;\n\n /**\n * @deprecated Dùng createdBy (number) thay thế\n */\n userUuid?: string;\n\n /**\n * Zalo credentials để đăng nhập\n */\n credentials: ZaloCredentials;\n\n /**\n * Tùy chọn cho credentials login\n */\n options?: CredentialsLoginOptions;\n}\n\n/**\n * Credentials Login Data - Dữ liệu credentials login\n */\nexport interface CredentialsLoginData {\n /**\n * Session ID được tạo\n */\n sessionId: string;\n\n /**\n * Thông tin user Zalo\n */\n userData: ZaloUserData;\n\n /**\n * Credentials có hợp lệ không\n */\n isValid: boolean;\n}\n\n/**\n * Credentials login response - Chuẩn theo automation-web CredentialsLoginResponseDto\n */\nexport interface CredentialsLoginResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu response\n */\n data?: CredentialsLoginData;\n}\n\n/**\n * Session Item - Chuẩn theo automation-web SessionItemDto\n */\nexport interface SessionItem {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * Thông tin user (nếu đã đăng nhập thành công)\n */\n userData?: ZaloUserData;\n\n /**\n * Thời gian tạo (timestamp)\n */\n createdAt: number;\n\n /**\n * Lần hoạt động cuối (timestamp)\n */\n lastActivity: number;\n\n /**\n * Thời gian hết hạn (timestamp)\n */\n expiresAt: number;\n\n /**\n * Session có hết hạn chưa\n */\n isExpired: boolean;\n}\n\n/**\n * Session List Data - Dữ liệu danh sách sessions\n */\nexport interface SessionListData {\n /**\n * Danh sách sessions\n */\n sessions: SessionItem[];\n\n /**\n * Tổng số sessions\n */\n total: number;\n\n /**\n * Số sessions đang active\n */\n activeCount: number;\n}\n\n/**\n * Session list response - Chuẩn theo automation-web SessionListResponseDto\n */\nexport interface SessionListResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu sessions\n */\n data?: SessionListData;\n}\n\n/**\n * Session delete response - Chuẩn theo automation-web SessionDeleteResponseDto\n */\nexport interface SessionDeleteResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n}\n\n/**\n * Bulk delete sessions request - Chuẩn theo automation-web BulkDeleteSessionsDto\n */\nexport interface BulkDeleteSessionsRequest {\n /**\n * Danh sách session IDs cần xóa\n */\n sessionIds: string[];\n}\n\n/**\n * Bulk delete sessions response - Chuẩn theo automation-web BulkDeleteSessionsResponseDto\n */\nexport interface BulkDeleteSessionsResponse {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Số lượng sessions đã xóa thành công\n */\n deletedCount: number;\n\n /**\n * Danh sách session IDs đã xóa thành công\n */\n deletedIds: string[];\n\n /**\n * Số lượng sessions xóa thất bại\n */\n failedCount?: number;\n\n /**\n * Danh sách session IDs xóa thất bại\n */\n failedIds?: string[];\n\n /**\n * Danh sách lỗi chi tiết\n */\n errors?: string[];\n}\n\n/**\n * Session Debug Data - Dữ liệu debug session\n */\nexport interface SessionDebugData {\n /**\n * Session ID\n */\n sessionId: string;\n\n /**\n * Creator ID\n */\n createdBy?: number | string;\n\n /**\n * User UUID\n */\n userUuid?: string;\n\n /**\n * Trạng thái session\n */\n status: SessionStatus;\n\n /**\n * QR Code (truncated)\n */\n qrCode: string | null;\n\n /**\n * Thời gian hết hạn QR code\n */\n qrExpiresAt?: number;\n\n /**\n * Có credentials không\n */\n hasCredentials: boolean;\n\n /**\n * Thông tin credentials\n */\n credentialsInfo?: {\n cookieCount: number;\n hasImei: boolean;\n hasUserAgent: boolean;\n language?: string;\n };\n\n /**\n * Có user data không\n */\n hasUserData: boolean;\n\n /**\n * Thông tin user data\n */\n userDataInfo?: {\n userId?: string;\n displayName?: string;\n hasAvatar: boolean;\n };\n\n /**\n * Thông tin timestamps\n */\n timestamps: {\n createdAt: number;\n expiresAt: number;\n lastActivity: number;\n };\n\n /**\n * Trạng thái hết hạn\n */\n isExpired: boolean;\n\n /**\n * Trạng thái QR hết hạn\n */\n isQRExpired: boolean;\n\n /**\n * Thông tin instance\n */\n instanceInfo?: {\n hasInstance: boolean;\n isConnected?: boolean;\n lastPing?: number;\n };\n}\n\n/**\n * Session debug information - Chuẩn theo automation-web debugSession response\n */\nexport interface SessionDebugInfo {\n /**\n * Trạng thái thành công\n */\n success: boolean;\n\n /**\n * Thông báo\n */\n message: string;\n\n /**\n * Dữ liệu debug (nếu thành công)\n */\n data?: SessionDebugData;\n\n /**\n * Thông tin lỗi (nếu thất bại)\n */\n error?: string;\n\n /**\n * Timestamp\n */\n timestamp?: number;\n}\n","/**\n * Webhook Event Enums\n * 100% khớp với zalo-personal-sdk/src/models/Enum.ts\n */\n\n/**\n * Thread Type enum - loại cuộc trò chuyện\n */\nexport enum ThreadType {\n USER = 0,\n GROUP = 1,\n}\n\n/**\n * Destination Type enum\n */\nexport enum DestType {\n USER = 3,\n PAGE = 5,\n}\n\n/**\n * Reminder Repeat Mode enum\n */\nexport enum ReminderRepeatMode {\n NONE = 0,\n DAILY = 1,\n WEEKLY = 2,\n MONTHLY = 3,\n}\n\n/**\n * Gender enum\n */\nexport enum Gender {\n MALE = 0,\n FEMALE = 1,\n}\n\n/**\n * Board Type enum\n */\nexport enum BoardType {\n NOTE = 1,\n PINNED_MESSAGE = 2,\n POLL = 3,\n}\n\n/**\n * Reaction Types enum - các loại phản ứng\n */\nexport enum Reactions {\n HEART = \"/-heart\",\n LIKE = \"/-strong\",\n HAHA = \":>\",\n WOW = \":o\",\n CRY = \":-((\",\n ANGRY = \":-h\",\n KISS = \":-*\",\n TEARS_OF_JOY = \":')\",\n SHIT = \"/-shit\",\n ROSE = \"/-rose\",\n BROKEN_HEART = \"/-break\",\n DISLIKE = \"/-weak\",\n LOVE = \";xx\",\n CONFUSED = \";-/\",\n WINK = \";-)\",\n FADE = \"/-fade\",\n SUN = \"/-li\",\n BIRTHDAY = \"/-bd\",\n BOMB = \"/-bome\",\n OK = \"/-ok\",\n PEACE = \"/-v\",\n THANKS = \"/-thanks\",\n PUNCH = \"/-punch\",\n SHARE = \"/-share\",\n PRAY = \"_()_\",\n NO = \"/-no\",\n BAD = \"/-bad\",\n LOVE_YOU = \"/-loveu\",\n SAD = \"--b\",\n VERY_SAD = \":((\",\n COOL = \"x-)\",\n NERD = \"8-)\",\n BIG_SMILE = \";-d\",\n SUNGLASSES = \"b-)\",\n NEUTRAL = \":--|\",\n SAD_FACE = \"p-(\",\n BYE = \":-bye\",\n SLEEPY = \"|-)\",\n WIPE = \":wipe\",\n DIG = \":-dig\",\n ANGUISH = \"&-(\",\n HANDCLAP = \":handclap\",\n ANGRY_FACE = \">-|\",\n F_CHAIR = \":-f\",\n L_CHAIR = \":-l\",\n R_CHAIR = \":-r\",\n SILENT = \";-x\",\n SURPRISE = \":-o\",\n EMBARRASSED = \";-s\",\n AFRAID = \";-a\",\n SAD2 = \":-<\",\n BIG_LAUGH = \":))\",\n RICH = \"$-)\",\n BEER = \"/-beer\",\n NONE = \"\",\n}\n\n/**\n * Friend Event Type enum - các loại sự kiện bạn bè\n */\nexport enum FriendEventType {\n ADD = 0,\n REMOVE = 1,\n REQUEST = 2,\n UNDO_REQUEST = 3,\n REJECT_REQUEST = 4,\n SEEN_FRIEND_REQUEST = 5,\n BLOCK = 6,\n UNBLOCK = 7,\n BLOCK_CALL = 8,\n UNBLOCK_CALL = 9,\n PIN_UNPIN = 10,\n PIN_CREATE = 11,\n UNKNOWN = 12,\n}\n\n/**\n * Group Event Type enum - các loại sự kiện nhóm\n */\nexport enum GroupEventType {\n JOIN_REQUEST = 0,\n JOIN = 1,\n LEAVE = 2,\n REMOVE_MEMBER = 3,\n BLOCK_MEMBER = 4,\n UPDATE_SETTING = 5,\n UPDATE = 6,\n NEW_LINK = 7,\n ADD_ADMIN = 8,\n REMOVE_ADMIN = 9,\n NEW_PIN_TOPIC = 10,\n UPDATE_PIN_TOPIC = 11,\n REORDER_PIN_TOPIC = 12,\n UPDATE_BOARD = 13,\n REMOVE_BOARD = 14,\n UPDATE_TOPIC = 15,\n UNPIN_TOPIC = 16,\n REMOVE_TOPIC = 17,\n ACCEPT_REMIND = 18,\n REJECT_REMIND = 19,\n REMIND_TOPIC = 20,\n UPDATE_AVATAR = 21,\n UNKNOWN = 22,\n}\n","/**\n * Message Types\n * 100% khớp với zalo-personal-sdk/src/models/Message.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Attachment Content Type\n */\nexport interface TAttachmentContent {\n title: string;\n description: string;\n href: string;\n thumb: string;\n childnumber: number;\n action: string;\n params: string;\n type: string;\n}\n\n/**\n * Other Content Type\n */\nexport interface TOtherContent {\n [key: string]: any;\n}\n\n/**\n * Quote Type\n */\nexport interface TQuote {\n ownerId: number;\n cliMsgId: number;\n globalMsgId: number;\n cliMsgType: number;\n ts: number;\n msg: string;\n attach: string;\n fromD: string;\n ttl: number;\n}\n\n/**\n * Mention Type\n */\nexport interface TMention {\n uid: string;\n pos: number;\n len: number;\n type: 0 | 1;\n}\n\n/**\n * Base Message Type\n */\nexport interface TMessage {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: string | TAttachmentContent | TOtherContent;\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n topOut: string;\n topOutTimeOut: string;\n topOutImprTimeOut: string;\n propertyExt:\n | {\n color: number;\n size: number;\n type: number;\n subType: number;\n ext: string;\n }\n | undefined;\n paramsExt: {\n countUnread: number;\n containType: number;\n platformType: number;\n };\n cmd: number;\n st: number;\n at: number;\n realMsgId: string;\n quote: TQuote | undefined;\n}\n\n/**\n * Group Message Type (extends TMessage with mentions)\n */\nexport interface TGroupMessage extends TMessage {\n mentions: TMention[] | undefined;\n}\n\n/**\n * User Message Class\n */\nexport class UserMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TMessage;\n threadId: string;\n /**\n * true if the message is sent by the logged in account\n */\n isSelf: boolean;\n\n constructor(uid: string, data: TMessage) {\n this.data = data;\n this.threadId = data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n\n/**\n * Group Message Class\n */\nexport class GroupMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupMessage;\n threadId: string;\n /**\n * true if the message is sent by the logged in account\n */\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupMessage) {\n this.data = data;\n this.threadId = data.idTo;\n this.isSelf = data.uidFrom === \"0\";\n\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n\n/**\n * Message Union Type\n */\nexport type Message = UserMessage | GroupMessage;\n","/**\n * Typing Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Typing.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Base Typing Type\n */\nexport interface TTyping {\n uid: string;\n ts: string;\n isPC: 0 | 1;\n}\n\n/**\n * Group Typing Type (extends TTyping with group ID)\n */\nexport interface TGroupTyping extends TTyping {\n gid: string;\n}\n\n/**\n * User Typing Class\n */\nexport class UserTyping {\n type: ThreadType.USER = ThreadType.USER;\n data: TTyping;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TTyping) {\n this.data = data;\n this.threadId = data.uid;\n this.isSelf = false;\n }\n}\n\n/**\n * Group Typing Class\n */\nexport class GroupTyping {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupTyping;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TGroupTyping) {\n this.data = data;\n this.threadId = data.gid;\n this.isSelf = false;\n }\n}\n\n/**\n * Typing Union Type\n */\nexport type Typing = UserTyping | GroupTyping;\n","/**\n * Reaction Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Reaction.ts\n */\n\nimport { Reactions } from './enums';\n\n/**\n * Reaction Type\n */\nexport interface TReaction {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName?: string;\n content: {\n rMsg: { gMsgID: string; cMsgID: string; msgType: number }[];\n rIcon: Reactions;\n rType: number;\n source: number;\n };\n ts: string;\n ttl: number;\n}\n\n/**\n * Reaction Class\n */\nexport class Reaction {\n data: TReaction;\n threadId: string;\n isSelf: boolean;\n isGroup: boolean;\n\n constructor(uid: string, data: TReaction, isGroup: boolean) {\n this.data = data;\n this.threadId = isGroup || data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n this.isGroup = isGroup;\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n","/**\n * Seen Message Event Types\n * 100% khớp với zalo-personal-sdk/src/models/SeenMessage.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * User Seen Message Type\n */\nexport interface TUserSeenMessage {\n idTo: string;\n msgId: string;\n realMsgId: string;\n}\n\n/**\n * Group Seen Message Type\n */\nexport interface TGroupSeenMessage {\n msgId: string;\n groupId: string;\n seenUids: string[];\n}\n\n/**\n * User Seen Message Class\n */\nexport class UserSeenMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TUserSeenMessage;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TUserSeenMessage) {\n this.data = data;\n this.threadId = data.idTo;\n this.isSelf = false;\n }\n}\n\n/**\n * Group Seen Message Class\n */\nexport class GroupSeenMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupSeenMessage;\n threadId: string;\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupSeenMessage) {\n this.data = data;\n this.threadId = data.groupId;\n this.isSelf = data.seenUids.includes(uid);\n }\n}\n\n/**\n * Seen Message Union Type\n */\nexport type SeenMessage = UserSeenMessage | GroupSeenMessage;\n","/**\n * Delivered Message Event Types\n * 100% khớp với zalo-personal-sdk/src/models/DeliveredMessage.ts\n */\n\nimport { ThreadType } from './enums';\n\n/**\n * Delivered Message Type\n */\nexport interface TDeliveredMessage {\n msgId: string;\n seen: number;\n deliveredUids: string[];\n seenUids: string[];\n realMsgId: string;\n mSTs: number;\n}\n\n/**\n * Group Delivered Message Type (extends TDeliveredMessage with group ID)\n */\nexport interface TGroupDeliveredMessage extends TDeliveredMessage {\n groupId: string;\n}\n\n/**\n * User Delivered Message Class\n */\nexport class UserDeliveredMessage {\n type: ThreadType.USER = ThreadType.USER;\n data: TDeliveredMessage;\n threadId: string;\n isSelf: false = false;\n\n constructor(data: TDeliveredMessage) {\n this.data = data;\n this.threadId = data.deliveredUids[0];\n this.isSelf = false;\n }\n}\n\n/**\n * Group Delivered Message Class\n */\nexport class GroupDeliveredMessage {\n type: ThreadType.GROUP = ThreadType.GROUP;\n data: TGroupDeliveredMessage;\n threadId: string;\n isSelf: boolean;\n\n constructor(uid: string, data: TGroupDeliveredMessage) {\n this.data = data;\n this.threadId = data.groupId;\n this.isSelf = data.deliveredUids.includes(uid);\n }\n}\n\n/**\n * Delivered Message Union Type\n */\nexport type DeliveredMessage = UserDeliveredMessage | GroupDeliveredMessage;\n","/**\n * Undo Event Types\n * 100% khớp với zalo-personal-sdk/src/models/Undo.ts\n */\n\n/**\n * Undo Content Type\n */\nexport interface TUndoContent {\n globalMsgId: number;\n cliMsgId: number;\n deleteMsg: number;\n srcId: number;\n destId: number;\n}\n\n/**\n * Undo Type\n */\nexport interface TUndo {\n actionId: string;\n msgId: string;\n cliMsgId: string;\n msgType: string;\n uidFrom: string;\n idTo: string;\n dName: string;\n ts: string;\n status: number;\n content: TUndoContent;\n notify: string;\n ttl: number;\n userId: string;\n uin: string;\n cmd: number;\n st: number;\n at: number;\n realMsgId: string;\n}\n\n/**\n * Undo Class\n */\nexport class Undo {\n data: TUndo;\n threadId: string;\n isSelf: boolean;\n isGroup: boolean;\n\n constructor(uid: string, data: TUndo, isGroup: boolean) {\n this.data = data;\n this.threadId = isGroup || data.uidFrom === \"0\" ? data.idTo : data.uidFrom;\n this.isSelf = data.uidFrom === \"0\";\n this.isGroup = isGroup;\n\n if (data.idTo === \"0\") data.idTo = uid;\n if (data.uidFrom === \"0\") data.uidFrom = uid;\n }\n}\n","/**\n * Webhook Job Types\n * 100% khớp với automation-web/src/shared/types/zalo-webhook-events.types.ts\n * Cấu trúc job khi đưa vào queue\n */\n\n// ==================== BASE TYPES ====================\n\n/**\n * Thread Type enum\n */\nexport enum ZaloThreadType {\n USER = 'user',\n GROUP = 'group',\n}\n\n/**\n * Connection Status enum\n */\nexport enum ZaloConnectionStatus {\n CONNECTED = 'connected',\n DISCONNECTED = 'disconnected',\n RECONNECTING = 'reconnecting',\n LOGGED_OUT = 'logged_out',\n}\n\n/**\n * Event Type enum - Chuẩn hóa tất cả event types\n */\nexport enum ZaloWebhookEventType {\n // ==================== TIN NHẮN TEXT (4 events) ====================\n TEXT_MESSAGE_SENT_TO_USER = 'text-message-sent-to-user',\n TEXT_MESSAGE_SENT_TO_GROUP = 'text-message-sent-to-group',\n TEXT_MESSAGE_RECEIVED_FROM_USER = 'text-message-received-from-user',\n TEXT_MESSAGE_RECEIVED_FROM_GROUP = 'text-message-received-from-group',\n\n // ==================== TIN NHẮN HÌNH ẢNH (4 events) ====================\n IMAGE_MESSAGE_SENT_TO_USER = 'image-message-sent-to-user',\n IMAGE_MESSAGE_SENT_TO_GROUP = 'image-message-sent-to-group',\n IMAGE_MESSAGE_RECEIVED_FROM_USER = 'image-message-received-from-user',\n IMAGE_MESSAGE_RECEIVED_FROM_GROUP = 'image-message-received-from-group',\n\n // ==================== TIN NHẮN VIDEO (4 events) ====================\n VIDEO_MESSAGE_SENT_TO_USER = 'video-message-sent-to-user',\n VIDEO_MESSAGE_SENT_TO_GROUP = 'video-message-sent-to-group',\n VIDEO_MESSAGE_RECEIVED_FROM_USER = 'video-message-received-from-user',\n VIDEO_MESSAGE_RECEIVED_FROM_GROUP = 'video-message-received-from-group',\n\n // ==================== TIN NHẮN VOICE/AUDIO (4 events) ====================\n VOICE_MESSAGE_SENT_TO_USER = 'voice-message-sent-to-user',\n VOICE_MESSAGE_SENT_TO_GROUP = 'voice-message-sent-to-group',\n VOICE_MESSAGE_RECEIVED_FROM_USER = 'voice-message-received-from-user',\n VOICE_MESSAGE_RECEIVED_FROM_GROUP = 'voice-message-received-from-group',\n\n // ==================== TIN NHẮN FILE (4 events) ====================\n FILE_MESSAGE_SENT_TO_USER = 'file-message-sent-to-user',\n FILE_MESSAGE_SENT_TO_GROUP = 'file-message-sent-to-group',\n FILE_MESSAGE_RECEIVED_FROM_USER = 'file-message-received-from-user',\n FILE_MESSAGE_RECEIVED_FROM_GROUP = 'file-message-received-from-group',\n\n // ==================== TIN NHẮN STICKER (4 events) ====================\n STICKER_MESSAGE_SENT_TO_USER = 'sticker-message-sent-to-user',\n STICKER_MESSAGE_SENT_TO_GROUP = 'sticker-message-sent-to-group',\n STICKER_MESSAGE_RECEIVED_FROM_USER = 'sticker-message-received-from-user',\n STICKER_MESSAGE_RECEIVED_FROM_GROUP = 'sticker-message-received-from-group',\n\n // ==================== TIN NHẮN VỊ TRÍ (4 events) ====================\n LOCATION_MESSAGE_SENT_TO_USER = 'location-message-sent-to-user',\n LOCATION_MESSAGE_SENT_TO_GROUP = 'location-message-sent-to-group',\n LOCATION_MESSAGE_RECEIVED_FROM_USER = 'location-message-received-from-user',\n LOCATION_MESSAGE_RECEIVED_FROM_GROUP = 'location-message-received-from-group',\n\n // ==================== TIN NHẮN GIF (4 events) ====================\n GIF_MESSAGE_SENT_TO_USER = 'gif-message-sent-to-user',\n GIF_MESSAGE_SENT_TO_GROUP = 'gif-message-sent-to-group',\n GIF_MESSAGE_RECEIVED_FROM_USER = 'gif-message-received-from-user',\n GIF_MESSAGE_RECEIVED_FROM_GROUP = 'gif-message-received-from-group',\n\n // ==================== TIN NHẮN LINK (4 events) ====================\n LINK_MESSAGE_SENT_TO_USER = 'link-message-sent-to-user',\n LINK_MESSAGE_SENT_TO_GROUP = 'link-message-sent-to-group',\n LINK_MESSAGE_RECEIVED_FROM_USER = 'link-message-received-from-user',\n LINK_MESSAGE_RECEIVED_FROM_GROUP = 'link-message-received-from-group',\n\n // ==================== TIN NHẮN VẼ DOODLE (4 events) ====================\n DOODLE_MESSAGE_SENT_TO_USER = 'doodle-message-sent-to-user',\n DOODLE_MESSAGE_SENT_TO_GROUP = 'doodle-message-sent-to-group',\n DOODLE_MESSAGE_RECEIVED_FROM_USER = 'doodle-message-received-from-user',\n DOODLE_MESSAGE_RECEIVED_FROM_GROUP = 'doodle-message-received-from-group',\n\n // Message events - RECOMMENDED (4 events)\n RECOMMENDED_MESSAGE_SENT_TO_USER = 'recommended-message-sent-to-user',\n RECOMMENDED_MESSAGE_SENT_TO_GROUP = 'recommended-message-sent-to-group',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_USER = 'recommended-message-received-from-user',\n RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP = 'recommended-message-received-from-group',\n\n // ==================== TIN NHẮN CŨ (1 event) ====================\n OLD_MESSAGES = 'old-messages',\n\n // ==================== TRẠNG THÁI TYPING - ĐANG SOẠN TIN (4 events) ====================\n TYPING_BY_SELF_IN_USER = 'typing-by-self-in-user',\n TYPING_BY_SELF_IN_GROUP = 'typing-by-self-in-group',\n TYPING_BY_OTHER_IN_USER = 'typing-by-other-in-user',\n TYPING_BY_OTHER_IN_GROUP = 'typing-by-other-in-group',\n\n // ==================== TRẠNG THÁI Đà XEM TIN NHẮN (4 events) ====================\n SEEN_MESSAGES_BY_SELF_IN_USER = 'seen-messages-by-self-in-user',\n SEEN_MESSAGES_BY_SELF_IN_GROUP = 'seen-messages-by-self-in-group',\n SEEN_MESSAGES_BY_OTHER_IN_USER = 'seen-messages-by-other-in-user',\n SEEN_MESSAGES_BY_OTHER_IN_GROUP = 'seen-messages-by-other-in-group',\n\n // ==================== TRẠNG THÁI Đà NHẬN TIN NHẮN (4 events) ====================\n DELIVERED_MESSAGES_BY_SELF_IN_USER = 'delivered-messages-by-self-in-user',\n DELIVERED_MESSAGES_BY_SELF_IN_GROUP = 'delivered-messages-by-self-in-group',\n DELIVERED_MESSAGES_BY_OTHER_IN_USER = 'delivered-messages-by-other-in-user',\n DELIVERED_MESSAGES_BY_OTHER_IN_GROUP = 'delivered-messages-by-other-in-group',\n\n // ==================== PHẢN ỨNG TIN NHẮN (4 events) ====================\n REACTION_BY_SELF_IN_USER = 'reaction-by-self-in-user',\n REACTION_BY_SELF_IN_GROUP = 'reaction-by-self-in-group',\n REACTION_BY_OTHER_IN_USER = 'reaction-by-other-in-user',\n REACTION_BY_OTHER_IN_GROUP = 'reaction-by-other-in-group',\n\n // ==================== PHẢN ỨNG CŨ (4 events) ====================\n OLD_REACTIONS_BY_SELF_IN_USER = 'old-reactions-by-self-in-user',\n OLD_REACTIONS_BY_SELF_IN_GROUP = 'old-reactions-by-self-in-group',\n OLD_REACTIONS_BY_OTHER_IN_USER = 'old-reactions-by-other-in-user',\n OLD_REACTIONS_BY_OTHER_IN_GROUP = 'old-reactions-by-other-in-group',\n\n // ==================== SỰ KIỆN BẠN BÈ (12 events) ====================\n FRIEND_EVENT_ADD = 'friend-event-add',\n FRIEND_EVENT_REMOVE = 'friend-event-remove',\n FRIEND_EVENT_REQUEST = 'friend-event-request',\n FRIEND_EVENT_UNDO_REQUEST = 'friend-event-undo-request',\n FRIEND_EVENT_REJECT_REQUEST = 'friend-event-reject-request',\n FRIEND_EVENT_SEEN_REQUEST = 'friend-event-seen-request',\n FRIEND_EVENT_BLOCK = 'friend-event-block',\n FRIEND_EVENT_UNBLOCK = 'friend-event-unblock',\n FRIEND_EVENT_BLOCK_CALL = 'friend-event-block-call',\n FRIEND_EVENT_UNBLOCK_CALL = 'friend-event-unblock-call',\n FRIEND_EVENT_PIN_UNPIN = 'friend-event-pin-unpin',\n FRIEND_EVENT_PIN_CREATE = 'friend-event-pin-create',\n FRIEND_EVENT_UNKNOWN = 'friend-event-unknown',\n\n // ==================== SỰ KIỆN NHÓM (22 events) ====================\n GROUP_EVENT_JOIN_REQUEST = 'group-event-join-request',\n GROUP_EVENT_JOIN = 'group-event-join',\n GROUP_EVENT_LEAVE = 'group-event-leave',\n GROUP_EVENT_REMOVE_MEMBER = 'group-event-remove-member',\n GROUP_EVENT_BLOCK_MEMBER = 'group-event-block-member',\n GROUP_EVENT_UPDATE_SETTING = 'group-event-update-setting',\n GROUP_EVENT_UPDATE = 'group-event-update',\n GROUP_EVENT_NEW_LINK = 'group-event-new-link',\n GROUP_EVENT_ADD_ADMIN = 'group-event-add-admin',\n GROUP_EVENT_REMOVE_ADMIN = 'group-event-remove-admin',\n GROUP_EVENT_NEW_PIN_TOPIC = 'group-event-new-pin-topic',\n GROUP_EVENT_UPDATE_PIN_TOPIC = 'group-event-update-pin-topic',\n GROUP_EVENT_REORDER_PIN_TOPIC = 'group-event-reorder-pin-topic',\n GROUP_EVENT_UPDATE_BOARD = 'group-event-update-board',\n GROUP_EVENT_REMOVE_BOARD = 'group-event-remove-board',\n GROUP_EVENT_UPDATE_TOPIC = 'group-event-update-topic',\n GROUP_EVENT_UNPIN_TOPIC = 'group-event-unpin-topic',\n GROUP_EVENT_REMOVE_TOPIC = 'group-event-remove-topic',\n GROUP_EVENT_ACCEPT_REMIND = 'group-event-accept-remind',\n GROUP_EVENT_REJECT_REMIND = 'group-event-reject-remind',\n GROUP_EVENT_REMIND_TOPIC = 'group-event-remind-topic',\n GROUP_EVENT_UPDATE_AVATAR = 'group-event-update-avatar',\n GROUP_EVENT_UNKNOWN = 'group-event-unknown',\n\n // ==================== THU HỒI TIN NHẮN (4 events) ====================\n UNDO_BY_SELF_IN_USER = 'undo-by-self-in-user',\n UNDO_BY_SELF_IN_GROUP = 'undo-by-self-in-group',\n UNDO_BY_OTHER_IN_USER = 'undo-by-other-in-user',\n UNDO_BY_OTHER_IN_GROUP = 'undo-by-other-in-group',\n\n // ==================== TRẠNG THÁI KẾT NỐI (4 events) ====================\n CONNECTION_STATUS_CONNECTED = 'connection-status-connected',\n CONNECTION_STATUS_DISCONNECTED = 'connection-status-disconnected',\n CONNECTION_STATUS_RECONNECTING = 'connection-status-reconnecting',\n CONNECTION_STATUS_LOGGED_OUT = 'connection-status-logged-out',\n\n // ==================== UPLOAD ATTACHMENT (3 events) ====================\n UPLOAD_ATTACHMENT_IN_PROGRESS = 'upload-attachment-in-progress',\n UPLOAD_ATTACHMENT_COMPLETED = 'upload-attachment-completed',\n UPLOAD_ATTACHMENT_FAILED = 'upload-attachment-failed',\n\n // ==================== CIPHER KEY (4 events) ====================\n CIPHER_KEY_UPDATED_IN_USER = 'cipher-key-updated-in-user',\n CIPHER_KEY_UPDATED_IN_GROUP = 'cipher-key-updated-in-group',\n CIPHER_KEY_EXPIRED_IN_USER = 'cipher-key-expired-in-user',\n CIPHER_KEY_EXPIRED_IN_GROUP = 'cipher-key-expired-in-group',\n\n // ==================== LỖI HỆ THỐNG (6 events) ====================\n ERROR_SYSTEM = 'error-system',\n ERROR_NETWORK = 'error-network',\n ERROR_AUTHENTICATION = 'error-authentication',\n ERROR_VALIDATION = 'error-validation',\n ERROR_BUSINESS_LOGIC = 'error-business-logic',\n ERROR_UNKNOWN = 'error-unknown',\n}\n\n/**\n * Base webhook event interface - Cấu trúc job chuẩn\n */\nexport interface BaseZaloWebhookEvent {\n sessionId: string;\n createdBy?: string;\n userUuid?: string;\n timestamp: number;\n eventType: ZaloWebhookEventType;\n metadata?: Record<string, any>;\n}\n\n/**\n * Job Priority enum\n */\nexport enum JobPriority {\n LOW = 1,\n NORMAL = 2,\n HIGH = 3,\n CRITICAL = 4,\n}\n\n/**\n * Job Status enum\n */\nexport enum JobStatus {\n WAITING = 'waiting',\n ACTIVE = 'active',\n COMPLETED = 'completed',\n FAILED = 'failed',\n DELAYED = 'delayed',\n PAUSED = 'paused',\n}\n\n/**\n * Queue Job Configuration\n */\nexport interface QueueJobConfig {\n priority?: JobPriority;\n delay?: number;\n attempts?: number;\n backoff?: {\n type: 'fixed' | 'exponential';\n delay: number;\n };\n removeOnComplete?: number | boolean;\n removeOnFail?: number | boolean;\n jobId?: string;\n}\n\n/**\n * Base Queue Job Interface - Cấu trúc job khi đưa vào queue\n */\nexport interface BaseQueueJob<T = any> {\n id?: string;\n name: string;\n data: T;\n opts?: QueueJobConfig;\n progress?: number;\n returnvalue?: any;\n failedReason?: string;\n stacktrace?: string[];\n attemptsMade?: number;\n delay?: number;\n timestamp?: number;\n processedOn?: number;\n finishedOn?: number;\n}\n\n/**\n * Webhook Queue Job - Job cụ thể cho webhook events\n */\nexport interface WebhookQueueJob extends BaseQueueJob<BaseZaloWebhookEvent> {\n name: 'webhook-event';\n data: BaseZaloWebhookEvent;\n}\n","/**\n * Job Types Index\n * Export tất cả job/queue types\n * 100% khớp với automation-web job structure\n */\n\n// ==================== BASE TYPES ====================\nexport * from './webhook-job.types';\n\n// ==================== MESSAGE JOB TYPES ====================\nexport * from './message-job.types';\n\n// ==================== EVENT JOB TYPES ====================\nexport * from './event-job.types';\n\n// ==================== FRIEND & GROUP JOB TYPES ====================\nexport * from './friend-group-job.types';\n\n// ==================== SYSTEM JOB TYPES ====================\nexport * from './system-job.types';\n\n// ==================== UNION TYPES FOR CONVENIENCE ====================\n\nimport {\n ZaloMessageEvent,\n MessageQueueJobUnion,\n} from './message-job.types';\n\nimport {\n ZaloTypingEvent,\n ZaloSeenMessagesEvent,\n ZaloDeliveredMessagesEvent,\n ZaloReactionEvent,\n ZaloUndoEvent,\n} from './event-job.types';\n\nimport {\n ZaloFriendEvent,\n ZaloGroupEvent,\n FriendEventQueueJob,\n GroupEventQueueJob,\n} from './friend-group-job.types';\n\nimport {\n ZaloSystemEvent,\n SystemQueueJobUnion,\n} from './system-job.types';\n\nimport {\n BaseZaloWebhookEvent,\n WebhookQueueJob,\n ZaloWebhookEventType,\n} from './webhook-job.types';\n\n/**\n * Union type for ALL Zalo webhook events\n */\nexport type ZaloWebhookEvent =\n | ZaloMessageEvent\n | ZaloTypingEvent\n | ZaloSeenMessagesEvent\n | ZaloDeliveredMessagesEvent\n | ZaloReactionEvent\n | ZaloUndoEvent\n | ZaloFriendEvent\n | ZaloGroupEvent\n | ZaloSystemEvent;\n\n/**\n * Union type for ALL queue jobs\n */\nexport type AllQueueJobs =\n | WebhookQueueJob\n | MessageQueueJobUnion\n | FriendEventQueueJob\n | GroupEventQueueJob\n | SystemQueueJobUnion;\n\n// ==================== HELPER FUNCTIONS ====================\n\n/**\n * Type guard to check if event is a message event\n */\nexport function isMessageEvent(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n return MESSAGE_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a typing event\n */\nexport function isTypingEvent(event: ZaloWebhookEvent): event is ZaloTypingEvent {\n return event.eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n event.eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is a reaction event\n */\nexport function isReactionEvent(event: ZaloWebhookEvent): event is ZaloReactionEvent {\n return event.eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n event.eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is a friend event\n */\nexport function isFriendEvent(event: ZaloWebhookEvent): event is ZaloFriendEvent {\n return FRIEND_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a group event\n */\nexport function isGroupEvent(event: ZaloWebhookEvent): event is ZaloGroupEvent {\n return GROUP_EVENT_TYPES.includes(event.eventType as any);\n}\n\n/**\n * Type guard to check if event is a system event\n */\nexport function isSystemEvent(event: ZaloWebhookEvent): event is ZaloSystemEvent {\n return event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_CONNECTED ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_RECONNECTING ||\n event.eventType === ZaloWebhookEventType.CONNECTION_STATUS_LOGGED_OUT ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_IN_PROGRESS ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_COMPLETED ||\n event.eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_FAILED ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER ||\n event.eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n event.eventType === ZaloWebhookEventType.ERROR_SYSTEM ||\n event.eventType === ZaloWebhookEventType.ERROR_NETWORK ||\n event.eventType === ZaloWebhookEventType.ERROR_AUTHENTICATION ||\n event.eventType === ZaloWebhookEventType.ERROR_VALIDATION ||\n event.eventType === ZaloWebhookEventType.ERROR_BUSINESS_LOGIC ||\n event.eventType === ZaloWebhookEventType.ERROR_UNKNOWN ||\n event.eventType === ZaloWebhookEventType.OLD_MESSAGES;\n}\n\n/**\n * Type guard to check if event is sent by self\n */\nexport function isSelfEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events sent by self\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n // Typing events by self\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n // Seen events by self\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n // Delivered events by self\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n // Reaction events by self\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n // Undo events by self\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is from other users\n */\nexport function isOtherEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events received from others\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n // Typing events by others\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n // Seen events by others\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n // Delivered events by others\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n // Reaction events by others\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n // Undo events by others\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP;\n}\n\n/**\n * Type guard to check if event is in user thread\n */\nexport function isUserThreadEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events in user threads\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n // Other events in user threads\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER;\n}\n\n/**\n * Type guard to check if event is in group thread\n */\nexport function isGroupThreadEvent(event: ZaloWebhookEvent): boolean {\n const eventType = event.eventType;\n\n // Message events in group threads\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n // Other events in group threads\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n // Group events\n GROUP_EVENT_TYPES.includes(eventType as any);\n}\n\n/**\n * Get event category from event type\n */\nexport function getEventCategory(eventType: ZaloWebhookEventType): string {\n // Message events\n if (MESSAGE_EVENT_TYPES.includes(eventType as any)) return 'message';\n\n // Typing events\n if (eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP) {\n return 'typing';\n }\n\n // Seen events\n if (eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP) {\n return 'seen';\n }\n\n // Delivered events\n if (eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP) {\n return 'delivered';\n }\n\n // Reaction events\n if (eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.OLD_REACTIONS_BY_OTHER_IN_GROUP) {\n return 'reaction';\n }\n\n // Undo events\n if (eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP) {\n return 'undo';\n }\n\n // Friend events\n if (FRIEND_EVENT_TYPES.includes(eventType as any)) return 'friend';\n\n // Group events\n if (GROUP_EVENT_TYPES.includes(eventType as any)) return 'group';\n\n // Connection events\n if (eventType === ZaloWebhookEventType.CONNECTION_STATUS_CONNECTED ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_DISCONNECTED ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_RECONNECTING ||\n eventType === ZaloWebhookEventType.CONNECTION_STATUS_LOGGED_OUT) {\n return 'connection';\n }\n\n // Upload events\n if (eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_IN_PROGRESS ||\n eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_COMPLETED ||\n eventType === ZaloWebhookEventType.UPLOAD_ATTACHMENT_FAILED) {\n return 'upload';\n }\n\n // Cipher events\n if (eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP) {\n return 'cipher';\n }\n\n // Error events\n if (eventType === ZaloWebhookEventType.ERROR_SYSTEM ||\n eventType === ZaloWebhookEventType.ERROR_NETWORK ||\n eventType === ZaloWebhookEventType.ERROR_AUTHENTICATION ||\n eventType === ZaloWebhookEventType.ERROR_VALIDATION ||\n eventType === ZaloWebhookEventType.ERROR_BUSINESS_LOGIC ||\n eventType === ZaloWebhookEventType.ERROR_UNKNOWN) {\n return 'error';\n }\n\n // Old messages\n if (eventType === ZaloWebhookEventType.OLD_MESSAGES) return 'old-messages';\n\n return 'unknown';\n}\n\n/**\n * Get thread type from event type\n */\nexport function getThreadTypeFromEvent(eventType: ZaloWebhookEventType): 'user' | 'group' | 'unknown' {\n // User thread events\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_USER ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_USER) {\n return 'user';\n }\n\n // Group thread events\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_UPDATED_IN_GROUP ||\n eventType === ZaloWebhookEventType.CIPHER_KEY_EXPIRED_IN_GROUP ||\n GROUP_EVENT_TYPES.includes(eventType as any)) {\n return 'group';\n }\n\n return 'unknown';\n}\n\n/**\n * Get actor type from event type (self or other)\n */\nexport function getActorTypeFromEvent(eventType: ZaloWebhookEventType): 'self' | 'other' | 'unknown' {\n // Self events (sent by self)\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP) {\n return 'self';\n }\n\n // Other events (received from others)\n if (eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER ||\n eventType === ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP) {\n return 'other';\n }\n\n return 'unknown';\n}\n\n// ==================== MESSAGE DIRECTION TYPE GUARDS ====================\n\n/**\n * Type guard to check if event is a message received from user to self\n * Tin nhắn được gửi từ user tới mình\n */\nexport function isMessageReceivedFromUser(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER;\n}\n\n/**\n * Type guard to check if event is a message received from group (sent by others)\n * Tin nhắn được gửi từ người khác tới group\n */\nexport function isMessageReceivedFromGroup(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP;\n}\n\n/**\n * Type guard to check if event is a message sent from self to group\n * Tin nhắn được gửi từ mình tới group\n */\nexport function isMessageSentToGroup(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP;\n}\n\n/**\n * Type guard to check if event is a message sent from self to user\n * Tin nhắn được chính mình gửi tới người khác\n */\nexport function isMessageSentToUser(event: ZaloWebhookEvent): event is ZaloMessageEvent {\n const eventType = event.eventType;\n\n return eventType === ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER ||\n eventType === ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER;\n}\n\n// ==================== CONSTANTS ====================\n\n/**\n * All message event types\n */\nexport const MESSAGE_EVENT_TYPES = [\n ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_USER,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_SENT_TO_GROUP,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_USER,\n ZaloWebhookEventType.RECOMMENDED_MESSAGE_RECEIVED_FROM_GROUP,\n] as const;\n\n/**\n * All friend event types\n */\nexport const FRIEND_EVENT_TYPES = [\n ZaloWebhookEventType.FRIEND_EVENT_ADD,\n ZaloWebhookEventType.FRIEND_EVENT_REMOVE,\n ZaloWebhookEventType.FRIEND_EVENT_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_UNDO_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_REJECT_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_SEEN_REQUEST,\n ZaloWebhookEventType.FRIEND_EVENT_BLOCK,\n ZaloWebhookEventType.FRIEND_EVENT_UNBLOCK,\n ZaloWebhookEventType.FRIEND_EVENT_BLOCK_CALL,\n ZaloWebhookEventType.FRIEND_EVENT_UNBLOCK_CALL,\n ZaloWebhookEventType.FRIEND_EVENT_PIN_UNPIN,\n ZaloWebhookEventType.FRIEND_EVENT_PIN_CREATE,\n ZaloWebhookEventType.FRIEND_EVENT_UNKNOWN,\n] as const;\n\n/**\n * All group event types\n */\nexport const GROUP_EVENT_TYPES = [\n ZaloWebhookEventType.GROUP_EVENT_JOIN_REQUEST,\n ZaloWebhookEventType.GROUP_EVENT_JOIN,\n ZaloWebhookEventType.GROUP_EVENT_LEAVE,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_MEMBER,\n ZaloWebhookEventType.GROUP_EVENT_BLOCK_MEMBER,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_SETTING,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE,\n ZaloWebhookEventType.GROUP_EVENT_NEW_LINK,\n ZaloWebhookEventType.GROUP_EVENT_ADD_ADMIN,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_ADMIN,\n ZaloWebhookEventType.GROUP_EVENT_NEW_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_REORDER_PIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_BOARD,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_BOARD,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UNPIN_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_REMOVE_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_ACCEPT_REMIND,\n ZaloWebhookEventType.GROUP_EVENT_REJECT_REMIND,\n ZaloWebhookEventType.GROUP_EVENT_REMIND_TOPIC,\n ZaloWebhookEventType.GROUP_EVENT_UPDATE_AVATAR,\n ZaloWebhookEventType.GROUP_EVENT_UNKNOWN,\n] as const;\n","/**\n * Profile DTOs for Zalo Personal Profile & Account Management\n * 100% khớp với automation-web/src/module/zalo-profile/dto/profile.dto.ts\n */\n\n// ==================== ENUMS ====================\n\nexport enum Gender {\n Male = 0,\n Female = 1,\n}\n\n// ==================== FETCH ACCOUNT INFO DTOs ====================\n\nexport interface FetchAccountInfoRequest {\n sessionId: string;\n}\n\n export interface BusinessPackage {\n label?: Record<string, string> | null;\n pkgId: number;\n }\n \nexport interface AccountInfo {\n userId: string;\n username: string;\n displayName: string;\n zaloName: string;\n avatar: string;\n bgavatar: string;\n cover: string;\n gender: Gender;\n dob: number;\n sdob: string;\n status: string;\n phoneNumber: string;\n isFr: number;\n isBlocked: number;\n lastActionTime: number;\n lastUpdateTime: number;\n isActive: number;\n key: number;\n type: number;\n isActivePC: number;\n isActiveWeb: number;\n isValid: number;\n userKey: string;\n accountStatus: number;\n oaInfo: any;\n user_mode: number;\n globalId: string;\n bizPkg: BusinessPackage;\n createdTs: number;\n oa_status: any;\n}\n\nexport type FetchAccountInfoResponse = AccountInfo;\n\n// ==================== CHANGE ACCOUNT AVATAR DTOs ====================\n\nexport interface AvatarMetadata {\n width: number;\n height: number;\n totalSize: number;\n size?: number;\n type?: string;\n}\n\nexport interface AvatarSource {\n data: string; // base64 encoded\n filename: string;\n metadata: AvatarMetadata;\n}\n\nexport interface ChangeAccountAvatarRequest {\n sessionId: string;\n avatarSource: AvatarSource;\n}\n\nexport interface ChangeAccountAvatarResponse {\n result: string;\n}\n\n// ==================== DELETE AVATAR DTOs ====================\n\nexport interface DeleteAvatarRequest {\n sessionId: string;\n photoId: string | string[];\n}\n\nexport interface DeleteAvatarResponse {\n result: any;\n}\n\n// ==================== REUSE AVATAR DTOs ====================\n\nexport interface ReuseAvatarRequest {\n sessionId: string;\n avatarId: string;\n}\n\nexport interface ReuseAvatarResponse {\n result: any;\n}\n\n// ==================== GET AVATAR LIST DTOs ====================\n\nexport interface GetAvatarListRequest {\n sessionId: string;\n}\n\nexport interface AvatarPhoto {\n photoId: string;\n thumbnail: string;\n url: string;\n bkUrl: string;\n}\n\nexport interface GetAvatarListResponse {\n albumId: string;\n nextPhotoId: string;\n hasMore: number;\n photos: AvatarPhoto[];\n}\n\n// ==================== UPDATE PROFILE DTOs ====================\n\nexport interface UpdateProfileRequest {\n sessionId: string;\n name: string;\n dob: `${string}-${string}-${string}`; // format: year-month-day\n gender: Gender;\n}\n\nexport interface UpdateProfileResponse {\n result: string;\n}\n\nexport interface GetAvatarUrlProfileRequest {\n sessionId: string;\n friendIds: string[];\n isAvatarSizeMax?: boolean;\n}\n\nexport interface GetAvatarUrlProfileResponse {\n results: Record<string, { avatar: string }>;\n}\n\nexport interface GetFullAvatarRequest {\n sessionId: string;\n friendId: string;\n}\n\nexport interface GetFullAvatarResponse {\n full_avatar: string;\n bk_full_avatar: string;\n}\n\nexport interface GetSettingsRequest {\n sessionId: string;\n}\n\nexport interface UserSetting {\n add_friend_via_contact: number;\n display_on_recommend_friend: number;\n add_friend_via_group: number;\n add_friend_via_qr: number;\n quick_message_status: number;\n show_online_status: boolean;\n accept_stranger_call: number;\n archived_chat_status: number;\n receive_message: number;\n add_friend_via_phone: number;\n display_seen_status: number;\n view_birthday: number;\n}\n\nexport interface GetSettingsResponse {\n settings: UserSetting;\n}\n\nexport enum UpdateSettingsType {\n ViewBirthday = 'view_birthday',\n ShowOnlineStatus = 'show_online_status',\n DisplaySeenStatus = 'display_seen_status',\n ReceiveMessage = 'receive_message',\n AcceptCall = 'accept_stranger_call',\n AddFriendViaPhone = 'add_friend_via_phone',\n AddFriendViaQR = 'add_friend_via_qr',\n AddFriendViaGroup = 'add_friend_via_group',\n AddFriendViaContact = 'add_friend_via_contact',\n DisplayOnRecommendFriend = 'display_on_recommend_friend',\n ArchivedChat = 'archivedChatStatus',\n QuickMessage = 'quickMessageStatus',\n}\n\nexport interface UpdateSettingsRequest {\n sessionId: string;\n type: UpdateSettingsType;\n value: number;\n}\n\nexport enum UpdateLangAvailableLanguages {\n VI = 'VI',\n EN = 'EN',\n}\n\nexport interface UpdateLangRequest {\n sessionId: string;\n language?: UpdateLangAvailableLanguages;\n}\n","import { ProxyProtocol, ProxyStatus } from './session-proxy.type';\r\n\r\nexport enum SortOrder {\r\n ASC = 'asc',\r\n DESC = 'desc',\r\n}\r\n\r\nexport enum SortByField {\r\n ID = 'id',\r\n CREATED_AT = 'createdAt',\r\n SUCCESS_RATE = 'successRate',\r\n LATENCY_MS = 'latencyMs',\r\n}\r\n\r\nexport interface CreateProxyRequest {\r\n host: string;\r\n port: number;\r\n username?: string;\r\n password?: string;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n weight?: number;\r\n note?: string;\r\n}\r\n\r\nexport interface UpdateProxyRequest {\r\n host?: string;\r\n port?: number;\r\n username?: string;\r\n password?: string;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n weight?: number;\r\n note?: string;\r\n status?: ProxyStatus;\r\n}\r\n\r\nexport interface ProxyFilterRequest {\r\n status?: ProxyStatus;\r\n protocol?: ProxyProtocol;\r\n region?: string;\r\n availableOnly?: boolean;\r\n page?: number;\r\n limit?: number;\r\n sortBy?: SortByField;\r\n sortOrder?: SortOrder;\r\n}\r\n\r\nexport interface BulkImportProxyRequest {\r\n proxies: CreateProxyRequest[];\r\n}\r\n\r\nexport interface TestProxyRequest {\r\n timeout?: number;\r\n}\r\n\r\nexport interface DisableProxyRequest {\r\n durationMs?: number;\r\n reason?: string;\r\n}\r\n\r\nexport interface ProxyResponse {\r\n id: string;\r\n host: string;\r\n port: number;\r\n username?: string;\r\n protocol: string;\r\n region?: string;\r\n weight: number;\r\n successCount: number;\r\n failureCount: number;\r\n successRate: number;\r\n lastUsedAt?: string;\r\n lastFailedAt?: string;\r\n status: string;\r\n disabledUntil?: string;\r\n healthCheckedAt?: string;\r\n latencyMs?: number;\r\n note?: string;\r\n resourceType?: string;\r\n ownedBy?: number;\r\n createdAt: string;\r\n updatedAt: string;\r\n}\r\n\r\nexport interface ProxyListResponse {\r\n data: ProxyResponse[];\r\n total: number;\r\n page: number;\r\n limit: number;\r\n totalPages: number;\r\n}\r\n\r\nexport interface ProxyStatsResponse {\r\n totalProxies: number;\r\n activeProxies: number;\r\n disabledProxies: number;\r\n bannedProxies: number;\r\n averageSuccessRate: number;\r\n averageLatency?: number;\r\n}\r\n\r\nexport interface BulkImportResult {\r\n success: number;\r\n failed: number;\r\n errors: Array<{ index: number; error: string }>;\r\n}\r\n\r\nexport interface VerifyProxyIpResult {\r\n success: boolean;\r\n proxyIP?: string;\r\n error?: string;\r\n}\r\n\r\nexport interface TestRedaiApiResult {\r\n success: boolean;\r\n statusCode?: number;\r\n latencyMs?: number;\r\n proxyIP?: string;\r\n responseData?: any;\r\n error?: string;\r\n}\r\n","// ==================== ENUMS & TYPES ====================\r\n\r\n/**\r\n * Thread Type Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum ThreadType {\r\n User = 0,\r\n Group = 1,\r\n}\r\n\r\n/**\r\n * Text Style Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum TextStyle {\r\n Bold = 'b',\r\n Italic = 'i',\r\n Underline = 'u',\r\n StrikeThrough = 's',\r\n Red = 'c_db342e',\r\n Orange = 'c_f27806',\r\n Yellow = 'c_f7b503',\r\n Green = 'c_15a85f',\r\n Small = 'f_13',\r\n Big = 'f_18',\r\n UnorderedList = 'lst_1',\r\n OrderedList = 'lst_2',\r\n Indent = 'ind_$',\r\n}\r\n\r\n/**\r\n * Urgency Enum - chuẩn theo zalo-personal SDK\r\n */\r\nexport enum Urgency {\r\n Default = 0,\r\n Important = 1,\r\n Urgent = 2,\r\n}\r\n\r\n/**\r\n * Message Type Enum - chuẩn theo automation-web\r\n */\r\nexport enum MessageType {\r\n WebChat = 'webchat',\r\n Photo = 'chat.photo',\r\n Video = 'chat.video',\r\n File = 'chat.file',\r\n Sticker = 'chat.sticker',\r\n Link = 'chat.link',\r\n Location = 'chat.location',\r\n Contact = 'chat.contact',\r\n Todo = 'chat.todo',\r\n GroupPoll = 'group.poll',\r\n}\r\n\r\n/**\r\n * Zalo Reactions Enum - chuẩn theo automation-web\r\n */\r\nexport enum ZaloReactions {\n HEART = '/-heart',\r\n LIKE = '/-strong',\r\n HAHA = ':>',\r\n WOW = ':o',\r\n CRY = ':-((',\r\n ANGRY = ':-h',\r\n KISS = ':-*',\r\n TEARS_OF_JOY = \":')\",\r\n SHIT = '/-shit',\r\n ROSE = '/-rose',\r\n BROKEN_HEART = '/-break',\r\n DISLIKE = '/-weak',\r\n LOVE = ';xx',\r\n CONFUSED = ';-/',\r\n WINK = ';-)',\r\n FADE = '/-fade',\r\n SUN = '/-li',\r\n BIRTHDAY = '/-bd',\r\n BOMB = '/-bome',\r\n OK = '/-ok',\r\n PEACE = '/-v',\r\n THANKS = '/-thanks',\r\n PUNCH = '/-punch',\r\n SHARE = '/-share',\r\n PRAY = '_()_',\r\n NO = '/-no',\r\n BAD = '/-bad',\r\n LOVE_YOU = '/-loveu',\r\n SAD = '--b',\r\n VERY_SAD = ':((',\r\n COOL = 'x-)',\r\n NERD = '8-)',\r\n BIG_SMILE = ';-d',\r\n SUNGLASSES = 'b-)',\r\n NEUTRAL = ':--|',\r\n SAD_FACE = 'p-(',\r\n BYE = ':-bye',\r\n SLEEPY = '|-)',\r\n WIPE = ':wipe',\r\n DIG = ':-dig',\r\n ANGUISH = '&-(',\r\n HANDCLAP = ':handclap',\r\n ANGRY_FACE = '>-|',\r\n F_CHAIR = ':-f',\r\n L_CHAIR = ':-l',\r\n R_CHAIR = ':-r',\r\n SILENT = ';-x',\r\n SURPRISE = ':-o',\r\n EMBARRASSED = ';-s',\r\n AFRAID = ';-a',\r\n SAD2 = ':-<',\r\n BIG_LAUGH = ':))',\r\n RICH = '$-)',\r\n BEER = '/-beer',\n}\n\nexport enum AttachmentMediaType {\n Image = 'image',\n Video = 'video',\n Audio = 'audio',\n File = 'file',\n}\n\r\n// ==================== TYPED INTERFACES ====================\r\n\r\n/**\r\n * Style interface - chuẩn theo automation-web StyleDto\r\n */\r\nexport interface Style {\r\n /**\r\n * Vị trí bắt đầu của style\r\n */\r\n start: number;\r\n\r\n /**\r\n * Độ dài của text được style\r\n */\r\n len: number;\r\n\r\n /**\r\n * Loại style\r\n */\r\n st: TextStyle;\r\n}\r\n\r\n/**\r\n * Mention interface - chuẩn theo automation-web MentionDto\r\n */\r\nexport interface Mention {\r\n /**\r\n * Vị trí của mention trong text\r\n */\r\n pos: number;\r\n\r\n /**\r\n * User ID được mention\r\n */\r\n uid: string;\r\n\r\n /**\r\n * Độ dài của mention text\r\n */\r\n len: number;\r\n}\r\n\r\n/**\r\n * Attachment Content interface - chuẩn theo automation-web AttachmentContentDto\r\n */\r\nexport interface AttachmentContent {\r\n /**\r\n * Tiêu đề attachment\r\n */\r\n title?: string;\r\n\r\n /**\r\n * Mô tả attachment\r\n */\r\n description?: string;\r\n\r\n /**\r\n * Link href của attachment\r\n */\r\n href?: string;\r\n\r\n /**\r\n * Link thumbnail\r\n */\r\n thumb?: string;\r\n\r\n /**\r\n * Số lượng children\r\n */\r\n childnumber?: number;\r\n\r\n /**\r\n * Action type\r\n */\r\n action?: string;\r\n\r\n /**\r\n * Parameters JSON string\r\n */\r\n params?: string;\r\n\r\n /**\r\n * Content type\r\n */\r\n type?: string;\r\n}\r\n\r\n/**\r\n * Property Extension interface - chuẩn theo automation-web PropertyExtDto\r\n */\r\nexport interface PropertyExt {\r\n /**\r\n * Màu sắc\r\n */\r\n color?: number;\r\n\r\n /**\r\n * Kích thước\r\n */\r\n size?: number;\r\n\r\n /**\r\n * Loại\r\n */\r\n type?: number;\r\n\r\n /**\r\n * Loại phụ\r\n */\r\n subType?: number;\r\n\r\n /**\r\n * Extension data\r\n */\r\n ext?: string;\r\n}\r\n\r\n/**\r\n * Send Message Quote interface - chuẩn theo automation-web SendMessageQuoteDto\r\n */\r\nexport interface SendMessageQuote {\r\n /**\r\n * Nội dung tin nhắn được quote\r\n */\r\n content: string | AttachmentContent | Record<string, any>;\r\n\r\n /**\r\n * Loại tin nhắn được quote\r\n */\r\n msgType: MessageType;\r\n\r\n /**\r\n * Property extension của tin nhắn được quote\r\n */\r\n propertyExt?: PropertyExt;\r\n\r\n /**\r\n * User ID người gửi tin nhắn được quote\r\n */\r\n uidFrom: string;\r\n\r\n /**\r\n * Message ID được quote\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client Message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * Timestamp (string format)\r\n */\r\n ts: string;\r\n\r\n /**\r\n * Time to live (seconds)\r\n */\r\n ttl: number;\r\n}\r\n\r\n/**\r\n * Attachment Metadata interface - chuẩn theo automation-web AttachmentMetadataDto\r\n */\r\nexport interface AttachmentMetadata {\r\n /**\r\n * Kích thước file (bytes)\r\n */\r\n totalSize: number;\r\n\r\n /**\r\n * Chiều rộng (cho ảnh/video)\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Chiều cao (cho ảnh/video)\r\n */\r\n height?: number;\r\n}\r\n\r\n/**\r\n * Attachment interface - chuẩn theo automation-web AttachmentDto\r\n */\r\nexport interface Attachment {\n /**\r\n * URL để tải file từ internet\r\n */\r\n url?: string;\r\n\r\n /**\r\n * Tên file (bắt buộc khi dùng URL hoặc Buffer)\r\n */\r\n filename?: string;\n\n mediaType?: AttachmentMediaType;\n\r\n /**\r\n * HTTP headers cho download (khi dùng URL)\r\n */\r\n headers?: Record<string, string>;\r\n\r\n /**\r\n * Đường dẫn file local\r\n */\r\n filePath?: string;\r\n\r\n /**\r\n * Base64 encoded file data\r\n */\r\n base64Data?: string;\r\n\r\n /**\r\n * Metadata của file (bắt buộc khi dùng base64Data)\r\n */\r\n metadata?: AttachmentMetadata;\r\n}\r\n\r\n// ==================== REQUEST DTOs ====================\r\n\r\n/**\r\n * DTO để gửi tin nhắn - chuẩn theo automation-web SendMessageDto\r\n */\r\nexport interface SendMessageRequest {\r\n /**\r\n * Nội dung tin nhắn\r\n */\r\n msg: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Text styles - định dạng văn bản\r\n */\r\n styles?: Style[];\r\n\r\n /**\r\n * Mentions trong tin nhắn\r\n */\r\n mentions?: Mention[];\r\n\r\n /**\r\n * Quote message - tin nhắn được trả lời\r\n */\r\n quote?: SendMessageQuote;\r\n\r\n /**\r\n * Danh sách file đính kèm\r\n */\r\n attachments?: Attachment[];\r\n\r\n /**\r\n * Mức độ ưu tiên tin nhắn\r\n */\r\n urgency?: Urgency;\r\n\r\n /**\r\n * Time to live - thời gian tự hủy tin nhắn (milliseconds)\r\n */\r\n ttl?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi sticker - chuẩn theo automation-web SendStickerDto\r\n */\r\nexport interface SendStickerRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * ID của sticker\r\n */\r\n stickerId: string;\r\n}\r\n\r\n/**\r\n * DTO để gửi voice message - chuẩn theo automation-web SendVoiceDto\r\n */\r\nexport interface SendVoiceRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * URL của file voice\r\n */\r\n fileUrl: string;\r\n\r\n /**\r\n * Thời lượng voice (giây)\r\n */\r\n duration?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi video message - chuẩn theo automation-web SendVideoDto\r\n */\r\nexport interface SendVideoRequest {\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * URL của video\r\n */\r\n videoUrl: string;\r\n\r\n /**\r\n * Thời lượng video (giây)\r\n */\r\n duration?: number;\r\n\r\n /**\r\n * Chiều rộng video\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Chiều cao video\r\n */\r\n height?: number;\n}\n\nexport interface SendFileRequest {\n sessionId: string;\n threadId: string;\n type: ThreadType;\n fileUrl: string;\n fileName: string;\n msg?: string;\n headers?: Record<string, string>;\n ttl?: number;\n}\n\r\n/**\r\n * DTO để gửi link message - chuẩn theo automation-web SendLinkDto\r\n */\r\nexport interface SendLinkRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Link cần gửi\r\n */\r\n link: string;\r\n\r\n /**\r\n * Tin nhắn kèm theo link\r\n */\r\n msg?: string;\r\n\r\n /**\r\n * Time to live (giây)\r\n */\r\n ttl?: number;\r\n}\r\n\r\n/**\r\n * DTO để gửi contact card - chuẩn theo automation-web SendCardDto\r\n */\r\nexport interface SendCardRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * User ID của người cần chia sẻ thông tin\r\n */\r\n userId: string;\r\n\r\n /**\r\n * Số điện thoại của người cần chia sẻ thông tin\r\n */\r\n phoneNumber?: string;\r\n}\r\n\r\n/**\r\n * DTO để chuyển tiếp tin nhắn - chuẩn theo automation-web ForwardMessageDto\r\n */\r\nexport interface ForwardMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Tin nhắn cần chuyển tiếp\r\n */\r\n message: any;\r\n\r\n /**\r\n * Danh sách thread IDs đích\r\n */\r\n threadIds: string[];\r\n\r\n /**\r\n * Loại thread đích\r\n */\r\n type: ThreadType;\r\n\r\n /**\r\n * Reference message (optional)\r\n */\r\n reference?: any;\r\n}\r\n\r\n/**\r\n * DTO để xóa tin nhắn - chuẩn theo automation-web DeleteMessageDto\r\n */\r\nexport interface DeleteMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID tin nhắn cần xóa\r\n */\r\n messageId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n/**\r\n * DTO để thu hồi tin nhắn (undo) - chuẩn theo automation-web UndoMessageDto\r\n */\r\nexport interface UndoMessageRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID tin nhắn cần thu hồi\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n/**\r\n * DTO để thêm reaction - chuẩn theo automation-web AddReactionDto\r\n */\r\nexport interface AddReactionRequest {\r\n /**\r\n * Session ID của Zalo Personal\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Loại reaction (sử dụng ZaloReactions enum)\r\n */\r\n reaction: ZaloReactions;\r\n\r\n /**\r\n * Message ID (global message ID)\r\n */\r\n msgId: string;\r\n\r\n /**\r\n * Client message ID\r\n */\r\n cliMsgId: string;\r\n\r\n /**\r\n * ID thread (user hoặc group)\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * Loại thread\r\n */\r\n type: ThreadType;\r\n}\r\n\r\n// ==================== RESPONSE DTOs ====================\r\n\r\n/**\r\n * Send Message Result từ Zalo SDK\r\n */\r\nexport interface SendMessageResult {\r\n msgId: number;\r\n}\r\n\r\n/**\r\n * Response DTO cho send message - chuẩn theo automation-web SendMessageResponseDto\r\n */\r\nexport interface SendMessageResponse {\r\n /**\r\n * Thông tin tin nhắn đã gửi (null nếu không có tin nhắn text)\r\n */\r\n message: SendMessageResult | null;\r\n\r\n /**\r\n * Thông tin attachments đã gửi\r\n */\r\n attachment: SendMessageResult[];\r\n\r\n /**\r\n * Trạng thái thành công\r\n */\r\n success?: boolean;\r\n\r\n /**\r\n * Thông báo lỗi nếu có\r\n */\r\n error?: string;\r\n}\r\n\r\n/**\r\n * Response types từ zalo-personal SDK - import từ automation-web\r\n */\r\nexport interface SendStickerResponse {\r\n success: boolean;\r\n messageId?: string;\r\n error?: string;\r\n}\r\n\r\nexport interface SendVoiceResponse {\r\n success: boolean;\r\n messageId?: string;\r\n error?: string;\r\n}\r\n\r\nexport type SendVideoResponse = {\r\n msgId: number;\r\n};\r\n\r\nexport type SendLinkResponse = {\r\n msgId: string;\r\n};\r\n\r\nexport type SendCardResponse = {\r\n msgId: number;\r\n};\r\n\r\nexport type Success = {\r\n clientId: string;\r\n msgId: string;\r\n};\r\nexport type Failed = {\r\n clientId: string;\r\n errorCode: number;\r\n errorMessage: string;\r\n};\r\n\r\nexport interface ForwardMessageResponse {\r\n success: boolean;\r\n messageIds?: string[];\r\n error?: string;\r\n}\r\n\r\nexport type DeleteMessageResponse = {\r\n status: number;\r\n};\r\n\r\nexport type UndoResponse = {\r\n status: number;\r\n};\r\n\r\nexport interface AddReactionResponse {\r\n msgIds?: number[];\r\n success?: boolean;\r\n error?: string;\r\n}\r\n\r\nexport interface AddQuickMessageRequest {\r\n sessionId: string;\r\n shortMessage: string;\r\n longMessage: string;\r\n}\r\n\r\nexport interface QuickMessageItem {\r\n id: number;\r\n keyword: string;\r\n type: number;\r\n createdTime: number;\r\n lastModified: number;\r\n message: {\r\n title: string;\r\n params: string | null;\r\n };\r\n media: any;\r\n}\r\n\r\nexport interface AddQuickMessageResponse {\r\n item: QuickMessageItem;\r\n version: number;\r\n}\r\n\r\nexport interface UpdateQuickMessageRequest {\r\n sessionId: string;\r\n quickMessageId: string;\r\n shortMessage: string;\r\n longMessage: string;\r\n}\r\n\r\nexport interface GetQuickMessageListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetQuickMessageListResponse {\r\n cursor: number;\r\n items: QuickMessageItem[];\r\n version: number;\r\n}\r\n\r\nexport interface CreateAutoReplyRequest {\r\n sessionId: string;\r\n message: string;\r\n}\r\n\r\nexport interface AutoReplyItem {\r\n id: number;\r\n enable: boolean;\r\n content: string;\r\n startTime: number;\r\n endTime: number;\r\n scope: number;\r\n}\r\n\r\nexport interface CreateAutoReplyResponse {\r\n item: AutoReplyItem;\r\n version: number;\r\n}\r\n\r\nexport interface GetAutoReplyListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetAutoReplyListResponse {\r\n item: AutoReplyItem[];\r\n version: number;\r\n}\r\n\r\nexport interface DeleteAutoReplyRequest {\r\n sessionId: string;\r\n autoReplyId: string;\r\n}\r\n\r\nexport interface StandardResponse {\r\n item: any;\r\n version: number;\r\n}\r\n\r\nexport interface DeleteChatRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface GetLabelsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface LabelItem {\n id: number;\n text: string;\n textKey: string;\n conversations: string[];\n color: string;\n offset: number;\n emoji: string;\n createTime: number;\n}\n\nexport interface GetLabelsResponse {\n labelData: LabelItem[];\n version: number;\n lastUpdateTime: number;\n}\n\nexport interface UpdateLabelsRequest {\n sessionId: string;\n labelData: LabelItem[];\n version: number;\n}\n\nexport type UpdateLabelsResponse = GetLabelsResponse;\n\nexport interface UpdateConversationLabelRequest {\n sessionId: string;\n labelId: number;\n threadId: string;\n type: ThreadType;\n}\n\nexport type UpdateConversationLabelResponse = GetLabelsResponse;\n\nexport interface GetMuteRequest {\n sessionId: string;\n}\n\r\nexport interface MuteEntriesInfo {\r\n id: string;\r\n duration: number;\r\n startTime: number;\r\n systemTime: number;\r\n currentTime: number;\r\n muteMode: number;\r\n}\r\n\r\nexport interface GetMuteResponse {\r\n chatEntries: MuteEntriesInfo[];\r\n groupChatEntries: MuteEntriesInfo[];\r\n}\r\n\r\nexport interface MessagingParseLinkRequest {\r\n sessionId: string;\r\n link: string;\r\n}\r\n\r\nexport interface MessagingParseLinkResponse {\r\n data: {\r\n thumb: string;\r\n title: string;\r\n desc: string;\r\n src: string;\r\n href: string;\r\n media: any;\r\n stream_icon: string;\r\n };\r\n error_maps: Record<string, number>;\r\n}\r\n\r\nexport interface AddUnreadMarkRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface AddUnreadMarkResponse {\r\n data: {\r\n updateId: number;\r\n };\r\n status: number;\r\n}\r\n\r\n// ==================== NEW BATCH TYPES ====================\r\n\r\nexport interface GetSearchStickerRequest {\r\n sessionId: string;\r\n keyword: string;\r\n}\r\n\r\nexport interface GetSearchStickerResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetStickerCategoryDetailRequest {\r\n sessionId: string;\r\n categoryId: string;\r\n}\r\n\r\nexport interface GetStickerCategoryDetailResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetStickersRequest {\r\n sessionId: string;\r\n keyword: string;\r\n}\r\n\r\nexport interface GetStickersResponse {\r\n items: number[];\r\n}\r\n\r\nexport interface GetStickersDetailRequest {\r\n sessionId: string;\r\n stickerIds: string[];\r\n}\r\n\r\nexport interface GetStickersDetailResponse {\r\n items: any[];\r\n}\r\n\r\nexport interface GetArchivedChatListRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetArchivedChatListResponse {\r\n items: any[];\r\n version: number;\r\n}\r\n\r\nexport interface GetAutoDeleteChatRequest {\r\n sessionId: string;\r\n threadId: string;\r\n type: ThreadType;\r\n}\r\n\r\nexport interface GetAutoDeleteChatResponse {\r\n convers: {\r\n destId: string;\r\n isGroup: boolean;\r\n ttl: number;\r\n createdAt: number;\r\n }[];\r\n}\r\n\r\nexport interface GetHiddenConversationsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetHiddenConversationsResponse {\r\n pin: string;\r\n threads: {\r\n is_group: number;\r\n thread_id: string;\r\n }[];\r\n}\r\n\r\nexport interface GetPinConversationsRequest {\r\n sessionId: string;\r\n}\r\n\r\nexport interface GetPinConversationsResponse {\r\n conversations: string[];\r\n version: number;\r\n}\r\n\r\nexport interface RemoveQuickMessageRequest {\r\n sessionId: string;\r\n quickMessageId: string;\r\n}\r\n\r\nexport interface RemoveQuickMessageResponse {\r\n itemIds: number[];\r\n version: number;\r\n}\r\n","/**\r\n * Session Proxy types and DTOs\r\n */\r\n\r\nexport enum ProxyProtocol {\r\n HTTP = 'http',\r\n HTTPS = 'https',\r\n SOCKS5 = 'socks5',\r\n}\r\n\r\nexport enum ProxyStatus {\r\n ACTIVE = 'active',\r\n DISABLED = 'disabled',\r\n BANNED = 'banned',\r\n}\r\n\r\n/**\r\n * Request DTO for assigning proxy to session\r\n */\r\nexport interface AssignProxyToSessionRequest {\r\n /**\r\n * ID của session cần gắn proxy\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID của proxy cần gắn\r\n */\r\n proxyId: string;\r\n}\r\n\r\n/**\r\n * Response DTO for assign proxy operation\r\n */\r\nexport interface AssignProxyToSessionResponse {\r\n /**\r\n * Trạng thái thành công\r\n */\r\n success: boolean;\r\n\r\n /**\r\n * ID của session đã được gắn proxy\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * ID của proxy đã được gắn\r\n */\r\n proxyId: string;\r\n\r\n /**\r\n * Thông báo kết quả\r\n */\r\n message?: string;\r\n\r\n /**\r\n * Thông báo lỗi (nếu có)\r\n */\r\n error?: string;\r\n}\r\n","/**\n * Formatting utility functions\n */\n\nimport { StyleDto, MentionDto } from '../types/common.types';\n\n/**\n * Formatting utilities class\n */\nexport class FormatUtils {\n /**\n * Format timestamp to readable string\n */\n static formatTimestamp(timestamp: string | number): string {\n const date = new Date(typeof timestamp === 'string' ? parseInt(timestamp) : timestamp);\n return date.toLocaleString();\n }\n\n /**\n * Format duration in milliseconds to human readable format\n */\n static formatDuration(ms: number): string {\n if (ms < 1000) {\n return `${ms}ms`;\n }\n\n const seconds = Math.floor(ms / 1000);\n if (seconds < 60) {\n return `${seconds}s`;\n }\n\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) {\n return remainingSeconds > 0 ? `${minutes}m ${remainingSeconds}s` : `${minutes}m`;\n }\n\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return remainingMinutes > 0 ? `${hours}h ${remainingMinutes}m` : `${hours}h`;\n }\n\n /**\n * Format file size in bytes to human readable format\n */\n static formatFileSize(bytes: number): string {\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n if (bytes === 0) return '0 Bytes';\n \n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n const size = bytes / Math.pow(1024, i);\n \n return `${Math.round(size * 100) / 100} ${sizes[i]}`;\n }\n\n /**\n * Format phone number for display\n */\n static formatPhoneNumber(phoneNumber: string): string {\n // Remove all non-digit characters\n const cleaned = phoneNumber.replace(/\\D/g, '');\n \n // Vietnamese phone number formatting\n if (cleaned.startsWith('84')) {\n // International format\n const number = cleaned.substring(2);\n if (number.length === 9) {\n return `+84 ${number.substring(0, 3)} ${number.substring(3, 6)} ${number.substring(6)}`;\n }\n } else if (cleaned.startsWith('0')) {\n // Domestic format\n if (cleaned.length === 10) {\n return `${cleaned.substring(0, 4)} ${cleaned.substring(4, 7)} ${cleaned.substring(7)}`;\n }\n }\n \n return phoneNumber; // Return original if can't format\n }\n\n /**\n * Truncate text with ellipsis\n */\n static truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) {\n return text;\n }\n \n return text.substring(0, maxLength - 3) + '...';\n }\n\n /**\n * Capitalize first letter of each word\n */\n static capitalizeWords(text: string): string {\n return text.replace(/\\b\\w/g, char => char.toUpperCase());\n }\n\n /**\n * Convert camelCase to kebab-case\n */\n static camelToKebab(text: string): string {\n return text.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n }\n\n /**\n * Convert kebab-case to camelCase\n */\n static kebabToCamel(text: string): string {\n return text.replace(/-([a-z])/g, (_, char) => char.toUpperCase());\n }\n\n /**\n * Format percentage\n */\n static formatPercentage(value: number, decimals: number = 1): string {\n return `${(value * 100).toFixed(decimals)}%`;\n }\n\n /**\n * Format number with thousand separators\n */\n static formatNumber(num: number): string {\n return num.toLocaleString();\n }\n\n /**\n * Create styled text with formatting\n */\n static createStyledText(text: string, styles: Array<{\n start: number;\n length: number;\n style: 'bold' | 'italic' | 'underline' | 'strikethrough';\n }>): { content: string; styles: StyleDto[] } {\n const styleMap = {\n bold: 'font-weight:bold',\n italic: 'font-style:italic',\n underline: 'text-decoration:underline',\n strikethrough: 'text-decoration:line-through',\n };\n\n const formattedStyles: StyleDto[] = styles.map(style => ({\n start: style.start,\n len: style.length,\n st: styleMap[style.style],\n }));\n\n return {\n content: text,\n styles: formattedStyles,\n };\n }\n\n /**\n * Create mentions in text\n */\n static createMentions(text: string, mentions: Array<{\n userId: string;\n displayName: string;\n start: number;\n }>): { content: string; mentions: MentionDto[] } {\n const formattedMentions: MentionDto[] = mentions.map(mention => ({\n uid: mention.userId,\n start: mention.start,\n len: mention.displayName.length,\n }));\n\n return {\n content: text,\n mentions: formattedMentions,\n };\n }\n\n /**\n * Extract mentions from text (e.g., @username)\n */\n static extractMentions(text: string): Array<{\n username: string;\n start: number;\n length: number;\n }> {\n const mentionRegex = /@(\\w+)/g;\n const mentions: Array<{ username: string; start: number; length: number }> = [];\n let match;\n\n while ((match = mentionRegex.exec(text)) !== null) {\n mentions.push({\n username: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return mentions;\n }\n\n /**\n * Extract hashtags from text\n */\n static extractHashtags(text: string): Array<{\n hashtag: string;\n start: number;\n length: number;\n }> {\n const hashtagRegex = /#(\\w+)/g;\n const hashtags: Array<{ hashtag: string; start: number; length: number }> = [];\n let match;\n\n while ((match = hashtagRegex.exec(text)) !== null) {\n hashtags.push({\n hashtag: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return hashtags;\n }\n\n /**\n * Extract URLs from text\n */\n static extractUrls(text: string): Array<{\n url: string;\n start: number;\n length: number;\n }> {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const urls: Array<{ url: string; start: number; length: number }> = [];\n let match;\n\n while ((match = urlRegex.exec(text)) !== null) {\n urls.push({\n url: match[1],\n start: match.index,\n length: match[0].length,\n });\n }\n\n return urls;\n }\n\n /**\n * Clean text by removing special characters\n */\n static cleanText(text: string): string {\n return text\n .replace(/[^\\w\\s\\u00C0-\\u024F\\u1E00-\\u1EFF]/g, '') // Keep alphanumeric, spaces, and Vietnamese characters\n .replace(/\\s+/g, ' ') // Normalize whitespace\n .trim();\n }\n\n /**\n * Generate random string\n */\n static generateRandomString(length: number): string {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n \n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n \n return result;\n }\n\n /**\n * Generate UUID v4\n */\n static generateUuid(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0;\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n /**\n * Escape HTML characters\n */\n static escapeHtml(text: string): string {\n const htmlEscapes: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#x27;',\n '/': '&#x2F;',\n };\n\n return text.replace(/[&<>\"'/]/g, (char) => htmlEscapes[char]);\n }\n\n /**\n * Unescape HTML characters\n */\n static unescapeHtml(text: string): string {\n const htmlUnescapes: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#x27;': \"'\",\n '&#x2F;': '/',\n };\n\n return text.replace(/&(?:amp|lt|gt|quot|#x27|#x2F);/g, (entity) => htmlUnescapes[entity]);\n }\n\n /**\n * Convert text to slug format\n */\n static toSlug(text: string): string {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove diacritics\n .replace(/[^a-z0-9\\s-]/g, '') // Remove special characters\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/-+/g, '-') // Replace multiple hyphens with single\n .trim()\n .replace(/^-+|-+$/g, ''); // Remove leading/trailing hyphens\n }\n\n /**\n * Format relative time (e.g., \"2 hours ago\")\n */\n static formatRelativeTime(timestamp: string | number): string {\n const now = Date.now();\n const time = typeof timestamp === 'string' ? parseInt(timestamp) : timestamp;\n const diff = now - time;\n\n const seconds = Math.floor(diff / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const weeks = Math.floor(days / 7);\n const months = Math.floor(days / 30);\n const years = Math.floor(days / 365);\n\n if (seconds < 60) return 'just now';\n if (minutes < 60) return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;\n if (hours < 24) return `${hours} hour${hours > 1 ? 's' : ''} ago`;\n if (days < 7) return `${days} day${days > 1 ? 's' : ''} ago`;\n if (weeks < 4) return `${weeks} week${weeks > 1 ? 's' : ''} ago`;\n if (months < 12) return `${months} month${months > 1 ? 's' : ''} ago`;\n return `${years} year${years > 1 ? 's' : ''} ago`;\n }\n\n /**\n * Mask sensitive information\n */\n static maskSensitiveInfo(text: string, type: 'phone' | 'email' | 'custom', customPattern?: RegExp): string {\n switch (type) {\n case 'phone':\n return text.replace(/(\\d{3})\\d{4}(\\d{3})/, '$1****$2');\n case 'email':\n return text.replace(/(.{2}).*@(.*)/, '$1***@$2');\n case 'custom':\n if (customPattern) {\n return text.replace(customPattern, '***');\n }\n return text;\n default:\n return text;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;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N,MAAM,mFACN,MAAM,qFACN,MAAM,iFACN,MAAM,2EACN,MAAM,+EACN,MAAM,iFACN,MAAM,+EACN,MAAM,iFACN,MAAM,mDACN,MAAM,qDACN,MAAM,mEACN,MAAM,2DACN,MAAM,mEACN,MAAM,qDACN,MAAM;AACf;AAKO,SAAS,YAAY,OAAkC;AAC5D,QAAM,YAAY,MAAM;AAGxB,SAAO,6EACA,+EACA,+EACA,iFACA,+EACA,iFACA,+EACA,iFACA,6EACA,+EACA,mFACA,qFACA,qFACA,uFACA,2EACA,6EACA,6EACA,+EACA,iFACA,mFACA,2FACA;AAAA,EAEA,uEACA;AAAA,EAEA,qFACA;AAAA,EAEA,+FACA;AAAA,EAEA,2EACA;AAAA,EAEA,mEACA;AACT;AAKO,SAAS,aAAa,OAAkC;AAC7D,QAAM,YAAY,MAAM;AAGxB,SAAO,yFACA,2FACA,2FACA,6FACA,2FACA,6FACA,2FACA,6FACA,yFACA,2FACA,+FACA,iGACA,iGACA,mGACA,uFACA,yFACA,yFACA,2FACA,6FACA,+FACA,uGACA;AAAA,EAEA,yEACA;AAAA,EAEA,uFACA;AAAA,EAEA,iGACA;AAAA,EAEA,6EACA;AAAA,EAEA,qEACA;AACT;AAKO,SAAS,kBAAkB,OAAkC;AAClE,QAAM,YAAY,MAAM;AAGxB,SAAO,6EACA,yFACA,+EACA,2FACA,+EACA,2FACA,+EACA,2FACA,6EACA,yFACA,mFACA,+FACA,qFACA,iGACA,2EACA,uFACA,6EACA,yFACA,iFACA,6FACA,2FACA;AAAA,EAEA,uEACA,yEACA,qFACA,uFACA,+FACA,iGACA,2EACA,6EACA,mEACA,qEACA,+EACA;AACT;AAKO,SAAS,mBAAmB,OAAkC;AACnE,QAAM,YAAY,MAAM;AAGxB,SAAO,+EACA,2FACA,iFACA,6FACA,iFACA,6FACA,iFACA,6FACA,+EACA,2FACA,qFACA,iGACA,uFACA,mGACA,6EACA,yFACA,+EACA,2FACA,mFACA,+FACA,6FACA;AAAA,EAEA,yEACA,2EACA,uFACA,yFACA,iGACA,mGACA,6EACA,+EACA,qEACA,uEACA,iFACA;AAAA,EAEA,kBAAkB,SAAS,SAAgB;AACpD;AAKO,SAAS,iBAAiB,WAAyC;AAExE,MAAI,oBAAoB,SAAS,SAAgB,EAAG,QAAO;AAG3D,MAAI,uEACA,yEACA,yEACA,yEAA6D;AAC/D,WAAO;AAAA,EACT;AAGA,MAAI,qFACA,uFACA,uFACA,uFAAoE;AACtE,WAAO;AAAA,EACT;AAGA,MAAI,+FACA,iGACA,iGACA,iGAAyE;AAC3E,WAAO;AAAA,EACT;AAGA,MAAI,2EACA,6EACA,6EACA,+EACA,qFACA,uFACA,uFACA,uFAAoE;AACtE,WAAO;AAAA,EACT;AAGA,MAAI,mEACA,qEACA,qEACA,qEAA2D;AAC7D,WAAO;AAAA,EACT;AAGA,MAAI,mBAAmB,SAAS,SAAgB,EAAG,QAAO;AAG1D,MAAI,kBAAkB,SAAS,SAAgB,EAAG,QAAO;AAGzD,MAAI,iFACA,uFACA,uFACA,iFAAiE;AACnE,WAAO;AAAA,EACT;AAGA,MAAI,qFACA,iFACA,yEAA6D;AAC/D,WAAO;AAAA,EACT;AAGA,MAAI,+EACA,iFACA,+EACA,+EAAgE;AAClE,WAAO;AAAA,EACT;AAGA,MAAI,mDACA,qDACA,mEACA,2DACA,mEACA,mDAAkD;AACpD,WAAO;AAAA,EACT;AAGA,MAAI,gDAAiD,QAAO;AAE5D,SAAO;AACT;AAKO,SAAS,uBAAuB,WAA+D;AAEpG,MAAI,6EACA,yFACA,+EACA,2FACA,+EACA,2FACA,+EACA,2FACA,6EACA,yFACA,mFACA,+FACA,qFACA,iGACA,2EACA,uFACA,6EACA,yFACA,iFACA,6FACA,2FACA,uGACA,uEACA,yEACA,qFACA,uFACA,+FACA,iGACA,2EACA,6EACA,mEACA,qEACA,+EACA,6EAA+D;AACjE,WAAO;AAAA,EACT;AAGA,MAAI,+EACA,2FACA,iFACA,6FACA,iFACA,6FACA,iFACA,6FACA,+EACA,2FACA,qFACA,iGACA,uFACA,mGACA,6EACA,yFACA,+EACA,2FACA,mFACA,+FACA,6FACA,yGACA,yEACA,2EACA,uFACA,yFACA,iGACA,mGACA,6EACA,+EACA,qEACA,uEACA,iFACA,iFACA,kBAAkB,SAAS,SAAgB,GAAG;AAChD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,SAAS,sBAAsB,WAA+D;AAEnG,MAAI,6EACA,+EACA,+EACA,iFACA,+EACA,iFACA,+EACA,iFACA,6EACA,+EACA,mFACA,qFACA,qFACA,uFACA,2EACA,6EACA,6EACA,+EACA,iFACA,mFACA,2FACA,6FACA,uEACA,yEACA,qFACA,uFACA,+FACA,iGACA,2EACA,6EACA,mEACA,mEAA0D;AAC5D,WAAO;AAAA,EACT;AAGA,MAAI,yFACA,2FACA,2FACA,6FACA,2FACA,6FACA,2FACA,6FACA,yFACA,2FACA,+FACA,iGACA,iGACA,mGACA,uFACA,yFACA,yFACA,2FACA,6FACA,+FACA,uGACA,yGACA,yEACA,2EACA,uFACA,yFACA,iGACA,mGACA,6EACA,+EACA,qEACA,qEAA2D;AAC7D,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAQO,SAAS,0BAA0B,OAAoD;AAC5F,QAAM,YAAY,MAAM;AAExB,SAAO,yFACA,2FACA,2FACA,2FACA,yFACA,+FACA,iGACA,uFACA,yFACA,6FACA;AACT;AAMO,SAAS,2BAA2B,OAAoD;AAC7F,QAAM,YAAY,MAAM;AAExB,SAAO,2FACA,6FACA,6FACA,6FACA,2FACA,iGACA,mGACA,yFACA,2FACA,+FACA;AACT;AAMO,SAAS,qBAAqB,OAAoD;AACvF,QAAM,YAAY,MAAM;AAExB,SAAO,+EACA,iFACA,iFACA,iFACA,+EACA,qFACA,uFACA,6EACA,+EACA,mFACA;AACT;AAMO,SAAS,oBAAoB,OAAoD;AACtF,QAAM,YAAY,MAAM;AAExB,SAAO,6EACA,+EACA,+EACA,+EACA,6EACA,mFACA,qFACA,2EAC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UAAU,KAAK,MAAM,UAAU,EAAE;AACvC,UAAM,QAAQ,KAAK,MAAM,UAAU,EAAE;AACrC,UAAM,OAAO,KAAK,MAAM,QAAQ,EAAE;AAClC,UAAM,QAAQ,KAAK,MAAM,OAAO,CAAC;AACjC,UAAM,SAAS,KAAK,MAAM,OAAO,EAAE;AACnC,UAAM,QAAQ,KAAK,MAAM,OAAO,GAAG;AAEnC,QAAI,UAAU,GAAI,QAAO;AACzB,QAAI,UAAU,GAAI,QAAO,GAAG,OAAO,UAAU,UAAU,IAAI,MAAM,EAAE;AACnE,QAAI,QAAQ,GAAI,QAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAC3D,QAAI,OAAO,EAAG,QAAO,GAAG,IAAI,OAAO,OAAO,IAAI,MAAM,EAAE;AACtD,QAAI,QAAQ,EAAG,QAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAC1D,QAAI,SAAS,GAAI,QAAO,GAAG,MAAM,SAAS,SAAS,IAAI,MAAM,EAAE;AAC/D,WAAO,GAAG,KAAK,QAAQ,QAAQ,IAAI,MAAM,EAAE;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,kBAAkB,MAAc,MAAoC,eAAgC;AACzG,YAAQ,MAAM;AAAA,MACZ,KAAK;AACH,eAAO,KAAK,QAAQ,uBAAuB,UAAU;AAAA,MACvD,KAAK;AACH,eAAO,KAAK,QAAQ,iBAAiB,UAAU;AAAA,MACjD,KAAK;AACH,YAAI,eAAe;AACjB,iBAAO,KAAK,QAAQ,eAAe,KAAK;AAAA,QAC1C;AACA,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IACX;AAAA,EACF;AACF;","names":["Gender","ThreadType","Urgency","ZaloWebhookEventType","axios","ThreadType","Urgency","ZaloMessageType","ZaloMessageCategory","SessionStatus","ThreadType","DestType","ReminderRepeatMode","Gender","BoardType","Reactions","FriendEventType","GroupEventType","ZaloThreadType","ZaloConnectionStatus","ZaloWebhookEventType","JobPriority","JobStatus","Gender","UpdateSettingsType","UpdateLangAvailableLanguages","SortOrder","SortByField","ThreadType","TextStyle","Urgency","MessageType","ZaloReactions","AttachmentMediaType","ProxyProtocol","ProxyStatus"]}