feat: 收口文档桥接与 OnlyOffice/Sidebar 回归

- 为 documents.save/meta/content、blocks.patch 与 sidebar.dataset.list 补齐 Rust 协议映射、共享契约与桥接执行器

- 对齐 BlockNote、Mindmap、OnlyOffice 的保存/路由元信息,并补真实浏览器回归脚本与 OnlyOffice 部署基线

- 忽略 Rust 本地构建产物与 Harness 调试状态文件,避免临时产物进入仓库历史
This commit is contained in:
lix-2026
2026-04-15 03:06:29 +08:00
parent 84a8454fa9
commit b33ffb99e7
51 changed files with 3260 additions and 379 deletions
+64 -8
View File
@@ -138,7 +138,15 @@ export const put = mutation({
const payload = args.data ?? defaultMindmapData;
if (existing && existing.deleted_at == null && args.createOnly) {
return { ok: true, created: false, skipped: true, updated_at: existing.updated_at ?? null };
return {
ok: true,
created: false,
skipped: true,
workspace_id: doc.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
updated_at: existing.updated_at ?? null,
};
}
if (existing) {
@@ -149,7 +157,15 @@ export const put = mutation({
deleted_by: null,
});
await enqueueIngestMindmapJob(ctx, { userId, docId: args.docId, mindmapId, debounceMs: 1500 });
return { ok: true, created: false, skipped: false, updated_at: ts };
return {
ok: true,
created: false,
skipped: false,
workspace_id: doc.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
updated_at: ts,
};
}
await ctx.db.insert("mindmaps", {
@@ -166,7 +182,15 @@ export const put = mutation({
});
await enqueueIngestMindmapJob(ctx, { userId, docId: args.docId, mindmapId, debounceMs: 1500 });
return { ok: true, created: true, skipped: false, updated_at: ts };
return {
ok: true,
created: true,
skipped: false,
workspace_id: doc.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
updated_at: ts,
};
},
});
@@ -185,12 +209,26 @@ export const softDelete = mutation({
if (!existing) {
// 兼容:不存在也视为成功
return { ok: true, moved: 0 };
return {
ok: true,
moved: 0,
workspace_id: null,
document_id: args.docId,
mindmap_id: mindmapId,
deleted_at: null,
};
}
if (existing.deleted_at != null) {
// 已在垃圾桶:保持幂等,避免重复删除导致 updated_at 抖动/重复调度
return { ok: true, moved: 0, deleted_at: existing.deleted_at };
return {
ok: true,
moved: 0,
workspace_id: existing.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
deleted_at: existing.deleted_at,
};
}
const ts = nowIso();
@@ -204,7 +242,14 @@ export const softDelete = mutation({
mindmapId,
deletedAt: ts,
});
return { ok: true, moved: 1, deleted_at: ts };
return {
ok: true,
moved: 1,
workspace_id: existing.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
deleted_at: ts,
};
},
});
@@ -272,7 +317,13 @@ export const restore = mutation({
const ts = nowIso();
await ctx.db.patch(existing._id, { deleted_at: null, deleted_by: null, updated_at: ts });
return { ok: true };
return {
ok: true,
workspace_id: existing.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
updated_at: ts,
};
},
});
@@ -294,7 +345,12 @@ export const purge = mutation({
}
await ctx.db.delete(existing._id);
return { ok: true };
return {
ok: true,
workspace_id: existing.workspace_id,
document_id: args.docId,
mindmap_id: mindmapId,
};
},
});