@dvsa/cvs-type-definitions 2.0.28 → 2.0.30
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/json-schemas/v3/tech-record/put/hgv/complete/index.json +4 -2
- package/json-schemas/v3/tech-record/put/hgv/skeleton/index.json +4 -2
- package/json-schemas/v3/tech-record/put/hgv/testable/index.json +4 -2
- package/json-schemas/v3/tech-record/put/psv/complete/index.json +4 -1
- package/json-schemas/v3/tech-record/put/psv/skeleton/index.json +4 -1
- package/json-schemas/v3/tech-record/put/psv/testable/index.json +4 -1
- package/json-schemas/v3/tech-record/put/trl/complete/index.json +4 -2
- package/json-schemas/v3/tech-record/put/trl/skeleton/index.json +5 -3
- package/json-schemas/v3/tech-record/put/trl/testable/index.json +4 -2
- package/package.json +1 -1
- package/schema-validator.d.ts +2 -1
- package/schema-validator.js +5 -1
- package/types/v3/tech-record/put/hgv/complete/index.d.ts +1 -1
- package/types/v3/tech-record/put/hgv/skeleton/index.d.ts +1 -1
- package/types/v3/tech-record/put/hgv/testable/index.d.ts +1 -1
- package/types/v3/tech-record/put/psv/complete/index.d.ts +1 -1
- package/types/v3/tech-record/put/psv/skeleton/index.d.ts +1 -1
- package/types/v3/tech-record/put/psv/testable/index.d.ts +1 -1
- package/types/v3/tech-record/put/trl/complete/index.d.ts +1 -1
- package/types/v3/tech-record/put/trl/skeleton/index.d.ts +2 -2
- package/types/v3/tech-record/put/trl/testable/index.d.ts +1 -1
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_reasonForCreation",
|
|
8
7
|
"techRecord_statusCode",
|
|
9
8
|
"techRecord_vehicleType",
|
|
@@ -48,7 +47,10 @@
|
|
|
48
47
|
],
|
|
49
48
|
"properties": {
|
|
50
49
|
"partialVin": {
|
|
51
|
-
"type":
|
|
50
|
+
"type": [
|
|
51
|
+
"string",
|
|
52
|
+
"null"
|
|
53
|
+
]
|
|
52
54
|
},
|
|
53
55
|
"techRecord_createdAt": {
|
|
54
56
|
"type": "string"
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_reasonForCreation",
|
|
8
7
|
"techRecord_statusCode",
|
|
9
8
|
"techRecord_vehicleType",
|
|
@@ -12,7 +11,10 @@
|
|
|
12
11
|
],
|
|
13
12
|
"properties": {
|
|
14
13
|
"partialVin": {
|
|
15
|
-
"type":
|
|
14
|
+
"type": [
|
|
15
|
+
"string",
|
|
16
|
+
"null"
|
|
17
|
+
]
|
|
16
18
|
},
|
|
17
19
|
"techRecord_createdAt": {
|
|
18
20
|
"type": "string"
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_reasonForCreation",
|
|
8
7
|
"techRecord_statusCode",
|
|
9
8
|
"techRecord_vehicleType",
|
|
@@ -16,7 +15,10 @@
|
|
|
16
15
|
],
|
|
17
16
|
"properties": {
|
|
18
17
|
"partialVin": {
|
|
19
|
-
"type":
|
|
18
|
+
"type": [
|
|
19
|
+
"string",
|
|
20
|
+
"null"
|
|
21
|
+
]
|
|
20
22
|
},
|
|
21
23
|
"techRecord_createdAt": {
|
|
22
24
|
"type": "string"
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_noOfAxles",
|
|
8
7
|
"techRecord_make",
|
|
9
8
|
"techRecord_model",
|
|
@@ -35,7 +34,10 @@
|
|
|
35
34
|
],
|
|
36
35
|
"properties": {
|
|
37
36
|
"partialVin": {
|
|
38
|
-
"type":
|
|
37
|
+
"type": [
|
|
38
|
+
"string",
|
|
39
|
+
"null"
|
|
40
|
+
]
|
|
39
41
|
},
|
|
40
42
|
"techRecord_createdAt": {
|
|
41
43
|
"type": "string"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "
|
|
2
|
+
"title": "PUT TRL Technical Record V3 Skeleton",
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_reasonForCreation",
|
|
8
7
|
"techRecord_statusCode",
|
|
9
8
|
"techRecord_vehicleClass_code",
|
|
@@ -15,7 +14,10 @@
|
|
|
15
14
|
],
|
|
16
15
|
"properties": {
|
|
17
16
|
"partialVin": {
|
|
18
|
-
"type":
|
|
17
|
+
"type": [
|
|
18
|
+
"string",
|
|
19
|
+
"null"
|
|
20
|
+
]
|
|
19
21
|
},
|
|
20
22
|
"techRecord_createdAt": {
|
|
21
23
|
"type": "string"
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"required": [
|
|
6
|
-
"partialVin",
|
|
7
6
|
"techRecord_noOfAxles",
|
|
8
7
|
"systemNumber",
|
|
9
8
|
"trailerId",
|
|
@@ -20,7 +19,10 @@
|
|
|
20
19
|
],
|
|
21
20
|
"properties": {
|
|
22
21
|
"partialVin": {
|
|
23
|
-
"type":
|
|
22
|
+
"type": [
|
|
23
|
+
"string",
|
|
24
|
+
"null"
|
|
25
|
+
]
|
|
24
26
|
},
|
|
25
27
|
"techRecord_createdAt": {
|
|
26
28
|
"type": "string"
|
package/package.json
CHANGED
package/schema-validator.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ErrorObject } from "ajv";
|
|
1
2
|
import { schemas } from "./schemas";
|
|
2
3
|
export declare type Schema = typeof schemas[number];
|
|
3
|
-
export declare const isValidObject: (schemaName: Schema, objectToValidate: object, logErrors?: boolean) => boolean;
|
|
4
|
+
export declare const isValidObject: (schemaName: Schema, objectToValidate: object, returnErrors?: boolean, logErrors?: boolean) => (boolean | ErrorObject[]);
|
package/schema-validator.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isValidObject = void 0;
|
|
4
4
|
var ajv_1 = require("ajv");
|
|
5
5
|
var fs_1 = require("fs");
|
|
6
|
-
var isValidObject = function (schemaName, objectToValidate, logErrors) {
|
|
6
|
+
var isValidObject = function (schemaName, objectToValidate, returnErrors, logErrors) {
|
|
7
|
+
if (returnErrors === void 0) { returnErrors = false; }
|
|
7
8
|
if (logErrors === void 0) { logErrors = false; }
|
|
8
9
|
var ajv = new ajv_1.default({ removeAdditional: true, allErrors: true });
|
|
9
10
|
var schema = JSON.parse((0, fs_1.readFileSync)("".concat(__dirname, "/json-schemas/").concat(schemaName), "utf8"));
|
|
@@ -12,6 +13,9 @@ var isValidObject = function (schemaName, objectToValidate, logErrors) {
|
|
|
12
13
|
if (logErrors && validateFunction.errors) {
|
|
13
14
|
console.error(validateFunction.errors);
|
|
14
15
|
}
|
|
16
|
+
if (returnErrors && validateFunction.errors) {
|
|
17
|
+
return validateFunction.errors;
|
|
18
|
+
}
|
|
15
19
|
return isValid;
|
|
16
20
|
};
|
|
17
21
|
exports.isValidObject = isValidObject;
|
|
@@ -143,7 +143,7 @@ export type ApprovalType =
|
|
|
143
143
|
| "IVA - DVSA/NI";
|
|
144
144
|
|
|
145
145
|
export interface PUTHGVTechnicalRecordV3Complete {
|
|
146
|
-
partialVin
|
|
146
|
+
partialVin?: string | null;
|
|
147
147
|
techRecord_createdAt?: string;
|
|
148
148
|
techRecord_createdById?: string;
|
|
149
149
|
techRecord_createdByName?: string;
|
|
@@ -143,7 +143,7 @@ export type ApprovalType =
|
|
|
143
143
|
| "IVA - DVSA/NI";
|
|
144
144
|
|
|
145
145
|
export interface PUTHGVTechnicalRecordV3Skeleton {
|
|
146
|
-
partialVin
|
|
146
|
+
partialVin?: string | null;
|
|
147
147
|
techRecord_createdAt?: string;
|
|
148
148
|
techRecord_createdById?: string;
|
|
149
149
|
techRecord_createdByName?: string;
|
|
@@ -143,7 +143,7 @@ export type ApprovalType =
|
|
|
143
143
|
| "IVA - DVSA/NI";
|
|
144
144
|
|
|
145
145
|
export interface PUTHGVTechnicalRecordV3Testable {
|
|
146
|
-
partialVin
|
|
146
|
+
partialVin?: string | null;
|
|
147
147
|
techRecord_createdAt?: string;
|
|
148
148
|
techRecord_createdById?: string;
|
|
149
149
|
techRecord_createdByName?: string;
|
|
@@ -185,7 +185,7 @@ export type MicrofilmDocumentType =
|
|
|
185
185
|
|
|
186
186
|
export interface POSTPSVTechnicalRecordV3Complete {
|
|
187
187
|
vin: string;
|
|
188
|
-
partialVin?: string;
|
|
188
|
+
partialVin?: string | null;
|
|
189
189
|
systemNumber: string;
|
|
190
190
|
primaryVrm?: string;
|
|
191
191
|
techRecord_vehicleType: "psv";
|
|
@@ -185,7 +185,7 @@ export type MicrofilmDocumentType =
|
|
|
185
185
|
|
|
186
186
|
export interface POSTPSVTechnicalRecordV3Skeleton {
|
|
187
187
|
vin: string;
|
|
188
|
-
partialVin?: string;
|
|
188
|
+
partialVin?: string | null;
|
|
189
189
|
systemNumber: string;
|
|
190
190
|
primaryVrm?: string;
|
|
191
191
|
techRecord_vehicleType: "psv";
|
|
@@ -185,7 +185,7 @@ export type MicrofilmDocumentType =
|
|
|
185
185
|
|
|
186
186
|
export interface POSTPSVTechnicalRecordV3Testable {
|
|
187
187
|
vin: string;
|
|
188
|
-
partialVin?: string;
|
|
188
|
+
partialVin?: string | null;
|
|
189
189
|
systemNumber: string;
|
|
190
190
|
primaryVrm?: string;
|
|
191
191
|
techRecord_vehicleType: "psv";
|
|
@@ -179,7 +179,7 @@ export type SpeedCategorySymbol =
|
|
|
179
179
|
| "q";
|
|
180
180
|
|
|
181
181
|
export interface PUTTRLTechnicalRecordV3Complete {
|
|
182
|
-
partialVin
|
|
182
|
+
partialVin?: string | null;
|
|
183
183
|
techRecord_createdAt?: string;
|
|
184
184
|
techRecord_createdById?: string;
|
|
185
185
|
techRecord_createdByName?: string;
|
|
@@ -126,8 +126,8 @@ export type VehicleConfiguration =
|
|
|
126
126
|
| "dolly"
|
|
127
127
|
| "full drawbar";
|
|
128
128
|
|
|
129
|
-
export interface
|
|
130
|
-
partialVin
|
|
129
|
+
export interface PUTTRLTechnicalRecordV3Skeleton {
|
|
130
|
+
partialVin?: string | null;
|
|
131
131
|
techRecord_createdAt?: string;
|
|
132
132
|
techRecord_createdById?: string;
|
|
133
133
|
techRecord_createdByName?: string;
|
|
@@ -144,7 +144,7 @@ export type SpeedCategorySymbol =
|
|
|
144
144
|
| "q";
|
|
145
145
|
|
|
146
146
|
export interface GETTRLTechnicalRecordV3Testable {
|
|
147
|
-
partialVin
|
|
147
|
+
partialVin?: string | null;
|
|
148
148
|
techRecord_createdAt?: string;
|
|
149
149
|
techRecord_createdById?: string;
|
|
150
150
|
techRecord_createdByName?: string;
|