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

@@ -8,22 +8,22 @@ using PrivaPub.Extensions;
namespace PrivaPub.Controllers.ClientToServer
{
[ApiController,
Route("clientapi/timeline"),
Route(ApiPaths.Timeline.Prefix),
Authorize(Policy = Policies.IsUser)]
public class TimelineController(
ITimelineService timelines) : ControllerBase
{
[HttpGet, Route("/clientapi/timeline/home")]
[HttpGet, Route(ApiPaths.Timeline.GET_Home)]
public async Task<IActionResult> Home([FromQuery] string avatarId, [FromQuery(Name = "max_id")] string maxId, [FromQuery] int limit = 20,
CancellationToken token = default) =>
Answer(await timelines.Home(User.GetUserId(), avatarId, maxId, limit, token));
[HttpGet, Route("/clientapi/notifications")]
[HttpGet, Route(ApiPaths.Timeline.GET_Notifications)]
public async Task<IActionResult> Notifications([FromQuery] string avatarId, [FromQuery(Name = "max_id")] string maxId, [FromQuery] int limit = 20,
CancellationToken token = default) =>
Answer(await timelines.Notifications(User.GetUserId(), avatarId, maxId, limit, token));
[HttpPost, Route("/clientapi/notifications/read")]
[HttpPost, Route(ApiPaths.Timeline.POST_Read)]
public async Task<IActionResult> Read([FromQuery] string avatarId, CancellationToken token) =>
Answer(await timelines.MarkNotificationsRead(User.GetUserId(), avatarId, token));