import { NextResponse } from "next/server";
import { isConvexEnabled } from "@/lib/convex/enabled";
import { executeDocumentEmbedBridgeCommand } from "@/lib/documents/page-command-adapter";

export async function POST(request: Request) {
  if (isConvexEnabled()) {
    return executeDocumentEmbedBridgeCommand(request);
  }

  return NextResponse.json({ error: "当前仅支持 Convex 模式" }, { status: 501 });
}
