diff --git a/src/types/index.ts b/src/types/index.ts index 6069883..63d01d9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -18,7 +18,9 @@ export type NodeType = | "dataInput" | "dataOutput" // Unified database connector - | "database"; + | "database" + // Slack integration + | "slack"; export type NodeStatus = | "idle" diff --git a/src/types/slack.ts b/src/types/slack.ts new file mode 100644 index 0000000..65e2828 --- /dev/null +++ b/src/types/slack.ts @@ -0,0 +1,75 @@ +export type SlackOperation = + | "message" + | "channel" + | "user" + | "file" + | "reaction" + | "reminder"; + +export interface SlackConfig { + // Operation selection + operation: SlackOperation; + + // Authentication + botToken: string; + appToken?: string; // For socket mode + + // Message operation + channel?: string; + text?: string; + blocks?: any[]; + attachments?: any[]; + threadTs?: string; // For replying to threads + replyBroadcast?: boolean; + + // Channel operation + channelName?: string; + channelPurpose?: string; + channelTopic?: string; + isPrivate?: boolean; + inviteUsers?: string[]; + + // User operation + userId?: string; + userEmail?: string; + userPresence?: "auto" | "away"; + + // File operation + fileContent?: string; + fileName?: string; + fileType?: string; + fileTitle?: string; + fileComment?: string; + + // Reaction operation + emoji?: string; + timestamp?: string; + + // Reminder operation + reminderText?: string; + reminderTime?: string; // Unix timestamp or natural language + reminderUser?: string; + + // Advanced options + parse?: "full" | "none"; + linkNames?: boolean; + unfurlLinks?: boolean; + unfurlMedia?: boolean; + username?: string; + iconEmoji?: string; + iconUrl?: string; + asUser?: boolean; +} + +export interface SlackResponse { + success: boolean; + data?: any; + error?: string; + metadata?: { + operation: SlackOperation; + channelId?: string; + messageTs?: string; + userId?: string; + executionTime?: number; + }; +}