From 2004c5d32f964543497cfa6e3a0e918038988479 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Sat, 30 Dec 2023 23:01:24 +0100 Subject: [PATCH 1/2] remove remaining deprecated actor decl CID refs --- labeler/service.go | 3 +-- pds/handlers.go | 2 +- pds/server.go | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/labeler/service.go b/labeler/service.go index df22f3c66..ec436bf59 100644 --- a/labeler/service.go +++ b/labeler/service.go @@ -20,7 +20,6 @@ import ( "github.com/bluesky-social/indigo/indexer" lexutil "github.com/bluesky-social/indigo/lex/util" "github.com/bluesky-social/indigo/models" - "github.com/bluesky-social/indigo/pds" "github.com/bluesky-social/indigo/repo" "github.com/bluesky-social/indigo/repomgr" cbg "github.com/whyrusleeping/cbor-gen" @@ -102,7 +101,7 @@ func NewServer(db *gorm.DB, cs *carstore.CarStore, repoUser RepoConfig, plcURL, head, _ := s.repoman.GetRepoRoot(ctx, s.user.UserId) if !head.Defined() { log.Info("initializing labelmaker repo") - if err := s.repoman.InitNewActor(ctx, s.user.UserId, s.user.Handle, s.user.Did, "Label Maker", pds.UserActorDeclCid, pds.UserActorDeclType); err != nil { + if err := s.repoman.InitNewActor(ctx, s.user.UserId, s.user.Handle, s.user.Did, "Label Maker", "", ""); err != nil { return nil, fmt.Errorf("creating labelmaker repo: %w", err) } } else { diff --git a/pds/handlers.go b/pds/handlers.go index 6eb50530f..99e269360 100644 --- a/pds/handlers.go +++ b/pds/handlers.go @@ -340,7 +340,7 @@ func (s *Server) handleComAtprotoServerCreateAccount(ctx context.Context, body * return nil, err } - if err := s.repoman.InitNewActor(ctx, u.ID, u.Handle, u.Did, "", UserActorDeclCid, UserActorDeclType); err != nil { + if err := s.repoman.InitNewActor(ctx, u.ID, u.Handle, u.Did, "", "", ""); err != nil { return nil, err } diff --git a/pds/server.go b/pds/server.go index 1408fa733..b273fd767 100644 --- a/pds/server.go +++ b/pds/server.go @@ -59,9 +59,6 @@ type Server struct { plc plc.PLCClient } -const UserActorDeclCid = "bafyreid27zk7lbis4zw5fz4podbvbs4fc5ivwji3dmrwa6zggnj4bnd57u" -const UserActorDeclType = "app.bsky.system.actorUser" - // serverListenerBootTimeout is how long to wait for the requested server socket // to become available for use. This is an arbitrary timeout that should be safe // on any platform, but there's no great way to weave this timeout without From 0cb3f8029c7465d23eb0d15333cd99fdbb0a8c99 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Sat, 30 Dec 2023 23:02:48 +0100 Subject: [PATCH 2/2] pds: remove app.bsky.* code from PDS impl This code is dead and unused. These routes are not served from the PDS, they get served from the AppView. In theory the implementation might be useful for a future golang appview; we can grab the code from git history if needed. --- pds/handlers.go | 368 ---------------- pds/server.go | 4 - pds/stubs.go | 1076 ----------------------------------------------- 3 files changed, 1448 deletions(-) diff --git a/pds/handlers.go b/pds/handlers.go index 99e269360..fe996cce3 100644 --- a/pds/handlers.go +++ b/pds/handlers.go @@ -6,275 +6,14 @@ import ( "database/sql" "fmt" "io" - "time" comatprototypes "github.com/bluesky-social/indigo/api/atproto" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" lexutil "github.com/bluesky-social/indigo/lex/util" "github.com/bluesky-social/indigo/models" "github.com/ipfs/go-cid" "github.com/lestrrat-go/jwx/v2/jwt" ) -func (s *Server) handleAppBskyActorGetProfile(ctx context.Context, actor string) (*appbskytypes.ActorDefs_ProfileViewDetailed, error) { - profile, err := s.feedgen.GetActorProfile(ctx, actor) - if err != nil { - return nil, err - } - - return &appbskytypes.ActorDefs_ProfileViewDetailed{ - Viewer: nil, //*ActorGetProfile_MyState `json:"myState" cborgen:"myState"` - Did: profile.Did, - Description: nil, - PostsCount: &profile.Posts, - FollowsCount: &profile.Following, - Handle: profile.Handle.String, - DisplayName: &profile.DisplayName, - FollowersCount: &profile.Followers, - }, nil -} - -func (s *Server) handleAppBskyActorGetSuggestions(ctx context.Context, cursor string, limit int) (*appbskytypes.ActorGetSuggestions_Output, error) { - - var out appbskytypes.ActorGetSuggestions_Output - out.Actors = []*appbskytypes.ActorDefs_ProfileView{} - return &out, nil -} - -func (s *Server) handleAppBskyFeedGetAuthorFeed(ctx context.Context, author string, before string, filter string, limit int) (*appbskytypes.FeedGetAuthorFeed_Output, error) { - _, err := s.getUser(ctx) - if err != nil { - return nil, err - } - - target, err := s.lookupUser(ctx, author) - //target, err := s.lookupUserByHandle(ctx, author) - if err != nil { - return nil, err - } - - feed, err := s.feedgen.GetAuthorFeed(ctx, target, before, limit) - if err != nil { - return nil, err - } - - out := appbskytypes.FeedGetAuthorFeed_Output{ - Feed: feed, - } - - return &out, nil -} - -func (s *Server) handleAppBskyFeedGetPostThread(ctx context.Context, depth int, parentHeight int, uri string) (*appbskytypes.FeedGetPostThread_Output, error) { - u, err := s.getUser(ctx) - if err != nil { - return nil, err - } - - d := depth - - pthread, err := s.feedgen.GetPostThread(ctx, uri, d) - if err != nil { - return nil, err - } - - fmt.Println("TODO: replies") - - var convertToOutputType func(thr *ThreadPost) (*appbskytypes.FeedDefs_ThreadViewPost, error) - convertToOutputType = func(thr *ThreadPost) (*appbskytypes.FeedDefs_ThreadViewPost, error) { - p := thr.Post - - vs, err := s.feedgen.getPostViewerState(ctx, thr.PostID, u.ID, u.Did) - if err != nil { - return nil, err - } - - p.Post.Viewer = vs - - out := &appbskytypes.FeedDefs_ThreadViewPost{ - Post: p.Post, - } - - if thr.ParentUri != "" { - if thr.Parent == nil { - out.Parent = &appbskytypes.FeedDefs_ThreadViewPost_Parent{ - FeedDefs_NotFoundPost: &appbskytypes.FeedDefs_NotFoundPost{ - Uri: thr.ParentUri, - NotFound: true, - }, - } - } else { - othr, err := convertToOutputType(thr.Parent) - if err != nil { - return nil, err - } - - out.Parent = &appbskytypes.FeedDefs_ThreadViewPost_Parent{ - FeedDefs_ThreadViewPost: othr, - } - } - } - - return out, nil - } - - othr, err := convertToOutputType(pthread) - if err != nil { - return nil, err - } - - out := appbskytypes.FeedGetPostThread_Output{ - Thread: &appbskytypes.FeedGetPostThread_Output_Thread{ - FeedDefs_ThreadViewPost: othr, - //FeedGetPostThread_NotFoundPost: &appbskytypes.FeedGetPostThread_NotFoundPost{}, - }, - } - - return &out, nil -} - -func (s *Server) handleAppBskyFeedGetRepostedBy(ctx context.Context, before string, cc string, limit int, uri string) (*appbskytypes.FeedGetRepostedBy_Output, error) { - panic("not yet implemented") -} - -func (s *Server) handleAppBskyFeedGetTimeline(ctx context.Context, algorithm string, before string, limit int) (*appbskytypes.FeedGetTimeline_Output, error) { - u, err := s.getUser(ctx) - if err != nil { - return nil, err - } - - tl, err := s.feedgen.GetTimeline(ctx, u, algorithm, before, limit) - if err != nil { - return nil, err - } - - var out appbskytypes.FeedGetTimeline_Output - out.Feed = tl - - return &out, nil -} - -func (s *Server) handleAppBskyFeedGetLikes(ctx context.Context, cc string, cursor string, limit int, uri string) (*appbskytypes.FeedGetLikes_Output, error) { - // func (s *Server) handleAppBskyFeedGetLikes(ctx context.Context,cid string,cursor string,limit int,uri string) (*appbskytypes.FeedGetLikes_Output, error) - pcid, err := cid.Decode(cc) - if err != nil { - return nil, err - } - - votes, err := s.feedgen.GetVotes(ctx, uri, pcid, limit, cursor) - if err != nil { - return nil, err - } - - var out appbskytypes.FeedGetLikes_Output - out.Uri = uri - out.Likes = []*appbskytypes.FeedGetLikes_Like{} - - for _, v := range votes { - out.Likes = append(out.Likes, &appbskytypes.FeedGetLikes_Like{ - Actor: s.actorBasicToView(ctx, v.Actor), - IndexedAt: v.IndexedAt.Format(time.RFC3339), - CreatedAt: v.CreatedAt, - }) - } - - return &out, nil -} - -func (s *Server) handleAppBskyGraphGetFollowers(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.GraphGetFollowers_Output, error) { - panic("not yet implemented") -} - -func (s *Server) handleAppBskyGraphGetFollows(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.GraphGetFollows_Output, error) { - follows, err := s.feedgen.GetFollows(ctx, actor, limit, cursor) - if err != nil { - return nil, err - } - - ai, err := s.feedgen.GetActorProfile(ctx, actor) - if err != nil { - return nil, err - } - - var out appbskytypes.GraphGetFollows_Output - out.Subject = s.actorBasicToView(ctx, ai.ActorRef()) - - out.Follows = []*appbskytypes.ActorDefs_ProfileView{} - for _, f := range follows { - out.Follows = append(out.Follows, &appbskytypes.ActorDefs_ProfileView{ - Handle: f.Subject.Handle, - DisplayName: f.Subject.DisplayName, - Did: f.Subject.Did, - }) - } - - return &out, nil -} - -func (s *Server) handleAppBskyGraphGetMutes(ctx context.Context, before string, limit int) (*appbskytypes.GraphGetMutes_Output, error) { - panic("not yet implemented") -} - -func (s *Server) handleAppBskyGraphMuteActor(ctx context.Context, input *appbskytypes.GraphMuteActor_Input) error { - panic("not yet implemented") -} - -func (s *Server) handleAppBskyGraphUnmuteActor(ctx context.Context, input *appbskytypes.GraphUnmuteActor_Input) error { - panic("not yet implemented") -} - -func (s *Server) handleAppBskyNotificationGetUnreadCount(ctx context.Context, seenAt string) (*appbskytypes.NotificationGetUnreadCount_Output, error) { - u, err := s.getUser(ctx) - if err != nil { - return nil, err - } - - // TODO: use seenAt - - count, err := s.notifman.GetCount(ctx, u.ID) - if err != nil { - return nil, fmt.Errorf("notification getCount: %w", err) - } - - fmt.Println("notif count: ", u.Handle, count) - return &appbskytypes.NotificationGetUnreadCount_Output{ - Count: count, - }, nil -} - -func (s *Server) handleAppBskyNotificationListNotifications(ctx context.Context, cursor string, limit int, seenAt string) (*appbskytypes.NotificationListNotifications_Output, error) { - u, err := s.getUser(ctx) - if err != nil { - return nil, err - } - - // TODO: use seenAt - _ = seenAt - - notifs, err := s.notifman.GetNotifications(ctx, u.ID) - if err != nil { - return nil, err - } - - return &appbskytypes.NotificationListNotifications_Output{ - Notifications: notifs, - }, nil -} - -func (s *Server) handleAppBskyNotificationUpdateSeen(ctx context.Context, input *appbskytypes.NotificationUpdateSeen_Input) error { - u, err := s.getUser(ctx) - if err != nil { - return err - } - - seen, err := time.Parse(time.RFC3339, input.SeenAt) - if err != nil { - return fmt.Errorf("invalid time format for 'seenAt': %w", err) - } - - return s.notifman.UpdateSeen(ctx, u.ID, seen) -} - func (s *Server) handleComAtprotoServerCreateAccount(ctx context.Context, body *comatprototypes.ServerCreateAccount_Input) (*comatprototypes.ServerCreateAccount_Output, error) { if body.Email == nil { return nil, fmt.Errorf("email is required") @@ -615,10 +354,6 @@ func (s *Server) handleComAtprotoSyncGetRepo(ctx context.Context, did string, si return buf, nil } -func (s *Server) handleAppBskyActorGetProfiles(ctx context.Context, actors []string) (*appbskytypes.ActorGetProfiles_Output, error) { - panic("nyi") -} - func (s *Server) handleComAtprotoAdminGetRecord(ctx context.Context, cid string, uri string) (*comatprototypes.AdminDefs_RecordViewDetail, error) { panic("nyi") } @@ -650,18 +385,6 @@ func (s *Server) handleComAtprotoSyncListBlobs(ctx context.Context, cursor strin panic("nyi") } -func (s *Server) handleAppBskyActorSearchActors(ctx context.Context, cursor string, limit int, q string, term string) (*appbskytypes.ActorSearchActors_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context, limit int, q string, term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyUnspeccedGetPopular(ctx context.Context, cursor string, includeNsfw bool, limit int) (*appbskytypes.UnspeccedGetPopular_Output, error) { - panic("nyi") -} - func (s *Server) handleComAtprotoIdentityUpdateHandle(ctx context.Context, body *comatprototypes.IdentityUpdateHandle_Input) error { if err := s.validateHandle(body.Handle); err != nil { return err @@ -726,34 +449,6 @@ func (s *Server) handleComAtprotoServerListAppPasswords(ctx context.Context) (*c func (s *Server) handleComAtprotoServerRevokeAppPassword(ctx context.Context, body *comatprototypes.ServerRevokeAppPassword_Input) error { panic("nyi") } -func (s *Server) handleAppBskyActorGetPreferences(ctx context.Context) (*appbskytypes.ActorGetPreferences_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyActorPutPreferences(ctx context.Context, body *appbskytypes.ActorPutPreferences_Input) error { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetPosts(ctx context.Context, uris []string) (*appbskytypes.FeedGetPosts_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyGraphGetBlocks(ctx context.Context, cursor string, limit int) (*appbskytypes.GraphGetBlocks_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyGraphGetList(ctx context.Context, cursor string, limit int, list string) (*appbskytypes.GraphGetList_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyGraphGetListMutes(ctx context.Context, cursor string, limit int) (*appbskytypes.GraphGetListMutes_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyGraphGetLists(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.GraphGetLists_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyGraphMuteActorList(ctx context.Context, body *appbskytypes.GraphMuteActorList_Input) error { - panic("nyi") -} -func (s *Server) handleAppBskyGraphUnmuteActorList(ctx context.Context, body *appbskytypes.GraphUnmuteActorList_Input) error { - panic("nyi") -} func (s *Server) handleComAtprotoAdminDisableAccountInvites(ctx context.Context, body *comatprototypes.AdminDisableAccountInvites_Input) error { panic("nyi") @@ -763,47 +458,10 @@ func (s *Server) handleComAtprotoAdminEnableAccountInvites(ctx context.Context, panic("nyi") } -func (s *Server) handleAppBskyFeedDescribeFeedGenerator(ctx context.Context) (*appbskytypes.FeedDescribeFeedGenerator_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetActorFeeds(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.FeedGetActorFeeds_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetFeed(ctx context.Context, cursor string, feed string, limit int) (*appbskytypes.FeedGetFeed_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetFeedGenerator(ctx context.Context, feed string) (*appbskytypes.FeedGetFeedGenerator_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetFeedGenerators(ctx context.Context, feeds []string) (*appbskytypes.FeedGetFeedGenerators_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context, cursor string, feed string, limit int) (*appbskytypes.FeedGetFeedSkeleton_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyUnspeccedApplyLabels(ctx context.Context, body *appbskytypes.UnspeccedApplyLabels_Input) error { - panic("nyi") -} -func (s *Server) handleAppBskyUnspeccedGetPopularFeedGenerators(ctx context.Context, cursor string, limit int, query string) (*appbskytypes.UnspeccedGetPopularFeedGenerators_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyUnspeccedGetTimelineSkeleton(ctx context.Context, cursor string, limit int) (*appbskytypes.UnspeccedGetTimelineSkeleton_Output, error) { - panic("nyi") -} - func (s *Server) handleComAtprotoAdminSendEmail(ctx context.Context, body *comatprototypes.AdminSendEmail_Input) (*comatprototypes.AdminSendEmail_Output, error) { panic("nyi") } -func (s *Server) handleAppBskyFeedGetActorLikes(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.FeedGetActorLikes_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyNotificationRegisterPush(ctx context.Context, body *appbskytypes.NotificationRegisterPush_Input) error { - panic("nyi") -} - func (s *Server) handleComAtprotoSyncGetLatestCommit(ctx context.Context, did string) (*comatprototypes.SyncGetLatestCommit_Output, error) { panic("nyi") } @@ -812,32 +470,6 @@ func (s *Server) handleComAtprotoTempUpgradeRepoVersion(ctx context.Context, bod panic("nyi") } -func (s *Server) handleAppBskyFeedGetListFeed(ctx context.Context, cursor string, limit int, list string) (*appbskytypes.FeedGetListFeed_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyFeedGetSuggestedFeeds(ctx context.Context, cursor string, limit int) (*appbskytypes.FeedGetSuggestedFeeds_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyFeedSearchPosts(ctx context.Context, cursor string, limit int, q string) (*appbskytypes.FeedSearchPosts_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyGraphGetListBlocks(ctx context.Context, cursor string, limit int) (*appbskytypes.GraphGetListBlocks_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyGraphGetSuggestedFollowsByActor(ctx context.Context, actor string) (*appbskytypes.GraphGetSuggestedFollowsByActor_Output, error) { - panic("nyi") -} - -func (s *Server) handleAppBskyUnspeccedSearchActorsSkeleton(ctx context.Context, cursor string, limit int, q string, typeahead *bool) (*appbskytypes.UnspeccedSearchActorsSkeleton_Output, error) { - panic("nyi") -} -func (s *Server) handleAppBskyUnspeccedSearchPostsSkeleton(ctx context.Context, cursor string, limit int, q string) (*appbskytypes.UnspeccedSearchPostsSkeleton_Output, error) { - panic("nyi") -} func (s *Server) handleComAtprotoAdminGetAccountInfo(ctx context.Context, did string) (*comatprototypes.AdminDefs_AccountView, error) { panic("nyi") } diff --git a/pds/server.go b/pds/server.go index b273fd767..325ef5bb0 100644 --- a/pds/server.go +++ b/pds/server.go @@ -313,9 +313,6 @@ func (s *Server) RunAPIWithListener(listen net.Listener) error { return true case "/xrpc/com.atproto.server.describeServer": return true - case "/xrpc/app.bsky.actor.getProfile": - fmt.Println("TODO: currently not requiring auth on get profile endpoint") - return true case "/xrpc/com.atproto.sync.getRepo": fmt.Println("TODO: currently not requiring auth on get repo endpoint") return true @@ -353,7 +350,6 @@ func (s *Server) RunAPIWithListener(listen net.Listener) error { e.Use(middleware.JWTWithConfig(cfg), s.userCheckMiddleware) s.RegisterHandlersComAtproto(e) - s.RegisterHandlersAppBsky(e) e.GET("/xrpc/com.atproto.sync.subscribeRepos", s.EventsHandler) e.GET("/xrpc/_health", s.HandleHealthCheck) e.GET("/.well-known/atproto-did", s.HandleResolveDid) diff --git a/pds/stubs.go b/pds/stubs.go index a60a71546..787348764 100644 --- a/pds/stubs.go +++ b/pds/stubs.go @@ -5,1086 +5,10 @@ import ( "strconv" comatprototypes "github.com/bluesky-social/indigo/api/atproto" - appbskytypes "github.com/bluesky-social/indigo/api/bsky" "github.com/labstack/echo/v4" "go.opentelemetry.io/otel" ) -func (s *Server) RegisterHandlersAppBsky(e *echo.Echo) error { - e.GET("/xrpc/app.bsky.actor.getPreferences", s.HandleAppBskyActorGetPreferences) - e.GET("/xrpc/app.bsky.actor.getProfile", s.HandleAppBskyActorGetProfile) - e.GET("/xrpc/app.bsky.actor.getProfiles", s.HandleAppBskyActorGetProfiles) - e.GET("/xrpc/app.bsky.actor.getSuggestions", s.HandleAppBskyActorGetSuggestions) - e.POST("/xrpc/app.bsky.actor.putPreferences", s.HandleAppBskyActorPutPreferences) - e.GET("/xrpc/app.bsky.actor.searchActors", s.HandleAppBskyActorSearchActors) - e.GET("/xrpc/app.bsky.actor.searchActorsTypeahead", s.HandleAppBskyActorSearchActorsTypeahead) - e.GET("/xrpc/app.bsky.feed.describeFeedGenerator", s.HandleAppBskyFeedDescribeFeedGenerator) - e.GET("/xrpc/app.bsky.feed.getActorFeeds", s.HandleAppBskyFeedGetActorFeeds) - e.GET("/xrpc/app.bsky.feed.getActorLikes", s.HandleAppBskyFeedGetActorLikes) - e.GET("/xrpc/app.bsky.feed.getAuthorFeed", s.HandleAppBskyFeedGetAuthorFeed) - e.GET("/xrpc/app.bsky.feed.getFeed", s.HandleAppBskyFeedGetFeed) - e.GET("/xrpc/app.bsky.feed.getFeedGenerator", s.HandleAppBskyFeedGetFeedGenerator) - e.GET("/xrpc/app.bsky.feed.getFeedGenerators", s.HandleAppBskyFeedGetFeedGenerators) - e.GET("/xrpc/app.bsky.feed.getFeedSkeleton", s.HandleAppBskyFeedGetFeedSkeleton) - e.GET("/xrpc/app.bsky.feed.getLikes", s.HandleAppBskyFeedGetLikes) - e.GET("/xrpc/app.bsky.feed.getListFeed", s.HandleAppBskyFeedGetListFeed) - e.GET("/xrpc/app.bsky.feed.getPostThread", s.HandleAppBskyFeedGetPostThread) - e.GET("/xrpc/app.bsky.feed.getPosts", s.HandleAppBskyFeedGetPosts) - e.GET("/xrpc/app.bsky.feed.getRepostedBy", s.HandleAppBskyFeedGetRepostedBy) - e.GET("/xrpc/app.bsky.feed.getSuggestedFeeds", s.HandleAppBskyFeedGetSuggestedFeeds) - e.GET("/xrpc/app.bsky.feed.getTimeline", s.HandleAppBskyFeedGetTimeline) - e.GET("/xrpc/app.bsky.feed.searchPosts", s.HandleAppBskyFeedSearchPosts) - e.GET("/xrpc/app.bsky.graph.getBlocks", s.HandleAppBskyGraphGetBlocks) - e.GET("/xrpc/app.bsky.graph.getFollowers", s.HandleAppBskyGraphGetFollowers) - e.GET("/xrpc/app.bsky.graph.getFollows", s.HandleAppBskyGraphGetFollows) - e.GET("/xrpc/app.bsky.graph.getList", s.HandleAppBskyGraphGetList) - e.GET("/xrpc/app.bsky.graph.getListBlocks", s.HandleAppBskyGraphGetListBlocks) - e.GET("/xrpc/app.bsky.graph.getListMutes", s.HandleAppBskyGraphGetListMutes) - e.GET("/xrpc/app.bsky.graph.getLists", s.HandleAppBskyGraphGetLists) - e.GET("/xrpc/app.bsky.graph.getMutes", s.HandleAppBskyGraphGetMutes) - e.GET("/xrpc/app.bsky.graph.getSuggestedFollowsByActor", s.HandleAppBskyGraphGetSuggestedFollowsByActor) - e.POST("/xrpc/app.bsky.graph.muteActor", s.HandleAppBskyGraphMuteActor) - e.POST("/xrpc/app.bsky.graph.muteActorList", s.HandleAppBskyGraphMuteActorList) - e.POST("/xrpc/app.bsky.graph.unmuteActor", s.HandleAppBskyGraphUnmuteActor) - e.POST("/xrpc/app.bsky.graph.unmuteActorList", s.HandleAppBskyGraphUnmuteActorList) - e.GET("/xrpc/app.bsky.notification.getUnreadCount", s.HandleAppBskyNotificationGetUnreadCount) - e.GET("/xrpc/app.bsky.notification.listNotifications", s.HandleAppBskyNotificationListNotifications) - e.POST("/xrpc/app.bsky.notification.registerPush", s.HandleAppBskyNotificationRegisterPush) - e.POST("/xrpc/app.bsky.notification.updateSeen", s.HandleAppBskyNotificationUpdateSeen) - e.GET("/xrpc/app.bsky.unspecced.getPopular", s.HandleAppBskyUnspeccedGetPopular) - e.GET("/xrpc/app.bsky.unspecced.getPopularFeedGenerators", s.HandleAppBskyUnspeccedGetPopularFeedGenerators) - e.GET("/xrpc/app.bsky.unspecced.getTimelineSkeleton", s.HandleAppBskyUnspeccedGetTimelineSkeleton) - e.GET("/xrpc/app.bsky.unspecced.searchActorsSkeleton", s.HandleAppBskyUnspeccedSearchActorsSkeleton) - e.GET("/xrpc/app.bsky.unspecced.searchPostsSkeleton", s.HandleAppBskyUnspeccedSearchPostsSkeleton) - return nil -} - -func (s *Server) HandleAppBskyActorGetPreferences(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetPreferences") - defer span.End() - var out *appbskytypes.ActorGetPreferences_Output - var handleErr error - // func (s *Server) handleAppBskyActorGetPreferences(ctx context.Context) (*appbskytypes.ActorGetPreferences_Output, error) - out, handleErr = s.handleAppBskyActorGetPreferences(ctx) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyActorGetProfile(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetProfile") - defer span.End() - actor := c.QueryParam("actor") - var out *appbskytypes.ActorDefs_ProfileViewDetailed - var handleErr error - // func (s *Server) handleAppBskyActorGetProfile(ctx context.Context,actor string) (*appbskytypes.ActorDefs_ProfileViewDetailed, error) - out, handleErr = s.handleAppBskyActorGetProfile(ctx, actor) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyActorGetProfiles(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetProfiles") - defer span.End() - - actors := c.QueryParams()["actors"] - var out *appbskytypes.ActorGetProfiles_Output - var handleErr error - // func (s *Server) handleAppBskyActorGetProfiles(ctx context.Context,actors []string) (*appbskytypes.ActorGetProfiles_Output, error) - out, handleErr = s.handleAppBskyActorGetProfiles(ctx, actors) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyActorGetSuggestions(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetSuggestions") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.ActorGetSuggestions_Output - var handleErr error - // func (s *Server) handleAppBskyActorGetSuggestions(ctx context.Context,cursor string,limit int) (*appbskytypes.ActorGetSuggestions_Output, error) - out, handleErr = s.handleAppBskyActorGetSuggestions(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyActorPutPreferences(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorPutPreferences") - defer span.End() - - var body appbskytypes.ActorPutPreferences_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyActorPutPreferences(ctx context.Context,body *appbskytypes.ActorPutPreferences_Input) error - handleErr = s.handleAppBskyActorPutPreferences(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyActorSearchActors(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorSearchActors") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 25 - } - q := c.QueryParam("q") - term := c.QueryParam("term") - var out *appbskytypes.ActorSearchActors_Output - var handleErr error - // func (s *Server) handleAppBskyActorSearchActors(ctx context.Context,cursor string,limit int,q string,term string) (*appbskytypes.ActorSearchActors_Output, error) - out, handleErr = s.handleAppBskyActorSearchActors(ctx, cursor, limit, q, term) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyActorSearchActorsTypeahead(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorSearchActorsTypeahead") - defer span.End() - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 10 - } - q := c.QueryParam("q") - term := c.QueryParam("term") - var out *appbskytypes.ActorSearchActorsTypeahead_Output - var handleErr error - // func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context,limit int,q string,term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) - out, handleErr = s.handleAppBskyActorSearchActorsTypeahead(ctx, limit, q, term) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedDescribeFeedGenerator(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedDescribeFeedGenerator") - defer span.End() - var out *appbskytypes.FeedDescribeFeedGenerator_Output - var handleErr error - // func (s *Server) handleAppBskyFeedDescribeFeedGenerator(ctx context.Context) (*appbskytypes.FeedDescribeFeedGenerator_Output, error) - out, handleErr = s.handleAppBskyFeedDescribeFeedGenerator(ctx) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetActorFeeds(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetActorFeeds") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetActorFeeds_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetActorFeeds(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.FeedGetActorFeeds_Output, error) - out, handleErr = s.handleAppBskyFeedGetActorFeeds(ctx, actor, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetActorLikes(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetActorLikes") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetActorLikes_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetActorLikes(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.FeedGetActorLikes_Output, error) - out, handleErr = s.handleAppBskyFeedGetActorLikes(ctx, actor, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetAuthorFeed(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetAuthorFeed") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - filter := c.QueryParam("filter") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetAuthorFeed_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetAuthorFeed(ctx context.Context,actor string,cursor string,filter string,limit int) (*appbskytypes.FeedGetAuthorFeed_Output, error) - out, handleErr = s.handleAppBskyFeedGetAuthorFeed(ctx, actor, cursor, filter, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetFeed(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeed") - defer span.End() - cursor := c.QueryParam("cursor") - feed := c.QueryParam("feed") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetFeed_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetFeed(ctx context.Context,cursor string,feed string,limit int) (*appbskytypes.FeedGetFeed_Output, error) - out, handleErr = s.handleAppBskyFeedGetFeed(ctx, cursor, feed, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetFeedGenerator(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedGenerator") - defer span.End() - feed := c.QueryParam("feed") - var out *appbskytypes.FeedGetFeedGenerator_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetFeedGenerator(ctx context.Context,feed string) (*appbskytypes.FeedGetFeedGenerator_Output, error) - out, handleErr = s.handleAppBskyFeedGetFeedGenerator(ctx, feed) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetFeedGenerators(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedGenerators") - defer span.End() - - feeds := c.QueryParams()["feeds"] - var out *appbskytypes.FeedGetFeedGenerators_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetFeedGenerators(ctx context.Context,feeds []string) (*appbskytypes.FeedGetFeedGenerators_Output, error) - out, handleErr = s.handleAppBskyFeedGetFeedGenerators(ctx, feeds) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetFeedSkeleton(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedSkeleton") - defer span.End() - cursor := c.QueryParam("cursor") - feed := c.QueryParam("feed") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetFeedSkeleton_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context,cursor string,feed string,limit int) (*appbskytypes.FeedGetFeedSkeleton_Output, error) - out, handleErr = s.handleAppBskyFeedGetFeedSkeleton(ctx, cursor, feed, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetLikes(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetLikes") - defer span.End() - cid := c.QueryParam("cid") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - uri := c.QueryParam("uri") - var out *appbskytypes.FeedGetLikes_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetLikes(ctx context.Context,cid string,cursor string,limit int,uri string) (*appbskytypes.FeedGetLikes_Output, error) - out, handleErr = s.handleAppBskyFeedGetLikes(ctx, cid, cursor, limit, uri) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetListFeed(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetListFeed") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - list := c.QueryParam("list") - var out *appbskytypes.FeedGetListFeed_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetListFeed(ctx context.Context,cursor string,limit int,list string) (*appbskytypes.FeedGetListFeed_Output, error) - out, handleErr = s.handleAppBskyFeedGetListFeed(ctx, cursor, limit, list) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetPostThread(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetPostThread") - defer span.End() - - var depth int - if p := c.QueryParam("depth"); p != "" { - var err error - depth, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - depth = 6 - } - - var parentHeight int - if p := c.QueryParam("parentHeight"); p != "" { - var err error - parentHeight, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - parentHeight = 80 - } - uri := c.QueryParam("uri") - var out *appbskytypes.FeedGetPostThread_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetPostThread(ctx context.Context,depth int,parentHeight int,uri string) (*appbskytypes.FeedGetPostThread_Output, error) - out, handleErr = s.handleAppBskyFeedGetPostThread(ctx, depth, parentHeight, uri) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetPosts(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetPosts") - defer span.End() - - uris := c.QueryParams()["uris"] - var out *appbskytypes.FeedGetPosts_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetPosts(ctx context.Context,uris []string) (*appbskytypes.FeedGetPosts_Output, error) - out, handleErr = s.handleAppBskyFeedGetPosts(ctx, uris) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetRepostedBy(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetRepostedBy") - defer span.End() - cid := c.QueryParam("cid") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - uri := c.QueryParam("uri") - var out *appbskytypes.FeedGetRepostedBy_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetRepostedBy(ctx context.Context,cid string,cursor string,limit int,uri string) (*appbskytypes.FeedGetRepostedBy_Output, error) - out, handleErr = s.handleAppBskyFeedGetRepostedBy(ctx, cid, cursor, limit, uri) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetSuggestedFeeds(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetSuggestedFeeds") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetSuggestedFeeds_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetSuggestedFeeds(ctx context.Context,cursor string,limit int) (*appbskytypes.FeedGetSuggestedFeeds_Output, error) - out, handleErr = s.handleAppBskyFeedGetSuggestedFeeds(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedGetTimeline(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetTimeline") - defer span.End() - algorithm := c.QueryParam("algorithm") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.FeedGetTimeline_Output - var handleErr error - // func (s *Server) handleAppBskyFeedGetTimeline(ctx context.Context,algorithm string,cursor string,limit int) (*appbskytypes.FeedGetTimeline_Output, error) - out, handleErr = s.handleAppBskyFeedGetTimeline(ctx, algorithm, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyFeedSearchPosts(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedSearchPosts") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 25 - } - q := c.QueryParam("q") - var out *appbskytypes.FeedSearchPosts_Output - var handleErr error - // func (s *Server) handleAppBskyFeedSearchPosts(ctx context.Context,cursor string,limit int,q string) (*appbskytypes.FeedSearchPosts_Output, error) - out, handleErr = s.handleAppBskyFeedSearchPosts(ctx, cursor, limit, q) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetBlocks(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetBlocks") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetBlocks_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetBlocks(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetBlocks_Output, error) - out, handleErr = s.handleAppBskyGraphGetBlocks(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetFollowers(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetFollowers") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetFollowers_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetFollowers(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.GraphGetFollowers_Output, error) - out, handleErr = s.handleAppBskyGraphGetFollowers(ctx, actor, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetFollows(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetFollows") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetFollows_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetFollows(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.GraphGetFollows_Output, error) - out, handleErr = s.handleAppBskyGraphGetFollows(ctx, actor, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetList(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetList") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - list := c.QueryParam("list") - var out *appbskytypes.GraphGetList_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetList(ctx context.Context,cursor string,limit int,list string) (*appbskytypes.GraphGetList_Output, error) - out, handleErr = s.handleAppBskyGraphGetList(ctx, cursor, limit, list) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetListBlocks(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetListBlocks") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetListBlocks_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetListBlocks(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetListBlocks_Output, error) - out, handleErr = s.handleAppBskyGraphGetListBlocks(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetListMutes(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetListMutes") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetListMutes_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetListMutes(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetListMutes_Output, error) - out, handleErr = s.handleAppBskyGraphGetListMutes(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetLists(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetLists") - defer span.End() - actor := c.QueryParam("actor") - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetLists_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetLists(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.GraphGetLists_Output, error) - out, handleErr = s.handleAppBskyGraphGetLists(ctx, actor, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetMutes(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetMutes") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.GraphGetMutes_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetMutes(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetMutes_Output, error) - out, handleErr = s.handleAppBskyGraphGetMutes(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphGetSuggestedFollowsByActor(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetSuggestedFollowsByActor") - defer span.End() - actor := c.QueryParam("actor") - var out *appbskytypes.GraphGetSuggestedFollowsByActor_Output - var handleErr error - // func (s *Server) handleAppBskyGraphGetSuggestedFollowsByActor(ctx context.Context,actor string) (*appbskytypes.GraphGetSuggestedFollowsByActor_Output, error) - out, handleErr = s.handleAppBskyGraphGetSuggestedFollowsByActor(ctx, actor) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyGraphMuteActor(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphMuteActor") - defer span.End() - - var body appbskytypes.GraphMuteActor_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyGraphMuteActor(ctx context.Context,body *appbskytypes.GraphMuteActor_Input) error - handleErr = s.handleAppBskyGraphMuteActor(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyGraphMuteActorList(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphMuteActorList") - defer span.End() - - var body appbskytypes.GraphMuteActorList_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyGraphMuteActorList(ctx context.Context,body *appbskytypes.GraphMuteActorList_Input) error - handleErr = s.handleAppBskyGraphMuteActorList(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyGraphUnmuteActor(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphUnmuteActor") - defer span.End() - - var body appbskytypes.GraphUnmuteActor_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyGraphUnmuteActor(ctx context.Context,body *appbskytypes.GraphUnmuteActor_Input) error - handleErr = s.handleAppBskyGraphUnmuteActor(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyGraphUnmuteActorList(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphUnmuteActorList") - defer span.End() - - var body appbskytypes.GraphUnmuteActorList_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyGraphUnmuteActorList(ctx context.Context,body *appbskytypes.GraphUnmuteActorList_Input) error - handleErr = s.handleAppBskyGraphUnmuteActorList(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyNotificationGetUnreadCount(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyNotificationGetUnreadCount") - defer span.End() - seenAt := c.QueryParam("seenAt") - var out *appbskytypes.NotificationGetUnreadCount_Output - var handleErr error - // func (s *Server) handleAppBskyNotificationGetUnreadCount(ctx context.Context,seenAt string) (*appbskytypes.NotificationGetUnreadCount_Output, error) - out, handleErr = s.handleAppBskyNotificationGetUnreadCount(ctx, seenAt) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyNotificationListNotifications(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyNotificationListNotifications") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - seenAt := c.QueryParam("seenAt") - var out *appbskytypes.NotificationListNotifications_Output - var handleErr error - // func (s *Server) handleAppBskyNotificationListNotifications(ctx context.Context,cursor string,limit int,seenAt string) (*appbskytypes.NotificationListNotifications_Output, error) - out, handleErr = s.handleAppBskyNotificationListNotifications(ctx, cursor, limit, seenAt) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyNotificationRegisterPush(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyNotificationRegisterPush") - defer span.End() - - var body appbskytypes.NotificationRegisterPush_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyNotificationRegisterPush(ctx context.Context,body *appbskytypes.NotificationRegisterPush_Input) error - handleErr = s.handleAppBskyNotificationRegisterPush(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyNotificationUpdateSeen(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyNotificationUpdateSeen") - defer span.End() - - var body appbskytypes.NotificationUpdateSeen_Input - if err := c.Bind(&body); err != nil { - return err - } - var handleErr error - // func (s *Server) handleAppBskyNotificationUpdateSeen(ctx context.Context,body *appbskytypes.NotificationUpdateSeen_Input) error - handleErr = s.handleAppBskyNotificationUpdateSeen(ctx, &body) - if handleErr != nil { - return handleErr - } - return nil -} - -func (s *Server) HandleAppBskyUnspeccedGetPopular(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedGetPopular") - defer span.End() - cursor := c.QueryParam("cursor") - - var includeNsfw bool - if p := c.QueryParam("includeNsfw"); p != "" { - var err error - includeNsfw, err = strconv.ParseBool(p) - if err != nil { - return err - } - } else { - includeNsfw = false - } - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.UnspeccedGetPopular_Output - var handleErr error - // func (s *Server) handleAppBskyUnspeccedGetPopular(ctx context.Context,cursor string,includeNsfw bool,limit int) (*appbskytypes.UnspeccedGetPopular_Output, error) - out, handleErr = s.handleAppBskyUnspeccedGetPopular(ctx, cursor, includeNsfw, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyUnspeccedGetPopularFeedGenerators(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedGetPopularFeedGenerators") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - query := c.QueryParam("query") - var out *appbskytypes.UnspeccedGetPopularFeedGenerators_Output - var handleErr error - // func (s *Server) handleAppBskyUnspeccedGetPopularFeedGenerators(ctx context.Context,cursor string,limit int,query string) (*appbskytypes.UnspeccedGetPopularFeedGenerators_Output, error) - out, handleErr = s.handleAppBskyUnspeccedGetPopularFeedGenerators(ctx, cursor, limit, query) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyUnspeccedGetTimelineSkeleton(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedGetTimelineSkeleton") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 50 - } - var out *appbskytypes.UnspeccedGetTimelineSkeleton_Output - var handleErr error - // func (s *Server) handleAppBskyUnspeccedGetTimelineSkeleton(ctx context.Context,cursor string,limit int) (*appbskytypes.UnspeccedGetTimelineSkeleton_Output, error) - out, handleErr = s.handleAppBskyUnspeccedGetTimelineSkeleton(ctx, cursor, limit) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyUnspeccedSearchActorsSkeleton(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedSearchActorsSkeleton") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 25 - } - q := c.QueryParam("q") - - var typeahead *bool - if p := c.QueryParam("typeahead"); p != "" { - typeahead_val, err := strconv.ParseBool(p) - if err != nil { - return err - } - typeahead = &typeahead_val - } - var out *appbskytypes.UnspeccedSearchActorsSkeleton_Output - var handleErr error - // func (s *Server) handleAppBskyUnspeccedSearchActorsSkeleton(ctx context.Context,cursor string,limit int,q string,typeahead *bool) (*appbskytypes.UnspeccedSearchActorsSkeleton_Output, error) - out, handleErr = s.handleAppBskyUnspeccedSearchActorsSkeleton(ctx, cursor, limit, q, typeahead) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - -func (s *Server) HandleAppBskyUnspeccedSearchPostsSkeleton(c echo.Context) error { - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedSearchPostsSkeleton") - defer span.End() - cursor := c.QueryParam("cursor") - - var limit int - if p := c.QueryParam("limit"); p != "" { - var err error - limit, err = strconv.Atoi(p) - if err != nil { - return err - } - } else { - limit = 25 - } - q := c.QueryParam("q") - var out *appbskytypes.UnspeccedSearchPostsSkeleton_Output - var handleErr error - // func (s *Server) handleAppBskyUnspeccedSearchPostsSkeleton(ctx context.Context,cursor string,limit int,q string) (*appbskytypes.UnspeccedSearchPostsSkeleton_Output, error) - out, handleErr = s.handleAppBskyUnspeccedSearchPostsSkeleton(ctx, cursor, limit, q) - if handleErr != nil { - return handleErr - } - return c.JSON(200, out) -} - func (s *Server) RegisterHandlersComAtproto(e *echo.Echo) error { e.POST("/xrpc/com.atproto.admin.disableAccountInvites", s.HandleComAtprotoAdminDisableAccountInvites) e.POST("/xrpc/com.atproto.admin.disableInviteCodes", s.HandleComAtprotoAdminDisableInviteCodes)