mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 04:19:06 +08:00
1041 lines
22 KiB
JSON
1041 lines
22 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"version": "1.0.0",
|
|
"title": "Monkeytype",
|
|
"termsOfService": "http://monkeytype.com/terms-of-service",
|
|
"contact": {
|
|
"name": "Developer",
|
|
"email": "jack@monkeytype.com"
|
|
}
|
|
},
|
|
"host": "api.monkeytype.com",
|
|
"basePath": "/",
|
|
"schemes": ["https"],
|
|
"consumes": ["application/json"],
|
|
"produces": ["application/json"],
|
|
"tags": [
|
|
{
|
|
"name": "index",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "users",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "psas",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "presets",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "configs",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "ape-keys",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "leaderboards",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "results",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "quotes",
|
|
"description": ""
|
|
}
|
|
],
|
|
"paths": {
|
|
"/": {
|
|
"get": {
|
|
"tags": ["index"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/name": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/signup": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"uid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/checkName/{name}": {
|
|
"get": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"description": "",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/leaderboardMemory": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"mode": {
|
|
"type": "string"
|
|
},
|
|
"mode2": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"rank": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/discord/link": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tokenType": {
|
|
"type": "string"
|
|
},
|
|
"accessToken": {
|
|
"type": "string"
|
|
},
|
|
"uid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/discord/unlink": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/email": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"newEmail": {
|
|
"type": "string"
|
|
},
|
|
"previousEmail": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/personalBests": {
|
|
"delete": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags": {
|
|
"get": {
|
|
"tags": ["tags"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tagName": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tagId": {
|
|
"type": "string"
|
|
},
|
|
"newName": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags/{tagId}": {
|
|
"delete": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "tagId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags/{tagId}/personalBest": {
|
|
"delete": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "tagId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/psas": {
|
|
"get": {
|
|
"tags": ["psas"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/presets": {
|
|
"get": {
|
|
"tags": ["presets"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["presets"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"config": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": ["presets"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"config": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/presets/{presetId}": {
|
|
"delete": {
|
|
"tags": ["presets"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "presetId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/configs": {
|
|
"get": {
|
|
"tags": ["configs"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": ["configs"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"config": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ape-keys": {
|
|
"get": {
|
|
"tags": ["ape-keys"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["ape-keys"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ape-keys/{apeKeyId}": {
|
|
"patch": {
|
|
"tags": ["ape-keys"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "apeKeyId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["ape-keys"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "apeKeyId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/leaderboards": {
|
|
"get": {
|
|
"tags": ["leaderboards"],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "language",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "mode",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "mode2",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "skip",
|
|
"type": "number"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "limit",
|
|
"type": "number"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/leaderboards/rank": {
|
|
"get": {
|
|
"tags": ["leaderboards"],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "language",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "mode",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "mode2",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/results": {
|
|
"get": {
|
|
"tags": ["results"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["results"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"result": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["results"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/results/tags": {
|
|
"patch": {
|
|
"tags": ["results"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tagIds": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"resultId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/quotes": {
|
|
"get": {
|
|
"tags": ["quotes"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"type": "string"
|
|
},
|
|
"source": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/quotes/approve": {
|
|
"post": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quoteId": {
|
|
"type": "string"
|
|
},
|
|
"editText": {
|
|
"type": "string"
|
|
},
|
|
"editSource": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/quotes/reject": {
|
|
"post": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quoteId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/quotes/rating": {
|
|
"get": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quoteId": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quoteId": {
|
|
"type": "string"
|
|
},
|
|
"rating": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/quotes/report": {
|
|
"post": {
|
|
"tags": ["quotes"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quoteId": {
|
|
"type": "string"
|
|
},
|
|
"quoteLanguage": {
|
|
"type": "string"
|
|
},
|
|
"reason": {
|
|
"type": "string"
|
|
},
|
|
"comment": {
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Response": {
|
|
"type": "object",
|
|
"required": ["error", "message"],
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"data": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|