@dvsa/cvs-type-definitions 2.0.30 → 2.1.1

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.
@@ -677,7 +677,7 @@
677
677
  },
678
678
  "techRecord_make": {
679
679
  "type": "string",
680
- "maxLength": 30
680
+ "maxLength": 50
681
681
  },
682
682
  "techRecord_maxTrainGbWeight": {
683
683
  "type": "number",
@@ -708,7 +708,7 @@
708
708
  "string",
709
709
  "null"
710
710
  ],
711
- "maxLength": 30
711
+ "maxLength": 50
712
712
  },
713
713
  "techRecord_maxTrainGbWeight": {
714
714
  "type": [
@@ -709,7 +709,7 @@
709
709
  "string",
710
710
  "null"
711
711
  ],
712
- "maxLength": 30
712
+ "maxLength": 50
713
713
  },
714
714
  "techRecord_maxTrainGbWeight": {
715
715
  "type": [
@@ -550,7 +550,7 @@
550
550
  },
551
551
  "techRecord_bodyMake": {
552
552
  "type": "string",
553
- "maxLength": 20
553
+ "maxLength": 50
554
554
  },
555
555
  "techRecord_bodyModel": {
556
556
  "type": "string",
@@ -558,7 +558,7 @@
558
558
  },
559
559
  "techRecord_chassisMake": {
560
560
  "type": "string",
561
- "maxLength": 20
561
+ "maxLength": 50
562
562
  },
563
563
  "techRecord_chassisModel": {
564
564
  "type": "string",
@@ -582,7 +582,7 @@
582
582
  "string",
583
583
  "null"
584
584
  ],
585
- "maxLength": 20
585
+ "maxLength": 50
586
586
  },
587
587
  "techRecord_bodyModel": {
588
588
  "type": [
@@ -596,7 +596,7 @@
596
596
  "string",
597
597
  "null"
598
598
  ],
599
- "maxLength": 20
599
+ "maxLength": 50
600
600
  },
601
601
  "techRecord_chassisModel": {
602
602
  "type": [
@@ -557,7 +557,7 @@
557
557
  "string",
558
558
  "null"
559
559
  ],
560
- "maxLength": 20
560
+ "maxLength": 50
561
561
  },
562
562
  "techRecord_bodyModel": {
563
563
  "type": [
@@ -571,7 +571,7 @@
571
571
  "string",
572
572
  "null"
573
573
  ],
574
- "maxLength": 20
574
+ "maxLength": 50
575
575
  },
576
576
  "techRecord_chassisModel": {
577
577
  "type": [
@@ -746,7 +746,7 @@
746
746
  "string",
747
747
  "null"
748
748
  ],
749
- "maxLength": 30
749
+ "maxLength": 50
750
750
  },
751
751
  "techRecord_manufactureYear": {
752
752
  "anyOf": [
@@ -624,7 +624,7 @@
624
624
  "string",
625
625
  "null"
626
626
  ],
627
- "maxLength": 30
627
+ "maxLength": 50
628
628
  },
629
629
  "techRecord_manufactureYear": {
630
630
  "anyOf": [
@@ -630,7 +630,7 @@
630
630
  "string",
631
631
  "null"
632
632
  ],
633
- "maxLength": 30
633
+ "maxLength": 50
634
634
  },
635
635
  "techRecord_manufactureYear": {
636
636
  "anyOf": [
@@ -667,7 +667,7 @@
667
667
  },
668
668
  "techRecord_make": {
669
669
  "type": "string",
670
- "maxLength": 30
670
+ "maxLength": 50
671
671
  },
672
672
  "techRecord_maxTrainGbWeight": {
673
673
  "type": "number",
@@ -698,7 +698,7 @@
698
698
  "string",
699
699
  "null"
700
700
  ],
701
- "maxLength": 30
701
+ "maxLength": 50
702
702
  },
703
703
  "techRecord_maxTrainGbWeight": {
704
704
  "type": [
@@ -699,7 +699,7 @@
699
699
  "string",
700
700
  "null"
701
701
  ],
702
- "maxLength": 30
702
+ "maxLength": 50
703
703
  },
704
704
  "techRecord_maxTrainGbWeight": {
705
705
  "type": [
@@ -544,7 +544,7 @@
544
544
  },
545
545
  "techRecord_bodyMake": {
546
546
  "type": "string",
547
- "maxLength": 20
547
+ "maxLength": 50
548
548
  },
549
549
  "techRecord_bodyModel": {
550
550
  "type": "string",
@@ -552,7 +552,7 @@
552
552
  },
553
553
  "techRecord_chassisMake": {
554
554
  "type": "string",
555
- "maxLength": 20
555
+ "maxLength": 50
556
556
  },
557
557
  "techRecord_chassisModel": {
558
558
  "type": "string",
@@ -577,7 +577,7 @@
577
577
  "string",
578
578
  "null"
579
579
  ],
580
- "maxLength": 20
580
+ "maxLength": 50
581
581
  },
582
582
  "techRecord_bodyModel": {
583
583
  "type": [
@@ -591,7 +591,7 @@
591
591
  "string",
592
592
  "null"
593
593
  ],
594
- "maxLength": 20
594
+ "maxLength": 50
595
595
  },
596
596
  "techRecord_chassisModel": {
597
597
  "type": [
@@ -557,7 +557,7 @@
557
557
  "string",
558
558
  "null"
559
559
  ],
560
- "maxLength": 20
560
+ "maxLength": 50
561
561
  },
562
562
  "techRecord_bodyModel": {
563
563
  "type": [
@@ -571,7 +571,7 @@
571
571
  "string",
572
572
  "null"
573
573
  ],
574
- "maxLength": 20
574
+ "maxLength": 50
575
575
  },
576
576
  "techRecord_chassisModel": {
577
577
  "type": [
@@ -736,7 +736,7 @@
736
736
  "string",
737
737
  "null"
738
738
  ],
739
- "maxLength": 30
739
+ "maxLength": 50
740
740
  },
741
741
  "techRecord_manufactureYear": {
742
742
  "anyOf": [
@@ -614,7 +614,7 @@
614
614
  "string",
615
615
  "null"
616
616
  ],
617
- "maxLength": 30
617
+ "maxLength": 50
618
618
  },
619
619
  "techRecord_manufactureYear": {
620
620
  "anyOf": [
@@ -622,7 +622,7 @@
622
622
  "string",
623
623
  "null"
624
624
  ],
625
- "maxLength": 30
625
+ "maxLength": 50
626
626
  },
627
627
  "techRecord_manufactureYear": {
628
628
  "anyOf": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvsa/cvs-type-definitions",
3
- "version": "2.0.30",
3
+ "version": "2.1.1",
4
4
  "description": "type definitions for cvs vta application",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -1,4 +1,5 @@
1
1
  import { ErrorObject } from "ajv";
2
2
  import { schemas } from "./schemas";
3
3
  export declare type Schema = typeof schemas[number];
4
- export declare const isValidObject: (schemaName: Schema, objectToValidate: object, returnErrors?: boolean, logErrors?: boolean) => (boolean | ErrorObject[]);
4
+ export declare function isValidObject<B extends boolean | undefined>(schemaName: Schema, objectToValidate: object): boolean;
5
+ export declare function isValidObject<B extends boolean | undefined>(schemaName: Schema, objectToValidate: object, returnErrors: B): B extends false ? boolean : ErrorObject[];
@@ -3,8 +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, returnErrors, logErrors) {
7
- if (returnErrors === void 0) { returnErrors = false; }
6
+ function isValidObject(schemaName, objectToValidate, returnErrors, logErrors) {
7
+ var _a;
8
8
  if (logErrors === void 0) { logErrors = false; }
9
9
  var ajv = new ajv_1.default({ removeAdditional: true, allErrors: true });
10
10
  var schema = JSON.parse((0, fs_1.readFileSync)("".concat(__dirname, "/json-schemas/").concat(schemaName), "utf8"));
@@ -13,9 +13,10 @@ var isValidObject = function (schemaName, objectToValidate, returnErrors, logErr
13
13
  if (logErrors && validateFunction.errors) {
14
14
  console.error(validateFunction.errors);
15
15
  }
16
- if (returnErrors && validateFunction.errors) {
17
- return validateFunction.errors;
16
+ if (returnErrors) {
17
+ return (_a = validateFunction.errors) !== null && _a !== void 0 ? _a : [];
18
18
  }
19
19
  return isValid;
20
- };
20
+ }
21
21
  exports.isValidObject = isValidObject;
22
+ ;