export interface LogConfig { level: LogLevel; colorize: boolean; timestamp: boolean; saveToFile: boolean; logDirectory: string; maxFileSize: string; maxFiles: number; format: 'simple' | 'detailed' | 'json'; showPerformance: boolean; showMemory: boolean; language: 'tl' | 'en'; } export type LogLevel = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR' | 'SUCCESS' | 'SYSTEM'; export interface LoginCredentials { email: string; password: string; } export interface AppState { cookies: Cookie[]; fbDtsg?: string; userId?: string; revision?: number; lastRefresh?: number; } export interface Cookie { name: string; value: string; domain: string; path: string; expires?: number; httpOnly?: boolean; secure?: boolean; } export interface CookieStatus { valid: boolean; expiresIn: string; lastRefresh: string; nextRefresh: string; health: 'excellent' | 'good' | 'fair' | 'poor'; } export interface CookieHealth { status: 'healthy' | 'degraded' | 'unhealthy'; score: number; issues: string[]; recommendations: string[]; } export interface AutoRefreshConfig { enabled: boolean; interval: number; refreshBeforeExpiry: number; maxRetries: number; onRefresh?: (info: RefreshInfo) => void; onError?: (error: Error) => void; } export interface RefreshInfo { timestamp: Date; success: boolean; newExpiry?: Date; attempts: number; } export interface Message { messageID: string; threadID: string; senderID: string; body: string; timestamp: number; type: MessageType; attachments: Attachment[]; mentions: Mention[]; isGroup: boolean; isUnread?: boolean; replyToMessage?: { messageID: string; senderID: string; body: string; }; } export type MessageType = 'text' | 'sticker' | 'photo' | 'video' | 'audio' | 'file' | 'gif' | 'location' | 'share'; export interface Attachment { type: string; url?: string; id?: string; filename?: string; size?: number; } export interface Mention { id: string; offset: number; length: number; name: string; } export interface UserInfo { id: string; name: string; firstName: string; lastName?: string; vanity?: string; profileUrl: string; avatarUrl: string; gender?: number; isFriend: boolean; isBirthday: boolean; } export interface ThreadInfo { threadID: string; name: string; isGroup: boolean; participantIDs: string[]; nicknames: Record; emoji?: string; color?: string; messageCount: number; unreadCount: number; lastMessage?: Message; adminIDs?: string[]; } export interface SendMessageOptions { body?: string; sticker?: string; attachment?: string | string[]; url?: string; emoji?: string; mentions?: MentionInput[]; replyToMessage?: string; } export interface MentionInput { id: string; tag: string; } export interface FingerprintConfig { autoRotate: boolean; rotationInterval: number; consistency: 'high' | 'medium' | 'low'; browserProfile: 'chrome' | 'edge' | 'firefox'; platform: 'Windows' | 'macOS' | 'Linux'; onRotation?: (fingerprint: Fingerprint) => void; } export interface Fingerprint { userAgent: string; language: string; platform: string; screenResolution: string; timezone: string; plugins: string[]; canvas: string; webgl: string; } export interface RequestObfuscatorConfig { enabled: boolean; entropyLevel: 'low' | 'medium' | 'high' | 'extreme'; headerRandomization: boolean; payloadEncryption: boolean; parameterShuffle: boolean; timestampFuzz: { enabled: boolean; variance: number; }; } export interface PatternDiffuserConfig { enabled: boolean; humanLikeDelays: { min: number; max: number; distribution: 'uniform' | 'normal' | 'exponential'; }; burstPrevention: { maxBurst: number; cooldownPeriod: number; }; idleSimulation: { enabled: boolean; minIdle: number; maxIdle: number; frequency: number; }; typingSimulation: { enabled: boolean; wpm: number; variance: number; }; } export interface RateLimiterConfig { enabled: boolean; adaptive: boolean; limits: { messagesPerMinute: number; messagesPerHour: number; messagesPerDay: number; newAccountMultiplier: number; groupMessagesMultiplier: number; }; burstAllowance: { enabled: boolean; maxBurst: number; cooldown: number; }; warningThresholds: Record; onLimitReached?: (info: RateLimitInfo) => void; } export interface RateLimitInfo { type: string; current: number; limit: number; resetIn: number; } export interface LiwanagOptions { logConfig?: Partial; autoRefresh?: Partial; fingerprint?: Partial; requestObfuscator?: Partial; patternDiffuser?: Partial; rateLimiter?: Partial; userAgent?: string; proxy?: string; selfListen?: boolean; listenEvents?: boolean; } export interface ApiCallback { (error: Error | null, api: LiwanagApi): void; } export interface MessageCallback { (error: Error | null, message: Message): void; } export interface LiwanagApi { getUserID(): string; magpadalaNgMensahe(message: string | SendMessageOptions, threadID: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; sendMessage(message: string | SendMessageOptions, threadID: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; makinigSaMensahe(callback: MessageCallback): void; listenMqtt(callback: MessageCallback): void; kuninAngUserInfo(userIDs: string | string[], callback?: (err: Error | null, info: Record) => void): Promise>; getUserInfo(userIDs: string | string[], callback?: (err: Error | null, info: Record) => void): Promise>; kuninAngThreadInfo(threadID: string, callback?: (err: Error | null, info: ThreadInfo) => void): Promise; getThreadInfo(threadID: string, callback?: (err: Error | null, info: ThreadInfo) => void): Promise; kuninAngThreadList(limit: number, timestamp: number | null, tags: string[], callback?: (err: Error | null, threads: ThreadInfo[]) => void): Promise; getThreadList(limit: number, timestamp: number | null, tags: string[], callback?: (err: Error | null, threads: ThreadInfo[]) => void): Promise; gumawaNgGroup(participantIDs: string[], name: string, callback?: (err: Error | null, threadID: string) => void): Promise; createGroup(participantIDs: string[], name: string, callback?: (err: Error | null, threadID: string) => void): Promise; magdagdagNgMember(threadID: string, userIDs: string | string[], callback?: (err: Error | null) => void): Promise; addUserToGroup(userIDs: string | string[], threadID: string, callback?: (err: Error | null) => void): Promise; magtanggalNgMember(threadID: string, userID: string, callback?: (err: Error | null) => void): Promise; removeUserFromGroup(userID: string, threadID: string, callback?: (err: Error | null) => void): Promise; palitanAngGroupName(threadID: string, newName: string, callback?: (err: Error | null) => void): Promise; setTitle(newTitle: string, threadID: string, callback?: (err: Error | null) => void): Promise; markAsRead(threadID: string, callback?: (err: Error | null) => void): Promise; markAsReadAll(callback?: (err: Error | null) => void): Promise; setMessageReaction(reaction: string, messageID: string, callback?: (err: Error | null) => void): Promise; unsendMessage(messageID: string, callback?: (err: Error | null) => void): Promise; autoRefreshCookies(config: Partial): void; refreshCookies(): Promise; getCookieStatus(): CookieStatus; checkCookieHealth(): Promise; exportCookies(): Cookie[]; saveCookies(path: string): Promise; loadCookies(path: string): Promise; rotateCookies(options: { clearCache?: boolean; renewSession?: boolean; }): Promise; fingerprintManager(config: Partial): void; requestObfuscator(config: Partial): void; patternDiffuser(config: Partial): void; smartRateLimiter(config: Partial): void; getAppState(): AppState; setOptions(options: Partial): void; logout(callback?: (err: Error | null) => void): Promise; sendPhoto(photoPath: string | string[], threadID: string, caption?: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; magpadalaNgLarawan(photoPath: string | string[], threadID: string, caption?: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; sendVideo(videoPath: string, threadID: string, caption?: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; magpadalaNgVideo(videoPath: string, threadID: string, caption?: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; sendSticker(stickerID: string, threadID: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; magpadalaNgSticker(stickerID: string, threadID: string, callback?: (err: Error | null, messageInfo: any) => void): Promise; getStickerURL(stickerID: string, callback?: (err: Error | null, url: string) => void): Promise; postToTimeline(message: string, options?: TimelinePostOptions, callback?: (err: Error | null, postInfo: TimelinePost) => void): Promise; magpostsaTimeline(message: string, options?: TimelinePostOptions, callback?: (err: Error | null, postInfo: TimelinePost) => void): Promise; deletePost(postID: string, callback?: (err: Error | null) => void): Promise; editPost(postID: string, newMessage: string, callback?: (err: Error | null) => void): Promise; sendFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; magpadalaNgFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; acceptFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; tanggapinAngFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; declineFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; cancelFriendRequest(userID: string, callback?: (err: Error | null) => void): Promise; unfriend(userID: string, callback?: (err: Error | null) => void): Promise; getFriendRequests(callback?: (err: Error | null, requests: FriendRequest[]) => void): Promise; kuninAngFriendRequests(callback?: (err: Error | null, requests: FriendRequest[]) => void): Promise; getFriendsList(callback?: (err: Error | null, friends: UserInfo[]) => void): Promise; getNotifications(limit?: number, callback?: (err: Error | null, notifications: Notification[]) => void): Promise; kuninAngNotifications(limit?: number, callback?: (err: Error | null, notifications: Notification[]) => void): Promise; markNotificationAsRead(notificationID: string, callback?: (err: Error | null) => void): Promise; markAllNotificationsAsRead(callback?: (err: Error | null) => void): Promise; onNotification(callback: NotificationCallback): void; registerWebhook(config: WebhookConfig): void; unregisterWebhook(webhookID: string): void; getWebhooks(): WebhookConfig[]; sendVoice(audioPath: string, threadID: string, options?: VoiceMessageOptions, callback?: (err: Error | null, messageInfo: VoiceMessage) => void): Promise; magpadalaNgBoses(audioPath: string, threadID: string, options?: VoiceMessageOptions, callback?: (err: Error | null, messageInfo: VoiceMessage) => void): Promise; sendFile(filePath: string, threadID: string, options?: FileAttachmentOptions, callback?: (err: Error | null, attachment: FileAttachment) => void): Promise; magpadalaNgFile(filePath: string, threadID: string, options?: FileAttachmentOptions, callback?: (err: Error | null, attachment: FileAttachment) => void): Promise; postStory(mediaPath: string, options?: StoryOptions, callback?: (err: Error | null, story: Story) => void): Promise; magpostNgStory(mediaPath: string, options?: StoryOptions, callback?: (err: Error | null, story: Story) => void): Promise; getStories(userID?: string, callback?: (err: Error | null, stories: Story[]) => void): Promise; kuninAngStories(userID?: string, callback?: (err: Error | null, stories: Story[]) => void): Promise; deleteStory(storyID: string, callback?: (err: Error | null) => void): Promise; postReel(videoPath: string, options?: ReelsOptions, callback?: (err: Error | null, reel: Reel) => void): Promise; magpostNgReel(videoPath: string, options?: ReelsOptions, callback?: (err: Error | null, reel: Reel) => void): Promise; getReels(userID?: string, callback?: (err: Error | null, reels: Reel[]) => void): Promise; kuninAngReels(userID?: string, callback?: (err: Error | null, reels: Reel[]) => void): Promise; createListing(options: MarketplaceListingOptions, callback?: (err: Error | null, listing: MarketplaceListing) => void): Promise; gumawaNgListing(options: MarketplaceListingOptions, callback?: (err: Error | null, listing: MarketplaceListing) => void): Promise; updateListing(listingID: string, updates: Partial, callback?: (err: Error | null, listing: MarketplaceListing) => void): Promise; deleteListing(listingID: string, callback?: (err: Error | null) => void): Promise; searchMarketplace(options: MarketplaceSearchOptions, callback?: (err: Error | null, listings: MarketplaceListing[]) => void): Promise; hanapiNgListings(options: MarketplaceSearchOptions, callback?: (err: Error | null, listings: MarketplaceListing[]) => void): Promise; getMyListings(callback?: (err: Error | null, listings: MarketplaceListing[]) => void): Promise; kuninAngMgaListingsKo(callback?: (err: Error | null, listings: MarketplaceListing[]) => void): Promise; markAsSold(listingID: string, callback?: (err: Error | null) => void): Promise; startWatchTogether(threadID: string, options: WatchTogetherOptions, callback?: (err: Error | null, session: WatchTogetherSession) => void): Promise; magsimulaNgWatchTogether(threadID: string, options: WatchTogetherOptions, callback?: (err: Error | null, session: WatchTogetherSession) => void): Promise; joinWatchTogether(sessionID: string, callback?: (err: Error | null, session: WatchTogetherSession) => void): Promise; leaveWatchTogether(sessionID: string, callback?: (err: Error | null) => void): Promise; controlWatchTogether(sessionID: string, action: 'play' | 'pause' | 'seek', value?: number, callback?: (err: Error | null) => void): Promise; startGame(threadID: string, gameID: string, callback?: (err: Error | null, session: GameSession) => void): Promise; magsimulaNgLaro(threadID: string, gameID: string, callback?: (err: Error | null, session: GameSession) => void): Promise; joinGame(sessionID: string, callback?: (err: Error | null, session: GameSession) => void): Promise; leaveGame(sessionID: string, callback?: (err: Error | null) => void): Promise; getAvailableGames(callback?: (err: Error | null, games: AvailableGame[]) => void): Promise; kuninAngMgaLaro(callback?: (err: Error | null, games: AvailableGame[]) => void): Promise; sendGameInvite(threadID: string, gameID: string, callback?: (err: Error | null, invite: GameInvite) => void): Promise; getAnalytics(period?: 'day' | 'week' | 'month' | 'all', callback?: (err: Error | null, data: AnalyticsData) => void): Promise; kuninAngAnalytics(period?: 'day' | 'week' | 'month' | 'all', callback?: (err: Error | null, data: AnalyticsData) => void): Promise; exportAnalytics(format: 'json' | 'csv', path: string, callback?: (err: Error | null) => void): Promise; resetAnalytics(callback?: (err: Error | null) => void): Promise; registerPlugin(plugin: Plugin): void; unregisterPlugin(pluginId: string): void; enablePlugin(pluginId: string): void; disablePlugin(pluginId: string): void; getPlugins(): Plugin[]; getPlugin(pluginId: string): Plugin | undefined; startLiveStream(options: LiveStreamOptions, callback?: (err: Error | null, stream: LiveStream) => void): Promise; magsimulaNgLiveStream(options: LiveStreamOptions, callback?: (err: Error | null, stream: LiveStream) => void): Promise; endLiveStream(streamID: string, callback?: (err: Error | null) => void): Promise; tapusinAngLiveStream(streamID: string, callback?: (err: Error | null) => void): Promise; getLiveStreams(callback?: (err: Error | null, streams: LiveStream[]) => void): Promise; kuninAngMgaLiveStream(callback?: (err: Error | null, streams: LiveStream[]) => void): Promise; onLiveStreamEvent(streamID: string, callback: LiveStreamCallback): void; configureChatbot(config: ChatbotConfig): void; iConfigAngChatbot(config: ChatbotConfig): void; enableChatbot(): void; disableChatbot(): void; addChatbotIntent(intent: ChatbotIntent): void; removeChatbotIntent(intentName: string): void; processChatbotMessage(message: string, userID: string): Promise; getChatbotContext(userID: string): ChatbotContext | undefined; clearChatbotContext(userID: string): void; addAccount(appState: AppState, name?: string): Promise; magdagdagNgAccount(appState: AppState, name?: string): Promise; removeAccount(accountID: string): void; switchAccount(accountID: string, options?: AccountSwitchOptions): Promise; lumipatNgAccount(accountID: string, options?: AccountSwitchOptions): Promise; getAccounts(): AccountInfo[]; kuninAngMgaAccount(): AccountInfo[]; getActiveAccount(): AccountInfo | undefined; getAccountStats(accountID?: string): AccountStats; configureAccountManager(config: AccountManagerConfig): void; addTemplate(template: ResponseTemplate): void; magdagdagNgTemplate(template: ResponseTemplate): void; removeTemplate(templateID: string): void; updateTemplate(templateID: string, updates: Partial): void; getTemplates(): ResponseTemplate[]; kuninAngMgaTemplate(): ResponseTemplate[]; enableTemplate(templateID: string): void; disableTemplate(templateID: string): void; testTemplate(templateID: string, testMessage: string): TemplateResponse | null; scheduleMessage(threadID: string, message: string | SendMessageOptions, scheduledTime: Date, options?: Partial): Promise; magScheduleNgMensahe(threadID: string, message: string | SendMessageOptions, scheduledTime: Date, options?: Partial): Promise; cancelScheduledMessage(messageID: string): void; getScheduledMessages(): ScheduledMessage[]; kuninAngMgaScheduledMessage(): ScheduledMessage[]; updateScheduledMessage(messageID: string, updates: Partial): void; configureScheduler(config: SchedulerConfig): void; configureSpamDetection(config: SpamDetectionConfig): void; iConfigAngSpamDetection(config: SpamDetectionConfig): void; checkForSpam(message: string, senderID: string, threadID: string): Promise; suriiinKungSpam(message: string, senderID: string, threadID: string): Promise; addToWhitelist(userID: string): void; addToBlacklist(userID: string): void; removeFromWhitelist(userID: string): void; removeFromBlacklist(userID: string): void; getSpamReports(): SpamReport[]; resolveSpamReport(reportID: string): void; getGroupAnalytics(groupID: string, period?: 'day' | 'week' | 'month' | 'all'): Promise; kuninAngGroupAnalytics(groupID: string, period?: 'day' | 'week' | 'month' | 'all'): Promise; exportGroupAnalytics(groupID: string, format: 'json' | 'csv', path: string): Promise; getTopContributors(groupID: string, limit?: number): Promise; kuninAngTopContributors(groupID: string, limit?: number): Promise; getGroupSentiment(groupID: string): Promise; configureBridge(config: MessagingBridgeConfig): void; iConfigAngBridge(config: MessagingBridgeConfig): void; addPlatform(platformConfig: PlatformConfig): void; removePlatform(platform: SupportedPlatform): void; getBridgeStats(): BridgeStats[]; kuninAngBridgeStats(): BridgeStats[]; sendCrossPlatformMessage(platform: SupportedPlatform, channel: string, message: string): Promise; magpadalaSaIbangPlatform(platform: SupportedPlatform, channel: string, message: string): Promise; getBridgedMessages(): BridgedMessage[]; startVoiceCall(threadID: string, options?: Partial, callback?: (err: Error | null, call: CallSession) => void): Promise; magsimulaNgVoiceCall(threadID: string, options?: Partial, callback?: (err: Error | null, call: CallSession) => void): Promise; startVideoCall(threadID: string, options?: Partial, callback?: (err: Error | null, call: CallSession) => void): Promise; magsimulaNgVideoCall(threadID: string, options?: Partial, callback?: (err: Error | null, call: CallSession) => void): Promise; joinCall(callID: string, callback?: (err: Error | null, call: CallSession) => void): Promise; sumaliSaTawag(callID: string, callback?: (err: Error | null, call: CallSession) => void): Promise; endCall(callID: string, callback?: (err: Error | null) => void): Promise; tapusinAngTawag(callID: string, callback?: (err: Error | null) => void): Promise; toggleMute(callID: string, muted: boolean, callback?: (err: Error | null) => void): Promise; toggleVideo(callID: string, videoOn: boolean, callback?: (err: Error | null) => void): Promise; getActiveCalls(): CallSession[]; kuninAngMgaTawag(): CallSession[]; onCallEvent(callID: string, callback: CallCallback): void; startScreenShare(callID: string, options?: ScreenShareOptions, callback?: (err: Error | null, session: ScreenShareSession) => void): Promise; magsimulaNgScreenShare(callID: string, options?: ScreenShareOptions, callback?: (err: Error | null, session: ScreenShareSession) => void): Promise; stopScreenShare(callID: string, callback?: (err: Error | null) => void): Promise; itigilAngScreenShare(callID: string, callback?: (err: Error | null) => void): Promise; pauseScreenShare(callID: string, callback?: (err: Error | null) => void): Promise; resumeScreenShare(callID: string, callback?: (err: Error | null) => void): Promise; configureModeration(config: ModerationConfig): void; iConfigAngModeration(config: ModerationConfig): void; evaluateMessage(message: string, senderID: string, threadID: string): Promise; suriiinAngMensahe(message: string, senderID: string, threadID: string): Promise; getModerationQueue(status?: 'pending' | 'approved' | 'rejected'): ModerationQueue; kuninAngModerationQueue(status?: 'pending' | 'approved' | 'rejected'): ModerationQueue; approveFlaggedMessage(resultID: string, callback?: (err: Error | null) => void): Promise; rejectFlaggedMessage(resultID: string, callback?: (err: Error | null) => void): Promise; getModerationStats(): ModerationStats; kuninAngModerationStats(): ModerationStats; addModerationRule(rule: ModerationRule): void; removeModerationRule(ruleID: string): void; configureEncryption(config: EncryptionConfig): void; iConfigAngEncryption(config: EncryptionConfig): void; enableEncryption(threadID: string, callback?: (err: Error | null, status: EncryptionStatus) => void): Promise; paganahinAngEncryption(threadID: string, callback?: (err: Error | null, status: EncryptionStatus) => void): Promise; disableEncryption(threadID: string, callback?: (err: Error | null) => void): Promise; patayinAngEncryption(threadID: string, callback?: (err: Error | null) => void): Promise; rotateEncryptionKeys(threadID: string, callback?: (err: Error | null, keyPair: EncryptionKeyPair) => void): Promise; getEncryptionStatus(threadID: string): EncryptionStatus | undefined; kuninAngEncryptionStatus(threadID: string): EncryptionStatus | undefined; verifyParticipant(threadID: string, userID: string, callback?: (err: Error | null, verified: boolean) => void): Promise; getEncryptedThreads(): EncryptedThread[]; configureBotMarketplace(config: BotMarketplaceConfig): void; iConfigAngBotMarketplace(config: BotMarketplaceConfig): void; searchBots(options?: BotSearchOptions): Promise; hanapiNgMgaBot(options?: BotSearchOptions): Promise; getBotDetails(botID: string): Promise; kuninAngBotDetails(botID: string): Promise; installBot(botID: string, config?: Record, callback?: (err: Error | null, bot: InstalledBot) => void): Promise; iInstallAngBot(botID: string, config?: Record, callback?: (err: Error | null, bot: InstalledBot) => void): Promise; uninstallBot(botID: string, callback?: (err: Error | null) => void): Promise; iUninstallAngBot(botID: string, callback?: (err: Error | null) => void): Promise; getInstalledBots(): InstalledBot[]; kuninAngMgaInstalledBot(): InstalledBot[]; enableBot(botID: string): void; disableBot(botID: string): void; configureBotForThread(botID: string, threadID: string, config?: Record): void; getBotReviews(botID: string): Promise; submitBotReview(botID: string, rating: number, review: string): Promise; configureWebhookTransforms(config: WebhookTransformConfig): void; iConfigAngWebhookTransforms(config: WebhookTransformConfig): void; addWebhookTransformation(transformation: WebhookTransformation): void; magdagdagNgTransformation(transformation: WebhookTransformation): void; removeWebhookTransformation(transformationID: string): void; updateWebhookTransformation(transformationID: string, updates: Partial): void; getWebhookTransformations(): WebhookTransformation[]; kuninAngMgaTransformation(): WebhookTransformation[]; testWebhookTransformation(transformationID: string, testPayload: any): TransformationResult; enableWebhookTransformation(transformationID: string): void; disableWebhookTransformation(transformationID: string): void; } export interface TwoFactorAuthOptions { method: '2fa_code' | 'backup_code' | 'authenticator'; code: string; } export interface CheckpointData { type: 'two_factor' | 'verification' | 'captcha' | 'identity'; challengeUrl?: string; message?: string; } export interface CheckpointHandler { onCheckpoint: (data: CheckpointData) => Promise; onError?: (error: Error) => void; } export interface TimelinePostOptions { privacy?: 'public' | 'friends' | 'only_me'; photos?: string[]; location?: string; feeling?: string; taggedUsers?: string[]; scheduledTime?: Date; } export interface TimelinePost { postID: string; authorID: string; message: string; timestamp: number; privacy: string; likes: number; comments: number; shares: number; attachments: Attachment[]; } export interface FriendRequest { id: string; senderID: string; senderName: string; senderProfileUrl: string; senderAvatarUrl: string; timestamp: number; mutualFriends: number; } export interface Notification { id: string; type: NotificationType; title: string; body: string; timestamp: number; isRead: boolean; link?: string; senderID?: string; senderName?: string; senderAvatar?: string; } export type NotificationType = 'message' | 'friend_request' | 'comment' | 'like' | 'mention' | 'tag' | 'group' | 'event' | 'birthday' | 'memory' | 'other'; export interface NotificationCallback { (notification: Notification): void; } export interface WebhookConfig { id?: string; url: string; events: WebhookEventType[]; secret?: string; headers?: Record; retryCount?: number; retryDelay?: number; } export type WebhookEventType = 'message' | 'message_reaction' | 'message_read' | 'friend_request' | 'notification' | 'presence' | 'typing' | 'all'; export interface WebhookPayload { event: WebhookEventType; timestamp: number; data: any; } export interface VoiceMessageOptions { duration?: number; waveform?: number[]; } export interface VoiceMessage { messageID: string; threadID: string; audioUrl: string; duration: number; timestamp: number; } export interface FileAttachmentOptions { filename?: string; description?: string; } export type SupportedFileType = 'pdf' | 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'txt' | 'zip' | 'rar'; export interface FileAttachment { id: string; filename: string; fileType: SupportedFileType | string; size: number; url?: string; timestamp: number; } export interface StoryOptions { duration?: number; backgroundColor?: string; textOverlay?: string; musicId?: string; privacy?: 'public' | 'friends' | 'close_friends'; allowReplies?: boolean; expiresIn?: number; } export interface Story { storyID: string; authorID: string; type: 'photo' | 'video' | 'text'; mediaUrl?: string; text?: string; timestamp: number; expiresAt: number; views: number; reactions: StoryReaction[]; } export interface StoryReaction { userID: string; reaction: string; timestamp: number; } export interface ReelsOptions { caption?: string; music?: { trackId: string; startTime?: number; duration?: number; }; effects?: string[]; privacy?: 'public' | 'friends'; allowComments?: boolean; allowDuet?: boolean; allowStitch?: boolean; } export interface Reel { reelID: string; authorID: string; videoUrl: string; thumbnailUrl: string; caption?: string; duration: number; timestamp: number; views: number; likes: number; comments: number; shares: number; } export interface MarketplaceListingOptions { title: string; description: string; price: number; currency?: string; category: MarketplaceCategory; condition?: 'new' | 'like_new' | 'good' | 'fair' | 'poor'; photos: string[]; location?: string; deliveryOptions?: ('pickup' | 'shipping' | 'both')[]; negotiable?: boolean; } export type MarketplaceCategory = 'vehicles' | 'property' | 'electronics' | 'clothing' | 'furniture' | 'toys' | 'sports' | 'books' | 'music' | 'garden' | 'pets' | 'home' | 'other'; export interface MarketplaceListing { listingID: string; sellerID: string; title: string; description: string; price: number; currency: string; category: MarketplaceCategory; condition: string; photos: string[]; location?: string; timestamp: number; status: 'active' | 'sold' | 'pending' | 'removed'; views: number; saves: number; } export interface MarketplaceSearchOptions { query?: string; category?: MarketplaceCategory; minPrice?: number; maxPrice?: number; location?: string; radius?: number; condition?: string[]; sortBy?: 'date' | 'price_low' | 'price_high' | 'distance'; limit?: number; } export interface WatchTogetherSession { sessionID: string; hostID: string; threadID: string; videoUrl: string; videoTitle?: string; participants: string[]; currentTime: number; isPlaying: boolean; timestamp: number; } export interface WatchTogetherOptions { videoUrl: string; videoTitle?: string; autoStart?: boolean; } export interface GameSession { sessionID: string; gameID: string; gameName: string; hostID: string; threadID: string; participants: string[]; status: 'waiting' | 'playing' | 'finished'; scores: Record; timestamp: number; } export interface GameInvite { inviteID: string; gameID: string; gameName: string; hostID: string; hostName: string; threadID: string; timestamp: number; expiresAt: number; } export interface AvailableGame { gameID: string; name: string; description: string; minPlayers: number; maxPlayers: number; category: 'puzzle' | 'trivia' | 'action' | 'multiplayer' | 'casual'; thumbnailUrl: string; } export interface AnalyticsData { period: 'day' | 'week' | 'month' | 'all'; startDate: Date; endDate: Date; messageStats: MessageStats; engagementStats: EngagementStats; performanceStats: PerformanceStats; topThreads: ThreadStats[]; topUsers: UserStats[]; } export interface MessageStats { sent: number; received: number; photos: number; videos: number; stickers: number; voiceMessages: number; files: number; } export interface EngagementStats { reactions: number; replies: number; mentions: number; avgResponseTime: number; peakHours: number[]; } export interface PerformanceStats { apiCalls: number; errors: number; errorRate: number; avgLatency: number; uptime: number; } export interface ThreadStats { threadID: string; threadName: string; messageCount: number; lastActivity: number; } export interface UserStats { userID: string; userName: string; messageCount: number; lastActivity: number; } export interface Plugin { id: string; name: string; version: string; description: string; author: string; enabled: boolean; hooks: PluginHook[]; config?: Record; } export interface PluginHook { event: PluginEventType; handler: (data: any, api: LiwanagApi) => Promise | any; priority?: number; } export type PluginEventType = 'beforeSendMessage' | 'afterSendMessage' | 'onMessageReceived' | 'beforeLogin' | 'afterLogin' | 'onError' | 'onReaction' | 'onTyping' | 'onPresence' | 'custom'; export interface PluginContext { api: LiwanagApi; logger: any; storage: PluginStorage; } export interface PluginStorage { get(key: string): Promise; set(key: string, value: any): Promise; delete(key: string): Promise; clear(): Promise; } export interface PluginManager { register(plugin: Plugin): void; unregister(pluginId: string): void; enable(pluginId: string): void; disable(pluginId: string): void; getPlugin(pluginId: string): Plugin | undefined; getPlugins(): Plugin[]; executeHook(event: PluginEventType, data: any): Promise; } export interface LiveStreamOptions { title: string; description?: string; privacy?: 'public' | 'friends' | 'only_me'; allowComments?: boolean; notifyFollowers?: boolean; scheduledTime?: Date; } export interface LiveStream { streamID: string; hostID: string; title: string; description?: string; privacy: string; status: 'scheduled' | 'live' | 'ended'; rtmpUrl?: string; streamKey?: string; viewers: number; peakViewers: number; likes: number; comments: number; startedAt?: number; endedAt?: number; duration?: number; timestamp: number; } export interface LiveStreamComment { id: string; userID: string; userName: string; message: string; timestamp: number; } export interface LiveStreamCallback { (event: 'viewer_joined' | 'viewer_left' | 'comment' | 'reaction' | 'ended', data: any): void; } export interface ChatbotConfig { enabled: boolean; language: 'tl' | 'en' | 'auto'; responseDelay?: number; typingSimulation?: boolean; intents: ChatbotIntent[]; fallbackResponse?: string; nlpProvider?: 'built-in' | 'openai' | 'dialogflow'; apiKey?: string; contextMemory?: number; } export interface ChatbotIntent { name: string; patterns: string[]; responses: string[]; entities?: string[]; context?: string[]; followUp?: string[]; priority?: number; } export interface ChatbotResponse { intent: string; confidence: number; response: string; entities: Record; suggestedActions?: string[]; } export interface ChatbotContext { sessionID: string; userID: string; history: ChatbotMessage[]; entities: Record; currentIntent?: string; lastInteraction: number; } export interface ChatbotMessage { role: 'user' | 'bot'; message: string; timestamp: number; intent?: string; } export interface AccountInfo { accountID: string; userID: string; name: string; email?: string; status: 'active' | 'inactive' | 'suspended' | 'rate_limited'; lastActive: number; createdAt: number; appState?: AppState; } export interface AccountSwitchOptions { preserveListeners?: boolean; warmup?: boolean; timeout?: number; } export interface AccountManagerConfig { maxAccounts: number; autoRotate?: boolean; rotateInterval?: number; balanceLoad?: boolean; failoverEnabled?: boolean; } export interface AccountStats { accountID: string; messagesSent: number; messagesReceived: number; errors: number; rateLimitHits: number; uptime: number; } export interface ResponseTemplate { id: string; name: string; category: string; trigger: TemplateTrigger; response: TemplateResponse; conditions?: TemplateCondition[]; schedule?: TemplateSchedule; enabled: boolean; priority: number; stats: TemplateStats; } export interface TemplateTrigger { type: 'keyword' | 'regex' | 'intent' | 'event' | 'scheduled'; value: string | string[]; caseSensitive?: boolean; matchType?: 'exact' | 'contains' | 'startsWith' | 'endsWith'; } export interface TemplateResponse { type: 'text' | 'random' | 'sequential' | 'conditional'; content: string | string[]; attachments?: string[]; sticker?: string; delay?: number; variables?: Record; } export interface TemplateCondition { field: string; operator: 'equals' | 'contains' | 'greaterThan' | 'lessThan' | 'in' | 'notIn'; value: any; } export interface TemplateSchedule { enabled: boolean; days?: number[]; startTime?: string; endTime?: string; timezone?: string; } export interface TemplateStats { triggered: number; lastTriggered?: number; successRate: number; } export interface ScheduledMessage { id: string; threadID: string; message: string | SendMessageOptions; scheduledTime: Date; timezone?: string; recurrence?: MessageRecurrence; status: 'pending' | 'sent' | 'failed' | 'cancelled'; createdAt: number; sentAt?: number; error?: string; retryCount?: number; } export interface MessageRecurrence { type: 'once' | 'daily' | 'weekly' | 'monthly' | 'custom'; interval?: number; daysOfWeek?: number[]; dayOfMonth?: number; endDate?: Date; maxOccurrences?: number; occurrenceCount?: number; } export interface SchedulerConfig { enabled: boolean; checkInterval?: number; maxRetries?: number; retryDelay?: number; timezone?: string; } export interface SpamDetectionConfig { enabled: boolean; sensitivity: 'low' | 'medium' | 'high'; actions: SpamAction[]; whitelist?: string[]; blacklist?: string[]; customPatterns?: SpamPattern[]; mlEnabled?: boolean; reportToFacebook?: boolean; } export interface SpamPattern { name: string; pattern: string; type: 'regex' | 'keyword' | 'fuzzy'; weight: number; action?: SpamAction; } export type SpamAction = 'ignore' | 'delete' | 'block' | 'report' | 'notify' | 'quarantine'; export interface SpamCheckResult { isSpam: boolean; score: number; reasons: SpamReason[]; suggestedAction: SpamAction; confidence: number; } export interface SpamReason { type: 'pattern' | 'behavior' | 'reputation' | 'content' | 'frequency'; description: string; weight: number; } export interface SpamReport { id: string; messageID: string; senderID: string; threadID: string; content: string; reasons: SpamReason[]; action: SpamAction; timestamp: number; resolved?: boolean; } export interface GroupAnalytics { groupID: string; groupName: string; period: 'day' | 'week' | 'month' | 'all'; memberStats: GroupMemberStats; activityStats: GroupActivityStats; contentStats: GroupContentStats; growthStats: GroupGrowthStats; topContributors: GroupContributor[]; peakActivityTimes: PeakActivityTime[]; sentimentAnalysis?: GroupSentiment; } export interface GroupMemberStats { totalMembers: number; activeMembers: number; newMembers: number; leftMembers: number; adminCount: number; averageResponseTime: number; } export interface GroupActivityStats { totalMessages: number; averageMessagesPerDay: number; photos: number; videos: number; links: number; polls: number; events: number; reactions: number; } export interface GroupContentStats { topTopics: { topic: string; count: number; }[]; topEmojis: { emoji: string; count: number; }[]; topLinks: { domain: string; count: number; }[]; mediaRatio: number; } export interface GroupGrowthStats { memberGrowthRate: number; activityGrowthRate: number; retentionRate: number; churnRate: number; } export interface GroupContributor { userID: string; userName: string; messageCount: number; reactionCount: number; mediaCount: number; score: number; } export interface PeakActivityTime { hour: number; day: number; messageCount: number; } export interface GroupSentiment { positive: number; neutral: number; negative: number; overallScore: number; } export interface MessagingBridgeConfig { enabled: boolean; platforms: PlatformConfig[]; syncMode: 'one-way' | 'two-way'; messageFormat?: 'preserve' | 'standardize'; attachmentHandling?: 'forward' | 'convert' | 'link'; } export interface PlatformConfig { platform: SupportedPlatform; enabled: boolean; credentials: Record; channelMappings: ChannelMapping[]; messagePrefix?: string; webhookUrl?: string; } export type SupportedPlatform = 'telegram' | 'discord' | 'slack' | 'whatsapp' | 'viber' | 'line' | 'messenger'; export interface ChannelMapping { sourceChannel: string; targetChannel: string; bidirectional: boolean; filters?: MessageFilter[]; } export interface MessageFilter { type: 'include' | 'exclude'; field: 'sender' | 'content' | 'type'; pattern: string; } export interface BridgedMessage { id: string; sourcePlatform: SupportedPlatform; targetPlatform: SupportedPlatform; sourceChannel: string; targetChannel: string; originalMessage: any; transformedMessage: any; status: 'pending' | 'sent' | 'failed'; timestamp: number; error?: string; } export interface BridgeStats { platform: SupportedPlatform; messagesSent: number; messagesReceived: number; errors: number; lastActivity: number; } export interface CallSession { callID: string; type: 'voice' | 'video'; threadID: string; participants: CallParticipant[]; status: 'ringing' | 'active' | 'ended' | 'missed' | 'declined'; startTime: number; endTime?: number; duration?: number; initiatorID: string; quality: CallQuality; screenShare?: ScreenShareSession; encryption?: boolean; } export interface CallParticipant { userID: string; userName: string; joinedAt: number; leftAt?: number; isMuted: boolean; isVideoOn: boolean; isScreenSharing: boolean; connectionQuality: 'excellent' | 'good' | 'fair' | 'poor'; } export interface CallQuality { bitrate: number; packetLoss: number; latency: number; resolution?: string; frameRate?: number; } export interface CallOptions { type: 'voice' | 'video'; encrypted?: boolean; maxParticipants?: number; recordCall?: boolean; timeout?: number; } export interface CallCallback { (event: CallEvent): void; } export interface CallEvent { type: 'participant_joined' | 'participant_left' | 'mute_changed' | 'video_changed' | 'quality_changed' | 'screen_share_started' | 'screen_share_ended' | 'call_ended'; callID: string; participantID?: string; data?: any; timestamp: number; } export interface ScreenShareSession { sessionID: string; callID: string; sharerID: string; status: 'active' | 'paused' | 'ended'; startTime: number; endTime?: number; quality: ScreenShareQuality; viewerCount: number; } export interface ScreenShareQuality { resolution: string; frameRate: number; bitrate: number; } export interface ScreenShareOptions { quality?: 'low' | 'medium' | 'high' | 'auto'; audio?: boolean; optimizeFor?: 'motion' | 'detail'; } export interface ModerationConfig { enabled: boolean; provider?: 'builtin' | 'openai' | 'perspective' | 'custom'; apiKey?: string; sensitivity: 'low' | 'medium' | 'high' | 'strict'; categories: ModerationCategory[]; actions: ModerationAction[]; autoModerate?: boolean; notifyAdmins?: boolean; logAll?: boolean; customRules?: ModerationRule[]; } export type ModerationCategory = 'hate_speech' | 'harassment' | 'violence' | 'sexual_content' | 'self_harm' | 'spam' | 'scam' | 'misinformation' | 'profanity' | 'personal_info' | 'illegal_content'; export interface ModerationRule { id: string; name: string; type: 'keyword' | 'regex' | 'ai' | 'custom'; pattern?: string; category: ModerationCategory; action: ModerationActionType; severity: 'low' | 'medium' | 'high' | 'critical'; enabled: boolean; } export type ModerationActionType = 'flag' | 'delete' | 'warn' | 'mute' | 'ban' | 'quarantine' | 'notify'; export interface ModerationAction { category: ModerationCategory; action: ModerationActionType; threshold: number; } export interface ModerationResult { id: string; messageID: string; threadID: string; senderID: string; content: string; flagged: boolean; categories: ModerationCategoryResult[]; overallScore: number; action: ModerationActionType | null; actionTaken: boolean; timestamp: number; reviewedBy?: string; reviewedAt?: number; status: 'pending' | 'approved' | 'rejected' | 'auto_resolved'; } export interface ModerationCategoryResult { category: ModerationCategory; score: number; flagged: boolean; details?: string; } export interface ModerationStats { totalChecked: number; totalFlagged: number; totalApproved: number; totalRejected: number; byCategory: Record; byAction: Record; avgProcessingTime: number; falsePositiveRate: number; } export interface ModerationQueue { items: ModerationResult[]; totalCount: number; pendingCount: number; } export interface EncryptionConfig { enabled: boolean; algorithm: 'aes-256-gcm' | 'chacha20-poly1305'; keyExchange: 'ecdh' | 'x25519'; autoRotateKeys: boolean; rotationInterval?: number; verifyIdentity?: boolean; } export interface EncryptionKeyPair { publicKey: string; privateKey: string; createdAt: number; expiresAt?: number; keyId: string; } export interface EncryptedThread { threadID: string; enabled: boolean; keyPair: EncryptionKeyPair; participantKeys: Record; lastRotation: number; verificationStatus: 'pending' | 'verified' | 'failed'; } export interface EncryptedPayload { ciphertext: string; nonce: string; tag: string; keyId: string; timestamp: number; } export interface EncryptionStatus { threadID: string; enabled: boolean; verified: boolean; lastKeyRotation: number; participantCount: number; allParticipantsVerified: boolean; } export interface BotMarketplaceConfig { enabled: boolean; allowExternalBots?: boolean; maxInstalledBots?: number; autoUpdate?: boolean; sandboxMode?: boolean; } export interface BotListing { id: string; name: string; description: string; author: string; authorID: string; version: string; category: BotCategory; capabilities: BotCapability[]; rating: number; reviewCount: number; installCount: number; price: number; currency: string; verified: boolean; featured: boolean; iconUrl: string; screenshots: string[]; tags: string[]; createdAt: number; updatedAt: number; permissions: BotPermission[]; } export type BotCategory = 'productivity' | 'entertainment' | 'moderation' | 'analytics' | 'games' | 'utilities' | 'social' | 'education' | 'business' | 'other'; export type BotCapability = 'messaging' | 'commands' | 'reactions' | 'media' | 'moderation' | 'analytics' | 'scheduling' | 'webhooks' | 'ai' | 'games'; export type BotPermission = 'read_messages' | 'send_messages' | 'manage_threads' | 'manage_members' | 'access_user_info' | 'access_analytics' | 'manage_settings' | 'external_requests'; export interface InstalledBot { id: string; botID: string; name: string; version: string; installedAt: number; updatedAt: number; enabled: boolean; config: Record; threads: string[]; stats: BotStats; } export interface BotStats { commandsExecuted: number; messagesProcessed: number; errorsCount: number; lastActive: number; uptime: number; } export interface BotReview { id: string; botID: string; userID: string; userName: string; rating: number; review: string; createdAt: number; helpful: number; reported: boolean; } export interface BotSearchOptions { query?: string; category?: BotCategory; capabilities?: BotCapability[]; minRating?: number; maxPrice?: number; verified?: boolean; sortBy?: 'rating' | 'installs' | 'newest' | 'price'; limit?: number; offset?: number; } export interface WebhookTransformConfig { enabled: boolean; transformations: WebhookTransformation[]; errorHandling: 'skip' | 'abort' | 'fallback'; fallbackPayload?: any; logging?: boolean; } export interface WebhookTransformation { id: string; name: string; webhookID?: string; eventTypes?: WebhookEventType[]; priority: number; enabled: boolean; type: 'map' | 'filter' | 'enrich' | 'custom'; config: TransformationConfig; } export interface TransformationConfig { mappings?: FieldMapping[]; filters?: TransformFilter[]; enrichments?: Enrichment[]; customFunction?: string; template?: string; } export interface FieldMapping { source: string; target: string; transform?: 'uppercase' | 'lowercase' | 'trim' | 'hash' | 'mask' | 'custom'; defaultValue?: any; } export interface TransformFilter { field: string; operator: 'eq' | 'neq' | 'gt' | 'lt' | 'contains' | 'matches' | 'exists'; value: any; action: 'include' | 'exclude'; } export interface Enrichment { field: string; source: 'user_info' | 'thread_info' | 'timestamp' | 'custom'; value?: any; } export interface TransformationResult { transformationID: string; success: boolean; originalPayload: any; transformedPayload: any; error?: string; processingTime: number; } //# sourceMappingURL=index.d.ts.map