mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 02:48:01 +03:00
feat: rename back to zkldi
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # zkldi
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: zkrising
|
||||
ko_fi: zkldi
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: pnpm --filter tachi-client build
|
||||
env:
|
||||
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
|
||||
VITE_GIT_REPO: "GitHub:zkldi/Tachi"
|
||||
VITE_TCHIC_MODE: "boku"
|
||||
VITE_GOATCOUNTER: "https://tachi.goatcounter.com/count"
|
||||
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
VITE_DISCORD: "https://discord.gg/NNgGJbpQUj"
|
||||
VITE_TCHIC_MODE: "kamai"
|
||||
VITE_CDN_URL: "https://cdn-kamai.tachi.ac"
|
||||
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
|
||||
VITE_GIT_REPO: "GitHub:zkldi/Tachi"
|
||||
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
|
||||
TACHI_NAME: "Kamaitachi"
|
||||
BUILD_OUT_DIR: /home/runner/kamai
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
VITE_SERVER_URL: "https://staging.tachi.ac"
|
||||
VITE_TCHIC_MODE: "omni"
|
||||
VITE_CDN_URL: "https://cdn-staging.tachi.ac"
|
||||
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
|
||||
VITE_GIT_REPO: "GitHub:zkldi/Tachi"
|
||||
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
|
||||
TACHI_NAME: "Tachi Staging"
|
||||
BUILD_OUT_DIR: /home/runner/staging
|
||||
|
||||
@@ -45,7 +45,7 @@ Tachi is intended to be developed inside a container. This ensures that you have
|
||||
|
||||
VSCode has excellent native support for dev containers, and as such this is the only method of local development we recommend.
|
||||
|
||||
Over the years we have had a *lot* of issues with people having subtle variations on their system (or on windows). Given the contributor-centricity of Tachi, it's untenable to expect every contributor to be an expert with local dev setup.
|
||||
Over the years we have had a _lot_ of issues with people having subtle variations on their system (or on windows). Given the contributor-centricity of Tachi, it's untenable to expect every contributor to be an expert with local dev setup.
|
||||
|
||||
The devcontainer provides us with the most simple, consistent experience, and allows us to put nice-to-haves inside the user's shell.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ BROWSER="none"
|
||||
VITE_TCHIC_MODE="omni"
|
||||
VITE_SERVER_URL="https://127.0.0.1:8080"
|
||||
VITE_CDN_URL="https://127.0.0.1:8080/cdn"
|
||||
VITE_GIT_REPO="GitHub:zkrising/Tachi"
|
||||
VITE_GIT_REPO="GitHub:zkldi/Tachi"
|
||||
VITE_EAG_CLIENT_ID=""
|
||||
VITE_MIN_CLIENT_ID=""
|
||||
VITE_FLO_CLIENT_ID=""
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function BeatorajaIRPage({ game }: { game: "bms" | "pms" }) {
|
||||
<ol className="instructions-list">
|
||||
<li>
|
||||
Download the latest version of the {name} IR{" "}
|
||||
<ExternalLink href="https://github.com/zkrising/Tachi-beatoraja-ir/releases">
|
||||
<ExternalLink href="https://github.com/zkldi/Tachi-beatoraja-ir/releases">
|
||||
here
|
||||
</ExternalLink>
|
||||
.
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function ITGHookPage() {
|
||||
<ol className="instructions-list">
|
||||
<li>
|
||||
Download the latest version of <code>Tachi.lua</code>{" "}
|
||||
<ExternalLink href="https://github.com/zkrising/Simply-Love-Tachi-Module">
|
||||
<ExternalLink href="https://github.com/zkldi/Simply-Love-Tachi-Module">
|
||||
here
|
||||
</ExternalLink>
|
||||
.
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function SilentHookPage() {
|
||||
<ol className="instructions-list">
|
||||
<li>
|
||||
Download <code>silent</code> from{" "}
|
||||
<ExternalLink href="https://zkrising.com/stuff/silent-latest.zip">
|
||||
<ExternalLink href="https://zkldi.com/stuff/silent-latest.zip">
|
||||
here
|
||||
</ExternalLink>{" "}
|
||||
and place all the <code>.dll</code> files in the same folder as{" "}
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function SupportBanner({ user }: { user: UserDocument }) {
|
||||
<br />
|
||||
<br />
|
||||
If you want to support development, you can donate to my{" "}
|
||||
<ExternalLink href="https://ko-fi.com/zkrising">Ko-Fi</ExternalLink>
|
||||
<ExternalLink href="https://ko-fi.com/zkldi">Ko-Fi</ExternalLink>
|
||||
, if you indicate your account name in the donation, you'll get a shiny name on the
|
||||
site!
|
||||
<br />
|
||||
@@ -87,7 +87,7 @@ export default function SupportBanner({ user }: { user: UserDocument }) {
|
||||
<br />
|
||||
<br />
|
||||
Alternatively, you can star or contribute to the fully-open-source{" "}
|
||||
<ExternalLink href="https://github.com/zkrising/Tachi">GitHub Repo</ExternalLink>.
|
||||
<ExternalLink href="https://github.com/zkldichi">GitHub Repo</ExternalLink>.
|
||||
This makes me look cool to employers!
|
||||
</span>
|
||||
</Card>
|
||||
|
||||
@@ -15,11 +15,11 @@ export default function SupportMePage() {
|
||||
</p>
|
||||
<p>
|
||||
If you want to support {TachiConfig.NAME} development, you can donate to my{" "}
|
||||
<ExternalLink href="https://ko-fi.com/zkrising">Ko-fi</ExternalLink>.
|
||||
<ExternalLink href="https://ko-fi.com/zkldi">Ko-fi</ExternalLink>.
|
||||
</p>
|
||||
<p>
|
||||
Alternatively, you can star the{" "}
|
||||
<ExternalLink href="https://github.com/zkrising/Tachi">GitHub Repo</ExternalLink>.
|
||||
<ExternalLink href="https://github.com/zkldichi">GitHub Repo</ExternalLink>.
|
||||
This makes me look cool to employers!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ export default function TISInfo({ name }: { name: string }) {
|
||||
<ol className="instructions-list">
|
||||
<li>
|
||||
Download the latest version of the {TachiConfig.NAME} Import Scripts{" "}
|
||||
<ExternalLink href="https://github.com/zkrising/Tachi-import-scripts/releases">
|
||||
<ExternalLink href="https://github.com/zkldi/Tachi-import-scripts/releases">
|
||||
here
|
||||
</ExternalLink>
|
||||
.
|
||||
|
||||
@@ -74,7 +74,7 @@ export function Footer() {
|
||||
)}
|
||||
<Nav.Link
|
||||
as={ExternalLink}
|
||||
href="https://github.com/zkrising/Tachi"
|
||||
href="https://github.com/zkldi/Tachi"
|
||||
className={linkClassNames}
|
||||
>
|
||||
Source Code
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function SeedsPicker({
|
||||
// a repo is one of the following:
|
||||
// null - nothing has been selected yet
|
||||
// "local" - we're referring to the files on the local development disk
|
||||
// "GitHub:NAME/REPO" - we're referring to a repository on github, like GitHub:zkrising/Tachi
|
||||
// "GitHub:NAME/REPO" - we're referring to a repository on github, like GitHub:zkldi/Tachi
|
||||
const [repo, setRepo] = useState<string | null>(null);
|
||||
|
||||
// to list commits, we need to know what branch we're looking at.
|
||||
|
||||
@@ -97,7 +97,7 @@ function InnerImportInputViewer({
|
||||
<Muted>
|
||||
For information on what each argument means,{" "}
|
||||
<ExternalLink
|
||||
href={`https://github.com/zkrising/Tachi/blob/main/server/src/lib/score-import/import-types/${importType}/parser.ts`}
|
||||
href={`https://github.com/zkldi/Tachi/blob/main/server/src/lib/score-import/import-types/${importType}/parser.ts`}
|
||||
>
|
||||
view the signature of the parser function for <code>{importType}</code>
|
||||
</ExternalLink>
|
||||
|
||||
@@ -53,7 +53,7 @@ try {
|
||||
<div>Welp. Looks like we're down. Sorry about that.</div>
|
||||
<div>Chances are, this is just a temporary outage and will be fixed soon.</div>
|
||||
<div style="font-size: 1.25rem; margin-top: 1rem; margin-bottom: 1rem;">
|
||||
Please be patient, <a href="https://github.com/zkrising/Tachi">Tachi is maintained by a very small team.</a>
|
||||
Please be patient, <a href="https://github.com/zkldi/Tachi">Tachi is maintained by a very small team.</a>
|
||||
</div>
|
||||
<div>An error message can be found in the console. (<code>Ctrl-Shift-I</code>)</div>`
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 zkrising
|
||||
Copyright (c) 2021 zkldi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+22
-22
@@ -6,18 +6,18 @@ This means you could make your own applications that work off of Tachi's
|
||||
datasets.
|
||||
|
||||
!!! warning
|
||||
This documentation assumes some basic programming knowledge, such as how to make
|
||||
HTTP requests, and how to parse JSON.
|
||||
This documentation assumes some basic programming knowledge, such as how to make
|
||||
HTTP requests, and how to parse JSON.
|
||||
|
||||
Depending on what variant of Tachi you want to interact with, the API is hosted
|
||||
on `https://kamai.tachi.ac/api/v1` or `https://boku.tachi.ac/api/v1`.
|
||||
|
||||
!!! note
|
||||
Some API endpoints are only available on Kamaitachi or Bokutachi. If an
|
||||
endpoint has this restriction, it will be documented on that endpoints'
|
||||
page.
|
||||
Some API endpoints are only available on Kamaitachi or Bokutachi. If an
|
||||
endpoint has this restriction, it will be documented on that endpoints'
|
||||
page.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Abuse
|
||||
|
||||
@@ -34,12 +34,12 @@ send an email to `zk@tachi.ac` and let me know what you're up to. Otherwise, I m
|
||||
|
||||
## License
|
||||
|
||||
[Tachi-Server](https://github.com/zkrising/Tachi/tree/main/server) (Where the API is wrote) is licensed under the [AGPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html).
|
||||
[Tachi-Server](https://github.com/zkldi/Tachi/tree/main/server) (Where the API is wrote) is licensed under the [AGPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html).
|
||||
|
||||
To quote GitHub:
|
||||
|
||||
!!! quote
|
||||
Permissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.
|
||||
Permissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.
|
||||
|
||||
This is not legal advice.
|
||||
|
||||
@@ -64,11 +64,11 @@ The API has two schemas for JSON responses.
|
||||
|
||||
As the name implies, the Success Response is returned on a successful request.
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `success` | true | Always true for a successful response. |
|
||||
| `description` | String | Information about what happened with the request. |
|
||||
| `body` | Endpoint Dependent | Any data that the endpoint needs to return, such as a user's document from a profile request. |
|
||||
| Property | Type | Description |
|
||||
| :-----------: | :----------------: | :-------------------------------------------------------------------------------------------: |
|
||||
| `success` | true | Always true for a successful response. |
|
||||
| `description` | String | Information about what happened with the request. |
|
||||
| `body` | Endpoint Dependent | Any data that the endpoint needs to return, such as a user's document from a profile request. |
|
||||
|
||||
The HTTP Status Code for any Success Response will always be of 2XX form.
|
||||
|
||||
@@ -76,26 +76,26 @@ The HTTP Status Code for any Success Response will always be of 2XX form.
|
||||
|
||||
As the name implies, the Failed Response is returned when a request fails.
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `success` | false | Always false for a failed response. |
|
||||
| Property | Type | Description |
|
||||
| :-----------: | :----: | :-------------------------------------------------: |
|
||||
| `success` | false | Always false for a failed response. |
|
||||
| `description` | String | Information about what went wrong with the request. |
|
||||
|
||||
The HTTP Status Code for any Failed Response will always be of either 4XX or 5XX form.
|
||||
|
||||
!!! warning
|
||||
The `description` property is **NOT** intended for program usage. You should **NEVER** depend
|
||||
on the output of `description`, as it may be changed at any time for any reason.
|
||||
The `description` property is **NOT** intended for program usage. You should **NEVER** depend
|
||||
on the output of `description`, as it may be changed at any time for any reason.
|
||||
|
||||
!!! note
|
||||
Any API request can fail for any reason. You should always account for the
|
||||
case where the request fails.
|
||||
Any API request can fail for any reason. You should always account for the
|
||||
case where the request fails.
|
||||
|
||||
## Footnote
|
||||
|
||||
That should be everything. If you have any questions about the API, you can
|
||||
contact me at `zk@tachi.ac`. You can also write an issue on the
|
||||
[Issue Tracker](https://github.com/zkrising/Tachi). I'll get around to either.
|
||||
contact me at `zk@tachi.ac`. You can also write an issue on the
|
||||
[Issue Tracker](https://github.com/zkldichi). I'll get around to either.
|
||||
|
||||
It's entirely possible that I might've made a typo or wrote a poor explaination
|
||||
of something, so please reach out!
|
||||
|
||||
@@ -3,48 +3,48 @@
|
||||
These endpoints relate to internal authentication methods. Read the warning below.
|
||||
|
||||
!!! danger
|
||||
This is **NOT** for external use. You should **NEVER**
|
||||
be requesting a username and password from a user.
|
||||
This is **NOT** for external use. You should **NEVER**
|
||||
be requesting a username and password from a user.
|
||||
|
||||
Furthermore, interacting with this programmatically
|
||||
is near-impossible because you need to complete a CAPTCHA.
|
||||
Furthermore, interacting with this programmatically
|
||||
is near-impossible because you need to complete a CAPTCHA.
|
||||
|
||||
Nevertheless, This is documented for completeness' sake.
|
||||
Nevertheless, This is documented for completeness' sake.
|
||||
|
||||
!!! warning
|
||||
All of these endpoints are aggressively rate limited. If you fire a bot at this, you will probably get
|
||||
your IP blacklisted. Don't do that.
|
||||
All of these endpoints are aggressively rate limited. If you fire a bot at this, you will probably get
|
||||
your IP blacklisted. Don't do that.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Login with username and password.
|
||||
|
||||
```POST /api/v1/auth/login```
|
||||
`POST /api/v1/auth/login`
|
||||
|
||||
Logs a user in and returns a session cookie.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `username` | String | The user's username. This is compared case-insensitively.
|
||||
| `!password` | String | The user's password. |
|
||||
| `captcha` | String | Information about the captcha filled out by the user. We use a Google ReCaptcha instance. |
|
||||
| Property | Type | Description |
|
||||
| :---------: | :----: | :---------------------------------------------------------------------------------------: |
|
||||
| `username` | String | The user's username. This is compared case-insensitively. |
|
||||
| `!password` | String | The user's password. |
|
||||
| `captcha` | String | Information about the captcha filled out by the user. We use a Google ReCaptcha instance. |
|
||||
|
||||
!!! info
|
||||
The `!` prefix is special in that anything with it is assumed to be private and is **always**
|
||||
ignored by our request logger.
|
||||
The `!` prefix is special in that anything with it is assumed to be private and is **always**
|
||||
ignored by our request logger.
|
||||
|
||||
Without it, we would log passwords!
|
||||
Without it, we would log passwords!
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----: | :--------------------------------------: |
|
||||
| `userID` | Integer | The ID of the user you authenticated as. |
|
||||
|
||||
| HTTP Header | Description |
|
||||
| :: | :: |
|
||||
| HTTP Header | Description |
|
||||
| :----------: | :--------------------------------------------------: |
|
||||
| `Set-Cookie` | Contains a session cookie for future authentication. |
|
||||
|
||||
### Example
|
||||
@@ -57,20 +57,21 @@ POST /api/v1/auth/login
|
||||
|
||||
```json
|
||||
{
|
||||
"username": "zkrising",
|
||||
"username": "zkldi",
|
||||
"!password": "my_password",
|
||||
"captcha": "herebedragons"
|
||||
}
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```json
|
||||
{
|
||||
"userID": 1
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Register a new account.
|
||||
|
||||
@@ -78,24 +79,24 @@ POST /api/v1/auth/login
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `username` | String | A string between 3 and 20 characters. The first character must be A-Z, _ or -. The other 19 may be A-Z, 0-9, _ or -. |
|
||||
| `!password` | String | An 8 character or longer string. |
|
||||
| `email` | String | |
|
||||
| `inviteCode` (Kamaitachi Only) | String (Undefined/Unused on Bokutachi) | If on Kamaitachi, this is the user's invitation code. |
|
||||
| `captcha` | String | |
|
||||
|
||||
| Property | Type | Description |
|
||||
| :----------------------------: | :------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |
|
||||
| `username` | String | A string between 3 and 20 characters. The first character must be A-Z, _ or -. The other 19 may be A-Z, 0-9, _ or -. |
|
||||
| `!password` | String | An 8 character or longer string. |
|
||||
| `email` | String | |
|
||||
| `inviteCode` (Kamaitachi Only) | String (Undefined/Unused on Bokutachi) | If on Kamaitachi, this is the user's invitation code. |
|
||||
| `captcha` | String | |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----------------------------------: | :-------------------------------------: |
|
||||
| `<body>` | [UserDocument](../../schemas/user.md) | The newly-created user's User Document. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
POST /api/v1/auth/register
|
||||
```
|
||||
@@ -136,7 +137,7 @@ POST /api/v1/auth/register
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Verify an email from the code that was sent to it.
|
||||
|
||||
@@ -144,9 +145,9 @@ POST /api/v1/auth/register
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `code` | String | The Code that was sent to the users mailbox. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :------------------------------------------: |
|
||||
| `code` | String | The Code that was sent to the users mailbox. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -155,6 +156,7 @@ Empty Object
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
{
|
||||
"code": "abcdef1234567890"
|
||||
@@ -165,7 +167,7 @@ Empty Object
|
||||
|
||||
Empty Object.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Resend a verification email to the requesting user's email address.
|
||||
|
||||
@@ -185,8 +187,7 @@ Empty object.
|
||||
|
||||
N/A
|
||||
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Log Out.
|
||||
|
||||
@@ -205,6 +206,7 @@ Empty Object.
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
POST /api/v1/auth/logout
|
||||
```
|
||||
@@ -213,21 +215,21 @@ POST /api/v1/auth/logout
|
||||
|
||||
Nothing.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Create a password reset code and send it to the provided email.
|
||||
|
||||
`POST /api/v1/auth/forgot-password`
|
||||
|
||||
!!! note
|
||||
This endpoint sends the password reset code pretty-printed to the email, and is **NOT**
|
||||
returned as part of the HTTP request.
|
||||
This endpoint sends the password reset code pretty-printed to the email, and is **NOT**
|
||||
returned as part of the HTTP request.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `email` | String | A user's email. If the email does not correspond to any accounts, 202 is returned anyway as a security measure. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :-------------------------------------------------------------------------------------------------------------: |
|
||||
| `email` | String | A user's email. If the email does not correspond to any accounts, 202 is returned anyway as a security measure. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -236,18 +238,19 @@ Empty Object. The endpoint immediately returns 202 to avoid giving away informat
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```js
|
||||
{
|
||||
"email": "zkrising.dev@gmail.com"
|
||||
"email": "zkldiv@gmail.com"
|
||||
}
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
Although the request body returns nothing, `zkrising.dev@gmail.com` will have recieved an email with
|
||||
Although the request body returns nothing, `zkldiv@gmail.com` will have recieved an email with
|
||||
a URL containing the password reset code.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Reset a user's password with a password reset code.
|
||||
|
||||
@@ -255,10 +258,10 @@ a URL containing the password reset code.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `code` | String | A password reset code. This is provided in a password reset email. |
|
||||
| `!password` | String | The password to change to. |
|
||||
| Property | Type | Description |
|
||||
| :---------: | :----: | :----------------------------------------------------------------: |
|
||||
| `code` | String | A password reset code. This is provided in a password reset email. |
|
||||
| `!password` | String | The password to change to. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -267,10 +270,11 @@ Empty Object.
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```js
|
||||
{
|
||||
"code": "1234567890abcdef",
|
||||
"!password": "zkrising_is_so_cool",
|
||||
"!password": "zkldi_so_cool",
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,114 +1,113 @@
|
||||
# Example Endpoint
|
||||
|
||||
*Endpoints will be formatted like this. - These are not real endpoints!*
|
||||
_Endpoints will be formatted like this. - These are not real endpoints!_
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Greet a user.
|
||||
|
||||
```GET /api/v1/greet```
|
||||
`GET /api/v1/greet`
|
||||
|
||||
This endpoint greets the user.
|
||||
|
||||
### Permissions
|
||||
|
||||
*If permissions are required, they will be listed here.*
|
||||
_If permissions are required, they will be listed here._
|
||||
|
||||
- example_permission
|
||||
|
||||
### Parameters
|
||||
|
||||
*Parameters are required unless explicitly stated to be optional.*
|
||||
_Parameters are required unless explicitly stated to be optional._
|
||||
|
||||
!!! note
|
||||
As mentioned in API Overview, GET parameters are to be sent in the query string,
|
||||
and all other methods are to have their content in the request body as
|
||||
`application/json`.
|
||||
As mentioned in API Overview, GET parameters are to be sent in the query string,
|
||||
and all other methods are to have their content in the request body as
|
||||
`application/json`.
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `name` | String | The name of the user to greet. |
|
||||
| Property | Type | Description |
|
||||
| :-------------------: | :------: | :---------------------------------------: |
|
||||
| `name` | String | The name of the user to greet. |
|
||||
| `birthday` (optional) | Presence | Whether it is the user's birthday or not. |
|
||||
|
||||
Not providing required parameters will result in a 400 error.
|
||||
|
||||
### Response
|
||||
|
||||
*Parameters are always present unless stated to be conditional/optional.*
|
||||
_Parameters are always present unless stated to be conditional/optional._
|
||||
|
||||
!!! info
|
||||
The below properties correspond to keys in the `body`
|
||||
property of a request.
|
||||
The below properties correspond to keys in the `body`
|
||||
property of a request.
|
||||
|
||||
This means that the below table corresponds to
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": {
|
||||
"greeting": "Hello, zkrising!",
|
||||
"wasBirthday": false,
|
||||
}
|
||||
}
|
||||
```
|
||||
This means that the below table corresponds to
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": {
|
||||
"greeting": "Hello, zkldi!",
|
||||
"wasBirthday": false,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `greeting` | String | A greeting for the user. |
|
||||
| Property | Type | Description |
|
||||
| :-----------: | :-----: | :-----------------------------------------: |
|
||||
| `greeting` | String | A greeting for the user. |
|
||||
| `wasBirthday` | Boolean | Whether today is the users birthday or not. |
|
||||
|
||||
!!! info
|
||||
Since the above table corresponds to keys in the `body`
|
||||
property of a request, the special property name
|
||||
`<body>` refers to the body itself.
|
||||
Since the above table corresponds to keys in the `body`
|
||||
property of a request, the special property name
|
||||
`<body>` refers to the body itself.
|
||||
|
||||
For example:
|
||||
For example:
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `<body>` | String | The greeting. |
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `<body>` | String | The greeting. |
|
||||
|
||||
Corresponds to:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": "Hello, zkrising!"
|
||||
}
|
||||
```
|
||||
Corresponds to:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": "Hello, zkldi
|
||||
}
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /greet?name=zkrising
|
||||
GET /greet?name=zkldi
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```json
|
||||
{
|
||||
"greeting": "Hello, zkrising!",
|
||||
"greeting": "Hello, zkldi
|
||||
"wasBirthday": false
|
||||
}
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The example response is implicitly the `body` key of the API response.
|
||||
That is to say that, the real response for this request is:
|
||||
The example response is implicitly the `body` key of the API response.
|
||||
That is to say that, the real response for this request is:
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": {
|
||||
"greeting": "Hello, zkrising!",
|
||||
"wasBirthday": false
|
||||
}
|
||||
}
|
||||
```
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"description": "Greeted user.",
|
||||
"body": {
|
||||
"greeting": "Hello, zkldi
|
||||
"wasBirthday": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This is omitted, because it's redundant all of the time. -- That is to say,
|
||||
You should never depend on parsing the content of `description`.
|
||||
This is omitted, because it's redundant all of the time. -- That is to say,
|
||||
You should never depend on parsing the content of `description`.
|
||||
|
||||
@@ -4,16 +4,16 @@ These endpoints deal with [targets](../../api/terminology.md) for a Game + Playt
|
||||
|
||||
For user-specific target endpoints, such as subscriptions, see [UGPT-Target Endpoints](./ugpt-targets.md).
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve this game's recently achieved targets
|
||||
|
||||
`GET /api/v1/games/:game/:playtype/targets/recently-achieved`
|
||||
|
||||
!!! info
|
||||
This endpoint returns the 100 most recently achieved goal subscriptions, and 50 most recently achieved quest subscriptions.
|
||||
This endpoint returns the 100 most recently achieved goal subscriptions, and 50 most recently achieved quest subscriptions.
|
||||
|
||||
A target is not considered recently achieved if it was [instantly achieved](../../codebase/implementation-details/goals-quests.md#instant-indirect-achievements).
|
||||
A target is not considered recently achieved if it was [instantly achieved](../../codebase/implementation-details/goals-quests.md#instant-indirect-achievements).
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -21,16 +21,17 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goals` | Array<GoalDocument> | The goal documents that were recently achieved. |
|
||||
| `quests` | Array<QuestDocument> | The quest documents that were recently achieved. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | User subscriptions to goals that were recently achieved. |
|
||||
| Property | Type | Description |
|
||||
| :---------: | :---------------------------: | :-------------------------------------------------------: |
|
||||
| `goals` | Array<GoalDocument> | The goal documents that were recently achieved. |
|
||||
| `quests` | Array<QuestDocument> | The quest documents that were recently achieved. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | User subscriptions to goals that were recently achieved. |
|
||||
| `questSubs` | Array<QuestSubDocument> | User subscriptions to quests that were recently achieved. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/targets/recently-achieved
|
||||
```
|
||||
@@ -64,19 +65,19 @@ 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`
|
||||
|
||||
!!! info
|
||||
This endpoint returns the 100 most recently interacted-with goal subscriptions, and 50 most recently interacted-with quest subscriptions.
|
||||
This endpoint returns the 100 most recently interacted-with goal subscriptions, and 50 most recently interacted-with quest subscriptions.
|
||||
|
||||
A recently interacted with target subscription is one where `progress` or `outOf` has changed recently.
|
||||
A recently interacted with target subscription is one where `progress` or `outOf` has changed recently.
|
||||
|
||||
!!! warn
|
||||
This endpoint excludes achieved targets -- targets still get interacted with when achieved, which means a user with a lot of targets will just flood this endpoint with redundant updates on larger imports.
|
||||
This endpoint excludes achieved targets -- targets still get interacted with when achieved, which means a user with a lot of targets will just flood this endpoint with redundant updates on larger imports.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -84,16 +85,17 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goals` | Array<GoalDocument> | The goal documents that were recently achieved. |
|
||||
| `quests` | Array<QuestDocument> | The quest documents that were recently achieved. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | User subscriptions to goals that were recently interacted with. |
|
||||
| Property | Type | Description |
|
||||
| :---------: | :---------------------------: | :--------------------------------------------------------------: |
|
||||
| `goals` | Array<GoalDocument> | The goal documents that were recently achieved. |
|
||||
| `quests` | Array<QuestDocument> | The quest documents that were recently achieved. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | User subscriptions to goals that were recently interacted with. |
|
||||
| `questSubs` | Array<QuestSubDocument> | User subscriptions to quests that were recently interacted with. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/targets/recently-raised
|
||||
```
|
||||
@@ -129,7 +131,7 @@ GET /api/v1/games/iidx/SP/targets/recently-raised
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get the most popular goals for this GPT.
|
||||
|
||||
@@ -141,13 +143,14 @@ N/A
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |
|
||||
| `<body>` | Array<GoalDocument & `__subscriptions` > | An array of the 100 most popular goals for this GPT, where `__subscriptions` is how many subscriptions the goal has. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/:game/:playtype/targets/goals/popular
|
||||
```
|
||||
@@ -155,16 +158,19 @@ GET /api/v1/games/:game/:playtype/targets/goals/popular
|
||||
#### Response
|
||||
|
||||
```js
|
||||
[{
|
||||
name: "HARD CLEAR foo",
|
||||
// ...
|
||||
}, {
|
||||
name: "AAA foo",
|
||||
// ...
|
||||
}]
|
||||
[
|
||||
{
|
||||
name: "HARD CLEAR foo",
|
||||
// ...
|
||||
},
|
||||
{
|
||||
name: "AAA foo",
|
||||
// ...
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve information about a specific goal and its subscribers.
|
||||
|
||||
@@ -176,52 +182,53 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goal` | GoalDocument | The goal document at this ID. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | All of the subscriptions to this goal. |
|
||||
| `users` | Array<UserDocument> | All of the users subscribed to this goal. |
|
||||
| `parentQuests` | Array<QuestDocument> | All of the quests that include this goal. |
|
||||
| Property | Type | Description |
|
||||
| :------------: | :--------------------------: | :---------------------------------------: |
|
||||
| `goal` | GoalDocument | The goal document at this ID. |
|
||||
| `goalSubs` | Array<GoalSubDocument> | All of the subscriptions to this goal. |
|
||||
| `users` | Array<UserDocument> | All of the users subscribed to this goal. |
|
||||
| `parentQuests` | Array<QuestDocument> | All of the quests that include this goal. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Evaluate a goal upon a user.
|
||||
|
||||
`GET /api/v1/games/:game/: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
|
||||
`UGPT/goals/:goalID` is for goal subscriptions, and overloading the endpoint to be
|
||||
something like "return the goal subscription or evaluate it if doesn't exist" is ugly.
|
||||
This endpoint is notably in a bit of a strange position. It can't go under UGPT because
|
||||
`UGPT/goals/:goalID` is for goal subscriptions, and overloading the endpoint to be
|
||||
something like "return the goal subscription or evaluate it if doesn't exist" is ugly.
|
||||
|
||||
As such, it ends up here, but is generally a bit awkward.
|
||||
As such, it ends up here, but is generally a bit awkward.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :---------------------------------: |
|
||||
| `userID` | String | The user to evaluate this goal for. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goal` | GoalDocument | The goal document that was evaluated. |
|
||||
| `user` | UserDocument | The user that this goal was evaluated for. |
|
||||
| `results.achieved` | Boolean | Whether this user would have this goal achieved or not. |
|
||||
| `results.progress` | Integer | What this user's progress would be on this goal. |
|
||||
| `results.progressHuman` | String | A user friendly format for this user's goal progress. |
|
||||
| `results.outOf` | Integer | What this goal was out of. |
|
||||
| `results.outOfHuman` | String | A user friendly format for what this goal was out of. |
|
||||
| Property | Type | Description |
|
||||
| :---------------------: | :----------: | :-----------------------------------------------------: |
|
||||
| `goal` | GoalDocument | The goal document that was evaluated. |
|
||||
| `user` | UserDocument | The user that this goal was evaluated for. |
|
||||
| `results.achieved` | Boolean | Whether this user would have this goal achieved or not. |
|
||||
| `results.progress` | Integer | What this user's progress would be on this goal. |
|
||||
| `results.progressHuman` | String | A user friendly format for this user's goal progress. |
|
||||
| `results.outOf` | Integer | What this goal was out of. |
|
||||
| `results.outOfHuman` | String | A user friendly format for what this goal was out of. |
|
||||
|
||||
!!! info
|
||||
For more info on `progress`/`outOf`, see [Goals](../../codebase/implementation-details/goals-quests.md#evaluating-a-users-progress).
|
||||
For more info on `progress`/`outOf`, see [Goals](../../codebase/implementation-details/goals-quests.md#evaluating-a-users-progress).
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/targets/goals/some_goal_id/evaluate-for?userID=zkrising
|
||||
GET /api/v1/games/iidx/SP/targets/goals/some_goal_id/evaluate-for?userID=zkldi
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -229,7 +236,7 @@ GET /api/v1/games/iidx/SP/targets/goals/some_goal_id/evaluate-for?userID=zkrisin
|
||||
```js
|
||||
{
|
||||
user: {
|
||||
username: "zkrising",
|
||||
username: "zkldi
|
||||
id: 1,
|
||||
// ...
|
||||
},
|
||||
@@ -248,32 +255,32 @@ GET /api/v1/games/iidx/SP/targets/goals/some_goal_id/evaluate-for?userID=zkrisin
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search quests for this GPT.
|
||||
|
||||
`GET /api/v1/games/:game/:playtype/targets/quests`
|
||||
|
||||
!!! note
|
||||
You might notice that there's no equivalent endpoint for goals.
|
||||
You might notice that there's no equivalent endpoint for goals.
|
||||
|
||||
Searching goals for a GPT isn't very interesting, since they can be created by anyone at any time. The only reason goals are stored separately to subscriptions are for deduplication purposes and quests.
|
||||
Searching goals for a GPT isn't very interesting, since they can be created by anyone at any time. The only reason goals are stored separately to subscriptions are for deduplication purposes and quests.
|
||||
|
||||
As such, searching goals for a GPT is pointless, since technically it should search the set of all possible goals.
|
||||
As such, searching goals for a GPT is pointless, since technically it should search the set of all possible goals.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :----------------------: |
|
||||
| `search` | String | The query to search for. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------: | :--------------------------------------------------: |
|
||||
| `<body>` | Array<QuestDocument> | All of the quests that matched this search criteria. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve information about a specific quest, and who is subscribed to it.
|
||||
|
||||
@@ -285,15 +292,15 @@ N/A
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `quest` | QuestDocument | The quest with this questID. |
|
||||
| `questSubs` | Array<QuestSubDocument> | All of the subscriptions to this quest. |
|
||||
| `users` | Array<UserDocument> | All of the user's with subscriptions to this quest. |
|
||||
| `goals` | Array<GoalDocument> | All of the goals in this quest. |
|
||||
| `parentQuestlines` | Array<QuestlineDocument> | Any questlines that contain this quest. |
|
||||
| Property | Type | Description |
|
||||
| :----------------: | :----------------------------: | :-------------------------------------------------: |
|
||||
| `quest` | QuestDocument | The quest with this questID. |
|
||||
| `questSubs` | Array<QuestSubDocument> | All of the subscriptions to this quest. |
|
||||
| `users` | Array<UserDocument> | All of the user's with subscriptions to this quest. |
|
||||
| `goals` | Array<GoalDocument> | All of the goals in this quest. |
|
||||
| `parentQuestlines` | Array<QuestlineDocument> | Any questlines that contain this quest. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Evaluate a quest for a user, even if they aren't subscribed to it.
|
||||
|
||||
@@ -301,32 +308,32 @@ N/A
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :--------------------------------------------: |
|
||||
| `userID` | String | The user you wish to evaluate this quest upon. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goals` | Array<GoalDocument> | All of the goals in this quest. |
|
||||
| `goalResults` | Array<EvaluatedGoalResult> | This user's progress on each individual goal in this quest. |
|
||||
| `achieved` | Boolean | Whether this user has this quest achieved or not. |
|
||||
| `progress` | Integer | How many goals this user has achieved in this quest. |
|
||||
| `outOf` | Integer | How many goals need to be achieved in this quest for it to be marked as achieved. |
|
||||
| Property | Type | Description |
|
||||
| :-----------: | :------------------------------: | :-------------------------------------------------------------------------------: |
|
||||
| `goals` | Array<GoalDocument> | All of the goals in this quest. |
|
||||
| `goalResults` | Array<EvaluatedGoalResult> | This user's progress on each individual goal in this quest. |
|
||||
| `achieved` | Boolean | Whether this user has this quest achieved or not. |
|
||||
| `progress` | Integer | How many goals this user has achieved in this quest. |
|
||||
| `outOf` | Integer | How many goals need to be achieved in this quest for it to be marked as achieved. |
|
||||
|
||||
#### EvaluatedGoalResult
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `goalID` | String | The goal ID that these results are for. |
|
||||
| `achieved` | Boolean | Whether this goal was achieved or not. |
|
||||
| `progress` | Number \| Null | How much progress this user made on this goal. Null if no progress was made. |
|
||||
| `outOf` | Number | What `progress` needs to be greater than or equal to for this goal to count as achieved. |
|
||||
| `progressHuman` | String | A humanised, pretty-printed progress indicator for this goal. |
|
||||
| `outOfHuman` | String | A humanised, pretty-printed outOf indicator for this goal. |
|
||||
| Property | Type | Description |
|
||||
| :-------------: | :------------: | :--------------------------------------------------------------------------------------: |
|
||||
| `goalID` | String | The goal ID that these results are for. |
|
||||
| `achieved` | Boolean | Whether this goal was achieved or not. |
|
||||
| `progress` | Number \| Null | How much progress this user made on this goal. Null if no progress was made. |
|
||||
| `outOf` | Number | What `progress` needs to be greater than or equal to for this goal to count as achieved. |
|
||||
| `progressHuman` | String | A humanised, pretty-printed progress indicator for this goal. |
|
||||
| `outOfHuman` | String | A humanised, pretty-printed outOf indicator for this goal. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search Questlines
|
||||
|
||||
@@ -334,17 +341,17 @@ N/A
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :----------------------------------: |
|
||||
| `search` | String | A name of a questline to search for. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `<body>` | Array<QuestlineDocument> | An array of QuestlineDocuments, based on the search parameter. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----------------------------: | :------------------------------------------------------------: |
|
||||
| `<body>` | Array<QuestlineDocument> | An array of QuestlineDocuments, based on the search parameter. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve a questline with a specific ID.
|
||||
|
||||
@@ -356,8 +363,7 @@ N/A
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `questline` | QuestlineDocument | The questline document at this ID. |
|
||||
| `quests` | Array<QuestDocument> | All of the quest documents that belong to this set. |
|
||||
|
||||
| Property | Type | Description |
|
||||
| :---------: | :------------------------: | :-------------------------------------------------: |
|
||||
| `questline` | QuestlineDocument | The questline document at this ID. |
|
||||
| `quests` | Array<QuestDocument> | All of the quest documents that belong to this set. |
|
||||
|
||||
+186
-158
@@ -4,7 +4,7 @@ These endpoints are for games + their playtypes.
|
||||
To find out what games are supported by a service
|
||||
programmatically, you should see [Game Endpoints](./games.md).
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve Game:Playtype Configuration.
|
||||
|
||||
@@ -16,17 +16,18 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----------: | :----------------------------------------------: |
|
||||
| `config` | GamePTConfig | The configuration file for this game + playtype. |
|
||||
|
||||
!!! warning
|
||||
A GamePTConfig is different to a GameConfig! Read more
|
||||
[here](../../codebase/implementation-details/game-configuration.md).
|
||||
A GamePTConfig is different to a GameConfig! Read more
|
||||
[here](../../codebase/implementation-details/game-configuration.md).
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP
|
||||
```
|
||||
@@ -42,14 +43,14 @@ GET /api/v1/games/iidx/SP
|
||||
|
||||
"defaultScoreRatingAlg": "ktRating",
|
||||
"defaultSessionRatingAlg": "ktRating",
|
||||
"defaultProfileRatingAlg": "ktRating",
|
||||
"defaultProfileRatingAlg": "ktRating"
|
||||
|
||||
// ... more props - a lot more props
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve the player leaderboard.
|
||||
|
||||
@@ -57,20 +58,21 @@ GET /api/v1/games/iidx/SP
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :--------------: | :----: | :----------------------------------------------------------------------------------------: |
|
||||
| `alg` (Optional) | String | If present, specifies an alternative algorithm to sort players on, instead of the default. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `gameStats` | Array<GameStats> | The sorted statistics for the leaderboards. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | All of the related users for the above statistics. |
|
||||
| Property | Type | Description |
|
||||
| :---------: | :------------------------------------------------: | :------------------------------------------------: |
|
||||
| `gameStats` | Array<GameStats> | The sorted statistics for the leaderboards. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | All of the related users for the above statistics. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/leaderboard
|
||||
```
|
||||
@@ -79,22 +81,26 @@ GET /api/v1/games/iidx/SP/leaderboard
|
||||
|
||||
```json
|
||||
{
|
||||
"gameStats": [{
|
||||
"userID": 1,
|
||||
"ratings": {
|
||||
"ktRating": 4,
|
||||
"gameStats": [
|
||||
{
|
||||
"userID": 1,
|
||||
"ratings": {
|
||||
"ktRating": 4
|
||||
// ...
|
||||
}
|
||||
// ...
|
||||
}
|
||||
// ...
|
||||
}],
|
||||
"users": [{
|
||||
"id": 1,
|
||||
"username": "zkrising"
|
||||
}]
|
||||
],
|
||||
"users": [
|
||||
{
|
||||
"id": 1,
|
||||
"username": "zkldi"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve a song and its charts.
|
||||
|
||||
@@ -106,14 +112,15 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `song` | [SongDocument](../../schemas/song.md) |The requested song document. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :---------------------------------------: | :-----------------------------------------------------------: |
|
||||
| `song` | [SongDocument](../../schemas/song.md) | The requested song document. |
|
||||
| `charts` | [ChartDocument](../../schemas/chart.md)[] | All of the charts that belong to this song for this playtype. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/songs/1
|
||||
```
|
||||
@@ -126,21 +133,24 @@ GET /api/v1/games/iidx/SP/songs/1
|
||||
"id": 1,
|
||||
"title": "5.1.1."
|
||||
},
|
||||
"charts": [{
|
||||
"songID": 1,
|
||||
"playtype": "SP",
|
||||
"difficulty": "HYPER",
|
||||
// ...
|
||||
}, {
|
||||
"songID": 1,
|
||||
"playtype": "SP",
|
||||
"difficulty": "ANOTHER",
|
||||
// ...
|
||||
}]
|
||||
"charts": [
|
||||
{
|
||||
"songID": 1,
|
||||
"playtype": "SP",
|
||||
"difficulty": "HYPER"
|
||||
// ...
|
||||
},
|
||||
{
|
||||
"songID": 1,
|
||||
"playtype": "SP",
|
||||
"difficulty": "ANOTHER"
|
||||
// ...
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get popular charts for this game + playtype.
|
||||
|
||||
@@ -148,33 +158,34 @@ GET /api/v1/games/iidx/SP/songs/1
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :-----------------: | :----: | :-------------------------: |
|
||||
| `search` (Optional) | String | A song title to search for. |
|
||||
|
||||
!!! note
|
||||
If no search parameter is set, then the most popular
|
||||
100 charts for this game are returned.
|
||||
If no search parameter is set, then the most popular
|
||||
100 charts for this game are returned.
|
||||
|
||||
If a search parameter is set, then the most popular
|
||||
charts that match the search criteria will be returned,
|
||||
in that order.
|
||||
If a search parameter is set, then the most popular
|
||||
charts that match the search criteria will be returned,
|
||||
in that order.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :---------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md) with `__playcount`> | The chart documents that matched this search, or the most popular 100 charts for this game. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The associated song documents for the charts. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The associated song documents for the charts. |
|
||||
|
||||
!!! info
|
||||
The `__playcount` property is patched onto the chart
|
||||
documents returned. This indicates the amount of unique
|
||||
players that have played this chart.
|
||||
The `__playcount` property is patched onto the chart
|
||||
documents returned. This indicates the amount of unique
|
||||
players that have played this chart.
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/charts?search=AA
|
||||
```
|
||||
@@ -183,31 +194,36 @@ GET /api/v1/games/iidx/SP/charts?search=AA
|
||||
|
||||
```json
|
||||
{
|
||||
"songs": [{
|
||||
"title": "AA",
|
||||
"id": 3,
|
||||
// ...
|
||||
}, {
|
||||
"title": "AA -rebuild-",
|
||||
"id": 133,
|
||||
// ...
|
||||
}],
|
||||
"charts": [{
|
||||
"songID": 3,
|
||||
"difficulty": "ANOTHER",
|
||||
"__playcount": 1049,
|
||||
// ...
|
||||
}, {
|
||||
"songID": 133,
|
||||
"difficulty": "ANOTHER",
|
||||
"__playcount": 120
|
||||
},
|
||||
"songs": [
|
||||
{
|
||||
"title": "AA",
|
||||
"id": 3
|
||||
// ...
|
||||
},
|
||||
{
|
||||
"title": "AA -rebuild-",
|
||||
"id": 133
|
||||
// ...
|
||||
}
|
||||
],
|
||||
"charts": [
|
||||
{
|
||||
"songID": 3,
|
||||
"difficulty": "ANOTHER",
|
||||
"__playcount": 1049
|
||||
// ...
|
||||
},
|
||||
{
|
||||
"songID": 133,
|
||||
"difficulty": "ANOTHER",
|
||||
"__playcount": 120
|
||||
}
|
||||
//...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve a chart at a specific ID.
|
||||
|
||||
@@ -219,14 +235,15 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `song` | [SongDocument](../../schemas/song.md) | The parent song for this chart. |
|
||||
| `chart` | [ChartDocument](../../schemas/chart.md) | The requested chart document. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-------------------------------------: | :-----------------------------: |
|
||||
| `song` | [SongDocument](../../schemas/song.md) | The parent song for this chart. |
|
||||
| `chart` | [ChartDocument](../../schemas/chart.md) | The requested chart document. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/charts/some_chart_id
|
||||
```
|
||||
@@ -237,19 +254,19 @@ GET /api/v1/games/iidx/SP/charts/some_chart_id
|
||||
{
|
||||
"song": {
|
||||
"id": 123,
|
||||
"title": "BLOCKS",
|
||||
"title": "BLOCKS"
|
||||
// ...
|
||||
},
|
||||
"chart": {
|
||||
"chartID": "some_chart_id",
|
||||
"songID": 123,
|
||||
"playtype": "SP",
|
||||
"playtype": "SP"
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve playcount for this chart.
|
||||
|
||||
@@ -261,15 +278,15 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `count` | Integer | The amount of plays on this chart. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----: | :--------------------------------: |
|
||||
| `count` | Integer | The amount of plays on this chart. |
|
||||
|
||||
### Example
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve leaderboards for this chart.
|
||||
|
||||
@@ -277,20 +294,21 @@ Self-explanatory.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :-----------------------: | :---------------------------------------------------------------------: | :---------: |
|
||||
| `startRanking` (Optional) | Specify a start point to return 100 pbs from. Defaults to 1. Inclusive. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `pbs` | Array<PBDocument> | The array of pbs sorted by ranking. |
|
||||
| `users` | The users these PBs belong to. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----------------------------: | :---------------------------------: |
|
||||
| `pbs` | Array<PBDocument> | The array of pbs sorted by ranking. |
|
||||
| `users` | The users these PBs belong to. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/charts/some_chart/pbs
|
||||
```
|
||||
@@ -307,12 +325,12 @@ GET /api/v1/games/iidx/SP/charts/some_chart/pbs
|
||||
"outOf": 100,
|
||||
},
|
||||
// ...
|
||||
},
|
||||
},
|
||||
//...
|
||||
],
|
||||
"users": [{
|
||||
"id": 1,
|
||||
"username": "zkrising",
|
||||
"username": "zkldi
|
||||
// ...
|
||||
},
|
||||
// ...
|
||||
@@ -320,7 +338,7 @@ GET /api/v1/games/iidx/SP/charts/some_chart/pbs
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search for a user's PB on this chart.
|
||||
|
||||
@@ -328,8 +346,8 @@ GET /api/v1/games/iidx/SP/charts/some_chart/pbs
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :-------------------------------------: |
|
||||
| `search` | String | The user whose PB you're searching for. |
|
||||
|
||||
### Response
|
||||
@@ -340,7 +358,7 @@ Same as `/api/v1/games/:game/:playtype/charts/:chartID/pbs`.
|
||||
|
||||
See Above.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search a GPT's folders.
|
||||
|
||||
@@ -348,32 +366,36 @@ See Above.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :------------------------------------: |
|
||||
| `search` | String | A string to search for a given folder. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-------------------------: | :-----------------------------------: |
|
||||
| `<body>` | Array<FolderDocument> | The folders that matched this search. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/folders?search=12
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```js
|
||||
[{
|
||||
name: "beatmania IIDX Level 12",
|
||||
// ...
|
||||
}]
|
||||
[
|
||||
{
|
||||
name: "beatmania IIDX Level 12",
|
||||
// ...
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve information on a specific folderID
|
||||
|
||||
@@ -385,15 +407,16 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The related song documents for this folder. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The related song documents for this folder. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The related chart documents for this folder. |
|
||||
| `folder` | FolderDocument | The folder document at this ID. |
|
||||
| `folder` | FolderDocument | The folder document at this ID. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/iidx/SP/folders/some_folder_id
|
||||
```
|
||||
@@ -422,17 +445,17 @@ GET /api/v1/games/iidx/SP/folders/some_folder_id
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Return all the tables for this game
|
||||
|
||||
`GET /api/v1/games/:game/:playtype/tables`
|
||||
|
||||
!!! note
|
||||
Unlike the folders endpoint, this one doesn't have a search parameter. This is because we expect
|
||||
the total table count to stay rather small.
|
||||
Unlike the folders endpoint, this one doesn't have a search parameter. This is because we expect
|
||||
the total table count to stay rather small.
|
||||
|
||||
If this changes in the future, this might become a paginated search like endpoint.
|
||||
If this changes in the future, this might become a paginated search like endpoint.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -440,34 +463,36 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------: | :-----------------------: |
|
||||
| `tables` | Array<TableDocument> | Every table for this GPT. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/bms/7K/tables
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```js
|
||||
{
|
||||
tables: [
|
||||
{
|
||||
name: "Insane",
|
||||
// ...
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Overjoy",
|
||||
// ...
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve folder documents for a specific table.
|
||||
|
||||
@@ -479,19 +504,21 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :-------: | :-------------------------: | :--------------------------------: |
|
||||
| `folders` | Array<FolderDocument> | All of the folders for this table. |
|
||||
| `table` | TableDocument | The table document at this ID. |
|
||||
| `table` | TableDocument | The table document at this ID. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/games/bms/7K/tableID/insane
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```js
|
||||
{
|
||||
folders: [
|
||||
@@ -505,7 +532,7 @@ GET /api/v1/games/bms/7K/tableID/insane
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve the PB leaderboard for this Game.
|
||||
|
||||
@@ -513,21 +540,21 @@ GET /api/v1/games/bms/7K/tableID/insane
|
||||
|
||||
### 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. |
|
||||
| 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<PBDocument> | The array of pbs part of the PB leaderboard. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs part of the PBs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts part of the PBs. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The array of users part of the PBs. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :------------------------------------------: |
|
||||
| `pbs` | Array<PBDocument> | The array of pbs part of the PB leaderboard. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs part of the PBs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts part of the PBs. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The array of users part of the PBs. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get the distribution of players for a provided class.
|
||||
|
||||
@@ -535,19 +562,20 @@ GET /api/v1/games/bms/7K/tableID/insane
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `class` | String | Must be one of the GPTs supported classes, This specifies what distribution to return. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :------------------------------------------------------------------------------------: |
|
||||
| `class` | String | Must be one of the GPTs supported classes, This specifies what distribution to return. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-------------------------------: | :---------------------------------------------------------------------------: |
|
||||
| `<body>` | 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
|
||||
```
|
||||
@@ -568,11 +596,11 @@ 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 gptConfig for this GPT.
|
||||
|
||||
See [tachi/common](https://github.com/zkrising/Tachi/tree/main/common) for more information.
|
||||
See [tachi/common](https://github.com/zkldichi/tree/main/common) for more information.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve recent class updates from all users on this game.
|
||||
|
||||
@@ -580,18 +608,18 @@ GET /api/v1/games/bms/7K/player-distribution?class=stslDan
|
||||
|
||||
### 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. |
|
||||
| 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](../../schemas/user.md)> | Array of the users who achieved the courses. |
|
||||
| `classes` | Array<ClassAchievementDocument> | Data about the recently achieved classes. |
|
||||
| Property | Type | Description |
|
||||
| :-------: | :------------------------------------------------: | :------------------------------------------: |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | 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.
|
||||
|
||||
@@ -599,15 +627,15 @@ GET /api/v1/games/bms/7K/player-distribution?class=stslDan
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `limit` | Optional Integer | Optionally, provide an integer between 1 and 100 to return this amount of scores. Defaults to 100. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------: | :------------------------------------------------------------------------------------------------: |
|
||||
| `limit` | Optional Integer | Optionally, provide an integer between 1 and 100 to return this amount of scores. Defaults to 100. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The highlighted scores. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The users who own the scores. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The songs the scores are on. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :---------------------------: |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The highlighted scores. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The users who own the scores. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The songs the scores are on. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The charts the scores are on. |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Session Endpoints
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a specific session
|
||||
|
||||
@@ -12,17 +12,18 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `session` | [SessionDocument](../../schemas/session.md) | The session document at this ID. |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The score documents involved in this session. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The songs these score documents belong to. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The charts these score documents belong to. |
|
||||
| `user` | [UserDocument](../../schemas/user.md) | The user that made this session. |
|
||||
| Property | Type | Description |
|
||||
| :-------: | :--------------------------------------------------: | :-------------------------------------------: |
|
||||
| `session` | [SessionDocument](../../schemas/session.md) | The session document at this ID. |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The score documents involved in this session. |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The songs these score documents belong to. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The charts these score documents belong to. |
|
||||
| `user` | [UserDocument](../../schemas/user.md) | The user that made this session. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
```
|
||||
@@ -33,7 +34,7 @@ GET /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
{
|
||||
user: {
|
||||
id: 1,
|
||||
username: "zkrising",
|
||||
username: "zkldi",
|
||||
// ...
|
||||
},
|
||||
session: {
|
||||
@@ -62,7 +63,7 @@ GET /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Modify a session
|
||||
|
||||
@@ -75,32 +76,33 @@ GET /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `name` (optional) | String | A new name for this session. This must be between 3 and 80 characters. If not present, no update will be made to the session name. |
|
||||
| `desc` (optional) | String | A new description for this session. This must be between 3 and 120 characters. If not present, no update to the description will be made. |
|
||||
| `highlight` (optional) | boolean | Whether this session is highlighted or not. If not present, no change will be made to the highlighted status. |
|
||||
| Property | Type | Description |
|
||||
| :--------------------: | :-----: | :---------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| `name` (optional) | String | A new name for this session. This must be between 3 and 80 characters. If not present, no update will be made to the session name. |
|
||||
| `desc` (optional) | String | A new description for this session. This must be between 3 and 120 characters. If not present, no update to the description will be made. |
|
||||
| `highlight` (optional) | boolean | Whether this session is highlighted or not. If not present, no change will be made to the highlighted status. |
|
||||
|
||||
!!! info
|
||||
Although all these fields are optional, making a request
|
||||
without any of them is a 400 error.
|
||||
Although all these fields are optional, making a request
|
||||
without any of them is a 400 error.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----------------------------------------: | :--------------------------------------------: |
|
||||
| `<body>` | [SessionDocument](../../schemas/session.md) | The new session document, after modifications. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
PATCH /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "new session name",
|
||||
"name": "new session name"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -113,4 +115,4 @@ PATCH /api/v1/sessions/Qe7b00261b1d3ba8e5c9ee4e76e77ea9f07d9493b
|
||||
"highlighted": false
|
||||
// ...
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
+146
-130
@@ -4,7 +4,7 @@ This endpoints are for specific users information on specific game + playtype co
|
||||
|
||||
This scenario appears frequently, and is typically shortened to UGPT.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get information about a user's plays on a game + playtype.
|
||||
|
||||
@@ -16,19 +16,20 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `gameStats` | UserGameStatsDocument | The User's GameStats for this game + playtype. |
|
||||
| `firstScore` | [ScoreDocument](../../schemas/score.md) or Null | The user's first score for this game + playtype. This is null if the user has no scores with timestamps. |
|
||||
| `mostRecentScore` | [ScoreDocument](../../schemas/score.md) or Null | The user's most recent score. This is null if the user has no scores with timestamps. |
|
||||
| `totalScores` | Integer | The total amount of scores this user has. |
|
||||
| `rankingData` | Record<Rating Algorithm, { ranking: integer, outOf: integer }> | The position of this player on the default leaderboards for this game, and how many players it is out of. |
|
||||
| Property | Type | Description |
|
||||
| :---------------: | :------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------: |
|
||||
| `gameStats` | UserGameStatsDocument | The User's GameStats for this game + playtype. |
|
||||
| `firstScore` | [ScoreDocument](../../schemas/score.md) or Null | The user's first score for this game + playtype. This is null if the user has no scores with timestamps. |
|
||||
| `mostRecentScore` | [ScoreDocument](../../schemas/score.md) or Null | The user's most recent score. This is null if the user has no scores with timestamps. |
|
||||
| `totalScores` | Integer | The total amount of scores this user has. |
|
||||
| `rankingData` | Record<Rating Algorithm, { ranking: integer, outOf: integer }> | The position of this player on the default leaderboards for this game, and how many players it is out of. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP
|
||||
GET /api/v1/users/zkldi/games/iidx/SP
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -66,7 +67,7 @@ GET /api/v1/users/zkrising/games/iidx/SP
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search a user's personal bests.
|
||||
|
||||
@@ -74,23 +75,24 @@ GET /api/v1/users/zkrising/games/iidx/SP
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :---------------------------------------------------------------------------------------------: |
|
||||
| `search` | String | Limits the returned scores to those where the corresponding song is most similar to this query. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `pbs` | Array<PBDocument> | The array of personal bests this search returned. This is limited to 30 returns. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :------------------------------------------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `pbs` | Array<PBDocument> | The array of personal bests this search returned. This is limited to 30 returns. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/pbs?search=Verfl
|
||||
GET /api/v1/users/zkldimes/iidx/SP/pbs?search=Verfl
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -135,23 +137,24 @@ different rating algorithm to sort under.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `alg` | String | An overriding rating algorithm to use instead of the default. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :-----------------------------------------------------------: |
|
||||
| `alg` | String | An overriding rating algorithm to use instead of the default. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `pbs` | Array<PBDocument> | The array of personal bests this search returned. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :-----------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `pbs` | Array<PBDocument> | The array of personal bests this search returned. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/pbs/best?alg=BPI
|
||||
GET /api/v1/users/zkldimes/iidx/SP/pbs/best?alg=BPI
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -197,7 +200,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/pbs/best?alg=BPI
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Returns all of a users personal bests.
|
||||
|
||||
@@ -209,17 +212,18 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `pbs` | Array<PBDocument> | All of the users PB Documents |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | All of the relevant songs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | All of the relevant charts. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :---------------------------: |
|
||||
| `pbs` | Array<PBDocument> | All of the users PB Documents |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | All of the relevant songs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | All of the relevant charts. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/pbs/all
|
||||
GET /api/v1/users/zkldimes/iidx/SP/pbs/all
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -250,7 +254,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/pbs/all
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get A User's PB for a given chart.
|
||||
|
||||
@@ -258,21 +262,22 @@ GET /api/v1/users/zkrising/games/iidx/SP/pbs/all
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :--------------: | :------: | :------------------------------------------------------------------------------------: |
|
||||
| `getComposition` | Presence | If present, the individual ScoreDocuments that composed this PB will also be returned. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `pb` | PBDocument | The user's PB for this chart. |
|
||||
| `chart` | [ChartDocument](../../schemas/chart.md) | The chart this PB is on. |
|
||||
| `scores` (Conditional) | Array<[ScoreDocument](../../schemas/score.md)> | If `getComposition` is present, then this field contains the array of score documents that composed this PB. |
|
||||
| Property | Type | Description |
|
||||
| :--------------------: | :--------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: |
|
||||
| `pb` | PBDocument | The user's PB for this chart. |
|
||||
| `chart` | [ChartDocument](../../schemas/chart.md) | The chart this PB is on. |
|
||||
| `scores` (Conditional) | Array<[ScoreDocument](../../schemas/score.md)> | If `getComposition` is present, then this field contains the array of score documents that composed this PB. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/1/games/iidx/SP/pbs/some_chart_id
|
||||
```
|
||||
@@ -293,7 +298,7 @@ GET /api/v1/users/1/games/iidx/SP/pbs/some_chart_id
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search a user's individual scores.
|
||||
|
||||
@@ -301,30 +306,31 @@ GET /api/v1/users/1/games/iidx/SP/pbs/some_chart_id
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :---------------------------------------------------------------------------------------------: |
|
||||
| `search` | String | Limits the returned scores to those where the corresponding song is most similar to this query. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md) with __textScore> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The array of scores this search returned. This is limited to 30 returns. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-------------------------------------------------------------------: | :----------------------------------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md) with \_\_textScore> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The array of scores this search returned. This is limited to 30 returns. |
|
||||
|
||||
!!! info
|
||||
All `songs` returned also have the `__textScore`
|
||||
property. This property describes how close the query
|
||||
was to the actual text, and is mostly internal.
|
||||
All `songs` returned also have the `__textScore`
|
||||
property. This property describes how close the query
|
||||
was to the actual text, and is mostly internal.
|
||||
|
||||
You can read more into the details of this at [Search Implementation](../../codebase/implementation-details/search.md)
|
||||
You can read more into the details of this at [Search Implementation](../../codebase/implementation-details/search.md)
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/scores?search=Verfl
|
||||
GET /api/v1/users/zkldimes/iidx/SP/scores?search=Verfl
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -355,7 +361,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/scores?search=Verfl
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a user's most recent 100 scores.
|
||||
|
||||
@@ -367,17 +373,18 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :----------------------------------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs this search returned. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts this search returned. |
|
||||
| `scores` | Array<[ScoreDocument](../../schemas/score.md)> | The array of scores this search returned. This is limited to 30 returns. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/scores/recent
|
||||
GET /api/v1/users/zkldimes/iidx/SP/scores/recent
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -408,7 +415,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/scores/recent
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Search a user's sessions.
|
||||
|
||||
@@ -420,21 +427,22 @@ song titles of played songs inside sessions.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :-----------------------------: |
|
||||
| `search` | String | The session name to search for. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------------------------------------: | :--------------------------------------------: |
|
||||
| `<body>` | Array<[SessionDocument](../../schemas/session.md)> | The array of sessions that matched this query. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/sessions?search=epic%20session
|
||||
GET /api/v1/users/zkldimes/iidx/SP/sessions?search=epic%20session
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -447,8 +455,8 @@ GET /api/v1/users/zkrising/games/iidx/SP/sessions?search=epic%20session
|
||||
game: "iidx",
|
||||
playtype: "SP",
|
||||
// ...
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
## Get a user's best 100 sessions.
|
||||
@@ -463,27 +471,28 @@ These are returned in descending order.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :--------------: | :----: | :------------------------------------------------------: |
|
||||
| `alg` (Optional) | String | The name of the algorithm to use instead of the default. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------------------------------------: | :-----------------------------------: |
|
||||
| `<body>` | Array<[SessionDocument](../../schemas/session.md)> | The array of the users best sessions. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/sessions/best
|
||||
GET /api/v1/users/zkldimes/iidx/SP/sessions/best
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
!!! info
|
||||
The default rating algorithm for IIDX:SP is `ktRating`.
|
||||
The default rating algorithm for IIDX:SP is `ktRating`.
|
||||
|
||||
```js
|
||||
[
|
||||
@@ -493,8 +502,8 @@ GET /api/v1/users/zkrising/games/iidx/SP/sessions/best
|
||||
playtype: "SP",
|
||||
calculatedData: {
|
||||
ktRating: 14,
|
||||
bpi: 3
|
||||
}
|
||||
bpi: 3,
|
||||
},
|
||||
// ... more properties
|
||||
},
|
||||
{
|
||||
@@ -503,10 +512,10 @@ GET /api/v1/users/zkrising/games/iidx/SP/sessions/best
|
||||
playtype: "SP",
|
||||
calculatedData: {
|
||||
ktRating: 13.2,
|
||||
bpi: 4
|
||||
}
|
||||
}
|
||||
]
|
||||
bpi: 4,
|
||||
},
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
## Get a user's most recent 100 sessions.
|
||||
@@ -523,19 +532,19 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------------------------------------: | :------------------------------: |
|
||||
| `<body>` | Array<[SessionDocument](../../schemas/session.md)> | The array of the users sessions. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a user's most recent session.
|
||||
|
||||
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/last`
|
||||
|
||||
!!! info
|
||||
This endpoint will return 404 if the user has never had a
|
||||
session for this game.
|
||||
This endpoint will return 404 if the user has never had a
|
||||
session for this game.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -543,15 +552,16 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----------------------------------------: | :-----------------------------: |
|
||||
| `<body>` | [SessionDocument](../../schemas/session.md) | The user's most recent session. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/sessions/last
|
||||
GET /api/v1/users/zkldimes/iidx/SP/sessions/last
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -564,7 +574,6 @@ GET /api/v1/users/zkrising/games/iidx/SP/sessions/last
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Get a user's most recent 100 highlighted sessions.
|
||||
|
||||
`GET /api/v1/users/:userID/games/:game/:playtype/sessions/highlighted`
|
||||
@@ -579,15 +588,16 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------------------------------------: | :------------------------------------------: |
|
||||
| `<body>` | Array<[SessionDocument](../../schemas/session.md)> | The array of the users highlighted sessions. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/sessions/highlighted
|
||||
GET /api/v1/users/zkldimes/iidx/SP/sessions/highlighted
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -608,7 +618,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/sessions/highlighted
|
||||
]
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a user's most played charts.
|
||||
|
||||
@@ -620,17 +630,18 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs related to the pbs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts related to the pbs. |
|
||||
| `pbs` | Array<(PBDocument & {__playcount: integer})> | An array of PB documents with the `__playcount` property attached. This property dictates how many times the user has played this chart. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| `songs` | Array<[SongDocument](../../schemas/song.md)> | The array of songs related to the pbs. |
|
||||
| `charts` | Array<[ChartDocument](../../schemas/chart.md)> | The array of charts related to the pbs. |
|
||||
| `pbs` | Array<(PBDocument & {\_\_playcount: integer})> | An array of PB documents with the `__playcount` property attached. This property dictates how many times the user has played this chart. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/most-played
|
||||
GET /api/v1/users/zkldimes/iidx/SP/most-played
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -674,7 +685,7 @@ GET /api/v1/users/zkrising/games/iidx/SP/most-played
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve a leaderboard around a user.
|
||||
|
||||
@@ -682,25 +693,26 @@ GET /api/v1/users/zkrising/games/iidx/SP/most-played
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `alg` | String (Optional) | Optionally, you can provide an override algorithm to use for the leaderboards instead of the game+playtype default. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :---------------: | :-----------------------------------------------------------------------------------------------------------------: |
|
||||
| `alg` | String (Optional) | Optionally, you can provide an override algorithm to use for the leaderboards instead of the game+playtype default. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `above` | Array<UserGameStats> | Up to 5 users' game stats better than this user. |
|
||||
| `below` | Array<UserGameStats> | Same as above, but below the user. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The user documents related to the above statistics. |
|
||||
| `thisUsersStats` | UserGameStats | The requested user's stats for this GPT. |
|
||||
| `thisUsersRanking` | {outOf: integer, ranking: integer} | The requested user's ranking for this GPT. |
|
||||
| Property | Type | Description |
|
||||
| :----------------: | :------------------------------------------------: | :-------------------------------------------------: |
|
||||
| `above` | Array<UserGameStats> | Up to 5 users' game stats better than this user. |
|
||||
| `below` | Array<UserGameStats> | Same as above, but below the user. |
|
||||
| `users` | Array<[UserDocument](../../schemas/user.md)> | The user documents related to the above statistics. |
|
||||
| `thisUsersStats` | UserGameStats | The requested user's stats for this GPT. |
|
||||
| `thisUsersRanking` | {outOf: integer, ranking: integer} | The requested user's ranking for this GPT. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/games/iidx/SP/leaderboard-adjacent
|
||||
GET /api/v1/users/zkldimes/iidx/SP/leaderboard-adjacent
|
||||
```
|
||||
|
||||
#### Response
|
||||
@@ -747,12 +759,12 @@ GET /api/v1/users/zkrising/games/iidx/SP/leaderboard-adjacent
|
||||
},
|
||||
thisUsersRanking: {
|
||||
ranking: 2,
|
||||
outOf: 3
|
||||
outOf: 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve this user's GPT stat history.
|
||||
|
||||
@@ -766,13 +778,14 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------: | :-------------------------------------------------------------------------------------------------------------------: |
|
||||
| `<body>` | Array<UserGameStatsSnapshot> | The most recent (up to) 90 UGS Snapshots, where the first element is the most recent one, and the last is the oldest. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/1/games/iidx/SP/history
|
||||
```
|
||||
@@ -792,21 +805,21 @@ GET /api/v1/users/1/games/iidx/SP/history
|
||||
},
|
||||
timestamp: 12312323123123, // most recent
|
||||
playcount: 500,
|
||||
ranking: 14
|
||||
ranking: 14,
|
||||
},
|
||||
// and so on..
|
||||
]
|
||||
];
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve this user's GPT settings.
|
||||
|
||||
`GET /api/v1/users/:userID/games/:game/:playtype/settings`
|
||||
|
||||
!!! warning
|
||||
Unlike most other applications, your settings are completely public. GPT Settings only concern
|
||||
cosmetic things, like what rating algorithms to prefer.
|
||||
Unlike most other applications, your settings are completely public. GPT Settings only concern
|
||||
cosmetic things, like what rating algorithms to prefer.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -814,18 +827,20 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------: | :----------------------------------: |
|
||||
| `<body>` | UGPTSettingsDocument | The settings document for this user. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/1/games/iidx/SP/settings
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
```js
|
||||
{
|
||||
preferredScoreAlg: null,
|
||||
@@ -835,15 +850,15 @@ GET /api/v1/users/1/games/iidx/SP/settings
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Modify your UGPT settings.
|
||||
|
||||
`PATCH /api/v1/users/:userID/games/:game/:playtype/settings`
|
||||
|
||||
!!! note
|
||||
Although `stats` are part of your settings, they are not modifiable under these endpoints,
|
||||
instead you should use [UGPT Showcase Endpoints](./ugpt-showcase.md).
|
||||
Although `stats` are part of your settings, they are not modifiable under these endpoints,
|
||||
instead you should use [UGPT Showcase Endpoints](./ugpt-showcase.md).
|
||||
|
||||
### Permissions
|
||||
|
||||
@@ -851,19 +866,20 @@ GET /api/v1/users/1/games/iidx/SP/settings
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| `<body>` | Partial UGPTSettingsDocument | A UGPTSettingsDocument where all properties are optional. Properties not present will not be modified. Note that `stats` are not modifiable here. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------: | :---------------------------: |
|
||||
| `<body>` | UGPTSettingsDocument | The new UGPTSettingsDocument. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
PATCH /api/v1/users/1/games/iidx/SP/settings
|
||||
|
||||
|
||||
+130
-120
@@ -2,7 +2,7 @@
|
||||
|
||||
These endpoints are related to users in general.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## List Users
|
||||
|
||||
@@ -10,19 +10,19 @@ These endpoints are related to users in general.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `online` (Optional) | Presence | If present, this limits the returned users to those that are currently online. |
|
||||
| `search` (Optional) | String | If present, this endpoint will only return users where this string is contained within their username. |
|
||||
| Property | Type | Description |
|
||||
| :-----------------: | :------: | :----------------------------------------------------------------------------------------------------: |
|
||||
| `online` (Optional) | Presence | If present, this limits the returned users to those that are currently online. |
|
||||
| `search` (Optional) | String | If present, this endpoint will only return users where this string is contained within their username. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :------------------------------------------------: | :------------------------------------: |
|
||||
| `<body>` | Array<[UserDocument](../../schemas/user.md)> | The array of up to 100 users returned. |
|
||||
|
||||
!!! note
|
||||
Users are guaranteeably returned in order of when they were `lastSeen`.
|
||||
Users are guaranteeably returned in order of when they were `lastSeen`.
|
||||
|
||||
### Example
|
||||
|
||||
@@ -35,28 +35,30 @@ GET /api/v1/users
|
||||
#### Response
|
||||
|
||||
```js
|
||||
[{
|
||||
"id": 1,
|
||||
"username": "zkrising",
|
||||
// ... continued
|
||||
}]
|
||||
[
|
||||
{
|
||||
id: 1,
|
||||
username: "zkldi",
|
||||
// ... continued
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve user with ID
|
||||
|
||||
`GET /api/v1/users/:userID`
|
||||
|
||||
!!! note
|
||||
The :userID param has some special functionality,
|
||||
and any time you see it in these docs, that
|
||||
functionality is supported.
|
||||
The :userID param has some special functionality,
|
||||
and any time you see it in these docs, that
|
||||
functionality is supported.
|
||||
|
||||
You may pass the integer userID for this user - 1.
|
||||
You may also pass the username - zkrising (This is also case-insensitive, so you could pass zkrising).
|
||||
You may also pass the special string - `me` - which
|
||||
will select whatever user you are authenticated as.
|
||||
You may pass the integer userID for this user - 1.
|
||||
You may also pass the username - zkldihis is also case-insensitive, so you could pass zklzkldi
|
||||
You may also pass the special string - `me` - which
|
||||
will select whatever user you are authenticated as.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -64,25 +66,26 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----------------------------------: | :---------------------------------------: |
|
||||
| `<body>` | [UserDocument](../../schemas/user.md) | The user this ID/username corresponds to. |
|
||||
|
||||
### Example
|
||||
|
||||
!!! note
|
||||
`zk` is the username for the user with userID 1.
|
||||
`zk` is the username for the user with userID 1.
|
||||
|
||||
it's also the username of the person writing these
|
||||
docs. Hi!
|
||||
it's also the username of the person writing these
|
||||
docs. Hi!
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising
|
||||
GET /api/v1/users/zkldi
|
||||
OR
|
||||
GET /api/v1/users/1
|
||||
OR
|
||||
GET /api/v1/users/zkrising (It's case insensitive!)
|
||||
GET /api/v1/users/zkldit's case insensitive!)
|
||||
OR
|
||||
GET /api/v1/users/me IF authenticated as userID 1.
|
||||
```
|
||||
@@ -92,12 +95,12 @@ GET /api/v1/users/me IF authenticated as userID 1.
|
||||
```js
|
||||
{
|
||||
id: 1,
|
||||
username: "zkrising",
|
||||
username: "zkldi
|
||||
// ... so on
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Modify this user document.
|
||||
|
||||
@@ -109,27 +112,28 @@ GET /api/v1/users/me IF authenticated as userID 1.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `about` | String | An about me. This is rendered as markdown. |
|
||||
| `status` | String \| Null | The users status. If null, this will be unset. |
|
||||
| Property | Type | Description |
|
||||
| :----------------------------------------------------------: | :------------: | :---------------------------------------------------------------------------: |
|
||||
| `about` | String | An about me. This is rendered as markdown. |
|
||||
| `status` | String \| Null | The users status. If null, this will be unset. |
|
||||
| `discord`, `twitter`, `github`, `steam`, `youtube`, `twitch` | String \| Null | Information about this users social media. If null, this field will be unset. |
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-----------------------------------: | :--------------------------------------------------: |
|
||||
| `<body>` | [UserDocument](../../schemas/user.md) | The user document with all of those changes applied. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```js
|
||||
{
|
||||
"about": "#Hello!**I'm zkrising**",
|
||||
"about": "#Hello!**I'm zkldi,
|
||||
"status": "I'm cool!",
|
||||
"twitter": null,
|
||||
"steam": "zkrising"
|
||||
"steam": "zkldi
|
||||
}
|
||||
```
|
||||
|
||||
@@ -138,21 +142,21 @@ GET /api/v1/users/me IF authenticated as userID 1.
|
||||
```js
|
||||
{
|
||||
"id": 1,
|
||||
"username": "zkrising",
|
||||
"usernameLowercase": "zkrising",
|
||||
"username": "zkldi
|
||||
"usernameLowercase": "zkldi
|
||||
"socialMedia": {
|
||||
"twitter": null,
|
||||
"steam": "zkrising",
|
||||
"steam": "zkldi
|
||||
// this property was already here, and not modified by the request.
|
||||
"discord": "chatbpd",
|
||||
},
|
||||
"about": "#Hello!**I'm zkrising**",
|
||||
"about": "#Hello!**I'm zkldi,
|
||||
"status": "I'm cool!",
|
||||
// and other user props...
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Retrieve user's statistics on all games.
|
||||
|
||||
@@ -164,18 +168,19 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `<body>` | Array<UserGameStatsDocument & __rankingData> | The array of User Game Stats this user has. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :--------------------------------------------------: | :-----------------------------------------: |
|
||||
| `<body>` | Array<UserGameStatsDocument & \_\_rankingData> | The array of User Game Stats this user has. |
|
||||
|
||||
!!! info
|
||||
For UI reasons, the UserGameStatsDocuments here have an additional `__rankingData` property, which contains leaderboard ranking information for this user.
|
||||
For UI reasons, the UserGameStatsDocuments here have an additional `__rankingData` property, which contains leaderboard ranking information for this user.
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
GET /api/v1/users/zkrising/game-stats
|
||||
GET /api/v1/users/zkldime-stats
|
||||
OR
|
||||
GET /api/v1/users/1/game-stats
|
||||
```
|
||||
@@ -183,50 +188,53 @@ GET /api/v1/users/1/game-stats
|
||||
#### Response
|
||||
|
||||
```js
|
||||
[{
|
||||
userID: 1,
|
||||
game: "iidx",
|
||||
playtype: "SP",
|
||||
ratings: {
|
||||
ktRating: 15
|
||||
},
|
||||
classes: {
|
||||
dan: 14
|
||||
},
|
||||
__rankingData: {
|
||||
ktRating: {
|
||||
ranking: 15,
|
||||
outOf: 74
|
||||
[
|
||||
{
|
||||
userID: 1,
|
||||
game: "iidx",
|
||||
playtype: "SP",
|
||||
ratings: {
|
||||
ktRating: 15,
|
||||
},
|
||||
classes: {
|
||||
dan: 14,
|
||||
},
|
||||
__rankingData: {
|
||||
ktRating: {
|
||||
ranking: 15,
|
||||
outOf: 74,
|
||||
},
|
||||
BPI: {
|
||||
ranking: 12,
|
||||
outOf: 74,
|
||||
},
|
||||
},
|
||||
BPI: {
|
||||
ranking: 12,
|
||||
outOf: 74
|
||||
}
|
||||
}
|
||||
}, {
|
||||
userID: 1,
|
||||
game: "gitadora",
|
||||
playtype: "Dora",
|
||||
ratings: {
|
||||
skill: 1404
|
||||
},
|
||||
classes: {
|
||||
skillColour: 1
|
||||
{
|
||||
userID: 1,
|
||||
game: "gitadora",
|
||||
playtype: "Dora",
|
||||
ratings: {
|
||||
skill: 1404,
|
||||
},
|
||||
classes: {
|
||||
skillColour: 1,
|
||||
},
|
||||
__rankingData: {
|
||||
skill: {
|
||||
ranking: 199,
|
||||
outOf: 202,
|
||||
},
|
||||
},
|
||||
},
|
||||
__rankingData: {
|
||||
skill: {
|
||||
ranking: 199,
|
||||
outOf: 202
|
||||
}
|
||||
}
|
||||
}]
|
||||
];
|
||||
```
|
||||
|
||||
!!! info
|
||||
In the event a user has played no games, this will
|
||||
return an empty array.
|
||||
In the event a user has played no games, this will
|
||||
return an empty array.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Change Profile Picture
|
||||
|
||||
@@ -239,22 +247,23 @@ GET /api/v1/users/1/game-stats
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `pfp` | JPG, or PNG | The new profile picture to set. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :---------: | :-----------------------------: |
|
||||
| `pfp` | JPG, or PNG | The new profile picture to set. |
|
||||
|
||||
!!! note
|
||||
This endpoint expects multipart form data.
|
||||
This endpoint expects multipart form data.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `get` | String | This contains the URL to then GET the new profile picture. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :--------------------------------------------------------: |
|
||||
| `get` | String | This contains the URL to then GET the new profile picture. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
PUT /api/v1/users/1/pfp
|
||||
```
|
||||
@@ -273,7 +282,7 @@ pfp=<somefiledata>
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a user's profile picture.
|
||||
|
||||
@@ -292,15 +301,15 @@ this user.
|
||||
|
||||
N/A
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Unset your profile picture.
|
||||
|
||||
`DELETE /api/v1/users/:userID/pfp`
|
||||
|
||||
!!! note
|
||||
If you do not have a profile picture set, this will be
|
||||
a 404 error.
|
||||
If you do not have a profile picture set, this will be
|
||||
a 404 error.
|
||||
|
||||
### Permissions
|
||||
|
||||
@@ -310,6 +319,7 @@ N/A
|
||||
### Parameters
|
||||
|
||||
None.
|
||||
|
||||
### Response
|
||||
|
||||
None.
|
||||
@@ -318,7 +328,7 @@ None.
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Change Profile Banner
|
||||
|
||||
@@ -331,22 +341,23 @@ Self-explanatory.
|
||||
|
||||
### Parameters
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :---------: | :----------------------------: |
|
||||
| `banner` | JPG, or PNG | The new profile banner to set. |
|
||||
|
||||
!!! note
|
||||
This endpoint expects multipart form data.
|
||||
This endpoint expects multipart form data.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| `get` | String | This contains the URL to then GET the new profile banner. |
|
||||
| Property | Type | Description |
|
||||
| :------: | :----: | :-------------------------------------------------------: |
|
||||
| `get` | String | This contains the URL to then GET the new profile banner. |
|
||||
|
||||
### Example
|
||||
|
||||
#### Request
|
||||
|
||||
```
|
||||
PUT /api/v1/users/1/banner
|
||||
```
|
||||
@@ -365,7 +376,7 @@ banner=<somefiledata>
|
||||
}
|
||||
```
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Get a user's profile banner.
|
||||
|
||||
@@ -384,17 +395,17 @@ this user.
|
||||
|
||||
N/A
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Unset your profile banner.
|
||||
|
||||
`DELETE /api/v1/users/:userID/banner`
|
||||
|
||||
!!! note
|
||||
If you do not have a profile banner set, this is
|
||||
a 404 error.
|
||||
If you do not have a profile banner set, this is
|
||||
a 404 error.
|
||||
|
||||
### Permissions
|
||||
|
||||
@@ -414,12 +425,12 @@ None.
|
||||
- Must be a session-request from the user who owns these notifications.
|
||||
|
||||
!!! note
|
||||
All of the notification endpoints must be accessed by session-level authentication
|
||||
from the right requesting user; viz. no api keys can access these endpoints, and
|
||||
nobody can read another players notifications.
|
||||
All of the notification endpoints must be accessed by session-level authentication
|
||||
from the right requesting user; viz. no api keys can access these endpoints, and
|
||||
nobody can read another players notifications.
|
||||
|
||||
This isn't really for any security reasons, but more for privacy reasons. It feels
|
||||
wrong to be able to let others read others notifications.
|
||||
This isn't really for any security reasons, but more for privacy reasons. It feels
|
||||
wrong to be able to let others read others notifications.
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -427,19 +438,19 @@ None.
|
||||
|
||||
### Response
|
||||
|
||||
| Property | Type | Description |
|
||||
| :: | :: | :: |
|
||||
| Property | Type | Description |
|
||||
| :------: | :-------------------------------: | :----------------------------------------------------------------------------------: |
|
||||
| `<body>` | Array<NotificationDocument> | An array of all of this users notifications, sorted by most recently recieved first. |
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Mark all of your notifications as read.
|
||||
|
||||
`POST /api/v1/users/:userID/notifications/mark-all-read`
|
||||
|
||||
!!! info
|
||||
This endpoints marks all of a users notifications as read, and is intended for a UI
|
||||
to invoke this request when they open their inbox.
|
||||
This endpoints marks all of a users notifications as read, and is intended for a UI
|
||||
to invoke this request when they open their inbox.
|
||||
|
||||
### Permissions
|
||||
|
||||
@@ -453,11 +464,10 @@ None.
|
||||
|
||||
None. (Empty Object)
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Clear all notifications from your inbox.
|
||||
|
||||
|
||||
`POST /api/v1/users/:userID/notifications/delete-all`
|
||||
|
||||
### Permissions
|
||||
|
||||
@@ -10,13 +10,13 @@ combination, which contains things like the list of
|
||||
lamps for the game.
|
||||
|
||||
!!! help
|
||||
This page is unfinished.
|
||||
This page is unfinished.
|
||||
|
||||
It would be really appreciated if someone formatted
|
||||
the configurations for every game! For the time being,
|
||||
the below documentation is just the raw configuration
|
||||
for each game. Please see [Contributing to Tachi](../../contributing).
|
||||
It would be really appreciated if someone formatted
|
||||
the configurations for every game! For the time being,
|
||||
the below documentation is just the raw configuration
|
||||
for each game. Please see [Contributing to Tachi](../../contributing).
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
This documentation is unfinished. It is probably easier for you to [just read the config.ts file](https://github.com/zkrising/Tachi/tree/main/common/src/config/config.ts)
|
||||
This documentation is unfinished. It is probably easier for you to [just read the config.ts file](https://github.com/zkldi/Tachi/tree/main/common/src/config/config.ts)
|
||||
|
||||
@@ -6,11 +6,11 @@ HARD CLEAR Mei goal, but one already exists, we should
|
||||
not insert two [Goal Documents](../../schemas/goal.md)
|
||||
representing the same thing.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Hashing
|
||||
|
||||
To create the Goal ID, we perform a [JSON stable hash](https://github.com/zkrising/fast-json-stable-hash) on the
|
||||
To create the Goal ID, we perform a [JSON stable hash](https://github.com/zkldi/fast-json-stable-hash) on the
|
||||
`game`, `playtype`, `charts` and `criteria` of this field.
|
||||
|
||||
This enforces that goals are unique on those fields.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Codebase Overview
|
||||
|
||||
This part of the documentation is for the [Tachi-Server](https://github.com/zkrising/Tachi/tree/main/server) codebase.
|
||||
This part of the documentation is for the [Tachi-Server](https://github.com/zkldi/Tachi/tree/main/server) codebase.
|
||||
|
||||
## Codebase Documentation vs. Code Documentation
|
||||
|
||||
@@ -40,4 +40,4 @@ This is also published to NPM when it hits production.
|
||||
|
||||
- `sieglinde/`, Which contains our BMS/PMS analysis functions.
|
||||
|
||||
Of these, `server/` and `client/` are licensed under the AGPL3. The `seeds/` are licensed under the unlicense, and everything else is MIT.
|
||||
Of these, `server/` and `client/` are licensed under the AGPL3. The `seeds/` are licensed under the unlicense, and everything else is MIT.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Database Seeds
|
||||
|
||||
Tachi tracks the contents of its songs and charts in something called the [Database Seeds](https://github.com/zkrising/Tachi/tree/main/seeds).
|
||||
Tachi tracks the contents of its songs and charts in something called the [Database Seeds](https://github.com/zkldi/Tachi/tree/main/seeds).
|
||||
|
||||
The databases in question aren't (normally) altered by the server code. We essentially overload git and its CI tools to version control parts of our database.
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ WinstonJS for logging. We use a slightly modified setup
|
||||
of winston, but the same basic logging principles apply.
|
||||
|
||||
!!! note
|
||||
If you like my defaults for logging, they can be quickly
|
||||
invoked with the [Mei](https://github.com/zkrising/mei) wrapper.
|
||||
If you like my defaults for logging, they can be quickly
|
||||
invoked with the [Mei](https://github.com/zkldi/mei) wrapper.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Log Levels
|
||||
|
||||
@@ -78,10 +78,10 @@ logger.info("foo");
|
||||
```
|
||||
|
||||
!!! info
|
||||
This is the default [LOG_LEVEL](./config) for tachi.
|
||||
This is the default [LOG_LEVEL](./config) for tachi.
|
||||
|
||||
This means that all the levels below this are
|
||||
not displayed to the console or stored.
|
||||
This means that all the levels below this are
|
||||
not displayed to the console or stored.
|
||||
|
||||
`info` indicates that something notable has happened. This
|
||||
should not be used for any errors - instead, it should be
|
||||
@@ -129,7 +129,7 @@ logger.info("foo");
|
||||
```
|
||||
|
||||
!!! info
|
||||
CreateLogCtx is short for Create Log Context.
|
||||
CreateLogCtx is short for Create Log Context.
|
||||
|
||||
This will spawn an instance of the logger with the context
|
||||
of the current filename.
|
||||
@@ -144,17 +144,17 @@ logger with the user's name and import type as "context".
|
||||
const logger = CreateLogCtx(`${username} ${userID}`);
|
||||
|
||||
logger.info("foo");
|
||||
// [zkrising 1] INFO: foo
|
||||
// [zkldi INFO: foo
|
||||
|
||||
SomeOtherFunction(argument1, argument2, logger);
|
||||
```
|
||||
|
||||
!!! info
|
||||
Logger should be the last argument for a function that
|
||||
takes a logger.
|
||||
Logger should be the last argument for a function that
|
||||
takes a logger.
|
||||
|
||||
The only exception to this is if it uses our `fetch` API,
|
||||
which **MUST** always be the last call.
|
||||
The only exception to this is if it uses our `fetch` API,
|
||||
which **MUST** always be the last call.
|
||||
|
||||
If we have an existing logger and want to append context,
|
||||
we can do that with the `AppendLogCtx` function.
|
||||
@@ -178,8 +178,8 @@ file logs everything above `LOG_LEVEL`. The second file
|
||||
logs `error` and above calls.
|
||||
|
||||
!!! bug
|
||||
Unintentional behaviour occurs here if LOG_LEVEL is
|
||||
above `error` - the main file will not log errors,
|
||||
but the error file will log errors regardless.
|
||||
Unintentional behaviour occurs here if LOG_LEVEL is
|
||||
above `error` - the main file will not log errors,
|
||||
but the error file will log errors regardless.
|
||||
|
||||
This may be fixed at some point, but is fairly low priority.
|
||||
This may be fixed at some point, but is fairly low priority.
|
||||
|
||||
@@ -13,19 +13,19 @@ contribute to it.
|
||||
|
||||
### Issue Reports
|
||||
|
||||
You can report issues on the [GitHub](https://github.com/zkrising/Tachi) repository. This requires
|
||||
*absolutely no programming knowledge* on your part. All you have to do is write up a nice summary
|
||||
You can report issues on the [GitHub](https://github.com/zkldi/Tachi) repository. This requires
|
||||
_absolutely no programming knowledge_ on your part. All you have to do is write up a nice summary
|
||||
of the bug.
|
||||
|
||||
!!! note
|
||||
Although they're called GitHub *issues*, they're actually used for tracking anything. If you've
|
||||
came up with a cool feature idea, send it over as an issue! `zk` will read and Triage them.
|
||||
Although they're called GitHub _issues_, they're actually used for tracking anything. If you've
|
||||
came up with a cool feature idea, send it over as an issue! `zk` will read and Triage them.
|
||||
|
||||
For more information, read our [Issue Reporting Guide](./components/issues.md).
|
||||
|
||||
### Documentation
|
||||
|
||||
We store our documentation as a series of markdown files in the [Main Repository](https://github.com/zkrising/Tachi). You can find it under the `docs/` folder.
|
||||
We store our documentation as a series of markdown files in the [Main Repository](https://github.com/zkldichi). You can find it under the `docs/` folder.
|
||||
|
||||
Writing, maintaining and proofreading the documentation is something that is **severely** neglected
|
||||
at the moment. Simple things like typo fixes, all the way up to writing new explanations about major features
|
||||
@@ -35,7 +35,7 @@ If you're interested in this, check out the [Documentation Contribution Guide](.
|
||||
|
||||
### Database Seeds
|
||||
|
||||
We use an interesting system for parts of our database. We actually store a game's songs and charts *in*
|
||||
We use an interesting system for parts of our database. We actually store a game's songs and charts _in_
|
||||
our GitHub repository! That means you can:
|
||||
|
||||
- Open the `songs` file for a game.
|
||||
@@ -45,30 +45,30 @@ our GitHub repository! That means you can:
|
||||
- They automatically synchronise with the site!
|
||||
|
||||
!!! important
|
||||
This part of Tachi is the most important part for external contributors.
|
||||
You guys know these games better than `zk` does, and you guys keep an eye on all the updates for your games!
|
||||
This part of Tachi is the most important part for external contributors.
|
||||
You guys know these games better than `zk` does, and you guys keep an eye on all the updates for your games!
|
||||
|
||||
If people don't add songs/charts to this database, `zk` will **not** keep an eye on the game for you! Someone *has* to pick up the reigns for each game!
|
||||
If people don't add songs/charts to this database, `zk` will **not** keep an eye on the game for you! Someone *has* to pick up the reigns for each game!
|
||||
|
||||
If you want to add/fix songs, charts, folders or tables for your favourite game - **START HERE!**
|
||||
If you want to add/fix songs, charts, folders or tables for your favourite game - **START HERE!**
|
||||
|
||||
Or in general, if you just want to contribute and don't know what to -- **this is the MOST in need of help. Always.**
|
||||
Or in general, if you just want to contribute and don't know what to -- **this is the MOST in need of help. Always.**
|
||||
|
||||
Want to get started on contributing to the Database? Check out our [Database Contribution Guide](./components/seeds.md).
|
||||
|
||||
### Server, Client
|
||||
|
||||
The server and client form the powerful *core* of Tachi.
|
||||
The server and client form the powerful _core_ of Tachi.
|
||||
|
||||
The server handles all of our logic -- How do we get scores, where should scores come from, how do we calculate all these stats and way more.
|
||||
|
||||
The client tries to then place a slick UI over that logic and its exposed API.
|
||||
|
||||
!!! warning
|
||||
Tachi's core is not an amazingly complex beast, but it is *not* going to be reasonably followable
|
||||
with not a lot of programming experience. You'll need some background in programming to be able to do almost anything in this area.
|
||||
Tachi's core is not an amazingly complex beast, but it is _not_ going to be reasonably followable
|
||||
with not a lot of programming experience. You'll need some background in programming to be able to do almost anything in this area.
|
||||
|
||||
That said, we still have a thorough guide -- It's not *from 0*, but it is *from some programming knowledge*.
|
||||
That said, we still have a thorough guide -- It's not *from 0*, but it is *from some programming knowledge*.
|
||||
|
||||
Want to get started on contributing to the Core? Check out our [Core Contribution Guide](./components/core.md).
|
||||
|
||||
@@ -83,4 +83,3 @@ We'll cover...
|
||||
|
||||
Everything else in Tachi isn't seeking external contribution at the moment. So, feel free to check
|
||||
out one of the above linked guides!
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Before you can contribute to Tachi, it'll help to have a functional setup on your machine.
|
||||
|
||||
You don't *necessarily* need to have a working install to contribute - you could easily
|
||||
You don't _necessarily_ need to have a working install to contribute - you could easily
|
||||
make documentation contributions without having anything running on your machine - but
|
||||
it's extremely helpful to be able to run Tachi's things while working on them.
|
||||
|
||||
@@ -15,7 +15,7 @@ We'll need a code editor so we can actually edit Tachi's code.
|
||||
Please install [VSCode](https://code.visualstudio.com).
|
||||
We'll use this as our editor because of it's excellent support for dev containers.
|
||||
|
||||
### Terminal
|
||||
### Terminal
|
||||
|
||||
You'll also need a terminal to run commands in. For Linux and Mac users, you can just open
|
||||
a Terminal app.
|
||||
@@ -24,79 +24,76 @@ However, for Windows users we recommend installing the [Windows Terminal](https:
|
||||
|
||||
With a terminal open you can proceed to the next steps!
|
||||
|
||||
### Git
|
||||
### Git
|
||||
|
||||
You'll need `git` to clone Tachi to your machine.
|
||||
|
||||
=== "Windows"
|
||||
Install git [from the official website](https://git-scm.com/downloads).
|
||||
Install git [from the official website](https://git-scm.com/downloads).
|
||||
|
||||
=== "Ubuntu, Debian"
|
||||
Open a terminal and type this:
|
||||
|
||||
```sh
|
||||
Open a terminal and type this:
|
||||
`sh
|
||||
sudo apt install git
|
||||
```
|
||||
`
|
||||
|
||||
=== "Arch, Manjaro"
|
||||
Open a terminal and type this:
|
||||
Open a terminal and type this:
|
||||
|
||||
```sh
|
||||
sudo pacman -S git
|
||||
```
|
||||
```sh
|
||||
sudo pacman -S git
|
||||
```
|
||||
|
||||
=== "MacOS"
|
||||
Open a terminal and type this:
|
||||
Open a terminal and type this:
|
||||
|
||||
```sh
|
||||
brew install git
|
||||
```
|
||||
```sh
|
||||
brew install git
|
||||
```
|
||||
|
||||
## 1. Getting Docker.
|
||||
|
||||
To set everything else up for local development, we'll use [Docker](https://docker.com).
|
||||
|
||||
=== "Windows, WSL Ubuntu"
|
||||
You should install [Docker Desktop](https://docs.docker.com/desktop/) instead.
|
||||
Docker doesn't work well inside WSL.
|
||||
You should install [Docker Desktop](https://docs.docker.com/desktop/) instead.
|
||||
Docker doesn't work well inside WSL.
|
||||
|
||||
=== "Debian"
|
||||
[Please use the official Docker install guide.](https://docs.docker.com/engine/install/debian/)
|
||||
[Please use the official Docker install guide.](https://docs.docker.com/engine/install/debian/)
|
||||
|
||||
=== "Ubuntu"
|
||||
[Please use the official Docker install guide.](https://docs.docker.com/engine/install/ubuntu/)
|
||||
[Please use the official Docker install guide.](https://docs.docker.com/engine/install/ubuntu/)
|
||||
|
||||
=== "Arch, Manjaro"
|
||||
Open a terminal and type this:
|
||||
Open a terminal and type this:
|
||||
|
||||
```sh
|
||||
sudo pacman -S docker docker-compose
|
||||
```
|
||||
```sh
|
||||
sudo pacman -S docker docker-compose
|
||||
```
|
||||
|
||||
=== "MacOS"
|
||||
Open a terminal and type this:
|
||||
Open a terminal and type this:
|
||||
|
||||
```sh
|
||||
brew install docker docker-compose
|
||||
```
|
||||
```sh
|
||||
brew install docker docker-compose
|
||||
```
|
||||
|
||||
!!! info
|
||||
Docker is like a VM[^1]. It runs an entire Linux box to contain your software in, and generally sidesteps the whole "works on some machines" problem.
|
||||
Docker is like a VM[^1]. It runs an entire Linux box to contain your software in, and generally sidesteps the whole "works on some machines" problem.
|
||||
|
||||
## 2. Fork and pull the repo.
|
||||
|
||||
Since you can't just commit straight to someone else's codebase (that would be a massive security issue), you need to make a fork of Tachi - One owned by you!
|
||||
|
||||
Go to [the Tachi repository](https://github.com/zkrising/Tachi) and click the Fork button in the top right (Make sure you're signed in).
|
||||
Go to [the Tachi repository](https://github.com/zkldi/Tachi) and click the Fork button in the top right (Make sure you're signed in).
|
||||
|
||||
Now, back to the terminal:
|
||||
|
||||
!!! tip
|
||||
It's good organisation to make a folder on your PC for codestuffs.
|
||||
|
||||
If you do that, make sure you open the terminal in that folder,
|
||||
so your Tachi repo will save there!
|
||||
|
||||
It's good organisation to make a folder on your PC for codestuffs.
|
||||
If you do that, make sure you open the terminal in that folder,
|
||||
so your Tachi repo will save there!
|
||||
|
||||
Open a terminal and type the following commands:
|
||||
|
||||
@@ -115,10 +112,10 @@ code Tachi
|
||||
|
||||
Your personal machine could be running anything. Windows, Mac, Linux, whatever!
|
||||
Tachi expects to be running on Linux and with specific versions of certain software running.
|
||||
It's a huge pain to ask *you* to install that software and manage it yourself.
|
||||
It's a huge pain to ask _you_ to install that software and manage it yourself.
|
||||
Plus, subtle differences between Windows and Linux cause problems _all_ the time.
|
||||
|
||||
As such, we work *inside* a docker container. This is sort of like having a Linux VM with everything set up perfectly for you.
|
||||
As such, we work _inside_ a docker container. This is sort of like having a Linux VM with everything set up perfectly for you.
|
||||
I've spent quite a bit of time making this container user friendly, and it has so many nice things pre-installed for you.
|
||||
|
||||
Perhaps more importantly, the container has everything needed to run Tachi perfectly. Neat!
|
||||
@@ -130,17 +127,17 @@ With `VSCode` open to Tachi, install the [Dev Container](https://marketplace.vis
|
||||
Then, hit `Ctrl+Shift+P` to view all commands, and run `Dev Containers: Rebuild and Reopen in Container`.
|
||||
|
||||
!!! warning
|
||||
First time setup can take a very long time.
|
||||
This depends on the performance of your machine, and whether you're using Windows or not.
|
||||
First time setup can take a very long time.
|
||||
This depends on the performance of your machine, and whether you're using Windows or not.
|
||||
|
||||
You can click `view log` in the bottom right to see the progress of making the container.
|
||||
You can click `view log` in the bottom right to see the progress of making the container.
|
||||
|
||||
### Working in the container
|
||||
|
||||
**You want to do ALL your work inside the container.**
|
||||
Doing thing outside of the container will cause issues or crashes.
|
||||
|
||||
There is a subtle confusing trick here. We now want to use a terminal *inside* our container.
|
||||
There is a subtle confusing trick here. We now want to use a terminal _inside_ our container.
|
||||
**Do not use a terminal outside of VSCode now.**
|
||||
|
||||
To open a terminal inside `VSCode`, use `Ctrl+J` to open the bottom panel.
|
||||
@@ -165,15 +162,15 @@ The frontend will be running on `http://127.0.0.1:3000`.
|
||||
The backend will be running on `https://127.0.0.1:8080`.
|
||||
|
||||
!!! danger
|
||||
The backend **always runs on HTTPS** in local development. This is because browsers
|
||||
tend to *really* hate HTTP mode nowadays, and it causes so many problems.
|
||||
The backend **always runs on HTTPS** in local development. This is because browsers
|
||||
tend to _really_ hate HTTP mode nowadays, and it causes so many problems.
|
||||
|
||||
You **need** to navigate to your running instance of the backend in a browser, and tell
|
||||
the browser that you trust these certificates. Otherwise, all client requests to
|
||||
the server will silently be chomped by the browser.
|
||||
You **need** to navigate to your running instance of the backend in a browser, and tell
|
||||
the browser that you trust these certificates. Otherwise, all client requests to
|
||||
the server will silently be chomped by the browser.
|
||||
|
||||
!!! tip
|
||||
Type `just` in the terminal to see other available commands.
|
||||
Type `just` in the terminal to see other available commands.
|
||||
|
||||
Navigate to http://127.0.0.1:3000 and check your Tachi instance!
|
||||
|
||||
|
||||
@@ -22,35 +22,35 @@ We're allowed 5 types of metrics:
|
||||
This metric is expected to be a decimal.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
`ts
|
||||
percent: {
|
||||
type: "DECIMAL",
|
||||
validate: p.isBetween(0, 100),
|
||||
formatter: FmtPercent,
|
||||
description: "EX Score divided by the maximum possible EX Score on this chart.",
|
||||
},
|
||||
```
|
||||
`
|
||||
|
||||
- `INTEGER`
|
||||
|
||||
This metric is expected to be a whole number.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
`ts
|
||||
{
|
||||
type: "INTEGER",
|
||||
validate: p.isBetween(0, 100_000),
|
||||
formatter: FmtNum,
|
||||
description: "The score value.",
|
||||
}
|
||||
```
|
||||
`
|
||||
|
||||
- `ENUM`
|
||||
|
||||
This metric is expected to be a string in a provided ordered list of strings. This is used to implement things like `"FAILED", "CLEAR", "FULL COMBO", "PERFECT"` lamps.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
`ts
|
||||
{
|
||||
type: "ENUM",
|
||||
values: [
|
||||
@@ -66,8 +66,7 @@ This metric is expected to be a string in a provided ordered list of strings. Th
|
||||
minimumRelevantValue: "EASY CLEAR",
|
||||
description: "The type of clear this was.",
|
||||
},
|
||||
```
|
||||
|
||||
`
|
||||
|
||||
- `GRAPH`
|
||||
|
||||
@@ -78,18 +77,18 @@ This metric is an array of numbers.
|
||||
This metric is an array of numbers or null.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
`ts
|
||||
gaugeHistory: {
|
||||
type: "NULLABLE_GRAPH",
|
||||
validate: p.isBetween(0, 100),
|
||||
description:
|
||||
"A snapshot of the gauge percent throughout the chart. The values should be null from the point the user dies until the end of the chart.",
|
||||
},
|
||||
```
|
||||
`
|
||||
|
||||
Importantly: something like `[99, 74, 12, null, null, null]` would be legal as a nullable graph.
|
||||
Importantly: something like `[99, 74, 12, null, null, null]` would be legal as a nullable graph.
|
||||
|
||||
This does not mean the field itself is nullable, only the values inside the array!
|
||||
This does not mean the field itself is nullable, only the values inside the array!
|
||||
|
||||
## Enum Metrics
|
||||
|
||||
@@ -97,6 +96,7 @@ Metrics of type `ENUM` are special in many ways. Most importantly, they don't re
|
||||
any sort of validation - the input is either a member of `values` or it isn't.
|
||||
|
||||
An ENUM metric looks like this:
|
||||
|
||||
```ts
|
||||
{
|
||||
type: "ENUM",
|
||||
@@ -122,10 +122,10 @@ ever realistically care about getting. This is used in the UI and other places t
|
||||
hide useless ENUM values from the user.
|
||||
|
||||
!!! example
|
||||

|
||||

|
||||
|
||||
Despite the fact this user failed a bunch of stuff this session, the UI won't
|
||||
show me my new `FAILED` or `ASSIST CLEAR` scores!
|
||||
Despite the fact this user failed a bunch of stuff this session, the UI won't
|
||||
show me my new `FAILED` or `ASSIST CLEAR` scores!
|
||||
|
||||
## Integer and Decimal Metrics
|
||||
|
||||
@@ -138,32 +138,32 @@ a property called `validate` which returns true on success, and a string represe
|
||||
an error message on failure:
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
{
|
||||
type: "INTEGER",
|
||||
validate: (value) => {
|
||||
if (value > 100_000) { return "Score cannot be greater than 100k." }
|
||||
```ts
|
||||
{
|
||||
type: "INTEGER",
|
||||
validate: (value) => {
|
||||
if (value > 100_000) { return "Score cannot be greater than 100k." }
|
||||
|
||||
return true;
|
||||
},
|
||||
formatter: FmtNum,
|
||||
description: "The score value.",
|
||||
}
|
||||
```
|
||||
return true;
|
||||
},
|
||||
formatter: FmtNum,
|
||||
description: "The score value.",
|
||||
}
|
||||
```
|
||||
|
||||
!!! note
|
||||
The type of input is already checked for you. You don't need to check whether your
|
||||
input is an integer or not if you declare `type: "INTEGER"`. The same goes for
|
||||
`type: "GRAPH"`, the validator instead runs on each element in the array.
|
||||
The type of input is already checked for you. You don't need to check whether your
|
||||
input is an integer or not if you declare `type: "INTEGER"`. The same goes for
|
||||
`type: "GRAPH"`, the validator instead runs on each element in the array.
|
||||
|
||||
!!! tip
|
||||
The reason for this rather strange type signature (`string | true`) is because we
|
||||
can use our validation library - [Prudence](https://github.com/zkrising/Prudence) - to create validators for us. Instead
|
||||
of writing out that validation code, we can use `p.isBetween(0, 100_000)`!
|
||||
The reason for this rather strange type signature (`string | true`) is because we
|
||||
can use our validation library - [Prudence](https://github.com/zkldi/Prudence) - to create validators for us. Instead
|
||||
of writing out that validation code, we can use `p.isBetween(0, 100_000)`!
|
||||
|
||||
However, it might not be possible to validate a metric without knowing what chart
|
||||
the score is on. For example, in IIDX the maximum amount of score you can get is
|
||||
the chart's notecount * 2.
|
||||
the chart's notecount \* 2.
|
||||
|
||||
Since we don't know what this GPT chart's look like at this time (we haven't defined them yet!)
|
||||
we instead don't declare a validator and put down `chartDependentMax: true` instead.
|
||||
@@ -182,6 +182,7 @@ Graph metrics (`GRAPH` and `NULLABLE_GRAPH`) also have to define a validator, bu
|
||||
|
||||
To validate that all of the values in a graph metric are between 0 and 10, you could
|
||||
write a validator like:
|
||||
|
||||
```ts
|
||||
function validate(value: number) {
|
||||
if (value < 0) return "too small";
|
||||
|
||||
@@ -16,25 +16,25 @@ an implementation here. You can declare a function that takes in the metric's va
|
||||
and the chart the score is on and validate accordingly.
|
||||
|
||||
These functions should return a string on error, and true on success. This is aligned
|
||||
with how [Prudence](https://github.com/zkrising/Prudence) works, so you can re-use prudence
|
||||
with how [Prudence](https://github.com/zkldi/Prudence) works, so you can re-use prudence
|
||||
functions here.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
musicRate: (rate, chart) => {
|
||||
switch (chart.difficulty) {
|
||||
case "BSC":
|
||||
case "ADV":
|
||||
case "EXT":
|
||||
return p.isBetween(0, 100)(rate);
|
||||
```ts
|
||||
musicRate: (rate, chart) => {
|
||||
switch (chart.difficulty) {
|
||||
case "BSC":
|
||||
case "ADV":
|
||||
case "EXT":
|
||||
return p.isBetween(0, 100)(rate);
|
||||
|
||||
case "HARD BSC":
|
||||
case "HARD ADV":
|
||||
case "HARD EXT":
|
||||
return p.isBetween(0, 120)(rate);
|
||||
}
|
||||
},
|
||||
```
|
||||
case "HARD BSC":
|
||||
case "HARD ADV":
|
||||
case "HARD EXT":
|
||||
return p.isBetween(0, 120)(rate);
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
## `derivers`
|
||||
|
||||
@@ -43,9 +43,9 @@ that takes in the provided metrics and the chart for this score and should retur
|
||||
the metric value we expect.
|
||||
|
||||
!!! example
|
||||
```ts
|
||||
`ts
|
||||
percent: (metrics, chart) => (100 * metrics.score) / (chart.data.notecount * 2);
|
||||
```
|
||||
`
|
||||
|
||||
## `scoreCalcs`, `sessionCalcs`, `profileCalcs`
|
||||
|
||||
@@ -87,7 +87,7 @@ HARD CLEAR/FULL COMBO
|
||||
|
||||
## `pbMergeFunctions`
|
||||
|
||||
How should we combine scores into one PB? There is an *extraordinarily* useful helper
|
||||
How should we combine scores into one PB? There is an _extraordinarily_ useful helper
|
||||
function for this called `CreatePBMergeFor`.
|
||||
|
||||
The way PBs are merged works like a chain: the first score is the best score this user
|
||||
@@ -129,8 +129,8 @@ As mentioned above, the chain of PB functions starts by plucking the best score
|
||||
user has on this chart under the `defaultMetric`. What should we call that score?
|
||||
|
||||
!!! example
|
||||
For IIDX, this is "Best Score". For something like GITADORA, which only has percent,
|
||||
this might be called "Best Percent".
|
||||
For IIDX, this is "Best Score". For something like GITADORA, which only has percent,
|
||||
this might be called "Best Percent".
|
||||
|
||||
## `scoreValidators`
|
||||
|
||||
|
||||
+15
-15
@@ -6,28 +6,28 @@ Tachi is a fully-open rhythm game score tracking engine, and is the name of the
|
||||
both [Bokutachi](https://boku.tachi.ac) and [Kamaitachi](https://kamai.tachi.ac).
|
||||
|
||||
!!! help
|
||||
Tachi is **fully open**. The core is almost exclusively maintained by [one person](https://github.com/zkrising).
|
||||
However, we support nearly twenty games and playtypes now. Said one person cannot reasonably keep up
|
||||
with all the new things coming out in those games.
|
||||
Tachi is **fully open**. The core is almost exclusively maintained by [one person](https://github.com/zkldi).
|
||||
However, we support nearly twenty games and playtypes now. Said one person cannot reasonably keep up
|
||||
with all the new things coming out in those games.
|
||||
|
||||
If you care about a game you play a lot, and want to help out Tachi, there are loads of ways you can contribute
|
||||
and ease the load on the primary maintainer!
|
||||
|
||||
Because Tachi is fully open source, if you want a feature, bug-fix, or new content added to your game,
|
||||
you can *become a contributor* or *report to someone who will contribute!*
|
||||
If you care about a game you play a lot, and want to help out Tachi, there are loads of ways you can contribute
|
||||
and ease the load on the primary maintainer!
|
||||
|
||||
We maintain a **comprehensive** [contribution guide](./contributing), which is accessible
|
||||
to even people who have never wrote a line of code in their life. If you want to improve Tachi, and maybe even
|
||||
nab some development skills yourself (or look good on a CV!), check it out. I've put a lot of effort into it.
|
||||
Because Tachi is fully open source, if you want a feature, bug-fix, or new content added to your game,
|
||||
you can *become a contributor* or *report to someone who will contribute!*
|
||||
|
||||
We maintain a **comprehensive** [contribution guide](./contributing), which is accessible
|
||||
to even people who have never wrote a line of code in their life. If you want to improve Tachi, and maybe even
|
||||
nab some development skills yourself (or look good on a CV!), check it out. I've put a lot of effort into it.
|
||||
|
||||
## About This Documentation
|
||||
|
||||
This is the documentation for *all* of Tachi. It - like Tachi - is primarily maintained by one
|
||||
This is the documentation for _all_ of Tachi. It - like Tachi - is primarily maintained by one
|
||||
person, and as such, some things may be slightly outdated, wrong, or generally just ill-maintained.
|
||||
|
||||
!!! info
|
||||
If you're confused about anything, ask in your Tachi instance's discord!
|
||||
We have a remarkably helpful community of developers and contributors, who should be able to help you out.
|
||||
If you're confused about anything, ask in your Tachi instance's discord!
|
||||
We have a remarkably helpful community of developers and contributors, who should be able to help you out.
|
||||
|
||||
Apologies in advance! If you find a problem in the documentation, you can freely contribute a fix
|
||||
to it. See the [Contribution Guide](./contributing)!
|
||||
@@ -39,7 +39,7 @@ statistics. It requires no programming knowledge, and is mostly used as a wiki-l
|
||||
|
||||
View it [here](./wiki).
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## Programmer References
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ be treated like a Wiki for Tachi information.
|
||||
As such, nothing here will require programming knowledge,
|
||||
but it might help.
|
||||
|
||||
*****
|
||||
---
|
||||
|
||||
## What is Tachi?
|
||||
|
||||
@@ -32,7 +32,7 @@ Tachi is a score tracker and analyser for various rhythm
|
||||
games. It was designed out of a dislike for existing websites
|
||||
that display your scores. I think that scores are integral
|
||||
to the rhythm game experience, and that displaying them
|
||||
properly is *just* as important.
|
||||
properly is _just_ as important.
|
||||
|
||||
The benefits of Tachi include features like [Sessions](./features.md#sessions), which break your scores up into
|
||||
groups of when they were played, and [Goals](./features.md#goals) which let you set automatically updating targets for yourself!
|
||||
@@ -63,6 +63,6 @@ The rules can be found [here](./rules.md).
|
||||
|
||||
## I have a bug report or feature request.
|
||||
|
||||
Please reach out on discord or [GitHub Issues](https://github.com/zkrising/Tachi)!
|
||||
Please reach out on discord or [GitHub Issues](https://github.com/zkldi/Tachi)!
|
||||
|
||||
--8<-- "includes/abbreviations.md"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
site_name: Tachi Documentation
|
||||
site_description: Documentation for Kamaitachi, Bokutachi and related things.
|
||||
site_author: zkrising
|
||||
site_author: zkldi
|
||||
site_url: https://docs.tachi.ac
|
||||
|
||||
watch:
|
||||
|
||||
@@ -48,7 +48,7 @@ async function sendMsg(message: string, octokit: any, repo: Repository, issue: n
|
||||
app.webhooks.on(["pull_request.opened", "pull_request.edited"], async ({ octokit, payload }) => {
|
||||
try {
|
||||
const filesChanged = (await fetch(
|
||||
`https://api.github.com/repos/zkrising/Tachi/pulls/${payload.number}/files`
|
||||
`https://api.github.com/repos/zkldi/Tachi/pulls/${payload.number}/files`
|
||||
).then((r) => r.json())) as Array<{ filename: string }>;
|
||||
|
||||
// if any file modified in this pr is a collection
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/><span>Bokutachi</span>
|
||||
</h1>
|
||||
<p>
|
||||
<a href="https://github.com/zkrising/Tachi" target="_blank"
|
||||
<a href="https://github.com/zkldi/Tachi" target="_blank"
|
||||
>Free & Open Source</a
|
||||
>
|
||||
at-home score tracking for many games & clients
|
||||
@@ -112,7 +112,7 @@
|
||||
/><span>Kamaitachi</span>
|
||||
</h1>
|
||||
<p>
|
||||
<a href="https://github.com/zkrising/Tachi" target="_blank"
|
||||
<a href="https://github.com/zkldichi" target="_blank"
|
||||
>Free & Open Source</a
|
||||
>
|
||||
arcade based score tracking
|
||||
@@ -137,14 +137,14 @@
|
||||
<div class="footer">
|
||||
<div class="credit">
|
||||
<span
|
||||
>created by <a href="https://github.com/zkrising">zk</a>, homepage
|
||||
>created by <a href="https://github.com/zkldik</a>, homepage
|
||||
by
|
||||
<a href="https://pfy.ch">pfych</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="links">
|
||||
<a href="https://ko-fi.com/zkrising" target="_blank">Donate</a>
|
||||
<a href="https://github.com/zkrising/Tachi" target="_blank">GitHub</a>
|
||||
<a href="https://ko-fi.com/zkldiarget="_blank">Donate</a>
|
||||
<a href="https://github.com/zkldichi" target="_blank">GitHub</a>
|
||||
<a href="https://docs.tachi.ac/">Documentation</a>
|
||||
<a href="https://boku.tachi.ac/credits">Credits</a>
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -10,14 +10,14 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zkrising/Tachi.git"
|
||||
"url": "git+https://github.com/zkldi/Tachi.git"
|
||||
},
|
||||
"author": "zk",
|
||||
"license": "SEE LICENSE IN EACH PACKAGE",
|
||||
"bugs": {
|
||||
"url": "https://github.com/zkrising/Tachi/issues"
|
||||
"url": "https://github.com/zkldi/Tachi/issues"
|
||||
},
|
||||
"homepage": "https://github.com/zkrising/Tachi#readme",
|
||||
"homepage": "https://github.com/zkldi/Tachi#readme",
|
||||
"devDependencies": {
|
||||
"@types/node": "18.11.18",
|
||||
"@types/tap": "15.0.3",
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ All work should be merged into `main`.
|
||||
Nothing private, nothing pertaining to an instance of Tachi. These are backbone files, such
|
||||
as songs, charts, and folders.
|
||||
|
||||
You can read more about what all these documents mean in [common/](https://github.com/zkrising/Tachi/tree/main/common).
|
||||
You can read more about what all these documents mean in [common/](https://github.com/zkldi/Tachi/tree/main/common).
|
||||
|
||||
- `songs-{game}`
|
||||
|
||||
@@ -54,4 +54,4 @@ Groups of quests that are registered by default.
|
||||
Depends what you want. If you're familiar with JSON, just
|
||||
take the files and do whatever.
|
||||
|
||||
Make a new script in `scripts/rerunners` and run it with `seeds`. You can really do whatever you want, though.
|
||||
Make a new script in `scripts/rerunners` and run it with `seeds`. You can really do whatever you want, though.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export interface MyPageRecordsRawCSVRecord {
|
||||
// eslint-disable-next-line lines-around-comment -- https://github.com/zkrising/Tachi/pull/673#discussion_r965947793
|
||||
// eslint-disable-next-line lines-around-comment -- https://github.com/zkldi/Tachi/pull/673#discussion_r965947793
|
||||
// These are snake case in the CSV. The first line of the CSV is:
|
||||
// music_id,music_title,music_artist,music_genre,music_levels,music_play_counts,music_scores,music_achieves
|
||||
// We only care about these fields. Currently we use music_title but
|
||||
@@ -21,7 +21,7 @@ export interface MyPageRecordsParsedPB {
|
||||
}
|
||||
|
||||
export interface MyPagePlayerStage {
|
||||
// eslint-disable-next-line lines-around-comment -- https://github.com/zkrising/Tachi/pull/673#discussion_r965947793
|
||||
// eslint-disable-next-line lines-around-comment -- https://github.com/zkldichi/pull/673#discussion_r965947793
|
||||
// https://github.com/XezolesS/WaccaMyPageScraper/blob/acebe4b655eb09b3ddbc15802dd948d5f9c5e0d3/WaccaMyPageScraper/Data/Stage.cs
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user