* checkpoint

* server compiles again

* fmt

* checkpoint

* last one out, get the lights

* euston station

* like, mostly good. I'm under the ocean right now.

* fix: some nonsense AI stuff

* fix: new eslint rules, and cleanup imports across the board

* feat: folder slug rewrite, email logic change, too

* fix: register must use txn not db

* checkpoint
This commit is contained in:
zk
2026-04-20 23:11:16 +01:00
committed by GitHub
parent edda03e916
commit 2bc4c3a628
1073 changed files with 52259 additions and 56015 deletions
+11 -11
View File
@@ -8,7 +8,7 @@ For user-specific target endpoints, such as subscriptions, see [UGPT-Target Endp
## Retrieve this game's recently achieved targets
`GET /api/v1/games/:game/:playtype/targets/recently-achieved`
`GET /api/v1/games/:gameGroup/:playtype/targets/recently-achieved`
!!! info
This endpoint returns the 100 most recently achieved goal subscriptions, and 50 most recently achieved quest subscriptions.
@@ -69,7 +69,7 @@ GET /api/v1/games/iidx/SP/targets/recently-achieved
## Retrieve this game's recently interacted-with targets
`GET /api/v1/games/:game/:playtype/targets/recently-raised`
`GET /api/v1/games/:gameGroup/:playtype/targets/recently-raised`
!!! info
This endpoint returns the 100 most recently interacted-with goal subscriptions, and 50 most recently interacted-with quest subscriptions.
@@ -135,7 +135,7 @@ GET /api/v1/games/iidx/SP/targets/recently-raised
## Get the most popular goals for this GPT.
`GET /api/v1/games/:game/:playtype/targets/goals/popular`
`GET /api/v1/games/:gameGroup/:playtype/targets/goals/popular`
### Parameters
@@ -152,7 +152,7 @@ N/A
#### Request
```
GET /api/v1/games/:game/:playtype/targets/goals/popular
GET /api/v1/games/:gameGroup/:playtype/targets/goals/popular
```
#### Response
@@ -174,7 +174,7 @@ GET /api/v1/games/:game/:playtype/targets/goals/popular
## Retrieve information about a specific goal and its subscribers.
`GET /api/v1/games/:game/:playtype/targets/goals/:goalID`
`GET /api/v1/games/:gameGroup/:playtype/targets/goals/:goalID`
### Parameters
@@ -193,7 +193,7 @@ None.
## Evaluate a goal upon a user.
`GET /api/v1/games/:game/:playtype/targets/goals/:goalID/evaluate-for`
`GET /api/v1/games/:gameGroup/:playtype/targets/goals/:goalID/evaluate-for`
!!! note
This endpoint is notably in a bit of a strange position. It can't go under UGPT because
@@ -259,7 +259,7 @@ GET /api/v1/games/iidx/SP/targets/goals/some_goal_id/evaluate-for?userID=zkldi
## Search quests for this GPT.
`GET /api/v1/games/:game/:playtype/targets/quests`
`GET /api/v1/games/:gameGroup/:playtype/targets/quests`
!!! note
You might notice that there's no equivalent endpoint for goals.
@@ -284,7 +284,7 @@ You might notice that there's no equivalent endpoint for goals.
## Retrieve information about a specific quest, and who is subscribed to it.
`GET /api/v1/games/:game/:playtype/targets/quests/:questID`
`GET /api/v1/games/:gameGroup/:playtype/targets/quests/:questID`
### Parameters
@@ -304,7 +304,7 @@ N/A
## Evaluate a quest for a user, even if they aren't subscribed to it.
`GET /api/v1/games/:game/:playtype/targets/quests/:questID/evaluate-for`
`GET /api/v1/games/:gameGroup/:playtype/targets/quests/:questID/evaluate-for`
### Parameters
@@ -337,7 +337,7 @@ N/A
## Search Questlines
`GET /api/v1/games/:game/:playtype/targets/questlines`
`GET /api/v1/games/:gameGroup/:playtype/targets/questlines`
### Parameters
@@ -355,7 +355,7 @@ N/A
## Retrieve a questline with a specific ID.
`GET /api/v1/games/:game/:playtype/targets/questlines/:questlineID`
`GET /api/v1/games/:gameGroup/:playtype/targets/questlines/:questlineID`
### Parameters
+18 -18
View File
@@ -8,7 +8,7 @@ programmatically, you should see [Game Endpoints](./games.md).
## Retrieve Game:Playtype Configuration.
`GET /api/v1/games/:game/:playtype`
`GET /api/v1/games/:gameGroup/:playtype`
### Parameters
@@ -54,7 +54,7 @@ GET /api/v1/games/iidx/SP
## Retrieve the player leaderboard.
`GET /api/v1/games/:game/:playtype/leaderboard`
`GET /api/v1/games/:gameGroup/:playtype/leaderboard`
### Parameters
@@ -104,7 +104,7 @@ GET /api/v1/games/iidx/SP/leaderboard
## Retrieve a song and its charts.
`GET /api/v1/games/:game/:playtype/songs/:songID`
`GET /api/v1/games/:gameGroup/:playtype/songs/:songID`
### Parameters
@@ -154,7 +154,7 @@ GET /api/v1/games/iidx/SP/songs/1
## Get popular charts for this game + playtype.
`GET /api/v1/games/:game/:playtype/charts`
`GET /api/v1/games/:gameGroup/:playtype/charts`
### Parameters
@@ -227,7 +227,7 @@ GET /api/v1/games/iidx/SP/charts?search=AA
## Retrieve a chart at a specific ID.
`GET /api/v1/games/:game/:playtype/charts/:chartID`
`GET /api/v1/games/:gameGroup/:playtype/charts/:chartID`
### Parameters
@@ -270,7 +270,7 @@ GET /api/v1/games/iidx/SP/charts/some_chart_id
## Retrieve playcount for this chart.
`GET /api/v1/games/:game/:playtype/charts/:chartID/playcount`
`GET /api/v1/games/:gameGroup/:playtype/charts/:chartID/playcount`
### Parameters
@@ -290,7 +290,7 @@ Self-explanatory.
## Retrieve leaderboards for this chart.
`GET /api/v1/games/:game/:playtype/charts/:chartID/pbs`
`GET /api/v1/games/:gameGroup/:playtype/charts/:chartID/pbs`
### Parameters
@@ -342,7 +342,7 @@ GET /api/v1/games/iidx/SP/charts/some_chart/pbs
## Search for a user's PB on this chart.
`GET /api/v1/games/:game/:playtype/charts/:chartID/pbs/search`
`GET /api/v1/games/:gameGroup/:playtype/charts/:chartID/pbs/search`
### Parameters
@@ -352,7 +352,7 @@ GET /api/v1/games/iidx/SP/charts/some_chart/pbs
### Response
Same as `/api/v1/games/:game/:playtype/charts/:chartID/pbs`.
Same as `/api/v1/games/:gameGroup/:playtype/charts/:chartID/pbs`.
### Example
@@ -362,7 +362,7 @@ See Above.
## Search a GPT's folders.
`GET /api/v1/games/:game/:playtype/folders`
`GET /api/v1/games/:gameGroup/:playtype/folders`
### Parameters
@@ -399,7 +399,7 @@ GET /api/v1/games/iidx/SP/folders?search=12
## Retrieve information on a specific folderID
`GET /api/v1/games/:game/:playtype/folders/:folderID`
`GET /api/v1/games/:gameGroup/:playtype/folders/:folderID`
### Parameters
@@ -449,7 +449,7 @@ GET /api/v1/games/iidx/SP/folders/some_folder_id
## Return all the tables for this game
`GET /api/v1/games/:game/:playtype/tables`
`GET /api/v1/games/:gameGroup/:playtype/tables`
!!! note
Unlike the folders endpoint, this one doesn't have a search parameter. This is because we expect
@@ -496,7 +496,7 @@ GET /api/v1/games/bms/7K/tables
## Retrieve folder documents for a specific table.
`GET /api/v1/games/:game/:playtype/tables/:tableID`
`GET /api/v1/games/:gameGroup/:playtype/tables/:tableID`
### Parameters
@@ -536,7 +536,7 @@ GET /api/v1/games/bms/7K/tableID/insane
## Retrieve the PB leaderboard for this Game.
`GET /api/v1/games/:game/:playtype/pb-leaderboard`
`GET /api/v1/games/:gameGroup/:playtype/pb-leaderboard`
### Parameters
@@ -558,7 +558,7 @@ GET /api/v1/games/bms/7K/tableID/insane
## Get the distribution of players for a provided class.
`GET /api/v1/games/:game/:playtype/player-distribution`
`GET /api/v1/games/:gameGroup/:playtype/player-distribution`
### Parameters
@@ -596,7 +596,7 @@ GET /api/v1/games/bms/7K/player-distribution?class=stslDan
```
!!! info
You can find the humanised conversions for these classes in the gptConfig for this GPT.
You can find the humanised conversions for these classes in the gameConfig for this GPT.
See [tachi/common](https://github.com/zkldi/Tachi/tree/main/common) for more information.
@@ -604,7 +604,7 @@ You can find the humanised conversions for these classes in the gptConfig for th
## Retrieve recent class updates from all users on this game.
`GET /api/v1/games/:game/:playtype/player-distribution`
`GET /api/v1/games/:gameGroup/:playtype/player-distribution`
### Parameters
@@ -623,7 +623,7 @@ You can find the humanised conversions for these classes in the gptConfig for th
## Retrieve the most recent highlighted scores for this GPT.
`GET /api/v1/games/:game/:playtype/scores/highlighted`
`GET /api/v1/games/:gameGroup/:playtype/scores/highlighted`
### Parameters
+3 -3
View File
@@ -6,7 +6,7 @@ These endpoints are related to the Statistic Showcase feature.
## Evaluate this users set stats
`GET /api/v1/users/:userID/games/:game/:playtype/showcase`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/showcase`
### Parameters
@@ -53,7 +53,7 @@ GET /api/v1/users/1/games/iidx/SP/showcase
## Replace a user's stat showcase.
`PATCH /api/v1/users/:userID/games/:game/:playtype/showcase`
`PATCH /api/v1/users/:userID/games/:gameGroup/:playtype/showcase`
### Permissions
@@ -101,7 +101,7 @@ PATCH /api/v1/users/1/games/iidx/SP/showcase
## Evaluate a custom stat on this user.
`GET /api/v1/users/:userID/games/:game/:playtype/showcase/custom`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/showcase/custom`
### Parameters
+6 -6
View File
@@ -10,7 +10,7 @@ For user-specific target endpoints, such as subscriptions, see [UGPT-Target Endp
## Retrieve a user's recently achieved targets.
`GET /api/v1/users/:userID/games/:game/:playtype/targets/recently-achieved`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/targets/recently-achieved`
### Parameters
@@ -30,7 +30,7 @@ None.
## Retrieve a user's recently raised targets.
`GET /api/v1/users/:userID/games/:game/:playtype/targets/recently-raised`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/targets/recently-raised`
!!! info
Recently raised means that the user recently increased their `progress` on the target. It explicitly excludes achieved goals -- only things that they are getting closer to.
@@ -53,7 +53,7 @@ None.
## Retrieve this user's quest subscriptions.
`GET /api/v1/users/:userID/games/:game/:playtype/targets/quests`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/targets/quests`
### Parameters
@@ -70,7 +70,7 @@ None.
## Get a user's progress on a specific quest they are subscribed to.
`GET /api/v1/users/:userID/games/:game/:playtype/targets/quests/:questID`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/targets/quests/:questID`
!!! info
If you're looking to evaluate a quest against a user, without knowing whether they're
@@ -106,7 +106,7 @@ None.
## Subscribe to a quest.
`PUT /api/v1/users/:userID/games/:game/:playtype/targets/quests/:questID`
`PUT /api/v1/users/:userID/games/:gameGroup/:playtype/targets/quests/:questID`
### Permissions
@@ -130,7 +130,7 @@ None. (All relevant info is in the URL.)
## Unsubscribe from a quest.
`DELETE /api/v1/users/:userID/games/:game/:playtype/targets/quests/:questID`
`DELETE /api/v1/users/:userID/games/:gameGroup/:playtype/targets/quests/:questID`
### Permissions
+17 -17
View File
@@ -8,7 +8,7 @@ This scenario appears frequently, and is typically shortened to UGPT.
## Get information about a user's plays on a game + playtype.
`GET /api/v1/users/:userID/games/:game/:playtype`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype`
### Parameters
@@ -71,7 +71,7 @@ GET /api/v1/users/zkldi/games/iidx/SP
## Search a user's personal bests.
`GET /api/v1/users/:userID/games/:game/:playtype/pbs`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/pbs`
### Parameters
@@ -125,7 +125,7 @@ GET /api/v1/users/zkldimes/iidx/SP/pbs?search=Verfl
## Get a user's best 100 personal bests.
`GET /api/v1/users/:userID/games/:game/:playtype/pbs/best`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/pbs/best`
This returns the users' best 100 personal bests according
to the [Default Rating Algorithm](../../codebase/implementation-details/game-configuration) for this game.
@@ -204,7 +204,7 @@ GET /api/v1/users/zkldimes/iidx/SP/pbs/best?alg=BPI
## Returns all of a users personal bests.
`GET /api/v1/users/:userID/games/:game/:playtype/pbs/all`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/pbs/all`
### Parameters
@@ -258,7 +258,7 @@ GET /api/v1/users/zkldimes/iidx/SP/pbs/all
## Get A User's PB for a given chart.
`GET /api/v1/users/:userID/games/:game/:playtype/pbs/:chartID`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/pbs/:chartID`
### Parameters
@@ -302,7 +302,7 @@ GET /api/v1/users/1/games/iidx/SP/pbs/some_chart_id
## Search a user's individual scores.
`GET /api/v1/users/:userID/games/:game/:playtype/scores`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/scores`
### Parameters
@@ -365,7 +365,7 @@ GET /api/v1/users/zkldimes/iidx/SP/scores?search=Verfl
## Get a user's most recent 100 scores.
`GET /api/v1/users/:userID/games/:game/:playtype/scores/recent`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/scores/recent`
### Parameters
@@ -419,7 +419,7 @@ GET /api/v1/users/zkldimes/iidx/SP/scores/recent
## Search a user's sessions.
`GET /api/v1/users/:userID/games/:game/:playtype/sessions`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/sessions`
Searches the names of sessions from a given user. This
does not search session descriptions, nor does it search
@@ -461,7 +461,7 @@ GET /api/v1/users/zkldimes/iidx/SP/sessions?search=epic%20session
## Get a user's best 100 sessions.
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/best`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/sessions/best`
Retrieves a user's best 100 sessions according to the
game + playtypes default algorithm. The algorithm can
@@ -520,7 +520,7 @@ The default rating algorithm for IIDX:SP is `ktRating`.
## Get a user's most recent 100 sessions.
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/recent`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/sessions/recent`
Retrieves a user's most recent 100 sessions for this game.
@@ -540,7 +540,7 @@ None.
## Get a user's most recent session.
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/last`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/sessions/last`
!!! info
This endpoint will return 404 if the user has never had a
@@ -576,7 +576,7 @@ GET /api/v1/users/zkldimes/iidx/SP/sessions/last
## Get a user's most recent 100 highlighted sessions.
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/highlighted`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/sessions/highlighted`
Retrieves a user's most recent 100 highlighted sessions for this game.
@@ -622,7 +622,7 @@ GET /api/v1/users/zkldimes/iidx/SP/sessions/highlighted
## Get a user's most played charts.
`GET /api/v1/users/:userID/games/:game/:playtype/most-played`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/most-played`
### Parameters
@@ -689,7 +689,7 @@ GET /api/v1/users/zkldimes/iidx/SP/most-played
## Retrieve a leaderboard around a user.
`GET /api/v1/users/:userID/games/:game/:playtype/leaderboard-adjacent`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/leaderboard-adjacent`
### Parameters
@@ -768,7 +768,7 @@ GET /api/v1/users/zkldimes/iidx/SP/leaderboard-adjacent
## Retrieve this user's GPT stat history.
`GET /api/v1/users/:userID/games/:game/:playtype/history`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/history`
Every day, a user's game stats are snapshotted and saved. This returns the recent ones.
@@ -815,7 +815,7 @@ GET /api/v1/users/1/games/iidx/SP/history
## Retrieve this user's GPT settings.
`GET /api/v1/users/:userID/games/:game/:playtype/settings`
`GET /api/v1/users/:userID/games/:gameGroup/:playtype/settings`
!!! warning
Unlike most other applications, your settings are completely public. GPT Settings only concern
@@ -854,7 +854,7 @@ GET /api/v1/users/1/games/iidx/SP/settings
## Modify your UGPT settings.
`PATCH /api/v1/users/:userID/games/:game/:playtype/settings`
`PATCH /api/v1/users/:userID/games/:gameGroup/:playtype/settings`
!!! note
Although `stats` are part of your settings, they are not modifiable under these endpoints,
+11 -14
View File
@@ -228,30 +228,27 @@ How many unique players have to have played a chart on the beatoraja IR for it t
- Type: String
Where *this* server is hosted. This is used to
provide callback URLs inside emails. You may stub
it out if emails are unsupported.
provide callback URLs inside emails.
### EMAIL_CONFIG
- Type: EMAIL_CONFIG | undefined.
- Type: EMAIL_CONFIG (required)
Configures how emails will be sent by Tachi.
If not present, email calls will become no-ops, and
certain features (such as resetting passwords)
will be disabled.
SMTP is always configured. Set:
`FROM` determines the email `From` header, and optionally
`SENDMAIL_BIN` can override the location of the `sendmail`
binary. Defaults to `/usr/bin/sendmail`, but some distros
may have it in `sbin`.
- `TACHI_EMAIL_FROM` — `From` header (must match a verified sender when using Postmark).
- `TACHI_EMAIL_AUTH_POSTMARK` — `true` or `false`. When `true`, uses Postmark’s SMTP
endpoint; set `TACHI_EMAIL_AUTH_USER` and `TACHI_EMAIL_AUTH_PASS` to your server API token
(both are the token for Postmark SMTP).
- When Postmark is `false`: `TACHI_EMAIL_HOST`, `TACHI_EMAIL_PORT`, `TACHI_EMAIL_SECURE`
(`true` / `false`), and optionally `TACHI_EMAIL_AUTH_USER` / `TACHI_EMAIL_AUTH_PASS`
for servers that require auth (local Mailpit typically needs no auth).
`TRANSPORT_OPS` Passes a set of options to the email transport. For more
information, see the nodemailer documentation for SMTPTransport.Options.
`TRANSPORT_OPS` is derived from these variables and passed to Nodemailer.
```ts
interface EMAIL_CONFIG {
FROM: string;
SENDMAIL_BIN?: string
TRANSPORT_OPS: any;
}
```