Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:memo: Revert document tree duplication API reference additions https://github.com/siyuan-note/siyuan/issues/12688

Danielc5dbcfd2c1f4
diff --git a/docs/API.ja.md b/docs/API.ja.md
index 37c1908fd3..08a4743b9c 100644
--- a/docs/API.ja.md
+++ b/docs/API.ja.md
@@ -20,7 +20,6 @@
* [ドキュメントの名前を変更](#ドキュメントの名前を変更)
* [ドキュメントを削除](#ドキュメントを削除)
* [ドキュメントを移動](#ドキュメントを移動)
- * [子ドキュメントを含めて複製](#子ドキュメントを含めて複製)
* [ノートブックとドキュメントのソート値を設定](#ノートブックとドキュメントのソート値を設定)
* [ドキュメントの子ドキュメント用ソート方式を設定](#ドキュメントの子ドキュメント用ソート方式を設定)
* [パスから人間が読めるパスを取得](#パスから人間が読めるパスを取得)
@@ -547,35 +546,6 @@ if (response.code === 0 && response.data) {
}
```
-### 子ドキュメントを含めて複製
-
-`POST /api/filetree/duplicateDocTree` には管理者権限が必要です。カーネルが読み取り専用の場合は実行できません。
-
-```json
-{"id":"20260919010000-source1"}
-```
-
-`id` はドキュメント ID を指定します。ノートブックドキュメントは対象外です。指定したドキュメントとすべての子ドキュメントを、同じノートブックの元の親階層に複製します。すべてのブロックに新しい ID を割り当て、複製を示す接尾辞は最上位のタイトルにのみ追加します。子ドキュメントのタイトル、階層、ソート方式、カスタム順序を保持します。カスタム順序では、複製した最上位ドキュメントを元の直後に配置します。
-
-複製対象内のブロック参照とブロックリンクは、タブのタイトルやリッチテキスト表セルも含め、複製先のブロックを参照します。クエリ埋め込み内の明示的なブロック ID も置き換えます。ほかの参照とアセットは元の参照先を保持します。データベースブロックは元のデータベースと行の関連付けを共有するミラーのままなので、関連付けられた行を編集すると元のブロックも変更される場合があります。複製したブロックはデータベースの項目やフラッシュカードへの所属を引き継ぎません。
-
-成功時は複製した最上位ドキュメントを返します。
-
-```json
-{
- "code": 0,
- "msg": "",
- "data": {
- "id": "20260919010001-copied1",
- "notebook": "20260919010002-notebk1",
- "path": "/20260919010001-copied1.sy",
- "hPath": "/Source (Duplicated 2026-09-19 01:00:01)"
- }
-}
-```
-
-暗号化ノートブックは事前にロックを解除する必要があり、応答のシリアライズ完了までノートブックのリースを保持します。読み取り不能、破損、未対応の形式はエラーとして扱い、元のファイルを保持します。書き込み失敗を検出した場合は新規ドキュメントを削除して順序を復元し、削除に失敗した場合もエラーを返します。この復元処理はプロセスのクラッシュを対象としません。`/api/filetree/duplicateDoc` は引き続き単一ドキュメントのみを複製します。
-
### 兄弟ドキュメントを基準にドキュメントの順序を変更
* `/api/filetree/reorderDocs`
diff --git a/docs/API.md b/docs/API.md
index 884250e369..bebc8bddc1 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -23,7 +23,6 @@ Plugin resource declarations, data authorization, and publishing APIs are docume
* [Rename a document](#Rename-a-document)
* [Remove a document](#Remove-a-document)
* [Move documents](#Move-documents)
- * [Duplicate a document with descendants](#duplicate-a-document-with-descendants)
* [Set notebook and document sort values](#Set-notebook-and-document-sort-values)
* [Set a document's child document sort mode](#Set-a-documents-child-document-sort-mode)
* [Get human-readable path based on path](#Get-human-readable-path-based-on-path)
@@ -552,35 +551,6 @@ Move documents by `id`:
}
```
-### Duplicate a document with descendants
-
-`POST /api/filetree/duplicateDocTree` requires administrator authorization and a writable kernel.
-
-```json
-{"id":"20260919010000-source1"}
-```
-
-The ID must identify a document, excluding the notebook document. The endpoint copies the document and every descendant to the same parent and notebook. All blocks receive new IDs; only the root title gains a duplicate suffix. Child titles, hierarchy, document sort modes, and custom child order are preserved. In custom order, the new root follows the original.
-
-References and block links inside the copied subtree, including tab titles and rich table cells, point to copied blocks. Explicit block IDs in query embeds are also remapped; other references and assets retain their existing targets. Database blocks remain mirrors sharing the original database and row bindings, so editing a bound row can modify an original block. Copied blocks do not inherit database membership or flashcard membership.
-
-The successful response identifies the copied root:
-
-```json
-{
- "code": 0,
- "msg": "",
- "data": {
- "id": "20260919010001-copied1",
- "notebook": "20260919010002-notebk1",
- "path": "/20260919010001-copied1.sy",
- "hPath": "/Source (Duplicated 2026-09-19 01:00:01)"
- }
-}
-```
-
-Encrypted notebooks must be unlocked; the request holds a notebook lease through response serialization. Unreadable, corrupt, or unsupported source documents fail without modifying them. Detected write failures clean up the new documents and restore sorting; cleanup errors are reported. Process crashes are not covered by this compensation. `/api/filetree/duplicateDoc` continues to copy only one document.
-
### Reorder documents relative to a sibling
* `/api/filetree/reorderDocs`
diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.md
index 6b4e57671e..dd096aa8bc 100644
--- a/docs/API.zh-CN.md
+++ b/docs/API.zh-CN.md
@@ -23,7 +23,6 @@
* [重命名文档](#重命名文档)
* [删除文档](#删除文档)
* [移动文档](#移动文档)
- * [带子文档创建副本](#带子文档创建副本)
* [设置笔记本和文档排序值](#设置笔记本和文档排序值)
* [设置文档的子文档排序方式](#设置文档的子文档排序方式)
* [根据路径获取人类可读路径](#根据路径获取人类可读路径)
@@ -552,35 +551,6 @@ if (response.code === 0 && response.data) {
}
```
-### 带子文档创建副本
-
-`POST /api/filetree/duplicateDocTree` 需要管理员权限,内核不能处于只读模式。
-
-```json
-{"id":"20260919010000-source1"}
-```
-
-`id` 必须为文档 ID,不能为笔记本文档 ID。接口将文档及全部子文档复制到同一笔记本的原父目录。所有块使用新 ID,仅根文档标题增加副本后缀;子文档标题、层级、文档排序方式和自定义子文档顺序保持不变。自定义排序下,副本根文档紧接原文档。
-
-副本内部的块引用和块链接指向副本中的块,包括标签页标题和富文本表格单元格。查询嵌入中的显式块 ID 同样重映射,其他引用和资源文件保留原目标。数据库块仍为镜像,共享原数据库及行绑定,编辑绑定行可能修改源块。副本中的块不继承数据库条目绑定或闪卡归属。
-
-成功响应返回副本根文档:
-
-```json
-{
- "code": 0,
- "msg": "",
- "data": {
- "id": "20260919010001-copied1",
- "notebook": "20260919010002-notebk1",
- "path": "/20260919010001-copied1.sy",
- "hPath": "/Source (Duplicated 2026-09-19 01:00:01)"
- }
-}
-```
-
-加密笔记本须先解锁,请求持有笔记本租约直到响应序列化完成。源文档不可读、损坏或格式不受支持时返回错误并保留源文件。检测到写入失败时清理新建文档并恢复排序,清理失败也会返回错误;此补偿不覆盖进程崩溃。`/api/filetree/duplicateDoc` 仍仅复制单篇文档。
-
### 相对调整文档顺序
* `/api/filetree/reorderDocs`