this repo has no description
0
fork

Configure Feed

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

Update chat lexicons

+131 -54
+23
api/chat/actordefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.actor.defs 6 + 7 + import ( 8 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 9 + appbskytypes "github.com/bluesky-social/indigo/api/bsky" 10 + ) 11 + 12 + // ActorDefs_ProfileViewBasic is a "profileViewBasic" in the chat.bsky.actor.defs schema. 13 + type ActorDefs_ProfileViewBasic struct { 14 + Associated *appbskytypes.ActorDefs_ProfileAssociated `json:"associated,omitempty" cborgen:"associated,omitempty"` 15 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 16 + // chatDisabled: Set to true when the actor cannot actively participate in converations 17 + ChatDisabled *bool `json:"chatDisabled,omitempty" cborgen:"chatDisabled,omitempty"` 18 + Did string `json:"did" cborgen:"did"` 19 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 20 + Handle string `json:"handle" cborgen:"handle"` 21 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 22 + Viewer *appbskytypes.ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 23 + }
+25
api/chat/actordeleteAccount.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.actor.deleteAccount 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ActorDeleteAccount_Output is the output of a chat.bsky.actor.deleteAccount call. 14 + type ActorDeleteAccount_Output struct { 15 + } 16 + 17 + // ActorDeleteAccount calls the XRPC method "chat.bsky.actor.deleteAccount". 18 + func ActorDeleteAccount(ctx context.Context, c *xrpc.Client) (*ActorDeleteAccount_Output, error) { 19 + var out ActorDeleteAccount_Output 20 + if err := c.Do(ctx, xrpc.Procedure, "", "chat.bsky.actor.deleteAccount", nil, nil, &out); err != nil { 21 + return nil, err 22 + } 23 + 24 + return &out, nil 25 + }
+22
api/chat/actorexportAccountData.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.actor.exportAccountData 6 + 7 + import ( 8 + "bytes" 9 + "context" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // ActorExportAccountData calls the XRPC method "chat.bsky.actor.exportAccountData". 15 + func ActorExportAccountData(ctx context.Context, c *xrpc.Client) ([]byte, error) { 16 + buf := new(bytes.Buffer) 17 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.actor.exportAccountData", nil, nil, buf); err != nil { 18 + return nil, err 19 + } 20 + 21 + return buf.Bytes(), nil 22 + }
+39 -39
api/chat/convodefs.go
··· 14 14 15 15 // ConvoDefs_ConvoView is a "convoView" in the chat.bsky.convo.defs schema. 16 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"` 17 + Id string `json:"id" cborgen:"id"` 18 + LastMessage *ConvoDefs_ConvoView_LastMessage `json:"lastMessage,omitempty" cborgen:"lastMessage,omitempty"` 19 + Members []*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 23 } 24 24 25 25 type ConvoDefs_ConvoView_LastMessage struct { ··· 64 64 LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#deletedMessageView" cborgen:"$type,const=chat.bsky.convo.defs#deletedMessageView"` 65 65 Id string `json:"id" cborgen:"id"` 66 66 Rev string `json:"rev" cborgen:"rev"` 67 - Sender *ConvoDefs_MessageViewSender `json:"sender,omitempty" cborgen:"sender,omitempty"` 67 + Sender *ConvoDefs_MessageViewSender `json:"sender" cborgen:"sender"` 68 68 SentAt string `json:"sentAt" cborgen:"sentAt"` 69 69 } 70 70 ··· 176 176 Rev string `json:"rev" cborgen:"rev"` 177 177 } 178 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"` 179 + // ConvoDefs_MessageInput is the input argument to a chat.bsky.convo.defs call. 180 + type ConvoDefs_MessageInput struct { 181 + Embed *ConvoDefs_MessageInput_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 182 182 // facets: Annotations of text (mentions, URLs, hashtags, etc) 183 183 Facets []*appbskytypes.RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 184 - Id *string `json:"id,omitempty" cborgen:"id,omitempty"` 185 184 Text string `json:"text" cborgen:"text"` 186 185 } 187 186 187 + type ConvoDefs_MessageInput_Embed struct { 188 + EmbedRecord *appbskytypes.EmbedRecord 189 + } 190 + 191 + func (t *ConvoDefs_MessageInput_Embed) MarshalJSON() ([]byte, error) { 192 + if t.EmbedRecord != nil { 193 + t.EmbedRecord.LexiconTypeID = "app.bsky.embed.record" 194 + return json.Marshal(t.EmbedRecord) 195 + } 196 + return nil, fmt.Errorf("cannot marshal empty enum") 197 + } 198 + func (t *ConvoDefs_MessageInput_Embed) UnmarshalJSON(b []byte) error { 199 + typ, err := util.TypeExtract(b) 200 + if err != nil { 201 + return err 202 + } 203 + 204 + switch typ { 205 + case "app.bsky.embed.record": 206 + t.EmbedRecord = new(appbskytypes.EmbedRecord) 207 + return json.Unmarshal(b, t.EmbedRecord) 208 + 209 + default: 210 + return nil 211 + } 212 + } 213 + 188 214 // ConvoDefs_MessageRef is a "messageRef" in the chat.bsky.convo.defs schema. 189 215 type ConvoDefs_MessageRef struct { 216 + ConvoId string `json:"convoId" cborgen:"convoId"` 190 217 Did string `json:"did" cborgen:"did"` 191 218 MessageId string `json:"messageId" cborgen:"messageId"` 192 219 } ··· 201 228 Facets []*appbskytypes.RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 202 229 Id string `json:"id" cborgen:"id"` 203 230 Rev string `json:"rev" cborgen:"rev"` 204 - Sender *ConvoDefs_MessageViewSender `json:"sender,omitempty" cborgen:"sender,omitempty"` 231 + Sender *ConvoDefs_MessageViewSender `json:"sender" cborgen:"sender"` 205 232 SentAt string `json:"sentAt" cborgen:"sentAt"` 206 233 Text string `json:"text" cborgen:"text"` 207 234 } ··· 237 264 return nil 238 265 } 239 266 } 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 - }
+2 -2
api/chat/convosendMessage.go
··· 12 12 13 13 // ConvoSendMessage_Input is the input argument to a chat.bsky.convo.sendMessage call. 14 14 type ConvoSendMessage_Input struct { 15 - ConvoId string `json:"convoId" cborgen:"convoId"` 16 - Message *ConvoDefs_Message `json:"message" cborgen:"message"` 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + Message *ConvoDefs_MessageInput `json:"message" cborgen:"message"` 17 17 } 18 18 19 19 // ConvoSendMessage calls the XRPC method "chat.bsky.convo.sendMessage".
+2 -2
api/chat/convosendMessageBatch.go
··· 12 12 13 13 // ConvoSendMessageBatch_BatchItem is a "batchItem" in the chat.bsky.convo.sendMessageBatch schema. 14 14 type ConvoSendMessageBatch_BatchItem struct { 15 - ConvoId string `json:"convoId" cborgen:"convoId"` 16 - Message *ConvoDefs_Message `json:"message" cborgen:"message"` 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + Message *ConvoDefs_MessageInput `json:"message" cborgen:"message"` 17 17 } 18 18 19 19 // ConvoSendMessageBatch_Input is the input argument to a chat.bsky.convo.sendMessageBatch call.
+4 -1
api/chat/moderationgetMessageContext.go
··· 54 54 } 55 55 56 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) { 57 + // 58 + // convoId: Conversation that the message is from. NOTE: this field will eventually be required. 59 + func ModerationGetMessageContext(ctx context.Context, c *xrpc.Client, after int64, before int64, convoId string, messageId string) (*ModerationGetMessageContext_Output, error) { 58 60 var out ModerationGetMessageContext_Output 59 61 60 62 params := map[string]interface{}{ 61 63 "after": after, 62 64 "before": before, 65 + "convoId": convoId, 63 66 "messageId": messageId, 64 67 } 65 68 if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.moderation.getMessageContext", params, nil, &out); err != nil {
+3 -2
api/chat/moderationupdateActorAccess.go
··· 12 12 13 13 // ModerationUpdateActorAccess_Input is the input argument to a chat.bsky.moderation.updateActorAccess call. 14 14 type ModerationUpdateActorAccess_Input struct { 15 - Actor string `json:"actor" cborgen:"actor"` 16 - AllowAccess bool `json:"allowAccess" cborgen:"allowAccess"` 15 + Actor string `json:"actor" cborgen:"actor"` 16 + AllowAccess bool `json:"allowAccess" cborgen:"allowAccess"` 17 + Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"` 17 18 } 18 19 19 20 // ModerationUpdateActorAccess calls the XRPC method "chat.bsky.moderation.updateActorAccess".
+11 -8
lex/gen.go
··· 17 17 ) 18 18 19 19 const ( 20 - EncodingCBOR = "application/cbor" 21 - EncodingJSON = "application/json" 22 - EncodingCAR = "application/vnd.ipld.car" 23 - EncodingANY = "*/*" 20 + EncodingCBOR = "application/cbor" 21 + EncodingJSON = "application/json" 22 + EncodingJSONL = "application/jsonl" 23 + EncodingCAR = "application/vnd.ipld.car" 24 + EncodingANY = "*/*" 24 25 ) 25 26 26 27 type Schema struct { ··· 182 183 183 184 if ts.Output != nil { 184 185 if ts.Output.Schema == nil { 185 - if ts.Output.Encoding != "application/cbor" && ts.Output.Encoding != "application/vnd.ipld.car" && ts.Output.Encoding != "*/*" { 186 + if ts.Output.Encoding != "application/cbor" && ts.Output.Encoding != "application/vnd.ipld.car" && ts.Output.Encoding != "*/*" && ts.Output.Encoding != "application/jsonl" { 186 187 panic(fmt.Sprintf("strange output type def in %s", s.ID)) 187 188 } 188 189 } else { ··· 497 498 out := "error" 498 499 if s.Output != nil { 499 500 switch s.Output.Encoding { 500 - case EncodingCBOR, EncodingCAR, EncodingANY: 501 + case EncodingCBOR, EncodingCAR, EncodingANY, EncodingJSONL: 501 502 out = "([]byte, error)" 502 503 case EncodingJSON: 503 504 outname := fname + "_Output" ··· 530 531 outRet := "nil" 531 532 if s.Output != nil { 532 533 switch s.Output.Encoding { 533 - case EncodingCBOR, EncodingCAR, EncodingANY: 534 + case EncodingCBOR, EncodingCAR, EncodingANY, EncodingJSONL: 534 535 pf("buf := new(bytes.Buffer)\n") 535 536 outvar = "buf" 536 537 errRet = "nil, err" ··· 994 995 } 995 996 pf("var out *%s.%s\n", impname, outname) 996 997 returndef = fmt.Sprintf("(*%s.%s, error)", impname, outname) 997 - case EncodingCBOR, EncodingCAR, EncodingANY: 998 + case EncodingCBOR, EncodingCAR, EncodingANY, EncodingJSONL: 998 999 assign = "out, handleErr" 999 1000 pf("var out io.Reader\n") 1000 1001 returndef = "(io.Reader, error)" ··· 1017 1018 pf("return c.Stream(200, \"application/octet-stream\", out)\n}\n\n") 1018 1019 case EncodingCAR: 1019 1020 pf("return c.Stream(200, \"application/vnd.ipld.car\", out)\n}\n\n") 1021 + case EncodingJSONL: 1022 + pf("return c.Stream(200, \"application/jsonl\", out)\n}\n\n") 1020 1023 default: 1021 1024 return fmt.Errorf("unrecognized output encoding (RPC output handler return): %q", s.Output.Encoding) 1022 1025 }