import { normalizeTrelloBoardId, TRELLO_TRIGGER_CONFIG_SCHEMA, } from "@automate.ax/integration-contracts/trello" import type { IntegrationAccountReference } from "../../../automation/integrations" /** Board and account selection shared by Trello board subscriptions. */ export interface TrelloBoardTriggerOptions { /** Trello account binding that can access the board. */ account?: string | IntegrationAccountReference<"trello"> /** Trello board ID, short link, or standard board URL. */ board: string } /** * Converts public board selection to canonical subscription configuration. * * @param options - Board and Trello account selection. */ export function getTrelloTriggerConfig(options: TrelloBoardTriggerOptions) { return { account: options.account, boardId: TRELLO_TRIGGER_CONFIG_SCHEMA.shape.boardId.parse( normalizeTrelloBoardId(options.board), ), } }