{
  "specVersion": "1.0",
  "host": {
    "displayName": "Quay",
    "identifier": "did:web:quaypro.pages.dev"
  },
  "entries": [
    {
      "identifier": "urn:ai:quaypro.pages.dev:api:icon",
      "displayName": "Quay 图标同源中继",
      "type": "application/openapi+json",
      "description": "把站点 favicon 或第三方图标服务的图片转成同源响应，不透传上游 Set-Cookie；仅放行图标服务与图标类路径，失败返回 1×1 占位 SVG。",
      "data": {
        "openapi": "3.1.0",
        "info": {
          "title": "Quay Icon Proxy",
          "version": "1.0.0"
        },
        "servers": [
          { "url": "https://quaypro.pages.dev" }
        ],
        "paths": {
          "/api/icon": {
            "get": {
              "operationId": "getProxiedIcon",
              "summary": "按 URL 获取站点图标（同源中继）",
              "parameters": [
                {
                  "name": "u",
                  "in": "query",
                  "required": true,
                  "schema": { "type": "string", "format": "uri" },
                  "description": "http(s) 图标地址；仅放行图标服务或图标类路径"
                }
              ],
              "responses": {
                "200": {
                  "description": "图片，或上游失败时的 1×1 占位 SVG",
                  "content": { "image/*": {} }
                }
              }
            }
          }
        }
      },
      "representativeQueries": [
        "获取某个网站的 favicon 而不让浏览器保存第三方 Cookie",
        "把远程图标地址转换成同源图片响应",
        "检查一个站点的图标地址是否可访问"
      ],
      "capabilities": ["FetchFavicon", "ProxyRemoteIcon", "NoThirdPartyCookies"],
      "tags": ["icon", "favicon", "image-proxy", "privacy"]
    },
    {
      "identifier": "urn:ai:quaypro.pages.dev:api:img",
      "displayName": "Quay 图片同源中继",
      "type": "application/openapi+json",
      "description": "壁纸等大图的同源中继，仅接受图片 content-type，不透传上游 Set-Cookie。",
      "data": {
        "openapi": "3.1.0",
        "info": {
          "title": "Quay Image Proxy",
          "version": "1.0.0"
        },
        "servers": [
          { "url": "https://quaypro.pages.dev" }
        ],
        "paths": {
          "/api/img": {
            "get": {
              "operationId": "getProxiedImage",
              "summary": "按 URL 获取远程图片（同源中继）",
              "parameters": [
                {
                  "name": "u",
                  "in": "query",
                  "required": true,
                  "schema": { "type": "string", "format": "uri" },
                  "description": "http(s) 图片地址"
                }
              ],
              "responses": {
                "200": {
                  "description": "图片，或上游失败时的 1×1 占位 SVG",
                  "content": { "image/*": {} }
                }
              }
            }
          }
        }
      },
      "representativeQueries": [
        "给起始页加载一张远程背景壁纸",
        "把远程图片代理成同源地址以避开跨域限制"
      ],
      "capabilities": ["ProxyRemoteImage", "StripSetCookie"],
      "tags": ["wallpaper", "image", "proxy"]
    },
    {
      "identifier": "urn:ai:quaypro.pages.dev:api:weather",
      "displayName": "Quay 天气聚合",
      "type": "application/openapi+json",
      "description": "按城市查询天气实况、预报与生活指数；服务端转发上游并统一加 CORS，网页端与扩展端均可调用。",
      "data": {
        "openapi": "3.1.0",
        "info": {
          "title": "Quay Weather",
          "version": "1.0.0"
        },
        "servers": [
          { "url": "https://quaypro.pages.dev" }
        ],
        "paths": {
          "/api/weather": {
            "get": {
              "operationId": "getWeather",
              "summary": "查询城市天气",
              "parameters": [
                { "name": "city", "in": "query", "schema": { "type": "string" }, "description": "城市名" },
                { "name": "extended", "in": "query", "schema": { "type": "string" }, "description": "返回扩展信息" },
                { "name": "forecast", "in": "query", "schema": { "type": "string" }, "description": "返回预报" }
              ],
              "responses": {
                "200": { "description": "天气 JSON", "content": { "application/json": {} } },
                "502": { "description": "上游不可用" }
              }
            }
          },
          "/api/version": {
            "get": {
              "operationId": "getDeployVersion",
              "summary": "查询当前部署版本（分支 / 提交 / 时间）",
              "responses": {
                "200": { "description": "版本 JSON", "content": { "application/json": {} } }
              }
            }
          },
          "/api/health": {
            "get": {
              "operationId": "getHealth",
              "summary": "服务健康检查",
              "responses": {
                "200": { "description": "健康状态 JSON", "content": { "application/json": {} } }
              }
            }
          }
        }
      },
      "representativeQueries": [
        "查询某个城市当前的天气和空气质量",
        "检查 Quay 服务是否在线以及当前部署版本"
      ],
      "capabilities": ["GetWeather", "GetForecast", "GetServiceHealth"],
      "tags": ["weather", "forecast", "health", "version"]
    },
    {
      "identifier": "urn:ai:quaypro.pages.dev:api:account-sync",
      "displayName": "Quay 账户与数据同步",
      "type": "application/openapi+json",
      "description": "注册 / 登录 / 令牌换取与按命名空间（bucket）读写同步数据；写操作需要 Bearer 令牌，用户数据默认仍保存在本机 localStorage。",
      "data": {
        "openapi": "3.1.0",
        "info": {
          "title": "Quay Account & Sync",
          "version": "1.0.0"
        },
        "servers": [
          { "url": "https://quaypro.pages.dev" }
        ],
        "components": {
          "securitySchemes": {
            "bearerAuth": { "type": "http", "scheme": "bearer" }
          }
        },
        "paths": {
          "/api/me": {
            "get": {
              "operationId": "getCurrentUser",
              "summary": "查询当前登录用户",
              "security": [{ "bearerAuth": [] }],
              "responses": {
                "200": { "description": "用户信息", "content": { "application/json": {} } }
              }
            }
          },
          "/api/register": {
            "post": {
              "operationId": "registerUser",
              "summary": "注册账户",
              "responses": {
                "200": { "description": "注册结果", "content": { "application/json": {} } }
              }
            }
          },
          "/api/login": {
            "post": {
              "operationId": "loginUser",
              "summary": "登录并获取令牌",
              "responses": {
                "200": { "description": "登录结果", "content": { "application/json": {} } }
              }
            }
          },
          "/api/sync/{bucket}": {
            "get": {
              "operationId": "pullBucket",
              "summary": "读取指定命名空间的同步数据",
              "security": [{ "bearerAuth": [] }],
              "parameters": [
                { "name": "bucket", "in": "path", "required": true, "schema": { "type": "string" } }
              ],
              "responses": {
                "200": { "description": "同步数据", "content": { "application/json": {} } }
              }
            },
            "put": {
              "operationId": "pushBucket",
              "summary": "写入指定命名空间的同步数据",
              "security": [{ "bearerAuth": [] }],
              "parameters": [
                { "name": "bucket", "in": "path", "required": true, "schema": { "type": "string" } }
              ],
              "responses": {
                "200": { "description": "写入结果", "content": { "application/json": {} } }
              }
            }
          }
        }
      },
      "representativeQueries": [
        "读取某个 Quay 账户在云端的同步数据",
        "把本地常用应用和待办同步到云端",
        "检查当前账户是否已登录"
      ],
      "capabilities": ["GetCurrentUser", "RegisterUser", "LoginUser", "PullSyncBucket", "PushSyncBucket"],
      "tags": ["account", "sync", "oidc", "local-first"]
    }
  ]
}
