this repo has no description
0
fork

Configure Feed

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

checkout atproto 5f2bcd180751e8875a52f4fb74eb2109f5d731ab make lexgen; make cborgen fixes for one function signature change

authored by

Brian Olson and committed by
Brian Olson
92b2ec2f edf05048

+250 -25
+14 -6
api/bsky/embedrecord.go
··· 118 118 } 119 119 120 120 type EmbedRecord_View_Record struct { 121 - EmbedRecord_ViewRecord *EmbedRecord_ViewRecord 122 - EmbedRecord_ViewNotFound *EmbedRecord_ViewNotFound 123 - EmbedRecord_ViewBlocked *EmbedRecord_ViewBlocked 124 - FeedDefs_GeneratorView *FeedDefs_GeneratorView 125 - GraphDefs_ListView *GraphDefs_ListView 126 - LabelerDefs_LabelerView *LabelerDefs_LabelerView 121 + EmbedRecord_ViewRecord *EmbedRecord_ViewRecord 122 + EmbedRecord_ViewNotFound *EmbedRecord_ViewNotFound 123 + EmbedRecord_ViewBlocked *EmbedRecord_ViewBlocked 124 + FeedDefs_GeneratorView *FeedDefs_GeneratorView 125 + GraphDefs_ListView *GraphDefs_ListView 126 + LabelerDefs_LabelerView *LabelerDefs_LabelerView 127 + GraphDefs_StarterPackViewBasic *GraphDefs_StarterPackViewBasic 127 128 } 128 129 129 130 func (t *EmbedRecord_View_Record) MarshalJSON() ([]byte, error) { ··· 151 152 t.LabelerDefs_LabelerView.LexiconTypeID = "app.bsky.labeler.defs#labelerView" 152 153 return json.Marshal(t.LabelerDefs_LabelerView) 153 154 } 155 + if t.GraphDefs_StarterPackViewBasic != nil { 156 + t.GraphDefs_StarterPackViewBasic.LexiconTypeID = "app.bsky.graph.defs#starterPackViewBasic" 157 + return json.Marshal(t.GraphDefs_StarterPackViewBasic) 158 + } 154 159 return nil, fmt.Errorf("cannot marshal empty enum") 155 160 } 156 161 func (t *EmbedRecord_View_Record) UnmarshalJSON(b []byte) error { ··· 178 183 case "app.bsky.labeler.defs#labelerView": 179 184 t.LabelerDefs_LabelerView = new(LabelerDefs_LabelerView) 180 185 return json.Unmarshal(b, t.LabelerDefs_LabelerView) 186 + case "app.bsky.graph.defs#starterPackViewBasic": 187 + t.GraphDefs_StarterPackViewBasic = new(GraphDefs_StarterPackViewBasic) 188 + return json.Unmarshal(b, t.GraphDefs_StarterPackViewBasic) 181 189 182 190 default: 183 191 return nil
+3
api/bsky/graphdefs.go
··· 94 94 } 95 95 96 96 // GraphDefs_StarterPackViewBasic is a "starterPackViewBasic" in the app.bsky.graph.defs schema. 97 + // 98 + // RECORDTYPE: GraphDefs_StarterPackViewBasic 97 99 type GraphDefs_StarterPackViewBasic struct { 100 + LexiconTypeID string `json:"$type,const=app.bsky.graph.defs#starterPackViewBasic" cborgen:"$type,const=app.bsky.graph.defs#starterPackViewBasic"` 98 101 Cid string `json:"cid" cborgen:"cid"` 99 102 Creator *ActorDefs_ProfileViewBasic `json:"creator" cborgen:"creator"` 100 103 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
+3 -2
api/bsky/notificationgetUnreadCount.go
··· 16 16 } 17 17 18 18 // NotificationGetUnreadCount calls the XRPC method "app.bsky.notification.getUnreadCount". 19 - func NotificationGetUnreadCount(ctx context.Context, c *xrpc.Client, seenAt string) (*NotificationGetUnreadCount_Output, error) { 19 + func NotificationGetUnreadCount(ctx context.Context, c *xrpc.Client, priority bool, seenAt string) (*NotificationGetUnreadCount_Output, error) { 20 20 var out NotificationGetUnreadCount_Output 21 21 22 22 params := map[string]interface{}{ 23 - "seenAt": seenAt, 23 + "priority": priority, 24 + "seenAt": seenAt, 24 25 } 25 26 if err := c.Do(ctx, xrpc.Query, "", "app.bsky.notification.getUnreadCount", params, nil, &out); err != nil { 26 27 return nil, err
+6 -4
api/bsky/notificationlistNotifications.go
··· 30 30 type NotificationListNotifications_Output struct { 31 31 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 32 32 Notifications []*NotificationListNotifications_Notification `json:"notifications" cborgen:"notifications"` 33 + Priority *bool `json:"priority,omitempty" cborgen:"priority,omitempty"` 33 34 SeenAt *string `json:"seenAt,omitempty" cborgen:"seenAt,omitempty"` 34 35 } 35 36 36 37 // NotificationListNotifications calls the XRPC method "app.bsky.notification.listNotifications". 37 - func NotificationListNotifications(ctx context.Context, c *xrpc.Client, cursor string, limit int64, seenAt string) (*NotificationListNotifications_Output, error) { 38 + func NotificationListNotifications(ctx context.Context, c *xrpc.Client, cursor string, limit int64, priority bool, seenAt string) (*NotificationListNotifications_Output, error) { 38 39 var out NotificationListNotifications_Output 39 40 40 41 params := map[string]interface{}{ 41 - "cursor": cursor, 42 - "limit": limit, 43 - "seenAt": seenAt, 42 + "cursor": cursor, 43 + "limit": limit, 44 + "priority": priority, 45 + "seenAt": seenAt, 44 46 } 45 47 if err := c.Do(ctx, xrpc.Query, "", "app.bsky.notification.listNotifications", params, nil, &out); err != nil { 46 48 return nil, err
+25
api/bsky/notificationputPreferences.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.notification.putPreferences 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // NotificationPutPreferences_Input is the input argument to a app.bsky.notification.putPreferences call. 14 + type NotificationPutPreferences_Input struct { 15 + Priority bool `json:"priority" cborgen:"priority"` 16 + } 17 + 18 + // NotificationPutPreferences calls the XRPC method "app.bsky.notification.putPreferences". 19 + func NotificationPutPreferences(ctx context.Context, c *xrpc.Client, input *NotificationPutPreferences_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "app.bsky.notification.putPreferences", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+6 -4
api/bsky/unspeccedgetSuggestionsSkeleton.go
··· 18 18 19 19 // UnspeccedGetSuggestionsSkeleton calls the XRPC method "app.bsky.unspecced.getSuggestionsSkeleton". 20 20 // 21 + // relativeToDid: DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer. 21 22 // viewer: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. 22 - func UnspeccedGetSuggestionsSkeleton(ctx context.Context, c *xrpc.Client, cursor string, limit int64, viewer string) (*UnspeccedGetSuggestionsSkeleton_Output, error) { 23 + func UnspeccedGetSuggestionsSkeleton(ctx context.Context, c *xrpc.Client, cursor string, limit int64, relativeToDid string, viewer string) (*UnspeccedGetSuggestionsSkeleton_Output, error) { 23 24 var out UnspeccedGetSuggestionsSkeleton_Output 24 25 25 26 params := map[string]interface{}{ 26 - "cursor": cursor, 27 - "limit": limit, 28 - "viewer": viewer, 27 + "cursor": cursor, 28 + "limit": limit, 29 + "relativeToDid": relativeToDid, 30 + "viewer": viewer, 29 31 } 30 32 if err := c.Do(ctx, xrpc.Query, "", "app.bsky.unspecced.getSuggestionsSkeleton", params, nil, &out); err != nil { 31 33 return nil, err
+6 -3
api/chat/convodefs.go
··· 212 212 } 213 213 214 214 // ConvoDefs_MessageRef is a "messageRef" in the chat.bsky.convo.defs schema. 215 + // 216 + // RECORDTYPE: ConvoDefs_MessageRef 215 217 type ConvoDefs_MessageRef struct { 216 - ConvoId string `json:"convoId" cborgen:"convoId"` 217 - Did string `json:"did" cborgen:"did"` 218 - MessageId string `json:"messageId" cborgen:"messageId"` 218 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#messageRef" cborgen:"$type,const=chat.bsky.convo.defs#messageRef"` 219 + ConvoId string `json:"convoId" cborgen:"convoId"` 220 + Did string `json:"did" cborgen:"did"` 221 + MessageId string `json:"messageId" cborgen:"messageId"` 219 222 } 220 223 221 224 // ConvoDefs_MessageView is a "messageView" in the chat.bsky.convo.defs schema.
+11 -2
api/ozone/moderationdefs.go
··· 9 9 "fmt" 10 10 11 11 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 12 + chatbskytypes "github.com/bluesky-social/indigo/api/chat" 12 13 "github.com/bluesky-social/indigo/lex/util" 13 14 ) 14 15 ··· 591 592 } 592 593 593 594 type ModerationDefs_ModEventView_Subject struct { 594 - AdminDefs_RepoRef *comatprototypes.AdminDefs_RepoRef 595 - RepoStrongRef *comatprototypes.RepoStrongRef 595 + AdminDefs_RepoRef *comatprototypes.AdminDefs_RepoRef 596 + RepoStrongRef *comatprototypes.RepoStrongRef 597 + ConvoDefs_MessageRef *chatbskytypes.ConvoDefs_MessageRef 596 598 } 597 599 598 600 func (t *ModerationDefs_ModEventView_Subject) MarshalJSON() ([]byte, error) { ··· 604 606 t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 605 607 return json.Marshal(t.RepoStrongRef) 606 608 } 609 + if t.ConvoDefs_MessageRef != nil { 610 + t.ConvoDefs_MessageRef.LexiconTypeID = "chat.bsky.convo.defs#messageRef" 611 + return json.Marshal(t.ConvoDefs_MessageRef) 612 + } 607 613 return nil, fmt.Errorf("cannot marshal empty enum") 608 614 } 609 615 func (t *ModerationDefs_ModEventView_Subject) UnmarshalJSON(b []byte) error { ··· 619 625 case "com.atproto.repo.strongRef": 620 626 t.RepoStrongRef = new(comatprototypes.RepoStrongRef) 621 627 return json.Unmarshal(b, t.RepoStrongRef) 628 + case "chat.bsky.convo.defs#messageRef": 629 + t.ConvoDefs_MessageRef = new(chatbskytypes.ConvoDefs_MessageRef) 630 + return json.Unmarshal(b, t.ConvoDefs_MessageRef) 622 631 623 632 default: 624 633 return nil
+40
api/ozone/servergetConfig.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.server.getConfig 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerGetConfig_Output is the output of a tools.ozone.server.getConfig call. 14 + type ServerGetConfig_Output struct { 15 + Appview *ServerGetConfig_ServiceConfig `json:"appview,omitempty" cborgen:"appview,omitempty"` 16 + BlobDivert *ServerGetConfig_ServiceConfig `json:"blobDivert,omitempty" cborgen:"blobDivert,omitempty"` 17 + Chat *ServerGetConfig_ServiceConfig `json:"chat,omitempty" cborgen:"chat,omitempty"` 18 + Pds *ServerGetConfig_ServiceConfig `json:"pds,omitempty" cborgen:"pds,omitempty"` 19 + Viewer *ServerGetConfig_ViewerConfig `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 20 + } 21 + 22 + // ServerGetConfig_ServiceConfig is a "serviceConfig" in the tools.ozone.server.getConfig schema. 23 + type ServerGetConfig_ServiceConfig struct { 24 + Url *string `json:"url,omitempty" cborgen:"url,omitempty"` 25 + } 26 + 27 + // ServerGetConfig_ViewerConfig is a "viewerConfig" in the tools.ozone.server.getConfig schema. 28 + type ServerGetConfig_ViewerConfig struct { 29 + Role *string `json:"role,omitempty" cborgen:"role,omitempty"` 30 + } 31 + 32 + // ServerGetConfig calls the XRPC method "tools.ozone.server.getConfig". 33 + func ServerGetConfig(ctx context.Context, c *xrpc.Client) (*ServerGetConfig_Output, error) { 34 + var out ServerGetConfig_Output 35 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.server.getConfig", nil, nil, &out); err != nil { 36 + return nil, err 37 + } 38 + 39 + return &out, nil 40 + }
+27
api/ozone/teamaddMember.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.team.addMember 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // TeamAddMember_Input is the input argument to a tools.ozone.team.addMember call. 14 + type TeamAddMember_Input struct { 15 + Did string `json:"did" cborgen:"did"` 16 + Role string `json:"role" cborgen:"role"` 17 + } 18 + 19 + // TeamAddMember calls the XRPC method "tools.ozone.team.addMember". 20 + func TeamAddMember(ctx context.Context, c *xrpc.Client, input *TeamAddMember_Input) (*TeamDefs_Member, error) { 21 + var out TeamDefs_Member 22 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.team.addMember", nil, input, &out); err != nil { 23 + return nil, err 24 + } 25 + 26 + return &out, nil 27 + }
+20
api/ozone/teamdefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.team.defs 6 + 7 + import ( 8 + appbskytypes "github.com/bluesky-social/indigo/api/bsky" 9 + ) 10 + 11 + // TeamDefs_Member is a "member" in the tools.ozone.team.defs schema. 12 + type TeamDefs_Member struct { 13 + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 14 + Did string `json:"did" cborgen:"did"` 15 + Disabled *bool `json:"disabled,omitempty" cborgen:"disabled,omitempty"` 16 + LastUpdatedBy *string `json:"lastUpdatedBy,omitempty" cborgen:"lastUpdatedBy,omitempty"` 17 + Profile *appbskytypes.ActorDefs_ProfileViewDetailed `json:"profile,omitempty" cborgen:"profile,omitempty"` 18 + Role string `json:"role" cborgen:"role"` 19 + UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` 20 + }
+25
api/ozone/teamdeleteMember.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.team.deleteMember 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // TeamDeleteMember_Input is the input argument to a tools.ozone.team.deleteMember call. 14 + type TeamDeleteMember_Input struct { 15 + Did string `json:"did" cborgen:"did"` 16 + } 17 + 18 + // TeamDeleteMember calls the XRPC method "tools.ozone.team.deleteMember". 19 + func TeamDeleteMember(ctx context.Context, c *xrpc.Client, input *TeamDeleteMember_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.team.deleteMember", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+32
api/ozone/teamlistMembers.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.team.listMembers 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // TeamListMembers_Output is the output of a tools.ozone.team.listMembers call. 14 + type TeamListMembers_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Members []*TeamDefs_Member `json:"members" cborgen:"members"` 17 + } 18 + 19 + // TeamListMembers calls the XRPC method "tools.ozone.team.listMembers". 20 + func TeamListMembers(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*TeamListMembers_Output, error) { 21 + var out TeamListMembers_Output 22 + 23 + params := map[string]interface{}{ 24 + "cursor": cursor, 25 + "limit": limit, 26 + } 27 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.team.listMembers", params, nil, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+28
api/ozone/teamupdateMember.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.team.updateMember 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // TeamUpdateMember_Input is the input argument to a tools.ozone.team.updateMember call. 14 + type TeamUpdateMember_Input struct { 15 + Did string `json:"did" cborgen:"did"` 16 + Disabled *bool `json:"disabled,omitempty" cborgen:"disabled,omitempty"` 17 + Role *string `json:"role,omitempty" cborgen:"role,omitempty"` 18 + } 19 + 20 + // TeamUpdateMember calls the XRPC method "tools.ozone.team.updateMember". 21 + func TeamUpdateMember(ctx context.Context, c *xrpc.Client, input *TeamUpdateMember_Input) (*TeamDefs_Member, error) { 22 + var out TeamDefs_Member 23 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.team.updateMember", nil, input, &out); err != nil { 24 + return nil, err 25 + } 26 + 27 + return &out, nil 28 + }
+1 -1
cmd/gosky/bsky.go
··· 334 334 return err 335 335 } 336 336 337 - notifs, err := appbsky.NotificationListNotifications(ctx, xrpcc, "", 50, "") 337 + notifs, err := appbsky.NotificationListNotifications(ctx, xrpcc, "", 50, false, "") 338 338 if err != nil { 339 339 return err 340 340 }
+2 -2
fakedata/generators.go
··· 386 386 func BrowseAccount(xrpcc *xrpc.Client, acc *AccountContext) error { 387 387 // fetch notifications 388 388 maxNotif := 50 389 - resp, err := appbsky.NotificationListNotifications(context.TODO(), xrpcc, "", int64(maxNotif), "") 389 + resp, err := appbsky.NotificationListNotifications(context.TODO(), xrpcc, "", int64(maxNotif), false, "") 390 390 if err != nil { 391 391 return err 392 392 } ··· 456 456 t2(len(timelineResp.Feed)) 457 457 458 458 // notification count for good measure 459 - _, err = appbsky.NotificationGetUnreadCount(context.TODO(), xrpcc, "") 459 + _, err = appbsky.NotificationGetUnreadCount(context.TODO(), xrpcc, false, "") 460 460 return err 461 461 }
+1 -1
testing/utils.go
··· 471 471 t.Helper() 472 472 473 473 ctx := context.TODO() 474 - resp, err := bsky.NotificationListNotifications(ctx, u.client, "", 100, "") 474 + resp, err := bsky.NotificationListNotifications(ctx, u.client, "", 100, false, "") 475 475 if err != nil { 476 476 t.Fatal(err) 477 477 }