A fork of https://github.com/teal-fm/piper
at main 95 lines 5.9 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package atproto 4 5// schema: com.atproto.sync.subscribeRepos 6 7import ( 8 "github.com/bluesky-social/indigo/lex/util" 9) 10 11// SyncSubscribeRepos_Account is a "account" in the com.atproto.sync.subscribeRepos schema. 12// 13// 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. 14type SyncSubscribeRepos_Account struct { 15 // active: Indicates that the account has a repository which can be fetched from the host that emitted this event. 16 Active bool `json:"active" cborgen:"active"` 17 Did string `json:"did" cborgen:"did"` 18 Seq int64 `json:"seq" cborgen:"seq"` 19 // status: If active=false, this optional field indicates a reason for why the account is not active. 20 Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 21 Time string `json:"time" cborgen:"time"` 22} 23 24// SyncSubscribeRepos_Commit is a "commit" in the com.atproto.sync.subscribeRepos schema. 25// 26// 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. 27type SyncSubscribeRepos_Commit struct { 28 Blobs []util.LexLink `json:"blobs" cborgen:"blobs"` 29 // blocks: CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. 30 Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 31 // commit: Repo commit object CID. 32 Commit util.LexLink `json:"commit" cborgen:"commit"` 33 Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"` 34 // prevData: The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. 35 PrevData *util.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"` 36 // rebase: DEPRECATED -- unused 37 Rebase bool `json:"rebase" cborgen:"rebase"` 38 // repo: The repo this event comes from. Note that all other message types name this field 'did'. 39 Repo string `json:"repo" cborgen:"repo"` 40 // rev: 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. 41 Rev string `json:"rev" cborgen:"rev"` 42 // seq: The stream sequence number of this message. 43 Seq int64 `json:"seq" cborgen:"seq"` 44 // since: The rev of the last emitted commit from this repo (if any). 45 Since *string `json:"since" cborgen:"since"` 46 // time: Timestamp of when this message was originally broadcast. 47 Time string `json:"time" cborgen:"time"` 48 // tooBig: DEPRECATED -- replaced by #sync event and data limits. 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. 49 TooBig bool `json:"tooBig" cborgen:"tooBig"` 50} 51 52// SyncSubscribeRepos_Identity is a "identity" in the com.atproto.sync.subscribeRepos schema. 53// 54// 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. 55type SyncSubscribeRepos_Identity struct { 56 Did string `json:"did" cborgen:"did"` 57 // handle: 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. 58 Handle *string `json:"handle,omitempty" cborgen:"handle,omitempty"` 59 Seq int64 `json:"seq" cborgen:"seq"` 60 Time string `json:"time" cborgen:"time"` 61} 62 63// SyncSubscribeRepos_Info is a "info" in the com.atproto.sync.subscribeRepos schema. 64type SyncSubscribeRepos_Info struct { 65 Message *string `json:"message,omitempty" cborgen:"message,omitempty"` 66 Name string `json:"name" cborgen:"name"` 67} 68 69// SyncSubscribeRepos_RepoOp is a "repoOp" in the com.atproto.sync.subscribeRepos schema. 70// 71// A repo operation, ie a mutation of a single record. 72type SyncSubscribeRepos_RepoOp struct { 73 Action string `json:"action" cborgen:"action"` 74 // cid: For creates and updates, the new record CID. For deletions, null. 75 Cid *util.LexLink `json:"cid" cborgen:"cid"` 76 Path string `json:"path" cborgen:"path"` 77 // prev: For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. 78 Prev *util.LexLink `json:"prev,omitempty" cborgen:"prev,omitempty"` 79} 80 81// SyncSubscribeRepos_Sync is a "sync" in the com.atproto.sync.subscribeRepos schema. 82// 83// Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository. 84type SyncSubscribeRepos_Sync struct { 85 // blocks: CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. 86 Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 87 // did: The account this repo event corresponds to. Must match that in the commit object. 88 Did string `json:"did" cborgen:"did"` 89 // rev: The rev of the commit. This value must match that in the commit object. 90 Rev string `json:"rev" cborgen:"rev"` 91 // seq: The stream sequence number of this message. 92 Seq int64 `json:"seq" cborgen:"seq"` 93 // time: Timestamp of when this message was originally broadcast. 94 Time string `json:"time" cborgen:"time"` 95}