this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Chat types

+1038
+1
Makefile
··· 70 70 go run ./cmd/lexgen/ --package bsky --prefix app.bsky --outdir api/bsky $(LEXDIR) 71 71 go run ./cmd/lexgen/ --package atproto --prefix com.atproto --outdir api/atproto $(LEXDIR) 72 72 go run ./cmd/lexgen/ --package ozone --prefix tools.ozone --outdir api/ozone $(LEXDIR) 73 + go run ./cmd/lexgen/ --package chat --prefix chat.bsky --outdir api/chat $(LEXDIR) 73 74 74 75 .PHONY: cborgen 75 76 cborgen: ## Run codegen tool for CBOR serialization
+18
api/chat/actordeclaration.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.actor.declaration 6 + 7 + import ( 8 + "github.com/bluesky-social/indigo/lex/util" 9 + ) 10 + 11 + func init() { 12 + util.RegisterType("chat.bsky.actor.declaration", &ActorDeclaration{}) 13 + } // 14 + // RECORDTYPE: ActorDeclaration 15 + type ActorDeclaration struct { 16 + LexiconTypeID string `json:"$type,const=chat.bsky.actor.declaration" cborgen:"$type,const=chat.bsky.actor.declaration"` 17 + AllowIncoming string `json:"allowIncoming" cborgen:"allowIncoming"` 18 + }
+145
api/chat/cbor_gen.go
··· 1 + // Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. 2 + 3 + package chat 4 + 5 + import ( 6 + "fmt" 7 + "io" 8 + "math" 9 + "sort" 10 + 11 + cid "github.com/ipfs/go-cid" 12 + cbg "github.com/whyrusleeping/cbor-gen" 13 + xerrors "golang.org/x/xerrors" 14 + ) 15 + 16 + var _ = xerrors.Errorf 17 + var _ = cid.Undef 18 + var _ = math.E 19 + var _ = sort.Sort 20 + 21 + func (t *ActorDeclaration) MarshalCBOR(w io.Writer) error { 22 + if t == nil { 23 + _, err := w.Write(cbg.CborNull) 24 + return err 25 + } 26 + 27 + cw := cbg.NewCborWriter(w) 28 + 29 + if _, err := cw.Write([]byte{162}); err != nil { 30 + return err 31 + } 32 + 33 + // t.LexiconTypeID (string) (string) 34 + if len("$type") > 1000000 { 35 + return xerrors.Errorf("Value in field \"$type\" was too long") 36 + } 37 + 38 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 39 + return err 40 + } 41 + if _, err := cw.WriteString(string("$type")); err != nil { 42 + return err 43 + } 44 + 45 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("chat.bsky.actor.declaration"))); err != nil { 46 + return err 47 + } 48 + if _, err := cw.WriteString(string("chat.bsky.actor.declaration")); err != nil { 49 + return err 50 + } 51 + 52 + // t.AllowIncoming (string) (string) 53 + if len("allowIncoming") > 1000000 { 54 + return xerrors.Errorf("Value in field \"allowIncoming\" was too long") 55 + } 56 + 57 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("allowIncoming"))); err != nil { 58 + return err 59 + } 60 + if _, err := cw.WriteString(string("allowIncoming")); err != nil { 61 + return err 62 + } 63 + 64 + if len(t.AllowIncoming) > 1000000 { 65 + return xerrors.Errorf("Value in field t.AllowIncoming was too long") 66 + } 67 + 68 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.AllowIncoming))); err != nil { 69 + return err 70 + } 71 + if _, err := cw.WriteString(string(t.AllowIncoming)); err != nil { 72 + return err 73 + } 74 + return nil 75 + } 76 + 77 + func (t *ActorDeclaration) UnmarshalCBOR(r io.Reader) (err error) { 78 + *t = ActorDeclaration{} 79 + 80 + cr := cbg.NewCborReader(r) 81 + 82 + maj, extra, err := cr.ReadHeader() 83 + if err != nil { 84 + return err 85 + } 86 + defer func() { 87 + if err == io.EOF { 88 + err = io.ErrUnexpectedEOF 89 + } 90 + }() 91 + 92 + if maj != cbg.MajMap { 93 + return fmt.Errorf("cbor input should be of type map") 94 + } 95 + 96 + if extra > cbg.MaxLength { 97 + return fmt.Errorf("ActorDeclaration: map struct too large (%d)", extra) 98 + } 99 + 100 + var name string 101 + n := extra 102 + 103 + for i := uint64(0); i < n; i++ { 104 + 105 + { 106 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 107 + if err != nil { 108 + return err 109 + } 110 + 111 + name = string(sval) 112 + } 113 + 114 + switch name { 115 + // t.LexiconTypeID (string) (string) 116 + case "$type": 117 + 118 + { 119 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 120 + if err != nil { 121 + return err 122 + } 123 + 124 + t.LexiconTypeID = string(sval) 125 + } 126 + // t.AllowIncoming (string) (string) 127 + case "allowIncoming": 128 + 129 + { 130 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 131 + if err != nil { 132 + return err 133 + } 134 + 135 + t.AllowIncoming = string(sval) 136 + } 137 + 138 + default: 139 + // Field doesn't exist on this type, so ignore it 140 + cbg.ScanForLinks(r, func(cid.Cid) {}) 141 + } 142 + } 143 + 144 + return nil 145 + }
+266
api/chat/convodefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.defs 6 + 7 + import ( 8 + "encoding/json" 9 + "fmt" 10 + 11 + appbskytypes "github.com/bluesky-social/indigo/api/bsky" 12 + "github.com/bluesky-social/indigo/lex/util" 13 + ) 14 + 15 + // ConvoDefs_ConvoView is a "convoView" in the chat.bsky.convo.defs schema. 16 + type ConvoDefs_ConvoView struct { 17 + Id string `json:"id" cborgen:"id"` 18 + LastMessage *ConvoDefs_ConvoView_LastMessage `json:"lastMessage,omitempty" cborgen:"lastMessage,omitempty"` 19 + Members []*appbskytypes.ActorDefs_ProfileViewBasic `json:"members" cborgen:"members"` 20 + Muted bool `json:"muted" cborgen:"muted"` 21 + Rev string `json:"rev" cborgen:"rev"` 22 + UnreadCount int64 `json:"unreadCount" cborgen:"unreadCount"` 23 + } 24 + 25 + type ConvoDefs_ConvoView_LastMessage struct { 26 + ConvoDefs_MessageView *ConvoDefs_MessageView 27 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 28 + } 29 + 30 + func (t *ConvoDefs_ConvoView_LastMessage) MarshalJSON() ([]byte, error) { 31 + if t.ConvoDefs_MessageView != nil { 32 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 33 + return json.Marshal(t.ConvoDefs_MessageView) 34 + } 35 + if t.ConvoDefs_DeletedMessageView != nil { 36 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 37 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 38 + } 39 + return nil, fmt.Errorf("cannot marshal empty enum") 40 + } 41 + func (t *ConvoDefs_ConvoView_LastMessage) UnmarshalJSON(b []byte) error { 42 + typ, err := util.TypeExtract(b) 43 + if err != nil { 44 + return err 45 + } 46 + 47 + switch typ { 48 + case "chat.bsky.convo.defs#messageView": 49 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 50 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 51 + case "chat.bsky.convo.defs#deletedMessageView": 52 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 53 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 54 + 55 + default: 56 + return nil 57 + } 58 + } 59 + 60 + // ConvoDefs_DeletedMessageView is a "deletedMessageView" in the chat.bsky.convo.defs schema. 61 + // 62 + // RECORDTYPE: ConvoDefs_DeletedMessageView 63 + type ConvoDefs_DeletedMessageView struct { 64 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#deletedMessageView" cborgen:"$type,const=chat.bsky.convo.defs#deletedMessageView"` 65 + Id string `json:"id" cborgen:"id"` 66 + Rev string `json:"rev" cborgen:"rev"` 67 + Sender *ConvoDefs_MessageViewSender `json:"sender,omitempty" cborgen:"sender,omitempty"` 68 + SentAt string `json:"sentAt" cborgen:"sentAt"` 69 + } 70 + 71 + // ConvoDefs_LogBeginConvo is a "logBeginConvo" in the chat.bsky.convo.defs schema. 72 + // 73 + // RECORDTYPE: ConvoDefs_LogBeginConvo 74 + type ConvoDefs_LogBeginConvo struct { 75 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logBeginConvo" cborgen:"$type,const=chat.bsky.convo.defs#logBeginConvo"` 76 + ConvoId string `json:"convoId" cborgen:"convoId"` 77 + Rev string `json:"rev" cborgen:"rev"` 78 + } 79 + 80 + // ConvoDefs_LogCreateMessage is a "logCreateMessage" in the chat.bsky.convo.defs schema. 81 + // 82 + // RECORDTYPE: ConvoDefs_LogCreateMessage 83 + type ConvoDefs_LogCreateMessage struct { 84 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logCreateMessage" cborgen:"$type,const=chat.bsky.convo.defs#logCreateMessage"` 85 + ConvoId string `json:"convoId" cborgen:"convoId"` 86 + Message *ConvoDefs_LogCreateMessage_Message `json:"message" cborgen:"message"` 87 + Rev string `json:"rev" cborgen:"rev"` 88 + } 89 + 90 + type ConvoDefs_LogCreateMessage_Message struct { 91 + ConvoDefs_MessageView *ConvoDefs_MessageView 92 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 93 + } 94 + 95 + func (t *ConvoDefs_LogCreateMessage_Message) MarshalJSON() ([]byte, error) { 96 + if t.ConvoDefs_MessageView != nil { 97 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 98 + return json.Marshal(t.ConvoDefs_MessageView) 99 + } 100 + if t.ConvoDefs_DeletedMessageView != nil { 101 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 102 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 103 + } 104 + return nil, fmt.Errorf("cannot marshal empty enum") 105 + } 106 + func (t *ConvoDefs_LogCreateMessage_Message) UnmarshalJSON(b []byte) error { 107 + typ, err := util.TypeExtract(b) 108 + if err != nil { 109 + return err 110 + } 111 + 112 + switch typ { 113 + case "chat.bsky.convo.defs#messageView": 114 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 115 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 116 + case "chat.bsky.convo.defs#deletedMessageView": 117 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 118 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 119 + 120 + default: 121 + return nil 122 + } 123 + } 124 + 125 + // ConvoDefs_LogDeleteMessage is a "logDeleteMessage" in the chat.bsky.convo.defs schema. 126 + // 127 + // RECORDTYPE: ConvoDefs_LogDeleteMessage 128 + type ConvoDefs_LogDeleteMessage struct { 129 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logDeleteMessage" cborgen:"$type,const=chat.bsky.convo.defs#logDeleteMessage"` 130 + ConvoId string `json:"convoId" cborgen:"convoId"` 131 + Message *ConvoDefs_LogDeleteMessage_Message `json:"message" cborgen:"message"` 132 + Rev string `json:"rev" cborgen:"rev"` 133 + } 134 + 135 + type ConvoDefs_LogDeleteMessage_Message struct { 136 + ConvoDefs_MessageView *ConvoDefs_MessageView 137 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 138 + } 139 + 140 + func (t *ConvoDefs_LogDeleteMessage_Message) MarshalJSON() ([]byte, error) { 141 + if t.ConvoDefs_MessageView != nil { 142 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 143 + return json.Marshal(t.ConvoDefs_MessageView) 144 + } 145 + if t.ConvoDefs_DeletedMessageView != nil { 146 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 147 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 148 + } 149 + return nil, fmt.Errorf("cannot marshal empty enum") 150 + } 151 + func (t *ConvoDefs_LogDeleteMessage_Message) UnmarshalJSON(b []byte) error { 152 + typ, err := util.TypeExtract(b) 153 + if err != nil { 154 + return err 155 + } 156 + 157 + switch typ { 158 + case "chat.bsky.convo.defs#messageView": 159 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 160 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 161 + case "chat.bsky.convo.defs#deletedMessageView": 162 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 163 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 164 + 165 + default: 166 + return nil 167 + } 168 + } 169 + 170 + // ConvoDefs_LogLeaveConvo is a "logLeaveConvo" in the chat.bsky.convo.defs schema. 171 + // 172 + // RECORDTYPE: ConvoDefs_LogLeaveConvo 173 + type ConvoDefs_LogLeaveConvo struct { 174 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logLeaveConvo" cborgen:"$type,const=chat.bsky.convo.defs#logLeaveConvo"` 175 + ConvoId string `json:"convoId" cborgen:"convoId"` 176 + Rev string `json:"rev" cborgen:"rev"` 177 + } 178 + 179 + // ConvoDefs_Message is a "message" in the chat.bsky.convo.defs schema. 180 + type ConvoDefs_Message struct { 181 + Embed *ConvoDefs_Message_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 182 + // facets: Annotations of text (mentions, URLs, hashtags, etc) 183 + Facets []*appbskytypes.RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 184 + Id *string `json:"id,omitempty" cborgen:"id,omitempty"` 185 + Text string `json:"text" cborgen:"text"` 186 + } 187 + 188 + // ConvoDefs_MessageRef is a "messageRef" in the chat.bsky.convo.defs schema. 189 + type ConvoDefs_MessageRef struct { 190 + Did string `json:"did" cborgen:"did"` 191 + MessageId string `json:"messageId" cborgen:"messageId"` 192 + } 193 + 194 + // ConvoDefs_MessageView is a "messageView" in the chat.bsky.convo.defs schema. 195 + // 196 + // RECORDTYPE: ConvoDefs_MessageView 197 + type ConvoDefs_MessageView struct { 198 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#messageView" cborgen:"$type,const=chat.bsky.convo.defs#messageView"` 199 + Embed *ConvoDefs_MessageView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 200 + // facets: Annotations of text (mentions, URLs, hashtags, etc) 201 + Facets []*appbskytypes.RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 202 + Id string `json:"id" cborgen:"id"` 203 + Rev string `json:"rev" cborgen:"rev"` 204 + Sender *ConvoDefs_MessageViewSender `json:"sender,omitempty" cborgen:"sender,omitempty"` 205 + SentAt string `json:"sentAt" cborgen:"sentAt"` 206 + Text string `json:"text" cborgen:"text"` 207 + } 208 + 209 + // ConvoDefs_MessageViewSender is a "messageViewSender" in the chat.bsky.convo.defs schema. 210 + type ConvoDefs_MessageViewSender struct { 211 + Did string `json:"did" cborgen:"did"` 212 + } 213 + 214 + type ConvoDefs_MessageView_Embed struct { 215 + EmbedRecord *appbskytypes.EmbedRecord 216 + } 217 + 218 + func (t *ConvoDefs_MessageView_Embed) MarshalJSON() ([]byte, error) { 219 + if t.EmbedRecord != nil { 220 + t.EmbedRecord.LexiconTypeID = "app.bsky.embed.record" 221 + return json.Marshal(t.EmbedRecord) 222 + } 223 + return nil, fmt.Errorf("cannot marshal empty enum") 224 + } 225 + func (t *ConvoDefs_MessageView_Embed) UnmarshalJSON(b []byte) error { 226 + typ, err := util.TypeExtract(b) 227 + if err != nil { 228 + return err 229 + } 230 + 231 + switch typ { 232 + case "app.bsky.embed.record": 233 + t.EmbedRecord = new(appbskytypes.EmbedRecord) 234 + return json.Unmarshal(b, t.EmbedRecord) 235 + 236 + default: 237 + return nil 238 + } 239 + } 240 + 241 + type ConvoDefs_Message_Embed struct { 242 + EmbedRecord *appbskytypes.EmbedRecord 243 + } 244 + 245 + func (t *ConvoDefs_Message_Embed) MarshalJSON() ([]byte, error) { 246 + if t.EmbedRecord != nil { 247 + t.EmbedRecord.LexiconTypeID = "app.bsky.embed.record" 248 + return json.Marshal(t.EmbedRecord) 249 + } 250 + return nil, fmt.Errorf("cannot marshal empty enum") 251 + } 252 + func (t *ConvoDefs_Message_Embed) UnmarshalJSON(b []byte) error { 253 + typ, err := util.TypeExtract(b) 254 + if err != nil { 255 + return err 256 + } 257 + 258 + switch typ { 259 + case "app.bsky.embed.record": 260 + t.EmbedRecord = new(appbskytypes.EmbedRecord) 261 + return json.Unmarshal(b, t.EmbedRecord) 262 + 263 + default: 264 + return nil 265 + } 266 + }
+27
api/chat/convodeleteMessageForSelf.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.deleteMessageForSelf 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoDeleteMessageForSelf_Input is the input argument to a chat.bsky.convo.deleteMessageForSelf call. 14 + type ConvoDeleteMessageForSelf_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + MessageId string `json:"messageId" cborgen:"messageId"` 17 + } 18 + 19 + // ConvoDeleteMessageForSelf calls the XRPC method "chat.bsky.convo.deleteMessageForSelf". 20 + func ConvoDeleteMessageForSelf(ctx context.Context, c *xrpc.Client, input *ConvoDeleteMessageForSelf_Input) (*ConvoDefs_DeletedMessageView, error) { 21 + var out ConvoDefs_DeletedMessageView 22 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.deleteMessageForSelf", nil, input, &out); err != nil { 23 + return nil, err 24 + } 25 + 26 + return &out, nil 27 + }
+30
api/chat/convogetConvo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.getConvo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoGetConvo_Output is the output of a chat.bsky.convo.getConvo call. 14 + type ConvoGetConvo_Output struct { 15 + Convo *ConvoDefs_ConvoView `json:"convo" cborgen:"convo"` 16 + } 17 + 18 + // ConvoGetConvo calls the XRPC method "chat.bsky.convo.getConvo". 19 + func ConvoGetConvo(ctx context.Context, c *xrpc.Client, convoId string) (*ConvoGetConvo_Output, error) { 20 + var out ConvoGetConvo_Output 21 + 22 + params := map[string]interface{}{ 23 + "convoId": convoId, 24 + } 25 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getConvo", params, nil, &out); err != nil { 26 + return nil, err 27 + } 28 + 29 + return &out, nil 30 + }
+30
api/chat/convogetConvoForMembers.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.getConvoForMembers 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoGetConvoForMembers_Output is the output of a chat.bsky.convo.getConvoForMembers call. 14 + type ConvoGetConvoForMembers_Output struct { 15 + Convo *ConvoDefs_ConvoView `json:"convo" cborgen:"convo"` 16 + } 17 + 18 + // ConvoGetConvoForMembers calls the XRPC method "chat.bsky.convo.getConvoForMembers". 19 + func ConvoGetConvoForMembers(ctx context.Context, c *xrpc.Client, members []string) (*ConvoGetConvoForMembers_Output, error) { 20 + var out ConvoGetConvoForMembers_Output 21 + 22 + params := map[string]interface{}{ 23 + "members": members, 24 + } 25 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getConvoForMembers", params, nil, &out); err != nil { 26 + return nil, err 27 + } 28 + 29 + return &out, nil 30 + }
+85
api/chat/convogetLog.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.getLog 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + "github.com/bluesky-social/indigo/lex/util" 13 + "github.com/bluesky-social/indigo/xrpc" 14 + ) 15 + 16 + // ConvoGetLog_Output is the output of a chat.bsky.convo.getLog call. 17 + type ConvoGetLog_Output struct { 18 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 19 + Logs []*ConvoGetLog_Output_Logs_Elem `json:"logs" cborgen:"logs"` 20 + } 21 + 22 + type ConvoGetLog_Output_Logs_Elem struct { 23 + ConvoDefs_LogBeginConvo *ConvoDefs_LogBeginConvo 24 + ConvoDefs_LogLeaveConvo *ConvoDefs_LogLeaveConvo 25 + ConvoDefs_LogCreateMessage *ConvoDefs_LogCreateMessage 26 + ConvoDefs_LogDeleteMessage *ConvoDefs_LogDeleteMessage 27 + } 28 + 29 + func (t *ConvoGetLog_Output_Logs_Elem) MarshalJSON() ([]byte, error) { 30 + if t.ConvoDefs_LogBeginConvo != nil { 31 + t.ConvoDefs_LogBeginConvo.LexiconTypeID = "chat.bsky.convo.defs#logBeginConvo" 32 + return json.Marshal(t.ConvoDefs_LogBeginConvo) 33 + } 34 + if t.ConvoDefs_LogLeaveConvo != nil { 35 + t.ConvoDefs_LogLeaveConvo.LexiconTypeID = "chat.bsky.convo.defs#logLeaveConvo" 36 + return json.Marshal(t.ConvoDefs_LogLeaveConvo) 37 + } 38 + if t.ConvoDefs_LogCreateMessage != nil { 39 + t.ConvoDefs_LogCreateMessage.LexiconTypeID = "chat.bsky.convo.defs#logCreateMessage" 40 + return json.Marshal(t.ConvoDefs_LogCreateMessage) 41 + } 42 + if t.ConvoDefs_LogDeleteMessage != nil { 43 + t.ConvoDefs_LogDeleteMessage.LexiconTypeID = "chat.bsky.convo.defs#logDeleteMessage" 44 + return json.Marshal(t.ConvoDefs_LogDeleteMessage) 45 + } 46 + return nil, fmt.Errorf("cannot marshal empty enum") 47 + } 48 + func (t *ConvoGetLog_Output_Logs_Elem) UnmarshalJSON(b []byte) error { 49 + typ, err := util.TypeExtract(b) 50 + if err != nil { 51 + return err 52 + } 53 + 54 + switch typ { 55 + case "chat.bsky.convo.defs#logBeginConvo": 56 + t.ConvoDefs_LogBeginConvo = new(ConvoDefs_LogBeginConvo) 57 + return json.Unmarshal(b, t.ConvoDefs_LogBeginConvo) 58 + case "chat.bsky.convo.defs#logLeaveConvo": 59 + t.ConvoDefs_LogLeaveConvo = new(ConvoDefs_LogLeaveConvo) 60 + return json.Unmarshal(b, t.ConvoDefs_LogLeaveConvo) 61 + case "chat.bsky.convo.defs#logCreateMessage": 62 + t.ConvoDefs_LogCreateMessage = new(ConvoDefs_LogCreateMessage) 63 + return json.Unmarshal(b, t.ConvoDefs_LogCreateMessage) 64 + case "chat.bsky.convo.defs#logDeleteMessage": 65 + t.ConvoDefs_LogDeleteMessage = new(ConvoDefs_LogDeleteMessage) 66 + return json.Unmarshal(b, t.ConvoDefs_LogDeleteMessage) 67 + 68 + default: 69 + return nil 70 + } 71 + } 72 + 73 + // ConvoGetLog calls the XRPC method "chat.bsky.convo.getLog". 74 + func ConvoGetLog(ctx context.Context, c *xrpc.Client, cursor string) (*ConvoGetLog_Output, error) { 75 + var out ConvoGetLog_Output 76 + 77 + params := map[string]interface{}{ 78 + "cursor": cursor, 79 + } 80 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getLog", params, nil, &out); err != nil { 81 + return nil, err 82 + } 83 + 84 + return &out, nil 85 + }
+71
api/chat/convogetMessages.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.getMessages 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + "github.com/bluesky-social/indigo/lex/util" 13 + "github.com/bluesky-social/indigo/xrpc" 14 + ) 15 + 16 + // ConvoGetMessages_Output is the output of a chat.bsky.convo.getMessages call. 17 + type ConvoGetMessages_Output struct { 18 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 19 + Messages []*ConvoGetMessages_Output_Messages_Elem `json:"messages" cborgen:"messages"` 20 + } 21 + 22 + type ConvoGetMessages_Output_Messages_Elem struct { 23 + ConvoDefs_MessageView *ConvoDefs_MessageView 24 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 25 + } 26 + 27 + func (t *ConvoGetMessages_Output_Messages_Elem) MarshalJSON() ([]byte, error) { 28 + if t.ConvoDefs_MessageView != nil { 29 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 30 + return json.Marshal(t.ConvoDefs_MessageView) 31 + } 32 + if t.ConvoDefs_DeletedMessageView != nil { 33 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 34 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 35 + } 36 + return nil, fmt.Errorf("cannot marshal empty enum") 37 + } 38 + func (t *ConvoGetMessages_Output_Messages_Elem) UnmarshalJSON(b []byte) error { 39 + typ, err := util.TypeExtract(b) 40 + if err != nil { 41 + return err 42 + } 43 + 44 + switch typ { 45 + case "chat.bsky.convo.defs#messageView": 46 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 47 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 48 + case "chat.bsky.convo.defs#deletedMessageView": 49 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 50 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 51 + 52 + default: 53 + return nil 54 + } 55 + } 56 + 57 + // ConvoGetMessages calls the XRPC method "chat.bsky.convo.getMessages". 58 + func ConvoGetMessages(ctx context.Context, c *xrpc.Client, convoId string, cursor string, limit int64) (*ConvoGetMessages_Output, error) { 59 + var out ConvoGetMessages_Output 60 + 61 + params := map[string]interface{}{ 62 + "convoId": convoId, 63 + "cursor": cursor, 64 + "limit": limit, 65 + } 66 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getMessages", params, nil, &out); err != nil { 67 + return nil, err 68 + } 69 + 70 + return &out, nil 71 + }
+32
api/chat/convoleaveConvo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.leaveConvo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoLeaveConvo_Input is the input argument to a chat.bsky.convo.leaveConvo call. 14 + type ConvoLeaveConvo_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + } 17 + 18 + // ConvoLeaveConvo_Output is the output of a chat.bsky.convo.leaveConvo call. 19 + type ConvoLeaveConvo_Output struct { 20 + ConvoId string `json:"convoId" cborgen:"convoId"` 21 + Rev string `json:"rev" cborgen:"rev"` 22 + } 23 + 24 + // ConvoLeaveConvo calls the XRPC method "chat.bsky.convo.leaveConvo". 25 + func ConvoLeaveConvo(ctx context.Context, c *xrpc.Client, input *ConvoLeaveConvo_Input) (*ConvoLeaveConvo_Output, error) { 26 + var out ConvoLeaveConvo_Output 27 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.leaveConvo", nil, input, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+32
api/chat/convolistConvos.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.listConvos 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoListConvos_Output is the output of a chat.bsky.convo.listConvos call. 14 + type ConvoListConvos_Output struct { 15 + Convos []*ConvoDefs_ConvoView `json:"convos" cborgen:"convos"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 17 + } 18 + 19 + // ConvoListConvos calls the XRPC method "chat.bsky.convo.listConvos". 20 + func ConvoListConvos(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*ConvoListConvos_Output, error) { 21 + var out ConvoListConvos_Output 22 + 23 + params := map[string]interface{}{ 24 + "cursor": cursor, 25 + "limit": limit, 26 + } 27 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.listConvos", params, nil, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+31
api/chat/convomuteConvo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.muteConvo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoMuteConvo_Input is the input argument to a chat.bsky.convo.muteConvo call. 14 + type ConvoMuteConvo_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + } 17 + 18 + // ConvoMuteConvo_Output is the output of a chat.bsky.convo.muteConvo call. 19 + type ConvoMuteConvo_Output struct { 20 + Convo *ConvoDefs_ConvoView `json:"convo" cborgen:"convo"` 21 + } 22 + 23 + // ConvoMuteConvo calls the XRPC method "chat.bsky.convo.muteConvo". 24 + func ConvoMuteConvo(ctx context.Context, c *xrpc.Client, input *ConvoMuteConvo_Input) (*ConvoMuteConvo_Output, error) { 25 + var out ConvoMuteConvo_Output 26 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.muteConvo", nil, input, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+27
api/chat/convosendMessage.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.sendMessage 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoSendMessage_Input is the input argument to a chat.bsky.convo.sendMessage call. 14 + type ConvoSendMessage_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + Message *ConvoDefs_Message `json:"message" cborgen:"message"` 17 + } 18 + 19 + // ConvoSendMessage calls the XRPC method "chat.bsky.convo.sendMessage". 20 + func ConvoSendMessage(ctx context.Context, c *xrpc.Client, input *ConvoSendMessage_Input) (*ConvoDefs_MessageView, error) { 21 + var out ConvoDefs_MessageView 22 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.sendMessage", nil, input, &out); err != nil { 23 + return nil, err 24 + } 25 + 26 + return &out, nil 27 + }
+37
api/chat/convosendMessageBatch.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.sendMessageBatch 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoSendMessageBatch_BatchItem is a "batchItem" in the chat.bsky.convo.sendMessageBatch schema. 14 + type ConvoSendMessageBatch_BatchItem struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + Message *ConvoDefs_Message `json:"message" cborgen:"message"` 17 + } 18 + 19 + // ConvoSendMessageBatch_Input is the input argument to a chat.bsky.convo.sendMessageBatch call. 20 + type ConvoSendMessageBatch_Input struct { 21 + Items []*ConvoSendMessageBatch_BatchItem `json:"items" cborgen:"items"` 22 + } 23 + 24 + // ConvoSendMessageBatch_Output is the output of a chat.bsky.convo.sendMessageBatch call. 25 + type ConvoSendMessageBatch_Output struct { 26 + Items []*ConvoDefs_MessageView `json:"items" cborgen:"items"` 27 + } 28 + 29 + // ConvoSendMessageBatch calls the XRPC method "chat.bsky.convo.sendMessageBatch". 30 + func ConvoSendMessageBatch(ctx context.Context, c *xrpc.Client, input *ConvoSendMessageBatch_Input) (*ConvoSendMessageBatch_Output, error) { 31 + var out ConvoSendMessageBatch_Output 32 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.sendMessageBatch", nil, input, &out); err != nil { 33 + return nil, err 34 + } 35 + 36 + return &out, nil 37 + }
+31
api/chat/convounmuteConvo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.unmuteConvo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoUnmuteConvo_Input is the input argument to a chat.bsky.convo.unmuteConvo call. 14 + type ConvoUnmuteConvo_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + } 17 + 18 + // ConvoUnmuteConvo_Output is the output of a chat.bsky.convo.unmuteConvo call. 19 + type ConvoUnmuteConvo_Output struct { 20 + Convo *ConvoDefs_ConvoView `json:"convo" cborgen:"convo"` 21 + } 22 + 23 + // ConvoUnmuteConvo calls the XRPC method "chat.bsky.convo.unmuteConvo". 24 + func ConvoUnmuteConvo(ctx context.Context, c *xrpc.Client, input *ConvoUnmuteConvo_Input) (*ConvoUnmuteConvo_Output, error) { 25 + var out ConvoUnmuteConvo_Output 26 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.unmuteConvo", nil, input, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+32
api/chat/convoupdateRead.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.updateRead 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoUpdateRead_Input is the input argument to a chat.bsky.convo.updateRead call. 14 + type ConvoUpdateRead_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + MessageId *string `json:"messageId,omitempty" cborgen:"messageId,omitempty"` 17 + } 18 + 19 + // ConvoUpdateRead_Output is the output of a chat.bsky.convo.updateRead call. 20 + type ConvoUpdateRead_Output struct { 21 + Convo *ConvoDefs_ConvoView `json:"convo" cborgen:"convo"` 22 + } 23 + 24 + // ConvoUpdateRead calls the XRPC method "chat.bsky.convo.updateRead". 25 + func ConvoUpdateRead(ctx context.Context, c *xrpc.Client, input *ConvoUpdateRead_Input) (*ConvoUpdateRead_Output, error) { 26 + var out ConvoUpdateRead_Output 27 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.updateRead", nil, input, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+40
api/chat/moderationgetActorMetadata.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.moderation.getActorMetadata 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationGetActorMetadata_Metadata is a "metadata" in the chat.bsky.moderation.getActorMetadata schema. 14 + type ModerationGetActorMetadata_Metadata struct { 15 + Convos int64 `json:"convos" cborgen:"convos"` 16 + ConvosStarted int64 `json:"convosStarted" cborgen:"convosStarted"` 17 + MessagesReceived int64 `json:"messagesReceived" cborgen:"messagesReceived"` 18 + MessagesSent int64 `json:"messagesSent" cborgen:"messagesSent"` 19 + } 20 + 21 + // ModerationGetActorMetadata_Output is the output of a chat.bsky.moderation.getActorMetadata call. 22 + type ModerationGetActorMetadata_Output struct { 23 + All *ModerationGetActorMetadata_Metadata `json:"all" cborgen:"all"` 24 + Day *ModerationGetActorMetadata_Metadata `json:"day" cborgen:"day"` 25 + Month *ModerationGetActorMetadata_Metadata `json:"month" cborgen:"month"` 26 + } 27 + 28 + // ModerationGetActorMetadata calls the XRPC method "chat.bsky.moderation.getActorMetadata". 29 + func ModerationGetActorMetadata(ctx context.Context, c *xrpc.Client, actor string) (*ModerationGetActorMetadata_Output, error) { 30 + var out ModerationGetActorMetadata_Output 31 + 32 + params := map[string]interface{}{ 33 + "actor": actor, 34 + } 35 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.moderation.getActorMetadata", params, nil, &out); err != nil { 36 + return nil, err 37 + } 38 + 39 + return &out, nil 40 + }
+70
api/chat/moderationgetMessageContext.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.moderation.getMessageContext 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + "github.com/bluesky-social/indigo/lex/util" 13 + "github.com/bluesky-social/indigo/xrpc" 14 + ) 15 + 16 + // ModerationGetMessageContext_Output is the output of a chat.bsky.moderation.getMessageContext call. 17 + type ModerationGetMessageContext_Output struct { 18 + Messages []*ModerationGetMessageContext_Output_Messages_Elem `json:"messages" cborgen:"messages"` 19 + } 20 + 21 + type ModerationGetMessageContext_Output_Messages_Elem struct { 22 + ConvoDefs_MessageView *ConvoDefs_MessageView 23 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 24 + } 25 + 26 + func (t *ModerationGetMessageContext_Output_Messages_Elem) MarshalJSON() ([]byte, error) { 27 + if t.ConvoDefs_MessageView != nil { 28 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 29 + return json.Marshal(t.ConvoDefs_MessageView) 30 + } 31 + if t.ConvoDefs_DeletedMessageView != nil { 32 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 33 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 34 + } 35 + return nil, fmt.Errorf("cannot marshal empty enum") 36 + } 37 + func (t *ModerationGetMessageContext_Output_Messages_Elem) UnmarshalJSON(b []byte) error { 38 + typ, err := util.TypeExtract(b) 39 + if err != nil { 40 + return err 41 + } 42 + 43 + switch typ { 44 + case "chat.bsky.convo.defs#messageView": 45 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 46 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 47 + case "chat.bsky.convo.defs#deletedMessageView": 48 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 49 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 50 + 51 + default: 52 + return nil 53 + } 54 + } 55 + 56 + // ModerationGetMessageContext calls the XRPC method "chat.bsky.moderation.getMessageContext". 57 + func ModerationGetMessageContext(ctx context.Context, c *xrpc.Client, after int64, before int64, messageId string) (*ModerationGetMessageContext_Output, error) { 58 + var out ModerationGetMessageContext_Output 59 + 60 + params := map[string]interface{}{ 61 + "after": after, 62 + "before": before, 63 + "messageId": messageId, 64 + } 65 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.moderation.getMessageContext", params, nil, &out); err != nil { 66 + return nil, err 67 + } 68 + 69 + return &out, nil 70 + }
+26
api/chat/moderationupdateActorAccess.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.moderation.updateActorAccess 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationUpdateActorAccess_Input is the input argument to a chat.bsky.moderation.updateActorAccess call. 14 + type ModerationUpdateActorAccess_Input struct { 15 + Actor string `json:"actor" cborgen:"actor"` 16 + AllowAccess bool `json:"allowAccess" cborgen:"allowAccess"` 17 + } 18 + 19 + // ModerationUpdateActorAccess calls the XRPC method "chat.bsky.moderation.updateActorAccess". 20 + func ModerationUpdateActorAccess(ctx context.Context, c *xrpc.Client, input *ModerationUpdateActorAccess_Input) error { 21 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.moderation.updateActorAccess", nil, input, nil); err != nil { 22 + return err 23 + } 24 + 25 + return nil 26 + }
+7
gen/main.go
··· 6 6 "github.com/bluesky-social/indigo/api" 7 7 atproto "github.com/bluesky-social/indigo/api/atproto" 8 8 bsky "github.com/bluesky-social/indigo/api/bsky" 9 + chat "github.com/bluesky-social/indigo/api/chat" 9 10 "github.com/bluesky-social/indigo/atproto/data" 10 11 "github.com/bluesky-social/indigo/events" 11 12 lexutil "github.com/bluesky-social/indigo/lex/util" ··· 71 72 bsky.FeedDefs_ThreadViewPost{}, bsky.EmbedRecord_ViewRecord{}, 72 73 bsky.FeedDefs_PostView{}, bsky.ActorDefs_ProfileViewBasic{}, 73 74 */ 75 + ); err != nil { 76 + panic(err) 77 + } 78 + 79 + if err := genCfg.WriteMapEncodersToFile("api/chat/cbor_gen.go", "chat", 80 + chat.ActorDeclaration{}, 74 81 ); err != nil { 75 82 panic(err) 76 83 }