corvix.web.schemas¶
Typed response schemas for the Corvix web API.
These dataclasses are the single source of truth for the JSON shapes returned
by the /api/v1 route handlers. Litestar serializes them directly and
auto-generates an OpenAPI document from their annotations; the frontend’s
TypeScript types are code-generated from that document (see
scripts/export_openapi.py and frontend/src/api-types.gen.ts).
Every field is required (no defaults) so the generated OpenAPI schema marks
each property as required and the TypeScript types never become accidentally
optional. str | None fields map to a nullable-but-present property, matching
how the handlers always emit the key.
Classes¶
A single notification row rendered by the dashboard table. |
|
A group of dashboard items (e.g. grouped by repository or reason). |
|
Aggregate counts shown in the dashboard shell. |
|
A per-account fetch failure recorded during a poll cycle. |
|
Poller health surfaced to the UI for the staleness warning banner. |
|
In-tab browser notification settings echoed to the frontend. |
|
Notification configuration relevant to the browser client. |
|
Full dashboard snapshot returned by |
|
Prefilled ignore-rule snippets for a single notification. |
Functions¶
|
Convert a |
|
Assemble a typed |
Module Contents¶
- class corvix.web.schemas.DashboardItemResponse[source][source]¶
A single notification row rendered by the dashboard table.
- class corvix.web.schemas.DashboardGroupResponse[source][source]¶
A group of dashboard items (e.g. grouped by repository or reason).
- items: list[DashboardItemResponse][source][source]¶
- class corvix.web.schemas.DashboardSummaryResponse[source][source]¶
Aggregate counts shown in the dashboard shell.
- class corvix.web.schemas.AccountErrorResponse[source][source]¶
A per-account fetch failure recorded during a poll cycle.
- class corvix.web.schemas.PollerStatusResponse[source][source]¶
Poller health surfaced to the UI for the staleness warning banner.
- account_errors: list[AccountErrorResponse][source][source]¶
- class corvix.web.schemas.BrowserTabNotificationsConfigResponse[source][source]¶
In-tab browser notification settings echoed to the frontend.
- class corvix.web.schemas.NotificationsConfigResponse[source][source]¶
Notification configuration relevant to the browser client.
- class corvix.web.schemas.SnapshotResponse[source][source]¶
Full dashboard snapshot returned by
GET /api/v1/snapshot.- groups: list[DashboardGroupResponse][source][source]¶
- notifications_config: NotificationsConfigResponse | None[source][source]¶
- class corvix.web.schemas.RuleSnippetsResponse[source][source]¶
Prefilled ignore-rule snippets for a single notification.
- corvix.web.schemas._dashboard_item_response(item: corvix.dashboarding.DashboardItem) DashboardItemResponse[source][source]¶
Convert a
dashboarding.DashboardIteminto its response schema.
- corvix.web.schemas.build_snapshot_response(*, data: corvix.dashboarding.DashboardData, dashboard_names: list[str], poller: PollerStatusResponse, notifications_config: corvix.config.notifications.NotificationsConfig | None) SnapshotResponse[source][source]¶
Assemble a typed
SnapshotResponsefrom dashboard data.Centralizes the mapping from the internal
DashboardDatadataclass (plus the already-resolved poller status and config state) to the wire schema so the route handler stays thin and the contract lives in one place.