From 7b4f76c1dea10e0333aeaa4148208683902408e8 Mon Sep 17 00:00:00 2001 From: shad Date: Sun, 14 Jun 2026 12:19:06 +0400 Subject: [PATCH] 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. --- qa/audit_wizard_writes.mjs | 4 ++-- src/lib/wizardApi.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qa/audit_wizard_writes.mjs b/qa/audit_wizard_writes.mjs index 3f0aca7..ca4ad48 100644 --- a/qa/audit_wizard_writes.mjs +++ b/qa/audit_wizard_writes.mjs @@ -23,8 +23,8 @@ p.on("response", async (res) => { const u = res.url(); if (/\/api\/(ea2|runtime)\//.test(u) && (res.request().method() === "POST" || res.request().method() === "PUT")) { let body = ""; - try { body = (await res.text()).slice(0, 200); } catch {} - console.log(`[resp ${res.status()}] ${res.request().method()} ${u.replace("https://canvas.flow-master.ai", "")} → ${body}`); + try { body = await res.text(); } catch {} + console.log(`[resp ${res.status()}] ${res.request().method()} ${u.replace("https://canvas.flow-master.ai", "")} → ${body.replace(/\n/g, " ")}`); } }); diff --git a/src/lib/wizardApi.ts b/src/lib/wizardApi.ts index 75a63a5..b619e5a 100644 --- a/src/lib/wizardApi.ts +++ b/src/lib/wizardApi.ts @@ -130,14 +130,14 @@ export const wizardApi = { 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 { op: "create_edge", edge_coll: "ea2_edge", from: `ea2_node/${fromKey}`, to: `ea2_node/${toKey}`, role, - data: { flow_key: flowKey }, }; }, publishFlow(flowKey: string): UpdateOp {