6.4.0 • Published 24 days ago

@dvsa/cvs-type-definitions v6.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
24 days 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
6.4.0

24 days ago

6.3.0

29 days ago

6.2.0

1 month ago

6.1.0

2 months ago

6.0.1

3 months ago

6.0.0

3 months ago

5.1.2

3 months ago

5.1.1

3 months ago

5.1.0

3 months ago

5.0.0

4 months ago

4.4.1

4 months ago

4.4.0

5 months ago

4.3.1

5 months ago

4.3.0

5 months ago

4.2.0

5 months ago

4.1.1

5 months ago

4.1.0

5 months ago

4.0.3

5 months ago

2.0.28

10 months ago

2.0.29

10 months ago

2.0.30

9 months ago

3.2.2

7 months ago

3.0.12

9 months ago

3.2.1

7 months ago

3.0.13

9 months ago

3.2.0

7 months ago

3.0.10

9 months ago

3.0.11

9 months ago

3.6.2

6 months ago

3.0.16

9 months ago

3.6.1

6 months ago

3.0.17

9 months ago

3.6.0

6 months ago

3.0.14

9 months ago

3.2.3

7 months ago

3.0.15

9 months ago

2.1.16

9 months ago

2.1.17

9 months ago

2.1.14

9 months ago

2.1.15

9 months ago

4.0.1

5 months ago

2.1.12

9 months ago

4.0.0

5 months ago

2.1.13

9 months ago

4.0.2

5 months ago

2.1.11

9 months ago

2.1.18

9 months ago

2.1.19

9 months ago

2.1.21

9 months ago

2.1.20

9 months ago

3.6.3

6 months ago

3.1.2

7 months ago

3.1.1

7 months ago

3.1.0

7 months ago

3.5.0

6 months ago

3.0.45

8 months ago

3.0.46

7 months ago

3.0.43

8 months ago

3.0.44

8 months ago

3.0.49

7 months ago

3.0.47

7 months ago

3.0.48

7 months ago

3.0.41

8 months ago

3.0.42

8 months ago

3.0.40

8 months ago

3.4.0

6 months ago

3.0.4

9 months ago

3.0.3

9 months ago

3.0.2

9 months ago

3.0.1

9 months ago

3.0.8

9 months ago

3.0.7

9 months ago

3.0.6

9 months ago

3.0.5

9 months ago

3.0.0

9 months ago

3.0.23

8 months ago

3.0.24

8 months ago

3.0.21

9 months ago

3.0.22

8 months ago

3.0.27

8 months ago

3.0.28

8 months ago

3.0.25

8 months ago

3.0.26

8 months ago

3.0.20

9 months ago

2.1.1

9 months ago

2.0.16

10 months ago

2.0.14

10 months ago

2.0.11

11 months ago

2.0.12

10 months ago

3.0.18

9 months ago

3.0.19

9 months ago

3.0.9

9 months ago

2.1.0

9 months ago

3.3.1

7 months ago

3.0.34

8 months ago

3.3.0

7 months ago

3.0.35

8 months ago

3.0.32

8 months ago

3.0.33

8 months ago

3.0.38

8 months ago

3.7.0

6 months ago

3.0.39

8 months ago

3.3.3

6 months ago

3.0.36

8 months ago

3.3.2

6 months ago

3.0.37

8 months ago

3.0.30

8 months ago

2.0.19

10 months ago

3.0.31

8 months ago

2.0.18

10 months ago

2.0.26

10 months ago

2.0.24

10 months ago

2.0.25

10 months ago

2.0.22

10 months ago

2.0.23

10 months ago

2.0.20

10 months ago

2.0.21

10 months ago

3.0.29

8 months ago

1.0.11

11 months ago