@dvsa/cvs-type-definitions 7.10.0 → 7.12.0

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.
@@ -29,7 +29,8 @@
29
29
  "type": "string"
30
30
  },
31
31
  "testStationEmail": {
32
- "type": "string"
32
+ "type": "string",
33
+ "format": "email"
33
34
  },
34
35
  "testStationType": {
35
36
  "title": "Test Station Types",
@@ -50,13 +51,30 @@
50
51
  ]
51
52
  },
52
53
  "testerName": {
53
- "type": "string"
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "maxLength": 60
54
57
  },
55
58
  "testerStaffId": {
56
59
  "type": "string"
57
60
  },
58
61
  "testerEmail": {
59
- "type": "string"
62
+ "type": "string",
63
+ "format": "email",
64
+ "if": {
65
+ "properties": {
66
+ "activityType": {
67
+ "const": "visit"
68
+ }
69
+ }
70
+ },
71
+ "then": {
72
+ "type": "string",
73
+ "format": "email"
74
+ },
75
+ "else": {
76
+ "not": {}
77
+ }
60
78
  },
61
79
  "startTime": {
62
80
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvsa/cvs-type-definitions",
3
- "version": "7.10.0",
3
+ "version": "7.12.0",
4
4
  "description": "type definitions for cvs vta and vtm applications",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "ajv": "^8.12.0",
29
+ "ajv-formats": "^3.0.1",
29
30
  "json-schema-deref-sync": "^0.14.0",
30
31
  "pretty-js": "^0.2.2",
31
32
  "util": "^0.12.5"
@@ -2,11 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidObject = void 0;
4
4
  var ajv_1 = require("ajv");
5
+ var ajv_formats_1 = require("ajv-formats");
5
6
  var fs_1 = require("fs");
6
7
  function isValidObject(schemaName, objectToValidate, returnErrors, logErrors) {
7
8
  var _a;
8
9
  if (logErrors === void 0) { logErrors = false; }
9
10
  var ajv = new ajv_1.default({ removeAdditional: true, allErrors: true });
11
+ (0, ajv_formats_1.default)(ajv);
10
12
  ajv.addKeyword('tsEnumNames');
11
13
  var schema = JSON.parse((0, fs_1.readFileSync)("".concat(__dirname, "/json-schemas/").concat(schemaName), "utf8"));
12
14
  var validateFunction = ajv.compile(schema);