···1818}
19192020export interface QueryParams {
2121- /** The last known event to backfill from. */
2121+ /** The last known event seq number to backfill from. */
2222 cursor?: number;
2323}
24242525export type RepoEvent =
2626 | Commit
2727+ | Identity
2828+ | Account
2729 | Handle
2830 | Migrate
2931 | Tombstone
···4143 ctx: HandlerReqCtx<HA>
4244) => AsyncIterable<HandlerOutput>;
43454646+/** Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. */
4447export interface Commit {
4848+ /** The stream sequence number of this message. */
4549 seq: number;
5050+ /** DEPRECATED -- unused */
4651 rebase: boolean;
5252+ /** Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. */
4753 tooBig: boolean;
5454+ /** The repo this event comes from. */
4855 repo: string;
5656+ /** Repo commit object CID. */
4957 commit: CID;
5858+ /** DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability. */
5059 prev?: CID | null;
5151- /** The rev of the emitted commit */
6060+ /** The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. */
5261 rev: string;
5353- /** The rev of the last emitted commit from this repo */
6262+ /** The rev of the last emitted commit from this repo (if any). */
5463 since: string | null;
5555- /** CAR file containing relevant blocks */
6464+ /** CAR file containing relevant blocks, as a diff since the previous repo state. */
5665 blocks: Uint8Array;
5766 ops: RepoOp[];
5867 blobs: CID[];
6868+ /** Timestamp of when this message was originally broadcast. */
5969 time: string;
6070 [k: string]: unknown;
6171}
···6878 );
6979}
70808181+/** Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. */
8282+export interface Identity {
8383+ seq: number;
8484+ did: string;
8585+ time: string;
8686+ /** The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. */
8787+ handle?: string;
8888+ [k: string]: unknown;
8989+}
9090+9191+export function isIdentity(v: unknown): v is Identity {
9292+ return (
9393+ isObj(v) &&
9494+ hasProp(v, "$type") &&
9595+ v.$type === "com.atproto.sync.subscribeRepos#identity"
9696+ );
9797+}
9898+9999+/** Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. */
100100+export interface Account {
101101+ seq: number;
102102+ did: string;
103103+ time: string;
104104+ /** Indicates that the account has a repository which can be fetched from the host that emitted this event. */
105105+ active: boolean;
106106+ /** If active=false, this optional field indicates a reason for why the account is not active. */
107107+ status?:
108108+ | "takendown"
109109+ | "suspended"
110110+ | "deleted"
111111+ | "deactivated"
112112+ | (string & {});
113113+ [k: string]: unknown;
114114+}
115115+116116+export function isAccount(v: unknown): v is Account {
117117+ return (
118118+ isObj(v) &&
119119+ hasProp(v, "$type") &&
120120+ v.$type === "com.atproto.sync.subscribeRepos#account"
121121+ );
122122+}
123123+124124+/** DEPRECATED -- Use #identity event instead */
71125export interface Handle {
72126 seq: number;
73127 did: string;
···84138 );
85139}
86140141141+/** DEPRECATED -- Use #account event instead */
87142export interface Migrate {
88143 seq: number;
89144 did: string;
···100155 );
101156}
102157158158+/** DEPRECATED -- Use #account event instead */
103159export interface Tombstone {
104160 seq: number;
105161 did: string;
···129185 );
130186}
131187132132-/** A repo operation, ie a write of a single record. For creates and updates, cid is the record's CID as of this operation. For deletes, it's null. */
188188+/** A repo operation, ie a mutation of a single record. */
133189export interface RepoOp {
134190 action: "create" | "update" | "delete" | (string & {});
135191 path: string;
192192+ /** For creates and updates, the new record CID. For deletions, null. */
136193 cid: CID | null;
137194 [k: string]: unknown;
138195}