chore: 保存剩余工作区改动并清理到干净状态
- 补 OnlyOffice callback 附件写回的 media asset bridge 适配层,并继续扩展 documents bridge/测试覆盖 - 提交当前 OMX hooks 删除与 Harness 运行状态文件更新,保留本轮任务执行轨迹 - 一并提交仓库中已跟踪的 Rust target 构建产物与相关协议桥接变更,确保工作区清零
This commit is contained in:
@@ -3,6 +3,14 @@ import { isConvexEnabled } from "@/lib/convex/enabled";
|
||||
import { getConvexHttpClient } from "@/lib/convex/server";
|
||||
import { api } from "@/lib/convex/api";
|
||||
import { resolveOnlyOfficeInternalUrl } from "@/lib/onlyoffice/internal-url";
|
||||
import {
|
||||
buildDocumentBridgeContextWithActor,
|
||||
buildDocumentCommandEnvelope,
|
||||
} from "@/lib/documents/bridge";
|
||||
import {
|
||||
executeMediaAssetWritebackBridgeCommand,
|
||||
type MediaAssetReplaceStoragePayload,
|
||||
} from "@/lib/documents/media-asset-command-adapter";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -137,10 +145,42 @@ export async function POST(request: Request) {
|
||||
return NextResponse.json({ error: 1 });
|
||||
}
|
||||
|
||||
await client.mutation(api.mediaAssets.replaceStorageFromUpload, {
|
||||
userId,
|
||||
id: assetId,
|
||||
storageId: storageId as any,
|
||||
const bridgeContext = buildDocumentBridgeContextWithActor({
|
||||
request,
|
||||
workspaceId: String((asset as any).workspace_id || "").trim() || null,
|
||||
actor: {
|
||||
actorType: "service",
|
||||
actorId: userId,
|
||||
sessionId: "onlyoffice-callback",
|
||||
},
|
||||
source: {
|
||||
channel: "onlyoffice-callback",
|
||||
client: "onlyoffice-document-server",
|
||||
},
|
||||
idempotencyKey: String(body.key || assetId || "").trim() || null,
|
||||
});
|
||||
const envelope = buildDocumentCommandEnvelope({
|
||||
name: "media.assets.replace_storage",
|
||||
payload: {
|
||||
assetId,
|
||||
documentId: String((asset as any).document_id || "").trim(),
|
||||
workspaceId: String((asset as any).workspace_id || "").trim() || null,
|
||||
storageId,
|
||||
userId,
|
||||
} satisfies MediaAssetReplaceStoragePayload,
|
||||
context: bridgeContext,
|
||||
target: {
|
||||
workspaceId: String((asset as any).workspace_id || "").trim() || null,
|
||||
pageId: String((asset as any).document_id || "").trim() || null,
|
||||
},
|
||||
reason: "ONLYOFFICE 回调写回附件存储",
|
||||
refs: [`onlyoffice:asset:${assetId}`],
|
||||
});
|
||||
|
||||
await executeMediaAssetWritebackBridgeCommand({
|
||||
client,
|
||||
context: bridgeContext,
|
||||
envelope,
|
||||
});
|
||||
|
||||
return NextResponse.json({ error: 0 });
|
||||
|
||||
Reference in New Issue
Block a user