准备拆书任务包
Body {topicid, bookmd5, segments[{startPage,endPage,title}](PDF 页序,非连续可,实际页数≤60), preset(book-breakdown|source-structure|exam-general|dictionary), anchorMode(page_text|block), title?, cardStyle{defaultFillIndex -1..2}?, async?}。>~10 页必 async:true(202 {jobId,bundleId,bundlePath,state:preparing} + 轮询 GET /bundles;参数错同步 404/422)。单飞(429 PREPARE_BUSY 看 details.runningJob/retryAfterSeconds)。exam-general 必须配 block(含 role 标注),否则静默退化;错配 0.18+ 回 warnings(停下改组合重 prepare)。同步小包阻塞到完工(curl ≥300s)。
Body {topicid, bookmd5, segments[{startPage,endPage,title}](PDF 页序,非连续可,实际页数≤60), preset(book-breakdown|source-structure|exam-general|dictionary), anchorMode(page_text|block), title?, cardStyle{defaultFillIndex -1..2}?, async?}。>~10 页必 async:true(202 {jobId,bundleId,bundlePath,state:preparing} + 轮询 GET /bundles;参数错同步 404/422)。单飞(429 PREPARE_BUSY 看 details.runningJob/retryAfterSeconds)。exam-general 必须配 block(含 role 标注),否则静默退化;错配 0.18+ 回 warnings(停下改组合重 prepare)。同步小包阻塞到完工(curl ≥300s)。
Authorization
bearerAuth 安装脚本写入 ~/.config/mn-bridge/token,或环境变量 MN_BRIDGE_TOKEN。不要带 Origin 头。
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
curl -X POST "https://example.com/bundles/prepare" \ -H "Content-Type: application/json" \ -d '{ "topicid": "string", "bookmd5": "string", "segments": [ {} ] }'提交导入(commit) POST
Body {targetParentNoteId?, withBlank?, excerptMode?:child|link, resultMarkdown?(仅跨设备)}。无 confirm 门,发即真执行。返回 {rootNoteId, version, preImportSnapshotId(存好,USER_EDITS_PRESENT 时带 force:true 才覆盖), receipt, parsed{headings,importedCards,wikilinks,excerptsTotal,excerptsAnchored,failedExcerpts[]}, warnings, excerptStatsTruncated?, blankInsertion?}。headings≠importedCards 即丢卡;excerptsAnchored 不等即有未定位摘录(no_match 多为改写原文)。并发重复提交 409 SUBMIT_IN_FLIGHT。
回退快照 POST
Body {confirm:true(, force:true 若 USER_EDITS_PRESENT 且用户确认覆盖)}。回退整集到过去,自动先打回退前保护点(protectionSnapshotId)。目标集正开着回 409 STUDY_SET_IN_USE(切走再试)。文档目录不在快照覆盖范围。真 dry-run(422 + wouldRestoreToVersion/快照时间/说明/卡数)。