···1919//
2020// RECORDTYPE: RepoApplyWrites_Create
2121type RepoApplyWrites_Create struct {
2222- LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#create" cborgen:"$type,const=com.atproto.repo.applyWrites#create"`
2323- Collection string `json:"collection" cborgen:"collection"`
2424- Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
2525- Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
2222+ LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#create" cborgen:"$type,const=com.atproto.repo.applyWrites#create"`
2323+ Collection string `json:"collection" cborgen:"collection"`
2424+ // rkey: NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.
2525+ Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
2626+ Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
2627}
27282829// RepoApplyWrites_CreateResult is a "createResult" in the com.atproto.repo.applyWrites schema.
+26-12
api/atproto/syncsubscribeRepos.go
···2626// 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.
2727type SyncSubscribeRepos_Commit struct {
2828 Blobs []util.LexLink `json:"blobs" cborgen:"blobs"`
2929- // blocks: CAR file containing relevant blocks, as a diff since the previous repo state.
2929+ // 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.
3030 Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"`
3131 // commit: Repo commit object CID.
3232- Commit util.LexLink `json:"commit" cborgen:"commit"`
3333- // prevData
3434- PrevData *util.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"`
3535- Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"`
3636- // prev: DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability.
3737- Prev *util.LexLink `json:"prev" cborgen:"prev"`
3232+ Commit util.LexLink `json:"commit" cborgen:"commit"`
3333+ Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"`
3434+ // 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.
3535+ PrevData *util.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"`
3836 // rebase: DEPRECATED -- unused
3937 Rebase bool `json:"rebase" cborgen:"rebase"`
4040- // repo: The repo this event comes from.
3838+ // repo: The repo this event comes from. Note that all other message types name this field 'did'.
4139 Repo string `json:"repo" cborgen:"repo"`
4240 // 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.
4341 Rev string `json:"rev" cborgen:"rev"`
···4745 Since *string `json:"since" cborgen:"since"`
4846 // time: Timestamp of when this message was originally broadcast.
4947 Time string `json:"time" cborgen:"time"`
5050- // tooBig: 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.
4848+ // 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.
5149 TooBig bool `json:"tooBig" cborgen:"tooBig"`
5250}
5351···9492type SyncSubscribeRepos_RepoOp struct {
9593 Action string `json:"action" cborgen:"action"`
9694 // cid: For creates and updates, the new record CID. For deletions, null.
9797- Cid *util.LexLink `json:"cid" cborgen:"cid"`
9898- // prev
9595+ Cid *util.LexLink `json:"cid" cborgen:"cid"`
9696+ Path string `json:"path" cborgen:"path"`
9797+ // prev: For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined.
9998 Prev *util.LexLink `json:"prev,omitempty" cborgen:"prev,omitempty"`
100100- Path string `json:"path" cborgen:"path"`
9999+}
100100+101101+// SyncSubscribeRepos_Sync is a "sync" in the com.atproto.sync.subscribeRepos schema.
102102+//
103103+// 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.
104104+type SyncSubscribeRepos_Sync struct {
105105+ // blocks: CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.
106106+ Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"`
107107+ // did: The account this repo event corresponds to. Must match that in the commit object.
108108+ Did string `json:"did" cborgen:"did"`
109109+ // rev: The rev of the commit. This value must match that in the commit object.
110110+ Rev string `json:"rev" cborgen:"rev"`
111111+ // seq: The stream sequence number of this message.
112112+ Seq int64 `json:"seq" cborgen:"seq"`
113113+ // time: Timestamp of when this message was originally broadcast.
114114+ Time string `json:"time" cborgen:"time"`
101115}
102116103117// SyncSubscribeRepos_Tombstone is a "tombstone" in the com.atproto.sync.subscribeRepos schema.
+32
api/chat/convoacceptConvo.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package chat
44+55+// schema: chat.bsky.convo.acceptConvo
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// ConvoAcceptConvo_Input is the input argument to a chat.bsky.convo.acceptConvo call.
1414+type ConvoAcceptConvo_Input struct {
1515+ ConvoId string `json:"convoId" cborgen:"convoId"`
1616+}
1717+1818+// ConvoAcceptConvo_Output is the output of a chat.bsky.convo.acceptConvo call.
1919+type ConvoAcceptConvo_Output struct {
2020+ // rev: Rev when the convo was accepted. If not present, the convo was already accepted.
2121+ Rev *string `json:"rev,omitempty" cborgen:"rev,omitempty"`
2222+}
2323+2424+// ConvoAcceptConvo calls the XRPC method "chat.bsky.convo.acceptConvo".
2525+func ConvoAcceptConvo(ctx context.Context, c *xrpc.Client, input *ConvoAcceptConvo_Input) (*ConvoAcceptConvo_Output, error) {
2626+ var out ConvoAcceptConvo_Output
2727+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.acceptConvo", nil, input, &out); err != nil {
2828+ return nil, err
2929+ }
3030+3131+ return &out, nil
3232+}
+64-1
api/chat/convodefs.go
···1818 LastMessage *ConvoDefs_ConvoView_LastMessage `json:"lastMessage,omitempty" cborgen:"lastMessage,omitempty"`
1919 Members []*ActorDefs_ProfileViewBasic `json:"members" cborgen:"members"`
2020 Muted bool `json:"muted" cborgen:"muted"`
2121- Opened *bool `json:"opened,omitempty" cborgen:"opened,omitempty"`
2221 Rev string `json:"rev" cborgen:"rev"`
2222+ Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
2323 UnreadCount int64 `json:"unreadCount" cborgen:"unreadCount"`
2424}
2525···6767 Rev string `json:"rev" cborgen:"rev"`
6868 Sender *ConvoDefs_MessageViewSender `json:"sender" cborgen:"sender"`
6969 SentAt string `json:"sentAt" cborgen:"sentAt"`
7070+}
7171+7272+// ConvoDefs_LogAcceptConvo is a "logAcceptConvo" in the chat.bsky.convo.defs schema.
7373+//
7474+// RECORDTYPE: ConvoDefs_LogAcceptConvo
7575+type ConvoDefs_LogAcceptConvo struct {
7676+ LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logAcceptConvo" cborgen:"$type,const=chat.bsky.convo.defs#logAcceptConvo"`
7777+ ConvoId string `json:"convoId" cborgen:"convoId"`
7878+ Rev string `json:"rev" cborgen:"rev"`
7079}
71807281// ConvoDefs_LogBeginConvo is a "logBeginConvo" in the chat.bsky.convo.defs schema.
···175184 LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logLeaveConvo" cborgen:"$type,const=chat.bsky.convo.defs#logLeaveConvo"`
176185 ConvoId string `json:"convoId" cborgen:"convoId"`
177186 Rev string `json:"rev" cborgen:"rev"`
187187+}
188188+189189+// ConvoDefs_LogMuteConvo is a "logMuteConvo" in the chat.bsky.convo.defs schema.
190190+type ConvoDefs_LogMuteConvo struct {
191191+ ConvoId string `json:"convoId" cborgen:"convoId"`
192192+ Rev string `json:"rev" cborgen:"rev"`
193193+}
194194+195195+// ConvoDefs_LogReadMessage is a "logReadMessage" in the chat.bsky.convo.defs schema.
196196+type ConvoDefs_LogReadMessage struct {
197197+ ConvoId string `json:"convoId" cborgen:"convoId"`
198198+ Message *ConvoDefs_LogReadMessage_Message `json:"message" cborgen:"message"`
199199+ Rev string `json:"rev" cborgen:"rev"`
200200+}
201201+202202+type ConvoDefs_LogReadMessage_Message struct {
203203+ ConvoDefs_MessageView *ConvoDefs_MessageView
204204+ ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView
205205+}
206206+207207+func (t *ConvoDefs_LogReadMessage_Message) MarshalJSON() ([]byte, error) {
208208+ if t.ConvoDefs_MessageView != nil {
209209+ t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView"
210210+ return json.Marshal(t.ConvoDefs_MessageView)
211211+ }
212212+ if t.ConvoDefs_DeletedMessageView != nil {
213213+ t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView"
214214+ return json.Marshal(t.ConvoDefs_DeletedMessageView)
215215+ }
216216+ return nil, fmt.Errorf("cannot marshal empty enum")
217217+}
218218+func (t *ConvoDefs_LogReadMessage_Message) UnmarshalJSON(b []byte) error {
219219+ typ, err := util.TypeExtract(b)
220220+ if err != nil {
221221+ return err
222222+ }
223223+224224+ switch typ {
225225+ case "chat.bsky.convo.defs#messageView":
226226+ t.ConvoDefs_MessageView = new(ConvoDefs_MessageView)
227227+ return json.Unmarshal(b, t.ConvoDefs_MessageView)
228228+ case "chat.bsky.convo.defs#deletedMessageView":
229229+ t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView)
230230+ return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView)
231231+232232+ default:
233233+ return nil
234234+ }
235235+}
236236+237237+// ConvoDefs_LogUnmuteConvo is a "logUnmuteConvo" in the chat.bsky.convo.defs schema.
238238+type ConvoDefs_LogUnmuteConvo struct {
239239+ ConvoId string `json:"convoId" cborgen:"convoId"`
240240+ Rev string `json:"rev" cborgen:"rev"`
178241}
179242180243// ConvoDefs_MessageInput is the input argument to a chat.bsky.convo.defs call.
+31
api/chat/convogetConvoAvailability.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package chat
44+55+// schema: chat.bsky.convo.getConvoAvailability
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// ConvoGetConvoAvailability_Output is the output of a chat.bsky.convo.getConvoAvailability call.
1414+type ConvoGetConvoAvailability_Output struct {
1515+ CanChat bool `json:"canChat" cborgen:"canChat"`
1616+ Convo *ConvoDefs_ConvoView `json:"convo,omitempty" cborgen:"convo,omitempty"`
1717+}
1818+1919+// ConvoGetConvoAvailability calls the XRPC method "chat.bsky.convo.getConvoAvailability".
2020+func ConvoGetConvoAvailability(ctx context.Context, c *xrpc.Client, members []string) (*ConvoGetConvoAvailability_Output, error) {
2121+ var out ConvoGetConvoAvailability_Output
2222+2323+ params := map[string]interface{}{
2424+ "members": members,
2525+ }
2626+ if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getConvoAvailability", params, nil, &out); err != nil {
2727+ return nil, err
2828+ }
2929+3030+ return &out, nil
3131+}
···222222 fmt.Printf("\nEvent at sequence %d had an invalid repo slice: %s\n", evt.Seq, err)
223223 return nil
224224 } else {
225225+ _ = r
226226+ /* "prev" is no longer included in #commit messages
225227 prev, err := r.PrevCommit(ctx)
226228 if err != nil {
227229 return err
···239241 if !evt.Rebase && cs != es {
240242 fmt.Printf("\nEvent at sequence %d has mismatch between slice prev and struct prev: %s != %s\n", evt.Seq, prev, evt.Prev)
241243 }
244244+ */
242245 }
243246 }
244247···345348346349 for i, ev := range slice {
347350 if ev.Commit == event.Commit {
351351+ _ = pll
352352+ /* TODO: prev is no longer included in #commit messages; could use prevData or rev?
348353 if pll(ev.Prev) != pll(event.Prev) {
349354 // same commit different prev??
350355 return nil, fmt.Errorf("matched event with same commit but different prev: (%d) %d - %d", n, ev.Seq, event.Seq)
351356 }
357357+ */
352358 }
353359354360 if i != 0 {