All 384 routes, the Mastodon API, the client API and the frozen federation paths, are read from one class with one nested class per controller. Their values are unchanged, checked one by one against the old literals; decePubClient keeps its own APIs class. Checked against GoToSocial in the pasture: 64 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4YtEJrgxG12Pc39Fai8Bd
This commit is contained in:
1 parent
0f73f69239
commit
739a1603ca
47 files changed
+952
-373
No files matched your search
@@ -31,7 +31,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
IEnumerable<T> Window<T>(IEnumerable<T> items, int fallback, int max) =>
|
||||
items.Skip(Math.Max(0, Params.Int("offset") ?? 0)).Take(Limit(fallback, max));
|
||||
|
||||
[HttpGet("/api/v1/trends"), HttpGet("/api/v1/trends/tags"), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Trends.GET_Tags), HttpGet(ApiPaths.Trends.GET_TagsV1), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<IActionResult> Tags(CancellationToken token)
|
||||
{
|
||||
var followed = MyId == default
|
||||
@@ -46,7 +46,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
}).ToList());
|
||||
}
|
||||
|
||||
[HttpGet("/api/v1/trends/statuses"), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Trends.GET_Statuses), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<IActionResult> Statuses(CancellationToken token)
|
||||
{
|
||||
var ids = Window(await trendService.Statuses(token), 20, 40).ToList();
|
||||
@@ -54,7 +54,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
return Json(await mapper.Statuses(ids.Where(posts.ContainsKey).Select(id => posts[id]).ToList(), MyId, token));
|
||||
}
|
||||
|
||||
[HttpGet("/api/v1/trends/links"), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Trends.GET_Links), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<IActionResult> Links(CancellationToken token)
|
||||
{
|
||||
var trends = Window(await trendService.Links(token), 10, 20).ToList();
|
||||
@@ -75,7 +75,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
|
||||
// order=active: by their latest public post PrivaPub holds; order=new: by when they say they joined, which for a
|
||||
// persona is its published day (never its creation, so personas made together are not told apart by their order)
|
||||
[HttpGet("/api/v1/directory"), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Trends.GET_Directory), Scope("read", requiresUser: false), Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<IActionResult> Directory(CancellationToken token)
|
||||
{
|
||||
var offset = Math.Max(0, Params.Int("offset") ?? 0);
|
||||
|
||||
Reference in new issue
Block a user