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
package/README.md ADDED
@@ -0,0 +1,1305 @@
1
+ # ReliantType
2
+
3
+ [![npm version](https://badge.fury.io/js/reliant-type.svg)](https://badge.fury.io/js/reliant-type)
4
+ [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
5
+ [![Build Status](https://github.com/nehonisteam/ReliantType/workflows/CI/badge.svg)](https://github.com/nehonisteam/ReliantType/actions)
6
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/reliant-type)](https://bundlephobia.com/package/reliant-type)
7
+ [![VS Code Extension](https://img.shields.io/badge/VS%20Code-Extension%20Available-blue)](https://sdk.nehonix.space/pkgs/mods/vscode/latest/reliant-type.vsix)
8
+
9
+ <div align="center">
10
+ <img src="https://sdk.nehonix.space/sdks/assets/reliant-type.jpg" alt="ReliantType Logo" width="250" />
11
+ </div>
12
+
13
+ <div align="center">
14
+ <img src="https://sdk.nehonix.space/sdks/assets/vscode-extension-preview.gif" alt="VSCode extension preview" width="500" />
15
+ </div>
16
+
17
+ **TypeScript Schema Validation with Interface-Like Syntax**
18
+
19
+ A modern TypeScript validation library designed around familiar interface syntax and powerful conditional validation. Experience schema validation that feels natural to TypeScript developers while unlocking advanced runtime validation capabilities.
20
+
21
+ > **Formerly Fortify Schema** - Originally developed at [github.com/Nehonix-Team/fortify-schema](https://github.com/Nehonix-Team/fortify-schema)
22
+
23
+ ⚠️ **Migration Notice**: The `fortify-schema` package will be deprecated in favor of `reliant-type`. While `fortify-schema` will continue to receive critical security updates, new features and improvements will only be available in `reliant-type`. We recommend migrating to `reliant-type` for the best experience and ongoing support.
24
+
25
+ ## 🆕 What's New
26
+
27
+ - **Required Fields (`!`)**: Enforce non-empty strings and non-zero numbers with `"string!"` and `"number!"`
28
+ - **Object Types**: Validate generic object structures with `"object"` and `"object?"`
29
+ - **Enhanced Security**: All string operations now use secure regex patterns instead of potentially vulnerable methods
30
+ - **Improved Performance**: Optimized validation paths with better caching and precompilation
31
+ - **Better Error Messages**: More descriptive validation errors with clear property paths
32
+
33
+ ## Quick Start
34
+
35
+ ```bash
36
+ npm install reliant-type
37
+ ```
38
+
39
+ ```typescript
40
+ import { Interface } from "reliant-type";
41
+
42
+ // Define schemas with familiar TypeScript-like syntax
43
+ const UserSchema = Interface({
44
+ id: "uuid",
45
+ email: "email!", // 🆕 Required (non-empty) email
46
+ name: "string(2,50)!", // 🆕 Required string with length constraints
47
+ age: "number(18,120)?",
48
+ role: "admin|user|guest",
49
+
50
+ // 🆕 Object and array types
51
+ profile: "object", // Any object structure
52
+ tags: "string[]", // Array of strings
53
+ metadata: "record<string, any>", // Dynamic key-value pairs
54
+
55
+ // Advanced conditional validation based on runtime properties
56
+ permissions: "when config.hasPermissions.$exists() *? string[] : =[]",
57
+ adminTools: "when role=admin *? boolean : =false",
58
+ });
59
+
60
+ // Validate with complete TypeScript inference
61
+ const result = UserSchema.safeParse(userData);
62
+ if (result.success) {
63
+ console.log("Valid user:", result.data); // Fully typed!
64
+ } else {
65
+ console.log("Validation errors:", result.errors);
66
+ }
67
+ ```
68
+
69
+ _Note: For nested objects, we recommend limiting depth to 50-100 or no more than 300 levels for performance and safety. Default depth limit is 500._
70
+
71
+ Test by running:
72
+
73
+ - bun src\_\_tests\_\_\test_nested_obj.ts note: you may have bun installed if using this command. "npm i -g bun" (recommanded because it's faster than node)
74
+
75
+ - npm run benchmark:nestedObject
76
+
77
+ _Note: you may have tsx installed if using this command. "npm i -g tsx"._
78
+
79
+ ## Table of Contents
80
+
81
+ - [Installation & Setup](#installation--setup)
82
+ - [Core Features](#core-features)
83
+ - [Utility Functions](#utility-functions)
84
+ - [Conditional Validation](#conditional-validation)
85
+ - [Live Utility - Real-time Validation](#live-utility---real-time-validation)
86
+ - [Real-World Applications](#real-world-applications)
87
+ - [Performance Excellence](#performance-excellence)
88
+ - [Advanced Capabilities](#advanced-capabilities)
89
+ - [Developer Experience](#developer-experience)
90
+ - [API Reference](#api-reference)
91
+
92
+ ## Installation & Setup
93
+
94
+ ### Requirements
95
+
96
+ - **TypeScript 4.5+**
97
+ - **Node.js 14+**
98
+ - **VS Code** (recommended for enhanced development experience)
99
+
100
+ ### Installation
101
+
102
+ ```bash
103
+ # NPM
104
+ npm install reliant-type
105
+
106
+ # Yarn
107
+ yarn add reliant-type
108
+
109
+ # PNPM
110
+ pnpm add reliant-type
111
+
112
+ # Bun
113
+ bun add reliant-type
114
+ ```
115
+
116
+ ### VS Code Extension
117
+
118
+ Enhance your development workflow with our dedicated VS Code extension featuring comprehensive developer tools:
119
+
120
+ #### **🎨 Enhanced Features**
121
+
122
+ - **Syntax Highlighting**: Full syntax highlighting for all Reliant Type types and utilities
123
+ - **Hover Documentation**: Detailed type information, examples, and use cases on hover
124
+ - **Go-to-Definition**: Ctrl+Click on types to open comprehensive documentation
125
+ - **IntelliSense Support**: Smart autocomplete for schema definitions
126
+ - **Error Detection**: Real-time validation of schema syntax
127
+ - **Code Snippets**: Pre-built templates for common schema patterns
128
+
129
+ #### **📖 Interactive Documentation**
130
+
131
+ When you hover over any type in `Interface({...})` blocks, you'll see:
132
+
133
+ - **Type Description**: What the type validates
134
+ - **Usage Examples**: `"string"`, `"string?"`, `"string[]"`
135
+ - **Use Cases**: When and where to use each type
136
+ - **Code Examples**: Complete working examples
137
+
138
+ #### **🔧 Installation**
139
+
140
+ ```bash
141
+ # Download and install
142
+ curl https://sdk.nehonix.space/pkgs/mods/vscode/latest/reliant-type.vsix -o reliant-type.vsix
143
+ code --install-extension reliant-type.vsix
144
+
145
+ # Or just search for "reliant-type" in the vscode marketplace
146
+ ```
147
+
148
+ ## Core Features
149
+
150
+ ### Intuitive Schema Definition
151
+
152
+ ```typescript
153
+ import { Interface } from "reliant-type";
154
+
155
+ const ProductSchema = Interface({
156
+ id: "uuid",
157
+ name: "string(1,100)",
158
+ price: "number(0.01,99999.99)",
159
+ category: "electronics|books|clothing|home",
160
+ inStock: "boolean",
161
+ tags: "string[]?",
162
+ description: "string(,500)?",
163
+ createdAt: "date",
164
+ });
165
+
166
+ // Usage with full type safety
167
+ const product = {
168
+ id: "123e4567-e89b-12d3-a456-426614174000",
169
+ name: "Wireless Headphones",
170
+ price: 99.99,
171
+ category: "electronics",
172
+ inStock: true,
173
+ tags: ["wireless", "audio", "bluetooth"],
174
+ createdAt: new Date(),
175
+ };
176
+
177
+ const result = ProductSchema.safeParse(product);
178
+ console.log(result.success); // true
179
+ console.log(result.data); // Fully typed product data
180
+ ```
181
+
182
+ ### Comprehensive Type Support
183
+
184
+ ```typescript
185
+ const ComprehensiveSchema = Interface({
186
+ // Fundamental types
187
+ name: "string",
188
+ age: "number",
189
+ active: "boolean",
190
+ birthday: "date",
191
+
192
+ // Optional fields
193
+ nickname: "string?",
194
+ bio: "string?",
195
+
196
+ // 🆕 Required fields (cannot be empty/zero)
197
+ requiredName: "string!", // Non-empty string required
198
+ requiredCount: "number!", // Non-zero number required
199
+
200
+ // Constraint validation
201
+ username: "string(3,20)", // 3-20 characters
202
+ password: "string(8,)", // Minimum 8 characters
203
+ score: "number(0,100)", // Range 0-100
204
+
205
+ // Format validation
206
+ email: "email",
207
+ website: "url",
208
+ secureApi: "url.https", // HTTPS-only validation
209
+ devServer: "url.dev", // Development mode (allows localhost and security features disabled)
210
+ phone: "phone",
211
+ userId: "uuid",
212
+
213
+ // Array validation
214
+ tags: "string[]", // Required array
215
+ scores: "number[]?", // Optional array
216
+ limitedTags: "string[](1,5)", // 1-5 items
217
+
218
+ // Union types
219
+ status: "active|inactive|pending",
220
+ role: "user|admin|moderator",
221
+
222
+ // 🆕 Object types
223
+ profile: "object", // Any object
224
+ config: "object?", // Optional object
225
+
226
+ // Record types (dynamic key-value objects)
227
+ settings: "record<string, any>", // String keys, any values
228
+ counters: "record<string, number>", // String keys, number values
229
+ metadata: "record<string, string>", // String keys, string values
230
+
231
+ // Literal values
232
+ version: "=2.0",
233
+ type: "=user",
234
+ });
235
+ ```
236
+
237
+ ### Deep Object Validation
238
+
239
+ ```typescript
240
+ const UserProfileSchema = Interface({
241
+ user: {
242
+ id: "uuid",
243
+ email: "email",
244
+ profile: {
245
+ firstName: "string(1,50)",
246
+ lastName: "string(1,50)",
247
+ avatar: "url?",
248
+ preferences: {
249
+ theme: "light|dark|auto",
250
+ language: "string(/^[a-z]{2}$/)",
251
+ notifications: "boolean",
252
+ },
253
+ },
254
+ },
255
+ metadata: {
256
+ createdAt: "date",
257
+ lastLogin: "date?",
258
+ loginCount: "number(0,)",
259
+ },
260
+ });
261
+ ```
262
+
263
+ ### Utility Functions
264
+
265
+ Reliant Type provides powerful utility functions for advanced schema definition:
266
+
267
+ #### **Make.const() - Constant Values**
268
+
269
+ Create schemas that validate against exact constant values:
270
+
271
+ ```typescript
272
+ import { Interface, Make } from "reliant-type";
273
+
274
+ const ConfigSchema = Interface({
275
+ // Exact string constants
276
+ apiVersion: Make.const("v2.1"),
277
+ environment: Make.const("production"),
278
+
279
+ // Numeric constants
280
+ maxRetries: Make.const(3),
281
+ timeout: Make.const(5000),
282
+
283
+ // Boolean constants
284
+ enableLogging: Make.const(true),
285
+
286
+ // Complex constants
287
+ defaultSettings: Make.const({
288
+ theme: "dark",
289
+ language: "en",
290
+ }),
291
+
292
+ // Array constants
293
+ supportedFormats: Make.const(["json", "xml", "csv"]),
294
+ });
295
+
296
+ // Usage
297
+ const config = {
298
+ apiVersion: "v2.1", // ✅ Valid
299
+ environment: "staging", // ❌ Invalid - must be exactly "production"
300
+ maxRetries: 3, // ✅ Valid
301
+ timeout: 3000, // ❌ Invalid - must be exactly 5000
302
+ };
303
+ ```
304
+
305
+ #### **Record Types - Dynamic Objects**
306
+
307
+ Validate objects with dynamic keys but consistent value types:
308
+
309
+ ```typescript
310
+ const DynamicSchema = Interface({
311
+ // String keys with any values
312
+ metadata: "record<string, any>",
313
+
314
+ // String keys with number values (counters, scores, etc.)
315
+ scores: "record<string, number>",
316
+
317
+ // String keys with string values (translations, labels, etc.)
318
+ translations: "record<string, string>",
319
+
320
+ // Optional record types
321
+ optionalSettings: "record<string, boolean>?",
322
+ });
323
+
324
+ // Usage
325
+ const data = {
326
+ metadata: {
327
+ userId: "123",
328
+ timestamp: new Date(),
329
+ flags: ["active", "verified"],
330
+ },
331
+ scores: {
332
+ math: 95,
333
+ science: 87,
334
+ english: 92,
335
+ },
336
+ translations: {
337
+ hello: "Hola",
338
+ goodbye: "Adiós",
339
+ welcome: "Bienvenido",
340
+ },
341
+ };
342
+ ```
343
+
344
+ ## Conditional Validation
345
+
346
+ Reliant Type's standout feature: advanced conditional validation based on runtime properties and business logic.
347
+
348
+ ```typescript
349
+ const SmartUserSchema = Interface({
350
+ // Runtime context objects
351
+ config: "any?",
352
+ user: "any?",
353
+ features: "any?",
354
+
355
+ // Core user data
356
+ id: "uuid",
357
+ email: "email",
358
+ role: "admin|user|guest",
359
+
360
+ // Dynamic validation based on runtime state
361
+ hasPermissions: "when config.permissions.$exists() *? boolean : =false",
362
+ hasProfile: "when user.profile.$exists() *? boolean : =false",
363
+ isListEmpty: "when config.items.$empty() *? boolean : =true",
364
+ hasAdminRole: "when user.roles.$contains(admin) *? boolean : =false",
365
+
366
+ // Smart default values
367
+ defaultTags: 'when config.tags.$exists() *? string[] : =["default","user"]',
368
+ defaultSettings:
369
+ 'when config.theme.$exists() *? any : ={"mode":"light","lang":"en"}',
370
+
371
+ // Deep property access
372
+ advancedFeature:
373
+ "when user.profile.settings.advanced.$exists() *? boolean : =false",
374
+
375
+ // Complex business rules
376
+ isValidUser:
377
+ "when user.email.$exists() && user.verified.$exists() *? boolean : =false",
378
+ });
379
+ ```
380
+
381
+ ### Runtime Validation Methods
382
+
383
+ ```typescript
384
+ const RuntimeMethodsSchema = Interface({
385
+ data: "any?",
386
+
387
+ // Property existence checking
388
+ hasData: "when data.field.$exists() *? boolean : =false",
389
+
390
+ // Empty state validation
391
+ isEmpty: "when data.list.$empty() *? boolean : =true",
392
+
393
+ // Null checking
394
+ isNull: "when data.value.$null() *? boolean : =false",
395
+
396
+ // String pattern matching
397
+ containsText:
398
+ "when data.description.$contains(important) *? boolean : =false",
399
+ startsWithPrefix: "when data.code.$startsWith(PRE) *? boolean : =false",
400
+ endsWithSuffix: "when data.filename.$endsWith(.pdf) *? boolean : =false",
401
+
402
+ // Numeric range validation
403
+ inRange: "when data.score.$between(0,100) *? boolean : =false",
404
+
405
+ // Value inclusion testing
406
+ isValidStatus:
407
+ "when data.status.$in(active,pending,inactive) *? boolean : =false",
408
+ });
409
+ ```
410
+
411
+ ## Live Utility - Real-time Validation (still in progress so not recommended for production use yet)
412
+
413
+ The Live utility transforms Reliant Type into a powerful real-time validation system with EventEmitter-like interface, data transformation pipelines, and stream control methods. Perfect for modern applications requiring reactive validation.
414
+
415
+ ### Key Features
416
+
417
+ - **Real-time Field Validation** - Validate form fields as users type
418
+ - **EventEmitter Interface** - Full `.on()`, `.emit()`, `.off()`, `.once()` support
419
+ - **Data Transformation Pipeline** - Chain `.transform()`, `.filter()`, `.map()` operations
420
+ - **Stream Control** - `.pause()`, `.resume()`, `.destroy()` for flow control
421
+ - **Stream Piping** - Connect validators with `.pipe()` for complex workflows
422
+ - **Performance Monitoring** - Built-in statistics and performance tracking
423
+ - **InterfaceSchema Sync** - Perfect synchronization with Interface validation
424
+
425
+ ### Quick Example
426
+
427
+ ```typescript
428
+ import { Live, Interface } from "reliant-type";
429
+
430
+ const UserSchema = Interface({
431
+ name: "string(2,50)",
432
+ email: "email",
433
+ age: "number(18,120)",
434
+ });
435
+
436
+ // Create stream validator with transformation pipeline
437
+ const validator = Live.stream(UserSchema)
438
+ .transform((data) => ({ ...data, timestamp: Date.now() }))
439
+ .filter((data) => data.age >= 21)
440
+ .map((data) => ({ ...data, name: data.name.toUpperCase() }));
441
+
442
+ // Listen for results
443
+ validator.on("valid", (data) => console.log("✅ Valid:", data));
444
+ validator.on("invalid", (data, errors) => console.log("❌ Invalid:", errors));
445
+ validator.on("filtered", (data) => console.log("🚫 Filtered:", data));
446
+
447
+ // Process data
448
+ validator.validate({ name: "john", email: "john@example.com", age: 25 });
449
+ // Output: ✅ Valid: { name: "JOHN", email: "john@example.com", age: 25, timestamp: 1703123456789 }
450
+ ```
451
+
452
+ ### Stream Control Example
453
+
454
+ ```typescript
455
+ const streamValidator = Live.stream(UserSchema);
456
+
457
+ // Pause stream (queues data)
458
+ streamValidator.pause();
459
+ streamValidator.validate(userData1); // Queued
460
+ streamValidator.validate(userData2); // Queued
461
+
462
+ console.log("Queue length:", streamValidator.queueLength); // 2
463
+
464
+ // Resume and process queue
465
+ streamValidator.resume(); // Processes both queued items
466
+
467
+ // Stream piping
468
+ const sourceValidator = Live.stream(InputSchema);
469
+ const destinationValidator = Live.stream(OutputSchema);
470
+
471
+ sourceValidator.pipe(destinationValidator);
472
+ // Valid data flows: source → destination
473
+ ```
474
+
475
+ ### Form Integration Example
476
+
477
+ ```typescript
478
+ const formValidator = Live.form(UserSchema);
479
+
480
+ // Bind form fields
481
+ formValidator.bindField("email", emailInput);
482
+ formValidator.bindField("name", nameInput);
483
+
484
+ // Enable real-time validation
485
+ formValidator.enableAutoValidation();
486
+
487
+ // Handle form submission
488
+ formValidator.onSubmit((isValid, data, errors) => {
489
+ if (isValid) {
490
+ submitToAPI(data);
491
+ } else {
492
+ displayErrors(errors);
493
+ }
494
+ });
495
+ ```
496
+
497
+ The Live utility provides **100% coverage** of standard stream methods while maintaining **perfect synchronization** with InterfaceSchema validation logic.
498
+
499
+ ## Real-World Applications
500
+
501
+ ### E-Commerce Product Management
502
+
503
+ ```typescript
504
+ const ECommerceProductSchema = Interface({
505
+ // Product identification
506
+ id: "uuid",
507
+ sku: "string(/^[A-Z0-9-]{8,20}$/)",
508
+ name: "string(1,200)",
509
+ slug: "string(/^[a-z0-9-]+$/)",
510
+
511
+ // Pricing structure
512
+ price: "number(0.01,999999.99)",
513
+ compareAtPrice: "number(0.01,999999.99)?",
514
+ cost: "number(0,999999.99)?",
515
+
516
+ // Inventory management
517
+ inventory: {
518
+ quantity: "number(0,)",
519
+ trackQuantity: "boolean",
520
+ allowBackorder: "boolean",
521
+ lowStockThreshold: "number(0,)?"
522
+ },
523
+
524
+ // Content management
525
+ description: "string(,5000)?",
526
+ shortDescription: "string(,500)?",
527
+ category: "electronics|clothing|books|home|sports|beauty",
528
+ tags: "string[](0,20)",
529
+
530
+ // Media assets
531
+ images: {
532
+ primary: "url",
533
+ gallery: "url[](0,10)",
534
+ alt: "string(,100)?"
535
+ }?,
536
+
537
+ // SEO optimization
538
+ seo: {
539
+ title: "string(,60)?",
540
+ description: "string(,160)?",
541
+ keywords: "string[](0,10)"
542
+ }?,
543
+
544
+ // Business logic with conditional validation
545
+ config: "any?",
546
+
547
+ // Product type-specific requirements
548
+ shipping: "when config.isDigital.$exists() *? any? : ={weight:0,dimensions:{}}",
549
+ subscription: "when config.isSubscription.$exists() *? any : =null",
550
+ variants: "when config.hasVariants.$exists() *? any[] : =[]",
551
+
552
+ // Publication workflow
553
+ status: "draft|active|archived",
554
+ publishedAt: "date?",
555
+ createdAt: "date",
556
+ updatedAt: "date"
557
+ });
558
+ ```
559
+
560
+ ## Performance Excellence
561
+
562
+ Reliant Type is engineered for high-performance validation with multiple optimization strategies:
563
+
564
+ ### Performance Architecture
565
+
566
+ ```typescript
567
+ // Built-in performance optimizations
568
+ const performanceFeatures = {
569
+ // Schema compilation
570
+ precompilation: "Schemas optimized at creation time",
571
+ caching: "Intelligent caching for union types and constraints",
572
+
573
+ // Memory management
574
+ memoryOptimized: "Minimal runtime overhead per validation",
575
+ zeroAllocation: "Hot paths avoid unnecessary object creation",
576
+
577
+ // Validation efficiency
578
+ earlyTermination: "Fast-fail validation on first error",
579
+ typeSpecialization: "Optimized validation paths per data type",
580
+ };
581
+ ```
582
+
583
+ ### Benchmark Highlights
584
+
585
+ Our continuous performance monitoring shows excellent results across all validation scenarios:
586
+
587
+ - **High Throughput**: Millions of operations per second for common validation patterns
588
+ - **Consistent Performance**: Low variation in execution times
589
+ - **Memory Efficient**: Minimal memory overhead per schema instance
590
+ - **Scalable**: Performance scales predictably with data complexity
591
+
592
+ ### Performance Testing
593
+
594
+ Validate performance on your specific use cases:
595
+
596
+ ```bash
597
+ # Run comprehensive benchmarks
598
+ bun run scripts/benchmark.js
599
+
600
+ ```
601
+
602
+ View detailed [benchmark results](./src/bench/BENCHMARK-RESULTS.md) for comprehensive performance analysis.
603
+
604
+ ## Advanced Capabilities
605
+
606
+ ### Schema Transformation
607
+
608
+ ```typescript
609
+ import { Mod } from "reliant-type";
610
+
611
+ const BaseUserSchema = Interface({
612
+ id: "uuid",
613
+ email: "email",
614
+ name: "string",
615
+ password: "string",
616
+ role: "user|admin",
617
+ createdAt: "date",
618
+ });
619
+
620
+ // Powerful schema transformations
621
+ const PublicUserSchema = Mod.omit(BaseUserSchema, ["password"]);
622
+ const PartialUserSchema = Mod.partial(BaseUserSchema);
623
+ const RequiredUserSchema = Mod.required(PartialUserSchema);
624
+ const ExtendedUserSchema = Mod.extend(BaseUserSchema, {
625
+ lastLogin: "date?",
626
+ preferences: {
627
+ theme: "light|dark",
628
+ notifications: "boolean",
629
+ },
630
+ });
631
+ ```
632
+
633
+ ### Comprehensive Error Handling
634
+
635
+ ```typescript
636
+ const result = UserSchema.safeParse(invalidData);
637
+
638
+ if (!result.success) {
639
+ // Rich error information for debugging
640
+ result.errors.forEach((error) => {
641
+ console.log(`Field: ${error.path.join(".")}`);
642
+ console.log(`Message: ${error.message}`);
643
+ console.log(`Code: ${error.code}`);
644
+ console.log(`Expected: ${error.expected}`);
645
+ console.log(`Received: ${error.received}`);
646
+ });
647
+ }
648
+
649
+ // Exception-based validation
650
+ try {
651
+ const data = UserSchema.parse(userData);
652
+ // Process validated data
653
+ } catch (error) {
654
+ if (error instanceof ValidationError) {
655
+ console.log("Validation failed:", error.errors);
656
+ }
657
+ }
658
+ ```
659
+
660
+ ## Developer Experience
661
+
662
+ ### VS Code Extension Features
663
+
664
+ Our dedicated VS Code extension transforms your development experience:
665
+
666
+ - **Intelligent Syntax Highlighting** for schema definitions
667
+ - **Advanced IntelliSense** with type and method completion
668
+ - **Real-time Validation** with inline error detection
669
+ - **Rich Hover Documentation** for all types and methods
670
+ - **Multiple Theme Support** for different coding preferences
671
+
672
+ ```typescript
673
+ const UserSchema = Interface({
674
+ // IntelliSense provides comprehensive type suggestions
675
+ email: "email", // Hover documentation explains validation rules
676
+
677
+ // Smart constraint completion
678
+ name: "string(2,50)", // Auto-suggests constraint syntax patterns
679
+
680
+ // Conditional method IntelliSense
681
+ hasProfile: "when user.profile.$exists() *? boolean : =false",
682
+ // ^ Shows all 8 available runtime methods
683
+ });
684
+ ```
685
+
686
+ ## What Sets Reliant Type Apart
687
+
688
+ ### Design Philosophy
689
+
690
+ - **Developer-Centric**: Built around familiar TypeScript patterns and conventions
691
+ - **Interface Syntax**: Schema definitions that feel like native TypeScript interfaces
692
+ - **Conditional Intelligence**: Advanced runtime validation based on dynamic properties
693
+ - **Performance Focused**: Optimized for high-throughput production applications
694
+ - **Tooling Excellence**: Professional-grade development tools and IDE integration
695
+ - **Type Safety**: Complete TypeScript inference and compile-time validation
696
+
697
+ ### Key Strengths
698
+
699
+ - **Familiar Syntax**: Write schemas using TypeScript-like interface definitions
700
+ - **Advanced Conditionals**: Unique runtime property validation and business logic
701
+ - **Rich Tooling**: Dedicated VS Code extension with comprehensive development support
702
+ - **Type Integration**: Seamless TypeScript integration with full type inference
703
+ - **Production Ready**: Battle-tested with comprehensive error handling and debugging
704
+
705
+ ### Community and Growth
706
+
707
+ We're building Reliant Type with transparency and community feedback at its core. We welcome:
708
+
709
+ - **Real-world usage feedback** and performance insights
710
+ - **Issue reports** with detailed reproduction cases
711
+ - **Feature requests** based on practical development needs
712
+ - **Performance benchmarking** on diverse use cases
713
+ - **Constructive feedback** on API design and developer experience
714
+
715
+ ## API Reference
716
+
717
+ ### Core Validation Methods
718
+
719
+ #### `Interface(schema, options?)`
720
+
721
+ Creates a new schema instance with comprehensive validation rules.
722
+
723
+ ```typescript
724
+ const UserSchema = Interface(
725
+ {
726
+ id: "uuid",
727
+ name: "string",
728
+ },
729
+ {
730
+ strict: true, // Reject extra properties
731
+ loose: false, // Disable automatic type coercion
732
+ allowUnknown: false, // Reject unknown properties
733
+ }
734
+ );
735
+ ```
736
+
737
+ #### `schema.parse(data)`
738
+
739
+ Synchronous validation that returns validated data or throws detailed errors.
740
+
741
+ ```typescript
742
+ try {
743
+ const user = UserSchema.parse(userData);
744
+ // user is fully typed and validated
745
+ } catch (error) {
746
+ console.error(error.errors);
747
+ }
748
+ ```
749
+
750
+ #### `schema.safeParse(data)`
751
+
752
+ Safe validation that returns a result object without throwing exceptions.
753
+
754
+ ```typescript
755
+ const result = UserSchema.safeParse(userData);
756
+ if (result.success) {
757
+ console.log(result.data); // Fully typed and validated
758
+ } else {
759
+ console.error(result.errors); // Detailed validation errors
760
+ }
761
+ ```
762
+
763
+ #### `schema.safeParseUnknown(data)`
764
+
765
+ Safe validation for unknown data types, ideal for testing and debugging.
766
+
767
+ ```typescript
768
+ const result = UserSchema.safeParseUnknown(unknownData);
769
+ // Same return type as safeParse() but accepts any input type
770
+ ```
771
+
772
+ #### `schema.parseAsync(data)`
773
+
774
+ Asynchronous validation with promise-based error handling.
775
+
776
+ ```typescript
777
+ try {
778
+ const user = await UserSchema.parseAsync(userData);
779
+ console.log("Valid user:", user);
780
+ } catch (error) {
781
+ console.error("Validation failed:", error.message);
782
+ }
783
+ ```
784
+
785
+ #### `schema.safeParseAsync(data)`
786
+
787
+ Asynchronous safe validation that never throws exceptions.
788
+
789
+ ```typescript
790
+ const result = await UserSchema.safeParseAsync(userData);
791
+ if (result.success) {
792
+ console.log("Valid user:", result.data);
793
+ } else {
794
+ console.error("Validation errors:", result.errors);
795
+ }
796
+ ```
797
+
798
+ #### `schema.safeParseUnknownAsync(data)`
799
+
800
+ Asynchronous safe validation for unknown data types.
801
+
802
+ ```typescript
803
+ const result = await UserSchema.safeParseUnknownAsync(unknownData);
804
+ if (result.success) {
805
+ console.log("Valid data:", result.data);
806
+ } else {
807
+ console.error("Validation errors:", result.errors);
808
+ }
809
+ ```
810
+
811
+ ### Schema Transformation Operations
812
+
813
+ #### `Mod.partial(schema)` - Optional Fields
814
+
815
+ ```typescript
816
+ const PartialUserSchema = Mod.partial(UserSchema);
817
+ // Converts all fields to optional
818
+ ```
819
+
820
+ #### `Mod.required(schema)` - Required Fields
821
+
822
+ ```typescript
823
+ const RequiredUserSchema = Mod.required(PartialUserSchema);
824
+ // Makes all fields required
825
+ ```
826
+
827
+ #### `Mod.pick(schema, keys)` - Field Selection
828
+
829
+ ```typescript
830
+ const PublicUserSchema = Mod.pick(UserSchema, ["id", "name", "email"]);
831
+ // Creates schema with only specified fields
832
+ ```
833
+
834
+ #### `Mod.omit(schema, keys)` - Field Exclusion
835
+
836
+ ```typescript
837
+ const SafeUserSchema = Mod.omit(UserSchema, ["password", "internalId"]);
838
+ // Creates schema excluding specified fields
839
+ ```
840
+
841
+ #### `Mod.extend(schema, extension)` - Schema Extension
842
+
843
+ ```typescript
844
+ const ExtendedUserSchema = Mod.extend(UserSchema, {
845
+ lastLogin: "date?",
846
+ preferences: {
847
+ theme: "light|dark",
848
+ },
849
+ });
850
+ ```
851
+
852
+ #### `Mod.merge(schema1, schema2)` - Schema Merging
853
+
854
+ ```typescript
855
+ const CombinedSchema = Mod.merge(UserSchema, ProfileSchema);
856
+ // Combines two schemas into one
857
+ ```
858
+
859
+ ### Available Extensions
860
+
861
+ ReliantType provides powerful extensions for enhanced functionality:
862
+
863
+ ```typescript
864
+ // Import extensions for advanced features
865
+ export {
866
+ Smart, // Smart schema inference from samples and TypeScript types
867
+ When, // Advanced conditional validation builder
868
+ Live, // Real-time validation for forms and streaming data
869
+ Docs, // Auto-documentation generation (OpenAPI, TypeScript, etc.)
870
+ Extensions, // Extension utilities and helpers
871
+ Quick, // Quick access utilities for common operations
872
+ TypeScriptGenerator, // TypeScript code generation from schemas
873
+ } from "reliant-type";
874
+ ```
875
+
876
+ #### Smart Inference
877
+
878
+ ```typescript
879
+ import { Smart } from "reliant-type";
880
+
881
+ // Infer schema from sample data
882
+ const sampleUser = {
883
+ id: 1,
884
+ email: "user@example.com",
885
+ name: "John Doe",
886
+ tags: ["developer", "typescript"],
887
+ };
888
+
889
+ const UserSchema = Smart.fromSample(sampleUser);
890
+ // Generates: { id: "positive", email: "email", name: "string", tags: "string[]" }
891
+ ```
892
+
893
+ #### Conditional Builder
894
+
895
+ ```typescript
896
+ import { When } from "reliant-type";
897
+
898
+ const OrderSchema = Interface({
899
+ orderType: "pickup|delivery",
900
+ address: "string?",
901
+
902
+ // Advanced conditional validation
903
+ deliveryFee: When.field("orderType")
904
+ .is("delivery")
905
+ .then("number(0,)")
906
+ .default("number?"),
907
+ });
908
+ ```
909
+
910
+ #### Real-time Validation with Live Utility
911
+
912
+ The Live utility provides comprehensive real-time validation with full EventEmitter-like interface, data transformation pipelines, and stream control methods. Perfect for forms, streaming data, and reactive applications.
913
+
914
+ ```typescript
915
+ import { Live } from "reliant-type";
916
+
917
+ const UserSchema = Interface({
918
+ id: "number",
919
+ name: "string(2,50)",
920
+ email: "email",
921
+ age: "number(18,120)",
922
+ });
923
+ ```
924
+
925
+ ##### Live Validator - Real-time Field Validation
926
+
927
+ ```typescript
928
+ // Create live validator for real-time field validation
929
+ const liveValidator = Live.validator(UserSchema);
930
+
931
+ // Listen for validation changes
932
+ liveValidator.onValidation((result) => {
933
+ console.log("Validation result:", result.isValid);
934
+ console.log("Current errors:", result.errors);
935
+ updateUI(result);
936
+ });
937
+
938
+ // Validate fields in real-time
939
+ liveValidator.validateField("email", "user@example.com");
940
+ liveValidator.validateField("name", "John Doe");
941
+
942
+ // Get current validation state
943
+ console.log("Is valid:", liveValidator.isValid);
944
+ console.log("All errors:", liveValidator.errors);
945
+
946
+ // Validate entire object
947
+ const fullResult = liveValidator.validateAll(userData);
948
+ ```
949
+
950
+ ##### Stream Validator - Advanced Stream Processing
951
+
952
+ The StreamValidator provides a complete EventEmitter-like interface with all standard stream methods:
953
+
954
+ ```typescript
955
+ // Create stream validator
956
+ const streamValidator = Live.stream(UserSchema);
957
+
958
+ // ===== EVENT EMITTER METHODS =====
959
+
960
+ // Generic event listeners (.on, .once, .off, .emit)
961
+ streamValidator.on("valid", (data) => {
962
+ console.log("Valid data received:", data);
963
+ });
964
+
965
+ streamValidator.once("invalid", (data, errors) => {
966
+ console.log("First invalid data:", errors);
967
+ });
968
+
969
+ streamValidator.on("error", (error) => {
970
+ console.error("Stream error:", error);
971
+ });
972
+
973
+ // Custom events
974
+ streamValidator.on("custom-event", (message) => {
975
+ console.log("Custom event:", message);
976
+ });
977
+
978
+ streamValidator.emit("custom-event", "Hello from stream!");
979
+
980
+ // Remove listeners
981
+ streamValidator.off("valid", specificListener);
982
+ streamValidator.off("invalid"); // Remove all listeners for event
983
+ ```
984
+
985
+ ##### Data Transformation Pipeline
986
+
987
+ ```typescript
988
+ // Build comprehensive data transformation pipeline
989
+ const transformValidator = Live.stream(UserSchema)
990
+ .transform((data) => {
991
+ // Add metadata
992
+ return { ...data, timestamp: Date.now(), source: "api" };
993
+ })
994
+ .filter((data) => {
995
+ // Filter by business rules
996
+ return data.age >= 21; // Only adults
997
+ })
998
+ .map((data) => {
999
+ // Transform data format
1000
+ return {
1001
+ ...data,
1002
+ name: data.name.toUpperCase(),
1003
+ email: data.email.toLowerCase(),
1004
+ };
1005
+ });
1006
+
1007
+ // Listen for pipeline results
1008
+ transformValidator.on("valid", (data) => {
1009
+ console.log("Processed data:", data); // Transformed and validated
1010
+ });
1011
+
1012
+ transformValidator.on("filtered", (data) => {
1013
+ console.log("Data filtered out:", data); // Failed filter conditions
1014
+ });
1015
+
1016
+ transformValidator.on("invalid", (data, errors) => {
1017
+ console.log("Validation failed after transformation:", errors);
1018
+ });
1019
+
1020
+ // Process data through pipeline
1021
+ transformValidator.validate(rawUserData);
1022
+ ```
1023
+
1024
+ ##### Stream Control Methods
1025
+
1026
+ ```typescript
1027
+ // Stream control with pause/resume/destroy
1028
+ const controlValidator = Live.stream(UserSchema);
1029
+
1030
+ // Pause stream (queues incoming data)
1031
+ controlValidator.pause();
1032
+ console.log("Stream paused:", controlValidator.paused);
1033
+
1034
+ // Data sent while paused gets queued
1035
+ controlValidator.validate(userData1); // Queued
1036
+ controlValidator.validate(userData2); // Queued
1037
+
1038
+ console.log("Queue length:", controlValidator.queueLength);
1039
+
1040
+ // Resume stream (processes queued data)
1041
+ controlValidator.resume();
1042
+ console.log("Stream resumed, queue processed");
1043
+
1044
+ // Destroy stream (cleanup and prevent further use)
1045
+ controlValidator.on("destroy", () => {
1046
+ console.log("Stream destroyed and cleaned up");
1047
+ });
1048
+
1049
+ controlValidator.destroy();
1050
+ console.log("Stream destroyed:", controlValidator.destroyed);
1051
+ ```
1052
+
1053
+ ##### Stream Piping
1054
+
1055
+ ```typescript
1056
+ // Pipe data between stream validators
1057
+ const sourceValidator = Live.stream(InputSchema);
1058
+ const destinationValidator = Live.stream(OutputSchema);
1059
+
1060
+ // Pipe valid data from source to destination
1061
+ sourceValidator.pipe(destinationValidator);
1062
+
1063
+ // Data flows: source → destination
1064
+ sourceValidator.validate(inputData);
1065
+ // If valid, automatically sent to destinationValidator
1066
+
1067
+ // Chain multiple streams
1068
+ const pipeline = sourceValidator
1069
+ .pipe(transformValidator)
1070
+ .pipe(destinationValidator);
1071
+ ```
1072
+
1073
+ ##### Form Validator - Advanced Form Integration
1074
+
1075
+ ```typescript
1076
+ // Create form validator with field binding
1077
+ const formValidator = Live.form(UserSchema);
1078
+
1079
+ // Bind form fields to validator
1080
+ formValidator.bindField("email", emailInput);
1081
+ formValidator.bindField("name", nameInput);
1082
+ formValidator.bindField("age", ageInput);
1083
+
1084
+ // Enable automatic validation on input changes
1085
+ formValidator.enableAutoValidation();
1086
+
1087
+ // Handle form submission
1088
+ formValidator.onSubmit((isValid, data, errors) => {
1089
+ if (isValid) {
1090
+ console.log("Form is valid, submitting:", data);
1091
+ submitToAPI(data);
1092
+ } else {
1093
+ console.log("Form has errors:", errors);
1094
+ displayErrors(errors);
1095
+ }
1096
+ });
1097
+
1098
+ // Manual form validation
1099
+ const formResult = formValidator.validateForm();
1100
+ console.log("Form valid:", formResult.isValid);
1101
+ ```
1102
+
1103
+ ##### Advanced Event Handling
1104
+
1105
+ ```typescript
1106
+ const streamValidator = Live.stream(UserSchema);
1107
+
1108
+ // Listen for all validation events
1109
+ streamValidator.on("data", (data) => {
1110
+ console.log("Data received for validation:", data);
1111
+ });
1112
+
1113
+ streamValidator.on("validated", (data, result) => {
1114
+ console.log("Validation completed:", result.isValid);
1115
+ });
1116
+
1117
+ streamValidator.on("queued", (data) => {
1118
+ console.log("Data queued (stream paused):", data);
1119
+ });
1120
+
1121
+ streamValidator.on("pause", () => {
1122
+ console.log("Stream paused");
1123
+ });
1124
+
1125
+ streamValidator.on("resume", () => {
1126
+ console.log("Stream resumed");
1127
+ });
1128
+
1129
+ // Error handling
1130
+ streamValidator.on("error", (error) => {
1131
+ console.error("Stream error:", error.message);
1132
+ // Handle gracefully without crashing
1133
+ });
1134
+ ```
1135
+
1136
+ ##### Performance and Statistics
1137
+
1138
+ ```typescript
1139
+ // Monitor stream performance
1140
+ streamValidator.onStats((stats) => {
1141
+ console.log("Validation Statistics:");
1142
+ console.log(`- Total validated: ${stats.totalValidated}`);
1143
+ console.log(`- Valid count: ${stats.validCount}`);
1144
+ console.log(`- Invalid count: ${stats.invalidCount}`);
1145
+ console.log(`- Error rate: ${(stats.errorRate * 100).toFixed(2)}%`);
1146
+ console.log(`- Running since: ${stats.startTime}`);
1147
+ });
1148
+
1149
+ // Get current statistics
1150
+ const currentStats = streamValidator.getStats();
1151
+ console.log("Current performance:", currentStats);
1152
+ ```
1153
+
1154
+ ##### Integration with InterfaceSchema
1155
+
1156
+ The Live utility is fully synchronized with InterfaceSchema modules, ensuring consistent validation behavior:
1157
+
1158
+ ```typescript
1159
+ const schema = Interface({
1160
+ email: "email",
1161
+ age: "number(18,120)",
1162
+ role: "admin|user|guest",
1163
+ });
1164
+
1165
+ // Both produce identical validation results
1166
+ const interfaceResult = schema.safeParse(userData);
1167
+ const liveResult = Live.stream(schema).validate(userData);
1168
+
1169
+ // Perfect synchronization guaranteed
1170
+ console.log("Results match:", interfaceResult.success === liveResult.isValid);
1171
+ ```
1172
+
1173
+ #### Documentation Generation
1174
+
1175
+ ```typescript
1176
+ import { Docs } from "reliant-type"; //in beta
1177
+
1178
+ // Generate OpenAPI specification
1179
+ const openApiSpec = Docs.openapi(UserSchema, {
1180
+ title: "User API",
1181
+ version: "1.0.0",
1182
+ servers: ["https://api.example.com"],
1183
+ });
1184
+
1185
+ // Generate TypeScript definitions
1186
+ const typeDefinitions = Docs.typescript(UserSchema, {
1187
+ exportName: "User",
1188
+ namespace: "API",
1189
+ });
1190
+ ```
1191
+
1192
+ #### Quick Utilities
1193
+
1194
+ ```typescript
1195
+ import { Quick } from "reliant-type";
1196
+
1197
+ // Quick schema inference
1198
+ const schema = Quick.fromSample(sampleData);
1199
+
1200
+ // Quick conditional validation
1201
+ const conditionalField = Quick.when("status").is("active").then("string");
1202
+
1203
+ // Quick documentation
1204
+ const docs = Quick.docs(schema);
1205
+ const typescript = Quick.typescript(schema);
1206
+ ```
1207
+
1208
+ ### Validation Configuration
1209
+
1210
+ #### Method Chaining
1211
+
1212
+ ```typescript
1213
+ const FlexibleSchema = UserSchema.loose() // Enable automatic type coercion
1214
+ .allowUnknown() // Accept extra properties
1215
+ .min(1) // Set minimum constraints
1216
+ .max(100) // Set maximum constraints
1217
+ .unique() // Require unique array values
1218
+ .pattern(/^[A-Z]/) // Apply regex pattern validation
1219
+ .default("N/A"); // Set default value
1220
+ ```
1221
+
1222
+ ## Contributing
1223
+
1224
+ By contributing to ReliantType, you help reliant-type to:
1225
+
1226
+ - Improve the quality of TypeScript validation
1227
+ - Expand the reach of TypeScript in the JavaScript ecosystem
1228
+ - Provide a robust and reliable validation solution for developers
1229
+ - Foster a community of developers who care about code quality and security
1230
+
1231
+ ### Development Environment
1232
+
1233
+ ```bash
1234
+ # Repository setup
1235
+ git clone https://github.com/Nehonix-Team/reliant-type.git
1236
+ cd reliant-type
1237
+
1238
+ # Dependency installation
1239
+ npm install
1240
+
1241
+ # Test suite execution
1242
+ npm run test
1243
+
1244
+ # Performance benchmarking
1245
+ npm run benchmark
1246
+
1247
+ # Project build
1248
+ npm run build
1249
+ ```
1250
+
1251
+ ### Quality Standards
1252
+
1253
+ - **TypeScript**: Strict mode with comprehensive type checking
1254
+ - **Test Coverage**: 95%+ coverage requirement
1255
+ - **Performance**: All benchmarks must pass performance thresholds
1256
+ - **Documentation**: Complete JSDoc comments for all public APIs
1257
+ - **Code Quality**: ESLint and Prettier configuration compliance
1258
+
1259
+ ### Contribution Process
1260
+
1261
+ 1. **Fork** the repository on GitHub
1262
+ 2. **Create** a feature branch: `git checkout -b feature/enhancement-name`
1263
+ 3. **Implement** changes with comprehensive test coverage
1264
+ 4. **Verify** all tests pass: `npm test`
1265
+ 5. **Validate** performance: `npm run benchmark`
1266
+ 6. **Commit** changes: `git commit -m 'Add enhancement: description'`
1267
+ 7. **Push** to branch: `git push origin feature/enhancement-name`
1268
+ 8. **Submit** a Pull Request with detailed description
1269
+
1270
+ ### Issue Reporting
1271
+
1272
+ For effective issue resolution, please provide:
1273
+
1274
+ - **Environment Details**: Reliant Type, TypeScript, and Node.js versions
1275
+ - **Reproduction Case**: Minimal code example demonstrating the issue
1276
+ - **Expected Behavior**: Clear description of intended functionality
1277
+ - **Actual Behavior**: Detailed explanation of observed behavior
1278
+ - **Error Information**: Complete error messages and stack traces
1279
+
1280
+ ## Release History
1281
+
1282
+ See [CHANGELOG.md](./CHANGELOG.md) for comprehensive release notes and migration guides.
1283
+
1284
+ ## License
1285
+
1286
+ MIT License - see [LICENSE](./LICENSE) file for complete terms.
1287
+
1288
+ ## Support Resources
1289
+
1290
+ - **Complete Documentation**: [Full documentation](./docs/)
1291
+ - **Issue Tracking**: [GitHub Issues](https://github.com/Nehonix-Team/reliant-type/issues)
1292
+ - **Community Discussions**: [GitHub Discussions](https://github.com/Nehonix-Team/reliant-type/discussions)
1293
+
1294
+ ---
1295
+
1296
+ **Development Status**: Reliant Type is in active development with a focus on production readiness. We maintain transparency about capabilities and limitations while continuously improving based on community feedback and real-world usage patterns.
1297
+
1298
+ <div align="center">
1299
+ <p><strong>Built by Nehonix</strong></p>
1300
+ <p>
1301
+ <a href="https://nehonix.space">Website</a> •
1302
+ <a href="https://sdk.nehonix.space">SDK</a> •
1303
+ <a href="https://github.com/Nehonix-Team">GitHub</a>
1304
+ </p>
1305
+ </div>