z-schema 12.0.4 → 12.1.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.
Files changed (176) hide show
  1. package/bin/z-schema +7 -2
  2. package/cjs/index.d.ts +541 -530
  3. package/cjs/index.js +3963 -7740
  4. package/dist/errors.d.mts +64 -0
  5. package/dist/errors.mjs +67 -0
  6. package/dist/format-validators.d.mts +14 -0
  7. package/dist/format-validators.mjs +261 -0
  8. package/dist/index.d.mts +10 -0
  9. package/dist/index.mjs +7 -0
  10. package/dist/json-schema-versions.d.mts +137 -0
  11. package/dist/json-schema-versions.mjs +11 -0
  12. package/dist/json-schema.d.mts +61 -0
  13. package/dist/json-schema.mjs +53 -0
  14. package/dist/json-validation.mjs +441 -0
  15. package/dist/report.d.mts +97 -0
  16. package/dist/report.mjs +194 -0
  17. package/dist/schema-cache.d.mts +23 -0
  18. package/dist/schema-cache.mjs +144 -0
  19. package/dist/schema-compiler.d.mts +23 -0
  20. package/dist/schema-compiler.mjs +265 -0
  21. package/dist/schema-validator.d.mts +15 -0
  22. package/dist/schema-validator.mjs +446 -0
  23. package/dist/schemas/draft-04-schema.mjs +125 -0
  24. package/dist/schemas/draft-06-schema.mjs +126 -0
  25. package/dist/schemas/draft-07-schema.mjs +141 -0
  26. package/dist/schemas/draft-2019-09-meta-applicator.mjs +46 -0
  27. package/dist/schemas/draft-2019-09-meta-content.mjs +15 -0
  28. package/dist/schemas/draft-2019-09-meta-core.mjs +52 -0
  29. package/dist/schemas/draft-2019-09-meta-format.mjs +11 -0
  30. package/dist/schemas/draft-2019-09-meta-meta-data.mjs +31 -0
  31. package/dist/schemas/draft-2019-09-meta-validation.mjs +80 -0
  32. package/dist/schemas/draft-2019-09-schema.mjs +39 -0
  33. package/dist/schemas/draft-2020-12-meta-applicator.mjs +45 -0
  34. package/dist/schemas/draft-2020-12-meta-content.mjs +15 -0
  35. package/dist/schemas/draft-2020-12-meta-core.mjs +46 -0
  36. package/dist/schemas/draft-2020-12-meta-format-annotation.mjs +11 -0
  37. package/dist/schemas/draft-2020-12-meta-format-assertion.mjs +11 -0
  38. package/dist/schemas/draft-2020-12-meta-meta-data.mjs +31 -0
  39. package/dist/schemas/draft-2020-12-meta-unevaluated.mjs +14 -0
  40. package/dist/schemas/draft-2020-12-meta-validation.mjs +80 -0
  41. package/dist/schemas/draft-2020-12-schema.mjs +55 -0
  42. package/dist/utils/array.mjs +54 -0
  43. package/dist/utils/base64.mjs +21 -0
  44. package/dist/utils/clone.mjs +42 -0
  45. package/dist/utils/constants.mjs +16 -0
  46. package/dist/utils/date.mjs +19 -0
  47. package/dist/utils/hostname.mjs +73 -0
  48. package/dist/utils/json.mjs +34 -0
  49. package/dist/utils/properties.mjs +11 -0
  50. package/dist/utils/schema-regex.mjs +49 -0
  51. package/dist/utils/symbols.mjs +5 -0
  52. package/dist/utils/time.mjs +42 -0
  53. package/dist/utils/unicode.mjs +12 -0
  54. package/dist/utils/uri.mjs +12 -0
  55. package/dist/utils/what-is.mjs +23 -0
  56. package/dist/validation/array.mjs +57 -0
  57. package/dist/validation/combinators.mjs +62 -0
  58. package/dist/validation/numeric.mjs +38 -0
  59. package/dist/validation/object.mjs +109 -0
  60. package/dist/validation/ref.mjs +49 -0
  61. package/dist/validation/shared.mjs +97 -0
  62. package/dist/validation/string.mjs +88 -0
  63. package/dist/validation/type.mjs +32 -0
  64. package/dist/z-schema-base.d.mts +85 -0
  65. package/dist/z-schema-base.mjs +230 -0
  66. package/dist/z-schema-options.d.mts +35 -0
  67. package/dist/z-schema-options.mjs +55 -0
  68. package/dist/z-schema-reader.d.mts +6 -0
  69. package/dist/z-schema-reader.mjs +10 -0
  70. package/dist/z-schema-versions.mjs +67 -0
  71. package/dist/z-schema.d.mts +193 -0
  72. package/dist/z-schema.mjs +300 -0
  73. package/package.json +49 -64
  74. package/src/index.ts +3 -3
  75. package/src/schema-compiler.ts +30 -10
  76. package/src/schema-validator.ts +1 -1
  77. package/src/utils/schema-regex.ts +13 -2
  78. package/src/z-schema-base.ts +1 -1
  79. package/src/z-schema-versions.ts +1 -2
  80. package/src/z-schema.ts +0 -1
  81. package/umd/ZSchema.js +5934 -8110
  82. package/umd/ZSchema.min.js +2 -1
  83. package/dist/errors.js +0 -72
  84. package/dist/format-validators.js +0 -392
  85. package/dist/index.js +0 -5
  86. package/dist/json-schema-versions.js +0 -8
  87. package/dist/json-schema.js +0 -84
  88. package/dist/json-validation.js +0 -728
  89. package/dist/package.json +0 -3
  90. package/dist/report.js +0 -265
  91. package/dist/schema-cache.js +0 -211
  92. package/dist/schema-compiler.js +0 -415
  93. package/dist/schema-validator.js +0 -721
  94. package/dist/schemas/draft-04-schema.json +0 -149
  95. package/dist/schemas/draft-06-schema.json +0 -155
  96. package/dist/schemas/draft-07-schema.json +0 -172
  97. package/dist/schemas/draft-2019-09-meta-applicator.json +0 -52
  98. package/dist/schemas/draft-2019-09-meta-content.json +0 -12
  99. package/dist/schemas/draft-2019-09-meta-core.json +0 -53
  100. package/dist/schemas/draft-2019-09-meta-format.json +0 -10
  101. package/dist/schemas/draft-2019-09-meta-meta-data.json +0 -32
  102. package/dist/schemas/draft-2019-09-meta-validation.json +0 -94
  103. package/dist/schemas/draft-2019-09-schema.json +0 -41
  104. package/dist/schemas/draft-2020-12-meta-applicator.json +0 -44
  105. package/dist/schemas/draft-2020-12-meta-content.json +0 -12
  106. package/dist/schemas/draft-2020-12-meta-core.json +0 -47
  107. package/dist/schemas/draft-2020-12-meta-format-annotation.json +0 -10
  108. package/dist/schemas/draft-2020-12-meta-format-assertion.json +0 -10
  109. package/dist/schemas/draft-2020-12-meta-meta-data.json +0 -32
  110. package/dist/schemas/draft-2020-12-meta-unevaluated.json +0 -11
  111. package/dist/schemas/draft-2020-12-meta-validation.json +0 -94
  112. package/dist/schemas/draft-2020-12-schema.json +0 -57
  113. package/dist/types/errors.d.ts +0 -64
  114. package/dist/types/format-validators.d.ts +0 -11
  115. package/dist/types/index.d.ts +0 -14
  116. package/dist/types/json-schema-versions.d.ts +0 -142
  117. package/dist/types/json-schema.d.ts +0 -66
  118. package/dist/types/json-validation.d.ts +0 -6
  119. package/dist/types/report.d.ts +0 -94
  120. package/dist/types/schema-cache.d.ts +0 -27
  121. package/dist/types/schema-compiler.d.ts +0 -31
  122. package/dist/types/schema-validator.d.ts +0 -10
  123. package/dist/types/utils/array.d.ts +0 -9
  124. package/dist/types/utils/base64.d.ts +0 -2
  125. package/dist/types/utils/clone.d.ts +0 -2
  126. package/dist/types/utils/constants.d.ts +0 -19
  127. package/dist/types/utils/date.d.ts +0 -1
  128. package/dist/types/utils/hostname.d.ts +0 -2
  129. package/dist/types/utils/json.d.ts +0 -9
  130. package/dist/types/utils/properties.d.ts +0 -1
  131. package/dist/types/utils/schema-regex.d.ts +0 -10
  132. package/dist/types/utils/symbols.d.ts +0 -2
  133. package/dist/types/utils/time.d.ts +0 -12
  134. package/dist/types/utils/unicode.d.ts +0 -5
  135. package/dist/types/utils/uri.d.ts +0 -4
  136. package/dist/types/utils/what-is.d.ts +0 -4
  137. package/dist/types/validation/array.d.ts +0 -12
  138. package/dist/types/validation/combinators.d.ts +0 -10
  139. package/dist/types/validation/numeric.d.ts +0 -8
  140. package/dist/types/validation/object.d.ts +0 -13
  141. package/dist/types/validation/ref.d.ts +0 -11
  142. package/dist/types/validation/shared.d.ts +0 -26
  143. package/dist/types/validation/string.d.ts +0 -9
  144. package/dist/types/validation/type.d.ts +0 -6
  145. package/dist/types/z-schema-base.d.ts +0 -87
  146. package/dist/types/z-schema-options.d.ts +0 -35
  147. package/dist/types/z-schema-reader.d.ts +0 -4
  148. package/dist/types/z-schema-versions.d.ts +0 -1
  149. package/dist/types/z-schema.d.ts +0 -191
  150. package/dist/utils/array.js +0 -69
  151. package/dist/utils/base64.js +0 -29
  152. package/dist/utils/clone.js +0 -59
  153. package/dist/utils/constants.js +0 -19
  154. package/dist/utils/date.js +0 -21
  155. package/dist/utils/hostname.js +0 -146
  156. package/dist/utils/json.js +0 -70
  157. package/dist/utils/properties.js +0 -10
  158. package/dist/utils/schema-regex.js +0 -52
  159. package/dist/utils/symbols.js +0 -2
  160. package/dist/utils/time.js +0 -50
  161. package/dist/utils/unicode.js +0 -12
  162. package/dist/utils/uri.js +0 -15
  163. package/dist/utils/what-is.js +0 -32
  164. package/dist/validation/array.js +0 -127
  165. package/dist/validation/combinators.js +0 -106
  166. package/dist/validation/numeric.js +0 -97
  167. package/dist/validation/object.js +0 -237
  168. package/dist/validation/ref.js +0 -70
  169. package/dist/validation/shared.js +0 -136
  170. package/dist/validation/string.js +0 -170
  171. package/dist/validation/type.js +0 -55
  172. package/dist/z-schema-base.js +0 -286
  173. package/dist/z-schema-options.js +0 -99
  174. package/dist/z-schema-reader.js +0 -7
  175. package/dist/z-schema-versions.js +0 -110
  176. package/dist/z-schema.js +0 -287
@@ -1,94 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2019-09/schema",
3
- "$id": "https://json-schema.org/draft/2019-09/meta/validation",
4
- "$recursiveAnchor": true,
5
- "title": "Validation vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "multipleOf": {
9
- "type": "number",
10
- "exclusiveMinimum": 0
11
- },
12
- "maximum": {
13
- "type": "number"
14
- },
15
- "exclusiveMaximum": {
16
- "type": "number"
17
- },
18
- "minimum": {
19
- "type": "number"
20
- },
21
- "exclusiveMinimum": {
22
- "type": "number"
23
- },
24
- "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
25
- "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
26
- "pattern": {
27
- "type": "string",
28
- "format": "regex"
29
- },
30
- "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
31
- "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
32
- "uniqueItems": {
33
- "type": "boolean",
34
- "default": false
35
- },
36
- "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
37
- "minContains": {
38
- "$ref": "#/$defs/nonNegativeInteger",
39
- "default": 1
40
- },
41
- "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
42
- "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
43
- "required": { "$ref": "#/$defs/stringArray" },
44
- "dependentRequired": {
45
- "type": "object",
46
- "additionalProperties": {
47
- "$ref": "#/$defs/stringArray"
48
- }
49
- },
50
- "const": true,
51
- "enum": {
52
- "type": "array",
53
- "items": true
54
- },
55
- "type": {
56
- "anyOf": [
57
- { "$ref": "#/$defs/simpleTypes" },
58
- {
59
- "type": "array",
60
- "items": { "$ref": "#/$defs/simpleTypes" },
61
- "minItems": 1,
62
- "uniqueItems": true
63
- }
64
- ]
65
- }
66
- },
67
- "$defs": {
68
- "nonNegativeInteger": {
69
- "type": "integer",
70
- "minimum": 0
71
- },
72
- "nonNegativeIntegerDefault0": {
73
- "$ref": "#/$defs/nonNegativeInteger",
74
- "default": 0
75
- },
76
- "simpleTypes": {
77
- "enum": [
78
- "array",
79
- "boolean",
80
- "integer",
81
- "null",
82
- "number",
83
- "object",
84
- "string"
85
- ]
86
- },
87
- "stringArray": {
88
- "type": "array",
89
- "items": { "type": "string" },
90
- "uniqueItems": true,
91
- "default": []
92
- }
93
- }
94
- }
@@ -1,41 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2019-09/schema",
3
- "$id": "https://json-schema.org/draft/2019-09/schema",
4
- "$vocabulary": {
5
- "https://json-schema.org/draft/2019-09/vocab/core": true,
6
- "https://json-schema.org/draft/2019-09/vocab/applicator": true,
7
- "https://json-schema.org/draft/2019-09/vocab/validation": true,
8
- "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
9
- "https://json-schema.org/draft/2019-09/vocab/format": false,
10
- "https://json-schema.org/draft/2019-09/vocab/content": true
11
- },
12
- "$recursiveAnchor": true,
13
- "title": "Core and Validation specifications meta-schema",
14
- "allOf": [
15
- { "$ref": "meta/core" },
16
- { "$ref": "meta/applicator" },
17
- { "$ref": "meta/validation" },
18
- { "$ref": "meta/meta-data" },
19
- { "$ref": "meta/format" },
20
- { "$ref": "meta/content" }
21
- ],
22
- "type": ["object", "boolean"],
23
- "properties": {
24
- "definitions": {
25
- "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
26
- "type": "object",
27
- "additionalProperties": { "$recursiveRef": "#" },
28
- "default": {}
29
- },
30
- "dependencies": {
31
- "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"",
32
- "type": "object",
33
- "additionalProperties": {
34
- "anyOf": [
35
- { "$recursiveRef": "#" },
36
- { "$ref": "meta/validation#/$defs/stringArray" }
37
- ]
38
- }
39
- }
40
- }
41
- }
@@ -1,44 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
4
- "$dynamicAnchor": "meta",
5
- "title": "Applicator vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "prefixItems": { "$ref": "#/$defs/schemaArray" },
9
- "items": { "$dynamicRef": "#meta" },
10
- "contains": { "$dynamicRef": "#meta" },
11
- "additionalProperties": { "$dynamicRef": "#meta" },
12
- "properties": {
13
- "type": "object",
14
- "additionalProperties": { "$dynamicRef": "#meta" },
15
- "default": {}
16
- },
17
- "patternProperties": {
18
- "type": "object",
19
- "additionalProperties": { "$dynamicRef": "#meta" },
20
- "propertyNames": { "format": "regex" },
21
- "default": {}
22
- },
23
- "dependentSchemas": {
24
- "type": "object",
25
- "additionalProperties": { "$dynamicRef": "#meta" },
26
- "default": {}
27
- },
28
- "propertyNames": { "$dynamicRef": "#meta" },
29
- "if": { "$dynamicRef": "#meta" },
30
- "then": { "$dynamicRef": "#meta" },
31
- "else": { "$dynamicRef": "#meta" },
32
- "allOf": { "$ref": "#/$defs/schemaArray" },
33
- "anyOf": { "$ref": "#/$defs/schemaArray" },
34
- "oneOf": { "$ref": "#/$defs/schemaArray" },
35
- "not": { "$dynamicRef": "#meta" }
36
- },
37
- "$defs": {
38
- "schemaArray": {
39
- "type": "array",
40
- "minItems": 1,
41
- "items": { "$dynamicRef": "#meta" }
42
- }
43
- }
44
- }
@@ -1,12 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/content",
4
- "$dynamicAnchor": "meta",
5
- "title": "Content vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "contentEncoding": { "type": "string" },
9
- "contentMediaType": { "type": "string" },
10
- "contentSchema": { "$dynamicRef": "#meta" }
11
- }
12
- }
@@ -1,47 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/core",
4
- "$dynamicAnchor": "meta",
5
- "title": "Core vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "$id": {
9
- "$ref": "#/$defs/uriReferenceString",
10
- "$comment": "Non-empty fragments not allowed.",
11
- "pattern": "^[^#]*#?$"
12
- },
13
- "$schema": { "$ref": "#/$defs/uriString" },
14
- "$ref": { "$ref": "#/$defs/uriReferenceString" },
15
- "$anchor": { "$ref": "#/$defs/anchorString" },
16
- "$dynamicRef": { "$ref": "#/$defs/uriReferenceString" },
17
- "$dynamicAnchor": { "$ref": "#/$defs/anchorString" },
18
- "$vocabulary": {
19
- "type": "object",
20
- "propertyNames": { "$ref": "#/$defs/uriString" },
21
- "additionalProperties": {
22
- "type": "boolean"
23
- }
24
- },
25
- "$comment": {
26
- "type": "string"
27
- },
28
- "$defs": {
29
- "type": "object",
30
- "additionalProperties": { "$dynamicRef": "#meta" }
31
- }
32
- },
33
- "$defs": {
34
- "anchorString": {
35
- "type": "string",
36
- "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
37
- },
38
- "uriString": {
39
- "type": "string",
40
- "format": "uri"
41
- },
42
- "uriReferenceString": {
43
- "type": "string",
44
- "format": "uri-reference"
45
- }
46
- }
47
- }
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
4
- "$dynamicAnchor": "meta",
5
- "title": "Format vocabulary meta-schema for annotation results",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "format": { "type": "string" }
9
- }
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
4
- "$dynamicAnchor": "meta",
5
- "title": "Format vocabulary meta-schema for assertion results",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "format": { "type": "string" }
9
- }
10
- }
@@ -1,32 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
4
- "$dynamicAnchor": "meta",
5
- "title": "Meta-data vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "title": {
9
- "type": "string"
10
- },
11
- "description": {
12
- "type": "string"
13
- },
14
- "default": true,
15
- "deprecated": {
16
- "type": "boolean",
17
- "default": false
18
- },
19
- "readOnly": {
20
- "type": "boolean",
21
- "default": false
22
- },
23
- "writeOnly": {
24
- "type": "boolean",
25
- "default": false
26
- },
27
- "examples": {
28
- "type": "array",
29
- "items": true
30
- }
31
- }
32
- }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
4
- "$dynamicAnchor": "meta",
5
- "title": "Unevaluated applicator vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "unevaluatedItems": { "$dynamicRef": "#meta" },
9
- "unevaluatedProperties": { "$dynamicRef": "#meta" }
10
- }
11
- }
@@ -1,94 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/meta/validation",
4
- "$dynamicAnchor": "meta",
5
- "title": "Validation vocabulary meta-schema",
6
- "type": ["object", "boolean"],
7
- "properties": {
8
- "type": {
9
- "anyOf": [
10
- { "$ref": "#/$defs/simpleTypes" },
11
- {
12
- "type": "array",
13
- "items": { "$ref": "#/$defs/simpleTypes" },
14
- "minItems": 1,
15
- "uniqueItems": true
16
- }
17
- ]
18
- },
19
- "const": true,
20
- "enum": {
21
- "type": "array",
22
- "items": true
23
- },
24
- "multipleOf": {
25
- "type": "number",
26
- "exclusiveMinimum": 0
27
- },
28
- "maximum": {
29
- "type": "number"
30
- },
31
- "exclusiveMaximum": {
32
- "type": "number"
33
- },
34
- "minimum": {
35
- "type": "number"
36
- },
37
- "exclusiveMinimum": {
38
- "type": "number"
39
- },
40
- "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
41
- "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
42
- "pattern": {
43
- "type": "string",
44
- "format": "regex"
45
- },
46
- "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
47
- "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
48
- "uniqueItems": {
49
- "type": "boolean",
50
- "default": false
51
- },
52
- "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
53
- "minContains": {
54
- "$ref": "#/$defs/nonNegativeInteger",
55
- "default": 1
56
- },
57
- "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
58
- "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
59
- "required": { "$ref": "#/$defs/stringArray" },
60
- "dependentRequired": {
61
- "type": "object",
62
- "additionalProperties": {
63
- "$ref": "#/$defs/stringArray"
64
- }
65
- }
66
- },
67
- "$defs": {
68
- "nonNegativeInteger": {
69
- "type": "integer",
70
- "minimum": 0
71
- },
72
- "nonNegativeIntegerDefault0": {
73
- "$ref": "#/$defs/nonNegativeInteger",
74
- "default": 0
75
- },
76
- "simpleTypes": {
77
- "enum": [
78
- "array",
79
- "boolean",
80
- "integer",
81
- "null",
82
- "number",
83
- "object",
84
- "string"
85
- ]
86
- },
87
- "stringArray": {
88
- "type": "array",
89
- "items": { "type": "string" },
90
- "uniqueItems": true,
91
- "default": []
92
- }
93
- }
94
- }
@@ -1,57 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://json-schema.org/draft/2020-12/schema",
4
- "$vocabulary": {
5
- "https://json-schema.org/draft/2020-12/vocab/core": true,
6
- "https://json-schema.org/draft/2020-12/vocab/applicator": true,
7
- "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
8
- "https://json-schema.org/draft/2020-12/vocab/validation": true,
9
- "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
10
- "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
11
- "https://json-schema.org/draft/2020-12/vocab/content": true
12
- },
13
- "$dynamicAnchor": "meta",
14
- "title": "Core and Validation specifications meta-schema",
15
- "allOf": [
16
- { "$ref": "meta/core" },
17
- { "$ref": "meta/applicator" },
18
- { "$ref": "meta/unevaluated" },
19
- { "$ref": "meta/validation" },
20
- { "$ref": "meta/meta-data" },
21
- { "$ref": "meta/format-annotation" },
22
- { "$ref": "meta/content" }
23
- ],
24
- "type": ["object", "boolean"],
25
- "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
26
- "properties": {
27
- "definitions": {
28
- "$comment": "\"definitions\" has been replaced by \"$defs\".",
29
- "type": "object",
30
- "additionalProperties": { "$dynamicRef": "#meta" },
31
- "deprecated": true,
32
- "default": {}
33
- },
34
- "dependencies": {
35
- "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
36
- "type": "object",
37
- "additionalProperties": {
38
- "anyOf": [
39
- { "$dynamicRef": "#meta" },
40
- { "$ref": "meta/validation#/$defs/stringArray" }
41
- ]
42
- },
43
- "deprecated": true,
44
- "default": {}
45
- },
46
- "$recursiveAnchor": {
47
- "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
48
- "$ref": "meta/core#/$defs/anchorString",
49
- "deprecated": true
50
- },
51
- "$recursiveRef": {
52
- "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
53
- "$ref": "meta/core#/$defs/uriReferenceString",
54
- "deprecated": true
55
- }
56
- }
57
- }
@@ -1,64 +0,0 @@
1
- import type { SchemaErrorDetail } from './report.js';
2
- export type ErrorCode = keyof typeof Errors;
3
- export type ErrorParam = string | number | Array<string | number>;
4
- export declare const Errors: {
5
- INVALID_TYPE: string;
6
- INVALID_FORMAT: string;
7
- ENUM_MISMATCH: string;
8
- ENUM_CASE_MISMATCH: string;
9
- ANY_OF_MISSING: string;
10
- ONE_OF_MISSING: string;
11
- ONE_OF_MULTIPLE: string;
12
- NOT_PASSED: string;
13
- ARRAY_LENGTH_SHORT: string;
14
- ARRAY_LENGTH_LONG: string;
15
- ARRAY_UNIQUE: string;
16
- ARRAY_ADDITIONAL_ITEMS: string;
17
- ARRAY_UNEVALUATED_ITEMS: string;
18
- MULTIPLE_OF: string;
19
- MINIMUM: string;
20
- MINIMUM_EXCLUSIVE: string;
21
- MAXIMUM: string;
22
- MAXIMUM_EXCLUSIVE: string;
23
- OBJECT_PROPERTIES_MINIMUM: string;
24
- OBJECT_PROPERTIES_MAXIMUM: string;
25
- OBJECT_MISSING_REQUIRED_PROPERTY: string;
26
- OBJECT_ADDITIONAL_PROPERTIES: string;
27
- OBJECT_UNEVALUATED_PROPERTIES: string;
28
- OBJECT_DEPENDENCY_KEY: string;
29
- MIN_LENGTH: string;
30
- MAX_LENGTH: string;
31
- PATTERN: string;
32
- KEYWORD_TYPE_EXPECTED: string;
33
- KEYWORD_UNDEFINED_STRICT: string;
34
- KEYWORD_UNEXPECTED: string;
35
- KEYWORD_MUST_BE: string;
36
- KEYWORD_DEPENDENCY: string;
37
- KEYWORD_PATTERN: string;
38
- KEYWORD_VALUE_TYPE: string;
39
- UNKNOWN_FORMAT: string;
40
- CUSTOM_MODE_FORCE_PROPERTIES: string;
41
- REF_UNRESOLVED: string;
42
- UNRESOLVABLE_REFERENCE: string;
43
- SCHEMA_NOT_REACHABLE: string;
44
- SCHEMA_TYPE_EXPECTED: string;
45
- SCHEMA_NOT_AN_OBJECT: string;
46
- ASYNC_TIMEOUT: string;
47
- PARENT_SCHEMA_VALIDATION_FAILED: string;
48
- REMOTE_NOT_VALID: string;
49
- SCHEMA_IS_FALSE: string;
50
- CONST: string;
51
- CONTAINS: string;
52
- PROPERTY_NAMES: string;
53
- COLLECT_EVALUATED_DEPTH_EXCEEDED: string;
54
- MAX_RECURSION_DEPTH_EXCEEDED: string;
55
- };
56
- export declare class ValidateError extends Error {
57
- name: string;
58
- details?: SchemaErrorDetail[];
59
- constructor(message: string, details?: SchemaErrorDetail[]);
60
- }
61
- export declare function getValidateError({ message, details }: {
62
- message?: string;
63
- details: SchemaErrorDetail[];
64
- }): ValidateError;
@@ -1,11 +0,0 @@
1
- export type FormatValidatorFn = (input: unknown) => boolean | Promise<boolean>;
2
- export interface FormatValidatorsOptions {
3
- strictUris?: boolean;
4
- customFormats?: Record<string, FormatValidatorFn | null>;
5
- }
6
- export declare function getFormatValidators(options?: FormatValidatorsOptions): Record<string, FormatValidatorFn>;
7
- export declare function registerFormat(name: string, validatorFunction: FormatValidatorFn): void;
8
- export declare function unregisterFormat(name: string): void;
9
- export declare function getSupportedFormats(customFormats?: Record<string, FormatValidatorFn | null>): string[];
10
- export declare function isFormatSupported(name: string, customFormats?: Record<string, FormatValidatorFn | null>): boolean;
11
- export declare function getRegisteredFormats(): string[];
@@ -1,14 +0,0 @@
1
- import { ZSchema } from './z-schema.js';
2
- export type { ErrorCode, ErrorParam, Errors } from './errors.js';
3
- export { ValidateError } from './errors.js';
4
- export type { FormatValidatorFn, FormatValidatorsOptions } from './format-validators.js';
5
- export { getFormatValidators, getRegisteredFormats, getSupportedFormats, isFormatSupported, registerFormat, unregisterFormat, } from './format-validators.js';
6
- export type { JsonSchemaType } from './json-schema.js';
7
- export type { JsonSchemaCommon } from './json-schema.js';
8
- export type { JsonSchema, JsonSchemaDraft4, JsonSchemaDraft6, JsonSchemaDraft7, JsonSchemaDraft201909, JsonSchemaDraft202012, JsonSchemaVersion, } from './json-schema-versions.js';
9
- export type { Report, SchemaErrorDetail } from './report.js';
10
- export type { ZSchema, ZSchemaAsync, ZSchemaAsyncSafe, ZSchemaSafe } from './z-schema.js';
11
- export { ValidateOptions, ValidateResponse } from './z-schema-base.js';
12
- export { ZSchemaOptions } from './z-schema-options.js';
13
- export { SchemaReader } from './z-schema-reader.js';
14
- export default ZSchema;