diff options
| author | 2025-03-10 09:24:37 +0000 | |
|---|---|---|
| committer | 2025-03-10 10:24:37 +0100 | |
| commit | 3db5bfa0f2d7528324c2fd6ae6d49d20da24eecf (patch) | |
| tree | a9d0d3adac68afd93960fcf91f264828b273033f /docs/locales/zh/api/swagger.yaml | |
| parent | [chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc... (diff) | |
| download | gotosocial-3db5bfa0f2d7528324c2fd6ae6d49d20da24eecf.tar.xz | |
[docs/zh] update zh docs: synced to 98c4cae + fix typo (#3884)
* [docs/zh] update zh docs: synced to 98c4cae8
* fix typo
* sync the support matrix in README
* update mkdocs.yml: add new article
Diffstat (limited to 'docs/locales/zh/api/swagger.yaml')
| -rw-r--r-- | docs/locales/zh/api/swagger.yaml | 521 |
1 files changed, 364 insertions, 157 deletions
diff --git a/docs/locales/zh/api/swagger.yaml b/docs/locales/zh/api/swagger.yaml index 3ac20cbfa..3ba31a8af 100644 --- a/docs/locales/zh/api/swagger.yaml +++ b/docs/locales/zh/api/swagger.yaml @@ -851,6 +851,19 @@ definitions: example: https://example.org/callback?some=query type: string x-go-name: RedirectURI + redirect_uris: + description: 授权后重定向的 URI 列表,用于应用程序 (OAuth2)。 + example: '[https://example.org/callback?some=query]' + items: + type: string + type: array + x-go-name: RedirectURIs + scopes: + description: 应用的 OAuth 授权范围。 + items: + type: string + type: array + x-go-name: Scopes vapid_key: description: 用于推送 API 的密钥。 type: string @@ -3008,6 +3021,13 @@ definitions: example: <p>这是一条嘟文。</p> type: string x-go-name: Content + content_type: + description: |- + 用于解析帖文文本的内容格式。 + 当帖文被删除时会返回该值,因此如果用户重新撰写消息, + 客户端可以默认使用相同的内容格式。 + type: string + x-go-name: ContentType created_at: description: 此修订版本创建的时间 (ISO 8601 Datetime)。 example: "2021-07-30T09:20:25+00:00" @@ -3057,6 +3077,13 @@ definitions: example: <p>这是一条嘟文。</p> type: string x-go-name: Content + content_type: + description: |- + 用于解析帖文文本的内容格式。 + 当帖文被删除时会返回该值,因此如果用户重新撰写消息, + 客户端可以默认使用相同的内容格式。 + type: string + x-go-name: ContentType created_at: description: 此贴文的创建时间 (ISO 8601 Datetime)。 example: "2021-07-30T09:20:25+00:00" @@ -3199,6 +3226,10 @@ definitions: description: |- StatusSource 表示创建贴文时提交给 API 的贴文源文本。 properties: + content_type: + description: 用于解析贴文文本的内容格式。 + type: string + x-go-name: ContentType id: description: 贴文的 ID。 example: 01FBVD42CQ3ZEEVMW180SBX03B @@ -3383,6 +3414,39 @@ definitions: type: object x-go-name: ThreadContext x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + tokenInfo: + description: |- + TokenInfo 表示与用户关联的访问令牌的元数据。 + 实际的访问令牌将永远不会通过 API 发送。 + properties: + application: + $ref: '#/definitions/application' + created_at: + description: 此令牌的创建时间(ISO 8601 Datetime)。 + example: "2021-07-30T09:20:25+00:00" + type: string + x-go-name: CreatedAt + id: + description: 此令牌的数据库 ID。 + example: 01JMW7QBAZYZ8T8H73PCEX12XG + type: string + x-go-name: ID + last_used: + description: |- + 上一次使用此令牌的大致时间(精确到小时内,格式为 ISO 8601 Datetime)。 + 如果该令牌从未使用过,或者无法确定其上一次使用的时间(例如,在记录“last_used”之前就已使用过),则会省略此项。 + example: "2021-07-30T09:20:25+00:00" + type: string + x-go-name: LastUsed + scope: + description: 此令牌被授予的 OAuth 权限范围,以空格分隔。 + example: read write admin + type: string + x-go-name: Scope + title: TokenInfo + type: object + x-go-name: TokenInfo + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model user: properties: admin: @@ -3622,7 +3686,7 @@ info: name: AGPL3 url: https://www.gnu.org/licenses/agpl-3.0.zh-cn.html title: GoToSocial Swagger 文档 - version: 0.18.0-SNAPSHOT-e10de846 + version: 0.18.2-SNAPSHOT-98c4cae8 paths: /.well-known/host-meta: get: @@ -4366,7 +4430,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:accounts + - read:statuses summary: 查看贴文 tags: - accounts @@ -5055,7 +5119,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:accounts summary: 查看账户 tags: - admin @@ -5089,7 +5153,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:accounts summary: 查看单个账户 description: 查看一个账户。 tags: @@ -5135,7 +5199,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:accounts summary: 执行管理操作 description: 对某个账户执行管理员操作。 tags: @@ -5170,7 +5234,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:accounts summary: 批准账户 description: 批准待处理的账户。 tags: @@ -5217,7 +5281,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:accounts summary: 拒绝账户 description: 拒绝待处理的账户。 tags: @@ -5298,6 +5362,9 @@ paths: description: not acceptable 不可接受 "500": description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: + - admin:read summary: 查看表情 tags: - admin @@ -5344,7 +5411,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 创建表情 description: 上传和创建一个新的实例表情。 tags: @@ -5387,7 +5454,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 删除表情 tags: - admin @@ -5418,6 +5485,9 @@ paths: description: not acceptable 不可接受 "500": description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: + - admin:read summary: 查看表情 description: 在管理视图中查看单个表情。 tags: @@ -5490,7 +5560,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 修改表情 tags: - admin @@ -5518,6 +5588,9 @@ paths: description: not acceptable 不可接受 "500": description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: + - admin:read summary: 查看表情类别 description: 获取现有表情类别的列表。 tags: @@ -5551,7 +5624,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 解析 ActivityPub URL tags: - debug @@ -5576,7 +5649,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 清除缓存 tags: - debug @@ -5611,7 +5684,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:domain_allows summary: 查看实例白名单 description: 查看当前所有被允许联合的域名。 tags: @@ -5675,7 +5748,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:domain_allows summary: 创建实例白名单 tags: - admin @@ -5711,7 +5784,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:domain_allows summary: 删除实例白名单条目 description: 删除具有给定 ID 的实例白名单条目。 tags: @@ -5745,7 +5818,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:domain_allows summary: 查看实例白名单条目 description: 查看具有给定 ID 的实例白名单条目。 tags: @@ -5781,7 +5854,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:domain_blocks summary: 查看实例黑名单 description: 查看当前所有实例黑名单。 tags: @@ -5845,7 +5918,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:domain_blocks summary: 创建实例黑名单 tags: - admin @@ -5881,7 +5954,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:domain_blocks summary: 删除实例黑名单条目 description: 删除具有给定 ID 的实例黑名单条目。 tags: @@ -5915,7 +5988,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:domain_blocks summary: 查看实例黑名单条目 description: 查看具有给定 ID 的实例黑名单条目。 tags: @@ -5964,7 +6037,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 吊销实例密钥 tags: - admin @@ -6037,7 +6110,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 查看域名权限草案。 tags: - admin @@ -6088,7 +6161,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 使用给定参数创建一条域名权限草案。 tags: - admin @@ -6120,7 +6193,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 获取具有给定 ID 的域名权限草案。 tags: - admin @@ -6162,7 +6235,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 接受一条域名权限草案,将其转换为会得到强制执行的域名权限。 tags: - admin @@ -6204,7 +6277,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 移除一条域名权限草案,可选择忽略所有之后的针对给定域名的草案。 tags: - admin @@ -6268,7 +6341,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 查看域名权限例外条目。 tags: - admin @@ -6310,7 +6383,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 使用给定参数创建一个域名权限例外条目。 tags: - admin @@ -6344,7 +6417,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 移除一个域名权限例外条目。 tags: - admin @@ -6375,7 +6448,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 获取具有给定 ID 的域名权限例外条目。 tags: - admin @@ -6440,7 +6513,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 查看域名权限订阅列表 tags: - admin @@ -6515,7 +6588,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 创建域名权限订阅 description: 使用给定参数创建一个新的域名权限订阅。 tags: @@ -6589,7 +6662,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 更新域名权限订阅 description: 使用给定参数更新一个域名权限订阅。 tags: @@ -6622,7 +6695,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 获取指定域名权限订阅 description: 获取具有给定 ID 的单个域名权限订阅。 tags: @@ -6667,7 +6740,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 删除单个域名权限订阅 tags: - admin @@ -6709,7 +6782,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 测试单个域名权限订阅 tags: - admin @@ -6746,7 +6819,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 预览全部域名权限订阅 tags: - admin @@ -6792,7 +6865,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 测试电子邮件 tags: - admin @@ -6818,7 +6891,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 查看标头放行规则 description: 查看当前所有 "allow" (放行) 过滤规则。 tags: @@ -6863,7 +6936,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 创建标头放行规则 tags: - admin @@ -6891,7 +6964,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 删除标头放行规则 description: 删除具有给定 ID 的 "allow" (放行) 标头过滤规则。 tags: @@ -6921,7 +6994,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 获取单个标头放行规则 description: 获取具有给定 ID 的 "allow" (放行) 标头过滤规则。 tags: @@ -6948,7 +7021,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 查看标头阻止规则 description: 获取目前所有的 "block" (阻止) 标头过滤规则。 tags: @@ -6993,7 +7066,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 创建标头阻止规则 tags: - admin @@ -7021,7 +7094,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 删除标头阻止规则 description: 删除具有给定 ID 的 "block" (阻止) 标头过滤规则。 tags: @@ -7051,12 +7124,40 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read summary: 获取单个标头阻止规则 description: 获取具有给定 ID 的 "block" (阻止) 标头过滤规则。 tags: - admin /api/v1/admin/instance/rules: + get: + description: 实例规则将按 Order 升序返回。 + operationId: adminsRuleGet + produces: + - application/json + responses: + "200": + description: 本站实例的所有规则组成的数组。 + schema: + items: + $ref: '#/definitions/instanceRule' + type: array + "400": + description: bad request 无效请求 + "401": + description: unauthorized 未授权 + "404": + description: not found 未找到 + "406": + description: not acceptable 不可接受 + "500": + description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: + - admin:read + summary: 查看实例规则(含ID) + tags: + - admin post: consumes: - multipart/form-data @@ -7089,7 +7190,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 创建实例规则 description: 创建一条新的实例规则。 tags: @@ -7126,11 +7227,42 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 删除实例规则 description: 删除一条现有的实例规则。 tags: - admin + get: + operationId: adminRuleGet + parameters: + - description: 要获取的实例规则的 ID。 + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 要获取的实例规则。 + schema: + $ref: '#/definitions/instanceRule' + "400": + description: bad request 无效请求 + "401": + description: unauthorized 未授权 + "404": + description: not found 未找到 + "406": + description: not acceptable 不可接受 + "500": + description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: + - admin:read + summary: 获取单条实例规则 + tags: + - admin patch: consumes: - multipart/form-data @@ -7169,7 +7301,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 更新实例规则 description: 更新一条现有的实例规则。 tags: @@ -7210,7 +7342,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 清理媒体 tags: - admin @@ -7245,7 +7377,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 重新获取媒体 tags: - admin @@ -7321,7 +7453,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:reports summary: 查看用户举报 tags: - admin @@ -7353,7 +7485,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:reports summary: 查看单个用户举报 description: 查看具有给定 ID 的用户举报。 tags: @@ -7395,73 +7527,11 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write:reports summary: 处理用户举报 description: 将具有给定 ID 的用户举报标记为已处理。 tags: - admin - /api/v1/admin/rules: - get: - description: 查看实例规则及其 ID。实例规则将按顺序返回(按 Order 升序排序)。 - operationId: adminsRuleGet - produces: - - application/json - responses: - "200": - description: 本站实例的所有规则组成的数组。 - schema: - items: - $ref: '#/definitions/instanceRule' - type: array - "400": - description: bad request 无效请求 - "401": - description: unauthorized 未授权 - "404": - description: not found 未找到 - "406": - description: not acceptable 不可接受 - "500": - description: internal server error 服务器内部错误 - security: - - OAuth2 Bearer: - - admin - summary: 查看实例规则 - tags: - - admin - /api/v1/admin/rules/{id}: - get: - operationId: adminRuleGet - parameters: - - description: 实例规则的 ID。 - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: 请求的规则。 - schema: - $ref: '#/definitions/instanceRule' - "400": - description: bad request 无效请求 - "401": - description: unauthorized 未授权 - "404": - description: not found 未找到 - "406": - description: not acceptable 不可接受 - "500": - description: internal server error 服务器内部错误 - security: - - OAuth2 Bearer: - - admin - summary: 查看单个实例规则 - description: 查看具有给定 ID 的实例规则。 - tags: - - admin /api/v1/announcements: get: operationId: announcementsGet @@ -7484,8 +7554,7 @@ paths: "500": description: internal server error 服务器内部错误 security: - - OAuth2 Bearer: - - read:announcements + - OAuth2 Bearer: [] summary: 获取公告 description: '以数组形式获取当前生效的公告。此端点目前尚未完全实现:它将无条件返回一个空数组。' tags: @@ -7512,16 +7581,17 @@ paths: type: string x-go-name: ClientName - description: |- - 用户在授权后应重定向到何处。 + 单个重定向 URI 或以换行符分隔的重定向 URI 列表(可选)。 若要向用户显示授权代码而不是重定向到网页,请在此参数中使用 `urn:ietf:wg:oauth:2.0:oob`。 + + 如果未提供重定向 URI,则默认为 `urn:ietf:wg:oauth:2.0:oob`。 in: formData name: redirect_uris - required: true type: string x-go-name: RedirectURIs - description: |- - 授权范围,以空格分隔的列表。 + 授权范围,以空格分隔的列表(可选)。 如果未提供范围,则默认为 `read`。 in: formData @@ -7805,8 +7875,7 @@ paths: "500": description: internal server error 服务器内部错误 security: - - OAuth2 Bearer: - - read:custom_emojis + - OAuth2 Bearer: [] summary: 获取自定义表情 description: 获取本实例可用的自定义表情数组。 tags: @@ -7848,7 +7917,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:follows + - read:accounts summary: 导出粉丝列表 description: 导出你的粉丝的 CSV 文件。 tags: @@ -7934,7 +8003,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:account + - read:accounts summary: 查看导出统计信息 description: 返回对应账户有关可以导出的项目数量的统计信息。 tags: @@ -8494,7 +8563,7 @@ paths: type: file - description: |- 此数据文件中包含的条目类型: - - `following` - 要关注的账户。 - `blocks` - 要屏蔽的账户。 + - `following` - 要关注的账户。 - `blocks` - 要屏蔽的账户。 - `mutes` - 要隐藏的账户。 in: formData name: type required: true @@ -8521,7 +8590,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - write:accounts + - write summary: 导入数据 tags: - import-export @@ -8615,7 +8684,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:write summary: 更新实例信息 tags: - instance @@ -8667,6 +8736,8 @@ paths: description: not acceptable 不可接受 "500": description: internal server error 服务器内部错误 + security: + - OAuth2 Bearer: [] tags: - instance /api/v1/instance/rules: @@ -9758,7 +9829,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:notifications + - write:notifications summary: 清空通知 tags: - notifications @@ -10280,7 +10351,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:reports + - read:accounts summary: 获取举报列表 tags: - reports @@ -10393,7 +10464,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - read:reports + - read:accounts summary: 获取单条举报 description: 获取具有给定 ID 的举报。 tags: @@ -10519,10 +10590,13 @@ paths: x-go-name: Federated - description: |- 此贴文的计划发布时间,格式为 ISO 8601 Datetime。 - 提供此参数将导致返回 ScheduledStatus 而不是 Status。 - 必须至少在未来 5 分钟之后。 + 如果使用 *未来* 的时间设置该参数,将返回 ScheduledStatus 而不是 Status。 + 且时间必须至少在当前时间之后 5 分钟。 + 此功能尚未实现。 - 此功能尚未实现;尝试设置它将返回 501 Not Implemented。 + 如果使用 *过去* 的时间设置该参数,则对应的帖文将被标记为历史帖文, + 且不会推送给用户的关注者。这主要用于导入旧帖文。 + format: date-time in: formData name: scheduled_at type: string @@ -10532,7 +10606,7 @@ paths: name: language type: string x-go-name: Language - - description: 解析此贴文时使用的内容类型。 + - description: 解析此贴文时使用的内容格式。 enum: - text/plain - text/markdown @@ -10662,7 +10736,7 @@ paths: name: language type: string x-go-name: Language - - description: 解析此贴文时使用的内容类型。 + - description: 解析此贴文时使用的内容格式。 enum: - text/plain - text/markdown @@ -10797,7 +10871,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - write:statuses + - write:bookmarks summary: 收藏贴文 description: 收藏具有给定 ID 的贴文。 tags: @@ -11165,7 +11239,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - write:statuses + - write:bookmarks summary: 取消收藏贴文 description: 取消收藏给定 ID 的贴文。 tags: @@ -11200,7 +11274,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - write:statuses + - write:favourites summary: 取消点赞贴文 description: 取消点赞给定 ID 的贴文。 tags: @@ -11450,8 +11524,7 @@ paths: "500": description: internal server error 服务器内部错误 security: - - OAuth2 Bearer: - - read:follows + - OAuth2 Bearer: [] summary: 获取话题标签 tags: - tags @@ -11764,6 +11837,128 @@ paths: summary: 查看话题标签时间线 tags: - timelines + /api/v1/tokens: + get: + description: |- + 查看由/为你的账户创建的令牌的相关信息。 + + 条目将按时间降序返回(最新的在前),并带有顺序 ID(数值越大表示越新)。 + + 返回的 Link 标头可用于在向上或向下翻页时生成上一页和下一页的查询。 + + 例如: + + + ``` + <https://example.org/api/v1/tokens?limit=20&max_id=01FC3GSQ8A3MMJ43BPZSGEG29M>; rel="next", <https://example.org/api/v1/tokens?limit=20&min_id=01FC3KJW2GYXSDDRA6RWNDM46M>; rel="prev" + ```` + operationId: tokensInfoGet + parameters: + - description: 只返回早于给定的最大令牌 ID 的令牌。具有给定 ID 的令牌不会包含在响应中。 + in: query + name: max_id + type: string + - description: 只返回新于给定的最小令牌 ID 的令牌。具有给定 ID 的令牌不会包含在响应中。 + in: query + name: since_id + type: string + - description: 只返回比给定的最小令牌 ID **相邻且更新** 的令牌。具有指定 ID 的令牌不会包含在响应中。 + in: query + name: min_id + type: string + - default: 20 + description: 要返回的令牌数量。 + in: query + name: limit + type: integer + produces: + - application/json + responses: + "200": + description: 令牌详情数组。 + headers: + Link: + description: 下一/上一查询的链接。 + type: string + schema: + items: + $ref: '#/definitions/tokenInfo' + type: array + "400": + description: bad request 无效请求 + "401": + description: unauthorized 未授权 + security: + - OAuth2 Bearer: + - read:accounts + summary: 查看令牌列表 + tags: + - tokens + /api/v1/tokens/{id}: + get: + operationId: tokenInfoGet + parameters: + - description: 要查询的令牌 ID。 + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 要查询的令牌。 + schema: + $ref: '#/definitions/tokenInfo' + "400": + description: bad request 无效请求 + "401": + description: unauthorized 未授权 + "404": + description: not found 未找到 + "406": + description: not acceptable 不可接受 + "500": + description: internal server error 服务端内部错误 + security: + - OAuth2 Bearer: + - read:accounts + summary: 获取单个令牌的信息 + tags: + - tokens + /api/v1/tokens/{id}/invalidate: + post: + operationId: tokenInvalidatePost + parameters: + - description: 要禁用的令牌 ID。 + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 被禁用的令牌信息。 + schema: + $ref: '#/definitions/tokenInfo' + "400": + description: bad request 无效请求 + "401": + description: unauthorized 未授权 + "404": + description: not found 未找到 + "406": + description: not acceptable 不可接受 + "500": + description: internal server error 服务端内部错误 + security: + - OAuth2 Bearer: + - write:accounts + summary: 禁用单个令牌 + description: 禁用单个令牌,从数据库中删除并使其无法使用。 + tags: + - tokens /api/v1/user: get: operationId: getUser @@ -11786,7 +11981,7 @@ paths: description: internal error security: - OAuth2 Bearer: - - read:user + - read:accounts summary: 获取当前用户 description: 获取自己的用户模型。 tags: @@ -11829,10 +12024,10 @@ paths: "409": description: '冲突: 提供的邮箱地址已被使用' "500": - description: internal error + description: internal error 服务端内部错误 security: - OAuth2 Bearer: - - write:user + - write:accounts summary: 更改邮箱地址 description: 请求更改当前用户的邮箱地址。 tags: @@ -11880,10 +12075,10 @@ paths: "422": description: 无法处理请求,因为实例正在使用 OIDC 后端 "500": - description: internal error 服务器内部错误 + description: internal error 服务端内部错误 security: - OAuth2 Bearer: - - write:user + - write:accounts summary: 更改密码 tags: - user @@ -11986,7 +12181,7 @@ paths: description: internal server error 服务器内部错误 security: - OAuth2 Bearer: - - admin + - admin:read:accounts summary: 查看账户列表 tags: - admin @@ -12892,32 +13087,44 @@ securityDefinitions: flow: accessCode scopes: admin: 授予对所有内容的管理权限 - admin:accounts: 授予对账户的管理权限 + admin:read: 授予对所有内容的读取权限 + admin:read:accounts: 授予对账户的读取权限 + admin:read:domain_allows: 授予对域名白名单的读取权限 + admin:read:domain_blocks: 授予对域名黑名单的读取权限 + admin:read:reports: 授予对举报的读取权限 + admin:write: 授予对所有内容的写入权限 + admin:write:accounts: 授予对账户的写入权限 + admin:write:domain_allows: 授予对域名白名单的写入权限 + admin:write:domain_blocks: 授予对域名黑名单的写入权限 + admin:write:reports: 授予对举报的写入权限 + profile: 授予对凭据验证端点的读取权限 + push: 授予对推送的读取和写入权限 read: 授予对所有内容的读取权限 read:accounts: 授予对账户的读取权限 - read:blocks: 授予对屏蔽的读取权限 - read:custom_emojis: 授予对自定义表情的读取权限 + read:blocks: 授予对屏蔽状态的读取权限 + read:bookmarks: 授予对收藏的读取权限 read:favourites: 授予对点赞的读取权限 read:filters: 授予对过滤规则的读取权限 read:follows: 授予对关注的读取权限 read:lists: 授予对列表的读取权限 - read:media: 授予对媒体的读取权限 - read:mutes: 授予对静音的读取权限 + read:mutes: 授予对隐藏状态的读取权限 read:notifications: 授予对通知的读取权限 read:search: 授予对搜索的读取权限 read:statuses: 授予对贴文的读取权限 - read:streaming: 授予对流式 API 的读取权限 - read:user: 授予对用户级信息的读取权限 write: 授予对所有内容的写入权限 write:accounts: 授予对账户的写入权限 - write:blocks: 授予对屏蔽的写入权限 + write:blocks: 授予对屏蔽状态的写入权限 + write:bookmarks: 授予对收藏的写入权限 + write:conversations: 授予对对话的写入权限 + write:favourites: 授予对点赞的写入权限 write:filters: 授予对过滤规则的写入权限 write:follows: 授予对关注的写入权限 write:lists: 授予对列表的写入权限 write:media: 授予对媒体的写入权限 - write:mutes: 授予对静音的写入权限 + write:mutes: 授予对隐藏状态的写入权限 + write:notifications: 授予对通知的写入权限 + write:reports: 授予对举报的写入权限 write:statuses: 授予对贴文的写入权限 - write:user: 授予对用户级信息的写入权限 tokenUrl: https://example.org/oauth/token type: oauth2 swagger: "2.0" |
