fix(wizard): drop data field from create_edge ops

EA2 server rejects data on create_edge with extra_forbidden despite the
OpenAPI schema marking it optional. flow_key is implicit from the node refs.
This commit is contained in:
2026-06-14 12:19:06 +04:00
parent 82de744985
commit 7b4f76c1de
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ p.on("response", async (res) => {
const u = res.url(); const u = res.url();
if (/\/api\/(ea2|runtime)\//.test(u) && (res.request().method() === "POST" || res.request().method() === "PUT")) { if (/\/api\/(ea2|runtime)\//.test(u) && (res.request().method() === "POST" || res.request().method() === "PUT")) {
let body = ""; let body = "";
try { body = (await res.text()).slice(0, 200); } catch {} try { body = await res.text(); } catch {}
console.log(`[resp ${res.status()}] ${res.request().method()} ${u.replace("https://canvas.flow-master.ai", "")}${body}`); console.log(`[resp ${res.status()}] ${res.request().method()} ${u.replace("https://canvas.flow-master.ai", "")}${body.replace(/\n/g, " ")}`);
} }
}); });
+2 -2
View File
@@ -130,14 +130,14 @@ export const wizardApi = {
data: { _key, flow_key: flowKey, ...rest }, data: { _key, flow_key: flowKey, ...rest },
}; };
}, },
createEdge(flowKey: string, fromKey: string, toKey: string, role = "next"): CreateEdgeOp { createEdge(_flowKey: string, fromKey: string, toKey: string, role = "next"): CreateEdgeOp {
// EA2 server rejects `data` on create_edge despite the OpenAPI schema marking it optional.
return { return {
op: "create_edge", op: "create_edge",
edge_coll: "ea2_edge", edge_coll: "ea2_edge",
from: `ea2_node/${fromKey}`, from: `ea2_node/${fromKey}`,
to: `ea2_node/${toKey}`, to: `ea2_node/${toKey}`,
role, role,
data: { flow_key: flowKey },
}; };
}, },
publishFlow(flowKey: string): UpdateOp { publishFlow(flowKey: string): UpdateOp {