this repo has no description
0
fork

Configure Feed

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

pds: remove deprecated endpoints (scenes)

+3 -153
+3 -42
pds/handlers.go
··· 14 14 jwt "github.com/lestrrat-go/jwx/jwt" 15 15 ) 16 16 17 - func (s *Server) handleAppBskyActorCreateScene(ctx context.Context, input *appbskytypes.ActorCreateScene_Input) (*appbskytypes.ActorCreateScene_Output, error) { 18 - u, err := s.getUser(ctx) 19 - if err != nil { 20 - return nil, err 21 - } 22 - 23 - _ = u 24 - panic("nyi") 25 - 26 - /* 27 - return &appbskytypes.ActorCreateScene_Output{ 28 - Declaration: scinfo.Declaration, 29 - Did: scinfo.Did, 30 - Handle: scinfo.Handle, 31 - }, nil 32 - */ 33 - } 34 - 35 17 func (s *Server) handleAppBskyActorGetProfile(ctx context.Context, actor string) (*appbskytypes.ActorGetProfile_Output, error) { 36 18 profile, err := s.feedgen.GetActorProfile(ctx, actor) 37 19 if err != nil { ··· 45 27 Cid: profile.DeclRefCid, 46 28 ActorType: profile.Type, 47 29 }, 48 - Description: nil, 49 - PostsCount: profile.Posts, 50 - FollowsCount: profile.Following, 51 - //MembersCount: 0, // TODO: 30 + Description: nil, 31 + PostsCount: profile.Posts, 32 + FollowsCount: profile.Following, 52 33 Handle: profile.Handle, 53 34 Creator: "", //TODO: 54 35 DisplayName: &profile.DisplayName, ··· 286 267 } 287 268 } 288 269 289 - func (s *Server) handleAppBskyGraphGetAssertions(ctx context.Context, assertion string, author string, before string, confirmed *bool, limit int, subject string) (*appbskytypes.GraphGetAssertions_Output, error) { 290 - panic("not yet implemented") 291 - } 292 - 293 270 func (s *Server) handleAppBskyGraphGetFollowers(ctx context.Context, before string, limit int, user string) (*appbskytypes.GraphGetFollowers_Output, error) { 294 271 panic("not yet implemented") 295 272 } ··· 321 298 } 322 299 323 300 return &out, nil 324 - } 325 - 326 - func (s *Server) handleAppBskyGraphGetMembers(ctx context.Context, actor string, before string, limit int) (*appbskytypes.GraphGetMembers_Output, error) { 327 - panic("not yet implemented") 328 - } 329 - 330 - func (s *Server) handleAppBskyGraphGetMemberships(ctx context.Context, actor string, before string, limit int) (*appbskytypes.GraphGetMemberships_Output, error) { 331 - ai, err := s.feedgen.GetActorProfile(ctx, actor) 332 - if err != nil { 333 - return nil, err 334 - } 335 - 336 - return &appbskytypes.GraphGetMemberships_Output{ 337 - Subject: ai.ActorRef(), 338 - Memberships: []*appbskytypes.GraphGetMemberships_Membership{}, 339 - }, nil 340 301 } 341 302 342 303 func (s *Server) handleAppBskyNotificationGetCount(ctx context.Context) (*appbskytypes.NotificationGetCount_Output, error) {
-111
pds/stubs.go
··· 11 11 ) 12 12 13 13 func (s *Server) RegisterHandlersAppBsky(e *echo.Echo) error { 14 - e.POST("/xrpc/app.bsky.actor.createScene", s.HandleAppBskyActorCreateScene) 15 14 e.GET("/xrpc/app.bsky.actor.getProfile", s.HandleAppBskyActorGetProfile) 16 15 e.GET("/xrpc/app.bsky.actor.getSuggestions", s.HandleAppBskyActorGetSuggestions) 17 16 e.GET("/xrpc/app.bsky.actor.search", s.HandleAppBskyActorSearch) ··· 23 22 e.GET("/xrpc/app.bsky.feed.getTimeline", s.HandleAppBskyFeedGetTimeline) 24 23 e.GET("/xrpc/app.bsky.feed.getVotes", s.HandleAppBskyFeedGetVotes) 25 24 e.POST("/xrpc/app.bsky.feed.setVote", s.HandleAppBskyFeedSetVote) 26 - e.GET("/xrpc/app.bsky.graph.getAssertions", s.HandleAppBskyGraphGetAssertions) 27 25 e.GET("/xrpc/app.bsky.graph.getFollowers", s.HandleAppBskyGraphGetFollowers) 28 26 e.GET("/xrpc/app.bsky.graph.getFollows", s.HandleAppBskyGraphGetFollows) 29 - e.GET("/xrpc/app.bsky.graph.getMembers", s.HandleAppBskyGraphGetMembers) 30 - e.GET("/xrpc/app.bsky.graph.getMemberships", s.HandleAppBskyGraphGetMemberships) 31 27 e.GET("/xrpc/app.bsky.graph.getMutes", s.HandleAppBskyGraphGetMutes) 32 28 e.POST("/xrpc/app.bsky.graph.mute", s.HandleAppBskyGraphMute) 33 29 e.POST("/xrpc/app.bsky.graph.unmute", s.HandleAppBskyGraphUnmute) ··· 36 32 e.POST("/xrpc/app.bsky.notification.updateSeen", s.HandleAppBskyNotificationUpdateSeen) 37 33 38 34 return nil 39 - } 40 - 41 - func (s *Server) HandleAppBskyActorCreateScene(c echo.Context) error { 42 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorCreateScene") 43 - defer span.End() 44 - 45 - var body appbskytypes.ActorCreateScene_Input 46 - if err := c.Bind(&body); err != nil { 47 - return err 48 - } 49 - var out *appbskytypes.ActorCreateScene_Output 50 - var handleErr error 51 - // func (s *Server) handleAppBskyActorCreateScene(ctx context.Context,body *appbskytypes.ActorCreateScene_Input) (*appbskytypes.ActorCreateScene_Output, error) 52 - out, handleErr = s.handleAppBskyActorCreateScene(ctx, &body) 53 - if handleErr != nil { 54 - return handleErr 55 - } 56 - return c.JSON(200, out) 57 35 } 58 36 59 37 func (s *Server) HandleAppBskyActorGetProfile(c echo.Context) error { ··· 312 290 return c.JSON(200, out) 313 291 } 314 292 315 - func (s *Server) HandleAppBskyGraphGetAssertions(c echo.Context) error { 316 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetAssertions") 317 - defer span.End() 318 - assertion := c.QueryParam("assertion") 319 - author := c.QueryParam("author") 320 - before := c.QueryParam("before") 321 - 322 - var confirmed *bool 323 - if p := c.QueryParam("confirmed"); p != "" { 324 - confirmed_val, err := strconv.ParseBool(p) 325 - if err != nil { 326 - return err 327 - } 328 - confirmed = &confirmed_val 329 - } 330 - 331 - var limit int 332 - if p := c.QueryParam("limit"); p != "" { 333 - var err error 334 - limit, err = strconv.Atoi(p) 335 - if err != nil { 336 - return err 337 - } 338 - } else { 339 - limit = 50 340 - } 341 - subject := c.QueryParam("subject") 342 - var out *appbskytypes.GraphGetAssertions_Output 343 - var handleErr error 344 - // func (s *Server) handleAppBskyGraphGetAssertions(ctx context.Context,assertion string,author string,before string,confirmed *bool,limit int,subject string) (*appbskytypes.GraphGetAssertions_Output, error) 345 - out, handleErr = s.handleAppBskyGraphGetAssertions(ctx, assertion, author, before, confirmed, limit, subject) 346 - if handleErr != nil { 347 - return handleErr 348 - } 349 - return c.JSON(200, out) 350 - } 351 - 352 293 func (s *Server) HandleAppBskyGraphGetFollowers(c echo.Context) error { 353 294 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetFollowers") 354 295 defer span.End() ··· 395 336 var handleErr error 396 337 // func (s *Server) handleAppBskyGraphGetFollows(ctx context.Context,before string,limit int,user string) (*appbskytypes.GraphGetFollows_Output, error) 397 338 out, handleErr = s.handleAppBskyGraphGetFollows(ctx, before, limit, user) 398 - if handleErr != nil { 399 - return handleErr 400 - } 401 - return c.JSON(200, out) 402 - } 403 - 404 - func (s *Server) HandleAppBskyGraphGetMembers(c echo.Context) error { 405 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetMembers") 406 - defer span.End() 407 - actor := c.QueryParam("actor") 408 - before := c.QueryParam("before") 409 - 410 - var limit int 411 - if p := c.QueryParam("limit"); p != "" { 412 - var err error 413 - limit, err = strconv.Atoi(p) 414 - if err != nil { 415 - return err 416 - } 417 - } else { 418 - limit = 50 419 - } 420 - var out *appbskytypes.GraphGetMembers_Output 421 - var handleErr error 422 - // func (s *Server) handleAppBskyGraphGetMembers(ctx context.Context,actor string,before string,limit int) (*appbskytypes.GraphGetMembers_Output, error) 423 - out, handleErr = s.handleAppBskyGraphGetMembers(ctx, actor, before, limit) 424 - if handleErr != nil { 425 - return handleErr 426 - } 427 - return c.JSON(200, out) 428 - } 429 - 430 - func (s *Server) HandleAppBskyGraphGetMemberships(c echo.Context) error { 431 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetMemberships") 432 - defer span.End() 433 - actor := c.QueryParam("actor") 434 - before := c.QueryParam("before") 435 - 436 - var limit int 437 - if p := c.QueryParam("limit"); p != "" { 438 - var err error 439 - limit, err = strconv.Atoi(p) 440 - if err != nil { 441 - return err 442 - } 443 - } else { 444 - limit = 50 445 - } 446 - var out *appbskytypes.GraphGetMemberships_Output 447 - var handleErr error 448 - // func (s *Server) handleAppBskyGraphGetMemberships(ctx context.Context,actor string,before string,limit int) (*appbskytypes.GraphGetMemberships_Output, error) 449 - out, handleErr = s.handleAppBskyGraphGetMemberships(ctx, actor, before, limit) 450 339 if handleErr != nil { 451 340 return handleErr 452 341 }