@emulsify/cli 1.2.0 → 1.4.2

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 (632) hide show
  1. package/README.md +5 -4
  2. package/dist/handlers/componentInstall.js +15 -15
  3. package/dist/handlers/componentList.js +11 -11
  4. package/dist/handlers/hofs/withProgressBar.js +16 -0
  5. package/dist/handlers/init.js +63 -59
  6. package/dist/handlers/systemInstall.js +46 -18
  7. package/dist/handlers/systemList.js +1 -1
  8. package/dist/index.js +2 -1
  9. package/dist/lib/constants.js +5 -3
  10. package/dist/lib/log.js +5 -4
  11. package/dist/node_modules/.package-lock.json +68 -7
  12. package/dist/node_modules/@types/node/LICENSE +21 -0
  13. package/dist/node_modules/@types/node/README.md +16 -0
  14. package/dist/node_modules/@types/node/assert.d.ts +128 -0
  15. package/dist/node_modules/@types/node/async_hooks.d.ts +229 -0
  16. package/dist/node_modules/@types/node/buffer.d.ts +25 -0
  17. package/dist/node_modules/@types/node/child_process.d.ts +514 -0
  18. package/dist/node_modules/@types/node/cluster.d.ts +265 -0
  19. package/dist/node_modules/@types/node/console.d.ts +142 -0
  20. package/dist/node_modules/@types/node/constants.d.ts +18 -0
  21. package/dist/node_modules/@types/node/crypto.d.ts +1189 -0
  22. package/dist/node_modules/@types/node/dgram.d.ts +144 -0
  23. package/dist/node_modules/@types/node/dns.d.ts +387 -0
  24. package/dist/node_modules/@types/node/domain.d.ts +27 -0
  25. package/dist/node_modules/@types/node/events.d.ts +82 -0
  26. package/dist/node_modules/@types/node/fs/promises.d.ts +568 -0
  27. package/dist/node_modules/@types/node/fs.d.ts +2273 -0
  28. package/dist/node_modules/@types/node/globals.d.ts +613 -0
  29. package/dist/node_modules/@types/node/globals.global.d.ts +1 -0
  30. package/dist/node_modules/@types/node/http.d.ts +490 -0
  31. package/dist/node_modules/@types/node/http2.d.ts +961 -0
  32. package/dist/node_modules/@types/node/https.d.ts +142 -0
  33. package/dist/node_modules/@types/node/index.d.ts +99 -0
  34. package/dist/node_modules/@types/node/inspector.d.ts +3051 -0
  35. package/dist/node_modules/@types/node/module.d.ts +56 -0
  36. package/dist/node_modules/@types/node/net.d.ts +296 -0
  37. package/dist/node_modules/@types/node/os.d.ts +242 -0
  38. package/dist/node_modules/@types/node/package.json +230 -0
  39. package/dist/node_modules/@types/node/path.d.ts +157 -0
  40. package/dist/node_modules/@types/node/perf_hooks.d.ts +274 -0
  41. package/dist/node_modules/@types/node/process.d.ts +413 -0
  42. package/dist/node_modules/@types/node/punycode.d.ts +78 -0
  43. package/dist/node_modules/@types/node/querystring.d.ts +31 -0
  44. package/dist/node_modules/@types/node/readline.d.ts +174 -0
  45. package/dist/node_modules/@types/node/repl.d.ts +398 -0
  46. package/dist/node_modules/@types/node/stream.d.ts +359 -0
  47. package/dist/node_modules/@types/node/string_decoder.d.ts +10 -0
  48. package/dist/node_modules/@types/node/timers.d.ts +19 -0
  49. package/dist/node_modules/@types/node/tls.d.ts +783 -0
  50. package/dist/node_modules/@types/node/trace_events.d.ts +64 -0
  51. package/dist/node_modules/@types/node/tty.d.ts +69 -0
  52. package/dist/node_modules/@types/node/url.d.ts +119 -0
  53. package/dist/node_modules/@types/node/util.d.ts +216 -0
  54. package/dist/node_modules/@types/node/v8.d.ts +190 -0
  55. package/dist/node_modules/@types/node/vm.d.ts +155 -0
  56. package/dist/node_modules/@types/node/wasi.d.ts +89 -0
  57. package/dist/node_modules/@types/node/worker_threads.d.ts +241 -0
  58. package/dist/node_modules/@types/node/zlib.d.ts +364 -0
  59. package/dist/node_modules/@types/progress/LICENSE +21 -0
  60. package/dist/node_modules/@types/progress/README.md +16 -0
  61. package/dist/node_modules/@types/progress/index.d.ts +148 -0
  62. package/dist/node_modules/@types/progress/package.json +27 -0
  63. package/dist/node_modules/ajv-formats/LICENSE +21 -0
  64. package/dist/node_modules/ajv-formats/README.md +123 -0
  65. package/dist/node_modules/ajv-formats/dist/formats.d.ts +9 -0
  66. package/dist/node_modules/ajv-formats/dist/formats.js +173 -0
  67. package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
  68. package/dist/node_modules/ajv-formats/dist/index.d.ts +15 -0
  69. package/dist/node_modules/ajv-formats/dist/index.js +37 -0
  70. package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
  71. package/dist/node_modules/ajv-formats/dist/limit.d.ts +10 -0
  72. package/dist/node_modules/ajv-formats/dist/limit.js +69 -0
  73. package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
  74. package/dist/node_modules/ajv-formats/node_modules/ajv/.runkit_example.js +23 -0
  75. package/dist/node_modules/ajv-formats/node_modules/ajv/LICENSE +22 -0
  76. package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +192 -0
  77. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.d.ts +17 -0
  78. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js +55 -0
  79. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js.map +1 -0
  80. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.d.ts +17 -0
  81. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js +49 -0
  82. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js.map +1 -0
  83. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.d.ts +16 -0
  84. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js +44 -0
  85. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js.map +1 -0
  86. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.d.ts +39 -0
  87. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +147 -0
  88. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  89. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
  90. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js +697 -0
  91. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  92. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
  93. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  94. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  95. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.d.ts +13 -0
  96. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js +123 -0
  97. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js.map +1 -0
  98. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.d.ts +80 -0
  99. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js +243 -0
  100. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -0
  101. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
  102. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
  103. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
  104. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
  105. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js +218 -0
  106. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
  107. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
  108. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/types.js +14 -0
  109. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
  110. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.d.ts +20 -0
  111. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js +28 -0
  112. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js.map +1 -0
  113. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.d.ts +5 -0
  114. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js +12 -0
  115. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  116. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
  117. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js +153 -0
  118. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  119. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.d.ts +28 -0
  120. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js +26 -0
  121. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js.map +1 -0
  122. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.d.ts +40 -0
  123. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js +178 -0
  124. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js.map +1 -0
  125. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
  126. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
  127. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  128. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
  129. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  130. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  131. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
  132. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js +202 -0
  133. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  134. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
  135. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
  136. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  137. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
  138. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js +510 -0
  139. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  140. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
  141. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
  142. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  143. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
  144. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
  145. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  146. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.d.ts +171 -0
  147. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js +614 -0
  148. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js.map +1 -0
  149. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.d.ts +45 -0
  150. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js +66 -0
  151. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js.map +1 -0
  152. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json +13 -0
  153. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
  154. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
  155. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
  156. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
  157. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
  158. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
  159. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
  160. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  161. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
  162. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
  163. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
  164. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
  165. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
  166. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
  167. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
  168. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
  169. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  170. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  171. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  172. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
  173. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
  174. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
  175. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
  176. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
  177. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
  178. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
  179. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
  180. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
  181. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js +7 -0
  182. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  183. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
  184. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js +184 -0
  185. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
  186. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
  187. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/quote.js +30 -0
  188. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/quote.js.map +1 -0
  189. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
  190. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/re2.js +6 -0
  191. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/re2.js.map +1 -0
  192. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
  193. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/timestamp.js +42 -0
  194. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
  195. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
  196. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
  197. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  198. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
  199. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js +11 -0
  200. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  201. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.d.ts +6 -0
  202. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js +83 -0
  203. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js.map +1 -0
  204. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
  205. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/instance.js +35 -0
  206. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/instance.js.map +1 -0
  207. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +177 -0
  208. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.js +3 -0
  209. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.js.map +1 -0
  210. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +124 -0
  211. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.js +3 -0
  212. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.js.map +1 -0
  213. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/jtd-schema.d.ts +168 -0
  214. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/jtd-schema.js +3 -0
  215. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
  216. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
  217. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
  218. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  219. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
  220. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
  221. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  222. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
  223. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
  224. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  225. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
  226. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
  227. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  228. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
  229. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
  230. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  231. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
  232. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
  233. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  234. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
  235. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
  236. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
  237. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
  238. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
  239. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  240. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
  241. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
  242. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  243. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
  244. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
  245. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  246. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
  247. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
  248. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  249. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
  250. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
  251. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  252. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
  253. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
  254. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  255. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
  256. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
  257. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  258. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
  259. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
  260. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  261. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
  262. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  263. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  264. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
  265. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
  266. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  267. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
  268. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
  269. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  270. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
  271. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js +131 -0
  272. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  273. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
  274. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
  275. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  276. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
  277. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
  278. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  279. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
  280. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
  281. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  282. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
  283. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +93 -0
  284. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  285. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
  286. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
  287. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  288. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
  289. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
  290. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
  291. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
  292. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
  293. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  294. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
  295. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
  296. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
  297. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
  298. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
  299. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
  300. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
  301. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
  302. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
  303. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
  304. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
  305. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
  306. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
  307. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
  308. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
  309. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
  310. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/errors.js +3 -0
  311. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
  312. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
  313. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
  314. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  315. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
  316. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
  317. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  318. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
  319. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
  320. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
  321. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
  322. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
  323. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
  324. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
  325. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
  326. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
  327. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
  328. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
  329. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
  330. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
  331. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
  332. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
  333. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
  334. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
  335. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
  336. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
  337. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
  338. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
  339. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
  340. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
  341. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
  342. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
  343. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js +146 -0
  344. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
  345. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
  346. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js +66 -0
  347. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
  348. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
  349. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
  350. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
  351. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
  352. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
  353. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
  354. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
  355. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js +48 -0
  356. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
  357. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
  358. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
  359. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  360. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
  361. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/next.js +8 -0
  362. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
  363. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
  364. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
  365. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
  366. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
  367. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
  368. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
  369. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
  370. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
  371. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
  372. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
  373. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
  374. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  375. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
  376. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
  377. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
  378. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
  379. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js +47 -0
  380. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  381. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
  382. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
  383. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  384. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
  385. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
  386. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
  387. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
  388. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
  389. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  390. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
  391. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
  392. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  393. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
  394. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
  395. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  396. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
  397. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
  398. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  399. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
  400. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
  401. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  402. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
  403. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js +24 -0
  404. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  405. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
  406. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
  407. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  408. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
  409. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
  410. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  411. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2019.ts +78 -0
  412. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2020.ts +72 -0
  413. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/ajv.ts +67 -0
  414. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +160 -0
  415. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/index.ts +832 -0
  416. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
  417. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/errors.ts +184 -0
  418. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +324 -0
  419. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
  420. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/serialize.ts +260 -0
  421. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
  422. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/names.ts +27 -0
  423. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/ref_error.ts +12 -0
  424. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +146 -0
  425. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/rules.ts +50 -0
  426. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/util.ts +213 -0
  427. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
  428. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
  429. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/dataType.ts +229 -0
  430. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
  431. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/index.ts +573 -0
  432. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
  433. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
  434. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/core.ts +880 -0
  435. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/jtd.ts +129 -0
  436. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/data.json +13 -0
  437. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
  438. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
  439. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
  440. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
  441. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
  442. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  443. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
  444. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
  445. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
  446. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
  447. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
  448. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
  449. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  450. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  451. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  452. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
  453. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
  454. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
  455. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
  456. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
  457. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
  458. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/equal.ts +7 -0
  459. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/parseJson.ts +176 -0
  460. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/quote.ts +31 -0
  461. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/re2.ts +6 -0
  462. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
  463. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
  464. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
  465. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/standalone/index.ts +93 -0
  466. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/standalone/instance.ts +36 -0
  467. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +233 -0
  468. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +189 -0
  469. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/jtd-schema.ts +264 -0
  470. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
  471. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
  472. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
  473. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
  474. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
  475. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
  476. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
  477. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
  478. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
  479. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
  480. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
  481. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
  482. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
  483. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
  484. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
  485. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
  486. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
  487. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
  488. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/code.ts +168 -0
  489. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
  490. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
  491. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
  492. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +102 -0
  493. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
  494. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
  495. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
  496. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
  497. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
  498. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
  499. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
  500. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
  501. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
  502. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
  503. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
  504. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
  505. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
  506. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
  507. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
  508. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
  509. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
  510. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
  511. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
  512. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/properties.ts +177 -0
  513. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/ref.ts +74 -0
  514. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
  515. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
  516. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/values.ts +55 -0
  517. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
  518. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/next.ts +8 -0
  519. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
  520. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
  521. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
  522. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
  523. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
  524. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/enum.ts +52 -0
  525. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
  526. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
  527. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
  528. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
  529. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
  530. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
  531. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
  532. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
  533. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
  534. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
  535. package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +124 -0
  536. package/dist/node_modules/ajv-formats/package.json +74 -0
  537. package/dist/node_modules/ajv-formats/src/formats.ts +232 -0
  538. package/dist/node_modules/ajv-formats/src/index.ts +62 -0
  539. package/dist/node_modules/ajv-formats/src/limit.ts +99 -0
  540. package/dist/node_modules/consola/CHANGELOG.md +706 -0
  541. package/dist/node_modules/consola/README.md +288 -0
  542. package/dist/node_modules/consola/dist/consola.browser.js +1 -0
  543. package/dist/node_modules/consola/dist/consola.js +1 -0
  544. package/dist/node_modules/consola/package.json +80 -0
  545. package/dist/node_modules/consola/src/browser.js +20 -0
  546. package/dist/node_modules/consola/src/consola.js +327 -0
  547. package/dist/node_modules/consola/src/index.js +7 -0
  548. package/dist/node_modules/consola/src/logLevels.js +11 -0
  549. package/dist/node_modules/consola/src/node.js +36 -0
  550. package/dist/node_modules/consola/src/reporters/basic.js +72 -0
  551. package/dist/node_modules/consola/src/reporters/browser.js +54 -0
  552. package/dist/node_modules/consola/src/reporters/fancy.js +87 -0
  553. package/dist/node_modules/consola/src/reporters/index.js +5 -0
  554. package/dist/node_modules/consola/src/reporters/json.js +9 -0
  555. package/dist/node_modules/consola/src/reporters/winston.js +45 -0
  556. package/dist/node_modules/consola/src/types.js +50 -0
  557. package/dist/node_modules/consola/src/utils/chalk.js +37 -0
  558. package/dist/node_modules/consola/src/utils/date.js +5 -0
  559. package/dist/node_modules/consola/src/utils/error.js +16 -0
  560. package/dist/node_modules/consola/src/utils/fancy.js +10 -0
  561. package/dist/node_modules/consola/src/utils/format.js +30 -0
  562. package/dist/node_modules/consola/src/utils/global.js +38 -0
  563. package/dist/node_modules/consola/src/utils/index.js +23 -0
  564. package/dist/node_modules/consola/src/utils/stream.js +20 -0
  565. package/dist/node_modules/consola/src/utils/string.js +41 -0
  566. package/dist/node_modules/consola/types/consola.d.ts +182 -0
  567. package/dist/node_modules/debug/LICENSE +10 -9
  568. package/dist/node_modules/debug/README.md +24 -1
  569. package/dist/node_modules/debug/package.json +6 -6
  570. package/dist/node_modules/debug/src/common.js +1 -1
  571. package/dist/node_modules/progress/CHANGELOG.md +115 -0
  572. package/dist/node_modules/progress/LICENSE +22 -0
  573. package/dist/node_modules/progress/Makefile +8 -0
  574. package/dist/node_modules/progress/Readme.md +146 -0
  575. package/dist/node_modules/progress/index.js +1 -0
  576. package/dist/node_modules/progress/lib/node-progress.js +236 -0
  577. package/dist/node_modules/progress/package.json +26 -0
  578. package/dist/node_modules/simple-git/CHANGELOG.md +35 -0
  579. package/dist/node_modules/simple-git/package.json +6 -2
  580. package/dist/node_modules/simple-git/readme.md +8 -1
  581. package/dist/node_modules/simple-git/src/lib/api.d.ts +2 -0
  582. package/dist/node_modules/simple-git/src/lib/api.js +2 -0
  583. package/dist/node_modules/simple-git/src/lib/api.js.map +1 -1
  584. package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.d.ts +2 -2
  585. package/dist/node_modules/simple-git/src/lib/git-factory.d.ts +1 -0
  586. package/dist/node_modules/simple-git/src/lib/git-factory.js +1 -0
  587. package/dist/node_modules/simple-git/src/lib/git-factory.js.map +1 -1
  588. package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.d.ts +3 -0
  589. package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js +80 -0
  590. package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js.map +1 -0
  591. package/dist/node_modules/simple-git/src/lib/plugins/index.d.ts +1 -0
  592. package/dist/node_modules/simple-git/src/lib/plugins/index.js +1 -0
  593. package/dist/node_modules/simple-git/src/lib/plugins/index.js.map +1 -1
  594. package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.d.ts +1 -0
  595. package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.d.ts +12 -33
  596. package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js +2 -22
  597. package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js.map +1 -1
  598. package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js +9 -23
  599. package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js.map +1 -1
  600. package/dist/node_modules/simple-git/src/lib/simple-git-api.js +2 -1
  601. package/dist/node_modules/simple-git/src/lib/simple-git-api.js.map +1 -1
  602. package/dist/node_modules/simple-git/src/lib/tasks/grep.d.ts +12 -0
  603. package/dist/node_modules/simple-git/src/lib/tasks/grep.js +76 -0
  604. package/dist/node_modules/simple-git/src/lib/tasks/grep.js.map +1 -0
  605. package/dist/node_modules/simple-git/src/lib/types/index.d.ts +16 -0
  606. package/dist/node_modules/simple-git/src/lib/utils/util.d.ts +2 -0
  607. package/dist/node_modules/simple-git/src/lib/utils/util.js +6 -1
  608. package/dist/node_modules/simple-git/src/lib/utils/util.js.map +1 -1
  609. package/dist/node_modules/simple-git/typings/response.d.ts +38 -1
  610. package/dist/node_modules/simple-git/typings/simple-git.d.ts +7 -0
  611. package/dist/node_modules/simple-git/typings/types.d.ts +2 -1
  612. package/dist/package.json +14 -10
  613. package/dist/schemas/system.json +74 -0
  614. package/dist/schemas/variant.json +137 -0
  615. package/dist/scripts/jsonSchemaToTs.js +5 -5
  616. package/dist/util/cache/cloneIntoCache.js +6 -6
  617. package/dist/util/cache/copyItemFromCache.js +3 -3
  618. package/dist/util/cache/getCachedItemCheckout.js +2 -2
  619. package/dist/util/cache/getCachedItemPath.js +2 -2
  620. package/dist/util/cache/getJsonFromCachedFile.js +1 -1
  621. package/dist/util/fs/executeScript.js +1 -1
  622. package/dist/util/fs/findFileInCurrentPath.js +5 -5
  623. package/dist/util/platform/getDrupalInfo.js +4 -4
  624. package/dist/util/platform/getInitSuccessMessageForPlatform.js +35 -0
  625. package/dist/util/platform/getPlatformInfo.js +1 -1
  626. package/dist/util/project/getEmulsifyConfig.js +2 -2
  627. package/dist/util/project/installComponentFromCache.js +4 -4
  628. package/dist/util/project/installDependencies.js +1 -1
  629. package/dist/util/project/installGeneralAssetsFromCache.js +3 -3
  630. package/dist/util/project/setEmulsifyConfig.js +3 -3
  631. package/dist/util/strToMachineName.js +5 -2
  632. package/package.json +15 -11
@@ -0,0 +1,880 @@
1
+ export {
2
+ Format,
3
+ FormatDefinition,
4
+ AsyncFormatDefinition,
5
+ KeywordDefinition,
6
+ KeywordErrorDefinition,
7
+ CodeKeywordDefinition,
8
+ MacroKeywordDefinition,
9
+ FuncKeywordDefinition,
10
+ Vocabulary,
11
+ Schema,
12
+ SchemaObject,
13
+ AnySchemaObject,
14
+ AsyncSchema,
15
+ AnySchema,
16
+ ValidateFunction,
17
+ AsyncValidateFunction,
18
+ AnyValidateFunction,
19
+ ErrorObject,
20
+ ErrorNoParams,
21
+ } from "./types"
22
+
23
+ export {SchemaCxt, SchemaObjCxt} from "./compile"
24
+ export interface Plugin<Opts> {
25
+ (ajv: Ajv, options?: Opts): Ajv
26
+ [prop: string]: any
27
+ }
28
+
29
+ export {KeywordCxt} from "./compile/validate"
30
+ export {DefinedError} from "./vocabularies/errors"
31
+ export {JSONType} from "./compile/rules"
32
+ export {JSONSchemaType} from "./types/json-schema"
33
+ export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
34
+ export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
35
+
36
+ import type {
37
+ Schema,
38
+ AnySchema,
39
+ AnySchemaObject,
40
+ SchemaObject,
41
+ AsyncSchema,
42
+ Vocabulary,
43
+ KeywordDefinition,
44
+ AddedKeywordDefinition,
45
+ AnyValidateFunction,
46
+ ValidateFunction,
47
+ AsyncValidateFunction,
48
+ ErrorObject,
49
+ Format,
50
+ AddedFormat,
51
+ RegExpEngine,
52
+ } from "./types"
53
+ import type {JSONSchemaType} from "./types/json-schema"
54
+ import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
55
+ import ValidationError from "./runtime/validation_error"
56
+ import MissingRefError from "./compile/ref_error"
57
+ import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules"
58
+ import {SchemaEnv, compileSchema, resolveSchema} from "./compile"
59
+ import {Code, ValueScope} from "./compile/codegen"
60
+ import {normalizeId, getSchemaRefs} from "./compile/resolve"
61
+ import {getJSONTypes} from "./compile/validate/dataType"
62
+ import {eachItem} from "./compile/util"
63
+
64
+ import * as $dataRefSchema from "./refs/data.json"
65
+
66
+ const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags)
67
+ defaultRegExp.code = "new RegExp"
68
+
69
+ const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"]
70
+ const EXT_SCOPE_NAMES = new Set([
71
+ "validate",
72
+ "serialize",
73
+ "parse",
74
+ "wrapper",
75
+ "root",
76
+ "schema",
77
+ "keyword",
78
+ "pattern",
79
+ "formats",
80
+ "validate$data",
81
+ "func",
82
+ "obj",
83
+ "Error",
84
+ ])
85
+
86
+ export type Options = CurrentOptions & DeprecatedOptions
87
+
88
+ export interface CurrentOptions {
89
+ // strict mode options (NEW)
90
+ strict?: boolean | "log"
91
+ strictSchema?: boolean | "log"
92
+ strictNumbers?: boolean | "log"
93
+ strictTypes?: boolean | "log"
94
+ strictTuples?: boolean | "log"
95
+ strictRequired?: boolean | "log"
96
+ allowMatchingProperties?: boolean // disables a strict mode restriction
97
+ allowUnionTypes?: boolean
98
+ validateFormats?: boolean
99
+ // validation and reporting options:
100
+ $data?: boolean
101
+ allErrors?: boolean
102
+ verbose?: boolean
103
+ discriminator?: boolean
104
+ unicodeRegExp?: boolean
105
+ timestamp?: "string" | "date" // JTD only
106
+ parseDate?: boolean // JTD only
107
+ allowDate?: boolean // JTD only
108
+ $comment?:
109
+ | true
110
+ | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown)
111
+ formats?: {[Name in string]?: Format}
112
+ keywords?: Vocabulary
113
+ schemas?: AnySchema[] | {[Key in string]?: AnySchema}
114
+ logger?: Logger | false
115
+ loadSchema?: (uri: string) => Promise<AnySchemaObject>
116
+ // options to modify validated data:
117
+ removeAdditional?: boolean | "all" | "failing"
118
+ useDefaults?: boolean | "empty"
119
+ coerceTypes?: boolean | "array"
120
+ // advanced options:
121
+ next?: boolean // NEW
122
+ unevaluated?: boolean // NEW
123
+ dynamicRef?: boolean // NEW
124
+ schemaId?: "id" | "$id"
125
+ jtd?: boolean // NEW
126
+ meta?: SchemaObject | boolean
127
+ defaultMeta?: string | AnySchemaObject
128
+ validateSchema?: boolean | "log"
129
+ addUsedSchema?: boolean
130
+ inlineRefs?: boolean | number
131
+ passContext?: boolean
132
+ loopRequired?: number
133
+ loopEnum?: number // NEW
134
+ ownProperties?: boolean
135
+ multipleOfPrecision?: number
136
+ int32range?: boolean // JTD only
137
+ messages?: boolean
138
+ code?: CodeOptions // NEW
139
+ }
140
+
141
+ export interface CodeOptions {
142
+ es5?: boolean
143
+ lines?: boolean
144
+ optimize?: boolean | number
145
+ formats?: Code // code to require (or construct) map of available formats - for standalone code
146
+ source?: boolean
147
+ process?: (code: string, schema?: SchemaEnv) => string
148
+ regExp?: RegExpEngine
149
+ }
150
+
151
+ interface InstanceCodeOptions extends CodeOptions {
152
+ regExp: RegExpEngine
153
+ optimize: number
154
+ }
155
+
156
+ interface DeprecatedOptions {
157
+ /** @deprecated */
158
+ ignoreKeywordsWithRef?: boolean
159
+ /** @deprecated */
160
+ jsPropertySyntax?: boolean // added instead of jsonPointers
161
+ /** @deprecated */
162
+ unicode?: boolean
163
+ }
164
+
165
+ interface RemovedOptions {
166
+ format?: boolean
167
+ errorDataPath?: "object" | "property"
168
+ nullable?: boolean // "nullable" keyword is supported by default
169
+ jsonPointers?: boolean
170
+ extendRefs?: true | "ignore" | "fail"
171
+ missingRefs?: true | "ignore" | "fail"
172
+ processCode?: (code: string, schema?: SchemaEnv) => string
173
+ sourceCode?: boolean
174
+ strictDefaults?: boolean
175
+ strictKeywords?: boolean
176
+ uniqueItems?: boolean
177
+ unknownFormats?: true | string[] | "ignore"
178
+ cache?: any
179
+ serialize?: (schema: AnySchema) => unknown
180
+ ajvErrors?: boolean
181
+ }
182
+
183
+ type OptionsInfo<T extends RemovedOptions | DeprecatedOptions> = {
184
+ [K in keyof T]-?: string | undefined
185
+ }
186
+
187
+ const removedOptions: OptionsInfo<RemovedOptions> = {
188
+ errorDataPath: "",
189
+ format: "`validateFormats: false` can be used instead.",
190
+ nullable: '"nullable" keyword is supported by default.',
191
+ jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
192
+ extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
193
+ missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
194
+ processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
195
+ sourceCode: "Use option `code: {source: true}`",
196
+ strictDefaults: "It is default now, see option `strict`.",
197
+ strictKeywords: "It is default now, see option `strict`.",
198
+ uniqueItems: '"uniqueItems" keyword is always validated.',
199
+ unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
200
+ cache: "Map is used as cache, schema object as key.",
201
+ serialize: "Map is used as cache, schema object as key.",
202
+ ajvErrors: "It is default now.",
203
+ }
204
+
205
+ const deprecatedOptions: OptionsInfo<DeprecatedOptions> = {
206
+ ignoreKeywordsWithRef: "",
207
+ jsPropertySyntax: "",
208
+ unicode: '"minLength"/"maxLength" account for unicode characters by default.',
209
+ }
210
+
211
+ type RequiredInstanceOptions = {
212
+ [K in
213
+ | "strictSchema"
214
+ | "strictNumbers"
215
+ | "strictTypes"
216
+ | "strictTuples"
217
+ | "strictRequired"
218
+ | "inlineRefs"
219
+ | "loopRequired"
220
+ | "loopEnum"
221
+ | "meta"
222
+ | "messages"
223
+ | "schemaId"
224
+ | "addUsedSchema"
225
+ | "validateSchema"
226
+ | "validateFormats"
227
+ | "int32range"
228
+ | "unicodeRegExp"]: NonNullable<Options[K]>
229
+ } & {code: InstanceCodeOptions}
230
+
231
+ export type InstanceOptions = Options & RequiredInstanceOptions
232
+
233
+ const MAX_EXPRESSION = 200
234
+
235
+ // eslint-disable-next-line complexity
236
+ function requiredOptions(o: Options): RequiredInstanceOptions {
237
+ const s = o.strict
238
+ const _optz = o.code?.optimize
239
+ const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0
240
+ const regExp = o.code?.regExp ?? defaultRegExp
241
+ return {
242
+ strictSchema: o.strictSchema ?? s ?? true,
243
+ strictNumbers: o.strictNumbers ?? s ?? true,
244
+ strictTypes: o.strictTypes ?? s ?? "log",
245
+ strictTuples: o.strictTuples ?? s ?? "log",
246
+ strictRequired: o.strictRequired ?? s ?? false,
247
+ code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp},
248
+ loopRequired: o.loopRequired ?? MAX_EXPRESSION,
249
+ loopEnum: o.loopEnum ?? MAX_EXPRESSION,
250
+ meta: o.meta ?? true,
251
+ messages: o.messages ?? true,
252
+ inlineRefs: o.inlineRefs ?? true,
253
+ schemaId: o.schemaId ?? "$id",
254
+ addUsedSchema: o.addUsedSchema ?? true,
255
+ validateSchema: o.validateSchema ?? true,
256
+ validateFormats: o.validateFormats ?? true,
257
+ unicodeRegExp: o.unicodeRegExp ?? true,
258
+ int32range: o.int32range ?? true,
259
+ }
260
+ }
261
+
262
+ export interface Logger {
263
+ log(...args: unknown[]): unknown
264
+ warn(...args: unknown[]): unknown
265
+ error(...args: unknown[]): unknown
266
+ }
267
+
268
+ export default class Ajv {
269
+ opts: InstanceOptions
270
+ errors?: ErrorObject[] | null // errors from the last validation
271
+ logger: Logger
272
+ // shared external scope values for compiled functions
273
+ readonly scope: ValueScope
274
+ readonly schemas: {[Key in string]?: SchemaEnv} = {}
275
+ readonly refs: {[Ref in string]?: SchemaEnv | string} = {}
276
+ readonly formats: {[Name in string]?: AddedFormat} = {}
277
+ readonly RULES: ValidationRules
278
+ readonly _compilations: Set<SchemaEnv> = new Set()
279
+ private readonly _loading: {[Ref in string]?: Promise<AnySchemaObject>} = {}
280
+ private readonly _cache: Map<AnySchema, SchemaEnv> = new Map()
281
+ private readonly _metaOpts: InstanceOptions
282
+
283
+ static ValidationError = ValidationError
284
+ static MissingRefError = MissingRefError
285
+
286
+ constructor(opts: Options = {}) {
287
+ opts = this.opts = {...opts, ...requiredOptions(opts)}
288
+ const {es5, lines} = this.opts.code
289
+
290
+ this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines})
291
+ this.logger = getLogger(opts.logger)
292
+ const formatOpt = opts.validateFormats
293
+ opts.validateFormats = false
294
+
295
+ this.RULES = getRules()
296
+ checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED")
297
+ checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn")
298
+ this._metaOpts = getMetaSchemaOptions.call(this)
299
+
300
+ if (opts.formats) addInitialFormats.call(this)
301
+ this._addVocabularies()
302
+ this._addDefaultMetaSchema()
303
+ if (opts.keywords) addInitialKeywords.call(this, opts.keywords)
304
+ if (typeof opts.meta == "object") this.addMetaSchema(opts.meta)
305
+ addInitialSchemas.call(this)
306
+ opts.validateFormats = formatOpt
307
+ }
308
+
309
+ _addVocabularies(): void {
310
+ this.addKeyword("$async")
311
+ }
312
+
313
+ _addDefaultMetaSchema(): void {
314
+ const {$data, meta, schemaId} = this.opts
315
+ let _dataRefSchema: SchemaObject = $dataRefSchema
316
+ if (schemaId === "id") {
317
+ _dataRefSchema = {...$dataRefSchema}
318
+ _dataRefSchema.id = _dataRefSchema.$id
319
+ delete _dataRefSchema.$id
320
+ }
321
+ if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false)
322
+ }
323
+
324
+ defaultMeta(): string | AnySchemaObject | undefined {
325
+ const {meta, schemaId} = this.opts
326
+ return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined)
327
+ }
328
+
329
+ // Validate data using schema
330
+ // AnySchema will be compiled and cached using schema itself as a key for Map
331
+ validate(schema: Schema | string, data: unknown): boolean
332
+ validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>
333
+ validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T
334
+ // Separated for type inference to work
335
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
336
+ validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T
337
+ // This overload is only intended for typescript inference, the first
338
+ // argument prevents manual type annotation from matching this overload
339
+ validate<N extends never, T extends SomeJTDSchemaType>(
340
+ schema: T,
341
+ data: unknown
342
+ ): data is JTDDataType<T>
343
+ validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>
344
+ validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>
345
+ validate<T>(
346
+ schemaKeyRef: AnySchema | string, // key, ref or schema object
347
+ data: unknown | T // to be validated
348
+ ): boolean | Promise<T> {
349
+ let v: AnyValidateFunction | undefined
350
+ if (typeof schemaKeyRef == "string") {
351
+ v = this.getSchema<T>(schemaKeyRef)
352
+ if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`)
353
+ } else {
354
+ v = this.compile<T>(schemaKeyRef)
355
+ }
356
+
357
+ const valid = v(data)
358
+ if (!("$async" in v)) this.errors = v.errors
359
+ return valid
360
+ }
361
+
362
+ // Create validation function for passed schema
363
+ // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords.
364
+ compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>
365
+ // Separated for type inference to work
366
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
367
+ compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>
368
+ // This overload is only intended for typescript inference, the first
369
+ // argument prevents manual type annotation from matching this overload
370
+ compile<N extends never, T extends SomeJTDSchemaType>(
371
+ schema: T,
372
+ _meta?: boolean
373
+ ): ValidateFunction<JTDDataType<T>>
374
+ compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>
375
+ compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>
376
+ compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T> {
377
+ const sch = this._addSchema(schema, _meta)
378
+ return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T>
379
+ }
380
+
381
+ // Creates validating function for passed schema with asynchronous loading of missing schemas.
382
+ // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
383
+ // TODO allow passing schema URI
384
+ // meta - optional true to compile meta-schema
385
+ compileAsync<T = unknown>(
386
+ schema: SchemaObject | JSONSchemaType<T>,
387
+ _meta?: boolean
388
+ ): Promise<ValidateFunction<T>>
389
+ // Separated for type inference to work
390
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
391
+ compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>
392
+ compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>
393
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
394
+ compileAsync<T = unknown>(
395
+ schema: AnySchemaObject,
396
+ meta?: boolean
397
+ ): Promise<AnyValidateFunction<T>>
398
+ compileAsync<T = unknown>(
399
+ schema: AnySchemaObject,
400
+ meta?: boolean
401
+ ): Promise<AnyValidateFunction<T>> {
402
+ if (typeof this.opts.loadSchema != "function") {
403
+ throw new Error("options.loadSchema should be a function")
404
+ }
405
+ const {loadSchema} = this.opts
406
+ return runCompileAsync.call(this, schema, meta)
407
+
408
+ async function runCompileAsync(
409
+ this: Ajv,
410
+ _schema: AnySchemaObject,
411
+ _meta?: boolean
412
+ ): Promise<AnyValidateFunction> {
413
+ await loadMetaSchema.call(this, _schema.$schema)
414
+ const sch = this._addSchema(_schema, _meta)
415
+ return sch.validate || _compileAsync.call(this, sch)
416
+ }
417
+
418
+ async function loadMetaSchema(this: Ajv, $ref?: string): Promise<void> {
419
+ if ($ref && !this.getSchema($ref)) {
420
+ await runCompileAsync.call(this, {$ref}, true)
421
+ }
422
+ }
423
+
424
+ async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise<AnyValidateFunction> {
425
+ try {
426
+ return this._compileSchemaEnv(sch)
427
+ } catch (e) {
428
+ if (!(e instanceof MissingRefError)) throw e
429
+ checkLoaded.call(this, e)
430
+ await loadMissingSchema.call(this, e.missingSchema)
431
+ return _compileAsync.call(this, sch)
432
+ }
433
+ }
434
+
435
+ function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void {
436
+ if (this.refs[ref]) {
437
+ throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`)
438
+ }
439
+ }
440
+
441
+ async function loadMissingSchema(this: Ajv, ref: string): Promise<void> {
442
+ const _schema = await _loadSchema.call(this, ref)
443
+ if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema)
444
+ if (!this.refs[ref]) this.addSchema(_schema, ref, meta)
445
+ }
446
+
447
+ async function _loadSchema(this: Ajv, ref: string): Promise<AnySchemaObject> {
448
+ const p = this._loading[ref]
449
+ if (p) return p
450
+ try {
451
+ return await (this._loading[ref] = loadSchema(ref))
452
+ } finally {
453
+ delete this._loading[ref]
454
+ }
455
+ }
456
+ }
457
+
458
+ // Adds schema to the instance
459
+ addSchema(
460
+ schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored
461
+ key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
462
+ _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
463
+ _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
464
+ ): Ajv {
465
+ if (Array.isArray(schema)) {
466
+ for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema)
467
+ return this
468
+ }
469
+ let id: string | undefined
470
+ if (typeof schema === "object") {
471
+ const {schemaId} = this.opts
472
+ id = schema[schemaId]
473
+ if (id !== undefined && typeof id != "string") {
474
+ throw new Error(`schema ${schemaId} must be string`)
475
+ }
476
+ }
477
+ key = normalizeId(key || id)
478
+ this._checkUnique(key)
479
+ this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true)
480
+ return this
481
+ }
482
+
483
+ // Add schema that will be used to validate other schemas
484
+ // options in META_IGNORE_OPTIONS are alway set to false
485
+ addMetaSchema(
486
+ schema: AnySchemaObject,
487
+ key?: string, // schema key
488
+ _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
489
+ ): Ajv {
490
+ this.addSchema(schema, key, true, _validateSchema)
491
+ return this
492
+ }
493
+
494
+ // Validate schema against its meta-schema
495
+ validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown> {
496
+ if (typeof schema == "boolean") return true
497
+ let $schema: string | AnySchemaObject | undefined
498
+ $schema = schema.$schema
499
+ if ($schema !== undefined && typeof $schema != "string") {
500
+ throw new Error("$schema must be a string")
501
+ }
502
+ $schema = $schema || this.opts.defaultMeta || this.defaultMeta()
503
+ if (!$schema) {
504
+ this.logger.warn("meta-schema not available")
505
+ this.errors = null
506
+ return true
507
+ }
508
+ const valid = this.validate($schema, schema)
509
+ if (!valid && throwOrLogError) {
510
+ const message = "schema is invalid: " + this.errorsText()
511
+ if (this.opts.validateSchema === "log") this.logger.error(message)
512
+ else throw new Error(message)
513
+ }
514
+ return valid
515
+ }
516
+
517
+ // Get compiled schema by `key` or `ref`.
518
+ // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
519
+ getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {
520
+ let sch
521
+ while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch
522
+ if (sch === undefined) {
523
+ const {schemaId} = this.opts
524
+ const root = new SchemaEnv({schema: {}, schemaId})
525
+ sch = resolveSchema.call(this, root, keyRef)
526
+ if (!sch) return
527
+ this.refs[keyRef] = sch
528
+ }
529
+ return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T> | undefined
530
+ }
531
+
532
+ // Remove cached schema(s).
533
+ // If no parameter is passed all schemas but meta-schemas are removed.
534
+ // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
535
+ // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
536
+ removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv {
537
+ if (schemaKeyRef instanceof RegExp) {
538
+ this._removeAllSchemas(this.schemas, schemaKeyRef)
539
+ this._removeAllSchemas(this.refs, schemaKeyRef)
540
+ return this
541
+ }
542
+ switch (typeof schemaKeyRef) {
543
+ case "undefined":
544
+ this._removeAllSchemas(this.schemas)
545
+ this._removeAllSchemas(this.refs)
546
+ this._cache.clear()
547
+ return this
548
+ case "string": {
549
+ const sch = getSchEnv.call(this, schemaKeyRef)
550
+ if (typeof sch == "object") this._cache.delete(sch.schema)
551
+ delete this.schemas[schemaKeyRef]
552
+ delete this.refs[schemaKeyRef]
553
+ return this
554
+ }
555
+ case "object": {
556
+ const cacheKey = schemaKeyRef
557
+ this._cache.delete(cacheKey)
558
+ let id = schemaKeyRef[this.opts.schemaId]
559
+ if (id) {
560
+ id = normalizeId(id)
561
+ delete this.schemas[id]
562
+ delete this.refs[id]
563
+ }
564
+ return this
565
+ }
566
+ default:
567
+ throw new Error("ajv.removeSchema: invalid parameter")
568
+ }
569
+ }
570
+
571
+ // add "vocabulary" - a collection of keywords
572
+ addVocabulary(definitions: Vocabulary): Ajv {
573
+ for (const def of definitions) this.addKeyword(def)
574
+ return this
575
+ }
576
+
577
+ addKeyword(
578
+ kwdOrDef: string | KeywordDefinition,
579
+ def?: KeywordDefinition // deprecated
580
+ ): Ajv {
581
+ let keyword: string | string[]
582
+ if (typeof kwdOrDef == "string") {
583
+ keyword = kwdOrDef
584
+ if (typeof def == "object") {
585
+ this.logger.warn("these parameters are deprecated, see docs for addKeyword")
586
+ def.keyword = keyword
587
+ }
588
+ } else if (typeof kwdOrDef == "object" && def === undefined) {
589
+ def = kwdOrDef
590
+ keyword = def.keyword
591
+ if (Array.isArray(keyword) && !keyword.length) {
592
+ throw new Error("addKeywords: keyword must be string or non-empty array")
593
+ }
594
+ } else {
595
+ throw new Error("invalid addKeywords parameters")
596
+ }
597
+
598
+ checkKeyword.call(this, keyword, def)
599
+ if (!def) {
600
+ eachItem(keyword, (kwd) => addRule.call(this, kwd))
601
+ return this
602
+ }
603
+ keywordMetaschema.call(this, def)
604
+ const definition: AddedKeywordDefinition = {
605
+ ...def,
606
+ type: getJSONTypes(def.type),
607
+ schemaType: getJSONTypes(def.schemaType),
608
+ }
609
+ eachItem(
610
+ keyword,
611
+ definition.type.length === 0
612
+ ? (k) => addRule.call(this, k, definition)
613
+ : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))
614
+ )
615
+ return this
616
+ }
617
+
618
+ getKeyword(keyword: string): AddedKeywordDefinition | boolean {
619
+ const rule = this.RULES.all[keyword]
620
+ return typeof rule == "object" ? rule.definition : !!rule
621
+ }
622
+
623
+ // Remove keyword
624
+ removeKeyword(keyword: string): Ajv {
625
+ // TODO return type should be Ajv
626
+ const {RULES} = this
627
+ delete RULES.keywords[keyword]
628
+ delete RULES.all[keyword]
629
+ for (const group of RULES.rules) {
630
+ const i = group.rules.findIndex((rule) => rule.keyword === keyword)
631
+ if (i >= 0) group.rules.splice(i, 1)
632
+ }
633
+ return this
634
+ }
635
+
636
+ // Add format
637
+ addFormat(name: string, format: Format): Ajv {
638
+ if (typeof format == "string") format = new RegExp(format)
639
+ this.formats[name] = format
640
+ return this
641
+ }
642
+
643
+ errorsText(
644
+ errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors
645
+ {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar`
646
+ ): string {
647
+ if (!errors || errors.length === 0) return "No errors"
648
+ return errors
649
+ .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
650
+ .reduce((text, msg) => text + separator + msg)
651
+ }
652
+
653
+ $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject {
654
+ const rules = this.RULES.all
655
+ metaSchema = JSON.parse(JSON.stringify(metaSchema))
656
+ for (const jsonPointer of keywordsJsonPointers) {
657
+ const segments = jsonPointer.split("/").slice(1) // first segment is an empty string
658
+ let keywords = metaSchema
659
+ for (const seg of segments) keywords = keywords[seg] as AnySchemaObject
660
+
661
+ for (const key in rules) {
662
+ const rule = rules[key]
663
+ if (typeof rule != "object") continue
664
+ const {$data} = rule.definition
665
+ const schema = keywords[key] as AnySchemaObject | undefined
666
+ if ($data && schema) keywords[key] = schemaOrData(schema)
667
+ }
668
+ }
669
+
670
+ return metaSchema
671
+ }
672
+
673
+ private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void {
674
+ for (const keyRef in schemas) {
675
+ const sch = schemas[keyRef]
676
+ if (!regex || regex.test(keyRef)) {
677
+ if (typeof sch == "string") {
678
+ delete schemas[keyRef]
679
+ } else if (sch && !sch.meta) {
680
+ this._cache.delete(sch.schema)
681
+ delete schemas[keyRef]
682
+ }
683
+ }
684
+ }
685
+ }
686
+
687
+ _addSchema(
688
+ schema: AnySchema,
689
+ meta?: boolean,
690
+ baseId?: string,
691
+ validateSchema = this.opts.validateSchema,
692
+ addSchema = this.opts.addUsedSchema
693
+ ): SchemaEnv {
694
+ let id: string | undefined
695
+ const {schemaId} = this.opts
696
+ if (typeof schema == "object") {
697
+ id = schema[schemaId]
698
+ } else {
699
+ if (this.opts.jtd) throw new Error("schema must be object")
700
+ else if (typeof schema != "boolean") throw new Error("schema must be object or boolean")
701
+ }
702
+ let sch = this._cache.get(schema)
703
+ if (sch !== undefined) return sch
704
+
705
+ baseId = normalizeId(id || baseId)
706
+ const localRefs = getSchemaRefs.call(this, schema, baseId)
707
+ sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs})
708
+ this._cache.set(sch.schema, sch)
709
+ if (addSchema && !baseId.startsWith("#")) {
710
+ // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
711
+ if (baseId) this._checkUnique(baseId)
712
+ this.refs[baseId] = sch
713
+ }
714
+ if (validateSchema) this.validateSchema(schema, true)
715
+ return sch
716
+ }
717
+
718
+ private _checkUnique(id: string): void {
719
+ if (this.schemas[id] || this.refs[id]) {
720
+ throw new Error(`schema with key or id "${id}" already exists`)
721
+ }
722
+ }
723
+
724
+ private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction {
725
+ if (sch.meta) this._compileMetaSchema(sch)
726
+ else compileSchema.call(this, sch)
727
+
728
+ /* istanbul ignore if */
729
+ if (!sch.validate) throw new Error("ajv implementation error")
730
+ return sch.validate
731
+ }
732
+
733
+ private _compileMetaSchema(sch: SchemaEnv): void {
734
+ const currentOpts = this.opts
735
+ this.opts = this._metaOpts
736
+ try {
737
+ compileSchema.call(this, sch)
738
+ } finally {
739
+ this.opts = currentOpts
740
+ }
741
+ }
742
+ }
743
+
744
+ export interface ErrorsTextOptions {
745
+ separator?: string
746
+ dataVar?: string
747
+ }
748
+
749
+ function checkOptions(
750
+ this: Ajv,
751
+ checkOpts: OptionsInfo<RemovedOptions | DeprecatedOptions>,
752
+ options: Options & RemovedOptions,
753
+ msg: string,
754
+ log: "warn" | "error" = "error"
755
+ ): void {
756
+ for (const key in checkOpts) {
757
+ const opt = key as keyof typeof checkOpts
758
+ if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`)
759
+ }
760
+ }
761
+
762
+ function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined {
763
+ keyRef = normalizeId(keyRef) // TODO tests fail without this line
764
+ return this.schemas[keyRef] || this.refs[keyRef]
765
+ }
766
+
767
+ function addInitialSchemas(this: Ajv): void {
768
+ const optsSchemas = this.opts.schemas
769
+ if (!optsSchemas) return
770
+ if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas)
771
+ else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key)
772
+ }
773
+
774
+ function addInitialFormats(this: Ajv): void {
775
+ for (const name in this.opts.formats) {
776
+ const format = this.opts.formats[name]
777
+ if (format) this.addFormat(name, format)
778
+ }
779
+ }
780
+
781
+ function addInitialKeywords(
782
+ this: Ajv,
783
+ defs: Vocabulary | {[K in string]?: KeywordDefinition}
784
+ ): void {
785
+ if (Array.isArray(defs)) {
786
+ this.addVocabulary(defs)
787
+ return
788
+ }
789
+ this.logger.warn("keywords option as map is deprecated, pass array")
790
+ for (const keyword in defs) {
791
+ const def = defs[keyword] as KeywordDefinition
792
+ if (!def.keyword) def.keyword = keyword
793
+ this.addKeyword(def)
794
+ }
795
+ }
796
+
797
+ function getMetaSchemaOptions(this: Ajv): InstanceOptions {
798
+ const metaOpts = {...this.opts}
799
+ for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]
800
+ return metaOpts
801
+ }
802
+
803
+ const noLogs = {log() {}, warn() {}, error() {}}
804
+
805
+ function getLogger(logger?: Partial<Logger> | false): Logger {
806
+ if (logger === false) return noLogs
807
+ if (logger === undefined) return console
808
+ if (logger.log && logger.warn && logger.error) return logger as Logger
809
+ throw new Error("logger must implement log, warn and error methods")
810
+ }
811
+
812
+ const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i
813
+
814
+ function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void {
815
+ const {RULES} = this
816
+ eachItem(keyword, (kwd) => {
817
+ if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`)
818
+ if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`)
819
+ })
820
+ if (!def) return
821
+ if (def.$data && !("code" in def || "validate" in def)) {
822
+ throw new Error('$data keyword must have "code" or "validate" function')
823
+ }
824
+ }
825
+
826
+ function addRule(
827
+ this: Ajv,
828
+ keyword: string,
829
+ definition?: AddedKeywordDefinition,
830
+ dataType?: JSONType
831
+ ): void {
832
+ const post = definition?.post
833
+ if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"')
834
+ const {RULES} = this
835
+ let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType)
836
+ if (!ruleGroup) {
837
+ ruleGroup = {type: dataType, rules: []}
838
+ RULES.rules.push(ruleGroup)
839
+ }
840
+ RULES.keywords[keyword] = true
841
+ if (!definition) return
842
+
843
+ const rule: Rule = {
844
+ keyword,
845
+ definition: {
846
+ ...definition,
847
+ type: getJSONTypes(definition.type),
848
+ schemaType: getJSONTypes(definition.schemaType),
849
+ },
850
+ }
851
+ if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before)
852
+ else ruleGroup.rules.push(rule)
853
+ RULES.all[keyword] = rule
854
+ definition.implements?.forEach((kwd) => this.addKeyword(kwd))
855
+ }
856
+
857
+ function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void {
858
+ const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before)
859
+ if (i >= 0) {
860
+ ruleGroup.rules.splice(i, 0, rule)
861
+ } else {
862
+ ruleGroup.rules.push(rule)
863
+ this.logger.warn(`rule ${before} is not defined`)
864
+ }
865
+ }
866
+
867
+ function keywordMetaschema(this: Ajv, def: KeywordDefinition): void {
868
+ let {metaSchema} = def
869
+ if (metaSchema === undefined) return
870
+ if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema)
871
+ def.validateSchema = this.compile(metaSchema, true)
872
+ }
873
+
874
+ const $dataRef = {
875
+ $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
876
+ }
877
+
878
+ function schemaOrData(schema: AnySchema): AnySchemaObject {
879
+ return {anyOf: [schema, $dataRef]}
880
+ }