{
    "openapi": "3.1.0",
    "info": {
        "title": "SaleSass 应用开发者接口",
        "version": "1.1.0",
        "description": "会员注册后申请 API 凭证，后台审核通过后领取 apiid/apikey；每项 scope 另行申请审核。外部接口使用 X-API-ID 与 X-API-Key，并且必须拥有对应 scope。"
    },
    "servers": [
        {
            "url": "/api/v1"
        }
    ],
    "security": [
        {
            "AdminSession": []
        }
    ],
    "paths": {
        "/context": {
            "get": {
                "summary": "当前账号与启用角色组",
                "operationId": "addonContext",
                "tags": [
                    "应用中心"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/roles": {
            "get": {
                "summary": "获取安装授权使用的启用角色组（addon.manage）",
                "operationId": "addonRoles",
                "tags": [
                    "应用中心"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/addons": {
            "get": {
                "summary": "应用中心列表（addon.view）",
                "operationId": "addonList",
                "tags": [
                    "应用中心"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/addons/{key}/pages": {
            "get": {
                "summary": "当前账号可访问的应用页面",
                "operationId": "addonPages",
                "tags": [
                    "应用中心"
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{1,79}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/addons/{key}/access": {
            "get": {
                "summary": "页面契约与已保存角色白名单（addon.manage）",
                "operationId": "addonAccess",
                "tags": [
                    "应用中心"
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{1,79}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "summary": "整体替换页面角色白名单（addon.manage）",
                "operationId": "addonAccessSave",
                "tags": [
                    "应用中心"
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{1,79}$"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "后台页面 meta[name=\"csrf-token\"] 的当前会话令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AccessRequest"
                            }
                        }
                    }
                }
            }
        },
        "/addons/{key}/actions/{action}": {
            "post": {
                "summary": "安装、重装、卸载、启停和菜单开关（addon.manage）",
                "operationId": "addonAction",
                "tags": [
                    "应用中心"
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{1,79}$"
                        }
                    },
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "install",
                                "reinstall",
                                "uninstall",
                                "enable",
                                "disable",
                                "menu"
                            ]
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "后台页面 meta[name=\"csrf-token\"] 的当前会话令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ActionRequest"
                            }
                        }
                    }
                }
            }
        },
        "/openapi": {
            "get": {
                "summary": "读取 OpenAPI 接口契约",
                "operationId": "addonOpenApi",
                "tags": [
                    "应用中心"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "未登录或会话失效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "没有权限",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "419": {
                        "description": "CSRF 令牌无效",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "参数错误",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据库结构需要升级",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/developer/register": {
            "post": {
                "summary": "注册开发者会员",
                "operationId": "developerRegister",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "in": "header",
                        "name": "X-CSRF-Token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "先 GET /developer/session 获取，必须使用同一 Cookie 会话"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "419": {
                        "description": "CSRF 无效"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "username": {
                                        "type": "string",
                                        "description": "会员账号"
                                    },
                                    "password": {
                                        "type": "string",
                                        "minLength": 6
                                    },
                                    "nickname": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "mobile": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "username",
                                    "password"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/developer/login": {
            "post": {
                "summary": "登录开发者会员",
                "operationId": "developerLogin",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "in": "header",
                        "name": "X-CSRF-Token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "先 GET /developer/session 获取，必须使用同一 Cookie 会话"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "419": {
                        "description": "CSRF 无效"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "username": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "username",
                                    "password"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/developer/dashboard": {
            "get": {
                "summary": "读取本人申请状态",
                "operationId": "developerDashboard",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "MemberSession": []
                    }
                ]
            }
        },
        "/developer/credential": {
            "post": {
                "summary": "申请 API 凭证",
                "operationId": "developerCredentialRequest",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "会员会话 CSRF 令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "MemberSession": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": []
                            }
                        }
                    }
                }
            }
        },
        "/developer/claim": {
            "post": {
                "summary": "领取已审核凭证",
                "operationId": "developerCredentialClaim",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "会员会话 CSRF 令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "MemberSession": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": []
                            }
                        }
                    }
                }
            }
        },
        "/developer/scopes": {
            "post": {
                "summary": "逐项申请 API 权限",
                "operationId": "developerScopeRequest",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "会员会话 CSRF 令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "MemberSession": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "scopes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "scopes",
                                    "reason"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/developer/logout": {
            "post": {
                "summary": "退出开发者账号",
                "operationId": "developerLogout",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "会员会话 CSRF 令牌"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "MemberSession": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": []
                            }
                        }
                    }
                }
            }
        },
        "/open/addons": {
            "get": {
                "summary": "读取平台应用目录",
                "operationId": "openAddonList",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "DeveloperApiId": [],
                        "DeveloperApiKey": []
                    }
                ]
            }
        },
        "/open/member-groups": {
            "get": {
                "summary": "读取会员组",
                "operationId": "openMemberGroups",
                "tags": [
                    "开发者 API"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "认证失败"
                    },
                    "403": {
                        "description": "权限未获批准"
                    },
                    "422": {
                        "description": "参数错误"
                    }
                },
                "security": [
                    {
                        "DeveloperApiId": [],
                        "DeveloperApiKey": []
                    }
                ]
            }
        },
        "/developer/session": {
            "get": {
                "operationId": "developerSession",
                "summary": "初始化会员会话",
                "security": [],
                "responses": {
                    "200": {
                        "description": "返回 csrf_token；保留响应 Cookie，用于后续注册、登录及会员管理请求"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "AdminSession": {
                "type": "apiKey",
                "in": "cookie",
                "name": "PHPSESSID"
            },
            "MemberSession": {
                "type": "apiKey",
                "in": "cookie",
                "name": "PHPSESSID",
                "description": "开发者会员会话，仅限开发者中心管理接口"
            },
            "DeveloperApiId": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-ID"
            },
            "DeveloperApiKey": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        },
        "schemas": {
            "Response": {
                "type": "object",
                "required": [
                    "code",
                    "message",
                    "data"
                ],
                "properties": {
                    "code": {
                        "type": "integer",
                        "description": "0 为成功"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": []
                }
            },
            "PageRoles": {
                "type": "object",
                "minProperties": 1,
                "additionalProperties": {
                    "type": "object",
                    "required": [
                        "view",
                        "manage"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "view": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                                "type": "integer",
                                "minimum": 1
                            }
                        },
                        "manage": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                                "type": "integer",
                                "minimum": 1
                            }
                        }
                    }
                },
                "description": "须包含全部页面。每页 view 为可查看角色，manage 为可操作角色且必须是 view 的子集；两者为空时仅管理员。"
            },
            "AccessRequest": {
                "type": "object",
                "required": [
                    "page_roles"
                ],
                "properties": {
                    "page_roles": {
                        "$ref": "#/components/schemas/PageRoles"
                    }
                }
            },
            "ActionRequest": {
                "type": "object",
                "properties": {
                    "show_menu": {
                        "type": "boolean",
                        "default": true
                    },
                    "page_roles": {
                        "$ref": "#/components/schemas/PageRoles"
                    }
                },
                "description": "install 必须传 page_roles；reinstall 不传时保留原授权；其他操作不能传 page_roles。"
            }
        }
    }
}