From 4ee885e7b22f0b5f4ecd094f137820d89fcf7c8e Mon Sep 17 00:00:00 2001 From: Samuel Cattini-Schultz Date: Wed, 24 Apr 2024 12:51:05 +1000 Subject: [PATCH] Use neoteroi-mkdocs to generate API Reference --- docs/docs/api-reference/difficalcy-catch.json | 486 +++++++++++++++++ docs/docs/api-reference/difficalcy-catch.md | 176 +----- docs/docs/api-reference/difficalcy-mania.json | 362 ++++++++++++ docs/docs/api-reference/difficalcy-mania.md | 156 +----- docs/docs/api-reference/difficalcy-osu.json | 514 ++++++++++++++++++ docs/docs/api-reference/difficalcy-osu.md | 204 +------ docs/docs/api-reference/difficalcy-taiko.json | 474 ++++++++++++++++ docs/docs/api-reference/difficalcy-taiko.md | 190 +------ docs/docs/css/mkdocsoad.css | 204 +++++++ docs/mkdocs.yml | 19 +- docs/requirements.txt | 11 + 11 files changed, 2070 insertions(+), 726 deletions(-) create mode 100644 docs/docs/api-reference/difficalcy-catch.json create mode 100644 docs/docs/api-reference/difficalcy-mania.json create mode 100644 docs/docs/api-reference/difficalcy-osu.json create mode 100644 docs/docs/api-reference/difficalcy-taiko.json create mode 100644 docs/docs/css/mkdocsoad.css diff --git a/docs/docs/api-reference/difficalcy-catch.json b/docs/docs/api-reference/difficalcy-catch.json new file mode 100644 index 0000000..5cf4a9e --- /dev/null +++ b/docs/docs/api-reference/difficalcy-catch.json @@ -0,0 +1,486 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Difficalcy.Catch", + "version": "v1" + }, + "paths": { + "/api/info": { + "get": { + "tags": [ + "CatchCalculator" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculatorInfo" + } + } + } + } + } + } + }, + "/api/difficulty": { + "get": { + "tags": [ + "CatchCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "TinyDroplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Droplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatchDifficulty" + } + } + } + } + } + } + }, + "/api/performance": { + "get": { + "tags": [ + "CatchCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "TinyDroplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Droplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatchPerformance" + } + } + } + } + } + } + }, + "/api/calculation": { + "get": { + "tags": [ + "CatchCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "TinyDroplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Droplets", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatchCalculation" + } + } + } + } + } + } + }, + "/api/batch/difficulty": { + "post": { + "tags": [ + "CatchCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchDifficulty" + } + } + } + } + } + } + } + }, + "/api/batch/performance": { + "post": { + "tags": [ + "CatchCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchPerformance" + } + } + } + } + } + } + } + }, + "/api/batch/calculation": { + "post": { + "tags": [ + "CatchCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatchCalculation" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CalculatorInfo": { + "type": "object", + "properties": { + "rulesetName": { + "type": "string", + "nullable": true + }, + "calculatorName": { + "type": "string", + "nullable": true + }, + "calculatorPackage": { + "type": "string", + "nullable": true + }, + "calculatorVersion": { + "type": "string", + "nullable": true + }, + "calculatorUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CatchDifficulty": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "CatchPerformance": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "CatchCalculation": { + "type": "object", + "properties": { + "difficulty": { + "$ref": "#/components/schemas/CatchDifficulty" + }, + "performance": { + "$ref": "#/components/schemas/CatchPerformance" + } + }, + "additionalProperties": false + }, + "CatchScore": { + "required": [ + "beatmapId" + ], + "type": "object", + "properties": { + "beatmapId": { + "type": "string" + }, + "mods": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "accuracy": { + "type": "number", + "format": "double", + "nullable": true + }, + "combo": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "misses": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "tinyDroplets": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "droplets": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + } + } + } +} diff --git a/docs/docs/api-reference/difficalcy-catch.md b/docs/docs/api-reference/difficalcy-catch.md index 4902e84..142d101 100644 --- a/docs/docs/api-reference/difficalcy-catch.md +++ b/docs/docs/api-reference/difficalcy-catch.md @@ -1,175 +1 @@ -# difficalcy-catch - -## `GET /api/calculator/info` - -### Response - -```json -{ - "rulesetName": "string", - "calculatorName": "string", - "calculatorPackage": "string", - "calculatorVersion": "string", - "calculatorUrl": "string" -} -``` - -## `GET /api/calculator/difficulty` - -### Query Parameters - -| Name | Description | Required | Type | -| ------------ | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| TinyDroplets | | No | integer | -| Droplets | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0 -} -``` - -## `GET /api/calculator/performance` - -### Query Parameters - -| Name | Description | Required | Type | -| ------------ | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| TinyDroplets | | No | integer | -| Droplets | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0 -} -``` - -## `GET /api/calculator/calculation` - -### Query Parameters - -| Name | Description | Required | Type | -| ------------ | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| TinyDroplets | | No | integer | -| Droplets | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "difficulty": { - "total": 0 - }, - "performance": { - "total": 0 - } -} -``` - -## `POST /api/calculator/batch/difficulty` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "tinyDroplets": 0, - "droplets": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0 - } -] -``` - -## `POST /api/calculator/batch/performance` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "tinyDroplets": 0, - "droplets": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0 - } -] -``` - -## `POST /api/calculator/batch/calculation` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "tinyDroplets": 0, - "droplets": 0 - } -] -``` - -### Response - -```json -[ - { - "difficulty": { - "total": 0 - }, - "performance": { - "total": 0 - } - } -] -``` +[OAD(./docs/api-reference/difficalcy-catch.json)] diff --git a/docs/docs/api-reference/difficalcy-mania.json b/docs/docs/api-reference/difficalcy-mania.json new file mode 100644 index 0000000..2945626 --- /dev/null +++ b/docs/docs/api-reference/difficalcy-mania.json @@ -0,0 +1,362 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Difficalcy.Mania", + "version": "v1" + }, + "paths": { + "/api/info": { + "get": { + "tags": [ + "ManiaCalculator" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculatorInfo" + } + } + } + } + } + } + }, + "/api/difficulty": { + "get": { + "tags": [ + "ManiaCalculator" + ], + "parameters": [ + { + "name": "TotalScore", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManiaDifficulty" + } + } + } + } + } + } + }, + "/api/performance": { + "get": { + "tags": [ + "ManiaCalculator" + ], + "parameters": [ + { + "name": "TotalScore", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManiaPerformance" + } + } + } + } + } + } + }, + "/api/calculation": { + "get": { + "tags": [ + "ManiaCalculator" + ], + "parameters": [ + { + "name": "TotalScore", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManiaCalculation" + } + } + } + } + } + } + }, + "/api/batch/difficulty": { + "post": { + "tags": [ + "ManiaCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaDifficulty" + } + } + } + } + } + } + } + }, + "/api/batch/performance": { + "post": { + "tags": [ + "ManiaCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaPerformance" + } + } + } + } + } + } + } + }, + "/api/batch/calculation": { + "post": { + "tags": [ + "ManiaCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManiaCalculation" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CalculatorInfo": { + "type": "object", + "properties": { + "rulesetName": { + "type": "string", + "nullable": true + }, + "calculatorName": { + "type": "string", + "nullable": true + }, + "calculatorPackage": { + "type": "string", + "nullable": true + }, + "calculatorVersion": { + "type": "string", + "nullable": true + }, + "calculatorUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ManiaDifficulty": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "ManiaPerformance": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + }, + "difficulty": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "ManiaCalculation": { + "type": "object", + "properties": { + "difficulty": { + "$ref": "#/components/schemas/ManiaDifficulty" + }, + "performance": { + "$ref": "#/components/schemas/ManiaPerformance" + } + }, + "additionalProperties": false + }, + "ManiaScore": { + "required": [ + "beatmapId" + ], + "type": "object", + "properties": { + "beatmapId": { + "type": "string" + }, + "mods": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "totalScore": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + } + } + } +} diff --git a/docs/docs/api-reference/difficalcy-mania.md b/docs/docs/api-reference/difficalcy-mania.md index a5f53ea..9c7eb40 100644 --- a/docs/docs/api-reference/difficalcy-mania.md +++ b/docs/docs/api-reference/difficalcy-mania.md @@ -1,155 +1 @@ -# difficalcy-mania - -## `GET /api/calculator/info` - -### Response - -```json -{ - "rulesetName": "string", - "calculatorName": "string", - "calculatorPackage": "string", - "calculatorVersion": "string", - "calculatorUrl": "string" -} -``` - -## `GET /api/calculator/difficulty` - -### Query Parameters - -| Name | Description | Required | Type | -| ---------- | ----------- | -------- | ------- | -| TotalScore | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0 -} -``` - -## `GET /api/calculator/performance` - -### Query Parameters - -| Name | Description | Required | Type | -| ---------- | ----------- | -------- | ------- | -| TotalScore | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0, - "difficulty": 0 -} -``` - -## `GET /api/calculator/calculation` - -### Query Parameters - -| Name | Description | Required | Type | -| ---------- | ----------- | -------- | ------- | -| TotalScore | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "difficulty": { - "total": 0 - }, - "performance": { - "total": 0, - "difficulty": 0 - } -} -``` - -## `POST /api/calculator/batch/difficulty` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "totalScore": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0 - } -] -``` - -## `POST /api/calculator/batch/performance` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "totalScore": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0, - "difficulty": 0 - } -] -``` - -## `POST /api/calculator/batch/calculation` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "totalScore": 0 - } -] -``` - -### Response - -```json -[ - { - "difficulty": { - "total": 0 - }, - "performance": { - "total": 0, - "difficulty": 0 - } - } -] -``` +[OAD(./docs/api-reference/difficalcy-mania.json)] diff --git a/docs/docs/api-reference/difficalcy-osu.json b/docs/docs/api-reference/difficalcy-osu.json new file mode 100644 index 0000000..81a9770 --- /dev/null +++ b/docs/docs/api-reference/difficalcy-osu.json @@ -0,0 +1,514 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Difficalcy.Osu", + "version": "v1" + }, + "paths": { + "/api/info": { + "get": { + "tags": [ + "OsuCalculator" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculatorInfo" + } + } + } + } + } + } + }, + "/api/difficulty": { + "get": { + "tags": [ + "OsuCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Mehs", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OsuDifficulty" + } + } + } + } + } + } + }, + "/api/performance": { + "get": { + "tags": [ + "OsuCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Mehs", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OsuPerformance" + } + } + } + } + } + } + }, + "/api/calculation": { + "get": { + "tags": [ + "OsuCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Mehs", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OsuCalculation" + } + } + } + } + } + } + }, + "/api/batch/difficulty": { + "post": { + "tags": [ + "OsuCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuDifficulty" + } + } + } + } + } + } + } + }, + "/api/batch/performance": { + "post": { + "tags": [ + "OsuCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuPerformance" + } + } + } + } + } + } + } + }, + "/api/batch/calculation": { + "post": { + "tags": [ + "OsuCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OsuCalculation" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CalculatorInfo": { + "type": "object", + "properties": { + "rulesetName": { + "type": "string", + "nullable": true + }, + "calculatorName": { + "type": "string", + "nullable": true + }, + "calculatorPackage": { + "type": "string", + "nullable": true + }, + "calculatorVersion": { + "type": "string", + "nullable": true + }, + "calculatorUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "OsuDifficulty": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + }, + "aim": { + "type": "number", + "format": "double" + }, + "speed": { + "type": "number", + "format": "double" + }, + "flashlight": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "OsuPerformance": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + }, + "aim": { + "type": "number", + "format": "double" + }, + "speed": { + "type": "number", + "format": "double" + }, + "accuracy": { + "type": "number", + "format": "double" + }, + "flashlight": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "OsuCalculation": { + "type": "object", + "properties": { + "difficulty": { + "$ref": "#/components/schemas/OsuDifficulty" + }, + "performance": { + "$ref": "#/components/schemas/OsuPerformance" + } + }, + "additionalProperties": false + }, + "OsuScore": { + "required": [ + "beatmapId" + ], + "type": "object", + "properties": { + "beatmapId": { + "type": "string" + }, + "mods": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "accuracy": { + "type": "number", + "format": "double", + "nullable": true + }, + "combo": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "misses": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "mehs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "oks": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + } + } + } +} diff --git a/docs/docs/api-reference/difficalcy-osu.md b/docs/docs/api-reference/difficalcy-osu.md index bf600a3..af17cae 100644 --- a/docs/docs/api-reference/difficalcy-osu.md +++ b/docs/docs/api-reference/difficalcy-osu.md @@ -1,203 +1 @@ -# difficalcy-osu - -## `GET /api/calculator/info` - -### Response - -```json -{ - "rulesetName": "string", - "calculatorName": "string", - "calculatorPackage": "string", - "calculatorVersion": "string", - "calculatorUrl": "string" -} -``` - -## `GET /api/calculator/difficulty` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Mehs | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0, - "aim": 0, - "speed": 0, - "flashlight": 0 -} -``` - -## `GET /api/calculator/performance` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Mehs | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0, - "aim": 0, - "speed": 0, - "accuracy": 0, - "flashlight": 0 -} -``` - -## `GET /api/calculator/calculation` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Mehs | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "difficulty": { - "total": 0, - "aim": 0, - "speed": 0, - "flashlight": 0 - }, - "performance": { - "total": 0, - "aim": 0, - "speed": 0, - "accuracy": 0, - "flashlight": 0 - } -} -``` - -## `POST /api/calculator/batch/difficulty` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "mehs": 0, - "oks": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0, - "aim": 0, - "speed": 0, - "flashlight": 0 - } -] -``` - -## `POST /api/calculator/batch/performance` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "mehs": 0, - "oks": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0, - "aim": 0, - "speed": 0, - "accuracy": 0, - "flashlight": 0 - } -] -``` - -## `POST /api/calculator/batch/calculation` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "mehs": 0, - "oks": 0 - } -] -``` - -### Response - -```json -[ - { - "difficulty": { - "total": 0, - "aim": 0, - "speed": 0, - "flashlight": 0 - }, - "performance": { - "total": 0, - "aim": 0, - "speed": 0, - "accuracy": 0, - "flashlight": 0 - } - } -] -``` +[OAD(./docs/api-reference/difficalcy-osu.json)] diff --git a/docs/docs/api-reference/difficalcy-taiko.json b/docs/docs/api-reference/difficalcy-taiko.json new file mode 100644 index 0000000..ad034af --- /dev/null +++ b/docs/docs/api-reference/difficalcy-taiko.json @@ -0,0 +1,474 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Difficalcy.Taiko", + "version": "v1" + }, + "paths": { + "/api/info": { + "get": { + "tags": [ + "TaikoCalculator" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculatorInfo" + } + } + } + } + } + } + }, + "/api/difficulty": { + "get": { + "tags": [ + "TaikoCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaikoDifficulty" + } + } + } + } + } + } + }, + "/api/performance": { + "get": { + "tags": [ + "TaikoCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaikoPerformance" + } + } + } + } + } + } + }, + "/api/calculation": { + "get": { + "tags": [ + "TaikoCalculator" + ], + "parameters": [ + { + "name": "Accuracy", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "nullable": true + } + }, + { + "name": "Combo", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Misses", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "Oks", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + { + "name": "BeatmapId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Mods", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaikoCalculation" + } + } + } + } + } + } + }, + "/api/batch/difficulty": { + "post": { + "tags": [ + "TaikoCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoDifficulty" + } + } + } + } + } + } + } + }, + "/api/batch/performance": { + "post": { + "tags": [ + "TaikoCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoPerformance" + } + } + } + } + } + } + } + }, + "/api/batch/calculation": { + "post": { + "tags": [ + "TaikoCalculator" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoScore" + }, + "nullable": true + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaikoCalculation" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CalculatorInfo": { + "type": "object", + "properties": { + "rulesetName": { + "type": "string", + "nullable": true + }, + "calculatorName": { + "type": "string", + "nullable": true + }, + "calculatorPackage": { + "type": "string", + "nullable": true + }, + "calculatorVersion": { + "type": "string", + "nullable": true + }, + "calculatorUrl": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TaikoDifficulty": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + }, + "stamina": { + "type": "number", + "format": "double" + }, + "rhythm": { + "type": "number", + "format": "double" + }, + "colour": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TaikoPerformance": { + "type": "object", + "properties": { + "total": { + "type": "number", + "format": "double" + }, + "difficulty": { + "type": "number", + "format": "double" + }, + "accuracy": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TaikoCalculation": { + "type": "object", + "properties": { + "difficulty": { + "$ref": "#/components/schemas/TaikoDifficulty" + }, + "performance": { + "$ref": "#/components/schemas/TaikoPerformance" + } + }, + "additionalProperties": false + }, + "TaikoScore": { + "required": [ + "beatmapId" + ], + "type": "object", + "properties": { + "beatmapId": { + "type": "string" + }, + "mods": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "accuracy": { + "type": "number", + "format": "double", + "nullable": true + }, + "combo": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "misses": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "oks": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + } + } + } +} diff --git a/docs/docs/api-reference/difficalcy-taiko.md b/docs/docs/api-reference/difficalcy-taiko.md index 07fc8f8..8d86e48 100644 --- a/docs/docs/api-reference/difficalcy-taiko.md +++ b/docs/docs/api-reference/difficalcy-taiko.md @@ -1,189 +1 @@ -# difficalcy-taiko - -## `GET /api/calculator/info` - -### Response - -```json -{ - "rulesetName": "string", - "calculatorName": "string", - "calculatorPackage": "string", - "calculatorVersion": "string", - "calculatorUrl": "string" -} -``` - -## `GET /api/calculator/difficulty` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0, - "stamina": 0, - "rhythm": 0, - "colour": 0 -} -``` - -## `GET /api/calculator/performance` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "total": 0, - "difficulty": 0, - "accuracy": 0 -} -``` - -## `GET /api/calculator/calculation` - -### Query Parameters - -| Name | Description | Required | Type | -| --------- | ----------- | -------- | ------- | -| Accuracy | | No | double | -| Combo | | No | integer | -| Misses | | No | integer | -| Oks | | No | integer | -| BeatmapId | | Yes | string | -| Mods | | No | integer | - -### Response - -```json -{ - "difficulty": { - "total": 0, - "stamina": 0, - "rhythm": 0, - "colour": 0 - }, - "performance": { - "total": 0, - "difficulty": 0, - "accuracy": 0 - } -} -``` - -## `POST /api/calculator/batch/difficulty` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "oks": 0 - } -] -``` - -### Response - -```json - - { - "total": 0, - "stamina": 0, - "rhythm": 0, - "colour": 0 - } -] -``` - -## `POST /api/calculator/batch/performance` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "oks": 0 - } -] -``` - -### Response - -```json -[ - { - "total": 0, - "difficulty": 0, - "accuracy": 0 - } -] -``` - -## `POST /api/calculator/batch/calculation` - -### Body Parameters - -```json -[ - { - "beatmapId": "string", - "mods": 0, - "accuracy": 0, - "combo": 0, - "misses": 0, - "oks": 0 - } -] -``` - -### Response - -```json -[ - { - "difficulty": { - "total": 0, - "stamina": 0, - "rhythm": 0, - "colour": 0 - }, - "performance": { - "total": 0, - "difficulty": 0, - "accuracy": 0 - } - } -] -``` +[OAD(./docs/api-reference/difficalcy-taiko.json)] diff --git a/docs/docs/css/mkdocsoad.css b/docs/docs/css/mkdocsoad.css new file mode 100644 index 0000000..461db25 --- /dev/null +++ b/docs/docs/css/mkdocsoad.css @@ -0,0 +1,204 @@ +/** + * Extra CSS file recommended for MkDocs and neoteroi.mkdocsoad plugin. + * This includes rules to highlight certain parts of the output of `essentials-openapi`, + * and to better use the width of the page. + * + * https://github.com/Neoteroi/mkdocs-plugins +**/ + +:root { + --http-get-color: green; + --http-delete-color: #dc0101; + --http-head-color: slateblue; + --http-options-color: steelblue; + --http-patch-color: darkorange; + --http-post-color: darkblue; + --http-put-color: darkmagenta; + --http-trace-color: darkcyan; + --http-route-param-color: rgb(51, 128, 210); + --oad-operation-separator-border-color: gray; + --oad-block-border-color: #00bfa5; + --oad-small-note-color: #666; + --oad-indent-border-color: #444; +} + +@media screen { + + /* Slate theme, i.e. dark mode */ + [data-md-color-scheme="slate"] { + --http-get-color: #2ea82e; + --http-post-color: #0093c0; + --http-put-color: #c333c3; + --oad-small-note-color: #afafaf; + } +} + +/* For large screens, make better use of the horizontal space */ + +/* @media screen and (min-width: 2000px) { + .md-grid { + max-width: 98%; + } + + .md-sidebar { + width: auto; + min-width: 15%; + } +} */ + +.api-tag { + font-weight: bold; +} + +span[class^="http-"] { + font-weight: bold; + color: #fff; + padding: 4px 1rem; + border-radius: 2px; + margin-right: .5rem; +} + +.http-get { + background-color: var(--http-get-color); +} + +.http-delete { + background-color: var(--http-delete-color); +} + +.http-post { + background-color: var(--http-post-color); +} + +.http-patch { + background-color: var(--http-patch-color); +} + +.http-trace { + background-color: var(--http-trace-color); +} + +.http-put { + background-color: var(--http-put-color); +} + +.http-head { + background-color: var(--http-head-color); +} + +.http-options { + background-color: var(--http-options-color); +} + +.route-param { + color: var(--http-route-param-color); +} + +.operation-separator+h3[id^="get"] .route-param { + color: var(--http-get-color); +} + +.operation-separator+h3[id^="delete"] .route-param { + color: var(--http-delete-color); +} + + +.operation-separator+h3[id^="post"] .route-param { + color: var(--http-post-color); +} + +.operation-separator+h3[id^="patch"] .route-param { + color: var(--http-patch-color); +} + +.operation-separator+h3[id^="trace"] .route-param { + color: var(--http-trace-color); +} + +.operation-separator+h3[id^="put"] .route-param { + color: var(--http-put-color); +} + +.operation-separator+h3[id^="head"] .route-param { + color: var(--http-head-color); +} + +.operation-separator+h3[id^="options"] .route-param { + color: var(--http-options-color); +} + +.api-version { + font-size: 1.2rem; +} + +.operation-separator { + margin: 0 !important; + border-bottom: 2px dotted var(--oad-operation-separator-border-color) !important; + padding-top: .5rem; +} + +.operation-separator+h3 { + margin-top: 1rem; +} + +.string-type { + color: var(--md-code-hl-string-color); +} + +.integer-type, +.number-type { + color: var(--md-code-hl-number-color); +} + +.boolean-type { + color: var(--md-code-hl-keyword-color); +} + +.format { + color: var(--md-code-hl-name-color); +} + +.null-type { + color: var(--md-code-hl-keyword-color); +} + +a.ref-link { + color: var(--md-code-hl-special-color); +} + +.request-block+div { + padding-left: 1rem; + border-left: 2px dashed var(--oad-block-border-color); +} + +.small-note { + font-size: 14px; + color: var(--oad-small-note-color); +} + +.request-body-title { + margin-bottom: 4px; +} + +.request-body-title+.tabbed-set, +.response-title+.tabbed-set, +.message-separator+.tabbed-set, +.common-response, +.response-section { + margin-top: 2px; + padding-left: 1rem; + border-left: 2px dotted var(--oad-indent-border-color); +} + +.info-data { + font-size: .6rem; +} + +.message-separator { + visibility: hidden; +} + +.sub-section-title { + font-style: italic; + font-size: 14px; +} diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 5ad72f9..bc21b45 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -12,10 +12,10 @@ nav: - getting-started.md - API Reference: - api-reference/index.md - - api-reference/difficalcy-osu.md - - api-reference/difficalcy-taiko.md - - api-reference/difficalcy-catch.md - - api-reference/difficalcy-mania.md + - difficalcy-osu: api-reference/difficalcy-osu.md + - difficalcy-taiko: api-reference/difficalcy-taiko.md + - difficalcy-catch: api-reference/difficalcy-catch.md + - difficalcy-mania: api-reference/difficalcy-mania.md theme: name: material @@ -48,3 +48,14 @@ markdown_extensions: - pymdownx.highlight: anchor_linenums: true - pymdownx.superfences + - pymdownx.details + - pymdownx.tabbed: + alternate_style: true + +plugins: + - search + - neoteroi.mkdocsoad: + use_pymdownx: true + +extra_css: + - "css/mkdocsoad.css" diff --git a/docs/requirements.txt b/docs/requirements.txt index 6e4d182..98ec0c2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,17 +1,26 @@ +anyio==4.3.0 Babel==2.14.0 certifi==2024.2.2 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 +essentials==1.1.5 +essentials-openapi==1.0.9 ghp-import==2.1.0 +h11==0.14.0 +httpcore==1.0.5 +httpx==0.27.0 idna==3.7 Jinja2==3.1.3 Markdown==3.6 +markdown-it-py==3.0.0 MarkupSafe==2.1.5 +mdurl==0.1.2 mergedeep==1.3.4 mkdocs==1.5.3 mkdocs-material==9.5.18 mkdocs-material-extensions==1.3.1 +neoteroi-mkdocs==1.0.5 packaging==24.0 paginate==0.5.6 pathspec==0.12.1 @@ -23,6 +32,8 @@ PyYAML==6.0.1 pyyaml_env_tag==0.1 regex==2024.4.16 requests==2.31.0 +rich==13.7.1 six==1.16.0 +sniffio==1.3.1 urllib3==2.2.1 watchdog==4.0.0