{ "swagger": "2.0", "info": { "description": "OpenFlare 平台后端 API,提供用户认证、系统配置、任务调度与边缘节点管理能力。", "title": "OpenFlare API", "contact": { "name": "OpenFlare", "url": "https://github.com/Rain-kl/OpenFlare" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.0" }, "basePath": "/", "paths": { "/api/cap/challenge": { "post": { "description": "客户端获取 PoW 难题和签名的 JWT Token,并在后台计算。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "cap" ], "summary": "生成人机验证难题", "parameters": [ { "description": "可选范围限制参数", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/cap.challengeRequest" } } ], "responses": { "200": { "description": "成功返回 PoW 难题", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_internal_apps_cap.ChallengeResponse" } } } ] } }, "500": { "description": "内部服务错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/cap/redeem": { "post": { "description": "提交 PoW 解答进行核销,成功后返回一次性 X-Cap-Token 凭证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "cap" ], "summary": "校验人机验证解答", "parameters": [ { "description": "难题 Token 与解答 solutions 数组", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cap.redeemRequest" } } ], "responses": { "200": { "description": "核销成功,返回 X-Cap-Token", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_internal_apps_cap.RedeemResponse" } } } ] } }, "400": { "description": "参数错误或核销失败", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部服务错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/health": { "get": { "description": "检查服务是否正常运行,可用于负载均衡存活探测", "produces": [ "application/json" ], "tags": [ "health" ], "summary": "健康检查", "responses": { "200": { "description": "服务正常", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } } } } }, "/api/v1/admin/auth-sources": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有已配置的 OAuth/OIDC 认证源列表,包括已启用和未启用的,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取认证源列表", "responses": { "200": { "description": "认证源列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.AuthSource" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建一个新的 OAuth/OIDC 认证源配置,认证源名称必须唯一且符合命名规范,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "创建认证源", "parameters": [ { "description": "创建认证源参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth_source.AuthSourceRequest" } } ], "responses": { "200": { "description": "创建成功,返回认证源信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.AuthSource" } } } ] } }, "400": { "description": "参数错误或验证失败", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/auth-sources/{id}": { "put": { "security": [ { "SessionCookie": [] } ], "description": "更新指定 ID 的认证源配置。若 client_secret 字段为空,则保留原有密钥不变,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新认证源", "parameters": [ { "type": "integer", "format": "int64", "description": "认证源 ID 或名称", "name": "id", "in": "path", "required": true }, { "description": "更新认证源参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth_source.AuthSourceRequest" } } ], "responses": { "200": { "description": "更新成功,返回更新后的认证源信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.AuthSource" } } } ] } }, "400": { "description": "参数错误或验证失败", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "删除指定认证源及其关联的所有外部帐号绑定记录,警告:删除后相关用户将无法通过该源登录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "删除认证源", "parameters": [ { "type": "integer", "format": "int64", "description": "认证源 ID 或名称", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "ID 无效或删除失败", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/auth-sources/{id}/toggle": { "put": { "security": [ { "SessionCookie": [] } ], "description": "启用或禁用指定认证源。尝试启用时将验证 Client ID 和 Client Secret 是否已配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "切换认证源启用状态", "parameters": [ { "type": "integer", "format": "int64", "description": "认证源 ID 或名称", "name": "id", "in": "path", "required": true }, { "description": "启用状态", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth_source.ToggleAuthSourceRequest" } } ], "responses": { "200": { "description": "切换成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "验证失败或认证源不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/cache/clear": { "post": { "security": [ { "SessionCookie": [] } ], "description": "清除系统磁盘缓存目录中的所有临时文件,并重置缓存容量和 Key 追踪数据", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "清空缓存", "responses": { "200": { "description": "清理成功", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/cache/config": { "post": { "security": [ { "SessionCookie": [] } ], "description": "更改磁盘缓存最大容量限制、文件生存时间(TTL)以及是否启用 LRU 淘汰淘汰算法,并进行热更新", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新缓存配置", "parameters": [ { "description": "缓存配置请求体", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cache.updateCacheConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/cache/status": { "get": { "security": [ { "SessionCookie": [] } ], "description": "获取当前系统磁盘缓存的使用情况(已占用字节、Key 数量等)与策略配置", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取缓存状态", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/diskcache.Status" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/db-export": { "get": { "security": [ { "SessionCookie": [] } ], "description": "SQLite 时直接下载 .db 文件;PostgreSQL 时执行 pg_dump 并流式下载 .sql 文件,需要管理员权限", "produces": [ "application/octet-stream" ], "tags": [ "admin" ], "summary": "导出数据库", "responses": { "200": { "description": "数据库文件", "schema": { "type": "file" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "导出失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/db-info": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前使用的数据库类型(sqlite/postgres)、名称/路径及版本字符串,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取数据库信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/status.DatabaseInfoResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/db-manage/overview": { "get": { "security": [ { "SessionCookie": [] } ], "description": "获取数据库类型、版本、名称、文件大小、表数量及当前连接数,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取数据库运行概览", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/db_manage.DBOverviewResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/db-manage/query": { "post": { "security": [ { "SessionCookie": [] } ], "description": "在当前数据库中执行任意自定义 SQL,如果是查询语句将返回格式化后的列与数据集,否则返回受影响行数,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "执行 SQL 查询", "parameters": [ { "description": "SQL 请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/db_manage.ExecuteSQLRequest" } } ], "responses": { "200": { "description": "执行完毕", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/db_manage.ExecuteSQLResponse" } } } ] } }, "400": { "description": "SQL 语句错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/db-manage/tables": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前数据库的所有用户自定义表名称列表,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取数据库所有表名", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/logs": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页获取系统历史日志,cursor=0 获取最新日志,cursor\u003e0 获取更早日志", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取系统日志", "parameters": [ { "type": "integer", "default": 0, "description": "日志游标,0=获取最新", "name": "cursor", "in": "query" }, { "type": "integer", "default": 200, "description": "每页条数", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "日志列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/logs.logsResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/logs/access": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错)", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取用户访问日志", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "每页条数", "name": "page_size", "in": "query" }, { "type": "string", "description": "用户名模糊搜索", "name": "username", "in": "query" }, { "type": "string", "description": "接口路径模糊搜索", "name": "path", "in": "query" }, { "type": "string", "description": "起始时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", "name": "start_time", "in": "query" }, { "type": "string", "description": "结束时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", "name": "end_time", "in": "query" } ], "responses": { "200": { "description": "访问日志列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/logs.accessLogsResponse" } } } ] } }, "400": { "description": "日志存储未启用或参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/logs/analytics": { "get": { "security": [ { "SessionCookie": [] } ], "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错)", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取访问日志分析数据", "responses": { "200": { "description": "分析统计数据", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/logs.logsAnalyticsResponse" } } } ] } }, "400": { "description": "日志存储未启用", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/logs/ws": { "get": { "description": "通过 WebSocket 实时推送系统日志,需要管理员权限", "tags": [ "admin" ], "summary": "系统日志实时推送", "responses": {} } }, "/api/v1/admin/push/channels": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统配置的所有消息通道列表,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "获取所有消息通道", "responses": { "200": { "description": "消息通道列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.PushChannel" } } } } ] } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "新建一个消息通道配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "创建消息通道", "parameters": [ { "description": "创建参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.CreateChannelRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.PushChannel" } } } ] } } } } }, "/api/v1/admin/push/channels/definitions": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "获取所有消息通道配置字段定义", "responses": { "200": { "description": "通道配置定义列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/push.Definition" } } } } ] } } } } }, "/api/v1/admin/push/channels/test": { "post": { "security": [ { "SessionCookie": [] } ], "description": "触发一次临时的或现有的通道连通性推送测试,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "测试通道连通性", "parameters": [ { "description": "测试参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.TestChannelRequest" } } ], "responses": { "200": { "description": "测试触发成功", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/push/channels/{id}": { "put": { "security": [ { "SessionCookie": [] } ], "description": "修改消息通道配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "更新消息通道", "parameters": [ { "type": "integer", "format": "int64", "description": "通道ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.UpdateChannelRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.PushChannel" } } } ] } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "根据ID删除消息通道,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "删除消息通道", "parameters": [ { "type": "integer", "format": "int64", "description": "通道ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/push/events": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统配置的通知事件列表,包括预置和自定义事件,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "获取所有通知事件", "responses": { "200": { "description": "通知事件列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.PushEvent" } } } } ] } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "绑定系统内置事件或异步任务、推送渠道、接收目标并创建通知事件配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "创建通知事件", "parameters": [ { "description": "创建参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.CreateEventRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.PushEvent" } } } ] } } } } }, "/api/v1/admin/push/events/builtin": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统定义的所有内置通知事件元数据,供前端下拉框选择,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "获取所有内置通知事件", "responses": { "200": { "description": "内置通知事件列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/push.EventMetadata" } } } } ] } } } } }, "/api/v1/admin/push/events/{id}": { "put": { "security": [ { "SessionCookie": [] } ], "description": "更新已有通知事件的推送渠道、接收目标和内容模板,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "更新通知事件", "parameters": [ { "type": "integer", "description": "事件 ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.UpdateEventRequest" } } ], "responses": { "200": { "description": "修改成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "删除数据库中的特定通知事件配置,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "删除通知事件配置", "parameters": [ { "type": "integer", "description": "事件 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } } } } }, "/api/v1/admin/push/events/{id}/toggle": { "post": { "security": [ { "SessionCookie": [] } ], "description": "启用或禁用指定的通知事件", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "快捷切换通知事件启用状态", "parameters": [ { "type": "integer", "description": "事件 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "切换成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } } } } }, "/api/v1/admin/push/histories": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回分页的通知历史日志数据,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "分页获取通知推送历史", "parameters": [ { "type": "integer", "description": "当前页码", "name": "page", "in": "query" }, { "type": "integer", "description": "分页大小", "name": "page_size", "in": "query" }, { "type": "string", "description": "过滤事件名称", "name": "event_key", "in": "query" }, { "type": "string", "description": "过滤发送状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "推送历史列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/push.pushHistoriesResponse" } } } ] } } } } }, "/api/v1/admin/push/test": { "post": { "security": [ { "SessionCookie": [] } ], "description": "接收临时通知渠道配置并在本地同步调用 Pusher.Send 发送测试消息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin-push" ], "summary": "测试推送通道发送", "parameters": [ { "description": "测试请求体", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/push.TestPushRequest" } } ], "responses": { "200": { "description": "测试成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } } } } }, "/api/v1/admin/status": { "get": { "security": [ { "SessionCookie": [] } ], "description": "获取后端服务运行状态、Goroutine、内存指标等详细统计数据,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取系统状态信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/status.SystemStatusResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/status/log-database": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前日志主库、迁移状态、各库保留天数与合法迁移目标,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取日志数据库状态", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/status.LogDatabaseStatus" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/system-configs": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有系统配置列表,支持按配置类型(system/business)过滤,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取系统配置列表", "parameters": [ { "type": "string", "description": "配置类型(system/business)", "name": "type", "in": "query" } ], "responses": { "200": { "description": "系统配置列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.SystemConfig" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建一条新的系统配置项,配置键不可重复,同时将新配置同步到 Redis,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "创建系统配置", "parameters": [ { "description": "创建请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system_config.CreateSystemConfigRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误或配置键已存在", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/system-configs/smtp/test": { "post": { "security": [ { "SessionCookie": [] } ], "description": "使用传入的配置进行 SMTP 邮件发送测试,支持使用 ****** 占位符使用保存的数据库密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "测试 SMTP 邮件发送", "parameters": [ { "description": "测试请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system_config.TestSMTPRequest" } } ], "responses": { "200": { "description": "测试执行完毕", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system_config.TestSMTPResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/system-configs/{key}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "根据配置键获取对应的系统配置详情,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取单个系统配置", "parameters": [ { "type": "string", "description": "配置键", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "系统配置详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.SystemConfig" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "配置不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "put": { "security": [ { "SessionCookie": [] } ], "description": "根据配置键更新对应的配置内容,同时将更新同步到 Redis,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新系统配置", "parameters": [ { "type": "string", "description": "配置键", "name": "key", "in": "path", "required": true }, { "description": "更新请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system_config.UpdateSystemConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "配置不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/dispatch": { "post": { "security": [ { "SessionCookie": [] } ], "description": "手动触发指定类型的异步任务,支持指定时间范围和用户,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "下发异步任务", "parameters": [ { "description": "任务请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/task.DispatchTaskRequest" } } ], "responses": { "200": { "description": "任务已入队", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "任务类型不存在或参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "任务入队失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/executions": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页查询任务执行记录,支持按状态和任务类型筛选,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "查询任务执行记录", "parameters": [ { "type": "string", "description": "状态筛选 (pending/running/succeeded/failed)", "name": "status", "in": "query" }, { "type": "string", "description": "任务类型筛选", "name": "task_type", "in": "query" }, { "type": "string", "description": "任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先)", "name": "task_type_prefix", "in": "query" }, { "type": "string", "description": "逗号分隔的精确任务类型列表(IN 筛选,优先于前缀)", "name": "task_types", "in": "query" }, { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "每页条数", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "任务执行记录列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/executions/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "根据 ID 查询任务执行记录详情,包含完整执行日志,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "查询任务执行详情", "parameters": [ { "type": "integer", "description": "任务执行记录 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "任务执行详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TaskExecution" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/executions/{id}/retry": { "post": { "security": [ { "SessionCookie": [] } ], "description": "重新下发一条失败的任务,创建新的执行记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "重试失败任务", "parameters": [ { "type": "integer", "description": "任务执行记录 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "新任务的 TaskID", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "任务不支持重试或参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "重试失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/schedules": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取定时任务列表", "responses": { "200": { "description": "定时任务列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Schedule" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "新增一个动态定时任务配置,关联已有的异步任务,配置 Cron 表达式和执行参数,并触发调度器热加载,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "创建定时任务", "parameters": [ { "description": "创建定时任务请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/task.CreateScheduleRequest" } } ], "responses": { "200": { "description": "创建成功的定时任务信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Schedule" } } } ] } }, "400": { "description": "Cron 表达式无效、异步任务类型不存在或参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "保存定时任务失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/schedules/{id}": { "put": { "security": [ { "SessionCookie": [] } ], "description": "修改一个定时任务的配置(名称、Cron 表达式、异步任务参数和是否启用等),并触发调度器热加载,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "修改定时任务", "parameters": [ { "type": "integer", "description": "定时任务 ID", "name": "id", "in": "path", "required": true }, { "description": "修改定时任务请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/task.UpdateScheduleRequest" } } ], "responses": { "200": { "description": "修改后的定时任务信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Schedule" } } } ] } }, "400": { "description": "Cron 表达式无效、参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "定时任务不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "修改定时任务失败", "schema": { "$ref": "#/definitions/response.Any" } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "删除指定的定时任务配置,并触发调度器热加载,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "删除定时任务", "parameters": [ { "type": "integer", "description": "定时任务 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "定时任务不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "删除定时任务失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/tasks/types": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统支持的所有可调度任务类型列表,包括任务名称、描述、是否支持时间范围等元数据,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取支持的任务类型", "responses": { "200": { "description": "任务类型列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/task.TaskMeta" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/templates": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有通知模板列表,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取模板列表", "responses": { "200": { "description": "模板列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Template" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建一条新的自定义通知模板,模板标识符(Key)不可重复,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "创建模板", "parameters": [ { "description": "创建请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/template.CreateTemplateRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误或模板标识符已存在", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/templates/{key}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "根据模板标识符获取对应的模板详情,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取单个模板", "parameters": [ { "type": "string", "description": "模板标识符", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "模板详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Template" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "模板不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "put": { "security": [ { "SessionCookie": [] } ], "description": "根据模板标识符更新对应的模板内容,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新模板", "parameters": [ { "type": "string", "description": "模板标识符", "name": "key", "in": "path", "required": true }, { "description": "更新请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/template.UpdateTemplateRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Template" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "模板不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "根据模板标识符删除对应模板,系统预置模板不可删除,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "删除模板", "parameters": [ { "type": "string", "description": "模板标识符", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "不可删除系统模板", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "模板不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/update": { "get": { "security": [ { "SessionCookie": [] } ], "description": "从系统配置指定的 GitHub 上游仓库查询最新兼容 Release,并与当前服务版本比较", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取应用更新状态", "responses": { "200": { "description": "更新状态", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/updater.Status" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "查询失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/update/apply": { "post": { "security": [ { "SessionCookie": [] } ], "description": "下载当前平台对应的 GitHub Actions Release 资产,替换当前二进制并重启进程", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "下载并应用应用更新", "responses": { "200": { "description": "升级已准备并即将重启", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "当前版本不可升级", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "升级准备失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取文件列表", "parameters": [ { "type": "integer", "description": "页码(默认 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量(默认 20,最大 100)", "name": "page_size", "in": "query" }, { "type": "string", "description": "文件名关键词(模糊匹配)", "name": "keyword", "in": "query" }, { "type": "string", "description": "业务分类过滤", "name": "type", "in": "query" }, { "type": "string", "description": "扩展名过滤", "name": "extension", "in": "query" }, { "type": "integer", "format": "int64", "description": "上传用户 ID", "name": "user_id", "in": "query" } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.listFilesResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads/download/batch": { "post": { "security": [ { "SessionCookie": [] } ], "description": "传入多个文件 ID,后台实时将其打包压缩为 ZIP 流并输出,自动处理文件名重复冲突", "consumes": [ "application/json" ], "produces": [ "application/octet-stream" ], "tags": [ "admin" ], "summary": "批量打包下载", "parameters": [ { "description": "包含文件 ID 数组 of string 的请求体", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.batchDownloadRequest" } } ], "responses": { "200": { "description": "成功下载打包后的 ZIP", "schema": { "type": "file" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "打包失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads/download/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "根据文件 ID 获取文件,以附件形式 (Attachment) 强制开启客户端浏览器下载", "produces": [ "application/octet-stream" ], "tags": [ "admin" ], "summary": "下载单文件", "parameters": [ { "type": "string", "description": "文件 ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "图片质量 (low, medium, high, origin),默认为 origin", "name": "quality", "in": "query" } ], "responses": { "200": { "description": "成功下载文件", "schema": { "type": "file" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads/stats": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取文件统计数据", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.fileStatsResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads/types": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取文件业务类型列表", "responses": { "200": { "description": "业务类型列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/uploads/{id}": { "delete": { "security": [ { "SessionCookie": [] } ], "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "删除文件", "parameters": [ { "type": "string", "description": "文件 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无权操作", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "系统保留类型或存储只读", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/users": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页返回用户列表,支持按用户 ID 和用户名筛选,需要管理员权限", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取用户列表", "parameters": [ { "type": "string", "name": "email", "in": "query" }, { "minimum": 1, "type": "integer", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "name": "page_size", "in": "query" }, { "type": "integer", "name": "user_id", "in": "query" }, { "type": "string", "name": "username", "in": "query" } ], "responses": { "200": { "description": "用户列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.listUsersResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建一个本地密码登录的新用户,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "创建用户", "parameters": [ { "description": "创建用户参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.createUserRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.user" } } } ] } }, "400": { "description": "参数错误或用户名已存在", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/users/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定用户的完整个人资料和系统状态,需要管理员权限,不返回密码等敏感字段", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "获取用户详情", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "用户详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.user" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "put": { "security": [ { "SessionCookie": [] } ], "description": "更新指定用户的昵称、邮箱、管理员权限,并可选重置密码,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新用户信息", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.updateUserRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限或尝试修改自身权限", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "删除指定非管理员用户,需要管理员权限,不能删除当前登录用户", "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "删除用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限、尝试删除管理员或当前用户", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/admin/users/{id}/status": { "put": { "security": [ { "SessionCookie": [] } ], "description": "启用或禁用指定用户,管理员账号无法被禁用,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "更新用户状态", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true }, { "description": "状态参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.updateUserStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无管理员权限或尝试禁用管理员", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/apply-logs": { "post": { "security": [ { "AgentTokenAuth": [] } ], "description": "记录 Agent 配置下发与应用结果", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "上报配置应用日志", "parameters": [ { "description": "应用日志", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent.ApplyLogPayload" } } ], "responses": { "200": { "description": "日志记录", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.OpenFlareApplyLog" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/config-versions/active": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "返回当前生效的完整配置包,供 Agent 拉取并应用", "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "获取活跃配置版本", "responses": { "200": { "description": "活跃配置", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/agent.ConfigResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/nodes/heartbeat": { "post": { "security": [ { "AgentTokenAuth": [] } ], "description": "上报节点状态、指标与健康事件,返回远程控制配置与活跃配置元信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "Agent 心跳上报", "parameters": [ { "description": "心跳数据", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent.NodePayload" } } ], "responses": { "200": { "description": "心跳成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/agent.HeartbeatResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/nodes/register": { "post": { "security": [ { "AgentTokenAuth": [] } ], "description": "使用节点 access token 重新注册,或使用全局 discovery token 发现新节点;请求头需携带 X-Agent-Token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "注册或发现 Agent 节点", "parameters": [ { "description": "节点上报数据", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent.NodePayload" } } ], "responses": { "200": { "description": "注册成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/agent.RegistrationResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/pages/deployments/{deployment_id}/hash": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "返回 upload 框架记录的 SHA-256 哈希,供 Agent 对比本地缓存并按需拉取部署包(兼容旧路径)", "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "查询 Pages 部署包哈希", "parameters": [ { "type": "integer", "description": "部署 ID", "name": "deployment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.PagesDeploymentHashResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/pages/deployments/{deployment_id}/package": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "流式下载指定部署的静态资源压缩包,供 Agent 边缘分发(兼容旧路径)", "produces": [ "application/octet-stream" ], "tags": [ "openflare-agent" ], "summary": "下载 Pages 部署包", "parameters": [ { "type": "integer", "description": "部署 ID", "name": "deployment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "部署包文件", "schema": { "type": "file" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/pages/projects/{project_id}/latest/hash": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "按项目 ID 返回当前激活部署的包哈希(类似 latest 指针),Agent 无需关心具体部署 ID", "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "查询 Pages 项目最新激活部署哈希", "parameters": [ { "type": "integer", "description": "Pages 项目 ID", "name": "project_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.PagesProjectLatestHashResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/pages/projects/{project_id}/latest/package": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "按项目 ID 下载当前激活部署的压缩包,供 Agent 边缘分发", "produces": [ "application/octet-stream" ], "tags": [ "openflare-agent" ], "summary": "下载 Pages 项目最新激活部署包", "parameters": [ { "type": "integer", "description": "Pages 项目 ID", "name": "project_id", "in": "path", "required": true } ], "responses": { "200": { "description": "部署包文件", "schema": { "type": "file" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/waf/ip-groups/sync": { "post": { "security": [ { "AgentTokenAuth": [] } ], "description": "按 ID 与校验和增量同步 WAF IP 组定义", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-agent" ], "summary": "同步 WAF IP 组", "parameters": [ { "description": "同步请求", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent.WAFIPGroupSyncInput" } } ], "responses": { "200": { "description": "同步结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/agent.WAFIPGroupSyncResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/agent/ws": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "升级为 WebSocket 长连接,用于实时推送配置同步、WAF IP 组等指令;需携带 X-Agent-Token", "tags": [ "openflare-agent" ], "summary": "Agent WebSocket 连接", "responses": { "401": { "description": "Token 无效", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/config/public": { "get": { "description": "返回系统配置表中 visibility 为 1 的配置键值集合", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "config" ], "summary": "获取公共配置", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页返回 OpenFlare 访问日志,支持按节点、IP、主机、路径与状态码筛选,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "列出访问日志", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "string", "description": "请求路径", "name": "path", "in": "query" }, { "type": "integer", "description": "HTTP 状态码(100-599)", "name": "status_code", "in": "query" }, { "type": "string", "description": "起始时间(RFC3339,需与 until 成对提供)", "name": "since", "in": "query" }, { "type": "string", "description": "结束时间(RFC3339,需与 since 成对提供)", "name": "until", "in": "query" }, { "type": "integer", "description": "页码", "name": "p", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "page_size", "in": "query" }, { "type": "string", "description": "排序字段", "name": "sort_by", "in": "query" }, { "type": "string", "description": "排序方向", "name": "sort_order", "in": "query" } ], "responses": { "200": { "description": "访问日志列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogList" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/cleanup": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按保留天数清理过期访问日志记录,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "清理访问日志", "parameters": [ { "description": "清理参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/observability.AccessLogCleanupInput" } } ], "responses": { "200": { "description": "清理结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogCleanupResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/folds": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按时间桶聚合访问日志并分页返回,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "列出折叠访问日志", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "string", "description": "请求路径", "name": "path", "in": "query" }, { "type": "integer", "description": "折叠时间窗口(分钟)", "name": "fold_minutes", "in": "query" }, { "type": "integer", "description": "页码", "name": "p", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "page_size", "in": "query" }, { "type": "string", "description": "排序字段", "name": "sort_by", "in": "query" }, { "type": "string", "description": "排序方向", "name": "sort_order", "in": "query" } ], "responses": { "200": { "description": "折叠访问日志列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.FoldedAccessLogList" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/folds/ip-summary": { "get": { "security": [ { "SessionCookie": [] } ], "description": "在指定时间桶内按 IP 聚合访问统计,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "列出折叠访问日志 IP 汇总", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "string", "description": "请求路径", "name": "path", "in": "query" }, { "type": "string", "description": "时间桶起始时间", "name": "bucket_started_at", "in": "query" }, { "type": "integer", "description": "折叠时间窗口(分钟)", "name": "fold_minutes", "in": "query" }, { "type": "integer", "description": "页码", "name": "p", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "page_size", "in": "query" }, { "type": "string", "description": "排序字段", "name": "sort_by", "in": "query" }, { "type": "string", "description": "排序方向", "name": "sort_order", "in": "query" } ], "responses": { "200": { "description": "折叠 IP 汇总列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.FoldedAccessLogIPList" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/ip-summary": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 IP 聚合访问日志统计并分页返回;支持 hours 或 since/until 时间窗,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "列出访问日志 IP 汇总", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "integer", "description": "统计时间范围(小时,1-720,默认 168)", "name": "hours", "in": "query" }, { "type": "string", "description": "开始时间 RFC3339(与 until 同时提供时优先于 hours)", "name": "since", "in": "query" }, { "type": "string", "description": "结束时间 RFC3339", "name": "until", "in": "query" }, { "type": "integer", "description": "页码", "name": "p", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "page_size", "in": "query" }, { "type": "string", "description": "排序字段 total_requests|request_length|bytes_sent|success_ratio|last_seen_at|remote_addr", "name": "sort_by", "in": "query" }, { "type": "string", "description": "排序方向", "name": "sort_order", "in": "query" } ], "responses": { "200": { "description": "IP 汇总列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogIPSummaryList" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/ip-summary/analysis": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定 IP 的汇总指标与 Top 分布,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "获取访问日志 IP 分析", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "integer", "description": "统计时间范围(小时)", "name": "hours", "in": "query" } ], "responses": { "200": { "description": "IP 访问分析", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogIPAnalysisView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/ip-summary/trend": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "获取访问日志 IP 趋势", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "客户端 IP", "name": "remote_addr", "in": "query" }, { "type": "string", "description": "请求 Host", "name": "host", "in": "query" }, { "type": "integer", "description": "统计时间范围(小时)", "name": "hours", "in": "query" }, { "type": "integer", "description": "时间桶粒度(分钟)", "name": "bucket_minutes", "in": "query" } ], "responses": { "200": { "description": "IP 访问趋势", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogIPTrendView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/access-logs/overview": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回访问日志汇总指标、趋势与 Top 排行,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-observability" ], "summary": "获取访问日志概览", "parameters": [ { "type": "string", "description": "节点 ID", "name": "node_id", "in": "query" }, { "type": "string", "description": "请求 Host(单域名)", "name": "host", "in": "query" }, { "type": "array", "items": { "type": "string" }, "collectionFormat": "csv", "description": "请求 Host 列表(多域名精确匹配)", "name": "hosts", "in": "query" }, { "type": "integer", "description": "统计时间范围(小时)", "name": "hours", "in": "query" }, { "type": "integer", "description": "趋势桶分钟数(1、3、5 或 60,默认 60)", "name": "bucket_minutes", "in": "query" } ], "responses": { "200": { "description": "访问日志概览", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/observability.AccessLogOverview" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/acme-accounts/default": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回系统默认 ACME 账号配置,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "获取默认 ACME 账号", "responses": { "200": { "description": "默认 ACME 账号", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.AcmeAccount" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/apply-logs": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-apply-log" ], "summary": "获取配置下发日志", "parameters": [ { "type": "string", "description": "节点 ID 筛选", "name": "node_id", "in": "query" }, { "type": "integer", "description": "页码", "name": "pageNo", "in": "query" }, { "type": "integer", "description": "页码(别名)", "name": "page_no", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "每页数量(别名)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "下发日志列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/apply_log.ListResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/apply-logs/cleanup": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按保留天数清理历史下发记录,或删除全部记录,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-apply-log" ], "summary": "清理配置下发日志", "parameters": [ { "description": "清理参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/apply_log.CleanupInput" } } ], "responses": { "200": { "description": "清理结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/apply_log.CleanupResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/connection": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取 Cloudflare 连接", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.ConnectionView" } } } ] } } } }, "put": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "保存 Cloudflare 连接", "parameters": [ { "description": "连接参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.ConnectionInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.ConnectionView" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/connection/clear": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "清除 Cloudflare 连接", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/connection/verify": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "测试 Cloudflare 连接", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.ConnectionView" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/domains/available": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取可加入 Cloudflare 指向的域名", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cloudflare.AvailableDomain" } } } } ] } } } } }, "/api/v1/d/cloudflare/groups": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取 Cloudflare 指向分组", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cloudflare.GroupItem" } } } } ] } } } }, "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "创建 Cloudflare 指向分组", "parameters": [ { "description": "分组参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.GroupInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.GroupItem" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取 Cloudflare 指向分组详情", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.GroupDetail" } } } ] } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "删除 Cloudflare 指向分组", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取 Cloudflare 指向分组成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cloudflare.MemberItem" } } } } ] } } } }, "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "添加 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "description": "成员参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.MemberCreateInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.MemberItem" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/batch-move": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "批量移动 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "原分组 ID", "name": "id", "in": "path", "required": true }, { "description": "批量移动参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.MemberBatchMoveInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/batch-remove": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "批量移出 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "description": "批量移出参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.MemberBatchRemoveInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/{memberId}/move": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "移动 Cloudflare 指向成员到其他分组", "parameters": [ { "type": "integer", "description": "原分组 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "成员 ID", "name": "memberId", "in": "path", "required": true }, { "description": "目标分组参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.MemberMoveInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.MemberItem" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/{memberId}/remove": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "移出 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "成员 ID", "name": "memberId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/{memberId}/sync": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "同步 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "成员 ID", "name": "memberId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.SyncReceipt" } } } ] } } } } }, "/api/v1/d/cloudflare/groups/{id}/members/{memberId}/update": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "更新 Cloudflare 指向成员", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "成员 ID", "name": "memberId", "in": "path", "required": true }, { "description": "成员参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.MemberUpdateInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.MemberItem" } } } ] } } } } }, "/api/v1/d/cloudflare/groups/{id}/sync": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "同步 Cloudflare 指向分组", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.SyncReceipt" } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/groups/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "更新 Cloudflare 指向分组", "parameters": [ { "type": "integer", "description": "分组 ID", "name": "id", "in": "path", "required": true }, { "description": "分组参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cloudflare.GroupInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.GroupItem" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/cloudflare/overview": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-cloudflare" ], "summary": "获取 Cloudflare 指向总览", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/cloudflare.Overview" } } } ] } } } } }, "/api/v1/d/config-versions": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有已发布的 OpenResty 配置版本摘要,按创建时间倒序排列,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "获取配置版本列表", "responses": { "200": { "description": "配置版本列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ConfigVersionSummary" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/active": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前正在使用的配置版本,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "获取当前活跃配置版本", "responses": { "200": { "description": "活跃配置版本", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ConfigVersion" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限、不存在或无活跃版本", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/cleanup": { "post": { "security": [ { "SessionCookie": [] } ], "description": "删除超出保留数量的非活跃配置版本,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "清理历史配置版本", "parameters": [ { "description": "清理参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/config_version.CleanupInput" } } ], "responses": { "200": { "description": "清理结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/config_version.CleanupResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/diff": { "get": { "security": [ { "SessionCookie": [] } ], "description": "对比当前草稿配置与活跃版本之间的差异,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "对比草稿与活跃配置", "responses": { "200": { "description": "配置差异", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/config_version.ConfigDiffResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/preview": { "get": { "security": [ { "SessionCookie": [] } ], "description": "渲染并返回当前草稿配置的预览结果,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "预览当前草稿配置", "responses": { "200": { "description": "配置预览", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/config_version.ConfigPreviewResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/publish": { "post": { "security": [ { "SessionCookie": [] } ], "description": "将当前草稿配置发布为新版本,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "发布配置版本", "parameters": [ { "type": "boolean", "description": "是否强制发布", "name": "force", "in": "query" } ], "responses": { "200": { "description": "发布成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ConfigVersion" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定配置版本的完整快照与渲染内容,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "获取配置版本详情", "parameters": [ { "type": "integer", "description": "配置版本 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "配置版本详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ConfigVersion" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或版本不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/config-versions/{id}/activate": { "post": { "security": [ { "SessionCookie": [] } ], "description": "将指定历史版本设为当前活跃配置,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-config-version" ], "summary": "激活配置版本", "parameters": [ { "type": "integer", "description": "配置版本 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "激活成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ConfigVersion" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或版本不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/dashboard/overview": { "get": { "security": [ { "SessionCookie": [] } ], "description": "聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-dashboard" ], "summary": "获取仪表盘概览", "responses": { "200": { "description": "仪表盘概览", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/dashboard.OverviewPayload" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/dns-accounts": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全部 DNS 提供商账号,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "列出 DNS 账号", "responses": { "200": { "description": "DNS 账号列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.DNSAccount" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的 DNS 提供商账号,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "创建 DNS 账号", "parameters": [ { "description": "DNS 账号参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.DNSAccountInput" } } ], "responses": { "200": { "description": "创建成功的 DNS 账号", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DNSAccount" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/dns-accounts/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 删除 DNS 提供商账号,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "删除 DNS 账号", "parameters": [ { "type": "integer", "description": "DNS 账号 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/dns-accounts/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 更新 DNS 提供商账号,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "更新 DNS 账号", "parameters": [ { "type": "integer", "description": "DNS 账号 ID", "name": "id", "in": "path", "required": true }, { "description": "DNS 账号参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.DNSAccountInput" } } ], "responses": { "200": { "description": "更新后的 DNS 账号", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DNSAccount" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有节点及最新配置下发记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "获取节点列表", "responses": { "200": { "description": "节点列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/node.View" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的边缘节点记录,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "创建节点", "parameters": [ { "description": "节点参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/node.Input" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/bootstrap-token": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全局节点发现引导令牌,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "获取引导令牌", "responses": { "200": { "description": "引导令牌", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.BootstrapView" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/bootstrap-token/rotate": { "post": { "security": [ { "SessionCookie": [] } ], "description": "重新生成全局节点发现引导令牌,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "轮换引导令牌", "responses": { "200": { "description": "新引导令牌", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.BootstrapView" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/agent-release": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定节点可用的最新 Agent 版本信息,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "获取 Agent 发布信息", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "发布渠道", "name": "channel", "in": "query" } ], "responses": { "200": { "description": "Agent 发布信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.AgentReleaseInfo" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/agent-update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "向指定节点下发 Agent 自更新指令,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "请求 Agent 更新", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true }, { "description": "更新参数(可选)", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/node.AgentUpdateInput" } } ], "responses": { "200": { "description": "更新请求已下发", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "删除指定节点记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "删除节点", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/force-sync": { "post": { "security": [ { "SessionCookie": [] } ], "description": "向指定节点下发强制同步当前活跃配置的指令,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "请求强制同步配置", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步请求已下发", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/observability": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定节点的指标、健康事件与流量分析数据,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "获取节点可观测性数据", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "统计时间范围(小时)", "name": "hours", "in": "query" }, { "type": "integer", "description": "返回记录数量上限", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "可观测性数据", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.ObservabilityView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/observability/cleanup": { "post": { "security": [ { "SessionCookie": [] } ], "description": "清理指定节点的历史健康事件记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "清理节点健康事件", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "清理结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.HealthEventCleanupResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/openresty-restart": { "post": { "security": [ { "SessionCookie": [] } ], "description": "向指定节点下发 OpenResty 重启指令,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "请求重启 OpenResty", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "重启请求已下发", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/nodes/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "更新指定节点的配置信息,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-node" ], "summary": "更新节点", "parameters": [ { "type": "integer", "description": "节点 ID", "name": "id", "in": "path", "required": true }, { "description": "节点参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/node.Input" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/node.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或节点不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/option": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全部非敏感 OpenFlare 配置项,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "列出 OpenFlare 配置项", "responses": { "200": { "description": "配置项列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.OpenFlareOption" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/option/geoip/lookup": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按提供商与 IP 查询地理位置信息,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "GeoIP 地址查询", "parameters": [ { "description": "查询参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/option.geoIPLookupRequest" } } ], "responses": { "200": { "description": "GeoIP 查询结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/option.geoIPLookupView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/option/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "更新单个 OpenFlare 配置项,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "更新 OpenFlare 配置项", "parameters": [ { "description": "配置项", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.OpenFlareOption" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/option/update-batch": { "post": { "security": [ { "SessionCookie": [] } ], "description": "批量更新多个 OpenFlare 配置项,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "批量更新 OpenFlare 配置项", "parameters": [ { "description": "批量配置项", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/option.optionBatchPayload" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/origins": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有源站及关联代理规则数量,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-origin" ], "summary": "获取源站列表", "responses": { "200": { "description": "源站列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/origin.View" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的上游源站记录,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-origin" ], "summary": "创建源站", "parameters": [ { "description": "源站参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/origin.Input" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/origin.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/origins/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定源站信息及关联代理规则摘要,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-origin" ], "summary": "获取源站详情", "parameters": [ { "type": "integer", "description": "源站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "源站详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/origin.DetailView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或源站不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/origins/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "删除指定源站记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-origin" ], "summary": "删除源站", "parameters": [ { "type": "integer", "description": "源站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或源站不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/origins/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "更新指定源站的配置信息,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-origin" ], "summary": "更新源站", "parameters": [ { "type": "integer", "description": "源站 ID", "name": "id", "in": "path", "required": true }, { "description": "源站参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/origin.Input" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/origin.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或源站不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全部 OpenFlare Pages 项目,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "列出 Pages 项目", "responses": { "200": { "description": "Pages 项目列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/pages.View" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的 OpenFlare Pages 项目,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "创建 Pages 项目", "parameters": [ { "description": "项目参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pages.Input" } } ], "responses": { "200": { "description": "创建成功的项目", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/deployments/{deployment_id}/files": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定部署包含的文件清单,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "列出 Pages 部署文件", "parameters": [ { "type": "integer", "description": "部署 ID", "name": "deployment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "部署文件列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/pages.DeploymentFileView" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "部署不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 返回 Pages 项目详情,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "获取 Pages 项目详情", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Pages 项目详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 删除 OpenFlare Pages 项目,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "删除 Pages 项目", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/deployments": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定项目的全部部署记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "列出 Pages 部署", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "部署列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/pages.DeploymentView" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/deployments/upload": { "post": { "security": [ { "SessionCookie": [] } ], "description": "为指定项目上传静态资源压缩包(zip/tar.gz/tar.xz/tar.bz2/tar/7z),需要管理员权限", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "上传 Pages 部署包", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "type": "file", "description": "部署包文件", "name": "package", "in": "formData", "required": true } ], "responses": { "200": { "description": "部署记录", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.DeploymentView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/deployments/upload-from-url": { "post": { "security": [ { "SessionCookie": [] } ], "description": "已弃用的一次性 URL 导入;使用 trusted_internal 策略兼容内网与自签名证书,不创建持久部署源", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "从 URL 导入 Pages 部署包", "deprecated": true, "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "description": "下载链接", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pages.UploadFromURLInput" } } ], "responses": { "200": { "description": "部署记录", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.DeploymentView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/deployments/{deployment_id}/activate": { "post": { "security": [ { "SessionCookie": [] } ], "description": "将指定部署设为项目当前生效版本,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "激活 Pages 部署", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "部署 ID", "name": "deployment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "激活后的项目", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目或部署不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/deployments/{deployment_id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "删除指定项目的部署记录,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "删除 Pages 部署", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "部署 ID", "name": "deployment_id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目或部署不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/source": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回项目部署源配置与运行状态,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "获取 Pages 部署源", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "部署源", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.SourceView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目或部署源不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/source/check": { "post": { "security": [ { "SessionCookie": [] } ], "description": "异步检查 GitHub Release 来源;Remote URL 来源不支持检查更新", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "检查 Pages 部署源", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "任务回执", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.SourceActionReceipt" } } } ] } }, "400": { "description": "当前来源不支持检查", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "部署源不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "来源任务正在执行", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/source/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "幂等删除持久部署源;已有部署历史与当前生产部署保持不变", "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "删除 Pages 部署源", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "手动来源视图", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.SourceView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/source/sync": { "post": { "security": [ { "SessionCookie": [] } ], "description": "异步下载、校验并原子激活来源部署包;空请求体与空 JSON 对象均有效", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "同步并发布 Pages 部署源", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "description": "同步参数", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/pages.SourceSyncInput" } } ], "responses": { "200": { "description": "任务回执", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.SourceActionReceipt" } } } ] } }, "400": { "description": "参数或来源类型无效", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "部署源不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "来源任务正在执行", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/source/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "支持 Remote URL 与公开 GitHub Release 来源;敏感地址仅写入,不会在响应中返回", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "更新 Pages 部署源", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "description": "部署源配置", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pages.SourceUpdateInput" } } ], "responses": { "200": { "description": "更新结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.SourceUpdateResult" } } } ] } }, "400": { "description": "配置无效", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/pages/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 更新 OpenFlare Pages 项目,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-pages" ], "summary": "更新 Pages 项目", "parameters": [ { "type": "integer", "description": "项目 ID", "name": "id", "in": "path", "required": true }, { "description": "项目参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/pages.Input" } } ], "responses": { "200": { "description": "更新后的项目", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/pages.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "项目不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/proxy-routes": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回所有代理规则配置,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-proxy-route" ], "summary": "获取代理规则列表", "responses": { "200": { "description": "代理规则列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/proxy_route.View" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的反向代理规则,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-proxy-route" ], "summary": "创建代理规则", "parameters": [ { "description": "代理规则参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/proxy_route.Input" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/proxy_route.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/proxy-routes/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回指定代理规则的完整配置,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-proxy-route" ], "summary": "获取代理规则详情", "parameters": [ { "type": "integer", "description": "代理规则 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "代理规则详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/proxy_route.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或规则不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/proxy-routes/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "删除指定代理规则,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-proxy-route" ], "summary": "删除代理规则", "parameters": [ { "type": "integer", "description": "代理规则 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或规则不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/proxy-routes/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "更新指定代理规则的配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-proxy-route" ], "summary": "更新代理规则", "parameters": [ { "type": "integer", "description": "代理规则 ID", "name": "id", "in": "path", "required": true }, { "description": "代理规则参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/proxy_route.Input" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/proxy_route.View" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或规则不存在", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/status": { "get": { "description": "返回版本、认证源与系统公开配置,无需登录", "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "获取 OpenFlare 公开状态", "responses": { "200": { "description": "公开状态", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/option.statusView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全部 TLS 证书(不含 PEM),需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "列出 TLS 证书", "responses": { "200": { "description": "证书列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.TLSCertificate" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "从 PEM 文本创建 TLS 证书,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "创建 TLS 证书", "parameters": [ { "description": "证书参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.CertificateInput" } } ], "responses": { "200": { "description": "创建成功的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/apply": { "post": { "security": [ { "SessionCookie": [] } ], "description": "通过 ACME 申请新的 TLS 证书,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "申请 ACME 证书", "parameters": [ { "description": "ACME 申请参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.ApplyInput" } } ], "responses": { "200": { "description": "申请中的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/import-file": { "post": { "security": [ { "SessionCookie": [] } ], "description": "上传证书与私钥文件创建 TLS 证书,需要管理员权限", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "从文件导入 TLS 证书", "parameters": [ { "type": "string", "description": "证书名称", "name": "name", "in": "formData" }, { "type": "string", "description": "备注", "name": "remark", "in": "formData" }, { "type": "file", "description": "证书文件", "name": "cert_file", "in": "formData", "required": true }, { "type": "file", "description": "私钥文件", "name": "key_file", "in": "formData", "required": true } ], "responses": { "200": { "description": "导入成功的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "获取 TLS 证书详情", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "证书详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/content": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 返回证书与私钥 PEM 内容,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "获取 TLS 证书 PEM 内容", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "证书 PEM 内容", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/tls.CertificateContent" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/convert-acme": { "post": { "security": [ { "SessionCookie": [] } ], "description": "将已上传证书转换为 ACME 自动续期模式,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "将证书转为 ACME 管理", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true }, { "description": "ACME 申请参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.ApplyInput" } } ], "responses": { "200": { "description": "转换后的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 删除 TLS 证书,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "删除 TLS 证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/renew": { "post": { "security": [ { "SessionCookie": [] } ], "description": "手动触发 ACME 证书续期,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "续期 ACME 证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "续期后的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 更新 TLS 证书 PEM 信息,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "更新 TLS 证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true }, { "description": "证书参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.CertificateInput" } } ], "responses": { "200": { "description": "更新后的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/tls-certificates/{id}/update-acme": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 更新 ACME 证书申请配置,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tls" ], "summary": "更新 ACME 证书配置", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true }, { "description": "ACME 申请参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tls.ApplyInput" } } ], "responses": { "200": { "description": "更新后的证书", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.TLSCertificate" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/uptimekuma/sync": { "post": { "security": [ { "SessionCookie": [] } ], "description": "将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-option" ], "summary": "同步 Uptime Kuma", "responses": { "200": { "description": "同步成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回全部 WAF IP 组,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "列出 WAF IP 组", "responses": { "200": { "description": "IP 组列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/waf.IPGroupView" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "创建新的 WAF IP 组,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "创建 WAF IP 组", "parameters": [ { "description": "IP 组参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.IPGroupInput" } } ], "responses": { "200": { "description": "创建成功的 IP 组", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.IPGroupView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups/test": { "post": { "security": [ { "SessionCookie": [] } ], "description": "根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "测试 WAF IP 组自动配置", "parameters": [ { "description": "自动配置参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.IPGroupAutoTestInput" } } ], "responses": { "200": { "description": "测试结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.IPGroupAutoTestResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 返回 WAF IP 组详情,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "获取 WAF IP 组详情", "parameters": [ { "type": "integer", "description": "IP 组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "IP 组详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.IPGroupView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 删除 WAF IP 组,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "删除 WAF IP 组", "parameters": [ { "type": "integer", "description": "IP 组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups/{id}/sync": { "post": { "security": [ { "SessionCookie": [] } ], "description": "手动触发 WAF IP 组外部 IP 同步,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "同步 WAF IP 组", "parameters": [ { "type": "integer", "description": "IP 组 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步结果", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.IPGroupSyncResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/ip-groups/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "description": "按 ID 更新 WAF IP 组,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "更新 WAF IP 组", "parameters": [ { "type": "integer", "description": "IP 组 ID", "name": "id", "in": "path", "required": true }, { "description": "IP 组参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.IPGroupInput" } } ], "responses": { "200": { "description": "更新后的 IP 组", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.IPGroupView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/rule-groups": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "列出 WAF 规则", "responses": { "200": { "description": "规则列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/waf.RuleView" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "创建 WAF 规则", "parameters": [ { "description": "规则名称", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.CreateRuleInput" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.RuleView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/rule-groups/{id}": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "获取 WAF 规则详情", "parameters": [ { "type": "integer", "description": "规则 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "规则详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.RuleView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/rule-groups/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "删除 WAF 规则", "parameters": [ { "type": "integer", "description": "规则 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/rule-groups/{id}/graph": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "保存 WAF 规则图", "parameters": [ { "type": "integer", "description": "规则 ID", "name": "id", "in": "path", "required": true }, { "description": "规则图和修订号", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.SaveRuleGraphInput" } } ], "responses": { "200": { "description": "保存成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.RuleView" } } } ] } }, "400": { "description": "参数或规则图错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "修订冲突", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/rule-groups/{id}/meta": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "更新 WAF 规则元数据", "parameters": [ { "type": "integer", "description": "规则 ID", "name": "id", "in": "path", "required": true }, { "description": "规则元数据", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.UpdateRuleMetaInput" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.RuleView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "无权限或不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/waf/sites/{route_id}/rule-groups": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回代理站点关联的 WAF 规则组绑定,需要管理员权限", "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "获取站点 WAF 规则组", "parameters": [ { "type": "integer", "description": "代理路由 ID", "name": "route_id", "in": "path", "required": true } ], "responses": { "200": { "description": "站点规则组绑定", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.SiteRuleGroupsView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "替换代理站点关联的 WAF 规则组列表,需要管理员权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-waf" ], "summary": "替换站点 WAF 规则组", "parameters": [ { "type": "integer", "description": "代理路由 ID", "name": "route_id", "in": "path", "required": true }, { "description": "规则组 ID 列表", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/waf.IDsRequest" } } ], "responses": { "200": { "description": "更新后的站点规则组绑定", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/waf.SiteRuleGroupsView" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "记录不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "获取 Zone 列表", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/zone.ListItem" } } } } ] } } } }, "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "创建 Zone", "parameters": [ { "description": "Zone 参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/zone.Input" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Zone" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "删除 Zone", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/domains": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "创建 Zone 域名", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true }, { "description": "域名参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/zone.DomainInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ZoneDomain" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/domains/{domainId}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "删除 Zone 域名", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "域名 ID", "name": "domainId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/domains/{domainId}/update": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "更新 Zone 域名", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "域名 ID", "name": "domainId", "in": "path", "required": true }, { "description": "域名参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/zone.DomainInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ZoneDomain" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/overview": { "get": { "security": [ { "SessionCookie": [] } ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "获取 Zone 概览", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/zone.Overview" } } } ] } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/stats": { "get": { "security": [ { "SessionCookie": [] } ], "description": "按 Zone 下全部域名聚合访问日志:唯一访问者、请求总数、已提供数据(字节)。range 支持 24h/7d/30d。", "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "获取 Zone 流量统计", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "时间范围:24h(默认)、7d、30d", "name": "range", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/zone.Stats" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/d/zones/{id}/update": { "post": { "security": [ { "SessionCookie": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-zone" ], "summary": "更新 Zone", "parameters": [ { "type": "integer", "description": "Zone ID", "name": "id", "in": "path", "required": true }, { "description": "Zone 参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/zone.Input" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Zone" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "OAuth 回调处理", "parameters": [ { "description": "回调请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth.CallbackRequest" } } ], "responses": { "200": { "description": "登录或绑定成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.OAuthCallbackResult" } } } ] } }, "400": { "description": "state 无效、参数错误或认证源错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "绑定场景未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "OAuth 认证失败或内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/external-accounts": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前登录用户已绑定的所有外部 OAuth 帐号信息,需要登录", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取外部帐号列表", "responses": { "200": { "description": "外部帐号列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ExternalAccountView" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/external-accounts/{id}/delete": { "post": { "security": [ { "SessionCookie": [] } ], "description": "解除当前登录用户与指定外部帐号的绑定关系,需要登录", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "解除外部帐号绑定", "parameters": [ { "type": "integer", "format": "int64", "description": "外部帐号绑定记录 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "解除绑定成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "ID 无效或解除失败", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/login": { "get": { "description": "根据指定认证源生成 OAuth 授权 URL,前端跳转到该 URL 完成 OAuth 登录授权。source 参数为空时使用第一个启用的认证源。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取登录授权地址", "parameters": [ { "type": "string", "description": "认证源名称,为空使用第一个启用的认证源", "name": "source", "in": "query" } ], "responses": { "200": { "description": "授权 URL", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" } } } ] } }, "400": { "description": "认证源不存在或未配置", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "Redis 异常 or 构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/logout": { "get": { "security": [ { "SessionCookie": [] } ], "description": "清除当前用户的登录会话,完成退出。清除 Cookie 中的 Session 数据。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "退出登录", "responses": { "200": { "description": "退出成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "500": { "description": "Session 清除失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/sources": { "get": { "description": "返回当前系统已启用的所有 OAuth 登录源,前端展示登录按钮列表时调用", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取可用登录源", "responses": { "200": { "description": "登录源列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/oauth.AuthSourceView" } } } } ] } } } } }, "/api/v1/oauth/user-info": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/oauth/{source}/authorize": { "get": { "description": "根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "发起指定认证源授权", "parameters": [ { "type": "string", "description": "认证源名称", "name": "source", "in": "path", "required": true }, { "type": "string", "description": "授权目的:login(登录)或 bind(绑定账号),默认 login", "name": "purpose", "in": "query" } ], "responses": { "200": { "description": "授权 URL", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" } } } ] } }, "400": { "description": "认证源不存在或未启用", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "Redis 异常或构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/relay/heartbeat": { "post": { "security": [ { "AgentTokenAuth": [] } ], "description": "Relay 节点定期上报运行状态与 frps 观测数据,返回运行时配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-relay" ], "summary": "上报 Relay 心跳", "parameters": [ { "description": "心跳载荷", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/relay.HeartbeatPayload" } } ], "responses": { "200": { "description": "心跳响应", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/relay.HeartbeatResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Agent Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/relay/ws": { "get": { "security": [ { "AgentTokenAuth": [] } ], "description": "将已认证的 Relay 连接升级为 WebSocket 长连接,用于配置推送", "tags": [ "openflare-relay" ], "summary": "升级 Relay WebSocket 连接", "responses": { "401": { "description": "Agent Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/tunnel/apply-log": { "post": { "security": [ { "TunnelTokenAuth": [] } ], "description": "Tunnel 客户端上报配置应用结果,服务端记录下发日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tunnel" ], "summary": "上报 Tunnel 配置下发结果", "parameters": [ { "description": "下发结果载荷", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/flared.ApplyLogPayload" } } ], "responses": { "200": { "description": "下发日志记录", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.OpenFlareApplyLog" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Tunnel Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/tunnel/config/active": { "get": { "security": [ { "TunnelTokenAuth": [] } ], "description": "返回 Tunnel 客户端当前应应用的完整路由配置(含中继列表与代理定义)", "produces": [ "application/json" ], "tags": [ "openflare-tunnel" ], "summary": "获取活跃隧道配置", "responses": { "200": { "description": "隧道配置", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/flared.TunnelConfigResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Tunnel Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/tunnel/heartbeat": { "post": { "security": [ { "TunnelTokenAuth": [] } ], "description": "Tunnel 客户端定期上报运行状态与中继连接信息,返回活跃配置元数据与隧道设置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "openflare-tunnel" ], "summary": "上报 Tunnel 心跳", "parameters": [ { "description": "心跳载荷", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/flared.HeartbeatPayload" } } ], "responses": { "200": { "description": "心跳响应", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/flared.HeartbeatResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "Tunnel Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/tunnel/ws": { "get": { "security": [ { "TunnelTokenAuth": [] } ], "description": "将已认证的 Tunnel 客户端连接升级为 WebSocket 长连接,用于配置推送", "tags": [ "openflare-tunnel" ], "summary": "升级 Tunnel WebSocket 连接", "responses": { "401": { "description": "Tunnel Token 无效", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "节点类型不匹配", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/upload": { "post": { "security": [ { "SessionCookie": [] } ], "description": "支持各种类型的通用文件上传,支持自动文件类型检测、哈希计算与“秒传”去重", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "upload" ], "summary": "上传文件", "parameters": [ { "type": "file", "description": "要上传的文件", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "业务分类 (例如: avatar, attachment, doc,默认为 generic)", "name": "type", "in": "formData" }, { "type": "string", "description": "额外的 JSON 格式元数据", "name": "metadata", "in": "formData" } ], "responses": { "200": { "description": "上传成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Upload" } } } ] } }, "400": { "description": "请求参数错误或文件受限", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "系统保留类型或存储只读", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/upload/my": { "get": { "security": [ { "SessionCookie": [] } ], "description": "分页获取当前登录用户上传的文件,支持文件名关键词、业务类型、扩展名过滤", "produces": [ "application/json" ], "tags": [ "upload" ], "summary": "获取我的文件列表", "parameters": [ { "type": "integer", "description": "页码(默认 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量(默认 20,最大 100)", "name": "page_size", "in": "query" }, { "type": "string", "description": "文件名关键词(模糊匹配)", "name": "keyword", "in": "query" }, { "type": "string", "description": "业务分类过滤", "name": "type", "in": "query" }, { "type": "string", "description": "扩展名过滤", "name": "extension", "in": "query" } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.listMyFilesResponse" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/upload/{id}": { "put": { "security": [ { "SessionCookie": [] } ], "description": "更新当前用户本人的文件名或访问权限模式 (AccessMode)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "upload" ], "summary": "更新我的文件信息", "parameters": [ { "type": "string", "description": "文件 ID", "name": "id", "in": "path", "required": true }, { "description": "更新字段", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.updateMyFileRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Upload" } } } ] } }, "403": { "description": "无权操作", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } } } }, "delete": { "security": [ { "SessionCookie": [] } ], "description": "将当前用户本人的文件状态置为 deleted(软删除)", "produces": [ "application/json" ], "tags": [ "upload" ], "summary": "删除我的文件", "parameters": [ { "type": "string", "description": "文件 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/response.Any" } }, "403": { "description": "无权操作", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } }, "409": { "description": "系统保留类型或存储只读", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user-info": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/access-tokens": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前登录用户的所有 active access tokens(脱敏后)", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "获取当前用户的 AccessToken 列表", "responses": { "200": { "description": "令牌列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.AccessToken" } } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } }, "post": { "security": [ { "SessionCookie": [] } ], "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "创建一个新的 AccessToken", "parameters": [ { "description": "令牌名称", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.createTokenRequest" } } ], "responses": { "200": { "description": "新建令牌成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.tokenResponse" } } } ] } }, "400": { "description": "参数错误或超限", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/access-tokens/{id}": { "delete": { "security": [ { "SessionCookie": [] } ], "description": "撤销并删除一个属于当前用户的 API 访问令牌", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "删除一个 AccessToken", "parameters": [ { "type": "string", "description": "令牌ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/access-tokens/{id}/rotate": { "post": { "security": [ { "SessionCookie": [] } ], "description": "轮换(重新生成)一个属于当前用户的 API 访问令牌的密钥,旧令牌将立即失效", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "轮换一个 AccessToken", "parameters": [ { "type": "string", "description": "令牌ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "令牌轮换成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.tokenResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/change-password": { "post": { "description": "修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "修改用户密码", "parameters": [ { "description": "修改密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.changePasswordRequest" } } ], "responses": { "200": { "description": "修改密码成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "400": { "description": "原密码错误或新密码不符合要求", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "请先登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/login": { "post": { "description": "使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "用户密码登录", "parameters": [ { "description": "登录请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.loginRequest" } } ], "responses": { "200": { "description": "登录成功,返回用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "400": { "description": "用户名或密码错误", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/logout": { "get": { "security": [ { "SessionCookie": [] } ], "description": "清除用户登录 Session,完成退出", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "用户退出登录", "responses": { "200": { "description": "退出成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "type": "string" } } } ] } }, "500": { "description": "Session 清除失败", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/profile": { "put": { "description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "修改当前登录用户的个人资料", "parameters": [ { "description": "更新请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.updateProfileRequest" } } ], "responses": { "200": { "description": "修改成功,返回更新后的用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "400": { "description": "邮箱已被占用或参数错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/register": { "post": { "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "用户注册", "parameters": [ { "description": "注册请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.registerRequest" } } ], "responses": { "200": { "description": "注册并登录成功,返回用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "400": { "description": "参数错误、用户名已存在或注册已关闭", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/self": { "get": { "security": [ { "SessionCookie": [] } ], "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", "produces": [ "application/json" ], "tags": [ "oauth" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { "allOf": [ { "$ref": "#/definitions/response.Any" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" } } } ] } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/api/v1/user/send-email-code": { "post": { "description": "向指定邮箱发送验证码(用于注册场景)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "发送邮箱验证码", "parameters": [ { "description": "发送验证码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.sendEmailCodeRequest" } } ], "responses": { "200": { "description": "发送成功", "schema": { "$ref": "#/definitions/response.Any" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/f/{id}": { "get": { "description": "根据文件 ID 获取并提供已上传的临时或正式文件,若配置了缓存则优先走本地缓存,否则从 S3 等后端存储读取并流式返回", "produces": [ "application/octet-stream" ], "tags": [ "upload" ], "summary": "获取已上传文件", "parameters": [ { "type": "string", "description": "文件 ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "图片质量 (low, medium, high, origin),默认为 origin", "name": "quality", "in": "query" } ], "responses": { "200": { "description": "成功获取文件内容", "schema": { "type": "file" } }, "400": { "description": "文件 ID 格式错误", "schema": { "$ref": "#/definitions/response.Any" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/response.Any" } }, "404": { "description": "文件未找到", "schema": { "$ref": "#/definitions/response.Any" } }, "500": { "description": "服务内部错误", "schema": { "$ref": "#/definitions/response.Any" } } } } }, "/robots.txt": { "get": { "description": "根据系统配置决定是否允许搜索引擎检索,并返回相应的 robots.txt 文件内容", "produces": [ "text/plain" ], "tags": [ "config" ], "summary": "获取 robots.txt", "responses": { "200": { "description": "robots.txt 内容", "schema": { "type": "string" } } } } } }, "definitions": { "agent.ActiveConfigMeta": { "type": "object", "properties": { "checksum": { "type": "string" }, "version": { "type": "string" } } }, "agent.ApplyLogPayload": { "type": "object", "properties": { "checksum": { "type": "string" }, "main_config_checksum": { "type": "string" }, "message": { "type": "string" }, "node_id": { "type": "string" }, "result": { "type": "string" }, "route_config_checksum": { "type": "string" }, "support_file_count": { "type": "integer" }, "version": { "type": "string" } } }, "agent.ConfigResponse": { "type": "object", "properties": { "checksum": { "type": "string" }, "created_at": { "type": "string" }, "source_config_json": { "type": "string" }, "support_files": { "type": "array", "items": { "$ref": "#/definitions/agent.SupportFile" } }, "version": { "type": "string" } } }, "agent.HeartbeatResponse": { "type": "object", "properties": { "active_config": { "$ref": "#/definitions/agent.ActiveConfigMeta" }, "agent_settings": { "$ref": "#/definitions/agent.Settings" }, "node": { "$ref": "#/definitions/model.OpenFlareNode" }, "waf_ip_groups": { "type": "array", "items": { "$ref": "#/definitions/agent.WAFIPGroup" } } } }, "agent.NodePayload": { "type": "object", "properties": { "access_logs": { "type": "array", "items": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeAccessLog" } }, "buffered": { "type": "array", "items": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.BufferedObservabilityRecord" } }, "current_version": { "type": "string" }, "edge_health": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeEdgeHealth" }, "ext_version": { "type": "string" }, "health_events": { "type": "array", "items": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeHealthEvent" } }, "host_metrics": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeMetricSnapshot" }, "ip": { "type": "string" }, "last_error": { "type": "string" }, "name": { "type": "string" }, "node_id": { "type": "string" }, "openresty_message": { "type": "string" }, "openresty_status": { "type": "string" }, "profile": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeSystemProfile" }, "schema_version": { "type": "integer" }, "version": { "type": "string" }, "waf_ip_group_checksums": { "type": "object", "additionalProperties": { "type": "string" } } } }, "agent.RegistrationResponse": { "type": "object", "properties": { "access_token": { "type": "string" }, "name": { "type": "string" }, "node_id": { "type": "string" } } }, "agent.Settings": { "type": "object", "properties": { "auto_update": { "type": "boolean" }, "heartbeat_interval": { "type": "integer" }, "restart_openresty_now": { "type": "boolean" }, "update_channel": { "type": "string" }, "update_now": { "type": "boolean" }, "update_repo": { "type": "string" }, "update_tag": { "type": "string" }, "websocket_upgrade_enabled": { "type": "boolean" } } }, "agent.SupportFile": { "type": "object", "properties": { "content": { "type": "string" }, "path": { "type": "string" } } }, "agent.WAFIPGroup": { "type": "object", "properties": { "checksum": { "type": "string" }, "enabled": { "type": "boolean" }, "id": { "type": "integer" }, "ip_list": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "type": { "type": "string" } } }, "agent.WAFIPGroupSyncInput": { "type": "object", "properties": { "checksums": { "type": "object", "additionalProperties": { "type": "string" } }, "ids": { "type": "array", "items": { "type": "integer" } } } }, "agent.WAFIPGroupSyncResult": { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.WAFIPGroup" } } } }, "analytics.BatchWriterStats": { "type": "object", "properties": { "cap": { "type": "integer" }, "depth": { "type": "integer" }, "drops": { "type": "integer" }, "flush_errors": { "type": "integer" }, "name": { "type": "string" }, "running": { "type": "boolean" } } }, "apply_log.CleanupInput": { "type": "object", "properties": { "delete_all": { "type": "boolean" }, "retention_days": { "type": "integer" } } }, "apply_log.CleanupResult": { "type": "object", "properties": { "cutoff": { "type": "string" }, "delete_all": { "type": "boolean" }, "deleted_count": { "type": "integer" }, "retention_days": { "type": "integer" } } }, "apply_log.ListResult": { "type": "object", "properties": { "current": { "type": "integer" }, "rows": { "type": "array", "items": { "$ref": "#/definitions/model.OpenFlareApplyLog" } }, "total": { "type": "integer" }, "totalPage": { "type": "integer" } } }, "auth_source.AuthSourceRequest": { "type": "object", "properties": { "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "display_name": { "type": "string" }, "icon_url": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "openid_discovery_url": { "type": "string" }, "scopes": { "type": "string" }, "type": { "type": "string" } } }, "auth_source.ToggleAuthSourceRequest": { "type": "object", "properties": { "is_active": { "type": "boolean" } } }, "cache.updateCacheConfigRequest": { "type": "object", "required": [ "max_size_mb", "ttl_minutes" ], "properties": { "lru_enabled": { "type": "boolean" }, "max_size_mb": { "type": "integer", "minimum": 1 }, "ttl_minutes": { "type": "integer", "minimum": 0 } } }, "cap.challengeRequest": { "type": "object", "properties": { "scope": { "type": "string" } } }, "cap.redeemRequest": { "type": "object", "required": [ "solutions", "token" ], "properties": { "scope": { "type": "string" }, "solutions": { "type": "array", "items": { "type": "integer" } }, "token": { "type": "string" } } }, "cloudflare.AvailableDomain": { "type": "object", "properties": { "domain": { "type": "string" }, "id": { "type": "integer" }, "zone_domain": { "type": "string" }, "zone_id": { "type": "integer" } } }, "cloudflare.ConnectionInput": { "type": "object", "properties": { "api_token": { "type": "string" }, "dns_account_id": { "type": "integer" }, "source": { "type": "string" } } }, "cloudflare.ConnectionView": { "type": "object", "properties": { "configured": { "type": "boolean" }, "dns_account_id": { "type": "integer" }, "ready": { "type": "boolean" }, "source": { "type": "string" }, "status": { "type": "string" }, "verified_at": { "type": "string" } } }, "cloudflare.GroupDetail": { "type": "object", "properties": { "group": { "$ref": "#/definitions/cloudflare.GroupItem" }, "members": { "type": "array", "items": { "$ref": "#/definitions/cloudflare.MemberItem" } } } }, "cloudflare.GroupInput": { "type": "object", "properties": { "backup_node_id": { "type": "integer" }, "default_proxied": { "type": "boolean" }, "enabled": { "type": "boolean" }, "name": { "type": "string" }, "primary_node_id": { "type": "integer" } } }, "cloudflare.GroupItem": { "type": "object", "properties": { "active_node": { "$ref": "#/definitions/cloudflare.NodeOption" }, "backup_node": { "$ref": "#/definitions/cloudflare.NodeOption" }, "created_at": { "type": "string" }, "default_proxied": { "type": "boolean" }, "enabled": { "type": "boolean" }, "id": { "type": "integer" }, "member_count": { "type": "integer" }, "name": { "type": "string" }, "primary_node": { "$ref": "#/definitions/cloudflare.NodeOption" }, "updated_at": { "type": "string" } } }, "cloudflare.MemberBatchMoveInput": { "type": "object", "properties": { "member_ids": { "type": "array", "items": { "type": "integer" } }, "target_group_id": { "type": "integer" } } }, "cloudflare.MemberBatchRemoveInput": { "type": "object", "properties": { "member_ids": { "type": "array", "items": { "type": "integer" } } } }, "cloudflare.MemberCreateInput": { "type": "object", "properties": { "proxied": { "type": "boolean" }, "zone_domain_id": { "type": "integer" } } }, "cloudflare.MemberItem": { "type": "object", "properties": { "desired_ip": { "type": "string" }, "domain": { "type": "string" }, "group_id": { "type": "integer" }, "id": { "type": "integer" }, "last_error": { "type": "string" }, "proxied": { "type": "boolean" }, "sync_status": { "type": "string" }, "synced_at": { "type": "string" }, "zone_domain_id": { "type": "integer" }, "zone_id": { "type": "integer" } } }, "cloudflare.MemberMoveInput": { "type": "object", "properties": { "target_group_id": { "type": "integer" } } }, "cloudflare.MemberUpdateInput": { "type": "object", "properties": { "proxied": { "type": "boolean" } } }, "cloudflare.NodeOption": { "type": "object", "properties": { "id": { "type": "integer" }, "ip": { "type": "string" }, "name": { "type": "string" } } }, "cloudflare.Overview": { "type": "object", "properties": { "connection": { "$ref": "#/definitions/cloudflare.ConnectionView" }, "error_count": { "type": "integer" }, "group_count": { "type": "integer" }, "member_count": { "type": "integer" }, "ok_count": { "type": "integer" }, "pending_count": { "type": "integer" } } }, "cloudflare.SyncReceipt": { "type": "object", "properties": { "task_id": { "type": "string" } } }, "config_version.CleanupInput": { "type": "object", "properties": { "keep_count": { "type": "integer" } } }, "config_version.CleanupResult": { "type": "object", "properties": { "deleted_count": { "type": "integer" }, "message": { "type": "string" } } }, "config_version.ConfigDiffResult": { "type": "object", "properties": { "active_version": { "type": "string" }, "active_website_count": { "type": "integer" }, "added_domains": { "type": "array", "items": { "type": "string" } }, "added_sites": { "type": "array", "items": { "type": "string" } }, "changed_option_details": { "type": "array", "items": { "$ref": "#/definitions/config_version.ConfigOptionDiffItem" } }, "changed_option_keys": { "type": "array", "items": { "type": "string" } }, "current_website_count": { "type": "integer" }, "main_config_changed": { "type": "boolean" }, "modified_domains": { "type": "array", "items": { "type": "string" } }, "modified_sites": { "type": "array", "items": { "type": "string" } }, "removed_domains": { "type": "array", "items": { "type": "string" } }, "removed_sites": { "type": "array", "items": { "type": "string" } }, "waf_config_changed": { "type": "boolean" } } }, "config_version.ConfigOptionDiffItem": { "type": "object", "properties": { "current_value": { "type": "string" }, "key": { "type": "string" }, "previous_value": { "type": "string" } } }, "config_version.ConfigPreviewResult": { "type": "object", "properties": { "checksum": { "type": "string" }, "main_config": { "type": "string" }, "rendered_config": { "type": "string" }, "route_config": { "type": "string" }, "route_count": { "type": "integer" }, "snapshot_json": { "type": "string" }, "support_files": { "type": "array", "items": { "$ref": "#/definitions/config_version.SupportFile" } }, "website_count": { "type": "integer" } } }, "config_version.SupportFile": { "type": "object", "properties": { "content": { "type": "string" }, "path": { "type": "string" } } }, "dashboard.Capacity": { "type": "object", "properties": { "average_cpu_usage_percent": { "type": "number" }, "average_memory_usage_percent": { "type": "number" }, "high_cpu_nodes": { "type": "integer" }, "high_memory_nodes": { "type": "integer" }, "high_storage_nodes": { "type": "integer" } } }, "dashboard.OverviewPayload": { "type": "object", "properties": { "capacity": { "$ref": "#/definitions/dashboard.Capacity" }, "distributions": { "$ref": "#/definitions/dashboard.distributionsPayload" }, "generated_at": {}, "nodes": { "type": "array", "items": { "type": "array", "items": {} } }, "summary": { "$ref": "#/definitions/dashboard.Summary" }, "traffic": { "$ref": "#/definitions/dashboard.Traffic" }, "trends": { "$ref": "#/definitions/dashboard.trendsPayload" } } }, "dashboard.Summary": { "type": "object", "properties": { "offline_nodes": { "type": "integer" }, "online_nodes": { "type": "integer" }, "pending_nodes": { "type": "integer" }, "total_nodes": { "type": "integer" }, "unhealthy_nodes": { "type": "integer" } } }, "dashboard.Traffic": { "type": "object", "properties": { "error_count": { "type": "integer" }, "estimated_qps": { "type": "number" }, "reported_nodes": { "type": "integer" }, "request_count": { "type": "integer" }, "unique_visitors": { "type": "integer" } } }, "dashboard.distributionsPayload": { "type": "object", "properties": { "source_countries": { "type": "array", "items": { "type": "array", "items": {} } }, "status_codes": { "type": "array", "items": { "type": "array", "items": {} } }, "top_domains": { "type": "array", "items": { "type": "array", "items": {} } } } }, "dashboard.trendsPayload": { "type": "object", "properties": { "capacity_24h": { "type": "array", "items": { "type": "array", "items": {} } }, "disk_io_24h": { "type": "array", "items": { "type": "array", "items": {} } }, "network_24h": { "type": "array", "items": { "type": "array", "items": {} } }, "traffic_24h": { "type": "array", "items": { "type": "array", "items": {} } } } }, "db_manage.DBOverviewResponse": { "type": "object", "properties": { "connections": { "type": "integer" }, "name": { "type": "string" }, "size": { "type": "string" }, "table_count": { "type": "integer" }, "type": { "type": "string" }, "version": { "type": "string" } } }, "db_manage.ExecuteSQLRequest": { "type": "object", "required": [ "sql" ], "properties": { "sql": { "type": "string" } } }, "db_manage.ExecuteSQLResponse": { "type": "object", "properties": { "affected_rows": { "type": "integer" }, "columns": { "type": "array", "items": { "type": "string" } }, "execution_time_ms": { "type": "integer" }, "results": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "type": { "description": "\"select\" 或 \"exec\"", "type": "string" } } }, "diskcache.Status": { "type": "object", "properties": { "base_path": { "type": "string" }, "keys_count": { "type": "integer" }, "lru_enabled": { "type": "boolean" }, "max_size_mb": { "type": "integer" }, "total_size": { "type": "integer" }, "ttl_minutes": { "type": "integer" } } }, "flared.ApplyLogPayload": { "type": "object", "properties": { "checksum": { "type": "string" }, "main_config_checksum": { "type": "string" }, "message": { "type": "string" }, "node_id": { "type": "string" }, "result": { "type": "string" }, "route_config_checksum": { "type": "string" }, "support_file_count": { "type": "integer" }, "version": { "type": "string" } } }, "flared.HeartbeatPayload": { "type": "object", "properties": { "client_version": { "type": "string" }, "connected_relays": { "type": "array", "items": { "$ref": "#/definitions/protocol.FlaredConnectedRelay" } }, "current_checksum": { "type": "string" }, "current_version": { "type": "string" }, "frp_version": { "type": "string" }, "ip": { "type": "string" }, "tunnel_status": { "type": "string" } } }, "flared.HeartbeatResponse": { "type": "object", "properties": { "active_config": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.ActiveConfigMeta" }, "tunnel_settings": { "$ref": "#/definitions/protocol.RelaySettings" } } }, "flared.TunnelConfigResponse": { "type": "object", "properties": { "checksum": { "type": "string" }, "proxies": { "type": "array", "items": { "$ref": "#/definitions/protocol.FlaredProxyEntry" } }, "relays": { "type": "array", "items": { "$ref": "#/definitions/protocol.FlaredRelayInfo" } }, "version": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_internal_apps_cap.ChallengeResponse": { "type": "object", "properties": { "challenge": { "type": "object", "properties": { "c": { "type": "integer" }, "d": { "type": "integer" }, "s": { "type": "integer" } } }, "expires": { "description": "ms timestamp", "type": "integer" }, "token": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_internal_apps_cap.RedeemResponse": { "type": "object", "properties": { "error": { "type": "string" }, "expires": { "type": "integer" }, "success": { "type": "boolean" }, "token": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_internal_model_analytics.ClickHouseOperationalStats": { "type": "object", "properties": { "active_parts": { "type": "integer" }, "async_insert_bytes": { "type": "integer" }, "async_insert_queue": { "type": "integer" }, "batch_writers": { "description": "BatchWriters reports in-process queue depth/drops/flush errors for CH writers.", "type": "array", "items": { "$ref": "#/definitions/analytics.BatchWriterStats" } }, "database": { "type": "string" }, "pending_mutations": { "type": "integer" }, "total_rows": { "type": "integer" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.ActiveConfigMeta": { "type": "object", "properties": { "checksum": { "type": "string" }, "version": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.BufferedObservabilityRecord": { "type": "object", "properties": { "access_logs": { "type": "array", "items": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeAccessLog" } }, "captured_at_unix": { "type": "integer" }, "edge_health": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeEdgeHealth" }, "host_metrics": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_pkg_protocol.NodeMetricSnapshot" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.NodeAccessLog": { "type": "object", "properties": { "bytes_sent": { "description": "body bytes = 已提供数据", "type": "integer" }, "cache_status": { "description": "$upstream_cache_status", "type": "string" }, "host": { "type": "string" }, "logged_at_unix": { "type": "integer" }, "path": { "type": "string" }, "remote_addr": { "type": "string" }, "request_length": { "description": "接收数据", "type": "integer" }, "request_time_ms": { "description": "optional", "type": "integer" }, "status_code": { "type": "integer" }, "user_agent": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.NodeEdgeHealth": { "type": "object", "properties": { "captured_at_unix": { "type": "integer" }, "connections": { "type": "integer" }, "message": { "type": "string" }, "status": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.NodeHealthEvent": { "type": "object", "properties": { "event_type": { "type": "string" }, "message": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "severity": { "type": "string" }, "triggered_at_unix": { "type": "integer" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.NodeMetricSnapshot": { "type": "object", "properties": { "captured_at_unix": { "type": "integer" }, "cpu_usage_percent": { "type": "number" }, "disk_read_bytes": { "type": "integer" }, "disk_write_bytes": { "type": "integer" }, "memory_total_bytes": { "type": "integer" }, "memory_used_bytes": { "type": "integer" }, "storage_total_bytes": { "type": "integer" }, "storage_used_bytes": { "type": "integer" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.NodeSystemProfile": { "type": "object", "properties": { "architecture": { "type": "string" }, "cpu_cores": { "type": "integer" }, "cpu_model": { "type": "string" }, "hostname": { "type": "string" }, "kernel_version": { "type": "string" }, "os_name": { "type": "string" }, "os_version": { "type": "string" }, "reported_at_unix": { "type": "integer" }, "total_disk_bytes": { "type": "integer" }, "total_memory_bytes": { "type": "integer" }, "uptime_seconds": { "type": "integer" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.PagesDeploymentHashResponse": { "type": "object", "properties": { "deployment_id": { "type": "integer" }, "hash": { "type": "string" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.PagesProjectLatestHashResponse": { "type": "object", "properties": { "deployment_id": { "type": "integer" }, "file_count": { "type": "integer" }, "hash": { "type": "string" }, "package_size": { "type": "integer" }, "project_id": { "type": "integer" }, "total_size": { "type": "integer" } } }, "github_com_Rain-kl_Wavelet_pkg_protocol.WAFIPGroup": { "type": "object", "properties": { "checksum": { "type": "string" }, "enabled": { "type": "boolean" }, "id": { "type": "integer" }, "ip_list": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "type": { "type": "string" } } }, "handler.batchDownloadRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "string" } } } }, "handler.distributionItem": { "type": "object", "properties": { "count": { "type": "integer" }, "name": { "type": "string" }, "size": { "type": "integer" } } }, "handler.fileStatsResponse": { "type": "object", "properties": { "categories": { "type": "array", "items": { "$ref": "#/definitions/handler.distributionItem" } }, "total_count": { "type": "integer" }, "total_size": { "type": "integer" }, "trend": { "type": "array", "items": { "$ref": "#/definitions/handler.trendItem" } }, "types": { "type": "array", "items": { "$ref": "#/definitions/handler.distributionItem" } } } }, "handler.listFilesResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/model.Upload" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "handler.listMyFilesResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/model.Upload" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "handler.trendItem": { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" }, "size": { "type": "integer" } } }, "handler.updateMyFileRequest": { "type": "object", "properties": { "access_mode": { "type": "integer", "enum": [ 0, 1 ] }, "file_name": { "type": "string", "maxLength": 255 } } }, "logger.LogEntry": { "type": "object", "properties": { "data": { "description": "一行日志原文(含换行符)", "type": "string" }, "index": { "description": "全局递增序号", "type": "integer" } } }, "logs.accessLogItem": { "type": "object", "properties": { "created_at": { "type": "string" }, "headers": { "type": "string" }, "id": { "type": "string", "example": "0" }, "ip": { "type": "string" }, "latency": { "type": "integer" }, "method": { "type": "string" }, "nickname": { "type": "string" }, "path": { "type": "string" }, "status": { "type": "integer" }, "user_agent": { "type": "string" }, "user_id": { "type": "string", "example": "0" }, "username": { "type": "string" } } }, "logs.accessLogsResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/logs.accessLogItem" } }, "total": { "type": "integer" } } }, "logs.browserItem": { "type": "object", "properties": { "browser": { "type": "string" }, "count": { "type": "integer" } } }, "logs.logsAnalyticsResponse": { "type": "object", "properties": { "browsers": { "type": "array", "items": { "$ref": "#/definitions/logs.browserItem" } }, "top_users": { "type": "array", "items": { "$ref": "#/definitions/logs.topUserItem" } }, "trend": { "type": "array", "items": { "$ref": "#/definitions/logs.trendItem" } } } }, "logs.logsResponse": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "lines": { "type": "array", "items": { "$ref": "#/definitions/logger.LogEntry" } }, "next_cursor": { "description": "用于加载更早日志的 cursor", "type": "integer" } } }, "logs.topUserItem": { "type": "object", "properties": { "count": { "type": "integer" }, "nickname": { "type": "string" }, "user_id": { "type": "string", "example": "0" }, "username": { "type": "string" } } }, "logs.trendItem": { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" } } }, "model.AccessToken": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_admin": { "type": "boolean" }, "masked_token": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "model.AcmeAccount": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "integer" }, "updated_at": { "type": "string" }, "url": { "type": "string" } } }, "model.AuthSource": { "type": "object", "properties": { "client_id": { "type": "string" }, "client_secret_configured": { "type": "boolean" }, "created_at": { "type": "string" }, "display_name": { "type": "string" }, "icon_url": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "openid_discovery_url": { "type": "string" }, "scopes": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.ConfigVersion": { "type": "object", "properties": { "checksum": { "type": "string" }, "created_at": { "type": "string" }, "created_by": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "main_config": { "type": "string" }, "rendered_config": { "type": "string" }, "snapshot_json": { "type": "string" }, "support_files_json": { "type": "string" }, "version": { "type": "string" } } }, "model.ConfigVersionSummary": { "type": "object", "properties": { "checksum": { "type": "string" }, "created_at": { "type": "string" }, "created_by": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "version": { "type": "string" } } }, "model.DNSAccount": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.ExternalAccountView": { "type": "object", "properties": { "auth_source_id": { "type": "integer" }, "auth_source_label": { "type": "string" }, "auth_source_name": { "type": "string" }, "auth_source_type": { "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "external_username": { "type": "string" }, "id": { "type": "integer" } } }, "model.OpenFlareApplyLog": { "type": "object", "properties": { "checksum": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "main_config_checksum": { "type": "string" }, "message": { "type": "string" }, "node_id": { "type": "string" }, "result": { "type": "string" }, "route_config_checksum": { "type": "string" }, "support_file_count": { "type": "integer" }, "version": { "type": "string" } } }, "model.OpenFlareHealthEvent": { "type": "object", "properties": { "created_at": { "type": "string" }, "event_type": { "type": "string" }, "first_triggered_at": { "type": "string" }, "id": { "type": "integer" }, "last_triggered_at": { "type": "string" }, "message": { "type": "string" }, "metadata_json": { "type": "string" }, "node_id": { "type": "string" }, "reported_at": { "type": "string" }, "resolved_at": { "type": "string" }, "severity": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.OpenFlareNode": { "type": "object", "properties": { "auto_update_enabled": { "type": "boolean" }, "capabilities_json": { "type": "string" }, "created_at": { "type": "string" }, "current_version": { "type": "string" }, "ext_version": { "type": "string" }, "geo_latitude": { "type": "number" }, "geo_longitude": { "type": "number" }, "geo_manual_override": { "type": "boolean" }, "geo_name": { "type": "string" }, "id": { "type": "integer" }, "ip": { "type": "string" }, "ip_manual_override": { "type": "boolean" }, "last_error": { "type": "string" }, "last_seen_at": { "type": "string" }, "name": { "type": "string" }, "node_id": { "type": "string" }, "node_type": { "type": "string" }, "openresty_message": { "type": "string" }, "openresty_status": { "type": "string" }, "relay_agent_access_addr": { "type": "string" }, "relay_bind_port": { "type": "integer" }, "relay_client_access_addr": { "type": "string" }, "relay_client_proxy_url": { "type": "string" }, "relay_status": { "type": "string" }, "relay_vhost_http_port": { "type": "integer" }, "relay_web_server_enabled": { "type": "boolean" }, "restart_openresty_requested": { "type": "boolean" }, "status": { "type": "string" }, "update_channel": { "type": "string" }, "update_requested": { "type": "boolean" }, "update_tag": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "string" } } }, "model.OpenFlareNodeSystemProfile": { "type": "object", "properties": { "architecture": { "type": "string" }, "cpu_cores": { "type": "integer" }, "cpu_model": { "type": "string" }, "created_at": { "type": "string" }, "hostname": { "type": "string" }, "id": { "type": "integer" }, "kernel_version": { "type": "string" }, "node_id": { "type": "string" }, "os_name": { "type": "string" }, "os_version": { "type": "string" }, "reported_at": { "type": "string" }, "total_disk_bytes": { "type": "integer" }, "total_memory_bytes": { "type": "integer" }, "updated_at": { "type": "string" }, "uptime_seconds": { "type": "integer" } } }, "model.OpenFlareOption": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "model.PushChannel": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "description": "备注", "type": "string" }, "enabled": { "description": "通道是否启用", "type": "boolean" }, "id": { "type": "integer" }, "name": { "description": "通道名称,仅英文字母和下划线,唯一", "type": "string" }, "other": { "description": "请求体/SMTP 密码等", "type": "string" }, "token": { "description": "鉴权令牌或发信用户名等", "type": "string" }, "type": { "description": "通道类型:custom, lark, email", "type": "string" }, "updated_at": { "type": "string" }, "url": { "description": "请求地址,HTTPS 协议或 SMTP 地址", "type": "string" } } }, "model.PushEvent": { "type": "object", "properties": { "channels": { "description": "推送渠道列表,如 [\"lark\"]", "type": "array", "items": { "type": "string" } }, "created_at": { "type": "string" }, "enabled": { "description": "是否启用", "type": "boolean" }, "event_key": { "description": "如 admin_login", "type": "string" }, "id": { "type": "integer" }, "name": { "description": "如 管理员登录", "type": "string" }, "targets": { "description": "推送目标用户/邮箱列表", "type": "array", "items": { "type": "string" } }, "task_type": { "description": "关联的异步任务类型", "type": "string" }, "template": { "description": "消息模板 JSON", "type": "string" }, "updated_at": { "type": "string" } } }, "model.PushHistory": { "type": "object", "properties": { "channel": { "type": "string" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "error_msg": { "type": "string" }, "event_key": { "type": "string" }, "id": { "type": "integer" }, "level": { "type": "string" }, "status": { "description": "success / failed", "type": "string" }, "target": { "type": "string" }, "title": { "type": "string" } } }, "model.Schedule": { "type": "object", "properties": { "created_at": { "type": "string" }, "cron": { "type": "string" }, "id": { "type": "string", "example": "0" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "payload": { "type": "string" }, "task_type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.SystemConfig": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "key": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" }, "value": { "type": "string" }, "visibility": { "type": "integer" } } }, "model.TLSCertificate": { "type": "object", "properties": { "acme_account_id": { "type": "integer" }, "apply_message": { "type": "string" }, "apply_status": { "type": "string" }, "auto_renew": { "type": "boolean" }, "created_at": { "type": "string" }, "disable_cname": { "type": "boolean" }, "dns1": { "type": "string" }, "dns2": { "type": "string" }, "dns_account_id": { "type": "integer" }, "id": { "type": "integer" }, "key_algorithm": { "type": "string" }, "name": { "type": "string" }, "not_after": { "type": "string" }, "not_before": { "type": "string" }, "other_domains": { "type": "string" }, "primary_domain": { "type": "string" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "skip_dns": { "type": "boolean" }, "updated_at": { "type": "string" } } }, "model.TaskExecution": { "type": "object", "properties": { "created_at": { "type": "string" }, "duration": { "type": "integer" }, "error_message": { "type": "string" }, "finished_at": { "type": "string" }, "id": { "type": "string", "example": "0" }, "log": { "type": "string" }, "max_retry": { "type": "integer" }, "payload": { "type": "string" }, "result": { "type": "string" }, "retry_count": { "type": "integer" }, "retryable": { "type": "boolean" }, "started_at": { "type": "string" }, "status": { "$ref": "#/definitions/model.TaskExecutionStatus" }, "task_id": { "type": "string" }, "task_name": { "type": "string" }, "task_type": { "type": "string" }, "triggered_by": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.TaskExecutionStatus": { "type": "string", "enum": [ "pending", "running", "succeeded", "failed" ], "x-enum-varnames": [ "TaskExecutionStatusPending", "TaskExecutionStatusRunning", "TaskExecutionStatusSucceeded", "TaskExecutionStatusFailed" ] }, "model.Template": { "type": "object", "properties": { "content": { "type": "string" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "is_system": { "type": "boolean" }, "key": { "type": "string" }, "name": { "type": "string" }, "subject": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Upload": { "type": "object", "properties": { "access_mode": { "type": "integer" }, "created_at": { "type": "string" }, "extension": { "description": "文件后缀名 (不含点,如 png, pdf)", "type": "string" }, "file_name": { "description": "原始文件名 (例如: image.png)", "type": "string" }, "file_path": { "description": "文件相对路径 / S3 Key", "type": "string" }, "file_size": { "description": "文件大小(字节)", "type": "integer" }, "hash": { "description": "文件哈希 (SHA-256/MD5,可用于排重)", "type": "string" }, "id": { "type": "string", "example": "0" }, "metadata": { "description": "业务扩展元数据", "allOf": [ { "$ref": "#/definitions/model.UploadMetadata" } ] }, "mime_type": { "description": "媒体类型 (MIME, 如 image/png)", "type": "string" }, "status": { "description": "状态", "allOf": [ { "$ref": "#/definitions/model.UploadStatus" } ] }, "type": { "description": "业务标识类型 (如 avatar, doc, attachment)", "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "string", "example": "0" } } }, "model.UploadMetadata": { "type": "object", "properties": { "bucket": { "description": "存储桶名称 (适用于 S3 等)", "type": "string" }, "client_ip": { "description": "上传者 IP", "type": "string" }, "duration": { "description": "音视频时长 (s)", "type": "number" }, "extra": { "description": "其它任意业务自定义元数据", "type": "object", "additionalProperties": {} }, "height": { "description": "图像/视频高度 (px)", "type": "integer" }, "original_mime": { "description": "原始 MIME 类型", "type": "string" }, "user_agent": { "description": "上传者的 UA", "type": "string" }, "width": { "description": "图像/视频宽度 (px)", "type": "integer" } } }, "model.UploadStatus": { "type": "string", "enum": [ "pending", "used", "deleted" ], "x-enum-comments": { "UploadStatusDeleted": "已删除", "UploadStatusPending": "待使用", "UploadStatusUsed": "已使用" }, "x-enum-descriptions": [ "待使用", "已使用", "已删除" ], "x-enum-varnames": [ "UploadStatusPending", "UploadStatusUsed", "UploadStatusDeleted" ] }, "model.Zone": { "type": "object", "properties": { "created_at": { "type": "string" }, "domain": { "type": "string" }, "id": { "type": "integer" }, "updated_at": { "type": "string" } } }, "model.ZoneDomain": { "type": "object", "properties": { "cert_id": { "type": "integer" }, "created_at": { "type": "string" }, "domain": { "type": "string" }, "id": { "type": "integer" }, "proxy_route_id": { "type": "integer" }, "updated_at": { "type": "string" }, "zone_id": { "type": "integer" } } }, "node.AgentReleaseInfo": { "type": "object", "properties": { "body": { "type": "string" }, "channel": { "type": "string" }, "current_version": { "type": "string" }, "has_update": { "type": "boolean" }, "html_url": { "type": "string" }, "prerelease": { "type": "boolean" }, "published_at": { "type": "string" }, "requested_channel": { "type": "string" }, "requested_tag": { "type": "string" }, "tag_name": { "type": "string" }, "update_requested": { "type": "boolean" } } }, "node.AgentUpdateInput": { "type": "object", "properties": { "channel": { "type": "string" }, "tag_name": { "type": "string" } } }, "node.BootstrapView": { "type": "object", "properties": { "discovery_token": { "type": "string" } } }, "node.HealthEventCleanupResult": { "type": "object", "properties": { "deleted_count": { "type": "integer" }, "node_id": { "type": "string" } } }, "node.Input": { "type": "object", "properties": { "auto_update_enabled": { "type": "boolean" }, "geo_latitude": { "type": "number" }, "geo_longitude": { "type": "number" }, "geo_manual_override": { "type": "boolean" }, "geo_name": { "type": "string" }, "ip": { "type": "string" }, "ip_manual_override": { "type": "boolean" }, "name": { "type": "string" }, "node_type": { "type": "string" }, "relay_agent_access_addr": { "type": "string" }, "relay_bind_port": { "type": "integer" }, "relay_client_access_addr": { "type": "string" }, "relay_client_proxy_url": { "type": "string" }, "relay_vhost_http_port": { "type": "integer" }, "relay_web_server_enabled": { "type": "boolean" } } }, "node.ObservabilityView": { "type": "object", "properties": { "analytics": { "$ref": "#/definitions/observability.NodeAnalytics" }, "health_events": { "type": "array", "items": { "$ref": "#/definitions/model.OpenFlareHealthEvent" } }, "metric_snapshots": { "type": "array", "items": { "$ref": "#/definitions/observability.NodeMetricSnapshotView" } }, "node_id": { "type": "string" }, "profile": { "$ref": "#/definitions/model.OpenFlareNodeSystemProfile" }, "relay_dashboard": { "$ref": "#/definitions/observability.RelayDashboardSnapshot" }, "trends": { "$ref": "#/definitions/observability.NodeTrends" } } }, "node.View": { "type": "object", "properties": { "access_token": { "type": "string" }, "auto_update_enabled": { "type": "boolean" }, "created_at": { "type": "string" }, "current_version": { "type": "string" }, "ext_version": { "type": "string" }, "geo_latitude": { "type": "number" }, "geo_longitude": { "type": "number" }, "geo_manual_override": { "type": "boolean" }, "geo_name": { "type": "string" }, "id": { "type": "integer" }, "ip": { "type": "string" }, "ip_manual_override": { "type": "boolean" }, "last_error": { "type": "string" }, "last_seen_at": {}, "latest_apply_at": { "type": "string" }, "latest_apply_checksum": { "type": "string" }, "latest_apply_message": { "type": "string" }, "latest_apply_result": { "type": "string" }, "latest_main_config_checksum": { "type": "string" }, "latest_route_config_checksum": { "type": "string" }, "latest_support_file_count": { "type": "integer" }, "name": { "type": "string" }, "node_id": { "type": "string" }, "node_type": { "type": "string" }, "openresty_message": { "type": "string" }, "openresty_status": { "type": "string" }, "relay_agent_access_addr": { "type": "string" }, "relay_bind_port": { "type": "integer" }, "relay_client_access_addr": { "type": "string" }, "relay_client_proxy_url": { "type": "string" }, "relay_status": { "type": "string" }, "relay_vhost_http_port": { "type": "integer" }, "relay_web_server_enabled": { "type": "boolean" }, "restart_openresty_requested": { "type": "boolean" }, "status": { "type": "string" }, "update_channel": { "type": "string" }, "update_requested": { "type": "boolean" }, "update_tag": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "string" } } }, "oauth.AuthSourceView": { "type": "object", "properties": { "client_secret_configured": { "type": "boolean" }, "display_name": { "type": "string" }, "icon_url": { "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "oauth.BasicUserInfo": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "bio": { "type": "string" }, "email": { "type": "string" }, "gender": { "type": "string" }, "id": { "type": "integer" }, "is_admin": { "type": "boolean" }, "location": { "type": "string" }, "need_change_password": { "type": "boolean" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "username": { "type": "string" }, "website": { "type": "string" } } }, "oauth.CallbackRequest": { "type": "object", "required": [ "code", "state" ], "properties": { "code": { "type": "string" }, "state": { "type": "string" } } }, "oauth.OAuthAuthorizeResponse": { "type": "object", "properties": { "authorize_url": { "type": "string" } } }, "oauth.OAuthCallbackResult": { "type": "object", "properties": { "status": { "type": "string" }, "user": { "$ref": "#/definitions/oauth.BasicUserInfo" } } }, "observability.AccessLogCleanupInput": { "type": "object", "properties": { "retention_days": { "type": "integer" } } }, "observability.AccessLogCleanupResult": { "type": "object", "properties": { "cutoff": { "type": "string" }, "deleted_count": { "type": "integer" }, "retention_days": { "type": "integer" } } }, "observability.AccessLogIPAnalysisSummary": { "type": "object", "properties": { "bandwidth_served": { "type": "integer" }, "bytes_received": { "type": "integer" }, "error_count": { "type": "integer" }, "total_requests": { "type": "integer" }, "unique_hosts": { "type": "integer" }, "unique_paths": { "type": "integer" } } }, "observability.AccessLogIPAnalysisView": { "type": "object", "properties": { "device_types": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "generated_at": { "type": "string" }, "hours": { "type": "integer" }, "remote_addr": { "type": "string" }, "status_codes": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "summary": { "$ref": "#/definitions/observability.AccessLogIPAnalysisSummary" }, "top_browsers": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_hosts": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_paths": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_user_agents": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } } } }, "observability.AccessLogIPSummaryList": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "hours": { "type": "integer" }, "items": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogIPSummaryView" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "since": { "type": "string" }, "sort_by": { "type": "string" }, "sort_order": { "type": "string" }, "total_ip": { "type": "integer" }, "until": { "type": "string" } } }, "observability.AccessLogIPSummaryView": { "type": "object", "properties": { "bytes_received": { "type": "integer" }, "bytes_sent": { "type": "integer" }, "last_seen_at": { "type": "string" }, "recent_requests": { "description": "RecentRequests is deprecated and always 0.", "type": "integer" }, "region": { "type": "string" }, "remote_addr": { "type": "string" }, "success_2xx_count": { "type": "integer" }, "success_ratio": { "type": "number" }, "total_requests": { "type": "integer" } } }, "observability.AccessLogIPTrendPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "request_count": { "type": "integer" } } }, "observability.AccessLogIPTrendView": { "type": "object", "properties": { "bucket_minutes": { "type": "integer" }, "hours": { "type": "integer" }, "points": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogIPTrendPoint" } }, "remote_addr": { "type": "string" } } }, "observability.AccessLogList": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogView" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total_ip": { "type": "integer" }, "total_record": { "type": "integer" } } }, "observability.AccessLogOverview": { "type": "object", "properties": { "bucket_minutes": { "type": "integer" }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "generated_at": { "type": "string" }, "hours": { "type": "integer" }, "status_codes": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "summary": { "$ref": "#/definitions/observability.AccessLogOverviewSummary" }, "top_browsers": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_hosts": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_ips": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_operating_systems": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_paths": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_user_agents": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "trends": { "$ref": "#/definitions/observability.AccessLogOverviewTrends" } } }, "observability.AccessLogOverviewMetricPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "value": { "type": "integer" } } }, "observability.AccessLogOverviewSummary": { "type": "object", "properties": { "bandwidth_served": { "type": "integer" }, "total_requests": { "type": "integer" }, "total_visits": { "type": "integer" } } }, "observability.AccessLogOverviewTrends": { "type": "object", "properties": { "bandwidth": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogOverviewMetricPoint" } }, "requests": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogOverviewMetricPoint" } }, "visits": { "type": "array", "items": { "$ref": "#/definitions/observability.AccessLogOverviewMetricPoint" } } } }, "observability.AccessLogView": { "type": "object", "properties": { "bytes_sent": { "type": "integer" }, "cache_status": { "type": "string" }, "created_at": { "type": "string" }, "host": { "type": "string" }, "id": { "type": "string" }, "logged_at": { "type": "string" }, "node_id": { "type": "string" }, "node_name": { "type": "string" }, "path": { "type": "string" }, "region": { "type": "string" }, "remote_addr": { "type": "string" }, "request_length": { "type": "integer" }, "request_time_ms": { "type": "integer" }, "status_code": { "type": "integer" }, "user_agent": { "type": "string" } } }, "observability.CapacityTrendPoint": { "type": "object", "properties": { "average_cpu_usage_percent": { "type": "number" }, "average_memory_usage_percent": { "type": "number" }, "bucket_started_at": { "type": "string" }, "reported_nodes": { "type": "integer" } } }, "observability.DiskIOTrendPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "disk_read_bytes": { "type": "integer" }, "disk_write_bytes": { "type": "integer" }, "reported_nodes": { "type": "integer" } } }, "observability.DistributionItem": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "integer" } } }, "observability.FoldedAccessLogIPList": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "fold_minutes": { "type": "integer" }, "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/observability.FoldedAccessLogIPView" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "sort_by": { "type": "string" }, "sort_order": { "type": "string" }, "total_ip": { "type": "integer" } } }, "observability.FoldedAccessLogIPView": { "type": "object", "properties": { "client_error_count": { "type": "integer" }, "last_seen_at": { "type": "string" }, "remote_addr": { "type": "string" }, "request_count": { "type": "integer" }, "server_error_count": { "type": "integer" }, "success_count": { "type": "integer" } } }, "observability.FoldedAccessLogList": { "type": "object", "properties": { "fold_minutes": { "type": "integer" }, "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/observability.FoldedAccessLogView" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total_bucket": { "type": "integer" }, "total_ip": { "type": "integer" }, "total_record": { "type": "integer" } } }, "observability.FoldedAccessLogView": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "client_error_count": { "type": "integer" }, "request_count": { "type": "integer" }, "server_error_count": { "type": "integer" }, "success_count": { "type": "integer" }, "unique_host_count": { "type": "integer" }, "unique_ip_count": { "type": "integer" } } }, "observability.HealthSummary": { "type": "object", "properties": { "active_alerts": { "type": "integer" }, "critical_alerts": { "type": "integer" }, "has_capacity_risk": { "type": "boolean" }, "has_runtime_risk": { "type": "boolean" }, "has_traffic_risk": { "type": "boolean" }, "info_alerts": { "type": "integer" }, "resolved_alerts": { "type": "integer" }, "warning_alerts": { "type": "integer" } } }, "observability.NetworkTrendPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "bytes_provided": { "description": "sum(bytes_sent)", "type": "integer" }, "bytes_received": { "description": "sum(request_length)", "type": "integer" }, "reported_nodes": { "type": "integer" } } }, "observability.NodeAnalytics": { "type": "object", "properties": { "distributions": { "$ref": "#/definitions/observability.TrafficDistributions" }, "health": { "$ref": "#/definitions/observability.HealthSummary" }, "traffic": { "$ref": "#/definitions/observability.TrafficWindowSummary" } } }, "observability.NodeMetricSnapshotView": { "type": "object", "properties": { "captured_at": { "type": "string" }, "cpu_usage_percent": { "type": "number" }, "disk_read_bytes": { "type": "integer" }, "disk_write_bytes": { "type": "integer" }, "id": { "type": "integer" }, "memory_total_bytes": { "type": "integer" }, "memory_used_bytes": { "type": "integer" }, "node_id": { "type": "string" }, "openresty_connections": { "type": "integer" }, "storage_total_bytes": { "type": "integer" }, "storage_used_bytes": { "type": "integer" } } }, "observability.NodeTrends": { "type": "object", "properties": { "capacity_24h": { "type": "array", "items": { "$ref": "#/definitions/observability.CapacityTrendPoint" } }, "disk_io_24h": { "type": "array", "items": { "$ref": "#/definitions/observability.DiskIOTrendPoint" } }, "network_24h": { "type": "array", "items": { "$ref": "#/definitions/observability.NetworkTrendPoint" } }, "traffic_24h": { "type": "array", "items": { "$ref": "#/definitions/observability.TrafficTrendPoint" } } } }, "observability.RelayDashboardSnapshot": { "type": "object", "properties": { "client_counts": { "type": "integer" }, "offline_proxies": { "type": "integer" }, "online_proxies": { "type": "integer" }, "proxies": { "type": "array", "items": { "$ref": "#/definitions/observability.RelayProxyStat" } }, "total_connections": { "type": "integer" }, "total_proxies": { "type": "integer" } } }, "observability.RelayProxyStat": { "type": "object", "properties": { "client_addr": { "type": "string" }, "client_version": { "type": "string" }, "last_close_time": { "type": "string" }, "last_start_time": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" } } }, "observability.TrafficDistributions": { "type": "object", "properties": { "source_countries": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "status_codes": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } }, "top_domains": { "type": "array", "items": { "$ref": "#/definitions/observability.DistributionItem" } } } }, "observability.TrafficTrendPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "error_count": { "type": "integer" }, "request_count": { "type": "integer" }, "status_2xx_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "unique_visitor_count": { "type": "integer" } } }, "observability.TrafficWindowSummary": { "type": "object", "properties": { "error_count": { "type": "integer" }, "error_rate_percent": { "type": "number" }, "estimated_qps": { "type": "number" }, "request_count": { "type": "integer" }, "unique_visitor_count": { "type": "integer" }, "window_ended_at": { "type": "string" }, "window_started_at": { "type": "string" } } }, "option.geoIPLookupRequest": { "type": "object", "properties": { "ip": { "type": "string" }, "provider": { "type": "string" } } }, "option.geoIPLookupView": { "type": "object", "properties": { "ip": { "type": "string" }, "iso_code": { "type": "string" }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "name": { "type": "string" }, "provider": { "type": "string" } } }, "option.optionBatchPayload": { "type": "object", "properties": { "options": { "type": "array", "items": { "$ref": "#/definitions/model.OpenFlareOption" } } } }, "option.publicAuthSourceView": { "type": "object", "properties": { "authorize_url": { "type": "string" }, "display_name": { "type": "string" }, "icon_url": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "option.statusView": { "type": "object", "properties": { "auth_sources": { "type": "array", "items": { "$ref": "#/definitions/option.publicAuthSourceView" } }, "cap_login_enabled": { "type": "boolean" }, "email_verification": { "type": "boolean" }, "password_register_enabled": { "type": "boolean" }, "server_address": { "type": "string" }, "start_time": { "type": "integer" }, "version": { "type": "string" } } }, "origin.DetailView": { "type": "object", "properties": { "address": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "remark": { "type": "string" }, "route_count": { "type": "integer" }, "routes": { "type": "array", "items": { "$ref": "#/definitions/origin.RouteSummary" } }, "updated_at": { "type": "string" } } }, "origin.Input": { "type": "object", "properties": { "address": { "type": "string" }, "name": { "type": "string" }, "remark": { "type": "string" } } }, "origin.RouteSummary": { "type": "object", "properties": { "domain": { "type": "string" }, "enabled": { "type": "boolean" }, "id": { "type": "integer" }, "origin_url": { "type": "string" }, "updated_at": { "type": "string" } } }, "origin.View": { "type": "object", "properties": { "address": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "remark": { "type": "string" }, "route_count": { "type": "integer" }, "updated_at": { "type": "string" } } }, "pages.DeploymentFileView": { "type": "object", "properties": { "checksum": { "type": "string" }, "created_at": { "type": "string" }, "deployment_id": { "type": "integer" }, "id": { "type": "integer" }, "path": { "type": "string" }, "size": { "type": "integer" } } }, "pages.DeploymentView": { "type": "object", "properties": { "activated_at": { "type": "string" }, "checksum": { "type": "string" }, "created_at": { "type": "string" }, "created_by": { "type": "string" }, "deployment_number": { "type": "integer" }, "file_count": { "type": "integer" }, "id": { "type": "integer" }, "project_id": { "type": "integer" }, "source_label": { "type": "string" }, "source_type": { "type": "string" }, "status": { "type": "string" }, "total_size": { "type": "integer" }, "trigger_type": { "type": "string" }, "upload_id": { "type": "string", "example": "0" } } }, "pages.Input": { "type": "object", "properties": { "api_proxy_enabled": { "type": "boolean" }, "api_proxy_pass": { "type": "string" }, "api_proxy_path": { "type": "string" }, "api_proxy_rewrite": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "entry_file": { "type": "string" }, "name": { "type": "string" }, "root_dir": { "type": "string" }, "slug": { "type": "string" }, "spa_fallback_enabled": { "type": "boolean" }, "spa_fallback_path": { "type": "string" } } }, "pages.SourceActionReceipt": { "type": "object", "properties": { "action": { "type": "string" }, "execution_id": { "type": "string" }, "task_id": { "type": "string" } } }, "pages.SourceRevisionView": { "type": "object", "properties": { "asset_name": { "type": "string" }, "label": { "type": "string" }, "revision": { "type": "string" } } }, "pages.SourceSyncInput": { "type": "object", "properties": { "confirmed_revision": { "type": "string" } } }, "pages.SourceUpdateInput": { "type": "object", "properties": { "allow_insecure": { "type": "boolean" }, "asset_name": { "type": "string" }, "auto_update_enabled": { "type": "boolean" }, "check_interval_minutes": { "type": "integer" }, "release_selector": { "type": "string" }, "release_tag": { "type": "string" }, "remote_url": { "type": "string" }, "repository_url": { "type": "string" }, "source_type": { "type": "string" } } }, "pages.SourceUpdateResult": { "type": "object", "properties": { "check_task": { "$ref": "#/definitions/pages.SourceActionReceipt" }, "source": { "$ref": "#/definitions/pages.SourceView" }, "warning": { "type": "string" } } }, "pages.SourceView": { "type": "object", "properties": { "allow_insecure": { "type": "boolean" }, "asset_name": { "type": "string" }, "auto_update_enabled": { "type": "boolean" }, "check_interval_minutes": { "type": "integer" }, "github_repository": { "type": "string" }, "last_applied": { "$ref": "#/definitions/pages.SourceRevisionView" }, "last_checked_at": { "type": "string" }, "last_error": { "type": "string" }, "last_seen": { "$ref": "#/definitions/pages.SourceRevisionView" }, "last_synced_at": { "type": "string" }, "next_check_at": { "type": "string" }, "release_selector": { "type": "string" }, "release_tag": { "type": "string" }, "remote_url": { "type": "string" }, "source_type": { "type": "string" }, "sync_status": { "type": "string" }, "update_available": { "type": "boolean" } } }, "pages.UploadFromURLInput": { "type": "object", "properties": { "url": { "type": "string" } } }, "pages.View": { "type": "object", "properties": { "active_deployment": { "$ref": "#/definitions/pages.DeploymentView" }, "active_deployment_id": { "type": "integer" }, "api_proxy_enabled": { "type": "boolean" }, "api_proxy_pass": { "type": "string" }, "api_proxy_path": { "type": "string" }, "api_proxy_rewrite": { "type": "string" }, "created_at": { "type": "string" }, "deployment_count": { "type": "integer" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "entry_file": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "root_dir": { "type": "string" }, "slug": { "type": "string" }, "spa_fallback_enabled": { "type": "boolean" }, "spa_fallback_path": { "type": "string" }, "updated_at": { "type": "string" } } }, "protocol.AgentNodeHealthEvent": { "type": "object", "properties": { "event_type": { "type": "string" }, "message": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "severity": { "type": "string" }, "triggered_at_unix": { "type": "integer" } } }, "protocol.AgentNodeMetricSnapshot": { "type": "object", "properties": { "captured_at_unix": { "type": "integer" }, "cpu_usage_percent": { "type": "number" }, "disk_read_bytes": { "type": "integer" }, "disk_write_bytes": { "type": "integer" }, "memory_total_bytes": { "type": "integer" }, "memory_used_bytes": { "type": "integer" }, "storage_total_bytes": { "type": "integer" }, "storage_used_bytes": { "type": "integer" } } }, "protocol.AgentNodeSystemProfile": { "type": "object", "properties": { "architecture": { "type": "string" }, "cpu_cores": { "type": "integer" }, "cpu_model": { "type": "string" }, "hostname": { "type": "string" }, "kernel_version": { "type": "string" }, "os_name": { "type": "string" }, "os_version": { "type": "string" }, "reported_at_unix": { "type": "integer" }, "total_disk_bytes": { "type": "integer" }, "total_memory_bytes": { "type": "integer" }, "uptime_seconds": { "type": "integer" } } }, "protocol.FlaredConnectedRelay": { "type": "object", "properties": { "proxy_count": { "type": "integer" }, "relay_node_id": { "type": "string" }, "status": { "type": "string" } } }, "protocol.FlaredProxyEntry": { "type": "object", "properties": { "custom_domains": { "type": "array", "items": { "type": "string" } }, "local_addr": { "type": "string" }, "local_port": { "type": "integer" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "protocol.FlaredRelayInfo": { "type": "object", "properties": { "address": { "type": "string" }, "auth_token": { "type": "string" }, "proxy_url": { "type": "string" }, "relay_node_id": { "type": "string" } } }, "protocol.RelayConfig": { "type": "object", "properties": { "auth_token": { "type": "string" }, "bind_port": { "type": "integer" }, "log_level": { "type": "string" }, "vhost_http_port": { "type": "integer" }, "web_server_enabled": { "type": "boolean" }, "web_server_port": { "type": "integer" } } }, "protocol.RelayProxyStat": { "type": "object", "properties": { "client_addr": { "type": "string" }, "client_version": { "type": "string" }, "last_close_time": { "type": "string" }, "last_start_time": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" } } }, "protocol.RelaySettings": { "type": "object", "properties": { "auto_update": { "type": "boolean" }, "heartbeat_interval": { "type": "integer" }, "update_channel": { "type": "string" }, "update_now": { "type": "boolean" }, "update_repo": { "type": "string" }, "update_tag": { "type": "string" }, "websocket_upgrade_enabled": { "type": "boolean" } } }, "proxy_route.CustomHeaderInput": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "proxy_route.Input": { "type": "object", "properties": { "basic_auth_enabled": { "type": "boolean" }, "basic_auth_password": { "type": "string" }, "basic_auth_username": { "type": "string" }, "cache_enabled": { "type": "boolean" }, "cache_policy": { "type": "string" }, "cache_rules": { "type": "array", "items": { "type": "string" } }, "custom_headers": { "type": "array", "items": { "$ref": "#/definitions/proxy_route.CustomHeaderInput" } }, "enable_https": { "type": "boolean" }, "enabled": { "type": "boolean" }, "limit_conn_per_ip": { "type": "integer" }, "limit_conn_per_server": { "type": "integer" }, "limit_rate": { "type": "string" }, "limit_req_per_ip": { "type": "string" }, "origin_address": { "type": "string" }, "origin_host": { "type": "string" }, "origin_id": { "type": "integer" }, "origin_port": { "type": "string" }, "origin_scheme": { "type": "string" }, "origin_uri": { "type": "string" }, "origin_url": { "type": "string" }, "pages_project_id": { "type": "integer" }, "redirect_http": { "type": "boolean" }, "site_name": { "type": "string" }, "tunnel_id": { "type": "integer" }, "tunnel_node_id": { "type": "integer" }, "tunnel_target_addr": { "type": "string" }, "tunnel_target_protocol": { "type": "string" }, "upstream_type": { "type": "string" }, "upstreams": { "type": "array", "items": { "type": "string" } }, "zone_domain_ids": { "type": "array", "items": { "type": "integer" } } } }, "proxy_route.View": { "type": "object", "properties": { "basic_auth_enabled": { "type": "boolean" }, "basic_auth_password": { "type": "string" }, "basic_auth_username": { "type": "string" }, "cache_enabled": { "type": "boolean" }, "cache_policy": { "type": "string" }, "cache_rule_list": { "type": "array", "items": { "type": "string" } }, "cache_rules": { "type": "string" }, "created_at": { "type": "string" }, "custom_header_list": { "type": "array", "items": { "$ref": "#/definitions/proxy_route.CustomHeaderInput" } }, "custom_headers": { "type": "string" }, "enable_https": { "type": "boolean" }, "enabled": { "type": "boolean" }, "id": { "type": "integer" }, "limit_conn_per_ip": { "type": "integer" }, "limit_conn_per_server": { "type": "integer" }, "limit_rate": { "type": "string" }, "limit_req_per_ip": { "type": "string" }, "origin_host": { "type": "string" }, "origin_id": { "type": "integer" }, "origin_url": { "type": "string" }, "pages_project_id": { "type": "integer" }, "redirect_http": { "type": "boolean" }, "site_name": { "type": "string" }, "tunnel_id": { "type": "integer" }, "tunnel_node_id": { "type": "integer" }, "tunnel_target_addr": { "type": "string" }, "tunnel_target_protocol": { "type": "string" }, "updated_at": { "type": "string" }, "upstream_list": { "type": "array", "items": { "type": "string" } }, "upstream_type": { "type": "string" }, "upstreams": { "type": "string" }, "zone_domain_ids": { "type": "array", "items": { "type": "integer" } }, "zone_domains": { "type": "array", "items": { "$ref": "#/definitions/proxy_route.ZoneDomainView" } } } }, "proxy_route.ZoneDomainView": { "type": "object", "properties": { "cert_id": { "type": "integer" }, "domain": { "type": "string" }, "id": { "type": "integer" }, "zone_id": { "type": "integer" } } }, "push.Config": { "type": "object", "properties": { "channel": { "description": "渠道名称,例如 \"lark\", \"custom\", \"email\" 等,唯一标识", "type": "string" }, "ext": { "description": "预留拓展 JSON 配置", "type": "object", "additionalProperties": {} }, "key": { "description": "AppID 或 SMTP 用户名", "type": "string" }, "secret": { "description": "签名密钥或 SMTP 密码/Token", "type": "string" }, "url": { "description": "Webhook 地址或 SMTP 地址", "type": "string" } } }, "push.CreateChannelRequest": { "type": "object", "required": [ "name", "type" ], "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "name": { "type": "string" }, "other": { "type": "string" }, "token": { "type": "string" }, "type": { "type": "string" }, "url": { "type": "string" } } }, "push.CreateEventRequest": { "type": "object", "properties": { "channels": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean" }, "event_key": { "type": "string" }, "targets": { "type": "array", "items": { "type": "string" } }, "task_type": { "description": "关联的异步任务类型", "type": "string" }, "template": { "type": "string" } } }, "push.Definition": { "type": "object", "properties": { "description": { "description": "short description", "type": "string" }, "fields": { "description": "form fields", "type": "array", "items": { "$ref": "#/definitions/push.Field" } }, "name": { "description": "display name", "type": "string" }, "type": { "description": "channel type (e.g., custom, lark, email)", "type": "string" } } }, "push.EventMetadata": { "type": "object", "properties": { "default_template": { "$ref": "#/definitions/push.NotificationMessage" }, "description": { "type": "string" }, "key": { "type": "string" }, "name": { "type": "string" } } }, "push.Field": { "type": "object", "properties": { "description": { "description": "field explanation/help text", "type": "string" }, "key": { "description": "unique key for the field (e.g. url, token, other)", "type": "string" }, "label": { "description": "human readable label (e.g. \"Webhook 地址\")", "type": "string" }, "placeholder": { "description": "input placeholder", "type": "string" }, "required": { "description": "whether this field is required", "type": "boolean" }, "type": { "description": "input type: \"text\" | \"password\" | \"textarea\"", "type": "string" } } }, "push.NotificationMessage": { "type": "object", "properties": { "content": { "type": "string" }, "ext": { "type": "object", "additionalProperties": {} }, "level": { "type": "string" }, "title": { "type": "string" } } }, "push.TestChannelRequest": { "type": "object", "properties": { "name": { "type": "string" }, "other": { "type": "string" }, "target": { "type": "string" }, "token": { "type": "string" }, "type": { "type": "string" }, "url": { "type": "string" } } }, "push.TestPushRequest": { "type": "object", "required": [ "config" ], "properties": { "config": { "$ref": "#/definitions/push.Config" }, "target": { "type": "string" } } }, "push.UpdateChannelRequest": { "type": "object", "required": [ "type" ], "properties": { "description": { "type": "string" }, "enabled": { "type": "boolean" }, "other": { "type": "string" }, "token": { "type": "string" }, "type": { "type": "string" }, "url": { "type": "string" } } }, "push.UpdateEventRequest": { "type": "object", "required": [ "template" ], "properties": { "channels": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean" }, "targets": { "type": "array", "items": { "type": "string" } }, "template": { "type": "string" } } }, "push.pushHistoriesResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/model.PushHistory" } }, "total": { "type": "integer" } } }, "relay.HeartbeatPayload": { "type": "object", "properties": { "frp_version": { "type": "string" }, "frps_client_count": { "type": "integer" }, "frps_connections": { "type": "integer" }, "frps_proxies": { "type": "array", "items": { "$ref": "#/definitions/protocol.RelayProxyStat" } }, "frps_proxy_count": { "type": "integer" }, "health_events": { "type": "array", "items": { "$ref": "#/definitions/protocol.AgentNodeHealthEvent" } }, "ip": { "type": "string" }, "name": { "type": "string" }, "profile": { "$ref": "#/definitions/protocol.AgentNodeSystemProfile" }, "relay_status": { "type": "string" }, "snapshot": { "$ref": "#/definitions/protocol.AgentNodeMetricSnapshot" }, "version": { "type": "string" } } }, "relay.HeartbeatResponse": { "type": "object", "properties": { "relay_config": { "$ref": "#/definitions/protocol.RelayConfig" }, "relay_settings": { "$ref": "#/definitions/protocol.RelaySettings" } } }, "response.Any": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string", "example": "" } } }, "status.DatabaseInfoResponse": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "version": { "type": "string" } } }, "status.LogDatabaseStatus": { "type": "object", "properties": { "active_database": { "type": "string" }, "available_targets": { "type": "array", "items": { "type": "string" } }, "clickhouse": { "$ref": "#/definitions/github_com_Rain-kl_Wavelet_internal_model_analytics.ClickHouseOperationalStats" }, "migration": { "description": "idle | migrating", "type": "string" }, "retention_days": { "type": "object", "additionalProperties": { "type": "integer" } } } }, "status.SystemStatusResponse": { "type": "object", "properties": { "alloc": { "type": "string" }, "buck_hash_sys": { "type": "string" }, "frees": { "type": "integer" }, "gc_sys": { "type": "string" }, "heap_alloc": { "type": "string" }, "heap_idle": { "type": "string" }, "heap_inuse": { "type": "string" }, "heap_objects": { "type": "integer" }, "heap_released": { "type": "string" }, "heap_sys": { "type": "string" }, "last_gc_time": { "type": "string" }, "last_pause": { "type": "string" }, "lookups": { "type": "integer" }, "mallocs": { "type": "integer" }, "mcache_inuse": { "type": "string" }, "mcache_sys": { "type": "string" }, "mspan_inuse": { "type": "string" }, "mspan_sys": { "type": "string" }, "next_gc": { "type": "string" }, "num_gc": { "type": "integer" }, "num_goroutine": { "type": "integer" }, "other_sys": { "type": "string" }, "pause_total_ns": { "type": "string" }, "stack_inuse": { "type": "string" }, "stack_sys": { "type": "string" }, "sys": { "type": "string" }, "total_alloc": { "type": "string" }, "uptime": { "type": "string" } } }, "system_config.CreateSystemConfigRequest": { "type": "object", "required": [ "key", "type", "value" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "key": { "type": "string", "maxLength": 64 }, "type": { "type": "string", "enum": [ "system", "business" ] }, "value": { "type": "string" }, "visibility": { "type": "integer", "enum": [ 0, 1 ] } } }, "system_config.TestSMTPRequest": { "type": "object", "required": [ "smtp_host", "smtp_password", "smtp_port", "smtp_username", "to" ], "properties": { "smtp_host": { "type": "string", "maxLength": 255 }, "smtp_password": { "type": "string", "maxLength": 255 }, "smtp_port": { "type": "integer" }, "smtp_username": { "type": "string", "maxLength": 255 }, "to": { "type": "string" } } }, "system_config.TestSMTPResponse": { "type": "object", "properties": { "error": { "type": "string" }, "log": { "type": "string" }, "success": { "type": "boolean" } } }, "system_config.UpdateSystemConfigRequest": { "type": "object", "required": [ "value" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "value": { "type": "string" }, "visibility": { "type": "integer", "enum": [ 0, 1 ] } } }, "task.CreateScheduleRequest": { "type": "object", "required": [ "cron", "is_active", "name", "task_type" ], "properties": { "cron": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "payload": { "type": "string" }, "task_type": { "type": "string" } } }, "task.DispatchTaskRequest": { "type": "object", "required": [ "task_type" ], "properties": { "end_time": { "type": "string" }, "payload": { "type": "string" }, "start_time": { "type": "string" }, "task_type": { "type": "string" }, "user_id": { "type": "integer" } } }, "task.TaskMeta": { "type": "object", "properties": { "asynq_task": { "type": "string" }, "description": { "type": "string" }, "max_retry": { "type": "integer" }, "name": { "type": "string" }, "params": { "type": "array", "items": { "$ref": "#/definitions/task.TaskParam" } }, "queue": { "type": "string" }, "retryable": { "description": "是否支持手动重试", "type": "boolean" }, "supports_time": { "type": "boolean" }, "type": { "type": "string" } } }, "task.TaskParam": { "type": "object", "properties": { "description": { "description": "描述", "type": "string" }, "label": { "description": "显示名称", "type": "string" }, "name": { "description": "参数键名", "type": "string" }, "placeholder": { "description": "占位符", "type": "string" }, "required": { "description": "是否必填", "type": "boolean" }, "type": { "description": "类型:string, text, number, boolean", "type": "string" } } }, "task.UpdateScheduleRequest": { "type": "object", "required": [ "cron", "is_active", "name", "task_type" ], "properties": { "cron": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "payload": { "type": "string" }, "task_type": { "type": "string" } } }, "template.CreateTemplateRequest": { "type": "object", "required": [ "content", "key", "name", "type" ], "properties": { "content": { "type": "string" }, "description": { "type": "string", "maxLength": 255 }, "key": { "type": "string", "maxLength": 80 }, "name": { "type": "string", "maxLength": 100 }, "subject": { "type": "string", "maxLength": 255 }, "type": { "type": "string", "maxLength": 20 } } }, "template.UpdateTemplateRequest": { "type": "object", "required": [ "content", "name", "type" ], "properties": { "content": { "type": "string" }, "description": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 100 }, "subject": { "type": "string", "maxLength": 255 }, "type": { "type": "string", "maxLength": 20 } } }, "tls.ApplyInput": { "type": "object", "properties": { "acme_account_id": { "type": "integer" }, "auto_renew": { "type": "boolean" }, "disable_cname": { "type": "boolean" }, "dns1": { "type": "string" }, "dns2": { "type": "string" }, "dns_account_id": { "type": "integer" }, "key_algorithm": { "type": "string" }, "name": { "type": "string" }, "other_domains": { "type": "string" }, "primary_domain": { "type": "string" }, "remark": { "type": "string" }, "skip_dns": { "type": "boolean" } } }, "tls.CertificateContent": { "type": "object", "properties": { "acme_account_id": { "type": "integer" }, "apply_message": { "type": "string" }, "apply_status": { "type": "string" }, "auto_renew": { "type": "boolean" }, "cert_pem": { "type": "string" }, "disable_cname": { "type": "boolean" }, "dns1": { "type": "string" }, "dns2": { "type": "string" }, "dns_account_id": { "type": "integer" }, "id": { "type": "integer" }, "key_algorithm": { "type": "string" }, "key_pem": { "type": "string" }, "name": { "type": "string" }, "other_domains": { "type": "string" }, "primary_domain": { "type": "string" }, "provider": { "type": "string" }, "remark": { "type": "string" }, "skip_dns": { "type": "boolean" } } }, "tls.CertificateInput": { "type": "object", "properties": { "cert_pem": { "type": "string" }, "key_pem": { "type": "string" }, "name": { "type": "string" }, "remark": { "type": "string" } } }, "tls.DNSAccountInput": { "type": "object", "properties": { "authorization": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "updater.Status": { "type": "object", "properties": { "asset_name": { "type": "string" }, "build_time": { "type": "string" }, "can_upgrade": { "type": "boolean" }, "current_version": { "type": "string" }, "latest_version": { "type": "string" }, "platform": { "type": "string" }, "prerelease": { "type": "boolean" }, "published_at": { "type": "string" }, "release_name": { "type": "string" }, "release_notes": { "type": "string" }, "release_url": { "type": "string" }, "update_available": { "type": "boolean" }, "upstream_repository": { "type": "string" } } }, "user.changePasswordRequest": { "type": "object", "properties": { "new_password": { "type": "string" }, "old_password": { "type": "string" } } }, "user.createTokenRequest": { "type": "object", "properties": { "is_admin": { "type": "boolean" }, "name": { "type": "string" } } }, "user.createUserRequest": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string", "maxLength": 255 }, "is_active": { "type": "boolean" }, "is_admin": { "type": "boolean" }, "nickname": { "type": "string", "maxLength": 64 }, "password": { "type": "string", "maxLength": 64, "minLength": 8 }, "username": { "type": "string", "maxLength": 64, "minLength": 3 } } }, "user.listUsersResponse": { "type": "object", "properties": { "total": { "type": "integer" }, "users": { "type": "array", "items": { "$ref": "#/definitions/user.user" } } } }, "user.loginRequest": { "type": "object", "properties": { "code": { "type": "string" }, "password": { "type": "string" }, "username": { "type": "string" } } }, "user.registerRequest": { "type": "object", "properties": { "code": { "type": "string" }, "display_name": { "type": "string" }, "email": { "type": "string" }, "nickname": { "type": "string" }, "password": { "type": "string" }, "username": { "type": "string" } } }, "user.sendEmailCodeRequest": { "type": "object", "required": [ "email", "scene" ], "properties": { "email": { "type": "string" }, "scene": { "type": "string" } } }, "user.tokenResponse": { "type": "object", "properties": { "record": { "$ref": "#/definitions/model.AccessToken" }, "token": { "type": "string" } } }, "user.updateProfileRequest": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "bio": { "type": "string" }, "email": { "type": "string" }, "gender": { "type": "string" }, "location": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "website": { "type": "string" } } }, "user.updateUserRequest": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "maxLength": 255 }, "is_admin": { "type": "boolean" }, "nickname": { "type": "string", "maxLength": 64 }, "password": { "type": "string", "maxLength": 64, "minLength": 8 } } }, "user.updateUserStatusRequest": { "type": "object", "properties": { "is_active": { "type": "boolean" } } }, "user.user": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "bio": { "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "gender": { "type": "string" }, "id": { "type": "string", "example": "0" }, "is_active": { "type": "boolean" }, "is_admin": { "type": "boolean" }, "last_login_at": { "type": "string" }, "location": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "updated_at": { "type": "string" }, "username": { "type": "string" }, "website": { "type": "string" } } }, "waf.CreateRuleInput": { "type": "object", "properties": { "name": { "type": "string" } } }, "waf.IDsRequest": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "integer" } } } }, "waf.IPGroupAutoTestInput": { "type": "object", "properties": { "auto_config": { "type": "array", "items": { "type": "integer" } } } }, "waf.IPGroupAutoTestResult": { "type": "object", "properties": { "lookback": { "type": "string" }, "matched_count": { "type": "integer" }, "matched_ips": { "type": "array", "items": { "type": "string" } }, "rule_count": { "type": "integer" }, "tested_at": { "type": "string" } } }, "waf.IPGroupExtIPView": { "type": "object", "properties": { "captured_at": { "type": "string" }, "ip": { "type": "string" } } }, "waf.IPGroupInput": { "type": "object", "properties": { "auto_config": { "type": "array", "items": { "type": "integer" } }, "enabled": { "type": "boolean" }, "ip_list": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "subscription_format": { "type": "string" }, "subscription_mapping_rule": { "type": "string" }, "subscription_url": { "type": "string" }, "sync_interval_minutes": { "type": "integer" }, "type": { "type": "string" } } }, "waf.IPGroupSyncResult": { "type": "object", "properties": { "group": { "$ref": "#/definitions/waf.IPGroupView" }, "ip_count": { "type": "integer" }, "message": { "type": "string" }, "next_sync_at": { "type": "string" }, "status": { "type": "string" }, "synced_at": { "type": "string" } } }, "waf.IPGroupView": { "type": "object", "properties": { "auto_config": { "type": "array", "items": { "type": "integer" } }, "created_at": { "type": "string" }, "enabled": { "type": "boolean" }, "ext_ips": { "type": "array", "items": { "$ref": "#/definitions/waf.IPGroupExtIPView" } }, "id": { "type": "integer" }, "ip_list": { "type": "array", "items": { "type": "string" } }, "last_sync_message": { "type": "string" }, "last_sync_status": { "type": "string" }, "last_synced_at": { "type": "string" }, "name": { "type": "string" }, "next_sync_at": { "type": "string" }, "referenced_by_rule_count": { "type": "integer" }, "subscription_format": { "type": "string" }, "subscription_mapping_rule": { "type": "string" }, "subscription_url": { "type": "string" }, "sync_interval_minutes": { "type": "integer" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "waf.RuleEdge": { "type": "object", "properties": { "id": { "type": "string" }, "source": { "type": "string" }, "source_handle": { "type": "string" }, "target": { "type": "string" } } }, "waf.RuleGraph": { "type": "object", "properties": { "edges": { "type": "array", "items": { "$ref": "#/definitions/waf.RuleEdge" } }, "nodes": { "type": "array", "items": { "$ref": "#/definitions/waf.RuleNode" } }, "schema_version": { "type": "integer" } } }, "waf.RuleNode": { "type": "object", "properties": { "config": { "type": "array", "items": { "type": "integer" } }, "id": { "type": "string" }, "label": { "type": "string" }, "position": { "$ref": "#/definitions/waf.RulePosition" }, "type": { "$ref": "#/definitions/waf.RuleNodeType" } } }, "waf.RuleNodeType": { "type": "string", "enum": [ "start", "allow", "block", "ip_match", "geo_match", "pow", "ua_check", "security_check" ], "x-enum-varnames": [ "RuleNodeStart", "RuleNodeAllow", "RuleNodeBlock", "RuleNodeIPMatch", "RuleNodeGeoMatch", "RuleNodePoW", "RuleNodeUACheck", "RuleNodeSecurityCheck" ] }, "waf.RulePosition": { "type": "object", "properties": { "x": { "type": "number" }, "y": { "type": "number" } } }, "waf.RuleView": { "type": "object", "properties": { "applied_site_count": { "type": "integer" }, "applied_site_ids": { "type": "array", "items": { "type": "integer" } }, "created_at": { "type": "string" }, "enabled": { "type": "boolean" }, "graph": { "$ref": "#/definitions/waf.RuleGraph" }, "id": { "type": "integer" }, "is_global": { "type": "boolean" }, "name": { "type": "string" }, "revision": { "type": "integer" }, "updated_at": { "type": "string" } } }, "waf.SaveRuleGraphInput": { "type": "object", "properties": { "graph": { "$ref": "#/definitions/waf.RuleGraph" }, "revision": { "type": "integer" } } }, "waf.SiteRuleGroupsView": { "type": "object", "properties": { "applied_ids": { "type": "array", "items": { "type": "integer" } }, "applied_rule_groups": { "type": "array", "items": { "$ref": "#/definitions/waf.RuleView" } }, "global_rule_group": { "$ref": "#/definitions/waf.RuleView" }, "route_id": { "type": "integer" }, "rule_groups": { "type": "array", "items": { "$ref": "#/definitions/waf.RuleView" } } } }, "waf.UpdateRuleMetaInput": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "name": { "type": "string" } } }, "zone.DomainInput": { "type": "object", "properties": { "cert_id": { "type": "integer" }, "domain": { "type": "string" } } }, "zone.Input": { "type": "object", "properties": { "domain": { "type": "string" } } }, "zone.ListItem": { "type": "object", "properties": { "created_at": { "type": "string" }, "domain": { "type": "string" }, "domain_count": { "type": "integer" }, "id": { "type": "integer" }, "updated_at": { "type": "string" } } }, "zone.Overview": { "type": "object", "properties": { "domains": { "type": "array", "items": { "$ref": "#/definitions/model.ZoneDomain" } }, "zone": { "$ref": "#/definitions/model.Zone" } } }, "zone.Stats": { "type": "object", "properties": { "available": { "type": "boolean" }, "bucket_minutes": { "type": "integer" }, "bytes_sent": { "type": "integer" }, "domain_count": { "type": "integer" }, "range": { "$ref": "#/definitions/zone.StatsRange" }, "range_hours": { "type": "integer" }, "request_count": { "type": "integer" }, "series": { "type": "array", "items": { "$ref": "#/definitions/zone.StatsPoint" } }, "unique_visitors": { "type": "integer" }, "window_ended_at": { "type": "string" }, "window_started_at": { "type": "string" } } }, "zone.StatsPoint": { "type": "object", "properties": { "bucket_started_at": { "type": "string" }, "bytes_sent": { "type": "integer" }, "request_count": { "type": "integer" }, "unique_visitors": { "type": "integer" } } }, "zone.StatsRange": { "type": "string", "enum": [ "24h", "7d", "30d" ], "x-enum-varnames": [ "StatsRange24h", "StatsRange7d", "StatsRange30d" ] } }, "securityDefinitions": { "SessionCookie": { "type": "apiKey", "name": "session", "in": "cookie" } } }