Summary
lib/updates-api.ts calls the gateway software-update endpoints with raw fetch() instead of the generated @selfpatch/ros2-medkit-client-ts client used everywhere else in the app. Now that the 0.6.0 client types the updates operations, migrate this module to the typed client for consistency.
Proposed solution
Replace the raw fetch() calls in updates-api.ts (fetchUpdateIds, fetchUpdateStatus, fetchUpdateDetail, and the prepare / execute / automate / delete helpers) with the typed client's updates operations.
Preserve the existing behavior:
- the status-code-aware
UpdatesApiError that distinguishes 501 ("no update backend") from other errors (the typed client exposes the response status, so this is achievable);
- the opaque, plugin-defined update detail response.
Additional context
- This is not a 0.5.0 migration workaround (there is no "temporary" / "until regenerated" marker) - it is a deliberate hand-written module, so this is a consistency / maintainability refactor, not a bug.
- The direct 0.5.0 query-param suppressions (
/logs, /faults) were already removed during the 0.6.0 client migration; this module is the remaining raw-fetch path.
Summary
lib/updates-api.tscalls the gateway software-update endpoints with rawfetch()instead of the generated@selfpatch/ros2-medkit-client-tsclient used everywhere else in the app. Now that the 0.6.0 client types theupdatesoperations, migrate this module to the typed client for consistency.Proposed solution
Replace the raw
fetch()calls inupdates-api.ts(fetchUpdateIds,fetchUpdateStatus,fetchUpdateDetail, and the prepare / execute / automate / delete helpers) with the typed client'supdatesoperations.Preserve the existing behavior:
UpdatesApiErrorthat distinguishes501("no update backend") from other errors (the typed client exposes the response status, so this is achievable);Additional context
/logs,/faults) were already removed during the 0.6.0 client migration; this module is the remaining raw-fetchpath.