{
  "title": "个推推送API服务 (带被动刷新)",
  "description": "基于Cloudflare Worker的个推REST API V2服务，支持自动token管理和CID单推功能",
  "features": [
    "自动token缓存管理",
    "被动刷新：当API返回10001错误码时自动刷新token并重试",
    "防止并发刷新",
    "提前5分钟预刷新机制",
    "CID单推功能"
  ],
  "endpoints": {
    "/": {
      "method": "GET",
      "description": "查看API文档"
    },
    "/token": {
      "method": "GET",
      "description": "获取个推鉴权token",
      "parameters": {
        "refresh": "true (可选) - 强制刷新token"
      },
      "response": {
        "success": "boolean",
        "token": "string (成功时)",
        "expire_time": "string (成功时)",
        "expire_date": "string (成功时)",
        "fromCache": "boolean (是否来自缓存)",
        "error": "string (失败时)",
        "code": "number (失败时)"
      }
    },
    "/token/{token}": {
      "method": "DELETE",
      "description": "删除指定的token",
      "response": {
        "success": "boolean",
        "message": "string",
        "code": "number"
      }
    },
    "/push/single/cid": {
      "method": "POST",
      "description": "CID单推 - 向单个用户推送消息",
      "required_params": [
        "cid",
        "title",
        "body"
      ],
      "optional_params": [
        "request_id",
        "group_name",
        "click_type",
        "url",
        "intent",
        "payload",
        "settings",
        "push_channel"
      ],
      "example": {
        "cid": "target_cid_here",
        "title": "推送标题",
        "body": "推送内容",
        "click_type": "url",
        "url": "https://example.com",
        "group_name": "测试推送组"
      },
      "response": {
        "success": "boolean",
        "data": "object (成功时的推送结果)",
        "error": "string (失败时)",
        "code": "number"
      }
    },
    "/test-api": {
      "method": "GET",
      "description": "测试API调用（演示被动刷新功能）",
      "note": "此端点演示了如何使用callGetuiAPI函数，当遇到10001错误时会自动刷新token并重试"
    }
  },
  "config": {
    "appkey": "9JGnJr4WFx6JkTdZgiO2e6",
    "baseUrl": "https://restapi.getui.com/v2/Eh9AO0i9bY6tRLZsqjKlgA"
  },
  "tokenCache": {
    "hasToken": false,
    "expireTime": null,
    "isRefreshing": false
  },
  "clickTypes": {
    "none": "点击通知不跳转",
    "url": "点击通知打开URL",
    "intent": "点击通知打开应用内页面",
    "payload": "点击通知获取自定义数据"
  }
}