7.6.0 • Published 8 months ago

@dvsa/cvs-type-definitions v7.6.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 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.5.1

8 months ago

7.6.0

8 months ago

7.5.0

8 months ago

7.3.0

11 months ago

7.0.0

12 months ago

7.4.0

11 months ago

7.1.0

12 months ago

7.2.0

12 months ago

6.4.0

1 year ago

6.3.0

1 year ago

6.2.0

1 year ago

6.1.0

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

5.1.2

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.0.0

1 year ago

4.4.1

1 year 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

2 years ago

2.0.29

2 years ago

2.0.30

2 years ago

3.2.2

2 years ago

3.0.12

2 years ago

3.2.1

2 years ago

3.0.13

2 years ago

3.2.0

2 years ago

3.0.10

2 years ago

3.0.11

2 years ago

3.6.2

2 years ago

3.0.16

2 years ago

3.6.1

2 years ago

3.0.17

2 years ago

3.6.0

2 years ago

3.0.14

2 years ago

3.2.3

2 years ago

3.0.15

2 years ago

2.1.16

2 years ago

2.1.17

2 years ago

2.1.14

2 years ago

2.1.15

2 years ago

4.0.1

2 years ago

2.1.12

2 years ago

4.0.0

2 years ago

2.1.13

2 years ago

4.0.2

2 years ago

2.1.11

2 years ago

2.1.18

2 years ago

2.1.19

2 years ago

2.1.21

2 years ago

2.1.20

2 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

2 years ago

3.0.42

2 years ago

3.0.40

2 years ago

3.4.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

3.0.23

2 years ago

3.0.24

2 years ago

3.0.21

2 years ago

3.0.22

2 years ago

3.0.27

2 years ago

3.0.28

2 years ago

3.0.25

2 years ago

3.0.26

2 years ago

3.0.20

2 years ago

2.1.1

2 years ago

2.0.16

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

3.0.18

2 years ago

3.0.19

2 years ago

3.0.9

2 years ago

2.1.0

2 years ago

3.3.1

2 years ago

3.0.34

2 years ago

3.3.0

2 years ago

3.0.35

2 years ago

3.0.32

2 years ago

3.0.33

2 years ago

3.0.38

2 years ago

3.7.0

2 years ago

3.0.39

2 years ago

3.3.3

2 years ago

3.0.36

2 years ago

3.3.2

2 years ago

3.0.37

2 years ago

3.0.30

2 years ago

2.0.19

2 years ago

3.0.31

2 years ago

2.0.18

2 years ago

2.0.26

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.22

2 years ago

2.0.23

2 years ago

2.0.20

2 years ago

2.0.21

2 years ago

3.0.29

2 years ago

1.0.11

2 years ago