@mica/sdk (SDK contract v1)
    Preparing search index...

    Interface UIMessage

    interface UIMessage {
        attachments?: { id?: number; media?: MediaPreview; photo_id?: number }[];
        conversation_id: number;
        created_at: string | Date;
        edited?: boolean;
        external_sender?: string | null;
        id: number;
        message: string;
        mine: boolean;
        reply_to_id?: number | null;
        replyToMsg?: UIMessage | null;
        sender: "other" | "me";
        sender_id: number | null;
        status?: "active" | "deleted" | "moderated";
        updated_at: string | Date;
    }

    Hierarchy

    • Message
      • UIMessage
    Index
    attachments?: { id?: number; media?: MediaPreview; photo_id?: number }[]

    photo_id on the way in, media on the way back.

    It used to be a bare base64 string, which made every attachment a photo by construction — a voice note or a GIF had nowhere to say what it was. media is a projection rather than the whole row for a reason that is not tidiness: a conversation is shared, so embedding the uploader's citizenid would hand it to every other participant. Same reasoning as publicColumns on a public read (§10).

    conversation_id: number
    created_at: string | Date
    edited?: boolean

    Whether the sender has rewritten this since sending it.

    Derived, never stored — MessageRepository.findByConversation computes updated_at > created_at in SQL, off the ON UPDATE CURRENT_TIMESTAMP the column already carries. Optional because a freshly-sent row has never been edited and the send path has no reason to say so.

    external_sender?: string | null

    Who sent this, when it was not a player (MICA-223): the label a resource gave SendMessage -- a business name, or the number it registered. Null, and absent from the wire, for a message a player wrote.

    id: number
    message: string
    mine: boolean

    Whether the reader sent this. False for a text from a line, which arrives on their row.

    reply_to_id?: number | null
    replyToMsg?: UIMessage | null
    sender: "other" | "me"
    sender_id: number | null

    The Participant.id of the member who sent it, in this thread; null for a text from a line and for a sender who has since left the thread.

    status?: "active" | "deleted" | "moderated"
    updated_at: string | Date