fix(types): T4 — stop spreading TopologySummary as dict; fix heartbeat .get() and scope param

This commit is contained in:
2026-05-01 01:51:43 -04:00
parent 0f90dcfd3e
commit d187304e99
6 changed files with 11 additions and 8 deletions

View File

@@ -120,4 +120,4 @@ async def api_create_blank_topology(
row = await repo.get_topology(topology_id)
if row is None: # pragma: no cover — create then vanish
raise HTTPException(status_code=500, detail="topology insert vanished")
return TopologySummary(**row)
return row

View File

@@ -74,4 +74,6 @@ async def api_create_topology(
) from exc
raise
row = await repo.get_topology(topology_id)
return TopologySummary(**row)
if row is None: # pragma: no cover — create then vanish
raise HTTPException(status_code=500, detail="topology insert vanished")
return row

View File

@@ -73,4 +73,4 @@ async def api_deploy_topology(
)
background.add_task(_run_deploy, topology_id)
return TopologySummary(**topo)
return topo

View File

@@ -6,7 +6,7 @@ from typing import Optional
from fastapi import APIRouter, Depends, Query
from decnet.telemetry import traced as _traced
from decnet.web.db.models import TopologyListResponse, TopologySummary
from decnet.web.db.models import TopologyListResponse
from decnet.web.dependencies import repo, require_viewer
router = APIRouter()
@@ -35,5 +35,5 @@ async def api_list_topologies(
total=total,
limit=limit,
offset=offset,
data=[TopologySummary(**r) for r in rows],
data=rows,
)

View File

@@ -76,4 +76,4 @@ async def api_teardown_topology(
)
background.add_task(_run_teardown, topology_id)
return TopologySummary(**topo)
return topo