@hyperjump/json-schema 0.19.0 → 0.22.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.
package/lib/draft-04.js CHANGED
@@ -4,15 +4,15 @@ const metaSchema = require("../meta/draft-04/schema");
4
4
 
5
5
 
6
6
  // JSON Schema Draft-04
7
- const schemaVersion = "http://json-schema.org/draft-04/schema";
7
+ const jsonSchemaVersion = "http://json-schema.org/draft-04/schema";
8
8
 
9
- Schema.setConfig(schemaVersion, "baseToken", "id");
10
- Schema.setConfig(schemaVersion, "embeddedToken", "id");
11
- Schema.setConfig(schemaVersion, "anchorToken", "id");
12
- Schema.setConfig(schemaVersion, "jrefToken", "$ref");
9
+ Schema.setConfig(jsonSchemaVersion, "baseToken", "id");
10
+ Schema.setConfig(jsonSchemaVersion, "embeddedToken", "id");
11
+ Schema.setConfig(jsonSchemaVersion, "anchorToken", "id");
12
+ Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
13
13
 
14
14
  Schema.add(JSON.parse(metaSchema));
15
- Core.defineVocabulary(schemaVersion, {
15
+ Core.defineVocabulary(jsonSchemaVersion, {
16
16
  "validate": keywords.validate,
17
17
  "additionalItems": keywords.additionalItems,
18
18
  "additionalProperties": keywords.additionalProperties,
package/lib/draft-06.js CHANGED
@@ -3,15 +3,15 @@ const keywords = require("./keywords");
3
3
  const metaSchema = require("../meta/draft-06/schema");
4
4
 
5
5
 
6
- const schemaVersion = "http://json-schema.org/draft-06/schema";
6
+ const jsonSchemaVersion = "http://json-schema.org/draft-06/schema";
7
7
 
8
- Schema.setConfig(schemaVersion, "baseToken", "$id");
9
- Schema.setConfig(schemaVersion, "embeddedToken", "$id");
10
- Schema.setConfig(schemaVersion, "anchorToken", "$id");
11
- Schema.setConfig(schemaVersion, "jrefToken", "$ref");
8
+ Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
9
+ Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
10
+ Schema.setConfig(jsonSchemaVersion, "anchorToken", "$id");
11
+ Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
12
12
 
13
13
  Schema.add(JSON.parse(metaSchema));
14
- Core.defineVocabulary(schemaVersion, {
14
+ Core.defineVocabulary(jsonSchemaVersion, {
15
15
  "validate": keywords.validate,
16
16
  "additionalItems": keywords.additionalItems6,
17
17
  "additionalProperties": keywords.additionalProperties6,
package/lib/draft-07.js CHANGED
@@ -3,15 +3,15 @@ const keywords = require("./keywords");
3
3
  const metaSchema = require("../meta/draft-07/schema");
4
4
 
5
5
 
6
- const schemaVersion = "http://json-schema.org/draft-07/schema";
6
+ const jsonSchemaVersion = "http://json-schema.org/draft-07/schema";
7
7
 
8
- Schema.setConfig(schemaVersion, "baseToken", "$id");
9
- Schema.setConfig(schemaVersion, "embeddedToken", "$id");
10
- Schema.setConfig(schemaVersion, "anchorToken", "$id");
11
- Schema.setConfig(schemaVersion, "jrefToken", "$ref");
8
+ Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
9
+ Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
10
+ Schema.setConfig(jsonSchemaVersion, "anchorToken", "$id");
11
+ Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
12
12
 
13
13
  Schema.add(JSON.parse(metaSchema));
14
- Core.defineVocabulary(schemaVersion, {
14
+ Core.defineVocabulary(jsonSchemaVersion, {
15
15
  "validate": keywords.validate,
16
16
  "additionalItems": keywords.additionalItems6,
17
17
  "additionalProperties": keywords.additionalProperties6,
@@ -9,14 +9,14 @@ const formatMetaSchema = require("../meta/draft/2019-09/meta/format");
9
9
  const contentMetaSchema = require("../meta/draft/2019-09/meta/content");
10
10
 
11
11
 
12
- const schemaVersion = "https://json-schema.org/draft/2019-09/schema";
12
+ const jsonSchemaVersion = "https://json-schema.org/draft/2019-09/vocab/core";
13
13
 
14
- Schema.setConfig(schemaVersion, "baseToken", "$id");
15
- Schema.setConfig(schemaVersion, "embeddedToken", "$id");
16
- Schema.setConfig(schemaVersion, "anchorToken", "$anchor");
17
- Schema.setConfig(schemaVersion, "recursiveAnchorToken", "$recursiveAnchor");
18
- Schema.setConfig(schemaVersion, "vocabularyToken", "$vocabulary");
19
- Schema.setConfig(schemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
14
+ Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
15
+ Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
16
+ Schema.setConfig(jsonSchemaVersion, "anchorToken", "$anchor");
17
+ Schema.setConfig(jsonSchemaVersion, "recursiveAnchorToken", "$recursiveAnchor");
18
+ Schema.setConfig(jsonSchemaVersion, "vocabularyToken", "$vocabulary");
19
+ Schema.setConfig(jsonSchemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
20
20
 
21
21
  Schema.add(JSON.parse(metaSchema));
22
22
 
@@ -11,14 +11,14 @@ const contentMetaSchema = require("../meta/draft/2020-12/meta/content");
11
11
  const unevaluatedMetaSchema = require("../meta/draft/2020-12/meta/unevaluated");
12
12
 
13
13
 
14
- const schemaVersion = "https://json-schema.org/draft/2020-12/schema";
14
+ const jsonSchemaVersion = "https://json-schema.org/draft/2020-12/vocab/core";
15
15
 
16
- Schema.setConfig(schemaVersion, "baseToken", "$id");
17
- Schema.setConfig(schemaVersion, "embeddedToken", "$id");
18
- Schema.setConfig(schemaVersion, "anchorToken", "$anchor");
19
- Schema.setConfig(schemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
20
- Schema.setConfig(schemaVersion, "vocabularyToken", "$vocabulary");
21
- Schema.setConfig(schemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
16
+ Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
17
+ Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
18
+ Schema.setConfig(jsonSchemaVersion, "anchorToken", "$anchor");
19
+ Schema.setConfig(jsonSchemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
20
+ Schema.setConfig(jsonSchemaVersion, "vocabularyToken", "$vocabulary");
21
+ Schema.setConfig(jsonSchemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
22
22
 
23
23
  Schema.add(JSON.parse(metaSchema));
24
24
 
package/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type JsonSchema = {
9
9
  interpret: typeof Core.interpret;
10
10
  setMetaOutputFormat: typeof Core.setMetaOutputFormat;
11
11
  setShouldMetaValidate: typeof Core.setShouldMetaValidate;
12
+ addMediaTypePlugin: typeof Core.addMediaTypePlugin;
12
13
  FLAG: typeof Core.FLAG;
13
14
  BASIC: typeof Core.BASIC;
14
15
  DETAILED: typeof Core.DETAILED;
@@ -24,6 +25,7 @@ export const compile: JsonSchema["compile"];
24
25
  export const interpret: JsonSchema["interpret"];
25
26
  export const setMetaOutputFormat: JsonSchema["setMetaOutputFormat"];
26
27
  export const setShouldMetaValidate: JsonSchema["setShouldMetaValidate"];
28
+ export const addMediaTypePlugin: JsonSchema["addMediaTypePlugin"];
27
29
  export const FLAG: JsonSchema["FLAG"];
28
30
  export const BASIC: JsonSchema["BASIC"];
29
31
  export const DETAILED: JsonSchema["DETAILED"];
package/lib/index.js CHANGED
@@ -16,6 +16,7 @@ module.exports = {
16
16
  interpret: Core.interpret,
17
17
  setMetaOutputFormat: Core.setMetaOutputFormat,
18
18
  setShouldMetaValidate: Core.setShouldMetaValidate,
19
+ addMediaTypePlugin: Core.addMediaTypePlugin,
19
20
  FLAG: Core.FLAG,
20
21
  BASIC: Core.BASIC,
21
22
  DETAILED: Core.DETAILED,
package/lib/index.mjs CHANGED
@@ -8,6 +8,7 @@ export const compile = JsonSchema.compile;
8
8
  export const interpret = JsonSchema.interpret;
9
9
  export const setMetaOutputFormat = JsonSchema.setMetaOutputFormat;
10
10
  export const setShouldMetaValidate = JsonSchema.setShouldMetaValidate;
11
+ export const addMediaTypePlugin = JsonSchema.addMediaTypePlugin;
11
12
  export const FLAG = JsonSchema.FLAG;
12
13
  export const BASIC = JsonSchema.BASIC;
13
14
  export const DETAILED = JsonSchema.DETAILED;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "0.19.0",
3
+ "version": "0.22.0",
4
4
  "description": "A JSON Schema Validator",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -33,27 +33,27 @@
33
33
  "url": "https://github.com/sponsors/jdesrosiers"
34
34
  },
35
35
  "devDependencies": {
36
- "@rollup/plugin-commonjs": "^11.1.0",
37
- "@rollup/plugin-node-resolve": "^7.1.3",
38
- "@types/chai": "^4.2.21",
39
- "@types/mocha": "^9.0.0",
40
- "@typescript-eslint/eslint-plugin": "^4.29.2",
41
- "@typescript-eslint/parser": "^4.29.2",
42
- "chai": "^4.3.4",
43
- "eslint": "^7.32.0",
44
- "eslint-import-resolver-node": "^0.3.6",
45
- "eslint-import-resolver-typescript": "^2.4.0",
46
- "eslint-plugin-import": "^2.24.0",
36
+ "@rollup/plugin-commonjs": "*",
37
+ "@rollup/plugin-node-resolve": "*",
38
+ "@types/chai": "*",
39
+ "@types/mocha": "*",
40
+ "@typescript-eslint/eslint-plugin": "*",
41
+ "@typescript-eslint/parser": "*",
42
+ "chai": "*",
43
+ "eslint": "*",
44
+ "eslint-import-resolver-node": "*",
45
+ "eslint-import-resolver-typescript": "*",
46
+ "eslint-plugin-import": "*",
47
47
  "json-schema-test-suite": "github:json-schema-org/JSON-Schema-Test-Suite",
48
- "mocha": "^9.1.3",
49
- "rimraf": "^3.0.2",
50
- "rollup": "^2.50.5",
51
- "rollup-plugin-terser": "^5.3.1",
52
- "ts-node": "^10.2.0",
53
- "typescript": "^4.3.5"
48
+ "mocha": "*",
49
+ "rimraf": "*",
50
+ "rollup": "*",
51
+ "rollup-plugin-terser": "*",
52
+ "ts-node": "*",
53
+ "typescript": "*"
54
54
  },
55
55
  "dependencies": {
56
- "@hyperjump/json-schema-core": "^0.24.0",
56
+ "@hyperjump/json-schema-core": "^0.27.0",
57
57
  "fastest-stable-stringify": "^2.0.2"
58
58
  }
59
59
  }