chore(web): swap flowsApi mock for real NF-7 endpoints (#366) #368
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!368
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/366-flowsapi-real-endpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces every mock body in
apps/web/src/features/flows/flowsApi.tswithfetchcalls against the NF-7 server surface (#363) + the NF-4 read-only routes (#352). Auth flows through the browser cookie viacredentials: "same-origin"— the web client doesn't manage tokens.Endpoints wired
GET /flows→list()GET /flows/:id→getFlow(id)GET /flows/:id/versions/:version→getFlow(id, version)(replay pin)GET /flows/:id/versions→listVersions(id)(for NF-UI-9)PATCH /flows/:id→updateFlow(id, body, patch)POST /flows/:id/enable/disable→setEnabled(id, enabled)DELETE /flows/:id→remove(id)POST /flows/:id/dry-run→testFire(flowId, payload)POST /flows/:id/revert?version=N→revertFlow(id, version)(for NF-UI-9)GET /flows/runs?flow_id&before&limit→listRuns(opts)GET /flows/runs/:id→getRun(runId)Bundled server-side change
NF-4
GET /flows'stoSummaryshipped a leaner shape than the client'sFlowSummary(no description / priority / mutex_group / repo_patterns / created_at / created_by). Extendedapps/server/src/http/flows-routes.ts::toSummaryto parse those fields out of the body JSON (defensive defaults on malformed bodies). Required for the list page filters + toolbar to work post-swap.Test harness
Existing tests call
__setMockLatency/__resetMockStore/__resetRunsMockStore/__setMockOperator— preserved as a back-compat surface that drives aglobalThis.fetchmock. The mock emits server-shaped responses from the seed JSON (flows.json,flow-graphs.json,flow-runs.json) so existing test files compile + pass without rewrites.Out of scope (still mocked)
GET /flows/mode— server endpoint not yet shipped.getMode()still reads the seed fixture; flagged inline asTODO(server). Filing a follow-up.GET /flows/fixtures— same story for the test-fire fixture library. Mock retained, flagged.Test plan
bun x turbo run typecheck— 4/4 packages clean.bun x biome check— clean on touched files.bun test apps/server— 1789 pass, 4 pre-existing fails (sweeper / foreman, identical on main).bun run test(web) — 369 pass, 11 pre-existing theme / pipeline-graph fails (identical on main)./app/flows, edit a flow, save, fire test event, watch the runs drawer populate.Closes #366.
🤖 Generated with Claude Code