From 768bcd96621c5b285759fc021173de2cddbad244 Mon Sep 17 00:00:00 2001 From: zkldi Date: Wed, 13 Oct 2021 19:17:11 +0100 Subject: [PATCH] Add more GPT endpoint definitions --- docs/docs/api/routes/gpt.md | 109 +++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/docs/docs/api/routes/gpt.md b/docs/docs/api/routes/gpt.md index b15a39e0f..f280a51b9 100644 --- a/docs/docs/api/routes/gpt.md +++ b/docs/docs/api/routes/gpt.md @@ -53,7 +53,7 @@ GET /api/v1/games/iidx/SP ## Retrieve the player leaderboard. -`GET /api/v1/leaderboard` +`GET /api/v1/games/:game/:playtype/leaderboard` ### Parameters @@ -571,3 +571,110 @@ GET /api/v1/games/bms/7K/tableID/insane } } ``` + +***** + +## Retrieve the score leaderboard for this Game. + +`GET /api/v1/games/:game/:playtype/score-leaderboard` + +### Parameters + +| Property | Type | Description | +| :: | :: | :: | +| `alg` | String | An alternative algorithm to use instead of the GPTs default. | +| `limit` | Optional Integer | Optionally, provide a number between 1 and 50 to change the amount of scores returned. | + +### Response + +| Property | Type | Description | +| :: | :: | :: | +| `pbs` | Array<PBScoreDocument> | The array of pbs part of the score leaderboard. | +| `songs` | Array<SongDocument> | The array of songs part of the PBs. | +| `charts` | Array<ChartDocument> | The array of charts part of the PBs. | +| `users` | Array<UserDocument> | The array of users part of the PBs. | + +***** + +## Get the distribution of players for a provided class. + +`GET /api/v1/games/:game/:playtype/player-distribution` + +### Parameters + +| Property | Type | Description | +| :: | :: | :: | +| `class` | String | Must be one of the GPTs supported classes, This specifies what distribution to return. | + +### Response + +| Property | Type | Description | +| :: | :: | :: | +| `` | Record<ClassValue, integer> | Returns a record of the class value against the amount of people who have it. | + +### Example + +#### Request +``` +GET /api/v1/games/bms/7K/player-distribution?class=stslDan +``` + +#### Response + +```js +{ + "12": 1, + "11": 5, + "10": 7, + "9": 6, + "8": 4, + // Note that keys will be empty if nobody has them. + "5": 30, + // ... so on +} +``` + +!!! info + You can find the humanised conversions for these classes in the gptConfig for this GPT. + + See [tachi-common](https://github.com/tng-dev/tachi-common) for more information. + +***** + +## Retrieve recent class updates from all users on this game. + +`GET /api/v1/games/:game/:playtype/player-distribution` + +### Parameters + +| Property | Type | Description | +| :: | :: | :: | +| `limit` | Optional Integer | Optionally, An integer between 1 and 50 can be provided to limit the amount of returns. Defaults to 10. | + +### Response + +| Property | Type | Description | +| :: | :: | :: | +| `users` | Array<UserDocument> | Array of the users who achieved the courses. | +| `classes` | Array<ClassAchievementDocument> | Data about the recently achieved classes. | + +***** + +## Retrieve the most recent highlighted scores for this GPT. + +`GET /api/v1/games/:game/:playtype/scores/highlighted` + +### Parameters + +| Property | Type | Description | +| :: | :: | :: | +| `limit` | Optional Integer | Optionally, provide an integer between 1 and 100 to return this amount of scores. Defaults to 10. | + +### Response + +| Property | Type | Description | +| :: | :: | :: | +| `scores` | Array<ScoreDocument> | The highlighted scores. | +| `users` | Array<UserDocument> | The users who own the scores. | +| `songs` | Array<SongDocument> | The songs the scores are on. | +| `charts` | Array<ChartDocument> | The charts the scores are on. |