Parse firehose message payloads into structured events.
Message types from com.atproto.sync.subscribeRepos:
#commit- Repository commit with record operations#sync- Asserts the current repository state (commit + CAR blocks)#identity- Identity update (DID document and/or handle change)#account- Account hosting status change (active / takendown / suspended / deleted / deactivated)#info- Informational message
The following event types are deprecated by the current sync spec and retained only for backwards compatibility with older relays:
#handle- Handle change (superseded by#identity)#tombstone- Repository deletion (superseded by#account)
Summary
Functions
Decode a message payload based on its type.
Extract records from a commit's CAR blocks.
Filter operations by collection prefix.
Check if a commit contains operations for a specific collection.
Types
@type commit() :: %{ type: :commit, seq: integer(), repo: String.t(), commit: Exosphere.ATProto.CID.t(), rev: String.t(), since: String.t() | nil, prev_data: Exosphere.ATProto.CID.t() | nil, ops: [operation()], blocks: binary(), time: String.t() }
@type operation() :: %{ action: :create | :update | :delete, path: String.t(), cid: Exosphere.ATProto.CID.t() | nil, prev: Exosphere.ATProto.CID.t() | nil }
Functions
Decode a message payload based on its type.
Extract records from a commit's CAR blocks.
Parses the embedded CAR file to extract the actual record data. Returns a list of records with their collection, rkey, cid, and parsed record data.
Filter operations by collection prefix.
Check if a commit contains operations for a specific collection.