{
  "openapi": "3.0.3",
  "info": {
    "title": "雨猫开放数据 API",
    "version": "1.0.0",
    "description": "公开只读的 EEW 档案及雨猫自感测数据。账号、登录、后台和软件观测服务不属于本接口目录。"
  },
  "servers": [
    {
      "url": "https://api.raineko.net/api/v1"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "eew",
      "description": "机构 EEW 历史档案"
    },
    {
      "name": "hyp",
      "description": "雨猫自感测"
    }
  ],
  "paths": {
    "/status": {
      "get": {
        "operationId": "eew_status",
        "tags": [
          "eew"
        ],
        "summary": "运行状态",
        "description": "归档计数、来源连接状态、最近接收时间和连接记录。connected 只代表当前连接状态，不保证历史无缺报。",
        "parameters": [],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "eew_events",
        "tags": [
          "eew"
        ],
        "summary": "事件列表",
        "description": "各机构分别建档，不跨机构合并。按发震时间筛选，返回 latest 和缺报信息。",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "description": "按来源筛选；省略时返回全部来源。",
            "schema": {
              "type": "string",
              "enum": [
                "cea",
                "sc",
                "fj",
                "cq"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "起始日期，YYYY-MM-DD，北京时间，包含当天。",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "结束日期，YYYY-MM-DD，北京时间，包含当天。",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "震中名称或上游事件编号，最多 100 字。",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "minMagnitude",
            "in": "query",
            "description": "最低震级。",
            "schema": {
              "type": "number",
              "minimum": -2,
              "maximum": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "从 1 开始的页码。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "每页条数。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EewPage"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "eew_event",
        "tags": [
          "eew"
        ],
        "summary": "事件与全部报次",
        "description": "保留同报次的不同内容版本，按报次顺序返回 reports。missingRevisions 表示尚未收录的报次，不能推断其内容。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件列表返回的 32 位十六进制 id；不是上游 sourceEventId。",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EewEvent"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/events/{id}/export": {
      "get": {
        "operationId": "eew_export",
        "tags": [
          "eew"
        ],
        "summary": "导出事件",
        "description": "JSON 包含全部报文版本、exportedAt 和各版本首次收到的 rawText。原文是收到的转发 JSON，不是官方机构原始电文。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件列表返回的 32 位十六进制 id；不是上游 sourceEventId。",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EewEvent"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/events/{id}/deliveries": {
      "get": {
        "operationId": "eew_deliveries",
        "tags": [
          "eew"
        ],
        "summary": "接收记录",
        "description": "包括重复投递，按接收记录 ID 递增分页。与报告版本 ID 使用不同的游标，不可混用。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件列表返回的 32 位十六进制 id；不是上游 sourceEventId。",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "上一页最后一条接收记录的 ID。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "每页接收记录数。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryPage"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/deliveries/{id}/raw": {
      "get": {
        "operationId": "eew_raw",
        "tags": [
          "eew"
        ],
        "summary": "原始报文字节",
        "description": "id 使用报文的 deliveryId。X-Content-SHA256 校验原始字节；不要重新排版或重编码后再计算散列。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "接收记录整数 ID。",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "原始报文字节",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Content-SHA256": {
                "schema": {
                  "type": "string"
                },
                "description": "原始接收字节的 SHA-256"
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/latest": {
      "get": {
        "operationId": "eew_latest",
        "tags": [
          "eew"
        ],
        "summary": "各路最近事件",
        "description": "最近归档事件可能已经结束。latest 不是“正在预警”列表，必须检查时间、测试、取消和最终报标记。",
        "parameters": [],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Latest"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/months": {
      "get": {
        "operationId": "eew_months",
        "tags": [
          "eew"
        ],
        "summary": "月份索引",
        "description": "按北京时间返回有档案的月份及事件数。",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "description": "按来源筛选；省略时返回全部来源。",
            "schema": {
              "type": "string",
              "enum": [
                "cea",
                "sc",
                "fj",
                "cq"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Months"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/reports": {
      "get": {
        "operationId": "eew_reports",
        "tags": [
          "eew"
        ],
        "summary": "增量同步",
        "description": "按入库 ID 递增同步报文。入库顺序不一定等于机构发报顺序；处理成功后保存 nextCursor，依据 id 幂等去重。",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "已成功消费的最后一个入库 ID。实时订阅省略时从当前最新游标开始；reports 查询省略时为 0。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "每次返回报文版本数。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPage"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/stream": {
      "get": {
        "operationId": "eew_stream",
        "tags": [
          "eew"
        ],
        "summary": "SSE 实时订阅",
        "description": "返回 ready、report、status 事件。after 优先于 Last-Event-ID；未指定游标时不回放历史。每 15 秒发送状态，历史积压分批发送；慢消费者可能断开，重新连接时续传。",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "已成功消费的最后一个入库 ID。实时订阅省略时从当前最新游标开始；reports 查询省略时为 0。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "description": "断线续传游标；after 存在时优先使用 after。",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE 事件流",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/ws": {
      "get": {
        "operationId": "eew_ws",
        "tags": [
          "eew"
        ],
        "summary": "WebSocket 实时订阅",
        "description": "wss 连接，接收 ready / report / status；文本 ping 返回 pong。指定 after 可补发已归档数据。成功消费 report.id 后保存游标，重连时恢复，按 id 去重。",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "已成功消费的最后一个入库 ID。实时订阅省略时从当前最新游标开始；reports 查询省略时为 0。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket Upgrade"
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/hyp/status": {
      "get": {
        "operationId": "hyp_status",
        "tags": [
          "hyp"
        ],
        "summary": "雨猫自感测运行状态",
        "description": "包含算法指纹、检测与归档进程状态、来源健康信息和错误。服务器自感测不受机构 EEW 接管；图像归档状态不等于公开图像下载权限。",
        "parameters": [],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HypStatus"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/hyp/events": {
      "get": {
        "operationId": "hyp_events",
        "tags": [
          "hyp"
        ],
        "summary": "自感测事件列表",
        "description": "只返回允许公开的事件。region 是展示用地区分组，latest 为末报摘要；韩国默认收起是网页行为，不影响 API 返回。",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "匹配事件 ID（不是地名），最多 100 字。",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "首次检出时间的起点，Unix 毫秒，包含该时间。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "首次检出时间的终点，Unix 毫秒，不包含该时间。",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "页码。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "每页条数。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HypPage"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/hyp/events/{id}": {
      "get": {
        "operationId": "hyp_event",
        "tags": [
          "hyp"
        ],
        "summary": "事件详情与逐报摘要",
        "description": "网页优先使用 view=summary：省略每报重复的 evidence、stations、sourceFrames，但保留逐报主要参数与事件台站峰值。省略 view 返回完整报文，较大事件可能有数十 MB。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件 ID；必须对整个 ID 做 URL 编码。例如 hyp:live:… 中的冒号编码为 %3A。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "description": "summary 为轻量摘要；省略返回完整数据。",
            "schema": {
              "type": "string",
              "enum": [
                "summary"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HypEvent"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/hyp/events/{id}/reports/{number}": {
      "get": {
        "operationId": "hyp_report",
        "tags": [
          "hyp"
        ],
        "summary": "按需读取完整单报",
        "description": "读取单报的完整关联证据、质量、台站快照、算法指纹和散列。隐藏事件与不存在事件均返回 404。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件 ID；必须对整个 ID 做 URL 编码。例如 hyp:live:… 中的冒号编码为 %3A。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "从 1 开始的报次。",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HypReport"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    },
    "/hyp/events/{id}/export": {
      "get": {
        "operationId": "hyp_export",
        "tags": [
          "hyp"
        ],
        "summary": "完整事件导出",
        "description": "完整 JSON 下载，保留每一报，不受 view=summary 影响。报告只追加，后续峰值回补不改写旧报告。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "事件 ID；必须对整个 ID 做 URL 编码。例如 hyp:live:… 中的冒号编码为 %3A。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HypEvent"
                }
              }
            }
          },
          "400": {
            "description": "参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或未公开",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求或连接频率超过限额；退避后重试"
          },
          "503": {
            "description": "服务或订阅暂不可用；退避后重试"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "错误响应",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Status": {
        "type": "object",
        "description": "EEW 运行状态；详细来源状态和统计字段可随版本增加。",
        "properties": {
          "version": {
            "type": "integer"
          },
          "serverTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "healthy": {
            "type": "boolean"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "archive": {
            "type": "object"
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "additionalProperties": true
      },
      "EewReport": {
        "type": "object",
        "description": "缺失观测值为 null，不能当作 0。",
        "properties": {
          "id": {
            "type": "integer",
            "description": "报文版本入库 ID；单调递增"
          },
          "eventKey": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "eventId": {
            "type": "string",
            "description": "上游事件主编号"
          },
          "revision": {
            "type": "integer"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "originAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "epicenter": {
            "type": "string",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "nullable": true
          },
          "depthKm": {
            "type": "number",
            "nullable": true
          },
          "magnitude": {
            "type": "number",
            "nullable": true
          },
          "maxIntensity": {
            "nullable": true,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "isFinal": {
            "type": "boolean"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isTest": {
            "type": "boolean"
          },
          "deliveryId": {
            "type": "integer"
          },
          "rawUrl": {
            "type": "string",
            "description": "相对路径，必须相对于 https://api.raineko.net 解析。"
          }
        },
        "additionalProperties": true
      },
      "EewEvent": {
        "type": "object",
        "description": "事件详情。列表项不含完整 reports。导出时 reports 额外含 rawText。",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "sourceEventId": {
            "type": "string"
          },
          "originAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "latest": {
            "$ref": "#/components/schemas/EewReport"
          },
          "reports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EewReport"
            }
          },
          "reportCount": {
            "type": "integer"
          },
          "missingRevisions": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "additionalProperties": true
      },
      "EewPage": {
        "type": "object",
        "description": "EEW 分页结果",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EewEvent"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "pages": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "DeliveryPage": {
        "type": "object",
        "description": "接收记录分页",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "nextCursor": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "ReportPage": {
        "type": "object",
        "description": "增量报文分页",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EewReport"
            }
          },
          "nextCursor": {
            "type": "integer"
          },
          "highWater": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "Latest": {
        "type": "object",
        "description": "每路最近归档事件与来源状态",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EewEvent"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "serverTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Months": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "北京时间月份",
              "properties": {
                "month": {
                  "type": "string",
                  "example": "2026-10"
                },
                "events": {
                  "type": "integer"
                }
              },
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "HypStatus": {
        "type": "object",
        "description": "HYP 服务与来源状态",
        "properties": {
          "algorithm": {
            "type": "string"
          },
          "detector": {
            "type": "object",
            "nullable": true
          },
          "recorder": {
            "type": "object",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "officialEewTakeover": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "stationScope": {
            "type": "string",
            "enum": [
              "algorithm-associated"
            ]
          }
        },
        "additionalProperties": true
      },
      "HypEstimate": {
        "type": "object",
        "description": "HYP 震源位于 event.hypEstimate，不能从 event.latitude 等未解算的波形定位字段取值。",
        "properties": {
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "depthKm": {
            "type": "number"
          },
          "originAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "calculatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "stationCount": {
            "type": "integer"
          },
          "score": {
            "type": "number"
          },
          "bestScore": {
            "type": "number"
          },
          "quietStationCount": {
            "type": "integer"
          },
          "sLikeStationCount": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "HypReport": {
        "type": "object",
        "description": "每报时间保存到毫秒；NIED 源图像为 1 秒分辨率。",
        "properties": {
          "reportNumber": {
            "type": "integer"
          },
          "reportedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "recordedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "epicenter": {
            "type": "string"
          },
          "epicenterRegion": {
            "type": "object",
            "description": "可选 JMA AreaEpicenter 代码、日文名称及边界来源"
          },
          "algorithm": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "description": "入库原报告 payload 的散列；不是 HTTP 正文或摘要的散列。响应附加 sha256，JSON 重排也会改变字节。"
          },
          "quality": {
            "type": "object",
            "description": "约束质量，不是经过标定的实际误差概率。",
            "properties": {
              "grade": {
                "type": "string",
                "enum": [
                  "S",
                  "A",
                  "B",
                  "C",
                  "D"
                ]
              },
              "rmsSeconds": {
                "type": "number",
                "nullable": true
              },
              "azimuthGapDegrees": {
                "type": "number",
                "nullable": true
              },
              "stationCount": {
                "type": "integer"
              }
            },
            "additionalProperties": true
          },
          "hypSelection": {
            "type": "object",
            "description": "可选：发报窗口开始、选中候选时刻与候选次数。"
          },
          "event": {
            "type": "object",
            "description": "完整结果及可选诊断字段；部分字段随算法版本出现。",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "candidate",
                  "preliminary",
                  "tracking",
                  "finalized",
                  "retracted",
                  "interrupted"
                ]
              },
              "firstDetectedAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix 毫秒"
              },
              "hypEstimate": {
                "$ref": "#/components/schemas/HypEstimate"
              },
              "magnitude": {
                "type": "number",
                "nullable": true
              },
              "magnitudeType": {
                "type": "string",
                "nullable": true
              },
              "magnitudeStationCount": {
                "type": "integer"
              },
              "magnitudeUncertainty": {
                "type": "number"
              },
              "magnitudeCalculatedAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix 毫秒"
              },
              "magnitudeRetained": {
                "type": "boolean"
              },
              "magnitudeEstimateLocation": {
                "type": "object"
              },
              "hypCompletion": {
                "type": "object"
              },
              "evidence": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            },
            "additionalProperties": true
          },
          "stations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "additionalProperties": true
      },
      "HypEvent": {
        "type": "object",
        "description": "事件状态是权威生命周期状态；服务中断不伪造最终报。",
        "properties": {
          "id": {
            "type": "string"
          },
          "first_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix 毫秒"
          },
          "status": {
            "type": "string"
          },
          "reports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HypReport"
            }
          },
          "stations": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "算法关联物理站，metrics 以 surface:pgaGal、underground:intensity 等分层键保存峰值、源时间、接收时间和 recovered。"
            }
          }
        },
        "additionalProperties": true
      },
      "HypPage": {
        "type": "object",
        "description": "HYP 分页；不返回 pages，可由 total 和 limit 计算。",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "公开事件与末报摘要",
              "properties": {
                "id": {
                  "type": "string"
                },
                "first_at": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Unix 毫秒"
                },
                "updated_at": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Unix 毫秒"
                },
                "status": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                },
                "latest": {
                  "$ref": "#/components/schemas/HypReport"
                }
              },
              "additionalProperties": true
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
