npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kubevirt-ui-ext/kubevirt-api

v2.0.0

Published

kubevirt OpenAPI automation for TypeScript

Downloads

2,622

Readme

NPM Version

kubevirt-api

alt gopher network

TypeScript types for KubeVirt, Kubernetes, CDI, NMState, and related OpenShift Console models.

Documentation

Auto generated API reference: KubeVirt API Docs

Packages

| Export | Source | |--------|--------| | @kubevirt-ui/kubevirt-api/kubevirt | kubevirt OpenAPI swagger | | @kubevirt-ui/kubevirt-api/kubernetes | kubernetes OpenAPI swagger | | @kubevirt-ui/kubevirt-api/containerized-data-importer | CDI OpenAPI swagger | | @kubevirt-ui/kubevirt-api/nmstate | kubernetes-nmstate CRDs | | @kubevirt-ui/kubevirt-api/virt-template | virt-template CRDs | | @kubevirt-ui/kubevirt-api/console | OpenShift Console models |

KubeVirt API reference: http://kubevirt.io/api-reference/master/index.html

Usage

yarn add @kubevirt-ui/kubevirt-api
import { IoK8sApiCoreV1Pod } from '@kubevirt-ui/kubevirt-api/kubernetes';
import { V1VirtualMachine } from '@kubevirt-ui/kubevirt-api/kubevirt';
import { V1beta1DataVolume } from '@kubevirt-ui/kubevirt-api/containerized-data-importer';

import { VirtualMachineModelGroupVersionKind } from '@kubevirt-ui/kubevirt-api/console/models';
import VirtualMachineModel from '@kubevirt-ui/kubevirt-api/console/models/VirtualMachineModel';

Each package exports TypeScript interfaces only. There is no runtime, no serializers, and no generated API client.

Update API

  1. Install dependencies:
yarn
  1. Pin upstream versions in scripts/versions.json if needed.

  2. Remove previously generated output (preserves kubevirt/test/ and nmstate/custom-models/):

yarn clean:all
  1. Generate types:
yarn generate
  1. Validate and build:
yarn test
yarn build
  1. Generate docs (optional):
yarn generate:docs

Generation pipeline

All generation is handled by a single script:

yarn generate   # runs scripts/generate-types.sh

Swagger-based packages

Used for kubevirt, kubernetes, and containerized-data-importer:

  1. Download upstream swagger JSON
  2. Generate types with swagger-typescript-api (--no-client --modular --patch, plus scripts/swagger-type-names.config.cjs for K8s naming)
  3. Split the output into one file per interface via scripts/split-data-contracts.mjs

CRD-based packages

Used for nmstate and virt-template:

  1. Download upstream CRD YAML into <package>/.crds/
  2. Convert CRDs to OpenAPI with crdtoapi<package>/.openapi.yaml
  3. Generate interfaces with crdtotypes<package>/models/

Console models

OpenShift Console model definitions are fetched from upstream and written to console/core/index.ts. Models that already exist under console/models/ are deduplicated automatically.

Scripts

| File | Purpose | |------|---------| | scripts/generate-types.sh | Main generation entrypoint | | scripts/versions.json | Pinned upstream source versions | | scripts/swagger-type-names.config.cjs | K8s type naming and format: bytestring for swagger-typescript-api | | scripts/split-data-contracts.mjs | Split swagger output into one type per file |

Intermediate artifacts (.crds/, .openapi.yaml, swagger-*.json) are written next to each package and ignored by git.

Tests

KubeVirt type tests live in kubevirt/test/. Each file exports a testObject literal that must satisfy the corresponding generated interface.

yarn test   # tsc --noEmit

Tests without a matching upstream type are kept under kubevirt/test/orphaned/ and excluded from compilation.

Breaking changes (v2)

This generation refactor removes runtime exports that were previously produced by openapi-generator:

  • No runtime.ts
  • No apis/ clients
  • No *FromJSON / *ToJSON helpers