Every route is a constant in ApiPaths
Build / Build (push) Successful in 35s

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:
thepraandClaude Opus 5.5 committed 2026-11-10 01:59:20 +01:00
1 parent 0f73f69239
commit 739a1603ca
47 files changed
+952 -373

No files matched your search

@@ -20,7 +20,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
MastodonMapper mapper,
IReactions reactionService) : MastodonController
{
[HttpGet("/api/v1/pleroma/statuses/{id}/reactions"), Scope("read:statuses", requiresUser: false), AllowAnonymous]
[HttpGet(ApiPaths.Reactions.GET_M_List), Scope("read:statuses", requiresUser: false), AllowAnonymous]
public async Task<IActionResult> List(string id, CancellationToken token)
{
var post = await Visible(id, token);
@@ -38,7 +38,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
}).OrderByDescending(r => r.count).ToList());
}
[HttpPut("/api/v1/pleroma/statuses/{id}/reactions/{emoji}"), Scope("write:favourites")]
[HttpPut(ApiPaths.Reactions.PUT_M_React), Scope("write:favourites")]
public async Task<IActionResult> React(string id, string emoji, CancellationToken token)
{
var post = await Visible(id, token);
@@ -49,7 +49,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
return Json(await mapper.Status(post, MyId, token));
}
[HttpDelete("/api/v1/pleroma/statuses/{id}/reactions/{emoji}"), Scope("write:favourites")]
[HttpDelete(ApiPaths.Reactions.DELETE_M_Unreact), Scope("write:favourites")]
public async Task<IActionResult> Unreact(string id, string emoji, CancellationToken token)
{
var post = await Visible(id, token);