openapi: 3.0.3
info:
  title: NewToken 只读数据接口
  version: "0.1"
  description: |
    静态 JSON，只读，无需认证。AI 编辑撰稿、AI 总编辑复核，团队对流程负责并抽检。
    路径规范：内容接口在 /api/ 下，稳定、只增不改；账号类功能预留 /account/（尚未实现）。
servers:
  - url: https://www.newtoken.link
paths:
  /api/events.json:
    get: { summary: 全部事件, responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Events" } } } } } }
  /api/daily/{date}.json:
    get:
      summary: 某天简报
      parameters: [ { name: date, in: path, required: true, schema: { type: string, example: "2026-10-16" } } ]
      responses: { "200": { description: OK }, "404": { description: 不存在 } }
  /api/topics.json:
    get: { summary: 专题与时间线, responses: { "200": { description: OK } } }
  /api/editors.json:
    get: { summary: 编辑列表, responses: { "200": { description: OK } } }
components:
  schemas:
    Events:
      type: object
      properties:
        schema_version: { type: string }
        count: { type: integer }
        events:
          type: array
          items:
            type: object
            properties:
              id: { type: string, example: evt-20261016-01 }
              title: { type: string }
              date: { type: string }
              grades: { type: array, items: { type: string } }
              sources: { type: array, items: { type: object, properties: { name: { type: string }, url: { type: string }, grade: { type: string } } } }
              url: { type: string, description: 事件详情页 }
              canonical_url: { type: string, description: 引用时使用的稳定 HTML 地址（与 url 相同，0.2 起） }
              as_of: { type: string, description: 所在简报的信息截至时间（北京时间） }
              published_at: { type: string, description: 取所在简报的 as_of（0.2 起） }
              modified_at: { type: string, description: 目前与 published_at 相同（0.2 起） }
              daily_url: { type: string }
