Remove aliased ajv6 version and add it as resource under assets

Remove aliased ajv6 version and add it as resource under assets
This commit is contained in:
Luis Tejeda
2022-02-08 13:19:58 -06:00
parent 68b65fe9c7
commit 0147dedebf
6 changed files with 11926 additions and 28 deletions

View File

@@ -12,6 +12,7 @@ jobs:
with:
node-version: '14.x'
- run: npm install
- run: npm run test-lint
- run: npm run test-unit
Regression:
@@ -23,4 +24,4 @@ jobs:
with:
node-version: '14.x'
- run: npm install
- run: npm run test-regression
- run: npm run test-regression

7191
assets/ajv6faker.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,149 @@
{
"id": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"positiveInteger": {
"type": "integer",
"minimum": 0
},
"positiveIntegerDefault0": {
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
},
"simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"type": "object",
"properties": {
"id": {
"type": "string"
},
"$schema": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
},
"maxLength": { "$ref": "#/definitions/positiveInteger" },
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},
"additionalItems": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/schemaArray" }
],
"default": {}
},
"maxItems": { "$ref": "#/definitions/positiveInteger" },
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
"uniqueItems": {
"type": "boolean",
"default": false
},
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"definitions": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/stringArray" }
]
}
},
"enum": {
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{ "$ref": "#/definitions/simpleTypes" },
{
"type": "array",
"items": { "$ref": "#/definitions/simpleTypes" },
"minItems": 1,
"uniqueItems": true
}
]
},
"format": { "type": "string" },
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" }
},
"dependencies": {
"exclusiveMaximum": [ "maximum" ],
"exclusiveMinimum": [ "minimum" ]
},
"default": {}
}

View File

@@ -1,5 +1,5 @@
const Ajv = require('ajv-06'),
draft4MetaSchema = require('ajv-06/lib/refs/json-schema-draft-04.json');
const Ajv = require('../../assets/ajv6faker'),
draft4MetaSchema = require('../../assets/json-schema-draft-04.json');
/**
* Used to validate schema against a value.

4600
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -117,7 +117,6 @@
},
"dependencies": {
"ajv": "8.1.0",
"ajv-06": "npm:ajv@6.12.5",
"ajv-formats": "2.1.1",
"async": "3.2.1",
"commander": "2.20.3",
@@ -139,15 +138,15 @@
"eslint-plugin-mocha": "5.3.0",
"eslint-plugin-security": "1.4.0",
"expect.js": "0.3.1",
"nyc": "15.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"parse-gitignore": "0.5.1"
},
"scripts": {
"test": "./scripts/test.sh",
"test-unit": "nyc --reporter=text ./node_modules/mocha/bin/mocha \"test/unit/**/**.test.js\"",
"test-unit": "nyc --reporter=text -x **/assets/** ./node_modules/mocha/bin/mocha \"test/unit/**/**.test.js\"",
"test-lint": "./scripts/test-lint.sh",
"test-system": "./node_modules/mocha/bin/mocha \"test/system/**.test.js\"",
"test-system": "./node_modules/mocha/bin/mocha -x **/assets/** \"test/system/**.test.js\"",
"test-regression": "./node_modules/mocha/bin/mocha test/integration/integration.test.js test/unit/sanity.test.js",
"release": "./scripts/release.sh",
"coverage": "nyc report --reporter=html --reporter=text mocha"