/** * Slack Web API operation enum — single source of truth across the * api, dashboard, and downstream consumers (Message Broker, MCP server). * Used by: * - slackAction entity / DTO (api): operation field + validation * - dashboard SlackAction operation picker + form generation * - MCP toolkit-specs expansion (one aiEnabled slackAction → N tools) * * v1 covers 16 ops — messaging, channel CRUD, members, reactions, files. * Future additions (pin / unpin, files.list, conversations.archive, app * publish, scheduled.list, etc.) extend this list — bump the package and * re-install in consumers, same pattern as Gmail / Calendar / Discord. */ import { type CapacidadesPorCredencial } from './capacidad-de-credencial.js'; export declare const SLACK_OPERATIONS: readonly ["sendMessage", "updateMessage", "deleteMessage", "sendEphemeral", "scheduleMessage", "getMessage", "listChannels", "getChannelHistory", "getThreadReplies", "createChannel", "inviteToChannel", "addReaction", "removeReaction", "listUsers", "getUserInfo", "uploadFile", "updateProfile", "createUser", "updateUser", "deleteUser"]; export type SlackOperation = (typeof SLACK_OPERATIONS)[number]; /** Type guard — useful when validating untrusted input (DTOs, AI tool calls). */ export declare function isSlackOperation(value: unknown): value is SlackOperation; /** * Per-operation parameter schema. Drives: * 1. Form auto-generation in the SlackAction detail page (dashboard). * 2. AI tool argument schema when `aiEnabled === true`. * 3. MCP tools/list expansion (one slackAction → N MCP tools). * * Field types kept narrow on purpose so the dashboard form picker can * render the right control (channel-picker vs free text vs number). * The api side `SlackOperationsService` accepts the same shapes. */ export interface SlackParamSpec { /** Field key — also the property name on operationConfig / payload. */ name: string; /** UI label. */ label: string; /** Param type for form rendering + AI tool schema. */ type: 'channel' | 'user' | 'string' | 'text' | 'number' | 'boolean' | 'emoji' | 'blocks' | 'json' | 'fileUrl'; /** Required at submit time. */ required?: boolean; /** Human description — also used as the AI tool param description. */ description: string; /** Hint shown under the input. */ placeholder?: string; } export interface SlackOperationSpec { /** UI label for the operation picker. */ label: string; /** Description shown in the picker + reused by the AI tool description * when the user hasn't set a custom one on the entity. */ description: string; /** Verb the operation maps to in Slack's docs (slack.com/methods/...). */ apiMethod: string; /** Parameter schema. Order matters for form rendering. */ params: SlackParamSpec[]; } export declare const SLACK_OPERATION_SPECS: Record; /** * Lo que puede hacer una credencial de Slack que NO es OAuth. * * Medido contra la documentación de Slack, no de memoria: * https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks * * Es el caso extremo, y conviene que se lea así de crudo: **una** operación de * las 16. Un incoming webhook publica y nada más. Textualmente: «Incoming * webhooks do not allow you to delete a message after it's been posted», no * lee, no sube ficheros, y editar exige `chat.update`, que es token. * * Y el campo que se cae es el que más duele, porque no parece una restricción * hasta que lo es: **`channel` no se puede elegir**. «You cannot override the * default channel (chosen by the user who installed your app)». El destino se * decide al crear la credencial, así que ofrecer el campo sería ofrecer una * pregunta cuya respuesta se ignora — que es peor que no ofrecerla. * * `text` y `blocks` se quedan (Block Kit está soportado), y `threadTs` también: * la doc lo admite si ya tienes el `ts` del padre por otra vía. */ export declare const SLACK_CAPACIDADES_POR_CREDENCIAL: CapacidadesPorCredencial; /** Las operaciones que ofrecer para una credencial de Slack. */ export declare function operacionesDeSlackPara(tipoDeCredencial: string | null | undefined): readonly SlackOperation[]; /** Si esa credencial puede ejecutar esa operación de Slack. */ export declare function slackPuedeEjecutar(tipoDeCredencial: string | null | undefined, operacion: SlackOperation): boolean; /** Los campos que esa credencial de Slack no deja elegir. */ export declare function camposDeSlackNoDisponibles(tipoDeCredencial: string | null | undefined): ReadonlySet;