248 lines
8.8 KiB
YAML
248 lines
8.8 KiB
YAML
# Generated with protoc-gen-openapi
|
|
# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi
|
|
|
|
openapi: 3.0.3
|
|
info:
|
|
title: AdminService API
|
|
description: AdminService is the admin service definition.
|
|
version: 0.0.1
|
|
paths:
|
|
/v1/admins/create:
|
|
post:
|
|
tags:
|
|
- AdminService
|
|
description: CreateAdmin creates a new admin.
|
|
operationId: AdminService_CreateAdmin
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
/v1/admins/current:
|
|
get:
|
|
tags:
|
|
- AdminService
|
|
description: Current returns the currently logged-in user.
|
|
operationId: AdminService_Current
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
/v1/admins/list:
|
|
get:
|
|
tags:
|
|
- AdminService
|
|
description: ListAdmins returns a list of admins.
|
|
operationId: AdminService_ListAdmins
|
|
parameters:
|
|
- name: pageSize
|
|
in: query
|
|
description: Optional. The number of admins per page.
|
|
schema:
|
|
type: integer
|
|
format: int32
|
|
- name: pageToken
|
|
in: query
|
|
description: Optional. The page token.
|
|
schema:
|
|
type: string
|
|
- name: filter
|
|
in: query
|
|
description: |-
|
|
Optional. The standard list filter.
|
|
Supported fields:
|
|
* `name` (i.e. `name="John Doe"`)
|
|
* `create_time` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
|
|
the timestamp is in RFC 3339 format)
|
|
|
|
More detail in [AIP-160](https://google.aip.dev/160).
|
|
schema:
|
|
type: string
|
|
- name: orderBy
|
|
in: query
|
|
description: |-
|
|
Optional. A comma-separated list of fields to order by, sorted in ascending
|
|
order. Use "desc" after a field name for descending. Supported fields:
|
|
- `create_time`
|
|
|
|
Example: `create_time desc`.
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.AdminSet'
|
|
/v1/admins/login:
|
|
post:
|
|
tags:
|
|
- AdminService
|
|
description: Login a user and return the username.
|
|
operationId: AdminService_Login
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.LoginRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
/v1/admins/logout:
|
|
post:
|
|
tags:
|
|
- AdminService
|
|
description: Logout the currently logged-in user.
|
|
operationId: AdminService_Logout
|
|
requestBody:
|
|
content:
|
|
application/json: {}
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content: {}
|
|
/v1/admins/update:
|
|
put:
|
|
tags:
|
|
- AdminService
|
|
description: UpdateAdmin updates an existing admin.
|
|
operationId: AdminService_UpdateAdmin
|
|
parameters:
|
|
- name: updateMask
|
|
in: query
|
|
description: Required. Mask of fields to update.
|
|
schema:
|
|
type: string
|
|
format: field-mask
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
/v1/admins/{id}:
|
|
get:
|
|
tags:
|
|
- AdminService
|
|
description: GetAdmin retrieves an admin by ID.
|
|
operationId: AdminService_GetAdmin
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: The ID of the admin to retrieve.
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
delete:
|
|
tags:
|
|
- AdminService
|
|
description: DeleteAdmin deletes an admin by ID.
|
|
operationId: AdminService_DeleteAdmin
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Required. The ID of the admin to delete.
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content: {}
|
|
components:
|
|
schemas:
|
|
kratos.admin.v1.Admin:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: The unique ID of the user.
|
|
name:
|
|
type: string
|
|
description: The name of the user.
|
|
email:
|
|
type: string
|
|
description: The email of the user.
|
|
phone:
|
|
type: string
|
|
description: The phone number of the user.
|
|
avatar:
|
|
type: string
|
|
description: The avatar URL of the user.
|
|
access:
|
|
type: string
|
|
description: |-
|
|
The access level of the user.
|
|
Possible values are: "admin", "user", etc.
|
|
password:
|
|
type: string
|
|
description: The password of the user.
|
|
createTime:
|
|
type: string
|
|
description: The timestamp at which the user was created.
|
|
format: date-time
|
|
updateTime:
|
|
type: string
|
|
description: The latest timestamp at which the user was updated.
|
|
format: date-time
|
|
description: Admin is the admin message.
|
|
kratos.admin.v1.AdminSet:
|
|
type: object
|
|
properties:
|
|
admins:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/kratos.admin.v1.Admin'
|
|
description: The set of admins.
|
|
nextPageToken:
|
|
type: string
|
|
description: The next page token.
|
|
description: AdminSet is the set of admins.
|
|
kratos.admin.v1.LoginRequest:
|
|
required:
|
|
- password
|
|
type: object
|
|
properties:
|
|
password:
|
|
type: string
|
|
description: Required. Password of the user.
|
|
username:
|
|
type: string
|
|
email:
|
|
type: string
|
|
description: LoginRequest is the request message for the Login method.
|
|
tags:
|
|
- name: AdminService
|