A Vue app that displays bluesky skeets in realtime as they are created.
at main 77 lines 2.3 kB view raw
1import { type UriCid } from './post' 2 3/** 4 * Represents a message received over WebSocket. 5 * 6 * - `did`: The Decentralized Identifier (DID) of the entity that created or owns the data. 7 * - `time_us`: A timestamp in microseconds. 8 * - `kind`: A string indicating the kind of message. 9 * - `commit`: An object containing information about a particular commit or record creation event. 10 * - `rev`: The revision identifier of the commit. 11 * - `operation`: The type of operation performed (e.g., "create", "update", etc.). 12 * - `collection`: The name of the collection that the record belongs to. 13 * - `rkey`: The record key within the collection. 14 * - `record`: An object describing the record itself. 15 * - `'$type'`: The record's type. 16 * - `createdAt`: A timestamp indicating when the record was created. 17 * - `subject`: A string associated with the record, often referencing another entity. 18 * - `reply`: Optional object containing `root` and `parent` references (both `UriCid`) 19 * if the record is a reply to another post. 20 * - `text`: The textual content of the record. 21 * - `cid`: The content identifier (CID) of the commit. 22 */ 23export type WebsocketMessage = { 24 at_uri: string 25 did: string 26 time_us: number 27 message: { 28 did: string 29 time_us: number 30 kind: string 31 commit: { 32 rev: string 33 operation: string 34 collection: string 35 rkey: string 36 record: { 37 $type: string 38 createdAt: string 39 subject: string 40 reply?: { 41 root: UriCid 42 parent: UriCid 43 } 44 text: string 45 embed: unknown 46 } 47 cid: string 48 } 49 } 50 hydrated_metadata: { 51 user: { 52 did: string 53 handle: string 54 avatar: string 55 banner: string 56 created_at: string 57 description: string 58 display_name: string 59 followers_count: number 60 follows_count: number 61 indexed_at: string 62 labels: [] 63 posts_count: number 64 verification: unknown 65 viewer: { 66 blocked_by: boolean 67 blocking: boolean 68 blocking_by_list: boolean 69 followed_by: boolean 70 following: boolean 71 known_followers: boolean 72 muted: boolean 73 muted_by_list: boolean 74 } 75 } 76 } 77}