import type { ChatSendInput } from '../../types'; /** * Google-Chat-narrowed extension of `ChatSendInput`. `to` is omitted * the webhook URL itself targets the space, so there is no separate * recipient parameter. Baseline `body` and `_passthrough?` are preserved. * * Per the >=90% baseline-coverage rule, the 3 narrowed fields cover * Google Chat's most-common Incoming Webhook request parameters. Anything else * flows through `_passthrough`. */ export interface GoogleChatNarrowedInput extends Omit { /** Cards v2 — Google Chat's current canonical rich-content format. */ cardsV2?: GoogleChatCardV2[]; /** Wire key `thread.name` (message threading inside a space). */ thread?: { name: string; }; /** * Wire key `fallbackText` (camelCase per Google Chat REST API as of * 2024-2025). Accessibility / screen-reader fallback when only cards present. */ fallbackText?: string; } export interface GoogleChatCardV2 { cardId: string; card: GoogleChatCard; } export interface GoogleChatCard { header?: { title?: string; subtitle?: string; imageUrl?: string; imageType?: 'SQUARE' | 'CIRCLE'; imageAltText?: string; }; sections?: Array<{ header?: string; collapsible?: boolean; uncollapsibleWidgetsCount?: number; widgets?: Array>; }>; cardActions?: Array<{ actionLabel: string; onClick: Record; }>; name?: string; } /** * Google Chat returns full JSON on success (unlike Slack/MS Teams which return * plain text). The `name` field is the full resource name * `'spaces//messages/'` — the connector surfaces this * verbatim on `providerMessageId`. */ export interface GoogleChatSendResponse { name?: string; sender?: { name: string; type?: 'HUMAN' | 'BOT'; }; text?: string; thread?: { name: string; }; createTime?: string; [k: string]: unknown; }