reliant-type 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1305 -0
  3. package/dist/cjs/constants/SECURITY_CONSTANTS.js +49 -0
  4. package/dist/cjs/constants/SECURITY_CONSTANTS.js.map +1 -0
  5. package/dist/cjs/constants/VALIDATION_CONSTANTS.js +103 -0
  6. package/dist/cjs/constants/VALIDATION_CONSTANTS.js.map +1 -0
  7. package/dist/cjs/core/schema/extensions/SmartInference.js +200 -0
  8. package/dist/cjs/core/schema/extensions/SmartInference.js.map +1 -0
  9. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/Docs.js +100 -0
  10. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/Docs.js.map +1 -0
  11. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js +192 -0
  12. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js.map +1 -0
  13. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js +174 -0
  14. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js.map +1 -0
  15. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js +54 -0
  16. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js.map +1 -0
  17. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js +50 -0
  18. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js.map +1 -0
  19. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/index.js +15 -0
  20. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/index.js.map +1 -0
  21. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js +70 -0
  22. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js.map +1 -0
  23. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js +40 -0
  24. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js.map +1 -0
  25. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js +19 -0
  26. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js.map +1 -0
  27. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js +20 -0
  28. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js.map +1 -0
  29. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js +49 -0
  30. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js.map +1 -0
  31. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/index.js +98 -0
  32. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/index.js.map +1 -0
  33. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/FormValidator.js +85 -0
  34. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/FormValidator.js.map +1 -0
  35. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/LiveValidator.js +133 -0
  36. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/LiveValidator.js.map +1 -0
  37. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/StreamValidator.js +351 -0
  38. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/StreamValidator.js.map +1 -0
  39. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/index.js +109 -0
  40. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/index.js.map +1 -0
  41. package/dist/cjs/core/schema/extensions/index.js +61 -0
  42. package/dist/cjs/core/schema/extensions/index.js.map +1 -0
  43. package/dist/cjs/core/schema/extensions/mods/index.js +51 -0
  44. package/dist/cjs/core/schema/extensions/mods/index.js.map +1 -0
  45. package/dist/cjs/core/schema/extensions/mods/openapi-converter.js +227 -0
  46. package/dist/cjs/core/schema/extensions/mods/openapi-converter.js.map +1 -0
  47. package/dist/cjs/core/schema/extensions/mods/typescript-generator.js +287 -0
  48. package/dist/cjs/core/schema/extensions/mods/typescript-generator.js.map +1 -0
  49. package/dist/cjs/core/schema/extensions/mods/validation-engine.js +224 -0
  50. package/dist/cjs/core/schema/extensions/mods/validation-engine.js.map +1 -0
  51. package/dist/cjs/core/schema/mode/interfaces/Interface.js +277 -0
  52. package/dist/cjs/core/schema/mode/interfaces/Interface.js.map +1 -0
  53. package/dist/cjs/core/schema/mode/interfaces/InterfaceSchema.js +1431 -0
  54. package/dist/cjs/core/schema/mode/interfaces/InterfaceSchema.js.map +1 -0
  55. package/dist/cjs/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js +520 -0
  56. package/dist/cjs/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js.map +1 -0
  57. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js +624 -0
  58. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js.map +1 -0
  59. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js +811 -0
  60. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js.map +1 -0
  61. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js +599 -0
  62. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js.map +1 -0
  63. package/dist/cjs/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js +89 -0
  64. package/dist/cjs/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js.map +1 -0
  65. package/dist/cjs/core/schema/mode/interfaces/errors/ErrorHandler.js +356 -0
  66. package/dist/cjs/core/schema/mode/interfaces/errors/ErrorHandler.js.map +1 -0
  67. package/dist/cjs/core/schema/mode/interfaces/errors/types/errors.type.js +80 -0
  68. package/dist/cjs/core/schema/mode/interfaces/errors/types/errors.type.js.map +1 -0
  69. package/dist/cjs/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js +778 -0
  70. package/dist/cjs/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js.map +1 -0
  71. package/dist/cjs/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js +523 -0
  72. package/dist/cjs/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js.map +1 -0
  73. package/dist/cjs/core/schema/mode/interfaces/typescript/ConditionalTypes.js +681 -0
  74. package/dist/cjs/core/schema/mode/interfaces/typescript/ConditionalTypes.js.map +1 -0
  75. package/dist/cjs/core/schema/mode/interfaces/typescript/IDESupport.js +430 -0
  76. package/dist/cjs/core/schema/mode/interfaces/typescript/IDESupport.js.map +1 -0
  77. package/dist/cjs/core/schema/mode/interfaces/typescript/TypeInference.js +225 -0
  78. package/dist/cjs/core/schema/mode/interfaces/typescript/TypeInference.js.map +1 -0
  79. package/dist/cjs/core/schema/mode/interfaces/typescript/index.js +44 -0
  80. package/dist/cjs/core/schema/mode/interfaces/typescript/index.js.map +1 -0
  81. package/dist/cjs/core/schema/mode/interfaces/validators/ConstraintParser.js +1134 -0
  82. package/dist/cjs/core/schema/mode/interfaces/validators/ConstraintParser.js.map +1 -0
  83. package/dist/cjs/core/schema/mode/interfaces/validators/TypeGuards.js +256 -0
  84. package/dist/cjs/core/schema/mode/interfaces/validators/TypeGuards.js.map +1 -0
  85. package/dist/cjs/core/schema/mode/interfaces/validators/TypeValidators.js +429 -0
  86. package/dist/cjs/core/schema/mode/interfaces/validators/TypeValidators.js.map +1 -0
  87. package/dist/cjs/core/schema/mode/interfaces/validators/UnionCache.js +404 -0
  88. package/dist/cjs/core/schema/mode/interfaces/validators/UnionCache.js.map +1 -0
  89. package/dist/cjs/core/schema/mode/interfaces/validators/ValidationHelpers.js +851 -0
  90. package/dist/cjs/core/schema/mode/interfaces/validators/ValidationHelpers.js.map +1 -0
  91. package/dist/cjs/core/schema/mode/interfaces/validators/mods/passValidator.js +262 -0
  92. package/dist/cjs/core/schema/mode/interfaces/validators/mods/passValidator.js.map +1 -0
  93. package/dist/cjs/core/schema/mode/interfaces/validators/mods/securityValidator.js +887 -0
  94. package/dist/cjs/core/schema/mode/interfaces/validators/mods/securityValidator.js.map +1 -0
  95. package/dist/cjs/core/schema/mode/interfaces/validators/mods/urlValidation.js +191 -0
  96. package/dist/cjs/core/schema/mode/interfaces/validators/mods/urlValidation.js.map +1 -0
  97. package/dist/cjs/core/schema/optimization/ObjectValidationCache.js +462 -0
  98. package/dist/cjs/core/schema/optimization/ObjectValidationCache.js.map +1 -0
  99. package/dist/cjs/core/schema/optimization/PerformanceMonitor.js +773 -0
  100. package/dist/cjs/core/schema/optimization/PerformanceMonitor.js.map +1 -0
  101. package/dist/cjs/core/schema/optimization/SchemaCompiler.js +600 -0
  102. package/dist/cjs/core/schema/optimization/SchemaCompiler.js.map +1 -0
  103. package/dist/cjs/core/types/ValidatorTypes.js +70 -0
  104. package/dist/cjs/core/types/ValidatorTypes.js.map +1 -0
  105. package/dist/cjs/core/types/parser.type.js +12 -0
  106. package/dist/cjs/core/types/parser.type.js.map +1 -0
  107. package/dist/cjs/core/utils/Make.js +61 -0
  108. package/dist/cjs/core/utils/Make.js.map +1 -0
  109. package/dist/cjs/core/utils/Mod.js +1033 -0
  110. package/dist/cjs/core/utils/Mod.js.map +1 -0
  111. package/dist/cjs/core/utils/UrlArgs.js +102 -0
  112. package/dist/cjs/core/utils/UrlArgs.js.map +1 -0
  113. package/dist/cjs/core/utils/arrayToEnum.js +18 -0
  114. package/dist/cjs/core/utils/arrayToEnum.js.map +1 -0
  115. package/dist/cjs/core/utils/createUrlArgsEnumFArray.js +13 -0
  116. package/dist/cjs/core/utils/createUrlArgsEnumFArray.js.map +1 -0
  117. package/dist/cjs/core/utils/securityHelpers.js +215 -0
  118. package/dist/cjs/core/utils/securityHelpers.js.map +1 -0
  119. package/dist/cjs/core/utils/securityValidatorHelpers.js +65 -0
  120. package/dist/cjs/core/utils/securityValidatorHelpers.js.map +1 -0
  121. package/dist/cjs/index.js +31 -0
  122. package/dist/cjs/index.js.map +1 -0
  123. package/dist/cjs/package.json +3 -0
  124. package/dist/esm/constants/SECURITY_CONSTANTS.js +47 -0
  125. package/dist/esm/constants/SECURITY_CONSTANTS.js.map +1 -0
  126. package/dist/esm/constants/VALIDATION_CONSTANTS.js +98 -0
  127. package/dist/esm/constants/VALIDATION_CONSTANTS.js.map +1 -0
  128. package/dist/esm/core/schema/extensions/SmartInference.js +197 -0
  129. package/dist/esm/core/schema/extensions/SmartInference.js.map +1 -0
  130. package/dist/esm/core/schema/extensions/components/AutoDocumentation/Docs.js +98 -0
  131. package/dist/esm/core/schema/extensions/components/AutoDocumentation/Docs.js.map +1 -0
  132. package/dist/esm/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js +190 -0
  133. package/dist/esm/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js.map +1 -0
  134. package/dist/esm/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js +172 -0
  135. package/dist/esm/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js.map +1 -0
  136. package/dist/esm/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js +52 -0
  137. package/dist/esm/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js.map +1 -0
  138. package/dist/esm/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js +48 -0
  139. package/dist/esm/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js.map +1 -0
  140. package/dist/esm/core/schema/extensions/components/AutoDocumentation/index.js +12 -0
  141. package/dist/esm/core/schema/extensions/components/AutoDocumentation/index.js.map +1 -0
  142. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js +68 -0
  143. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js.map +1 -0
  144. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js +38 -0
  145. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js.map +1 -0
  146. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js +17 -0
  147. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js.map +1 -0
  148. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js +18 -0
  149. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js.map +1 -0
  150. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js +45 -0
  151. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js.map +1 -0
  152. package/dist/esm/core/schema/extensions/components/ConditionalValidation/index.js +92 -0
  153. package/dist/esm/core/schema/extensions/components/ConditionalValidation/index.js.map +1 -0
  154. package/dist/esm/core/schema/extensions/components/RealtimeValidation/FormValidator.js +83 -0
  155. package/dist/esm/core/schema/extensions/components/RealtimeValidation/FormValidator.js.map +1 -0
  156. package/dist/esm/core/schema/extensions/components/RealtimeValidation/LiveValidator.js +131 -0
  157. package/dist/esm/core/schema/extensions/components/RealtimeValidation/LiveValidator.js.map +1 -0
  158. package/dist/esm/core/schema/extensions/components/RealtimeValidation/StreamValidator.js +349 -0
  159. package/dist/esm/core/schema/extensions/components/RealtimeValidation/StreamValidator.js.map +1 -0
  160. package/dist/esm/core/schema/extensions/components/RealtimeValidation/index.js +103 -0
  161. package/dist/esm/core/schema/extensions/components/RealtimeValidation/index.js.map +1 -0
  162. package/dist/esm/core/schema/extensions/index.js +53 -0
  163. package/dist/esm/core/schema/extensions/index.js.map +1 -0
  164. package/dist/esm/core/schema/extensions/mods/index.js +47 -0
  165. package/dist/esm/core/schema/extensions/mods/index.js.map +1 -0
  166. package/dist/esm/core/schema/extensions/mods/openapi-converter.js +225 -0
  167. package/dist/esm/core/schema/extensions/mods/openapi-converter.js.map +1 -0
  168. package/dist/esm/core/schema/extensions/mods/typescript-generator.js +284 -0
  169. package/dist/esm/core/schema/extensions/mods/typescript-generator.js.map +1 -0
  170. package/dist/esm/core/schema/extensions/mods/validation-engine.js +222 -0
  171. package/dist/esm/core/schema/extensions/mods/validation-engine.js.map +1 -0
  172. package/dist/esm/core/schema/mode/interfaces/Interface.js +269 -0
  173. package/dist/esm/core/schema/mode/interfaces/Interface.js.map +1 -0
  174. package/dist/esm/core/schema/mode/interfaces/InterfaceSchema.js +1429 -0
  175. package/dist/esm/core/schema/mode/interfaces/InterfaceSchema.js.map +1 -0
  176. package/dist/esm/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js +518 -0
  177. package/dist/esm/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js.map +1 -0
  178. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js +620 -0
  179. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js.map +1 -0
  180. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js +809 -0
  181. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js.map +1 -0
  182. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js +597 -0
  183. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js.map +1 -0
  184. package/dist/esm/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js +89 -0
  185. package/dist/esm/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js.map +1 -0
  186. package/dist/esm/core/schema/mode/interfaces/errors/ErrorHandler.js +354 -0
  187. package/dist/esm/core/schema/mode/interfaces/errors/ErrorHandler.js.map +1 -0
  188. package/dist/esm/core/schema/mode/interfaces/errors/types/errors.type.js +80 -0
  189. package/dist/esm/core/schema/mode/interfaces/errors/types/errors.type.js.map +1 -0
  190. package/dist/esm/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js +776 -0
  191. package/dist/esm/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js.map +1 -0
  192. package/dist/esm/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js +521 -0
  193. package/dist/esm/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js.map +1 -0
  194. package/dist/esm/core/schema/mode/interfaces/typescript/ConditionalTypes.js +681 -0
  195. package/dist/esm/core/schema/mode/interfaces/typescript/ConditionalTypes.js.map +1 -0
  196. package/dist/esm/core/schema/mode/interfaces/typescript/IDESupport.js +428 -0
  197. package/dist/esm/core/schema/mode/interfaces/typescript/IDESupport.js.map +1 -0
  198. package/dist/esm/core/schema/mode/interfaces/typescript/TypeInference.js +223 -0
  199. package/dist/esm/core/schema/mode/interfaces/typescript/TypeInference.js.map +1 -0
  200. package/dist/esm/core/schema/mode/interfaces/typescript/index.js +35 -0
  201. package/dist/esm/core/schema/mode/interfaces/typescript/index.js.map +1 -0
  202. package/dist/esm/core/schema/mode/interfaces/validators/ConstraintParser.js +1132 -0
  203. package/dist/esm/core/schema/mode/interfaces/validators/ConstraintParser.js.map +1 -0
  204. package/dist/esm/core/schema/mode/interfaces/validators/TypeGuards.js +254 -0
  205. package/dist/esm/core/schema/mode/interfaces/validators/TypeGuards.js.map +1 -0
  206. package/dist/esm/core/schema/mode/interfaces/validators/TypeValidators.js +427 -0
  207. package/dist/esm/core/schema/mode/interfaces/validators/TypeValidators.js.map +1 -0
  208. package/dist/esm/core/schema/mode/interfaces/validators/UnionCache.js +400 -0
  209. package/dist/esm/core/schema/mode/interfaces/validators/UnionCache.js.map +1 -0
  210. package/dist/esm/core/schema/mode/interfaces/validators/ValidationHelpers.js +849 -0
  211. package/dist/esm/core/schema/mode/interfaces/validators/ValidationHelpers.js.map +1 -0
  212. package/dist/esm/core/schema/mode/interfaces/validators/mods/passValidator.js +260 -0
  213. package/dist/esm/core/schema/mode/interfaces/validators/mods/passValidator.js.map +1 -0
  214. package/dist/esm/core/schema/mode/interfaces/validators/mods/securityValidator.js +881 -0
  215. package/dist/esm/core/schema/mode/interfaces/validators/mods/securityValidator.js.map +1 -0
  216. package/dist/esm/core/schema/mode/interfaces/validators/mods/urlValidation.js +189 -0
  217. package/dist/esm/core/schema/mode/interfaces/validators/mods/urlValidation.js.map +1 -0
  218. package/dist/esm/core/schema/optimization/ObjectValidationCache.js +460 -0
  219. package/dist/esm/core/schema/optimization/ObjectValidationCache.js.map +1 -0
  220. package/dist/esm/core/schema/optimization/PerformanceMonitor.js +771 -0
  221. package/dist/esm/core/schema/optimization/PerformanceMonitor.js.map +1 -0
  222. package/dist/esm/core/schema/optimization/SchemaCompiler.js +598 -0
  223. package/dist/esm/core/schema/optimization/SchemaCompiler.js.map +1 -0
  224. package/dist/esm/core/types/ValidatorTypes.js +65 -0
  225. package/dist/esm/core/types/ValidatorTypes.js.map +1 -0
  226. package/dist/esm/core/types/parser.type.js +12 -0
  227. package/dist/esm/core/types/parser.type.js.map +1 -0
  228. package/dist/esm/core/utils/Make.js +59 -0
  229. package/dist/esm/core/utils/Make.js.map +1 -0
  230. package/dist/esm/core/utils/Mod.js +1031 -0
  231. package/dist/esm/core/utils/Mod.js.map +1 -0
  232. package/dist/esm/core/utils/UrlArgs.js +98 -0
  233. package/dist/esm/core/utils/UrlArgs.js.map +1 -0
  234. package/dist/esm/core/utils/arrayToEnum.js +16 -0
  235. package/dist/esm/core/utils/arrayToEnum.js.map +1 -0
  236. package/dist/esm/core/utils/createUrlArgsEnumFArray.js +11 -0
  237. package/dist/esm/core/utils/createUrlArgsEnumFArray.js.map +1 -0
  238. package/dist/esm/core/utils/securityHelpers.js +207 -0
  239. package/dist/esm/core/utils/securityHelpers.js.map +1 -0
  240. package/dist/esm/core/utils/securityValidatorHelpers.js +62 -0
  241. package/dist/esm/core/utils/securityValidatorHelpers.js.map +1 -0
  242. package/dist/esm/index.js +12 -0
  243. package/dist/esm/index.js.map +1 -0
  244. package/dist/esm/package.json +3 -0
  245. package/dist/schema.d.ts +2595 -0
  246. package/docs/ALL_TYPES.md +120 -0
  247. package/docs/API-STABILITY.md +336 -0
  248. package/docs/CONDITIONAL-VALIDATION.md +637 -0
  249. package/docs/EXAMPLES.md +876 -0
  250. package/docs/FIELD-TYPES.md +829 -0
  251. package/docs/GETTING-STARTED.md +394 -0
  252. package/docs/LIVE-UTILITY.md +1137 -0
  253. package/docs/QUICK-REFERENCE.md +346 -0
  254. package/docs/README.md +205 -0
  255. package/docs/VSCODE-EXTENSION.md +458 -0
  256. package/package.json +219 -0
  257. package/src/bench/BENCHMARK-RESULTS.md +211 -0
  258. package/src/bench/benchmark-results.json +148 -0
  259. package/src/bench/performance-comparison.ts +218 -0
  260. package/src/bench/precompilation-benchmark.ts +218 -0
  261. package/src/constants/SECURITY_CONSTANTS.ts +44 -0
  262. package/src/constants/VALIDATION_CONSTANTS.ts +176 -0
  263. package/src/core/README.md +395 -0
  264. package/src/core/compiler/SchemaTransformer.ts +279 -0
  265. package/src/core/compiler/TypeAnalyzer.ts +378 -0
  266. package/src/core/compiler/TypeScriptCompilerIntegration.ts +220 -0
  267. package/src/core/compiler/TypeToSchemaConverter.ts +288 -0
  268. package/src/core/index.ts +70 -0
  269. package/src/core/schema/extensions/AutoDocumentation.ts +572 -0
  270. package/src/core/schema/extensions/ConditionalValidation.ts +330 -0
  271. package/src/core/schema/extensions/README.md +171 -0
  272. package/src/core/schema/extensions/RealtimeValidation.ts +656 -0
  273. package/src/core/schema/extensions/SmartInference.ts +224 -0
  274. package/src/core/schema/extensions/components/AutoDocumentation/Docs.ts +98 -0
  275. package/src/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.ts +201 -0
  276. package/src/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.ts +176 -0
  277. package/src/core/schema/extensions/components/AutoDocumentation/OpenAPIGenerator.ts +175 -0
  278. package/src/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.ts +49 -0
  279. package/src/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.ts +54 -0
  280. package/src/core/schema/extensions/components/AutoDocumentation/index.ts +17 -0
  281. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.ts +101 -0
  282. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalElse.ts +65 -0
  283. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalThen.ts +33 -0
  284. package/src/core/schema/extensions/components/ConditionalValidation/Extend.ts +75 -0
  285. package/src/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.ts +16 -0
  286. package/src/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.ts +50 -0
  287. package/src/core/schema/extensions/components/ConditionalValidation/index.ts +104 -0
  288. package/src/core/schema/extensions/components/RealtimeValidation/FormValidator.ts +88 -0
  289. package/src/core/schema/extensions/components/RealtimeValidation/LiveValidator.ts +171 -0
  290. package/src/core/schema/extensions/components/RealtimeValidation/StreamValidator.ts +397 -0
  291. package/src/core/schema/extensions/components/RealtimeValidation/index.ts +114 -0
  292. package/src/core/schema/extensions/index.ts +76 -0
  293. package/src/core/schema/extensions/mods/index.ts +131 -0
  294. package/src/core/schema/extensions/mods/openapi-converter.ts +338 -0
  295. package/src/core/schema/extensions/mods/typescript-generator.ts +379 -0
  296. package/src/core/schema/extensions/mods/validation-engine.ts +295 -0
  297. package/src/core/schema/mode/interfaces/Interface.ts +364 -0
  298. package/src/core/schema/mode/interfaces/InterfaceSchema.ts +1838 -0
  299. package/src/core/schema/mode/interfaces/README.md +278 -0
  300. package/src/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.ts +657 -0
  301. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalAST.ts +826 -0
  302. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.ts +992 -0
  303. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalParser.ts +803 -0
  304. package/src/core/schema/mode/interfaces/conditional/parser/readme.md +406 -0
  305. package/src/core/schema/mode/interfaces/conditional/types/ConditionalTypes.ts +273 -0
  306. package/src/core/schema/mode/interfaces/errors/ErrorHandler.ts +624 -0
  307. package/src/core/schema/mode/interfaces/errors/types/errors.type.ts +102 -0
  308. package/src/core/schema/mode/interfaces/precompilation/FieldPrecompilers.ts +962 -0
  309. package/src/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.ts +667 -0
  310. package/src/core/schema/mode/interfaces/typescript/ConditionalTypes.ts +1534 -0
  311. package/src/core/schema/mode/interfaces/typescript/IDESupport.ts +534 -0
  312. package/src/core/schema/mode/interfaces/typescript/TypeInference.ts +737 -0
  313. package/src/core/schema/mode/interfaces/typescript/index.ts +92 -0
  314. package/src/core/schema/mode/interfaces/validators/ConstraintParser.ts +1438 -0
  315. package/src/core/schema/mode/interfaces/validators/EnhancedErrorReporting.ts +227 -0
  316. package/src/core/schema/mode/interfaces/validators/TypeGuards.ts +288 -0
  317. package/src/core/schema/mode/interfaces/validators/TypeValidators.ts +660 -0
  318. package/src/core/schema/mode/interfaces/validators/UnionCache.ts +508 -0
  319. package/src/core/schema/mode/interfaces/validators/ValidationHelpers.ts +1257 -0
  320. package/src/core/schema/mode/interfaces/validators/index.ts +21 -0
  321. package/src/core/schema/mode/interfaces/validators/mods/passValidator.ts +424 -0
  322. package/src/core/schema/mode/interfaces/validators/mods/securityValidator.ts +1634 -0
  323. package/src/core/schema/mode/interfaces/validators/mods/urlValidation.ts +333 -0
  324. package/src/core/schema/optimization/ObjectValidationCache.ts +560 -0
  325. package/src/core/schema/optimization/PerformanceInitializer.ts +188 -0
  326. package/src/core/schema/optimization/PerformanceMonitor.ts +898 -0
  327. package/src/core/schema/optimization/SchemaCompiler.ts +730 -0
  328. package/src/core/testing/TestDataGenerator.ts +590 -0
  329. package/src/core/types/SchemaValidator.type.ts +210 -0
  330. package/src/core/types/ValidatorTypes.ts +93 -0
  331. package/src/core/types/extension.type.ts +109 -0
  332. package/src/core/types/objValidationCache.ts +17 -0
  333. package/src/core/types/parser.type.ts +15 -0
  334. package/src/core/types/perfoMonitor.ts +37 -0
  335. package/src/core/types/scompiler.ts +22 -0
  336. package/src/core/types/securityValidator.type.ts +10 -0
  337. package/src/core/types/types.ts +154 -0
  338. package/src/core/utils/Make.ts +97 -0
  339. package/src/core/utils/Mod.ts +1168 -0
  340. package/src/core/utils/UrlArgs.ts +124 -0
  341. package/src/core/utils/arrayToEnum.ts +89 -0
  342. package/src/core/utils/createUrlArgsEnumFArray.ts +11 -0
  343. package/src/core/utils/securityHelpers.ts +341 -0
  344. package/src/core/utils/securityValidatorHelpers.ts +76 -0
  345. package/src/index.ts +124 -0
@@ -0,0 +1,1134 @@
1
+ 'use strict';
2
+
3
+ var parser_type = require('../../../../types/parser.type.js');
4
+ var ValidatorTypes = require('../../../../types/ValidatorTypes.js');
5
+
6
+ /**
7
+ * Constraint Parser Module - Enhanced Robust Version
8
+ *
9
+ * Optimized parsing of constraint syntax like "string(3,20)", "number(0,100)?", etc.
10
+ * Uses caching, pre-compiled patterns, and robust regex validation for maximum reliability.
11
+ */
12
+ /**
13
+ * Enhanced constraint parser with robust regex patterns and bulletproof validation
14
+ */
15
+ class ConstraintParser {
16
+ /**
17
+ * Parse constraint syntax with aggressive caching and robust validation
18
+ */
19
+ static parseConstraints(fieldType) {
20
+ if (!this._isValidInput(fieldType)) {
21
+ throw new Error("Invalid field type: must be a non-empty string");
22
+ }
23
+ // Check cache first
24
+ const cached = this._parseCache.get(fieldType);
25
+ if (cached) {
26
+ this._cacheHits++;
27
+ return this._deepClone(cached);
28
+ }
29
+ this._cacheMisses++;
30
+ const result = this._parseConstraintsInternal(fieldType);
31
+ // Cache the result with size limit
32
+ this._addToCache(fieldType, result);
33
+ return result;
34
+ }
35
+ /**
36
+ * Enhanced input validation
37
+ */
38
+ static _isValidInput(input) {
39
+ return (typeof input === "string" &&
40
+ input.length > 0 &&
41
+ !this._patterns.whitespaceOnly.test(input));
42
+ }
43
+ /**
44
+ * Deep clone utility for cache results
45
+ */
46
+ static _deepClone(obj) {
47
+ const cloned = {
48
+ type: obj.type,
49
+ constraints: {},
50
+ optional: obj.optional,
51
+ required: obj.required,
52
+ };
53
+ // Deep clone constraints object
54
+ if (obj.constraints && typeof obj.constraints === "object") {
55
+ for (const [key, value] of Object.entries(obj.constraints)) {
56
+ if (value instanceof RegExp) {
57
+ cloned.constraints[key] = new RegExp(value.source, value.flags);
58
+ }
59
+ else if (typeof value === "object" && value !== null) {
60
+ cloned.constraints[key] = { ...value };
61
+ }
62
+ else {
63
+ cloned.constraints[key] = value;
64
+ }
65
+ }
66
+ }
67
+ return cloned;
68
+ }
69
+ /**
70
+ * Enhanced internal parsing logic with robust error handling
71
+ */
72
+ static _parseConstraintsInternal(fieldType) {
73
+ let optional = false;
74
+ let required = false;
75
+ let type = this._sanitizeInput(fieldType);
76
+ let constraints = {};
77
+ if (!type) {
78
+ throw new Error("Field type cannot be empty after sanitization");
79
+ }
80
+ // Enhanced optional marker detection
81
+ if (this._hasOptionalMarker(type)) {
82
+ optional = true;
83
+ type = this._removeOptionalMarker(type);
84
+ if (!type) {
85
+ throw new Error('Invalid field type: cannot be only "?"');
86
+ }
87
+ }
88
+ // Enhanced required marker detection
89
+ if (this._hasRequiredMarker(type)) {
90
+ required = true;
91
+ type = this._removeRequiredMarker(type);
92
+ if (!type) {
93
+ throw new Error('Invalid field type: cannot be only "!"');
94
+ }
95
+ }
96
+ // Enhanced union type detection
97
+ if (this._isUnionTypeInParentheses(type)) {
98
+ return { type, constraints: {}, optional, required };
99
+ }
100
+ // Enhanced constraint parsing with robust validation
101
+ const constraintMatch = this._parseBalancedConstraints(type);
102
+ if (constraintMatch) {
103
+ const { baseType, constraintStr } = constraintMatch;
104
+ type = baseType;
105
+ if (constraintStr) {
106
+ try {
107
+ constraints = this._parseConstraintString(constraintStr, baseType);
108
+ }
109
+ catch (error) {
110
+ throw new Error(`Invalid constraint syntax in "${fieldType}": ${this._getErrorMessage(error)}`);
111
+ }
112
+ }
113
+ }
114
+ // Check for conditional expressions (when ... *? ... : ...)
115
+ if (this._isConditionalExpression(type)) {
116
+ return { type, constraints: {}, optional, required };
117
+ }
118
+ // Enhanced base type validation
119
+ if (!this._isValidBaseType(type)) {
120
+ throw new Error(`Invalid base type: "${type}"`);
121
+ }
122
+ return { type, constraints, optional, required };
123
+ }
124
+ /**
125
+ * Check if type is a conditional expression using secure regex pattern
126
+ */
127
+ static _isConditionalExpression(type) {
128
+ // Secure regex pattern to match: when <condition> *? <thenValue> [: <elseValue>]
129
+ const conditionalPattern = /^\s*when\s+.+?\s*\*\?\s*.+/;
130
+ return conditionalPattern.test(type);
131
+ }
132
+ /**
133
+ * Enhanced input sanitization
134
+ */
135
+ static _sanitizeInput(input) {
136
+ if (typeof input !== "string") {
137
+ throw new Error("Input must be a string");
138
+ }
139
+ // Trim whitespace but preserve internal structure
140
+ return input.trim().replace(/\s+/g, " ");
141
+ }
142
+ /**
143
+ * Robust optional marker detection
144
+ */
145
+ static _hasOptionalMarker(type) {
146
+ return (type.length > 0 &&
147
+ type.charCodeAt(type.length - 1) === this._charCodes.questionMark &&
148
+ this._patterns.optionalMarker.test(type));
149
+ }
150
+ /**
151
+ * Safe optional marker removal
152
+ */
153
+ static _removeOptionalMarker(type) {
154
+ if (!this._hasOptionalMarker(type)) {
155
+ return type;
156
+ }
157
+ return type.slice(0, -1).trim();
158
+ }
159
+ /**
160
+ * Robust required marker detection
161
+ */
162
+ static _hasRequiredMarker(type) {
163
+ return (type.length > 0 &&
164
+ type.charCodeAt(type.length - 1) === this._charCodes.exclamation &&
165
+ this._patterns.requiredMarker.test(type));
166
+ }
167
+ /**
168
+ * Safe required marker removal
169
+ */
170
+ static _removeRequiredMarker(type) {
171
+ if (!this._hasRequiredMarker(type)) {
172
+ return type;
173
+ }
174
+ return type.slice(0, -1).trim();
175
+ }
176
+ /**
177
+ * Enhanced union type detection with regex validation
178
+ */
179
+ static _isUnionTypeInParentheses(type) {
180
+ return (this._patterns.unionType.test(type) &&
181
+ this._containsPipeOperator(type) &&
182
+ this._hasBalancedParentheses(type));
183
+ }
184
+ /**
185
+ * Check for pipe operator in union types
186
+ */
187
+ static _containsPipeOperator(type) {
188
+ for (let i = 0; i < type.length; i++) {
189
+ if (type.charCodeAt(i) === this._charCodes.pipe) {
190
+ return true;
191
+ }
192
+ }
193
+ return false;
194
+ }
195
+ /**
196
+ * Validate balanced parentheses
197
+ */
198
+ static _hasBalancedParentheses(input) {
199
+ let depth = 0;
200
+ for (let i = 0; i < input.length; i++) {
201
+ const charCode = input.charCodeAt(i);
202
+ if (charCode === this._charCodes.openParen) {
203
+ depth++;
204
+ }
205
+ else if (charCode === this._charCodes.closeParen) {
206
+ depth--;
207
+ if (depth < 0) {
208
+ return false;
209
+ }
210
+ }
211
+ }
212
+ return depth === 0;
213
+ }
214
+ /**
215
+ * Enhanced constraint parsing with robust parentheses handling
216
+ */
217
+ static _parseBalancedConstraints(type) {
218
+ const match = type.match(this._patterns.constraint);
219
+ if (!match) {
220
+ return null;
221
+ }
222
+ const [, baseType, constraintStr] = match;
223
+ // Enhanced base type validation
224
+ if (!this._patterns.baseType.test(baseType)) {
225
+ throw new Error(`Invalid base type format: "${baseType}"`);
226
+ }
227
+ // Validate constraint string is not empty
228
+ if (!constraintStr || this._patterns.whitespaceOnly.test(constraintStr)) {
229
+ throw new Error(`Empty constraint string in: "${type}"`);
230
+ }
231
+ // Validate balanced parentheses in constraint string
232
+ if (!this._validateConstraintParentheses(constraintStr)) {
233
+ throw new Error(`Unbalanced parentheses in constraint: "${type}"`);
234
+ }
235
+ return { baseType, constraintStr };
236
+ }
237
+ /**
238
+ * Validate parentheses balance in constraint strings
239
+ */
240
+ static _validateConstraintParentheses(constraintStr) {
241
+ let depth = 0;
242
+ let inRegex = false;
243
+ let escaped = false;
244
+ for (let i = 0; i < constraintStr.length; i++) {
245
+ const charCode = constraintStr.charCodeAt(i);
246
+ constraintStr[i];
247
+ // Handle regex pattern detection
248
+ if (charCode === this._charCodes.slash && !escaped) {
249
+ inRegex = !inRegex;
250
+ escaped = false;
251
+ continue;
252
+ }
253
+ // Handle escaping
254
+ if (charCode === this._charCodes.backslash && !escaped) {
255
+ escaped = true;
256
+ continue;
257
+ }
258
+ // Skip parentheses inside regex patterns
259
+ if (!inRegex) {
260
+ if (charCode === this._charCodes.openParen && !escaped) {
261
+ depth++;
262
+ }
263
+ else if (charCode === this._charCodes.closeParen && !escaped) {
264
+ depth--;
265
+ if (depth < 0) {
266
+ return false;
267
+ }
268
+ }
269
+ }
270
+ escaped = false;
271
+ }
272
+ return depth === 0;
273
+ }
274
+ /**
275
+ * Enhanced constraint string parsing with robust error handling
276
+ */
277
+ static _parseConstraintString(constraintStr, baseType) {
278
+ const trimmed = constraintStr.trim();
279
+ if (!trimmed) {
280
+ return {};
281
+ }
282
+ const constraints = {};
283
+ // Enhanced regex pattern detection
284
+ const regexMatch = this._parseRegexPattern(trimmed);
285
+ if (regexMatch) {
286
+ constraints.pattern = regexMatch;
287
+ return constraints;
288
+ }
289
+ // Enhanced semicolon-separated complex constraints
290
+ if (this._containsCharCode(trimmed, this._charCodes.semicolon)) {
291
+ return this._parseComplexConstraints(trimmed);
292
+ }
293
+ // Enhanced min,max constraints
294
+ if (this._containsCharCode(trimmed, this._charCodes.comma)) {
295
+ return this._parseMinMaxConstraints(trimmed, baseType);
296
+ }
297
+ // Enhanced single value constraint
298
+ if (this._isValidNumericValue(trimmed)) {
299
+ const val = this._parseNumericValue(trimmed);
300
+ this._setConstraintValue(constraints, baseType, parser_type.ConstraintType.Max, val);
301
+ return constraints;
302
+ }
303
+ throw new Error(`Unrecognized constraint format: "${trimmed}"`);
304
+ }
305
+ /**
306
+ * Enhanced regex pattern parsing
307
+ */
308
+ static _parseRegexPattern(input) {
309
+ const match = input.match(this._patterns.regex);
310
+ if (!match) {
311
+ return null;
312
+ }
313
+ try {
314
+ const [, pattern, flags] = match;
315
+ // Validate flags
316
+ if (flags && !this._isValidRegexFlags(flags)) {
317
+ throw new Error(`Invalid regex flags: "${flags}"`);
318
+ }
319
+ return new RegExp(pattern, flags || "");
320
+ }
321
+ catch (error) {
322
+ throw new Error(`Invalid regex pattern: ${this._getErrorMessage(error)}`);
323
+ }
324
+ }
325
+ /**
326
+ * Validate regex flags
327
+ */
328
+ static _isValidRegexFlags(flags) {
329
+ const validFlags = new Set(["g", "i", "m", "s", "u", "v", "y"]);
330
+ const flagSet = new Set();
331
+ for (const flag of flags) {
332
+ if (!validFlags.has(flag)) {
333
+ return false;
334
+ }
335
+ if (flagSet.has(flag)) {
336
+ return false; // Duplicate flag
337
+ }
338
+ flagSet.add(flag);
339
+ }
340
+ return true;
341
+ }
342
+ /**
343
+ * Check if string contains specific character code
344
+ */
345
+ static _containsCharCode(str, charCode) {
346
+ for (let i = 0; i < str.length; i++) {
347
+ if (str.charCodeAt(i) === charCode) {
348
+ return true;
349
+ }
350
+ }
351
+ return false;
352
+ }
353
+ /**
354
+ * Enhanced numeric value validation
355
+ */
356
+ static _isValidNumericValue(value) {
357
+ if (!value || typeof value !== "string") {
358
+ return false;
359
+ }
360
+ return this._patterns.numeric.test(value.trim());
361
+ }
362
+ /**
363
+ * Safe numeric value parsing
364
+ */
365
+ static _parseNumericValue(value) {
366
+ const trimmed = value.trim();
367
+ if (!this._isValidNumericValue(trimmed)) {
368
+ throw new Error(`Invalid numeric value: "${value}"`);
369
+ }
370
+ const parsed = Number(trimmed);
371
+ if (!Number.isFinite(parsed)) {
372
+ throw new Error(`Non-finite numeric value: "${value}"`);
373
+ }
374
+ return parsed;
375
+ }
376
+ /**
377
+ * Enhanced min,max constraint parsing
378
+ */
379
+ static _parseMinMaxConstraints(constraintStr, baseType) {
380
+ const constraints = {};
381
+ const parts = constraintStr.split(this._patterns.commaSplit);
382
+ if (parts.length > 2) {
383
+ throw new Error(`Too many constraint values. Expected format: "min,max" but got: "${constraintStr}"`);
384
+ }
385
+ const [minStr, maxStr] = parts;
386
+ // Enhanced minimum value parsing
387
+ if (minStr && !this._patterns.whitespaceOnly.test(minStr)) {
388
+ const minVal = this._parseNumericValue(minStr);
389
+ this._setConstraintValue(constraints, baseType, parser_type.ConstraintType.Min, minVal);
390
+ }
391
+ // Enhanced maximum value parsing
392
+ if (maxStr && !this._patterns.whitespaceOnly.test(maxStr)) {
393
+ const maxVal = this._parseNumericValue(maxStr);
394
+ this._setConstraintValue(constraints, baseType, parser_type.ConstraintType.Max, maxVal);
395
+ }
396
+ // Enhanced min/max relationship validation
397
+ this._validateMinMaxRelationship(constraints);
398
+ return constraints;
399
+ }
400
+ /**
401
+ * Validate min/max constraint relationships
402
+ */
403
+ static _validateMinMaxRelationship(constraints) {
404
+ const pairs = [
405
+ ["min", "max"],
406
+ ["minLength", "maxLength"],
407
+ ["minItems", "maxItems"],
408
+ ];
409
+ for (const [minKey, maxKey] of pairs) {
410
+ if (constraints[minKey] !== undefined &&
411
+ constraints[maxKey] !== undefined) {
412
+ if (constraints[minKey] > constraints[maxKey]) {
413
+ throw new Error(`${minKey} value (${constraints[minKey]}) cannot be greater than ${maxKey} value (${constraints[maxKey]})`);
414
+ }
415
+ }
416
+ }
417
+ }
418
+ /**
419
+ * Enhanced constraint value setting with robust validation
420
+ */
421
+ static _setConstraintValue(constraints, baseType, constraintType, value) {
422
+ // Enhanced negative value validation
423
+ if (!Number.isFinite(value)) {
424
+ throw new Error(`Constraint value must be finite: ${value}`);
425
+ }
426
+ // Type-specific negative value validation
427
+ if (this._isStringType(baseType) && value < 0) {
428
+ throw new Error("String length constraints cannot be negative");
429
+ }
430
+ if (this._isArrayType(baseType) && value < 0) {
431
+ throw new Error("Array length constraints cannot be negative");
432
+ }
433
+ // Set appropriate constraint based on type
434
+ if (this._isArrayType(baseType)) {
435
+ constraints[constraintType === parser_type.ConstraintType.Min
436
+ ? parser_type.ConstraintType.MinItems
437
+ : parser_type.ConstraintType.MaxItems] = value;
438
+ }
439
+ else if (this._isStringType(baseType)) {
440
+ constraints[constraintType === parser_type.ConstraintType.Min
441
+ ? parser_type.ConstraintType.MinLength
442
+ : parser_type.ConstraintType.MaxLength] = value;
443
+ }
444
+ else {
445
+ constraints[constraintType] = value;
446
+ }
447
+ }
448
+ /**
449
+ * Enhanced string type detection
450
+ */
451
+ static _isStringType(type) {
452
+ return (type === "string" ||
453
+ (this._patterns.baseType.test(type) && type.includes("string")));
454
+ }
455
+ /**
456
+ * Enhanced array type detection
457
+ */
458
+ static _isArrayType(type) {
459
+ return this._patterns.arrayType.test(type) || type.endsWith("[]");
460
+ }
461
+ /**
462
+ * Enhanced base type validation with comprehensive checks
463
+ */
464
+ static _isValidBaseType(type) {
465
+ if (!type || typeof type !== "string") {
466
+ return false;
467
+ }
468
+ // Enhanced whitespace validation
469
+ if (this._patterns.whitespaceOnly.test(type)) {
470
+ return false;
471
+ }
472
+ // Check valid conditional types
473
+ if (ValidatorTypes.VALID_CONDITIONNAL_TYPES.includes(type)) {
474
+ return true;
475
+ }
476
+ // Enhanced union type validation
477
+ if (this._containsPipeOperator(type)) {
478
+ return this._validateUnionType(type);
479
+ }
480
+ // Enhanced literal value validation
481
+ if (this._patterns.literalValue.test(type)) {
482
+ return true;
483
+ }
484
+ // Enhanced Record type validation
485
+ if (this._isRecordType(type)) {
486
+ return true;
487
+ }
488
+ // Enhanced supported validator types check
489
+ if (ValidatorTypes.SUPPORTED_VALIDATOR_TYPES.includes(type)) {
490
+ return true;
491
+ }
492
+ // Enhanced base type pattern validation
493
+ return this._patterns.baseType.test(type);
494
+ }
495
+ /**
496
+ * Validate union types
497
+ */
498
+ static _validateUnionType(type) {
499
+ const parts = type.split("|");
500
+ if (parts.length < 2) {
501
+ return false;
502
+ }
503
+ return parts.every((part) => {
504
+ const trimmed = part.trim();
505
+ return trimmed.length > 0 && !this._patterns.whitespaceOnly.test(trimmed);
506
+ });
507
+ }
508
+ /**
509
+ * Enhanced Record type detection
510
+ */
511
+ static _isRecordType(type) {
512
+ return (this._patterns.recordTypeLower.test(type) ||
513
+ this._patterns.recordTypeUpper.test(type));
514
+ }
515
+ /**
516
+ * Enhanced cache management with deep cloning
517
+ */
518
+ static _addToCache(key, value) {
519
+ if (this._parseCache.size >= this._maxCacheSize) {
520
+ const firstKey = this._parseCache.keys().next().value;
521
+ if (firstKey) {
522
+ this._parseCache.delete(firstKey);
523
+ }
524
+ }
525
+ this._parseCache.set(key, this._deepClone(value));
526
+ }
527
+ /**
528
+ * Enhanced complex constraint parsing
529
+ */
530
+ static _parseComplexConstraints(constraintStr) {
531
+ const constraints = {};
532
+ const parts = constraintStr
533
+ .split(this._patterns.semicolonSplit)
534
+ .map((part) => part.trim())
535
+ .filter((part) => !this._patterns.whitespaceOnly.test(part));
536
+ if (parts.length === 0) {
537
+ throw new Error("Empty complex constraint string");
538
+ }
539
+ for (const part of parts) {
540
+ try {
541
+ this._parseComplexConstraintPart(constraints, part);
542
+ }
543
+ catch (error) {
544
+ throw new Error(`Error parsing constraint "${part}": ${this._getErrorMessage(error)}`);
545
+ }
546
+ }
547
+ return constraints;
548
+ }
549
+ /**
550
+ * Parse individual complex constraint part
551
+ */
552
+ static _parseComplexConstraintPart(constraints, part) {
553
+ const colonParts = part.split(this._patterns.colonSplit);
554
+ if (colonParts.length !== 2) {
555
+ throw new Error(`Invalid constraint format. Expected "key:value" but got: "${part}"`);
556
+ }
557
+ const [key, value] = colonParts;
558
+ if (this._patterns.whitespaceOnly.test(key) ||
559
+ this._patterns.whitespaceOnly.test(value)) {
560
+ throw new Error(`Invalid constraint format. Both key and value must be non-empty: "${part}"`);
561
+ }
562
+ if (!this._patterns.constraintKey.test(key)) {
563
+ throw new Error(`Invalid constraint key format: "${key}"`);
564
+ }
565
+ this._parseComplexConstraintPair(constraints, key, value);
566
+ }
567
+ /**
568
+ * Enhanced individual constraint key-value pair parsing
569
+ */
570
+ static _parseComplexConstraintPair(constraints, key, value) {
571
+ switch (key) {
572
+ case parser_type.ConstraintType.Min:
573
+ case parser_type.ConstraintType.Max:
574
+ case parser_type.ConstraintType.MinLength:
575
+ case parser_type.ConstraintType.MaxLength:
576
+ case parser_type.ConstraintType.MinItems:
577
+ case parser_type.ConstraintType.MaxItems:
578
+ const numValue = this._parseNumericValue(value);
579
+ if (numValue < 0 && (key.includes("Length") || key.includes("Items"))) {
580
+ throw new Error(`"${key}" cannot be negative`);
581
+ }
582
+ constraints[key] = numValue;
583
+ break;
584
+ case "pattern":
585
+ const regexPattern = this._parseRegexPattern(value);
586
+ if (!regexPattern) {
587
+ throw new Error(`Pattern must be in regex format (/pattern/flags): "${value}"`);
588
+ }
589
+ constraints.pattern = regexPattern;
590
+ break;
591
+ case "unique":
592
+ if (!this._patterns.booleanValue.test(value)) {
593
+ throw new Error(`"unique" must be "true" or "false", got: "${value}"`);
594
+ }
595
+ constraints.unique = value.toLowerCase() === "true";
596
+ break;
597
+ default:
598
+ throw new Error(`Unknown constraint key: "${key}"`);
599
+ }
600
+ }
601
+ /**
602
+ * Enhanced error message extraction
603
+ */
604
+ static _getErrorMessage(error) {
605
+ if (error instanceof Error) {
606
+ return error.message;
607
+ }
608
+ if (typeof error === "string") {
609
+ return error;
610
+ }
611
+ return "Unknown error";
612
+ }
613
+ // Enhanced public utility methods with stronger validation
614
+ /**
615
+ * Check if a field type has constraints - enhanced validation
616
+ */
617
+ static hasConstraints(fieldType) {
618
+ if (!this._isValidInput(fieldType)) {
619
+ return false;
620
+ }
621
+ const sanitized = this._sanitizeInput(fieldType);
622
+ const withoutModifiers = sanitized
623
+ .replace(this._patterns.optionalMarker, "")
624
+ .replace(this._patterns.requiredMarker, "");
625
+ return this._patterns.complexConstraint.test(withoutModifiers);
626
+ }
627
+ /**
628
+ * Extract base type without constraints - enhanced
629
+ */
630
+ static getBaseType(fieldType) {
631
+ if (!this._isValidInput(fieldType)) {
632
+ return "";
633
+ }
634
+ try {
635
+ const parsed = this.parseConstraints(fieldType);
636
+ return parsed.type;
637
+ }
638
+ catch {
639
+ // Enhanced fallback with regex
640
+ const sanitized = this._sanitizeInput(fieldType);
641
+ return sanitized
642
+ .replace(/\([^)]*\)/, "")
643
+ .replace(this._patterns.optionalMarker, "")
644
+ .replace(this._patterns.requiredMarker, "")
645
+ .trim();
646
+ }
647
+ }
648
+ /**
649
+ * Check if field type is optional - enhanced
650
+ */
651
+ static isOptional(fieldType) {
652
+ return this._isValidInput(fieldType) && this._hasOptionalMarker(fieldType);
653
+ }
654
+ /**
655
+ * Check if field type is required - enhanced
656
+ */
657
+ static isRequired(fieldType) {
658
+ return this._isValidInput(fieldType) && this._hasRequiredMarker(fieldType);
659
+ }
660
+ /**
661
+ * Check if field type is an array - enhanced
662
+ */
663
+ static isArrayType(fieldType) {
664
+ if (!this._isValidInput(fieldType)) {
665
+ return false;
666
+ }
667
+ try {
668
+ const parsed = this.parseConstraints(fieldType);
669
+ return this._isArrayType(parsed.type);
670
+ }
671
+ catch {
672
+ return false;
673
+ }
674
+ }
675
+ /**
676
+ * Get element type for array types - enhanced
677
+ */
678
+ static getElementType(fieldType) {
679
+ if (!this._isValidInput(fieldType)) {
680
+ return fieldType;
681
+ }
682
+ try {
683
+ const parsed = this.parseConstraints(fieldType);
684
+ if (this._isArrayType(parsed.type)) {
685
+ return parsed.type.replace(/\[\]$/, "");
686
+ }
687
+ return parsed.type;
688
+ }
689
+ catch {
690
+ return fieldType;
691
+ }
692
+ }
693
+ /**
694
+ * Enhanced constraint validation
695
+ */
696
+ static validateConstraints(constraints, type) {
697
+ if (!constraints || typeof constraints !== "object") {
698
+ return [];
699
+ }
700
+ const errors = [];
701
+ try {
702
+ // Enhanced min/max validation
703
+ this._validateMinMaxRelationship(constraints);
704
+ // Enhanced type-specific validation
705
+ this._validateTypeSpecificConstraints(constraints, type, errors);
706
+ // Enhanced regex pattern validation
707
+ if (constraints.pattern && !(constraints.pattern instanceof RegExp)) {
708
+ errors.push("Pattern constraint must be a RegExp object");
709
+ }
710
+ // Enhanced negative value validation
711
+ this._validateNegativeConstraints(constraints, errors);
712
+ }
713
+ catch (error) {
714
+ errors.push(`Constraint validation error: ${this._getErrorMessage(error)}`);
715
+ }
716
+ return errors;
717
+ }
718
+ /**
719
+ * Validate type-specific constraints
720
+ */
721
+ static _validateTypeSpecificConstraints(constraints, type, errors) {
722
+ if (type === "positive" &&
723
+ constraints.min !== undefined &&
724
+ constraints.min < 0) {
725
+ errors.push("Positive type cannot have negative minimum value");
726
+ }
727
+ if (type === "negative" &&
728
+ constraints.max !== undefined &&
729
+ constraints.max > 0) {
730
+ errors.push("Negative type cannot have positive maximum value");
731
+ }
732
+ }
733
+ /**
734
+ * Validate negative constraints
735
+ */
736
+ static _validateNegativeConstraints(constraints, errors) {
737
+ const lengthKeys = [
738
+ parser_type.ConstraintType.MinLength,
739
+ parser_type.ConstraintType.MaxLength,
740
+ parser_type.ConstraintType.MinItems,
741
+ parser_type.ConstraintType.MaxItems,
742
+ ];
743
+ lengthKeys.forEach((key) => {
744
+ if (constraints[key] !== undefined && constraints[key] < 0) {
745
+ errors.push(`${key} cannot be negative`);
746
+ }
747
+ });
748
+ }
749
+ /**
750
+ * Enhanced constraint merging
751
+ */
752
+ static mergeConstraints(baseOptions, constraints) {
753
+ if (!baseOptions && !constraints) {
754
+ return {};
755
+ }
756
+ if (!baseOptions) {
757
+ return this._deepCloneObject(constraints);
758
+ }
759
+ if (!constraints) {
760
+ return this._deepCloneObject(baseOptions);
761
+ }
762
+ const merged = { ...baseOptions };
763
+ // Enhanced merging with conflict resolution
764
+ for (const [key, value] of Object.entries(constraints)) {
765
+ if (value instanceof RegExp) {
766
+ merged[key] = new RegExp(value.source, value.flags);
767
+ }
768
+ else if (typeof value === "object" && value !== null) {
769
+ merged[key] = { ...value };
770
+ }
771
+ else {
772
+ merged[key] = value;
773
+ }
774
+ }
775
+ return merged;
776
+ }
777
+ /**
778
+ * Deep clone utility for objects
779
+ */
780
+ static _deepCloneObject(obj) {
781
+ if (!obj || typeof obj !== "object") {
782
+ return obj;
783
+ }
784
+ const cloned = {};
785
+ for (const [key, value] of Object.entries(obj)) {
786
+ if (value instanceof RegExp) {
787
+ cloned[key] = new RegExp(value.source, value.flags);
788
+ }
789
+ else if (typeof value === "object" && value !== null) {
790
+ cloned[key] = { ...value };
791
+ }
792
+ else {
793
+ cloned[key] = value;
794
+ }
795
+ }
796
+ return cloned;
797
+ }
798
+ /**
799
+ * Enhanced cache clearing with statistics reset
800
+ */
801
+ static clearCache() {
802
+ this._parseCache.clear();
803
+ this._cacheHits = 0;
804
+ this._cacheMisses = 0;
805
+ }
806
+ /**
807
+ * Enhanced cache statistics with additional metrics
808
+ */
809
+ static getCacheStats() {
810
+ const total = this._cacheHits + this._cacheMisses;
811
+ const hitRate = total > 0 ? this._cacheHits / total : 0;
812
+ const efficiency = this._parseCache.size > 0 ? hitRate : 0;
813
+ return {
814
+ size: this._parseCache.size,
815
+ hitRate: Number(hitRate.toFixed(4)),
816
+ hits: this._cacheHits,
817
+ misses: this._cacheMisses,
818
+ maxSize: this._maxCacheSize,
819
+ efficiency: Number(efficiency.toFixed(4)),
820
+ };
821
+ }
822
+ /**
823
+ * Enhanced constraint description with better formatting
824
+ */
825
+ static getConstraintDescription(constraints, _type) {
826
+ if (!constraints || typeof constraints !== "object") {
827
+ return "";
828
+ }
829
+ const descriptions = [];
830
+ try {
831
+ const constraintKeys = [
832
+ parser_type.ConstraintType.Min,
833
+ parser_type.ConstraintType.Max,
834
+ parser_type.ConstraintType.MinLength,
835
+ parser_type.ConstraintType.MaxLength,
836
+ parser_type.ConstraintType.MinItems,
837
+ parser_type.ConstraintType.MaxItems,
838
+ ];
839
+ constraintKeys.forEach((key) => {
840
+ if (constraints[key] !== undefined &&
841
+ Number.isFinite(constraints[key])) {
842
+ descriptions.push(`${key}: ${constraints[key]}`);
843
+ }
844
+ });
845
+ if (constraints.pattern instanceof RegExp) {
846
+ const flags = constraints.pattern.flags
847
+ ? `/${constraints.pattern.flags}`
848
+ : "";
849
+ descriptions.push(`pattern: /${constraints.pattern.source}${flags}`);
850
+ }
851
+ if (constraints.unique === true) {
852
+ descriptions.push("unique: true");
853
+ }
854
+ // Enhanced description formatting
855
+ return descriptions.length > 0 ? `(${descriptions.join(", ")})` : "";
856
+ }
857
+ catch (error) {
858
+ return `(invalid constraints: ${this._getErrorMessage(error)})`;
859
+ }
860
+ }
861
+ /**
862
+ * Enhanced complex constraint parsing (public interface)
863
+ */
864
+ static parseComplexConstraints(constraintStr) {
865
+ if (!this._isValidInput(constraintStr)) {
866
+ throw new Error("Invalid constraint string: must be a non-empty string");
867
+ }
868
+ try {
869
+ return this._parseComplexConstraints(constraintStr);
870
+ }
871
+ catch (error) {
872
+ throw new Error(`Failed to parse complex constraints "${constraintStr}": ${this._getErrorMessage(error)}`);
873
+ }
874
+ }
875
+ // Additional enhanced utility methods
876
+ /**
877
+ * Validate field type format comprehensively
878
+ */
879
+ static isValidFieldType(fieldType) {
880
+ if (!this._isValidInput(fieldType)) {
881
+ return false;
882
+ }
883
+ try {
884
+ this.parseConstraints(fieldType);
885
+ return true;
886
+ }
887
+ catch {
888
+ return false;
889
+ }
890
+ }
891
+ /**
892
+ * Extract all modifiers from field type
893
+ */
894
+ static getFieldTypeModifiers(fieldType) {
895
+ if (!this._isValidInput(fieldType)) {
896
+ return { optional: false, required: false, hasConstraints: false };
897
+ }
898
+ try {
899
+ const parsed = this.parseConstraints(fieldType);
900
+ return {
901
+ optional: parsed.optional,
902
+ required: parsed.required,
903
+ hasConstraints: Object.keys(parsed.constraints).length > 0,
904
+ };
905
+ }
906
+ catch {
907
+ return {
908
+ optional: this.isOptional(fieldType),
909
+ required: this.isRequired(fieldType),
910
+ hasConstraints: this.hasConstraints(fieldType),
911
+ };
912
+ }
913
+ }
914
+ /**
915
+ * Normalize field type string
916
+ */
917
+ static normalizeFieldType(fieldType) {
918
+ if (!this._isValidInput(fieldType)) {
919
+ return "";
920
+ }
921
+ try {
922
+ const parsed = this.parseConstraints(fieldType);
923
+ let normalized = parsed.type;
924
+ // Add constraints back if they exist
925
+ if (Object.keys(parsed.constraints).length > 0) {
926
+ const constraintDesc = this._formatConstraintsForType(parsed.constraints);
927
+ if (constraintDesc) {
928
+ normalized += `(${constraintDesc})`;
929
+ }
930
+ }
931
+ // Add modifiers back
932
+ if (parsed.required) {
933
+ normalized += "!";
934
+ }
935
+ if (parsed.optional) {
936
+ normalized += "?";
937
+ }
938
+ return normalized;
939
+ }
940
+ catch {
941
+ return this._sanitizeInput(fieldType);
942
+ }
943
+ }
944
+ /**
945
+ * Format constraints for type reconstruction
946
+ */
947
+ static _formatConstraintsForType(constraints) {
948
+ if (!constraints || typeof constraints !== "object") {
949
+ return "";
950
+ }
951
+ const parts = [];
952
+ // Handle regex pattern
953
+ if (constraints.pattern instanceof RegExp) {
954
+ const flags = constraints.pattern.flags || "";
955
+ parts.push(`/${constraints.pattern.source}/${flags}`);
956
+ return parts.join(";");
957
+ }
958
+ // Handle min/max pairs
959
+ if (constraints.min !== undefined && constraints.max !== undefined) {
960
+ parts.push(`${constraints.min},${constraints.max}`);
961
+ }
962
+ else if (constraints.min !== undefined) {
963
+ parts.push(`${constraints.min},`);
964
+ }
965
+ else if (constraints.max !== undefined) {
966
+ parts.push(`${constraints.max}`);
967
+ }
968
+ // Handle length constraints
969
+ if (constraints.minLength !== undefined &&
970
+ constraints.maxLength !== undefined) {
971
+ if (parts.length === 0) {
972
+ parts.push(`${constraints.minLength},${constraints.maxLength}`);
973
+ }
974
+ else {
975
+ parts.push(`minLength:${constraints.minLength};maxLength:${constraints.maxLength}`);
976
+ }
977
+ }
978
+ // Handle items constraints
979
+ if (constraints.minItems !== undefined &&
980
+ constraints.maxItems !== undefined) {
981
+ if (parts.length === 0) {
982
+ parts.push(`${constraints.minItems},${constraints.maxItems}`);
983
+ }
984
+ else {
985
+ parts.push(`minItems:${constraints.minItems};maxItems:${constraints.maxItems}`);
986
+ }
987
+ }
988
+ // Handle unique
989
+ if (constraints.unique === true) {
990
+ parts.push("unique:true");
991
+ }
992
+ return parts.join(";");
993
+ }
994
+ /**
995
+ * Performance monitoring utilities
996
+ */
997
+ static getParsingPerformance() {
998
+ const total = this._cacheHits + this._cacheMisses;
999
+ const hitRatio = total > 0 ? this._cacheHits / total : 0;
1000
+ return {
1001
+ totalParses: total,
1002
+ cacheHitRatio: Number(hitRatio.toFixed(4)),
1003
+ averageParseTime: 0, // Would need instrumentation
1004
+ memoryUsage: this._parseCache.size * 100, // Rough estimate
1005
+ };
1006
+ }
1007
+ /**
1008
+ * Optimize cache by removing least recently used entries
1009
+ */
1010
+ static optimizeCache() {
1011
+ if (this._parseCache.size <= this._maxCacheSize * 0.8) {
1012
+ return; // No optimization needed
1013
+ }
1014
+ const entries = Array.from(this._parseCache.entries());
1015
+ const keepSize = Math.floor(this._maxCacheSize * 0.6);
1016
+ // Keep most recent entries (simple LRU approximation)
1017
+ this._parseCache.clear();
1018
+ entries.slice(-keepSize).forEach(([key, value]) => {
1019
+ this._parseCache.set(key, value);
1020
+ });
1021
+ }
1022
+ /**
1023
+ * Validate constraint compatibility with field type
1024
+ */
1025
+ static validateConstraintCompatibility(fieldType, constraints) {
1026
+ const errors = [];
1027
+ if (!this._isValidInput(fieldType)) {
1028
+ errors.push("Invalid field type");
1029
+ return { valid: false, errors };
1030
+ }
1031
+ if (!constraints || typeof constraints !== "object") {
1032
+ return { valid: true, errors: [] };
1033
+ }
1034
+ try {
1035
+ const parsed = this.parseConstraints(fieldType);
1036
+ const baseType = parsed.type;
1037
+ // Check string-specific constraints
1038
+ if (!this._isStringType(baseType)) {
1039
+ if (constraints.minLength !== undefined ||
1040
+ constraints.maxLength !== undefined) {
1041
+ errors.push("Length constraints are only valid for string types");
1042
+ }
1043
+ if (constraints.pattern !== undefined) {
1044
+ errors.push("Pattern constraints are only valid for string types");
1045
+ }
1046
+ }
1047
+ // Check array-specific constraints
1048
+ if (!this._isArrayType(baseType)) {
1049
+ if (constraints.minItems !== undefined ||
1050
+ constraints.maxItems !== undefined) {
1051
+ errors.push("Item constraints are only valid for array types");
1052
+ }
1053
+ if (constraints.unique !== undefined) {
1054
+ errors.push("Unique constraints are only valid for array types");
1055
+ }
1056
+ }
1057
+ // Check numeric-specific constraints
1058
+ const numericTypes = ["number", "integer", "positive", "negative"];
1059
+ if (!numericTypes.some((t) => baseType.includes(t))) {
1060
+ if (constraints.min !== undefined || constraints.max !== undefined) {
1061
+ errors.push("Min/Max constraints are only valid for numeric types");
1062
+ }
1063
+ }
1064
+ }
1065
+ catch (error) {
1066
+ errors.push(`Type parsing error: ${this._getErrorMessage(error)}`);
1067
+ }
1068
+ return { valid: errors.length === 0, errors };
1069
+ }
1070
+ }
1071
+ // Private static properties for better encapsulation
1072
+ ConstraintParser._parseCache = new Map();
1073
+ ConstraintParser._maxCacheSize = 1000;
1074
+ ConstraintParser._cacheHits = 0;
1075
+ ConstraintParser._cacheMisses = 0;
1076
+ // pre-compiled regex patterns with stronger validation
1077
+ ConstraintParser._patterns = {
1078
+ // Robust constraint pattern - handles complex nested patterns
1079
+ constraint: /^([a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*)\((.+)\)$/,
1080
+ // Enhanced regex pattern detection with proper escaping
1081
+ regex: /^\/(.+?)\/([gimsuvy]*)$/,
1082
+ // Precise comma splitting that handles whitespace
1083
+ commaSplit: /\s*,\s*/,
1084
+ // Robust numeric validation including scientific notation and edge cases
1085
+ numeric: /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/,
1086
+ // Strict base type validation
1087
+ baseType: /^[a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*$/,
1088
+ // Enhanced complex constraint detection
1089
+ complexConstraint: /^[a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*\([^)]*\)$/,
1090
+ // Union type detection with balanced parentheses
1091
+ unionType: /^\([^()]*(?:\|[^()]*)+\)$/,
1092
+ // Record type detection (both cases)
1093
+ recordTypeLower: /^record<[^<>]+>$/i,
1094
+ recordTypeUpper: /^Record<[^<>]+>$/,
1095
+ // Optional marker validation
1096
+ optionalMarker: /\?$/,
1097
+ // Required marker validation
1098
+ requiredMarker: /!$/,
1099
+ // Whitespace validation
1100
+ whitespaceOnly: /^\s*$/,
1101
+ // Constraint key validation
1102
+ constraintKey: /^[a-zA-Z][a-zA-Z0-9_]*$/,
1103
+ // Balanced parentheses validation
1104
+ balancedParens: /^[^()]*(?:\([^()]*\)[^()]*)*$/,
1105
+ // Array type detection
1106
+ arrayType: /^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/,
1107
+ // Equal sign prefix for literal values
1108
+ literalValue: /^=/,
1109
+ // Boolean value validation
1110
+ booleanValue: /^(?:true|false)$/i,
1111
+ // Enhanced semicolon split for complex constraints
1112
+ semicolonSplit: /\s*;\s*/,
1113
+ // Colon split for key-value pairs
1114
+ colonSplit: /\s*:\s*/,
1115
+ };
1116
+ // Character codes for optimized checks
1117
+ ConstraintParser._charCodes = {
1118
+ questionMark: 63, // '?'
1119
+ exclamation: 33, // '!'
1120
+ openParen: 40, // '('
1121
+ closeParen: 41, // ')'
1122
+ comma: 44, // ','
1123
+ semicolon: 59, // ';'
1124
+ colon: 58, // ':'
1125
+ pipe: 124, // '|'
1126
+ openBracket: 91, // '['
1127
+ closeBracket: 93, // ']'
1128
+ slash: 47, // '/'
1129
+ backslash: 92, // '\'
1130
+ equal: 61, // '='
1131
+ };
1132
+
1133
+ exports.ConstraintParser = ConstraintParser;
1134
+ //# sourceMappingURL=ConstraintParser.js.map