Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/HNU-himematsu/HNU-TimeLetter/llms.txt

Use this file to discover all available pages before exploring further.

The sync configuration API lets you inspect and update the Feishu data sync scheduler without restarting the server. You can read the current cron schedule, toggle the scheduler on or off, and change which tables are synced by default. All changes take effect immediately via hot-reload.

SyncTableKey reference

Each SyncTableKey value maps to a Feishu Bitable table and writes to a specific JSON output file read by the frontend runtime API.
KeyFeishu TableOutput File
locations地点表src/config/locations.json
stories故事表src/data/content.json
creation_headers创作板-头表src/data/creation-board-headers.json
creation_board创作板-主表src/data/creation-board.json
contributors参与贡献名单src/data/contributors.json

GET /api/admin/sync/config

Returns the current scheduler configuration, runtime state, available table definitions, and next scheduled run time. Authentication: admin_auth cookie required. Returns 401 Unauthorized if absent or invalid.

Response fields

config
object
required
Persisted scheduler configuration.
runtime
object
required
Live scheduler state — updated as jobs run.
availableTables
TableDefinition[]
required
All tables the system supports. Use the key values when setting defaultTables or creating jobs.
nextRunAt
string | null
required
ISO 8601 timestamp of when the scheduler will next fire. null when config.enabled is false.

Example response

{
  "config": {
    "enabled": true,
    "cron": "0 2 * * *",
    "defaultTables": ["locations", "stories", "creation_headers", "creation_board", "contributors"]
  },
  "runtime": {
    "currentJobId": null,
    "lastJobId": "sync_20260430100000_ab12cd",
    "lastRunAt": "2026-04-30T10:00:00.000Z"
  },
  "availableTables": [
    { "key": "locations",         "label": "地点表",           "dependsOn": [] },
    { "key": "stories",           "label": "故事表",           "dependsOn": [] },
    { "key": "creation_headers",  "label": "创作板-头表",       "dependsOn": [] },
    { "key": "creation_board",    "label": "创作板-主表",       "dependsOn": [] },
    { "key": "contributors",      "label": "参与贡献名单",      "dependsOn": [] }
  ],
  "nextRunAt": "2026-04-30T18:00:00.000Z"
}

curl example

curl -X GET https://himematsu.cn/api/admin/sync/config \
  --cookie "admin_auth=<YOUR_SESSION_COOKIE>"

PATCH /api/admin/sync/config

Updates one or more scheduler settings. All fields are optional — only include the fields you want to change. The scheduler is hot-reloaded immediately; no server restart is required. Authentication: admin_auth cookie required.

Request body

enabled
boolean
Set to true to activate the cron scheduler, false to pause it. Omit to leave unchanged.
cron
string
A valid cron expression with at least 5 space-separated segments (e.g. "0 */6 * * *" for every 6 hours). Omit to leave unchanged.
defaultTables
SyncTableKey[]
Replaces the full list of tables synced by the scheduler. Must contain at least one valid SyncTableKey — an empty array is rejected with 400. Omit to leave unchanged.

Responses

200 OK — Returns the same structure as GET /api/admin/sync/config, reflecting the updated state. 400 Bad Request — Returned when an unrecognised table key is supplied or the cron expression is malformed.
{ "message": "不支持的同步表: unknown_table" }
401 Unauthorized — Missing or invalid admin_auth cookie.
{ "message": "Unauthorized" }

curl examples

Disable the scheduler:
curl -X PATCH https://himematsu.cn/api/admin/sync/config \
  --cookie "admin_auth=<YOUR_SESSION_COOKIE>" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'
Change the cron schedule to every 6 hours and update the default tables:
curl -X PATCH https://himematsu.cn/api/admin/sync/config \
  --cookie "admin_auth=<YOUR_SESSION_COOKIE>" \
  -H "Content-Type: application/json" \
  -d '{
    "cron": "0 */6 * * *",
    "defaultTables": ["locations", "stories"]
  }'

Build docs developers (and LLMs) love