added api docs
This commit is contained in:
26
interface/api/accounts/auth_login.yaml
Normal file
26
interface/api/accounts/auth_login.yaml
Normal 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
|
||||
28
interface/api/accounts/auth_refresh.yaml
Normal file
28
interface/api/accounts/auth_refresh.yaml
Normal 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
|
||||
28
interface/api/accounts/auth_rotate.yaml
Normal file
28
interface/api/accounts/auth_rotate.yaml
Normal 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
|
||||
15
interface/api/accounts/bodies/auth.yaml
Normal file
15
interface/api/accounts/bodies/auth.yaml
Normal 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
|
||||
17
interface/api/accounts/request/auth.yaml
Normal file
17
interface/api/accounts/request/auth.yaml
Normal 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
|
||||
49
interface/api/accounts/response/auth.yaml
Normal file
49
interface/api/accounts/response/auth.yaml
Normal 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
|
||||
Reference in New Issue
Block a user