rooms-kit / src / ardegazu / rooms / lib / protocol.cljs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;; ported-from: src/lib/protocol.ts @ v1.0.0
;;
;; Wire types shared by the p2p lib. See chat/docs/PROTOCOL.md.
;;
;; The TypeScript original was TYPES ONLY — ClientFrame/ServerFrame,
;; SignalPayload, PeerConnState, LegacyMsg and LogOp — so it compiled to an empty
;; module and `dist/lib/protocol.js` was `export {};`. There is nothing to run
;; here; the shapes now live in types/index.d.ts for TS consumers, and the
;; documentation of them lives in this comment so the tree still maps 1:1 to the
;; original.
;;
;;   ClientFrame   {t:"join"|"signal"|"leave"|"ping", …}
;;   ServerFrame   {t:"peers"|"peer-joined"|"peer-left"|"signal"|"pong"|"error", …}
;;   SignalPayload {kind:"offer"|"answer"|"ice", …}
;;   PeerConnState "connecting" | "direct" | "relayed" | "disconnected"
;;
;;   LogOp — v2 replicated-log operations, the post-decryption payloads of
;;   OrbitDB entries. Message ids are entry hashes (CIDs); thread/target
;;   reference them. Key order below is the order the appenders build them in
;;   (see lib/crypto's note on js-obj key order, and test/vectors/protocol.json):
;;     {t:"chat",   ts, name, text, thread?}
;;     {t:"img",    ts, name, cid, mime, bytes, w, h, thread?}
;;     {t:"react",  ts, name, target, emoji, op:"add"|"remove"}
;;     {t:"name",   ts, name}
;;     {t:"call",   ts, name}
;;     {t:"legacy", ts, msgs:[{lid, from, name, ts, text?, thread?, rx?}]}
;;   The board fork adds {t:"add"|"edit"|"del", …} (see lib/board).
(ns ardegazu.rooms.lib.protocol)

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/rooms-kit.git