aboutsummaryrefslogtreecommitdiff
path: root/Scalar.html
blob: f5280a1340175b9da2fcfe5a861acaba959c8914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<html>
<head>
    <title>Scalar</title>
    <meta charset="utf-8"/>
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1"/>
</head>
<body>

<script
        id="api-reference"
        type="application/json">
    {"openapi":"3.1.0","info":{"title":"ITMO queue server API","description":"Queuing service for labs works","license":{"name":"AGPL-3.0","url":"https://www.gnu.org/licenses/agpl-3.0.en.html#license-text"},"version":"1.0.0"},"servers":[{"url":"http://localhost:{port}/","description":"Local server","variables":{"port":{"default":"8888","description":"Server port"}}},{"url":"https://очередь.псж.онлайн/api/v1/","description":"Production server"}],"paths":{"/account/me":{"get":{"tags":["Account"],"summary":"Get me","operationId":"me","responses":{"200":{"description":"Success response with your account data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_Account"}}}},"400":{"description":"General response for invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Fail":{"value":{"status":"fail","kind":"SomeFailKind","message":"some fail message"}}}}}},"500":{"description":"General response when a server error occurs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Error":{"value":{"status":"error","kind":"SomeErrorKind","message":"some error message"}}}}}}},"security":[{"auth":[]}]}},"/account/register":{"post":{"tags":["Account"],"summary":"Register","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Success response with created account data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_Account"}}}},"400":{"description":"General response for invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Fail":{"value":{"status":"fail","kind":"SomeFailKind","message":"some fail message"}}}}}},"500":{"description":"General response when a server error occurs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Error":{"value":{"status":"error","kind":"SomeErrorKind","message":"some error message"}}}}}}}}},"/account/login":{"post":{"tags":["Account"],"summary":"Login","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Success response with auth token data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_Token"}}}},"400":{"description":"General response for invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Fail":{"value":{"status":"fail","kind":"SomeFailKind","message":"some fail message"}}}}}},"500":{"description":"General response when a server error occurs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Error":{"value":{"status":"error","kind":"SomeErrorKind","message":"some error message"}}}}}}}}},"/account/change/password":{"put":{"tags":["Account"],"summary":"Change password","operationId":"change_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Success response with changed account data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_Account"}}}},"400":{"description":"General response for invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Fail":{"value":{"status":"fail","kind":"SomeFailKind","message":"some fail message"}}}}}},"500":{"description":"General response when a server error occurs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Error":{"value":{"status":"error","kind":"SomeErrorKind","message":"some error message"}}}}}}},"security":[{"auth":[]}]}},"/account/delete":{"delete":{"tags":["Account"],"summary":"Delete","operationId":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserRequest"}}},"required":true},"responses":{"200":{"description":"Success response with deleted account data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_Account"}}}},"400":{"description":"General response for invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Fail":{"value":{"status":"fail","kind":"SomeFailKind","message":"some fail message"}}}}}},"500":{"description":"General response when a server error occurs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Error":{"value":{"status":"error","kind":"SomeErrorKind","message":"some error message"}}}}}}},"security":[{"auth":[]}]}}},"components":{"schemas":{"Account":{"type":"object","description":"Account information","required":["id","username","first_name","last_name"],"properties":{"id":{"type":"integer","format":"int64","examples":[1]},"username":{"type":"string","examples":["john_doe","ivanov_ivan"]},"first_name":{"type":"string","examples":["John","Иван"]},"last_name":{"type":"string","examples":["Doe","Иванов"]}}},"ChangePasswordRequest":{"type":"object","description":"Change account password data","required":["old_password","new_password"],"properties":{"old_password":{"type":"string","examples":["secret-password"]},"new_password":{"type":"string","examples":["super-secret-password"]}}},"DeleteUserRequest":{"type":"object","description":"Account delete data","required":["password"],"properties":{"password":{"type":"string","examples":["secret-password"]}}},"ErrorResponse":{"type":"object","required":["status","kind","message"],"properties":{"status":{"$ref":"#/components/schemas/ErrorStatus"},"kind":{"type":"string","examples":["SomeErrorKind","NotAuthorized","Database"]},"message":{"type":"string","examples":["some error text"]}}},"ErrorStatus":{"type":"string","enum":["fail","error"],"examples":["fail or error"]},"LoginRequest":{"type":"object","description":"Account login data","required":["username","password"],"properties":{"username":{"type":"string","examples":["john_doe","ivanov_ivan"]},"password":{"type":"string","examples":["secret-password"]},"token_lifetime":{"oneOf":[{"$ref":"#/components/schemas/TokenLifetime"}],"default":"WEEK"}}},"RegisterRequest":{"type":"object","description":"Account register data","required":["username","password","first_name","last_name"],"properties":{"username":{"type":"string","examples":["john_doe","ivanov_ivan"]},"password":{"type":"string","examples":["secret-password"]},"first_name":{"type":"string","examples":["John","Иван"]},"last_name":{"type":"string","examples":["Doe","Иванов"]}}},"SuccessResponse_Account":{"type":"object","required":["status","data"],"properties":{"status":{"$ref":"#/components/schemas/SuccessStatus"},"data":{"type":"object","description":"Account information","required":["id","username","first_name","last_name"],"properties":{"id":{"type":"integer","format":"int64","examples":[1]},"username":{"type":"string","examples":["john_doe","ivanov_ivan"]},"first_name":{"type":"string","examples":["John","Иван"]},"last_name":{"type":"string","examples":["Doe","Иванов"]}}}}},"SuccessResponse_Token":{"type":"object","required":["status","data"],"properties":{"status":{"$ref":"#/components/schemas/SuccessStatus"},"data":{"type":"object","description":"Authorization token information","required":["token","expired_at"],"properties":{"token":{"type":"string"},"expired_at":{"type":"string","format":"date-time"}}}}},"SuccessStatus":{"type":"string","enum":["success"]},"Token":{"type":"object","description":"Authorization token information","required":["token","expired_at"],"properties":{"token":{"type":"string"},"expired_at":{"type":"string","format":"date-time"}}},"TokenLifetime":{"type":"string","description":"Account token life time","enum":["DAY","WEEK","MONTH"]}},"securitySchemes":{"auth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"tags":[{"name":"Account","description":"Account management methods"}]}
</script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
</body>
</html>