@dvsa/cvs-type-definitions 1.0.11 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -13
- package/json-schemas/{activity → v1/activity}/index.json +61 -61
- package/json-schemas/{defect-category-reference-data → v1/defect-category-reference-data}/index.json +439 -439
- package/json-schemas/{defect-details → v1/defect-details}/index.json +264 -264
- package/json-schemas/{defect-location → v1/defect-location}/index.json +48 -48
- package/json-schemas/{reason-item → v1/reason-item}/index.json +16 -16
- package/json-schemas/{tech-record → v1/tech-record}/index.json +638 -638
- package/json-schemas/{test → v1/test}/index.json +1842 -1842
- package/json-schemas/{test-result → v1/test-result}/index.json +635 -635
- package/json-schemas/{test-station → v1/test-station}/index.json +66 -66
- package/json-schemas/{test-type → v1/test-type}/index.json +478 -478
- package/json-schemas/{vehicle → v1/vehicle}/index.json +1803 -1803
- package/json-schemas/{vehicle-tech-record → v1/vehicle-tech-record}/index.json +682 -682
- package/json-schemas/{visit → v1/visit}/index.json +1894 -1894
- package/json-schemas/v3/tech-record/get/car/complete/index.json +216 -0
- package/json-schemas/v3/tech-record/get/car/skeleton/index.json +195 -0
- package/json-schemas/v3/tech-record/get/hgv/complete/index.json +1051 -0
- package/json-schemas/v3/tech-record/get/hgv/skeleton/index.json +1124 -0
- package/json-schemas/v3/tech-record/get/hgv/testable/index.json +1119 -0
- package/json-schemas/v3/tech-record/get/lgv/complete/index.json +226 -0
- package/json-schemas/v3/tech-record/get/lgv/skeleton/index.json +202 -0
- package/json-schemas/v3/tech-record/get/motorcycle/complete/index.json +219 -0
- package/json-schemas/v3/tech-record/get/motorcycle/skeleton/index.json +202 -0
- package/json-schemas/v3/tech-record/get/psv/complete/index.json +1027 -0
- package/json-schemas/v3/tech-record/get/psv/skeleton/index.json +1120 -0
- package/json-schemas/v3/tech-record/get/psv/testable/index.json +1097 -0
- package/json-schemas/v3/tech-record/get/search/complete/index.json +55 -0
- package/json-schemas/v3/tech-record/get/search/skeleton/index.json +55 -0
- package/json-schemas/v3/tech-record/get/trl/complete/index.json +1307 -0
- package/json-schemas/v3/tech-record/get/trl/skeleton/index.json +1002 -0
- package/json-schemas/v3/tech-record/get/trl/testable/index.json +1155 -0
- package/json-schemas/v3/tech-record/post/psv/complete/index.json +1024 -0
- package/json-schemas/v3/tech-record/post/psv/skeleton/index.json +1112 -0
- package/json-schemas/v3/tech-record/post/psv/testable/index.json +1092 -0
- package/json-schemas/v3/tech-record/put/car/complete/request/index.json +87 -0
- package/json-schemas/v3/tech-record/put/car/complete/response/index.json +237 -0
- package/json-schemas/v3/tech-record/put/car/skeleton/request/index.json +64 -0
- package/json-schemas/v3/tech-record/put/car/skeleton/response/index.json +216 -0
- package/json-schemas/v3/tech-record/put/hgv/complete/index.json +1009 -0
- package/json-schemas/v3/tech-record/put/hgv/skeleton/index.json +1082 -0
- package/json-schemas/v3/tech-record/put/hgv/testable/index.json +1077 -0
- package/json-schemas/v3/tech-record/put/lgv/complete/request/index.json +97 -0
- package/json-schemas/v3/tech-record/put/lgv/complete/response/index.json +247 -0
- package/json-schemas/v3/tech-record/put/lgv/skeleton/request/index.json +71 -0
- package/json-schemas/v3/tech-record/put/lgv/skeleton/response/index.json +223 -0
- package/json-schemas/v3/tech-record/put/trl/complete/index.json +1265 -0
- package/json-schemas/v3/tech-record/put/trl/skeleton/index.json +978 -0
- package/json-schemas/v3/tech-record/put/trl/testable/index.json +1115 -0
- package/package.json +8 -5
- package/types/v3/tech-record/get/car/complete/index.d.ts +74 -0
- package/types/v3/tech-record/get/car/skeleton/index.d.ts +72 -0
- package/types/v3/tech-record/get/hgv/complete/index.d.ts +285 -0
- package/types/v3/tech-record/get/hgv/skeleton/index.d.ts +285 -0
- package/types/v3/tech-record/get/hgv/testable/index.d.ts +285 -0
- package/types/v3/tech-record/get/lgv/complete/index.d.ts +75 -0
- package/types/v3/tech-record/get/lgv/skeleton/index.d.ts +73 -0
- package/types/v3/tech-record/get/motorcycle/complete/index.d.ts +75 -0
- package/types/v3/tech-record/get/motorcycle/skeleton/index.d.ts +73 -0
- package/types/v3/tech-record/get/psv/complete/index.d.ts +315 -0
- package/types/v3/tech-record/get/psv/skeleton/index.d.ts +313 -0
- package/types/v3/tech-record/get/psv/testable/index.d.ts +313 -0
- package/types/v3/tech-record/get/search/complete/index.d.ts +20 -0
- package/types/v3/tech-record/get/search/skeleton/index.d.ts +19 -0
- package/types/v3/tech-record/get/trl/complete/index.d.ts +350 -0
- package/types/v3/tech-record/get/trl/skeleton/index.d.ts +256 -0
- package/types/v3/tech-record/get/trl/testable/index.d.ts +294 -0
- package/types/v3/tech-record/post/psv/complete/index.d.ts +315 -0
- package/types/v3/tech-record/post/psv/skeleton/index.d.ts +313 -0
- package/types/v3/tech-record/post/psv/testable/index.d.ts +313 -0
- package/types/v3/tech-record/put/car/complete/request/index.d.ts +24 -0
- package/types/v3/tech-record/put/car/complete/response/index.d.ts +75 -0
- package/types/v3/tech-record/put/car/skeleton/request/index.d.ts +22 -0
- package/types/v3/tech-record/put/car/skeleton/response/index.d.ts +75 -0
- package/types/v3/tech-record/put/hgv/complete/index.d.ts +276 -0
- package/types/v3/tech-record/put/hgv/skeleton/index.d.ts +276 -0
- package/types/v3/tech-record/put/hgv/testable/index.d.ts +276 -0
- package/types/v3/tech-record/put/lgv/complete/request/index.d.ts +25 -0
- package/types/v3/tech-record/put/lgv/complete/response/index.d.ts +76 -0
- package/types/v3/tech-record/put/lgv/skeleton/request/index.d.ts +23 -0
- package/types/v3/tech-record/put/lgv/skeleton/response/index.d.ts +76 -0
- package/types/v3/tech-record/put/trl/complete/index.d.ts +341 -0
- package/types/v3/tech-record/put/trl/skeleton/index.d.ts +250 -0
- package/types/v3/tech-record/put/trl/testable/index.d.ts +285 -0
- package/json-schemas/.DS_Store +0 -0
- package/lib/schemas.d.ts +0 -1
- package/lib/schemas.js +0 -18
- package/lib/src/schema-validation/schema-validator.d.ts +0 -3
- package/lib/src/schema-validation/schema-validator.js +0 -22
- /package/types/{activity → v1/activity}/index.d.ts +0 -0
- /package/types/{defect-category-reference-data → v1/defect-category-reference-data}/index.d.ts +0 -0
- /package/types/{defect-details → v1/defect-details}/index.d.ts +0 -0
- /package/types/{defect-location → v1/defect-location}/index.d.ts +0 -0
- /package/types/{reason-item → v1/reason-item}/index.d.ts +0 -0
- /package/types/{tech-record → v1/tech-record}/index.d.ts +0 -0
- /package/types/{test → v1/test}/index.d.ts +0 -0
- /package/types/{test-result → v1/test-result}/index.d.ts +0 -0
- /package/types/{test-station → v1/test-station}/index.d.ts +0 -0
- /package/types/{test-type → v1/test-type}/index.d.ts +0 -0
- /package/types/{vehicle → v1/vehicle}/index.d.ts +0 -0
- /package/types/{vehicle-tech-record → v1/vehicle-tech-record}/index.d.ts +0 -0
- /package/types/{visit → v1/visit}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
# cvs-type-definitions
|
|
2
|
+
|
|
2
3
|
[json schema](https://json-schema.org/) and .ts type definitions for cvs vta application
|
|
3
4
|
|
|
4
5
|
# Usage
|
|
5
6
|
|
|
6
7
|
## Install GitHub package:
|
|
7
8
|
|
|
8
|
-
- Ensure consuming repo is set up to install private DVSA packages by adding the following to the `.npmrc` file:
|
|
9
|
-
`@dvsa:registry=https://npm.pkg.github.com`
|
|
10
|
-
- **NOTE:** in order to install private DVSA packages you will need a `.npmrc` file in your `$PATH` containing a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) linked to the DVSA org. You should add the token to your `.npmrc` file as follows:
|
|
11
|
-
- `//npm.pkg.github.com/:_authToken=<AUTH_TOKEN_HERE>`
|
|
12
9
|
- install GitHub package: `npm install @dvsa/cvs-type-definitions@latest`
|
|
13
10
|
|
|
14
11
|
## Example usage (TS types):
|
|
@@ -21,14 +18,11 @@ The package exports an `isValidObject()` function which can be used to validate
|
|
|
21
18
|
|
|
22
19
|
`import { isValidObject } from '@dvsa/cvs-type-definitions/lib/src/schema-validation/schema-validator';`
|
|
23
20
|
|
|
24
|
-
|
|
25
21
|
`const isValidVisit: boolean = isValidObject('visit', myVisitObject);`
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
23
|
# Updating a schema
|
|
30
24
|
|
|
31
|
-
Edits should only be made to `json` schema definitions within `json-definitions` directory.
|
|
25
|
+
Edits should only be made to `json` schema definitions within `json-definitions` directory.
|
|
32
26
|
|
|
33
27
|
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.
|
|
34
28
|
|
|
@@ -41,13 +35,14 @@ TypeScript interfaces will be generated from these files and saved to `types` di
|
|
|
41
35
|
# Adding a new schema
|
|
42
36
|
|
|
43
37
|
1. Create a new subdirectory with an appropriate name within the `json-defininitions` directory (e.g. `my-new-schema`)
|
|
44
|
-
2.
|
|
45
|
-
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)
|
|
38
|
+
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`)
|
|
46
39
|
3. Generate the new TypeScript definitions using `npm run generate`
|
|
47
40
|
4. Bump the version of the package using `npm version {major|minor|patch}`
|
|
48
41
|
5. Publish updates
|
|
49
42
|
|
|
50
|
-
# Publishing
|
|
43
|
+
# Publishing a new version
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
- Raise a PR
|
|
46
|
+
- 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.
|
|
47
|
+
- Add a description of the changes in the `Changelog` section of the PR description
|
|
48
|
+
- Once merged to develop, a github action should create a release and publish a new version of that release on npm
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Activity Schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"activityType": {
|
|
6
|
-
"type": "string"
|
|
7
|
-
},
|
|
8
|
-
"testStationName": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"testStationPNumber": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
"testStationEmail": {
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
"testStationType": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
},
|
|
20
|
-
"testerName": {
|
|
21
|
-
"type": "string"
|
|
22
|
-
},
|
|
23
|
-
"testerStaffId": {
|
|
24
|
-
"type": "string"
|
|
25
|
-
},
|
|
26
|
-
"testerEmail": {
|
|
27
|
-
"type": "string"
|
|
28
|
-
},
|
|
29
|
-
"startTime": {
|
|
30
|
-
"type": "string"
|
|
31
|
-
},
|
|
32
|
-
"endTime": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
},
|
|
35
|
-
"parentId": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"waitReason": {
|
|
39
|
-
"type": "array",
|
|
40
|
-
"items": {
|
|
41
|
-
"type": "string"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"notes": {
|
|
45
|
-
"type": "string"
|
|
46
|
-
},
|
|
47
|
-
"id": {
|
|
48
|
-
"type": "string"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"additionalProperties": false,
|
|
52
|
-
"required": [
|
|
53
|
-
"activityType",
|
|
54
|
-
"testStationName",
|
|
55
|
-
"testStationPNumber",
|
|
56
|
-
"testStationEmail",
|
|
57
|
-
"testStationType",
|
|
58
|
-
"testerName",
|
|
59
|
-
"testerStaffId",
|
|
60
|
-
"startTime"
|
|
61
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"title": "Activity Schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"activityType": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"testStationName": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"testStationPNumber": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"testStationEmail": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"testStationType": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"testerName": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"testerStaffId": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"testerEmail": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"startTime": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"endTime": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"parentId": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"waitReason": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"items": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"notes": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"id": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": [
|
|
53
|
+
"activityType",
|
|
54
|
+
"testStationName",
|
|
55
|
+
"testStationPNumber",
|
|
56
|
+
"testStationEmail",
|
|
57
|
+
"testStationType",
|
|
58
|
+
"testerName",
|
|
59
|
+
"testerStaffId",
|
|
60
|
+
"startTime"
|
|
61
|
+
]
|
|
62
62
|
}
|