Skip to content

Repo Statistics

WarmHub exposes several repository statistics surfaces because dashboards, billing, settings pages, and shape summaries need different levels of detail.

client.repo.listForCaller(opts?) returns repositories across all organizations the caller has access to, with optional limit and sort ('recent' | 'name') parameters.

Use this when you need an account-wide view rather than calling listPage separately for each organization. Note that listForCaller requires an interactive session — it does not accept PAT or component-token auth.

client.repo.listPage(...) returns repository list items with dashboard-oriented metadata:

  • total is the exact active count across shapes, things, and assertions.

  • byKind breaks that exact count into shape, thing, and assertion.

  • lastWriteAt is an activity timestamp, not a strict write-history cursor.

  • hasErrors is true when the repo has at least one active subscription whose latest terminal run is a failure. A subsequent successful run clears the flag. Inactive subscriptions are excluded.

  • failingSubscriptionName is present when hasErrors is true and the caller holds repo:configure. It names the failing subscription whose failure is the most recent among all currently failing subscriptions.

Use this for repository tiles and organization dashboards.

client.repo.getStats(...) returns an exact active-item count for one repository.

The total field sums active shapes, things, and assertions. The per-kind breakdown separates those categories, and the per-shape map counts active things and assertions by shape.

Use this for billing, quotas, or repository detail pages that need the per-shape map.

client.repo.getStatsBatch(...) returns exact totals for up to 100 repositories in one request.

Use it when callers need exact counts for a caller-provided set of repositories. The batch result does not include the per-shape map; call getStats(...) for any repository where you need that detail.

client.repo.getConfigureStats(...) returns settings-page counts such as the number of subscriptions attached to a repository.

Use it before delete or visibility-change flows when the UI needs to explain what repository configuration will be affected.

client.repo.getShapeInstanceCounts(...) returns thing and assertion counts grouped by shape.

The server computes these totals directly, so callers do not need to page through repository contents to build a shape summary UI.