@itentialopensource/adapter-utils 4.48.16 → 5.0.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.
@@ -435,7 +435,7 @@ function extractJSONEntity(dataObj, entitySchema, ajvInstance) {
435
435
  // validate the entity against the schema
436
436
  let ajvInst = ajvInstance;
437
437
  if (!ajvInst) {
438
- ajvInst = new AjvCl();
438
+ ajvInst = new AjvCl({ strictSchema: false, allowUnionTypes: true });
439
439
  }
440
440
  const validate = ajvInst.compile(entitySchema);
441
441
  const result = validate(combinedEntity);
@@ -678,8 +678,9 @@ function buildJSONEntity(dataObj, entitySchema, ajvInstance) {
678
678
  // validate the entity against the schema
679
679
  let ajvInst = ajvInstance;
680
680
  if (!ajvInst) {
681
- ajvInst = new AjvCl();
681
+ ajvInst = new AjvCl({ strictSchema: false, allowUnionTypes: true });
682
682
  }
683
+
683
684
  const validate = ajvInst.compile(entitySchema);
684
685
  const result = validate(combinedEntity);
685
686
 
@@ -795,7 +796,7 @@ class AdapterTranslatorUtil {
795
796
 
796
797
  // make sure we are working with a JSON object instead of strigified object
797
798
  const transObj = this.formatInputData(inEntity);
798
- const ajvInst = new AjvCl();
799
+ const ajvInst = new AjvCl({ strictSchema: false, allowUnionTypes: true });
799
800
 
800
801
  // if an array of Entities, just translate the data (no objects)
801
802
  if (Array.isArray(transObj)) {
@@ -877,7 +878,7 @@ class AdapterTranslatorUtil {
877
878
 
878
879
  // make sure we are working with a JSON object instead of strigified object
879
880
  const transObj = this.formatInputData(outEntity);
880
- const ajvInst = new AjvCl();
881
+ const ajvInst = new AjvCl({ strictSchema: false, allowUnionTypes: true });
881
882
 
882
883
  // if this is an array of Objects, translate each of the objects
883
884
  if (Array.isArray(transObj)) {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-utils",
3
- "version": "4.48.16",
3
+ "version": "5.0.0",
4
4
  "description": "Itential Adapter Utility Libraries",
5
5
  "scripts": {
6
6
  "postinstall": "node utils/setup.js",
7
7
  "lint": "eslint . --ext .json --ext .js",
8
8
  "lint:errors": "eslint --quiet . --ext .json --ext .js",
9
- "test:unit": "mocha test/unit/lib/requestHandlerTest.js --LOG=error && mocha test/unit/lib/restHandlerTest.js --LOG=error && mocha test/unit/lib/propertyUtilTest.js --LOG=error && mocha test/unit/lib/translatorUtilTest.js --LOG=error && mocha test/unit/lib/dbUtilTest.js --LOG=debug",
9
+ "test:unit": "mocha test/unit/lib/requestHandlerTest.js --LOG=error && mocha test/unit/lib/restHandlerTest.js --LOG=error && mocha test/unit/lib/propertyUtilTest.js --LOG=error && mocha test/unit/lib/translatorUtilTest.js --LOG=error && mocha test/unit/lib/dbUtilTest.js --LOG=error",
10
10
  "test:integration": "mocha test/integration/lib/requestHandlerTest.js --LOG=error && mocha test/integration/lib/restHandlerTest.js --LOG=error && mocha test/integration/lib/restHandlerMfaTest.js --LOG=error",
11
11
  "test:cover": "nyc --reporter html --reporter text mocha --recursive --reporter dot test/*",
12
12
  "test": "npm run test:unit && npm run test:integration",
@@ -25,37 +25,37 @@
25
25
  "author": "Itential",
26
26
  "homepage": "https://gitlab.com/itentialopensource/adapter-utils#readme",
27
27
  "dependencies": {
28
- "ajv": "^6.12.0",
29
- "async-lock": "1.2.0",
30
- "cookie": "^0.4.0",
31
- "crypto-js": "^3.1.9-1",
32
- "ejs": "^3.1.7",
33
- "form-data": "^2.5.1",
34
- "fs-extra": "^8.1.0",
35
- "https-proxy-agent": "^2.2.1",
28
+ "ajv": "^8.12.0",
29
+ "async-lock": "^1.4.0",
30
+ "cookie": "^0.5.0",
31
+ "crypto-js": "^4.1.1",
32
+ "ejs": "^3.1.9",
33
+ "form-data": "^4.0.0",
34
+ "fs-extra": "^11.1.1",
35
+ "https-proxy-agent": "^7.0.0",
36
36
  "json-query": "^2.2.2",
37
37
  "jsontoxml": "^1.0.1",
38
- "jsonwebtoken": "^9.0.0",
39
- "mongodb": "^3.3.3",
38
+ "jsonwebtoken": "^9.0.1",
39
+ "mongodb": "^3.7.4",
40
40
  "querystring": "^0.2.0",
41
41
  "readline-sync": "^1.4.10",
42
- "socks-proxy-agent": "^4.0.2",
43
- "uuid": "^8.3.2",
44
- "xml2js": "^0.5.0"
42
+ "socks-proxy-agent": "^8.0.1",
43
+ "uuid": "^9.0.0",
44
+ "xml2js": "^0.6.0"
45
45
  },
46
46
  "devDependencies": {
47
- "chai": "^4.3.4",
48
- "eslint": "^7.29.0",
49
- "eslint-config-airbnb-base": "^14.2.1",
50
- "eslint-plugin-import": "^2.23.4",
51
- "eslint-plugin-json": "^3.0.0",
52
- "mocha": "^9.0.1",
53
- "nock": "^13.2.9",
47
+ "chai": "^4.3.7",
48
+ "eslint": "^8.44.0",
49
+ "eslint-config-airbnb-base": "^15.0.0",
50
+ "eslint-plugin-import": "^2.27.5",
51
+ "eslint-plugin-json": "^3.1.0",
52
+ "mocha": "^10.2.0",
53
+ "nock": "^13.3.1",
54
54
  "nyc": "^15.1.0",
55
- "strip-ansi": "^7.0.1",
56
- "strip-ansi-cli": "^3.0.1",
57
- "testdouble": "^3.16.1",
58
- "winston": "^3.3.3"
55
+ "strip-ansi": "^7.1.0",
56
+ "strip-ansi-cli": "^3.0.2",
57
+ "testdouble": "^3.18.0",
58
+ "winston": "^3.9.0"
59
59
  },
60
60
  "peerDependencies": {},
61
61
  "private": false
Binary file