diff --git a/docs/endpoints/get-sonolus-backgrounds-list.md b/docs/endpoints/get-sonolus-backgrounds-list.md deleted file mode 100644 index 4892f5a..0000000 --- a/docs/endpoints/get-sonolus-backgrounds-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/backgrounds/list` - -`/sonolus/backgrounds/list` provides information of backgrounds, and is used by Sonolus app to populate server background list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type BackgroundList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-backgrounds-name-community-comments-list.md b/docs/endpoints/get-sonolus-backgrounds-name-community-comments-list.md deleted file mode 100644 index cfba431..0000000 --- a/docs/endpoints/get-sonolus-backgrounds-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/backgrounds/{name}/community/comments/list` - -`/sonolus/backgrounds/{name}/community/comments/list` provides comments information of a background, and is used by Sonolus app to populate server background details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type BackgroundCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-backgrounds-name-community.md b/docs/endpoints/get-sonolus-backgrounds-name-community.md deleted file mode 100644 index 9b85112..0000000 --- a/docs/endpoints/get-sonolus-backgrounds-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/backgrounds/{name}/community` - -`/sonolus/backgrounds/{name}/community` provides community information of background of name `{name}`, and is used by Sonolus app to populate server background details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type BackgroundCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-effects-info.md b/docs/endpoints/get-sonolus-effects-info.md deleted file mode 100644 index e238914..0000000 --- a/docs/endpoints/get-sonolus-effects-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/effects/info` - -`/sonolus/effects/info` provides information of effects, and is used by Sonolus app to populate server effect info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EffectInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-effects-list.md b/docs/endpoints/get-sonolus-effects-list.md deleted file mode 100644 index ad43cf9..0000000 --- a/docs/endpoints/get-sonolus-effects-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/effects/list` - -`/sonolus/effects/list` provides information of effects, and is used by Sonolus app to populate server effect list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EffectList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-effects-name.md b/docs/endpoints/get-sonolus-effects-name.md deleted file mode 100644 index 84bde10..0000000 --- a/docs/endpoints/get-sonolus-effects-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/effects/{name}` - -`/sonolus/effects/{name}` provides detailed information of effect of name `{name}`, and is used by Sonolus app to populate server effect details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EffectDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the effect", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-engines-info.md b/docs/endpoints/get-sonolus-engines-info.md deleted file mode 100644 index c02189e..0000000 --- a/docs/endpoints/get-sonolus-engines-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/engines/info` - -`/sonolus/engines/info` provides information of engines, and is used by Sonolus app to populate server engine info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EngineInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-engines-list.md b/docs/endpoints/get-sonolus-engines-list.md deleted file mode 100644 index b2be0c6..0000000 --- a/docs/endpoints/get-sonolus-engines-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/engines/list` - -`/sonolus/engines/list` provides information of engines, and is used by Sonolus app to populate server engine list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EngineList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-engines-name-community-comments-list.md b/docs/endpoints/get-sonolus-engines-name-community-comments-list.md deleted file mode 100644 index f75f1b5..0000000 --- a/docs/endpoints/get-sonolus-engines-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/engines/{name}/community/comments/list` - -`/sonolus/engines/{name}/community/comments/list` provides comments information of a engine, and is used by Sonolus app to populate server engine details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EngineCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-engines-name-community.md b/docs/endpoints/get-sonolus-engines-name-community.md deleted file mode 100644 index 5568ef9..0000000 --- a/docs/endpoints/get-sonolus-engines-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/engines/{name}/community` - -`/sonolus/engines/{name}/community` provides community information of engine of name `{name}`, and is used by Sonolus app to populate server engine details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type EngineCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-info.md b/docs/endpoints/get-sonolus-info.md index b52323b..4bf9123 100644 --- a/docs/endpoints/get-sonolus-info.md +++ b/docs/endpoints/get-sonolus-info.md @@ -2,6 +2,10 @@ `/sonolus/info` provides information of the server, and is used by Sonolus app to populate server home page. +## URL Parameters + +None. + ## Query Parameters | Query Parameter | Value | Description | @@ -37,10 +41,24 @@ None. type ServerInfo = { title: string description?: string - hasAuthentication: boolean - hasMultiplayer: boolean + buttons: ServerInfoButton[] banner?: SRL } + +type ServerInfoButton = { + type: + | 'authentication' + | 'multiplayer' + | 'post' + | 'playlist' + | 'level' + | 'replay' + | 'skin' + | 'background' + | 'effect' + | 'particle' + | 'engine' +} ``` ## Examples @@ -48,8 +66,10 @@ type ServerInfo = { ```json { "title": "My Server Title", - "hasAuthentication": false, - "hasMultiplayer": true, + "description": "Description of my server.", + "buttons": [ + // ... + ], "banner": { // ... } diff --git a/docs/endpoints/get-sonolus-levels-info.md b/docs/endpoints/get-sonolus-levels-info.md deleted file mode 100644 index e149233..0000000 --- a/docs/endpoints/get-sonolus-levels-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/levels/info` - -`/sonolus/levels/info` provides information of levels, and is used by Sonolus app to populate server level info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type LevelInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-levels-list.md b/docs/endpoints/get-sonolus-levels-list.md deleted file mode 100644 index 64138b9..0000000 --- a/docs/endpoints/get-sonolus-levels-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/levels/list` - -`/sonolus/levels/list` provides information of levels, and is used by Sonolus app to populate server level list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type LevelList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-levels-name-community-comments-list.md b/docs/endpoints/get-sonolus-levels-name-community-comments-list.md deleted file mode 100644 index 8a45878..0000000 --- a/docs/endpoints/get-sonolus-levels-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/levels/{name}/community/comments/list` - -`/sonolus/levels/{name}/community/comments/list` provides comments information of a level, and is used by Sonolus app to populate server level details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type LevelCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-levels-name-community.md b/docs/endpoints/get-sonolus-levels-name-community.md deleted file mode 100644 index be14a43..0000000 --- a/docs/endpoints/get-sonolus-levels-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/levels/{name}/community` - -`/sonolus/levels/{name}/community` provides community information of level of name `{name}`, and is used by Sonolus app to populate server level details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type LevelCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-levels-name.md b/docs/endpoints/get-sonolus-levels-name.md deleted file mode 100644 index eb151b6..0000000 --- a/docs/endpoints/get-sonolus-levels-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/levels/{name}` - -`/sonolus/levels/{name}` provides detailed information of level of name `{name}`, and is used by Sonolus app to populate server level details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type LevelDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the level", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-particles-info.md b/docs/endpoints/get-sonolus-particles-info.md deleted file mode 100644 index 6081ee2..0000000 --- a/docs/endpoints/get-sonolus-particles-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/particles/info` - -`/sonolus/particles/info` provides information of particles, and is used by Sonolus app to populate server particle info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ParticleInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-particles-list.md b/docs/endpoints/get-sonolus-particles-list.md deleted file mode 100644 index 7af9898..0000000 --- a/docs/endpoints/get-sonolus-particles-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/particles/list` - -`/sonolus/particles/list` provides information of particles, and is used by Sonolus app to populate server particle list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ParticleList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-particles-name-community-comments-list.md b/docs/endpoints/get-sonolus-particles-name-community-comments-list.md deleted file mode 100644 index 9b57525..0000000 --- a/docs/endpoints/get-sonolus-particles-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/particles/{name}/community/comments/list` - -`/sonolus/particles/{name}/community/comments/list` provides comments information of a particle, and is used by Sonolus app to populate server particle details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ParticleCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-particles-name-community.md b/docs/endpoints/get-sonolus-particles-name-community.md deleted file mode 100644 index 1e2d8df..0000000 --- a/docs/endpoints/get-sonolus-particles-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/particles/{name}/community` - -`/sonolus/particles/{name}/community` provides community information of particle of name `{name}`, and is used by Sonolus app to populate server particle details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ParticleCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-particles-name.md b/docs/endpoints/get-sonolus-particles-name.md deleted file mode 100644 index 4bb9098..0000000 --- a/docs/endpoints/get-sonolus-particles-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/particles/{name}` - -`/sonolus/particles/{name}` provides detailed information of particle of name `{name}`, and is used by Sonolus app to populate server particle details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ParticleDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the particle", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-playlists-info.md b/docs/endpoints/get-sonolus-playlists-info.md deleted file mode 100644 index bb47b6c..0000000 --- a/docs/endpoints/get-sonolus-playlists-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/playlists/info` - -`/sonolus/playlists/info` provides information of playlists, and is used by Sonolus app to populate server playlist info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PlaylistInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-playlists-list.md b/docs/endpoints/get-sonolus-playlists-list.md deleted file mode 100644 index 97e724e..0000000 --- a/docs/endpoints/get-sonolus-playlists-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/playlists/list` - -`/sonolus/playlists/list` provides information of playlists, and is used by Sonolus app to populate server playlist list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PlaylistList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-playlists-name-community-comments-list.md b/docs/endpoints/get-sonolus-playlists-name-community-comments-list.md deleted file mode 100644 index de1b356..0000000 --- a/docs/endpoints/get-sonolus-playlists-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/playlists/{name}/community/comments/list` - -`/sonolus/playlists/{name}/community/comments/list` provides comments information of a playlist, and is used by Sonolus app to populate server playlist details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PlaylistCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-playlists-name-community.md b/docs/endpoints/get-sonolus-playlists-name-community.md deleted file mode 100644 index f60e89f..0000000 --- a/docs/endpoints/get-sonolus-playlists-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/playlists/{name}/community` - -`/sonolus/playlists/{name}/community` provides community information of playlist of name `{name}`, and is used by Sonolus app to populate server playlist details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PlaylistCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-playlists-name.md b/docs/endpoints/get-sonolus-playlists-name.md deleted file mode 100644 index 2c2fd69..0000000 --- a/docs/endpoints/get-sonolus-playlists-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/playlists/{name}` - -`/sonolus/playlists/{name}` provides detailed information of playlist of name `{name}`, and is used by Sonolus app to populate server playlist details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PlaylistDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the playlist", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-posts-info.md b/docs/endpoints/get-sonolus-posts-info.md deleted file mode 100644 index 2dc06c7..0000000 --- a/docs/endpoints/get-sonolus-posts-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/posts/info` - -`/sonolus/posts/info` provides information of posts, and is used by Sonolus app to populate server post info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PostInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-posts-list.md b/docs/endpoints/get-sonolus-posts-list.md deleted file mode 100644 index 8407b6c..0000000 --- a/docs/endpoints/get-sonolus-posts-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/posts/list` - -`/sonolus/posts/list` provides information of posts, and is used by Sonolus app to populate server post list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PostList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-posts-name-community-comments-list.md b/docs/endpoints/get-sonolus-posts-name-community-comments-list.md deleted file mode 100644 index cdd3db2..0000000 --- a/docs/endpoints/get-sonolus-posts-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/posts/{name}/community/comments/list` - -`/sonolus/posts/{name}/community/comments/list` provides comments information of a post, and is used by Sonolus app to populate server post details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PostCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-posts-name-community.md b/docs/endpoints/get-sonolus-posts-name-community.md deleted file mode 100644 index cdfb162..0000000 --- a/docs/endpoints/get-sonolus-posts-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/posts/{name}/community` - -`/sonolus/posts/{name}/community` provides community information of post of name `{name}`, and is used by Sonolus app to populate server post details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PostCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-posts-name.md b/docs/endpoints/get-sonolus-posts-name.md deleted file mode 100644 index e6ac09a..0000000 --- a/docs/endpoints/get-sonolus-posts-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/posts/{name}` - -`/sonolus/posts/{name}` provides detailed information of post of name `{name}`, and is used by Sonolus app to populate server post details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type PostDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the post", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-replays-info.md b/docs/endpoints/get-sonolus-replays-info.md deleted file mode 100644 index 93c1aa2..0000000 --- a/docs/endpoints/get-sonolus-replays-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/replays/info` - -`/sonolus/replays/info` provides information of replays, and is used by Sonolus app to populate server replay info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ReplayInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-replays-list.md b/docs/endpoints/get-sonolus-replays-list.md deleted file mode 100644 index 1b9e857..0000000 --- a/docs/endpoints/get-sonolus-replays-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/replays/list` - -`/sonolus/replays/list` provides information of replays, and is used by Sonolus app to populate server replay list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ReplayList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-replays-name-community-comments-list.md b/docs/endpoints/get-sonolus-replays-name-community-comments-list.md deleted file mode 100644 index c40fac5..0000000 --- a/docs/endpoints/get-sonolus-replays-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/replays/{name}/community/comments/list` - -`/sonolus/replays/{name}/community/comments/list` provides comments information of a replay, and is used by Sonolus app to populate server replay details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ReplayCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-replays-name-community.md b/docs/endpoints/get-sonolus-replays-name-community.md deleted file mode 100644 index 9f5717d..0000000 --- a/docs/endpoints/get-sonolus-replays-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/replays/{name}/community` - -`/sonolus/replays/{name}/community` provides community information of replay of name `{name}`, and is used by Sonolus app to populate server replay details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ReplayCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-replays-name.md b/docs/endpoints/get-sonolus-replays-name.md deleted file mode 100644 index 6088efb..0000000 --- a/docs/endpoints/get-sonolus-replays-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/replays/{name}` - -`/sonolus/replays/{name}` provides detailed information of replay of name `{name}`, and is used by Sonolus app to populate server replay details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type ReplayDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the replay", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-rooms-info.md b/docs/endpoints/get-sonolus-rooms-info.md deleted file mode 100644 index ee93a8f..0000000 --- a/docs/endpoints/get-sonolus-rooms-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/rooms/info` - -`/sonolus/rooms/info` provides information of rooms, and is used by Sonolus app to populate server room info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type RoomInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-skins-info.md b/docs/endpoints/get-sonolus-skins-info.md deleted file mode 100644 index 5dde5f9..0000000 --- a/docs/endpoints/get-sonolus-skins-info.md +++ /dev/null @@ -1,54 +0,0 @@ -# `GET /sonolus/skins/info` - -`/sonolus/skins/info` provides information of skins, and is used by Sonolus app to populate server skin info view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SkinInfo = ItemInfo -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/endpoints/get-sonolus-skins-list.md b/docs/endpoints/get-sonolus-skins-list.md deleted file mode 100644 index 1832157..0000000 --- a/docs/endpoints/get-sonolus-skins-list.md +++ /dev/null @@ -1,58 +0,0 @@ -# `GET /sonolus/skins/list` - -`/sonolus/skins/list` provides information of skins, and is used by Sonolus app to populate server skin list view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :---------------- | :------- | :------------------------------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | -| Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SkinList = ItemList -``` - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/get-sonolus-skins-name-community-comments-list.md b/docs/endpoints/get-sonolus-skins-name-community-comments-list.md deleted file mode 100644 index c40c823..0000000 --- a/docs/endpoints/get-sonolus-skins-name-community-comments-list.md +++ /dev/null @@ -1,50 +0,0 @@ -# `GET /sonolus/skins/{name}/community/comments/list` - -`/sonolus/skins/{name}/community/comments/list` provides comments information of a skin, and is used by Sonolus app to populate server skin details view's community section's comment list. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | -| `page` | `number` | See [`page`](../query-parameters/page.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SkinCommunityCommentList = ItemCommunityCommentList -``` - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-skins-name-community.md b/docs/endpoints/get-sonolus-skins-name-community.md deleted file mode 100644 index 07e8373..0000000 --- a/docs/endpoints/get-sonolus-skins-name-community.md +++ /dev/null @@ -1,52 +0,0 @@ -# `GET /sonolus/skins/{name}/community` - -`/sonolus/skins/{name}/community` provides community information of skin of name `{name}`, and is used by Sonolus app to populate server skin details view's community section. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SkinCommunity = ItemCommunity -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-skins-name.md b/docs/endpoints/get-sonolus-skins-name.md deleted file mode 100644 index ab34fa1..0000000 --- a/docs/endpoints/get-sonolus-skins-name.md +++ /dev/null @@ -1,53 +0,0 @@ -# `GET /sonolus/skins/{name}` - -`/sonolus/skins/{name}` provides detailed information of skin of name `{name}`, and is used by Sonolus app to populate server skin details view. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -None. - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SkinDetails = ItemDetails -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the skin", - "sections": [ - // ... - ] -} -``` diff --git a/docs/endpoints/get-sonolus-backgrounds-info.md b/docs/endpoints/get-sonolus-type-info.md similarity index 62% rename from docs/endpoints/get-sonolus-backgrounds-info.md rename to docs/endpoints/get-sonolus-type-info.md index 21e610c..10e5849 100644 --- a/docs/endpoints/get-sonolus-backgrounds-info.md +++ b/docs/endpoints/get-sonolus-type-info.md @@ -1,6 +1,12 @@ -# `GET /sonolus/backgrounds/info` +# `GET /sonolus/{type}/info` -`/sonolus/backgrounds/info` provides information of backgrounds, and is used by Sonolus app to populate server background info view. +`/sonolus/{type}/info` provides information of items, and is used by Sonolus app to populate server item info view. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :---------------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, `replays`, or `rooms`. | ## Query Parameters @@ -34,13 +40,21 @@ None. ## Response Body ```ts -type BackgroundInfo = ItemInfo +type ItemInfo = { + creates?: ServerForm[] + searches?: ServerForm[] + sections: ItemSection[] + banner?: SRL +} ``` ## Examples ```json { + "creates": [ + // ... + ], "searches": [ // ... ], diff --git a/docs/endpoints/get-sonolus-effects-name-community-comments-list.md b/docs/endpoints/get-sonolus-type-item-name-community-comments-list.md similarity index 53% rename from docs/endpoints/get-sonolus-effects-name-community-comments-list.md rename to docs/endpoints/get-sonolus-type-item-name-community-comments-list.md index e86ac04..6e4fb31 100644 --- a/docs/endpoints/get-sonolus-effects-name-community-comments-list.md +++ b/docs/endpoints/get-sonolus-type-item-name-community-comments-list.md @@ -1,6 +1,13 @@ -# `GET /sonolus/effects/{name}/community/comments/list` +# `GET /sonolus/{type}/{itemName}/community/comments/list` -`/sonolus/effects/{name}/community/comments/list` provides comments information of a effect, and is used by Sonolus app to populate server effect details view's community section's comment list. +`/sonolus/{type}/{itemName}/community/comments/list` provides comments information of item of name `{itemName}`, and is used by Sonolus app to populate server item details view's community section's comment list. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | ## Query Parameters @@ -25,6 +32,7 @@ None. | :----------------- | :---------------------------------- | | `200 OK` | | | `401 Unauthorized` | Authentication required or expired. | +| `404 Not Found` | | ## Response Headers @@ -35,9 +43,20 @@ None. ## Response Body ```ts -type EffectCommunityCommentList = ItemCommunityCommentList +type ItemCommunityCommentList = { + pageCount: number + comments: ItemCommunityComment[] +} ``` +### `pageCount` + +If `-1` is used, the list is treated as having infinite pagination. + +### `comments` + +It is recommended to keep each page short by showing only 10 comments. + ## Examples ```json diff --git a/docs/endpoints/get-sonolus-effects-name-community.md b/docs/endpoints/get-sonolus-type-item-name-community-info.md similarity index 60% rename from docs/endpoints/get-sonolus-effects-name-community.md rename to docs/endpoints/get-sonolus-type-item-name-community-info.md index 0ad8ff2..993352b 100644 --- a/docs/endpoints/get-sonolus-effects-name-community.md +++ b/docs/endpoints/get-sonolus-type-item-name-community-info.md @@ -1,6 +1,13 @@ -# `GET /sonolus/effects/{name}/community` +# `GET /sonolus/{type}/{itemName}/community/info` -`/sonolus/effects/{name}/community` provides community information of effect of name `{name}`, and is used by Sonolus app to populate server effect details view's community section. +`/sonolus/{type}/{itemName}/community/info` provides community information of item of name `{itemName}`, and is used by Sonolus app to populate server item details view's community section. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | ## Query Parameters @@ -35,7 +42,10 @@ None. ## Response Body ```ts -type EffectCommunity = ItemCommunity +type ItemCommunity = { + actions: ServerForm[] + topComments: ItemCommunityComment[] +} ``` ## Examples diff --git a/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-list.md b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-list.md new file mode 100644 index 0000000..3f581ad --- /dev/null +++ b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-list.md @@ -0,0 +1,70 @@ +# `GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/list` + +`/sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/list` provides detailed information of leaderboard of name `{leaderboardName}` in item of name `{itemName}`, and is used by Sonolus app to populate server item details view's leaderboard section's record list. + +## URL Parameters + +| URL Parameter | Value | Description | +| :---------------- | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | +| `leaderboardName` | `string` | Name of leaderboard. | + +## Query Parameters + +| Query Parameter | Value | Description | +| :-------------- | :------- | :--------------------------------------------------------- | +| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | +| `page` | `number` | See [`page`](../query-parameters/page.md). | + +## Request Headers + +| Header | Value | Description | +| :---------------- | :------- | :---------------------------------------------------------------- | +| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | + +## Request Body + +None. + +## Response Code + +| Code | Description | +| :----------------- | :---------------------------------- | +| `200 OK` | | +| `401 Unauthorized` | Authentication required or expired. | +| `404 Not Found` | | + +## Response Headers + +| Header | Value | Description | +| :---------------- | :------- | :---------------------------------------------------------------- | +| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | + +## Response Body + +```ts +type ItemLeaderboardRecordList = { + pageCount: number + records: ItemLeaderboardRecord[] +} +``` + +### `pageCount` + +If `-1` is used, the list is treated as having infinite pagination. + +### `comments` + +It is recommended to keep each page short by showing only 10 records. + +## Examples + +```json +{ + "pageCount": 5, + "records": [ + // ... + ] +} +``` diff --git a/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-record-name.md b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-record-name.md new file mode 100644 index 0000000..f9d5092 --- /dev/null +++ b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-record-name.md @@ -0,0 +1,60 @@ +# `GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/{recordName}` + +`/sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/{recordName}` provides detailed information of record of `{recordName}` in leaderboard of name `{leaderboardName}` in item of name `{itemName}`, and is used by Sonolus app to populate server item details view's leaderboard section's record's details. + +## URL Parameters + +| URL Parameter | Value | Description | +| :---------------- | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | +| `leaderboardName` | `string` | Name of leaderboard. | +| `recordName` | `string` | Name of record. | + +## Query Parameters + +| Query Parameter | Value | Description | +| :-------------- | :------- | :--------------------------------------------------------- | +| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | + +## Request Headers + +| Header | Value | Description | +| :---------------- | :------- | :---------------------------------------------------------------- | +| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | + +## Request Body + +None. + +## Response Code + +| Code | Description | +| :----------------- | :---------------------------------- | +| `200 OK` | | +| `401 Unauthorized` | Authentication required or expired. | +| `404 Not Found` | | + +## Response Headers + +| Header | Value | Description | +| :---------------- | :------- | :---------------------------------------------------------------- | +| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | + +## Response Body + +```ts +type ItemLeaderboardRecordDetails = { + replays: ReplayItem[] +} +``` + +## Examples + +```json +{ + "replays": [ + // ... + ] +} +``` diff --git a/docs/endpoints/get-sonolus-backgrounds-name.md b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name.md similarity index 53% rename from docs/endpoints/get-sonolus-backgrounds-name.md rename to docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name.md index 83e0e3f..930b58a 100644 --- a/docs/endpoints/get-sonolus-backgrounds-name.md +++ b/docs/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name.md @@ -1,6 +1,14 @@ -# `GET /sonolus/backgrounds/{name}` +# `GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}` -`/sonolus/backgrounds/{name}` provides detailed information of background of name `{name}`, and is used by Sonolus app to populate server background details view. +`/sonolus/{type}/{itemName}/leaderboards/{leaderboardName}` provides detailed information of leaderboard of name `{leaderboardName}` in item of name `{itemName}`, and is used by Sonolus app to populate server item details view's leaderboard section. + +## URL Parameters + +| URL Parameter | Value | Description | +| :---------------- | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | +| `leaderboardName` | `string` | Name of leaderboard. | ## Query Parameters @@ -35,18 +43,16 @@ None. ## Response Body ```ts -type BackgroundDetails = ItemDetails +type ItemLeaderboardDetails = { + topRecords: ItemLeaderboardRecord[] +} ``` ## Examples ```json { - "item": { - // ... - }, - "description": "Description of the background", - "sections": [ + "topRecords": [ // ... ] } diff --git a/docs/endpoints/get-sonolus-engines-name.md b/docs/endpoints/get-sonolus-type-item-name.md similarity index 56% rename from docs/endpoints/get-sonolus-engines-name.md rename to docs/endpoints/get-sonolus-type-item-name.md index 00ed26b..f8fa5c5 100644 --- a/docs/endpoints/get-sonolus-engines-name.md +++ b/docs/endpoints/get-sonolus-type-item-name.md @@ -1,6 +1,13 @@ -# `GET /sonolus/engines/{name}` +# `GET /sonolus/{type}/{itemName}` -`/sonolus/engines/{name}` provides detailed information of engine of name `{name}`, and is used by Sonolus app to populate server engine details view. +`/sonolus/{type}/{itemName}` provides detailed information of item of name `{itemName}`, and is used by Sonolus app to populate server item details view. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | ## Query Parameters @@ -35,7 +42,13 @@ None. ## Response Body ```ts -type EngineDetails = ItemDetails +type ItemDetails = { + item: T + description: string + hasCommunity: boolean + leaderboards: ItemLeaderboard[] + sections: ItemSection[] +} ``` ## Examples @@ -45,7 +58,11 @@ type EngineDetails = ItemDetails "item": { // ... }, - "description": "Description of the engine", + "description": "Description of the item.", + "hasCommunity": true, + "leaderboards": [ + // ... + ], "sections": [ // ... ] diff --git a/docs/endpoints/get-sonolus-rooms-list.md b/docs/endpoints/get-sonolus-type-list.md similarity index 65% rename from docs/endpoints/get-sonolus-rooms-list.md rename to docs/endpoints/get-sonolus-type-list.md index dee47e9..2f4c523 100644 --- a/docs/endpoints/get-sonolus-rooms-list.md +++ b/docs/endpoints/get-sonolus-type-list.md @@ -1,6 +1,12 @@ -# `GET /sonolus/rooms/list` +# `GET /sonolus/{type}/list` -`/sonolus/rooms/list` provides information of rooms, and is used by Sonolus app to populate server room list view. +`/sonolus/{type}/list` provides information of items, and is used by Sonolus app to populate server item list view. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :---------------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, `replays`, or `rooms`. | ## Query Parameters @@ -10,6 +16,10 @@ | `page` | `number` | See [`page`](../query-parameters/page.md). | | Search Parameters | `any` | See [Options Query Parameters](../query-parameters/options-query-parameters.md). | +### Search Parameters + +When using quick search, search parameters of `?type=quick&keywords=...` will be sent. + ## Request Headers | Header | Value | Description | @@ -36,9 +46,21 @@ None. ## Response Body ```ts -type RoomList = ItemList +type ItemList = { + pageCount: number + items: T[] + searches?: ServerForm[] +} ``` +### `pageCount` + +If `-1` is used, the list is treated as having infinite pagination. + +### `items` + +It is recommended to keep each page short by showing only 20 items. + ## Examples ```json @@ -52,7 +74,3 @@ type RoomList = ItemList ] } ``` - -## Remarks - -When using quick search, search parameters of `?type=quick&keywords=...` will be sent. diff --git a/docs/endpoints/post-sonolus-authenticate.md b/docs/endpoints/post-sonolus-authenticate.md index 0476c95..45710b8 100644 --- a/docs/endpoints/post-sonolus-authenticate.md +++ b/docs/endpoints/post-sonolus-authenticate.md @@ -2,6 +2,10 @@ `/sonolus/authenticate` allows Sonolus app to establish an authentication session. +## URL Parameters + +None. + ## Query Parameters | Query Parameter | Value | Description | @@ -25,6 +29,8 @@ type AuthenticateServerRequest = { } ``` +Server should verify that request body is authentic using `Sonolus-Signature` request header. + ### `type` Server should verify that `type` equals to `'authenticateServer'`. @@ -77,7 +83,3 @@ Session should be short lived, recommended 30 minutes or less. Once expired, Son "expiration": 1640995200000 } ``` - -## Remarks - -Server should verify that request body is authentic using `Sonolus-Signature` request header. diff --git a/docs/endpoints/post-sonolus-levels-name-community.md b/docs/endpoints/post-sonolus-levels-name-community.md deleted file mode 100644 index b55d721..0000000 --- a/docs/endpoints/post-sonolus-levels-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/levels/{name}/community` - -`/sonolus/levels/{name}/community` allows Sonolus app to submit community actions to a level. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-particles-name-community.md b/docs/endpoints/post-sonolus-particles-name-community.md deleted file mode 100644 index 468a70a..0000000 --- a/docs/endpoints/post-sonolus-particles-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/particles/{name}/community` - -`/sonolus/particles/{name}/community` allows Sonolus app to submit community actions to a particle. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-playlists-name-community.md b/docs/endpoints/post-sonolus-playlists-name-community.md deleted file mode 100644 index 214797a..0000000 --- a/docs/endpoints/post-sonolus-playlists-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/playlists/{name}/community` - -`/sonolus/playlists/{name}/community` allows Sonolus app to submit community actions to a playlist. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-posts-name-community.md b/docs/endpoints/post-sonolus-posts-name-community.md deleted file mode 100644 index bf7d76a..0000000 --- a/docs/endpoints/post-sonolus-posts-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/posts/{name}/community` - -`/sonolus/posts/{name}/community` allows Sonolus app to submit community actions to a post. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-replays-name-community.md b/docs/endpoints/post-sonolus-replays-name-community.md deleted file mode 100644 index 80fb231..0000000 --- a/docs/endpoints/post-sonolus-replays-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/replays/{name}/community` - -`/sonolus/replays/{name}/community` allows Sonolus app to submit community actions to a replay. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-rooms-create.md b/docs/endpoints/post-sonolus-rooms-create.md index cd026e9..13d69c9 100644 --- a/docs/endpoints/post-sonolus-rooms-create.md +++ b/docs/endpoints/post-sonolus-rooms-create.md @@ -2,6 +2,10 @@ `/sonolus/rooms/create` allows Sonolus app to create a room. +## URL Parameters + +None. + ## Query Parameters | Query Parameter | Value | Description | @@ -39,7 +43,6 @@ type CreateRoomRequest = {} type CreateRoomResponse = { name: string key: string - creates: ServerForm[] } ``` @@ -56,10 +59,7 @@ Server defined room key. ```json { "name": "...", - "key": "...", - "creates": [ - // ... - ] + "key": "..." } ``` diff --git a/docs/endpoints/post-sonolus-rooms-name.md b/docs/endpoints/post-sonolus-rooms-item-name.md similarity index 89% rename from docs/endpoints/post-sonolus-rooms-name.md rename to docs/endpoints/post-sonolus-rooms-item-name.md index 2da98a4..954caec 100644 --- a/docs/endpoints/post-sonolus-rooms-name.md +++ b/docs/endpoints/post-sonolus-rooms-item-name.md @@ -1,7 +1,13 @@ -# `POST /sonolus/rooms/{name}` +# `POST /sonolus/rooms/{itemName}` `/sonolus/rooms/{name}` allows Sonolus app to join a room. +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------ | +| `itemName` | `string` | Name of room. | + ## Query Parameters | Query Parameter | Value | Description | @@ -29,6 +35,8 @@ type JoinRoomRequest = { } ``` +Server should verify that request body is authentic using `Sonolus-Signature` request header. + ### `type` Server should verify that `type` equals to `'authenticateMultiplayer'`. @@ -91,8 +99,6 @@ Server defined session information. ## Remarks -Server should verify that request body is authentic using `Sonolus-Signature` request header. - If a room is being created, create query parameters and `Sonolus-Room-key` header will be available. -If successful, client will join the multiplayer server with `Sonolus-Room-Session` header containing the value of `session`. Server can use it to replay necessary information to multiplayer server. +If successful, client will join the multiplayer server with `Sonolus-Room-Session` header containing the value of `session`. Server can use it to relay necessary information to multiplayer server. diff --git a/docs/endpoints/post-sonolus-skins-name-community.md b/docs/endpoints/post-sonolus-skins-name-community.md deleted file mode 100644 index b121828..0000000 --- a/docs/endpoints/post-sonolus-skins-name-community.md +++ /dev/null @@ -1,69 +0,0 @@ -# `POST /sonolus/skins/{name}/community` - -`/sonolus/skins/{name}/community` allows Sonolus app to submit community actions to a skin. - -## Query Parameters - -| Query Parameter | Value | Description | -| :-------------- | :------- | :--------------------------------------------------------- | -| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | - -## Request Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | - -## Request Body - -```ts -type SubmitItemCommunityActionRequest = { - values: string -} -``` - -### `values` - -Query parameters of submitted action. - -See [Options Query Parameters](../query-parameters/options-query-parameters.md). - -## Response Code - -| Code | Description | -| :----------------- | :---------------------------------- | -| `200 OK` | | -| `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | - -## Response Headers - -| Header | Value | Description | -| :---------------- | :------- | :---------------------------------------------------------------- | -| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | - -## Response Body - -```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number -} -``` - -### `shouldUpdateCommunity` - -Whether community section should update or not. - -### `shouldNavigateCommentsToPage` - -Whether comment list should navigate to specified page or not. - -## Examples - -```json -{ - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 -} -``` diff --git a/docs/endpoints/post-sonolus-engines-name-community.md b/docs/endpoints/post-sonolus-type-create.md similarity index 55% rename from docs/endpoints/post-sonolus-engines-name-community.md rename to docs/endpoints/post-sonolus-type-create.md index cde36e8..620d1c5 100644 --- a/docs/endpoints/post-sonolus-engines-name-community.md +++ b/docs/endpoints/post-sonolus-type-create.md @@ -1,6 +1,12 @@ -# `POST /sonolus/engines/{name}/community` +# `POST /sonolus/{type}/create` -`/sonolus/engines/{name}/community` allows Sonolus app to submit community actions to a engine. +`/sonolus/{type}/create` allows Sonolus app to create an item. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | ## Query Parameters @@ -17,14 +23,14 @@ ## Request Body ```ts -type SubmitItemCommunityActionRequest = { +type CreateItemRequest = { values: string } ``` ### `values` -Query parameters of submitted action. +Query parameters of create. See [Options Query Parameters](../query-parameters/options-query-parameters.md). @@ -34,7 +40,6 @@ See [Options Query Parameters](../query-parameters/options-query-parameters.md). | :----------------- | :---------------------------------- | | `200 OK` | | | `401 Unauthorized` | Authentication required or expired. | -| `404 Not Found` | | ## Response Headers @@ -45,25 +50,37 @@ See [Options Query Parameters](../query-parameters/options-query-parameters.md). ## Response Body ```ts -type SubmitItemCommunityActionResponse = { - shouldUpdateCommunity?: boolean - shouldNavigateCommentsToPage?: number +type CreateItemResponse = { + name: string + key: string + hashes: string[] } ``` -### `shouldUpdateCommunity` +### `name` + +Name of the created item. + +### `key` + +Server defined upload key. + +### `hashes` -Whether community section should update or not. +Hashes of files needed to be uploaded. -### `shouldNavigateCommentsToPage` +Only files specified in request body `values` can be uploaded. -Whether comment list should navigate to specified page or not. +If not empty, files will be uploaded using [`POST /sonolus/{type}/upload`](../endpoints/post-sonolus-type-upload.md). ## Examples ```json { - "shouldUpdateCommunity": true, - "shouldNavigateCommentsToPage": 5 + "name": "...", + "key": "...", + "hashes": [ + // ... + ] } ``` diff --git a/docs/endpoints/post-sonolus-effects-name-community.md b/docs/endpoints/post-sonolus-type-item-name-community-comments-comment-name-submit.md similarity index 65% rename from docs/endpoints/post-sonolus-effects-name-community.md rename to docs/endpoints/post-sonolus-type-item-name-community-comments-comment-name-submit.md index cc56fe0..b3b8289 100644 --- a/docs/endpoints/post-sonolus-effects-name-community.md +++ b/docs/endpoints/post-sonolus-type-item-name-community-comments-comment-name-submit.md @@ -1,6 +1,14 @@ -# `POST /sonolus/effects/{name}/community` +# `POST /sonolus/{type}/{itemName}/community/comments/{commentName}/submit` -`/sonolus/effects/{name}/community` allows Sonolus app to submit community actions to a effect. +`/sonolus/{type}/{itemName}/community/comments/{commentName}/submit` allows Sonolus app to submit community actions to comment of name `{commentName}` in item of name `{itemName}`. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | +| `commentName` | `string` | Name of comment. | ## Query Parameters diff --git a/docs/endpoints/post-sonolus-backgrounds-name-community.md b/docs/endpoints/post-sonolus-type-item-name-community-submit.md similarity index 70% rename from docs/endpoints/post-sonolus-backgrounds-name-community.md rename to docs/endpoints/post-sonolus-type-item-name-community-submit.md index ba85ed2..e0dc83a 100644 --- a/docs/endpoints/post-sonolus-backgrounds-name-community.md +++ b/docs/endpoints/post-sonolus-type-item-name-community-submit.md @@ -1,6 +1,13 @@ -# `POST /sonolus/backgrounds/{name}/community` +# `POST /sonolus/{type}/{itemName}/community/submit` -`/sonolus/backgrounds/{name}/community` allows Sonolus app to submit community actions to a background. +`/sonolus/{type}/{itemName}/community/submit` allows Sonolus app to submit community actions to item of name `{itemName}`. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | +| `itemName` | `string` | Name of item. | ## Query Parameters diff --git a/docs/endpoints/post-sonolus-type-upload.md b/docs/endpoints/post-sonolus-type-upload.md new file mode 100644 index 0000000..c755f58 --- /dev/null +++ b/docs/endpoints/post-sonolus-type-upload.md @@ -0,0 +1,51 @@ +# `POST /sonolus/{type}/upload` + +`/sonolus/{type}/upload` allows Sonolus app to upload files when creating an item. + +## URL Parameters + +| URL Parameter | Value | Description | +| :------------ | :------- | :------------------------------------------------------------------------------------------------------- | +| `type` | `string` | `posts`, `playlists`, `levels`, `skins`, `backgrounds`, `effects`, `particles`, `engines`, or `replays`. | + +## Query Parameters + +| Query Parameter | Value | Description | +| :-------------- | :------- | :--------------------------------------------------------- | +| `localization` | `string` | See [`localization`](../query-parameters/localization.md). | + +## Request Headers + +| Header | Value | Description | +| :------------------- | :------- | :----------------------------------------------------------------------------- | +| `Sonolus-Session` | `string` | Optional, see [`Sonolus-Session`](../headers/sonolus-session.md). | +| `Sonolus-Upload-Key` | `string` | See [`POST /sonolus/{type}/create`](../endpoints/post-sonolus-type-create.md). | + +## Request Body + +`multipart/form-data` encoded data with `files` field. + +## Response Code + +| Code | Description | +| :----------------- | :---------------------------------- | +| `200 OK` | | +| `401 Unauthorized` | Authentication required or expired. | + +## Response Headers + +| Header | Value | Description | +| :---------------- | :------- | :---------------------------------------------------------------- | +| `Sonolus-Version` | `string` | Optional, see [`Sonolus-Version`](../headers/sonolus-version.md). | + +## Response Body + +```ts +type UploadItemResponse = {} +``` + +## Examples + +```json +{} +``` diff --git a/docs/misc/external-authentication.md b/docs/misc/external-authentication.md index 2a41dd3..ff98ee5 100644 --- a/docs/misc/external-authentication.md +++ b/docs/misc/external-authentication.md @@ -25,6 +25,8 @@ type AuthenticateExternalRequest = { } ``` +Server should verify that request body is authentic using `Sonolus-Signature` request header. + ### `type` Server should verify that `type` equals to `'authenticateExternal'`. @@ -51,7 +53,3 @@ None. ## Response Body None. - -## Remarks - -Server should verify that request body is authentic using `Sonolus-Signature` request header. diff --git a/docs/misc/item-community-comment-list.md b/docs/misc/item-community-comment-list.md deleted file mode 100644 index bce428f..0000000 --- a/docs/misc/item-community-comment-list.md +++ /dev/null @@ -1,31 +0,0 @@ -# `ItemCommunityCommentList` - -`ItemCommunityCommentList` provides comments information of an item, and is used by Sonolus app to populate item details view's community section's comment list. - -## Syntax - -```ts -type ItemCommunityCommentList = { - pageCount: number - comments: ItemCommunityComment[] -} -``` - -### `pageCount` - -If `-1` is used, the list is treated as having infinite pagination. - -## Examples - -```json -{ - "pageCount": 5, - "comments": [ - // ... - ] -} -``` - -## Remarks - -It is recommended to keep each page short by showing only 10 entries. diff --git a/docs/misc/item-community-comment.md b/docs/misc/item-community-comment.md index 1e26c81..b690fac 100644 --- a/docs/misc/item-community-comment.md +++ b/docs/misc/item-community-comment.md @@ -6,6 +6,7 @@ ```ts type ItemCommunityComment = { + name: string author: string time: number content: string @@ -17,6 +18,7 @@ type ItemCommunityComment = { ```json { + "name": "...", "author": "Username", "time": 1640995200000, "content": "...", diff --git a/docs/misc/item-community.md b/docs/misc/item-community.md deleted file mode 100644 index e635da9..0000000 --- a/docs/misc/item-community.md +++ /dev/null @@ -1,25 +0,0 @@ -# `ItemCommunity` - -`ItemCommunity` provides community information of an item, and is used by Sonolus app to populate item details view's community section. - -## Syntax - -```ts -type ItemCommunity = { - actions: ServerForm[] - topComments: ItemCommunityComment[] -} -``` - -## Examples - -```json -{ - "actions": [ - // ... - ], - "topComments": [ - // ... - ] -} -``` diff --git a/docs/misc/item-details.md b/docs/misc/item-details.md deleted file mode 100644 index 2586ee1..0000000 --- a/docs/misc/item-details.md +++ /dev/null @@ -1,33 +0,0 @@ -# `ItemDetails` - -`ItemDetails` provides detailed information of an item, and is used by Sonolus app to populate item details view. - -## Syntax - -```ts -type ItemDetails = { - item: T - description: string - hasCommunity: boolean - sections: ItemSection[] -} -``` - -## Examples - -```json -{ - "item": { - // ... - }, - "description": "Description of the item", - "hasCommunity": true, - "sections": [ - // ... - ] -} -``` - -## Remarks - -It is recommended to keep recommended short by showing only 5 entries. diff --git a/docs/misc/item-info.md b/docs/misc/item-info.md deleted file mode 100644 index a690253..0000000 --- a/docs/misc/item-info.md +++ /dev/null @@ -1,29 +0,0 @@ -# `ItemInfo` - -`ItemInfo` provides information of items, and is used by Sonolus app to populate item info view. - -## Syntax - -```ts -type ItemInfo = { - searches?: ServerForm[] - sections: ItemSection[] - banner?: SRL -} -``` - -## Examples - -```json -{ - "searches": [ - // ... - ], - "sections": [ - // ... - ], - "banner": { - // ... - } -} -``` diff --git a/docs/misc/item-leaderboard-record.md b/docs/misc/item-leaderboard-record.md new file mode 100644 index 0000000..0808fca --- /dev/null +++ b/docs/misc/item-leaderboard-record.md @@ -0,0 +1,25 @@ +# `ItemLeaderboardRecord` + +`ItemLeaderboardRecord` provides information of an item leaderboard record. + +## Syntax + +```ts +type ItemLeaderboardRecord = { + name: string + rank: Text | (string & {}) + player: string + value: Text | (string & {}) +} +``` + +## Examples + +```json +{ + "name": "...", + "rank": "...", + "player": "...", + "value": "..." +} +``` diff --git a/docs/misc/item-leaderboard.md b/docs/misc/item-leaderboard.md new file mode 100644 index 0000000..0ef6934 --- /dev/null +++ b/docs/misc/item-leaderboard.md @@ -0,0 +1,21 @@ +# `ItemLeaderboard` + +`ItemLeaderboard` provides information of an item leaderboard. + +## Syntax + +```ts +type ItemLeaderboard = { + name: string + title: Text | (string & {}) +} +``` + +## Examples + +```json +{ + "name": "...", + "title": "..." +} +``` diff --git a/docs/misc/item-list.md b/docs/misc/item-list.md deleted file mode 100644 index 117bd32..0000000 --- a/docs/misc/item-list.md +++ /dev/null @@ -1,35 +0,0 @@ -# `ItemList` - -`ItemList` provides information of a paginated list of items, and is used by Sonolus app to populate item list view. - -## Syntax - -```ts -type ItemList = { - pageCount: number - items: T[] - searches?: ServerForm[] -} -``` - -### `pageCount` - -If `-1` is used, the list is treated as having infinite pagination. - -## Examples - -```json -{ - "pageCount": 5, - "items": [ - // ... - ], - "searches": [ - // ... - ] -} -``` - -## Remarks - -It is recommended to keep each page short by showing only 20 entries. diff --git a/docs/misc/server-form.md b/docs/misc/server-form.md index b1aa6ff..d2ef7cc 100644 --- a/docs/misc/server-form.md +++ b/docs/misc/server-form.md @@ -8,7 +8,7 @@ type ServerForm = { type: string title: Text | (string & {}) - icon?: Icon + icon?: Icon | (string & {}) options: ServerOption[] } @@ -19,10 +19,15 @@ type ServerOption = | ServerToggleOption | ServerSelectOption | ServerMultiOption + | ServerServerItemOption + | ServerCollectionItemOption + | ServerFileOption type ServerTextOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'text' placeholder: Text | (string & {}) limit?: number @@ -31,6 +36,8 @@ type ServerTextOption = { type ServerTextAreaOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'textArea' placeholder: Text | (string & {}) limit?: number @@ -39,6 +46,8 @@ type ServerTextAreaOption = { type ServerSliderOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'slider' def: number min: number @@ -50,6 +59,8 @@ type ServerSliderOption = { type ServerToggleOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'toggle' def: 0 | 1 } @@ -57,6 +68,8 @@ type ServerToggleOption = { type ServerSelectOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'select' def: number values: (Text | (string & {}))[] @@ -65,16 +78,48 @@ type ServerSelectOption = { type ServerMultiOption = { query: string name: Text | (string & {}) + description?: string + required?: boolean type: 'multi' defs: boolean[] values: (Text | (string & {}))[] } + +type ServerServerItemOption = { + query: string + name: Text | (string & {}) + description?: string + required?: boolean + type: 'serverItem' + itemType: ItemType +} + +type ServerCollectionItemOption = { + query: string + name: Text | (string & {}) + description?: string + required?: boolean + type: 'collectionItem' + itemType: ItemType +} + +type ServerFileOption = { + query: string + name: Text | (string & {}) + description?: string + required?: boolean + type: 'file' +} ``` ### `query` Name of query parameter used to identify the option. +### `required` + +If `true`, player is required to modify the value. + ## Examples ```json diff --git a/docs/misc/tag.md b/docs/misc/tag.md index a240f06..29b7e1e 100644 --- a/docs/misc/tag.md +++ b/docs/misc/tag.md @@ -7,7 +7,7 @@ ```ts type Tag = { title: Text | (string & {}) - icon?: Icon + icon?: Icon | (string & {}) } ``` diff --git a/docs/sidebar.json b/docs/sidebar.json index 0179e30..324d168 100644 --- a/docs/sidebar.json +++ b/docs/sidebar.json @@ -11,64 +11,20 @@ "title": "Endpoints", "pages": { "/endpoints/get-sonolus-info": "GET /sonolus/info", - "/endpoints/get-sonolus-rooms-info": "GET /sonolus/rooms/info", - "/endpoints/get-sonolus-posts-info": "GET /sonolus/posts/info", - "/endpoints/get-sonolus-playlists-info": "GET /sonolus/playlists/info", - "/endpoints/get-sonolus-levels-info": "GET /sonolus/levels/info", - "/endpoints/get-sonolus-replays-info": "GET /sonolus/replays/info", - "/endpoints/get-sonolus-skins-info": "GET /sonolus/skins/info", - "/endpoints/get-sonolus-backgrounds-info": "GET /sonolus/backgrounds/info", - "/endpoints/get-sonolus-effects-info": "GET /sonolus/effects/info", - "/endpoints/get-sonolus-particles-info": "GET /sonolus/particles/info", - "/endpoints/get-sonolus-engines-info": "GET /sonolus/engines/info", - "/endpoints/get-sonolus-rooms-list": "GET /sonolus/rooms/list", - "/endpoints/get-sonolus-posts-list": "GET /sonolus/posts/list", - "/endpoints/get-sonolus-playlists-list": "GET /sonolus/playlists/list", - "/endpoints/get-sonolus-levels-list": "GET /sonolus/levels/list", - "/endpoints/get-sonolus-replays-list": "GET /sonolus/replays/list", - "/endpoints/get-sonolus-skins-list": "GET /sonolus/skins/list", - "/endpoints/get-sonolus-backgrounds-list": "GET /sonolus/backgrounds/list", - "/endpoints/get-sonolus-effects-list": "GET /sonolus/effects/list", - "/endpoints/get-sonolus-particles-list": "GET /sonolus/particles/list", - "/endpoints/get-sonolus-engines-list": "GET /sonolus/engines/list", + "/endpoints/get-sonolus-type-info": "GET /sonolus/{type}/info", + "/endpoints/get-sonolus-type-list": "GET /sonolus/{type}/list", + "/endpoints/post-sonolus-type-create": "POST /sonolus/{type}/create", "/endpoints/post-sonolus-rooms-create": "POST /sonolus/rooms/create", - "/endpoints/post-sonolus-rooms-name": "POST /sonolus/rooms/{name}", - "/endpoints/get-sonolus-posts-name": "GET /sonolus/posts/{name}", - "/endpoints/get-sonolus-playlists-name": "GET /sonolus/playlists/{name}", - "/endpoints/get-sonolus-levels-name": "GET /sonolus/levels/{name}", - "/endpoints/get-sonolus-replays-name": "GET /sonolus/replays/{name}", - "/endpoints/get-sonolus-skins-name": "GET /sonolus/skins/{name}", - "/endpoints/get-sonolus-backgrounds-name": "GET /sonolus/backgrounds/{name}", - "/endpoints/get-sonolus-effects-name": "GET /sonolus/effects/{name}", - "/endpoints/get-sonolus-particles-name": "GET /sonolus/particles/{name}", - "/endpoints/get-sonolus-engines-name": "GET /sonolus/engines/{name}", - "/endpoints/get-sonolus-posts-name-community": "GET /sonolus/posts/{name}/community", - "/endpoints/get-sonolus-playlists-name-community": "GET /sonolus/playlists/{name}/community", - "/endpoints/get-sonolus-levels-name-community": "GET /sonolus/levels/{name}/community", - "/endpoints/get-sonolus-replays-name-community": "GET /sonolus/replays/{name}/community", - "/endpoints/get-sonolus-skins-name-community": "GET /sonolus/skins/{name}/community", - "/endpoints/get-sonolus-backgrounds-name-community": "GET /sonolus/backgrounds/{name}/community", - "/endpoints/get-sonolus-effects-name-community": "GET /sonolus/effects/{name}/community", - "/endpoints/get-sonolus-particles-name-community": "GET /sonolus/particles/{name}/community", - "/endpoints/get-sonolus-engines-name-community": "GET /sonolus/engines/{name}/community", - "/endpoints/get-sonolus-posts-name-community-comments-list": "GET /sonolus/posts/{name}/community/comments/list", - "/endpoints/get-sonolus-playlists-name-community-comments-list": "GET /sonolus/playlists/{name}/community/comments/list", - "/endpoints/get-sonolus-levels-name-community-comments-list": "GET /sonolus/levels/{name}/community/comments/list", - "/endpoints/get-sonolus-replays-name-community-comments-list": "GET /sonolus/replays/{name}/community/comments/list", - "/endpoints/get-sonolus-skins-name-community-comments-list": "GET /sonolus/skins/{name}/community/comments/list", - "/endpoints/get-sonolus-backgrounds-name-community-comments-list": "GET /sonolus/backgrounds/{name}/community/comments/list", - "/endpoints/get-sonolus-effects-name-community-comments-list": "GET /sonolus/effects/{name}/community/comments/list", - "/endpoints/get-sonolus-particles-name-community-comments-list": "GET /sonolus/particles/{name}/community/comments/list", - "/endpoints/get-sonolus-engines-name-community-comments-list": "GET /sonolus/engines/{name}/community/comments/list", - "/endpoints/post-sonolus-posts-name-community": "POST /sonolus/posts/{name}/community", - "/endpoints/post-sonolus-playlists-name-community": "POST /sonolus/playlists/{name}/community", - "/endpoints/post-sonolus-levels-name-community": "POST /sonolus/levels/{name}/community", - "/endpoints/post-sonolus-replays-name-community": "POST /sonolus/replays/{name}/community", - "/endpoints/post-sonolus-skins-name-community": "POST /sonolus/skins/{name}/community", - "/endpoints/post-sonolus-backgrounds-name-community": "POST /sonolus/backgrounds/{name}/community", - "/endpoints/post-sonolus-effects-name-community": "POST /sonolus/effects/{name}/community", - "/endpoints/post-sonolus-particles-name-community": "POST /sonolus/particles/{name}/community", - "/endpoints/post-sonolus-engines-name-community": "POST /sonolus/engines/{name}/community", + "/endpoints/post-sonolus-type-upload": "POST /sonolus/{type}/upload", + "/endpoints/get-sonolus-type-item-name": "GET /sonolus/{type}/{itemName}", + "/endpoints/post-sonolus-rooms-item-name": "POST /sonolus/rooms/{itemName}", + "/endpoints/get-sonolus-type-item-name-community-info": "GET /sonolus/{type}/{itemName}/community/info", + "/endpoints/post-sonolus-type-item-name-community-submit": "POST /sonolus/{type}/{itemName}/community/submit", + "/endpoints/get-sonolus-type-item-name-community-comments-list": "GET /sonolus/{type}/{itemName}/community/comments/list", + "/endpoints/post-sonolus-type-item-name-community-comments-comment-name-submit": "POST /sonolus/{type}/{itemName}/community/comments/{commentName}/submit", + "/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name": "GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}", + "/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-list": "GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/list", + "/endpoints/get-sonolus-type-item-name-leaderboards-leaderboard-name-records-record-name": "GET /sonolus/{type}/{itemName}/leaderboards/{leaderboardName}/records/{recordName}", "/endpoints/post-sonolus-authenticate": "POST /sonolus/authenticate" } }, @@ -97,12 +53,9 @@ "/misc/srl": "SRL", "/misc/server-form": "ServerForm", "/misc/item-section": "ItemSection", - "/misc/item-info": "ItemInfo", - "/misc/item-list": "ItemList", - "/misc/item-details": "ItemDetails", - "/misc/item-community": "ItemCommunity", "/misc/item-community-comment": "ItemCommunityComment", - "/misc/item-community-comment-list": "ItemCommunityCommentList", + "/misc/item-leaderboard": "ItemLeaderboard", + "/misc/item-leaderboard-record": "ItemLeaderboardRecord", "/misc/room-item": "RoomItem", "/misc/post-item": "PostItem", "/misc/playlist-item": "PlaylistItem",