Skip to content
npm · devops

API client & CI helpers for@kbve/devops

A TypeScript helper library for CI and for talking to the KBVE API — a typed openapi-fetch client, ArgoCD summary schemas, the CI project registry, GitHub Actions and issue helpers, and input sanitization.

Split for the browser

@kbve/devops/client and @kbve/devops/argocd are exported on their own, so a browser bundle that needs the API client does not have to prove jsdom is unreachable.

  • Client — createKbveClient, withBearerAuth, unwrap over types generated from the axum-kbve OpenAPI document.
  • Schemas — CI and forum schemas come from @kbve/proto, not a vendored copy.
TypeScriptLanguage
zodValidation
dompurifySanitize
MITLicense

What it gives you

Features

KBVE API client

createKbveClient and kbveApi wrap openapi-fetch over the OpenAPI types axum-kbve emits, with bearer-token auth, KbveApiError and unwrap.

ArgoCD schemas

Zod schemas for ArgoCD applications, health and sync status, and the AppSummary shape the dashboard reads.

CI project registry

CI_PROJECTS, validated at import time against the kbve.ci.v1 schema from @kbve/proto, with lookups by key, pipeline and test framework.

GitHub helpers

The gha namespace — CI failure classification and issue bodies, issues, actions, pulls, docker, and a retry wrapper for GitHub API calls.

Sanitization

Markdown-to-safe-JSON via marked and dompurify, plus port, container name and image sanitizers.

Questions

Frequently asked

What is the @kbve/devops library?

A TypeScript helper library for CI and for talking to the KBVE API. It carries the typed openapi-fetch client kbve.com calls axum-kbve through, the ArgoCD summary shapes the dashboard reads, the CI project registry, GitHub Actions and issue helpers, and input sanitization.

Does @kbve/devops still generate Zod schemas from protobuf?

No. The proto-to-zod generator moved to packages/proto-zod, and the CI and forum schemas are imported from @kbve/proto rather than vendored here. Only the ArgoCD and telemetry schemas stay committed as generated files in this package.

Why are ./argocd and ./client separate exports?

The root entry also carries sanitization and the YouTube helpers, which need jsdom. A browser bundle that only wants the API client or the ArgoCD schemas imports those subpaths and never has to pull jsdom in.

Where is @kbve/devops used?

The kbve.com web app uses it for the dashboard's ArgoCD view, the Minecraft player list and its platform data, and its tests run under moon with moon run devops:test.

Discuss on the forum

Questions, fixes and notes on this page live in the KBVE forum.