/** * Slack Integration Service * * Simplified service that properly uses the official Slack SDK libraries: * - @slack/oauth InstallProvider for OAuth flow management * - @slack/web-api WebClient for Slack API operations * - Metadata-based project-to-team mapping */ import { WebClient } from "@slack/web-api"; import { InstallProvider } from "@slack/oauth"; export interface SlackChannel { id: string; name: string; isPrivate: boolean; isMember: boolean; } export interface SlackMessageParams { client: WebClient; channelId: string; blocks: any[]; text?: string; } export interface SlackMessageResponse { messageTs: string; channel: string; } export interface SlackInstallationMetadata { projectId: string; } /** * Helper function to safely parse and validate Slack installation metadata */ export declare function parseSlackInstallationMetadata(metadata: unknown): SlackInstallationMetadata; /** * Slack Service Class * * Uses InstallProvider for OAuth flow and metadata-based project mapping. * Much simpler than the previous implementation while maintaining all functionality. */ export declare class SlackService { private static instance; private readonly installer; private constructor(); /** * Get singleton instance of SlackService */ static getInstance(): SlackService; /** * Get the configured InstallProvider instance for OAuth handling */ getInstaller(): InstallProvider; /** * Reset the singleton instance (useful for testing) */ static resetInstance(): void; /** * Delete Slack integration for a project */ deleteIntegration(projectId: string): Promise; /** * Get WebClient for a specific project */ getWebClientForProject(projectId: string): Promise; /** * Recursively fetch all channels accessible to the bot * Uses cursor-based pagination defined by Slack API https://api.slack.com/apis/pagination */ private getChannelsRecursive; /** * Get channels accessible to the bot */ getChannels(client: WebClient): Promise; /** * Send a message to a Slack channel */ sendMessage(params: SlackMessageParams): Promise; /** * Validate a WebClient instance */ validateClient(client: WebClient): Promise; } //# sourceMappingURL=SlackService.d.ts.map