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

    Interface UIConversation

    The conversation and message shapes Facets['messages'] hands an app. MICA-172 — see ./accounts.ts.

    Both extend a @mica/shared/types row the SDK already imports, so moving them in acquired no new dependency: the wire shape stays shared with server/, and what is added here is the UI's own projection of it.

    Nobody else's identity is in either (MICA-339). A conversation carries no creator citizenid and no participant_a/participant_b; each of participants is the number on the phone in the thread (phone) and whether it is the reader's own (self); a message says whether the reader sent it (mine) and which member did (sender_id, a participants[].id) instead of carrying the sender's citizenid. A name is the reader's own contact for that number, or the number.

    interface UIConversation {
        absent_number?: string | null;
        archived_at?: string | Date | null;
        created_at: string | Date;
        id: number;
        is_group: boolean;
        last_message?: Pick<
            Message,
            "message"
            | "created_at"
            | "mine"
            | "sender_id"
            | "external_sender",
        >;
        lastMessage: string;
        lastMessageAt: string;
        name?: string;
        participant_count?: number;
        participants?: Participant[];
        status?: "active" | "deleted" | "moderated" | "archived";
        target: string;
        targetAvatar?: string;
        targetName: string;
        unread_count?: number;
        unreadCount: number;
        updated_at: string | Date;
    }

    Hierarchy

    • Conversation
      • UIConversation
    Index
    absent_number?: string | null

    The number on the other side of a 1:1 nobody else is in (MICA-350): the phone that left it, or was taken out of it by a privacy delete, or a number nobody held when the thread was started. No live member is there to carry it, so without this the reader sees no number at all. Absent on a group, a line thread, and a 1:1 both sides are still in.

    archived_at?: string | Date | null

    When the caller archived it for themselves; null while it is in the inbox.

    created_at: string | Date
    id: number
    is_group: boolean
    last_message?: Pick<
        Message,
        "message"
        | "created_at"
        | "mine"
        | "sender_id"
        | "external_sender",
    >

    The newest live message, as much of it as the inbox row draws.

    lastMessage: string
    lastMessageAt: string
    name?: string

    A name a member chose (a group's), or a line's label. Never a directory name for a number.

    participant_count?: number

    How many live members the thread has, the caller included.

    participants?: Participant[]
    status?: "active" | "deleted" | "moderated" | "archived"
    target: string
    targetAvatar?: string
    targetName: string
    unread_count?: number
    unreadCount: number
    updated_at: string | Date