9.1.0 • Published 9 months ago

@dvsa/cvs-type-definitions v9.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

cvs-type-definitions

json schema and .ts type definitions for cvs vta application

Usage

Install GitHub package:

  • Ensure consuming repo is set up to install private DVSA packages by adding the following to the .npmrc file: @dvsa:registry=https://npm.pkg.github.com
  • NOTE: in order to install private DVSA packages you will need a .npmrc file in your $PATH containing a personal access token linked to the DVSA org. You should add the token to your .npmrc file as follows:
    • //npm.pkg.github.com/:_authToken=<AUTH_TOKEN_HERE>
  • 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. Add an index.json file to the new directory with appropriate json schema definitions
  3. Add the new schema name to the schemas constant array in ./schemas.ts NOTE: this MUST match the directory name created at step 1 (my-new-schema in the example here)
  4. Generate the new TypeScript definitions using npm run generate
  5. Bump the version of the package using npm version {major|minor|patch}
  6. Publish updates

Publishing github package

  1. Raise a Pull Request on Github and await approvals
  2. Once merged, publish the new package from the latest develop branch to GitHub packages using npm publish - _You must be logged in and have the correct permissions to publish to the package
7.8.0

1 year ago

8.1.0

10 months ago

7.13.1

12 months ago

7.13.2

12 months ago

7.13.0

12 months ago

7.9.1

1 year ago

7.9.0

1 year ago

9.0.0

10 months ago

7.12.0

1 year ago

7.6.2

1 year ago

7.6.1

1 year ago

7.6.3

1 year ago

9.1.0

9 months ago

7.11.0

1 year ago

7.7.1

1 year ago

7.7.0

1 year ago

8.0.0

12 months ago

7.10.0

1 year ago

7.5.1

1 year ago

7.6.0

1 year ago

7.5.0

1 year ago

7.3.0

2 years ago

7.0.0

2 years ago

7.4.0

2 years ago

7.1.0

2 years ago

7.2.0

2 years ago

6.4.0

2 years ago

6.3.0

2 years ago

6.2.0

2 years ago

6.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.4.1

2 years ago

4.4.0

2 years ago

4.3.1

2 years ago

4.3.0

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.3

2 years ago

2.0.28

3 years ago

2.0.29

3 years ago

2.0.30

3 years ago

3.2.2

2 years ago

3.0.12

3 years ago

3.2.1

2 years ago

3.0.13

3 years ago

3.2.0

2 years ago

3.0.10

3 years ago

3.0.11

3 years ago

3.6.2

2 years ago

3.0.16

3 years ago

3.6.1

2 years ago

3.0.17

3 years ago

3.6.0

2 years ago

3.0.14

3 years ago

3.2.3

2 years ago

3.0.15

3 years ago

2.1.16

3 years ago

2.1.17

3 years ago

2.1.14

3 years ago

2.1.15

3 years ago

4.0.1

2 years ago

2.1.12

3 years ago

4.0.0

2 years ago

2.1.13

3 years ago

4.0.2

2 years ago

2.1.11

3 years ago

2.1.18

3 years ago

2.1.19

3 years ago

2.1.21

3 years ago

2.1.20

3 years ago

3.6.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.5.0

2 years ago

3.0.45

2 years ago

3.0.46

2 years ago

3.0.43

2 years ago

3.0.44

2 years ago

3.0.49

2 years ago

3.0.47

2 years ago

3.0.48

2 years ago

3.0.41

3 years ago

3.0.42

3 years ago

3.0.40

3 years ago

3.4.0

2 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.0

3 years ago

3.0.23

3 years ago

3.0.24

3 years ago

3.0.21

3 years ago

3.0.22

3 years ago

3.0.27

3 years ago

3.0.28

3 years ago

3.0.25

3 years ago

3.0.26

3 years ago

3.0.20

3 years ago

2.1.1

3 years ago

2.0.16

3 years ago

2.0.14

3 years ago

2.0.11

3 years ago

2.0.12

3 years ago

3.0.18

3 years ago

3.0.19

3 years ago

3.0.9

3 years ago

2.1.0

3 years ago

3.3.1

2 years ago

3.0.34

3 years ago

3.3.0

2 years ago

3.0.35

3 years ago

3.0.32

3 years ago

3.0.33

3 years ago

3.0.38

3 years ago

3.7.0

2 years ago

3.0.39

3 years ago

3.3.3

2 years ago

3.0.36

3 years ago

3.3.2

2 years ago

3.0.37

3 years ago

3.0.30

3 years ago

2.0.19

3 years ago

3.0.31

3 years ago

2.0.18

3 years ago

2.0.26

3 years ago

2.0.24

3 years ago

2.0.25

3 years ago

2.0.22

3 years ago

2.0.23

3 years ago

2.0.20

3 years ago

2.0.21

3 years ago

3.0.29

3 years ago

1.0.11

3 years ago