corvix.web.routes_api

Versioned /api/v1/* JSON route handlers (plus /metrics).

Thin decorated handlers that delegate to the implementation helpers in snapshot, rule_snippets, and actions; this module owns only the HTTP surface (paths, verbs, response types) and the theme presets.

Attributes

Functions

metrics_endpoint(→ litestar.Response[bytes])

Expose Prometheus metrics in text exposition format for scraping.

api_themes(→ dict[str, object])

Return available theme presets.

dashboards(→ dict[str, object])

List configured dashboard names.

snapshot(→ corvix.web.schemas.SnapshotResponse)

Return the selected dashboard data from storage.

notification_rule_snippets(...)

Return prefilled ignore-rule snippets for a notification.

dismiss_notification(→ litestar.Response[None])

Dismiss a notification thread (removes it from the GitHub inbox).

mark_notification_read(→ litestar.Response[None])

Mark a notification thread as read in GitHub and local storage.

Module Contents

corvix.web.routes_api.THEMES: dict[str, dict[str, str]][source][source]
corvix.web.routes_api.metrics_endpoint() litestar.Response[bytes][source][source]

Expose Prometheus metrics in text exposition format for scraping.

corvix.web.routes_api.api_themes() dict[str, object][source][source]

Return available theme presets.

corvix.web.routes_api.dashboards() dict[str, object][source][source]

List configured dashboard names.

corvix.web.routes_api.snapshot(dashboard: str | None = None) corvix.web.schemas.SnapshotResponse[source][source]

Return the selected dashboard data from storage.

corvix.web.routes_api.notification_rule_snippets(account_id: str, thread_id: str, dashboard: str | None = None) corvix.web.schemas.RuleSnippetsResponse[source][source]

Return prefilled ignore-rule snippets for a notification.

corvix.web.routes_api.dismiss_notification(account_id: str, thread_id: str) litestar.Response[None][source][source]

Dismiss a notification thread (removes it from the GitHub inbox).

Calls DELETE /notifications/threads/{id} on GitHub, then marks the record as dismissed in local storage. Returns 204 No Content on success.

corvix.web.routes_api.mark_notification_read(account_id: str, thread_id: str) litestar.Response[None][source][source]

Mark a notification thread as read in GitHub and local storage.