feat: 完成 rust cutover phase 8 收口
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { isConvexEnabled } from "@/lib/convex/enabled";
|
||||
import { getAuthedConvexClient } from "@/lib/convex/route";
|
||||
import { api } from "@/lib/convex/api";
|
||||
import {
|
||||
assertDocumentId,
|
||||
buildDocumentBridgeContext,
|
||||
buildDocumentQueryEnvelope,
|
||||
documentBridgeErrorResponse,
|
||||
} from "@/lib/documents/bridge";
|
||||
import {
|
||||
executeRustBridgeQueryTransport,
|
||||
resolveRustBridgeQueryPlan,
|
||||
} from "@/lib/documents/rust-runtime";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
if (isConvexEnabled()) {
|
||||
@@ -23,9 +27,17 @@ export async function GET(request: Request) {
|
||||
name: "documents.content.get",
|
||||
payload: { documentId, workspaceId },
|
||||
});
|
||||
|
||||
const result = await client.query(api.documents.getContent, {
|
||||
id: documentId,
|
||||
const plan = await resolveRustBridgeQueryPlan({
|
||||
context: bridgeContext,
|
||||
envelope,
|
||||
});
|
||||
const result = await executeRustBridgeQueryTransport<{
|
||||
content?: unknown;
|
||||
revision?: number | null;
|
||||
conflict_detection_key?: string | null;
|
||||
} | null>({
|
||||
client,
|
||||
plan,
|
||||
});
|
||||
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user