from dataclasses import dataclass from typing import Optional @dataclass class ContactSummary: phone: str name: str mode: str secure_state: str has_peer_key: bool last_message_preview: str = "" @dataclass class ContactDetails: phone: str name: str mode: str secure_state: str peer_fingerprint: Optional[str] has_peer_key: bool last_secure_at: Optional[str] @dataclass class MessageView: id: int phone: str direction: str body: str mode: str transport_state: str created_at: str @dataclass class SecureEventView: created_at: str event_type: str phone: str details: str @dataclass class PendingPacketView: phone: str packet_id: str packet_kind: str packet_mode: Optional[str] received_parts: int total_parts: int first_seen: str