added api docs

This commit is contained in:
Arseni
2026-02-24 21:26:31 +03:00
parent 0646f55189
commit fa54088b25
87 changed files with 2299 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
post:
tags: [Accounts, Auth]
summary: Login using email/password and receive pending verification token
operationId: accountsLogin
requestBody:
$ref: ./bodies/auth.yaml#/components/requestBodies/LoginBody
responses:
'202':
description: Pending verification token issued
content:
application/json:
schema:
allOf:
- $ref: ../response/response.yaml#/components/schemas/BaseResponse
- type: object
properties:
data:
$ref: ./response/auth.yaml#/components/schemas/PendingLoginData
'400':
$ref: ../response/operation.yaml#/components/responses/BadRequest
'401':
$ref: ../response/operation.yaml#/components/responses/Unauthorized
'403':
$ref: ../response/operation.yaml#/components/responses/Forbidden
'500':
$ref: ../response/operation.yaml#/components/responses/InternalServerError

View File

@@ -0,0 +1,28 @@
post:
tags: [Accounts, Auth]
summary: Refresh access token by refresh token
operationId: accountsRefreshAccessToken
requestBody:
$ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody
responses:
'200':
description: Access token refreshed
content:
application/json:
schema:
allOf:
- $ref: ../response/response.yaml#/components/schemas/BaseResponse
- type: object
properties:
data:
$ref: ./response/auth.yaml#/components/schemas/AccountAuthData
'400':
$ref: ../response/operation.yaml#/components/responses/BadRequest
'401':
$ref: ../response/operation.yaml#/components/responses/Unauthorized
'403':
$ref: ../response/operation.yaml#/components/responses/Forbidden
'404':
$ref: ../response/operation.yaml#/components/responses/NotFound
'500':
$ref: ../response/operation.yaml#/components/responses/InternalServerError

View File

@@ -0,0 +1,28 @@
post:
tags: [Accounts, Auth]
summary: Rotate refresh token and issue new access/refresh tokens
operationId: accountsRotateRefreshToken
requestBody:
$ref: ./bodies/auth.yaml#/components/requestBodies/RefreshTokenBody
responses:
'200':
description: New token pair issued
content:
application/json:
schema:
allOf:
- $ref: ../response/response.yaml#/components/schemas/BaseResponse
- type: object
properties:
data:
$ref: ./response/auth.yaml#/components/schemas/LoginData
'400':
$ref: ../response/operation.yaml#/components/responses/BadRequest
'401':
$ref: ../response/operation.yaml#/components/responses/Unauthorized
'403':
$ref: ../response/operation.yaml#/components/responses/Forbidden
'404':
$ref: ../response/operation.yaml#/components/responses/NotFound
'500':
$ref: ../response/operation.yaml#/components/responses/InternalServerError

View File

@@ -0,0 +1,15 @@
components:
requestBodies:
LoginBody:
required: true
content:
application/json:
schema:
$ref: ../request/auth.yaml#/components/schemas/LoginRequest
RefreshTokenBody:
required: true
content:
application/json:
schema:
$ref: ../request/auth.yaml#/components/schemas/RefreshTokenRequest

View File

@@ -0,0 +1,17 @@
components:
schemas:
LoginRequest:
type: object
additionalProperties: false
required:
- login
properties:
clientId:
type: string
deviceId:
type: string
login:
$ref: ../../../models/auth/login_data.yaml#/components/schemas/LoginData
RefreshTokenRequest:
$ref: ../../../models/auth/client_refresh_token.yaml#/components/schemas/ClientRefreshToken

View File

@@ -0,0 +1,49 @@
components:
schemas:
AccountAuthData:
type: object
additionalProperties: false
required:
- accessToken
- account
properties:
accessToken:
$ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData
account:
$ref: ../../../models/account/account.yaml#/components/schemas/AccountData
LoginData:
type: object
additionalProperties: false
required:
- accessToken
- account
- refreshToken
properties:
accessToken:
$ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData
account:
$ref: ../../../models/account/account.yaml#/components/schemas/AccountData
refreshToken:
$ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData
PendingLoginData:
type: object
additionalProperties: false
required:
- account
- pendingToken
- target
properties:
account:
type: object
additionalProperties: false
properties:
accessToken:
$ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData
account:
$ref: ../../../models/account/account.yaml#/components/schemas/AccountData
pendingToken:
$ref: ../../../models/auth/token_data.yaml#/components/schemas/TokenData
target:
type: string