# @dvsa/cvs-type-definitions

> Type definitions for CVS VTA and VTM applications

Latest version **17.3.0** (published 2026-11-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install @dvsa/cvs-type-definitions
pnpm add @dvsa/cvs-type-definitions
yarn add @dvsa/cvs-type-definitions
bun add @dvsa/cvs-type-definitions
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 17.3.0 |
| Published | 2026-11-03 |
| First published | 2023-06-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | dvsa |
| Maintainers | r.stepnowski, rfaulds, cullifordm, matthew2564, edwardwilson, shaun.hare, janmrozowicz, wraggj_dvsa, david.aaron, tomcrawleyy, setterfielda, annadodson, michalszy, johnneill, foysalm, gittinsr, baljinderhayre, rlcorp, dhcrees |

## Links

- npm: https://www.npmjs.com/package/@dvsa/cvs-type-definitions
- Repository: https://github.com/dvsa/cvs-type-definitions
- Homepage: https://github.com/dvsa/cvs-type-definitions#readme
- Issues: https://github.com/dvsa/cvs-type-definitions/issues
- npm.io page: https://npm.io/package/@dvsa/cvs-type-definitions

## Dependencies (5)

- [ajv](https://npm.io/package/ajv.md) ^8.20.0
- [util](https://npm.io/package/util.md) ^0.12.5
- [pretty-js](https://npm.io/package/pretty-js.md) ^0.2.2
- [ajv-formats](https://npm.io/package/ajv-formats.md) ^3.0.1
- [json-schema-deref-sync](https://npm.io/package/json-schema-deref-sync.md) ^0.14.0

## Recent versions

- 17.3.0 (latest) — 2026-11-03
- 18.0.0-zod-canary.2 (canary) — 2026-08-21
- 17.2.1 — 2026-09-08
- 17.2.0 — 2026-09-07
- 18.0.0-zod-canary.1 — 2026-08-21
- 18.0.0-canary.1 — 2026-08-21
- 18.0.0-zod.canary.0 — 2026-08-21
- 17.1.0 — 2026-08-17
- 17.0.0 — 2026-08-13
- 16.0.0 — 2026-08-13
- 15.1.1 — 2026-08-11
- 15.0.0 — 2026-07-30
- 14.0.2 — 2026-07-02
- 14.0.1 — 2026-06-23
- 14.0.0 — 2026-06-22
- … 167 more at https://npm.io/package/@dvsa/cvs-type-definitions/versions

## README

# cvs-type-definitions

[json schema](https://json-schema.org/) and .ts type definitions for cvs vta application

# Usage

## Install GitHub package:

- install GitHub package: `npm install @dvsa/cvs-type-definitions@latest`

## Example usage (TS types):

`import { CommercialVehicleTestSchema } from @dvsa/cvs-type-definitions/types/test`

## Example usage (json schemas)

The package exports an `isValidObject()` function which can be used to validate an object against a specified schema. e.g:

`import { isValidObject } from '@dvsa/cvs-type-definitions/lib/src/schema-validation../../schema-validator';`

`const isValidVisit: boolean = isValidObject('visit', myVisitObject);`

# Updating a schema

Edits should only be made to `json` schema definitions within `json-definitions` directory.

TypeScript interfaces will be generated from these files and saved to `types` directory. De-referenced json schema definitions will be saved to `json-schemas` directory. Only these two directories are published in the npm package.

1. Navigate into the relevant schema (e.g. `./json-definitions/test/index.json`)
2. Edit file
3. Generate the new TypeScript and de-referenced json schema definitions using `npm run generate`
4. Bump the version of the package using `npm version {major|minor|patch}`
5. Publish updates

# Adding a new schema

1. Create a new subdirectory with an appropriate name within the `json-defininitions` directory (e.g. `my-new-schema`)
2. If you do not wish for a type file and a de-referenced schema to be generated for a schema, add `.ignore` in the name of the file (e.g. `my-new-schema.ignore.json`)
3. Generate the new TypeScript definitions using `npm run generate`
4. Bump the version of the package using `npm version {major|minor|patch}`
5. Publish updates

# Creating a new enum
1. Add (or update) the enum to a file marked `*.enum.json` in the `enum` folder in `json-definitions`
2. Make sure you give it both `enum` and `tsEnumNames` properties on the object
3. Then update the `json-definitions` to use the new file name
4. Run the generate and you should have just a new file in the enum folder of types, which is exportable and useable.

# Publishing a new version

- Raise a PR
- The PR title should start with `major`, `minor` or `patch` and be followed by the character `(`. Doing this ensure the correct version of the package is published to npm. A Github action should enforce the PR title format.
- Add a description of the changes in the `Changelog` section of the PR description
- Once merged to develop, a github action should create a release and publish a new version of that release on npm

---
_Source: https://npm.io/package/@dvsa/cvs-type-definitions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
