/** * Chat Notifications * * Sends certification notifications to Slack, Microsoft Teams, and Discord. * Supports rich message formatting with findings summaries. * * @module enterprise/integrations/chat */ import type { Finding, Severity } from "../../certification/types.js"; /** * Supported chat platforms */ export type ChatPlatform = "slack" | "teams" | "discord"; /** * Base chat configuration */ export interface ChatConfig { /** Platform type */ platform: ChatPlatform; /** Webhook URL */ webhookUrl: string; /** Default channel/thread (optional) */ defaultChannel?: string; /** Include signed link to full report */ includeReportLink?: boolean; } /** * Certification notification payload */ export interface CertificationNotification { /** Certification ID */ certificationId: string; /** Target being certified */ target: string; /** Certification status */ status: "started" | "completed" | "failed"; /** Certification score (0-100) */ score?: number; /** Grade (A-F) */ grade?: string; /** Findings summary */ findings?: FindingsSummary; /** Link to full report */ reportUrl?: string; /** Additional context */ metadata?: Record; } /** * Findings summary for notifications */ export interface FindingsSummary { total: number; critical: number; high: number; medium: number; low: number; info: number; topFindings?: Array<{ id: string; severity: Severity; description: string; }>; } /** * Notification result */ export interface NotificationResult { success: boolean; platform: ChatPlatform; timestamp: string; error?: string; messageId?: string; } /** * Slack webhook client */ export declare class SlackClient { private webhookUrl; constructor(webhookUrl: string); /** * Send certification notification */ sendNotification(notification: CertificationNotification): Promise; /** * Build Slack blocks */ private buildBlocks; /** * Get status emoji */ private getStatusEmoji; /** * Calculate grade from score */ private calculateGrade; } /** * Microsoft Teams webhook client */ export declare class TeamsClient { private webhookUrl; constructor(webhookUrl: string); /** * Send certification notification */ sendNotification(notification: CertificationNotification): Promise; /** * Build Adaptive Card */ private buildAdaptiveCard; /** * Get status color for Teams */ private getStatusColor; /** * Calculate grade from score */ private calculateGrade; } /** * Discord webhook client */ export declare class DiscordClient { private webhookUrl; constructor(webhookUrl: string); /** * Send certification notification */ sendNotification(notification: CertificationNotification): Promise; /** * Build Discord embed */ private buildEmbed; /** * Get embed color (decimal) */ private getEmbedColor; /** * Calculate grade from score */ private calculateGrade; } /** * Unified chat notification client */ export declare class ChatClient { private client; private platform; constructor(config: ChatConfig); /** * Send certification notification */ sendNotification(notification: CertificationNotification): Promise; /** * Get platform name */ getPlatform(): ChatPlatform; } /** * Multi-platform notification manager */ export declare class MultiPlatformNotifier { private clients; /** * Add a chat platform */ addPlatform(config: ChatConfig): void; /** * Send notification to all platforms */ sendNotification(notification: CertificationNotification): Promise; /** * Send notification from findings */ notifyFindings(certificationId: string, target: string, findings: Finding[], score: number, reportUrl?: string): Promise; /** * Summarize findings */ private summarizeFindings; /** * Calculate grade from score */ private calculateGrade; } /** * Create chat client */ export declare function createChatClient(config: ChatConfig): ChatClient; /** * Create Slack client */ export declare function createSlackClient(webhookUrl: string): SlackClient; /** * Create Teams client */ export declare function createTeamsClient(webhookUrl: string): TeamsClient; /** * Create Discord client */ export declare function createDiscordClient(webhookUrl: string): DiscordClient; /** * Create multi-platform notifier */ export declare function createMultiPlatformNotifier(): MultiPlatformNotifier; //# sourceMappingURL=chat.d.ts.map