five-on-it / apps/api/src/respect-routes
apps/api/src/respect-routes
The standings' routes (GAME_DESIGN §14, TECHNICAL_SPECS §9.6): a player's own Respect, tier, season and conduct band; another player's Respect and tier; the leaderboard of a season or of all time; what a run did for one of its players, endorsing a player of it and rating its mission; the admins' and moderators' view of an account's conduct and an admin's adjustment (with a note, in the audit log); a moderator's upholding of a report of a player (its conduct lowered, in the audit log); a player's own data's export and an admin's erasing of an account's standing; and, with FOI_DEBUG=1 alone, the tests' seeding of a standing. The rules are standing.ts', the service respect.ts'.
Where Respect is not shown (FOI_RESPECT=shadow or off) the players' routes answer 404; the admins' and moderators' still answer (shadow keeps it all, to tune on real runs).
| Route | Who | What |
|---|---|---|
GET /me/standing | signed in | The caller's Respect, tier, the next tier and what it needs, the season's Respect, the conduct band and why it moved lately (StandingView); a guest's is empty. |
GET /me/standing/export | signed in | Everything kept of the caller's standing: the standing (the conduct's number too), every ledger line, the endorsements, the ratings of missions. |
GET /players/:id/standing | anyone | A player's name, Respect and tier (PublicStanding). |
GET /leaderboard?season=&limit= | anyone | The season's (2026Q4, the current by default; all: of all time) players by Respect, names and tiers (LeaderboardView). |
GET /runs/:id/standing | its players | What the run did for the caller (RunStandingView): its Respect step by step, the endorsements, the mission's rating. |
POST /runs/:id/endorse {account} | its players | Endorses a player of the run: what it added. |
POST /runs/:id/rating {stars} | its players | Rates the run's mission's version (again: replaced). |
GET /admin/accounts/:id/standing | admins, moderators | An account's Respect, its conduct's number and band, its recent ledger. |
POST /admin/accounts/:id/conduct {delta | to, note} | admins | Adjusts an account's conduct, with a note (the audit log: conduct). |
DELETE /admin/accounts/:id/standing {note} | admins | Erases an account's standing (its deletion on request; the audit log: erase). |
POST /moderation/reports/:id/uphold {note?} | moderators | Upholds an open report of a player: actioned, their conduct lowered by 1,000 (the audit log: uphold). |
PUT /debug/standing/:id {respect?, conduct?, skill?} | an admin, or a request from this machine; with FOI_DEBUG=1 alone | Sets an account's standing, for the tests. |