@warlock.js/seal 5.24.0 → 5.26.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 (255) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -21
  3. package/cjs/index.cjs +10 -5
  4. package/cjs/index.cjs.map +1 -1
  5. package/cjs/{object-DPPttDAF.cjs → object-BuKApaax.cjs} +3 -3
  6. package/cjs/object-BuKApaax.cjs.map +1 -0
  7. package/cjs/object.cjs +2 -2
  8. package/cjs/{required-methods-DJTm7yNP.cjs → required-methods-BOVNRtci.cjs} +12 -2
  9. package/cjs/required-methods-BOVNRtci.cjs.map +1 -0
  10. package/cjs/{string-C_pAtZPC.cjs → string-DpDpgefH.cjs} +2 -2
  11. package/cjs/string-DpDpgefH.cjs.map +1 -0
  12. package/cjs/string.cjs +2 -2
  13. package/esm/config.d.mts +0 -1
  14. package/esm/config.d.mts.map +1 -1
  15. package/esm/config.mjs.map +1 -1
  16. package/esm/factory/validate.mjs.map +1 -1
  17. package/esm/factory/validators.d.mts.map +1 -1
  18. package/esm/factory/validators.mjs +1 -1
  19. package/esm/factory/validators.mjs.map +1 -1
  20. package/esm/helpers/date-helpers.mjs.map +1 -1
  21. package/esm/helpers/get-field-value.d.mts +0 -1
  22. package/esm/helpers/get-field-value.d.mts.map +1 -1
  23. package/esm/helpers/get-field-value.mjs.map +1 -1
  24. package/esm/helpers/index.d.mts +5 -0
  25. package/esm/helpers/path-helpers.mjs.map +1 -1
  26. package/esm/helpers/validation-helpers.d.mts +0 -1
  27. package/esm/helpers/validation-helpers.d.mts.map +1 -1
  28. package/esm/mutators/array-mutators.d.mts +0 -1
  29. package/esm/mutators/array-mutators.d.mts.map +1 -1
  30. package/esm/mutators/array-mutators.mjs.map +1 -1
  31. package/esm/mutators/boolean-mutators.d.mts +0 -1
  32. package/esm/mutators/boolean-mutators.d.mts.map +1 -1
  33. package/esm/mutators/date-mutators.d.mts +0 -1
  34. package/esm/mutators/date-mutators.d.mts.map +1 -1
  35. package/esm/mutators/date-mutators.mjs.map +1 -1
  36. package/esm/mutators/index.d.mts +7 -0
  37. package/esm/mutators/number-mutators.d.mts +0 -1
  38. package/esm/mutators/number-mutators.d.mts.map +1 -1
  39. package/esm/mutators/number-mutators.mjs.map +1 -1
  40. package/esm/mutators/object-mutators.d.mts +0 -1
  41. package/esm/mutators/object-mutators.d.mts.map +1 -1
  42. package/esm/mutators/object-mutators.mjs.map +1 -1
  43. package/esm/mutators/scalar-mutators.d.mts +0 -1
  44. package/esm/mutators/scalar-mutators.d.mts.map +1 -1
  45. package/esm/mutators/scalar-mutators.mjs.map +1 -1
  46. package/esm/mutators/string-mutators.d.mts +0 -1
  47. package/esm/mutators/string-mutators.d.mts.map +1 -1
  48. package/esm/mutators/string-mutators.mjs.map +1 -1
  49. package/esm/plugins/plugin-system.mjs.map +1 -1
  50. package/esm/rules/array/array-rules.d.mts +0 -1
  51. package/esm/rules/array/array-rules.d.mts.map +1 -1
  52. package/esm/rules/array/array-rules.mjs.map +1 -1
  53. package/esm/rules/array/index.d.mts +1 -0
  54. package/esm/rules/color/color-rules.d.mts +0 -1
  55. package/esm/rules/color/color-rules.d.mts.map +1 -1
  56. package/esm/rules/color/color-rules.mjs.map +1 -1
  57. package/esm/rules/color/index.d.mts +1 -0
  58. package/esm/rules/common/enum.d.mts +0 -1
  59. package/esm/rules/common/enum.d.mts.map +1 -1
  60. package/esm/rules/common/enum.mjs.map +1 -1
  61. package/esm/rules/common/equals-field-rules.d.mts +0 -1
  62. package/esm/rules/common/equals-field-rules.d.mts.map +1 -1
  63. package/esm/rules/common/equals-field-rules.mjs.map +1 -1
  64. package/esm/rules/common/index.d.mts +6 -0
  65. package/esm/rules/common/instanceof.d.mts +0 -1
  66. package/esm/rules/common/instanceof.d.mts.map +1 -1
  67. package/esm/rules/common/literal.d.mts +0 -1
  68. package/esm/rules/common/literal.d.mts.map +1 -1
  69. package/esm/rules/common/type-rules.d.mts +0 -1
  70. package/esm/rules/common/type-rules.d.mts.map +1 -1
  71. package/esm/rules/common/type-rules.mjs.map +1 -1
  72. package/esm/rules/common/unknown-key.d.mts +0 -1
  73. package/esm/rules/common/unknown-key.d.mts.map +1 -1
  74. package/esm/rules/conditional/forbidden-if-rules.d.mts +0 -1
  75. package/esm/rules/conditional/forbidden-if-rules.d.mts.map +1 -1
  76. package/esm/rules/conditional/forbidden-if-rules.mjs.map +1 -1
  77. package/esm/rules/conditional/index.d.mts +10 -0
  78. package/esm/rules/conditional/present-if-rules.d.mts +0 -1
  79. package/esm/rules/conditional/present-if-rules.d.mts.map +1 -1
  80. package/esm/rules/conditional/present-if-rules.mjs.map +1 -1
  81. package/esm/rules/conditional/present-unless-rules.d.mts +0 -1
  82. package/esm/rules/conditional/present-unless-rules.d.mts.map +1 -1
  83. package/esm/rules/conditional/present-unless-rules.mjs.map +1 -1
  84. package/esm/rules/conditional/present-with-rules.d.mts +0 -1
  85. package/esm/rules/conditional/present-with-rules.d.mts.map +1 -1
  86. package/esm/rules/conditional/present-with-rules.mjs.map +1 -1
  87. package/esm/rules/conditional/present-without-rules.d.mts +0 -1
  88. package/esm/rules/conditional/present-without-rules.d.mts.map +1 -1
  89. package/esm/rules/conditional/present-without-rules.mjs.map +1 -1
  90. package/esm/rules/conditional/required-if-rules.d.mts +0 -1
  91. package/esm/rules/conditional/required-if-rules.d.mts.map +1 -1
  92. package/esm/rules/conditional/required-if-rules.mjs.map +1 -1
  93. package/esm/rules/conditional/required-unless-rules.d.mts +0 -1
  94. package/esm/rules/conditional/required-unless-rules.d.mts.map +1 -1
  95. package/esm/rules/conditional/required-unless-rules.mjs.map +1 -1
  96. package/esm/rules/conditional/required-when-rule.d.mts +0 -1
  97. package/esm/rules/conditional/required-when-rule.d.mts.map +1 -1
  98. package/esm/rules/conditional/required-with-rules.d.mts +0 -1
  99. package/esm/rules/conditional/required-with-rules.d.mts.map +1 -1
  100. package/esm/rules/conditional/required-with-rules.mjs.map +1 -1
  101. package/esm/rules/conditional/required-without-rules.d.mts +0 -1
  102. package/esm/rules/conditional/required-without-rules.d.mts.map +1 -1
  103. package/esm/rules/conditional/required-without-rules.mjs.map +1 -1
  104. package/esm/rules/core/equal.d.mts +0 -1
  105. package/esm/rules/core/equal.d.mts.map +1 -1
  106. package/esm/rules/core/equal.mjs.map +1 -1
  107. package/esm/rules/core/forbidden.d.mts +0 -1
  108. package/esm/rules/core/forbidden.d.mts.map +1 -1
  109. package/esm/rules/core/forbidden.mjs.map +1 -1
  110. package/esm/rules/core/index.d.mts +5 -0
  111. package/esm/rules/core/required.d.mts +0 -1
  112. package/esm/rules/core/required.d.mts.map +1 -1
  113. package/esm/rules/core/required.mjs.map +1 -1
  114. package/esm/rules/core/union.d.mts.map +1 -1
  115. package/esm/rules/core/union.mjs.map +1 -1
  116. package/esm/rules/core/when.d.mts +0 -1
  117. package/esm/rules/core/when.d.mts.map +1 -1
  118. package/esm/rules/core/when.mjs.map +1 -1
  119. package/esm/rules/date/date-comparison-rules.d.mts +0 -1
  120. package/esm/rules/date/date-comparison-rules.d.mts.map +1 -1
  121. package/esm/rules/date/date-comparison-rules.mjs.map +1 -1
  122. package/esm/rules/date/date-day-rules.d.mts +0 -1
  123. package/esm/rules/date/date-day-rules.d.mts.map +1 -1
  124. package/esm/rules/date/date-day-rules.mjs.map +1 -1
  125. package/esm/rules/date/date-field-comparison-rules.d.mts +0 -1
  126. package/esm/rules/date/date-field-comparison-rules.d.mts.map +1 -1
  127. package/esm/rules/date/date-field-comparison-rules.mjs.map +1 -1
  128. package/esm/rules/date/date-period-rules.d.mts +0 -1
  129. package/esm/rules/date/date-period-rules.d.mts.map +1 -1
  130. package/esm/rules/date/date-period-rules.mjs.map +1 -1
  131. package/esm/rules/date/date-relative-rules.d.mts +0 -1
  132. package/esm/rules/date/date-relative-rules.d.mts.map +1 -1
  133. package/esm/rules/date/date-relative-rules.mjs.map +1 -1
  134. package/esm/rules/date/date-special-rules.d.mts +0 -1
  135. package/esm/rules/date/date-special-rules.d.mts.map +1 -1
  136. package/esm/rules/date/date-special-rules.mjs.map +1 -1
  137. package/esm/rules/date/date.d.mts +0 -1
  138. package/esm/rules/date/date.d.mts.map +1 -1
  139. package/esm/rules/date/date.mjs.map +1 -1
  140. package/esm/rules/date/index.d.mts +7 -0
  141. package/esm/rules/file/dimensions.d.mts +0 -1
  142. package/esm/rules/file/dimensions.d.mts.map +1 -1
  143. package/esm/rules/file/dimensions.mjs.map +1 -1
  144. package/esm/rules/file/file-size.d.mts +0 -1
  145. package/esm/rules/file/file-size.d.mts.map +1 -1
  146. package/esm/rules/file/file-size.mjs.map +1 -1
  147. package/esm/rules/file/index.d.mts +2 -0
  148. package/esm/rules/index.d.mts +45 -0
  149. package/esm/rules/length/index.d.mts +1 -0
  150. package/esm/rules/length/length-rules.d.mts +0 -1
  151. package/esm/rules/length/length-rules.d.mts.map +1 -1
  152. package/esm/rules/length/length-rules.mjs.map +1 -1
  153. package/esm/rules/number/index.d.mts +1 -0
  154. package/esm/rules/number/number-rules.d.mts +0 -1
  155. package/esm/rules/number/number-rules.d.mts.map +1 -1
  156. package/esm/rules/number/number-rules.mjs.map +1 -1
  157. package/esm/rules/scalar/accepted-rule.mjs.map +1 -1
  158. package/esm/rules/scalar/declined-rule.mjs.map +1 -1
  159. package/esm/rules/string/alpha.d.mts +0 -1
  160. package/esm/rules/string/alpha.d.mts.map +1 -1
  161. package/esm/rules/string/alpha.mjs.map +1 -1
  162. package/esm/rules/string/credit-card.d.mts +0 -1
  163. package/esm/rules/string/credit-card.d.mts.map +1 -1
  164. package/esm/rules/string/credit-card.mjs.map +1 -1
  165. package/esm/rules/string/email.d.mts +0 -1
  166. package/esm/rules/string/email.d.mts.map +1 -1
  167. package/esm/rules/string/email.mjs.map +1 -1
  168. package/esm/rules/string/id-formats.d.mts +0 -1
  169. package/esm/rules/string/id-formats.d.mts.map +1 -1
  170. package/esm/rules/string/index.d.mts +11 -0
  171. package/esm/rules/string/ip.d.mts +0 -1
  172. package/esm/rules/string/ip.d.mts.map +1 -1
  173. package/esm/rules/string/matches.d.mts +0 -1
  174. package/esm/rules/string/matches.d.mts.map +1 -1
  175. package/esm/rules/string/matches.mjs.map +1 -1
  176. package/esm/rules/string/pattern.d.mts +0 -1
  177. package/esm/rules/string/pattern.d.mts.map +1 -1
  178. package/esm/rules/string/pattern.mjs.map +1 -1
  179. package/esm/rules/string/string-comparison.d.mts +0 -1
  180. package/esm/rules/string/string-comparison.d.mts.map +1 -1
  181. package/esm/rules/string/string-comparison.mjs.map +1 -1
  182. package/esm/rules/string/strong-password-rule.d.mts +0 -1
  183. package/esm/rules/string/strong-password-rule.d.mts.map +1 -1
  184. package/esm/rules/string/strong-password-rule.mjs.map +1 -1
  185. package/esm/rules/string/url.d.mts +0 -1
  186. package/esm/rules/string/url.d.mts.map +1 -1
  187. package/esm/rules/string/url.mjs.map +1 -1
  188. package/esm/rules/string/without-whitespace.d.mts +0 -1
  189. package/esm/rules/string/without-whitespace.d.mts.map +1 -1
  190. package/esm/rules/string/without-whitespace.mjs.map +1 -1
  191. package/esm/standard-schema/index.d.mts +3 -0
  192. package/esm/standard-schema/map-result.d.mts +0 -1
  193. package/esm/standard-schema/map-result.d.mts.map +1 -1
  194. package/esm/types/date-types.mjs.map +1 -1
  195. package/esm/types/index.d.mts +10 -0
  196. package/esm/validators/any-validator.mjs.map +1 -1
  197. package/esm/validators/array-validator.d.mts.map +1 -1
  198. package/esm/validators/array-validator.mjs +1 -0
  199. package/esm/validators/array-validator.mjs.map +1 -1
  200. package/esm/validators/base-validator.d.mts +2 -1
  201. package/esm/validators/base-validator.d.mts.map +1 -1
  202. package/esm/validators/base-validator.mjs +11 -1
  203. package/esm/validators/base-validator.mjs.map +1 -1
  204. package/esm/validators/boolean-validator.d.mts.map +1 -1
  205. package/esm/validators/boolean-validator.mjs +1 -0
  206. package/esm/validators/boolean-validator.mjs.map +1 -1
  207. package/esm/validators/computed-validator.d.mts.map +1 -1
  208. package/esm/validators/date-validator.d.mts +0 -1
  209. package/esm/validators/date-validator.d.mts.map +1 -1
  210. package/esm/validators/date-validator.mjs +1 -0
  211. package/esm/validators/date-validator.mjs.map +1 -1
  212. package/esm/validators/discriminated-union-validator.d.mts.map +1 -1
  213. package/esm/validators/float-validator.mjs.map +1 -1
  214. package/esm/validators/int-validator.mjs.map +1 -1
  215. package/esm/validators/lazy-validator.d.mts.map +1 -1
  216. package/esm/validators/literal-validator.d.mts.map +1 -1
  217. package/esm/validators/literal-validator.mjs +1 -3
  218. package/esm/validators/literal-validator.mjs.map +1 -1
  219. package/esm/validators/managed-validator.d.mts.map +1 -1
  220. package/esm/validators/methods/equality-conditional-methods.d.mts +0 -1
  221. package/esm/validators/methods/equality-conditional-methods.d.mts.map +1 -1
  222. package/esm/validators/methods/equality-conditional-methods.mjs.map +1 -1
  223. package/esm/validators/methods/forbidden-methods.mjs.map +1 -1
  224. package/esm/validators/methods/present-methods.mjs.map +1 -1
  225. package/esm/validators/methods/required-methods.d.mts +0 -1
  226. package/esm/validators/methods/required-methods.d.mts.map +1 -1
  227. package/esm/validators/methods/required-methods.mjs.map +1 -1
  228. package/esm/validators/number-validator.d.mts.map +1 -1
  229. package/esm/validators/number-validator.mjs +1 -0
  230. package/esm/validators/number-validator.mjs.map +1 -1
  231. package/esm/validators/numeric-validator.mjs.map +1 -1
  232. package/esm/validators/object-validator.d.mts.map +1 -1
  233. package/esm/validators/object-validator.mjs +1 -1
  234. package/esm/validators/object-validator.mjs.map +1 -1
  235. package/esm/validators/record-validator.d.mts.map +1 -1
  236. package/esm/validators/record-validator.mjs.map +1 -1
  237. package/esm/validators/scalar-validator.d.mts.map +1 -1
  238. package/esm/validators/scalar-validator.mjs +1 -0
  239. package/esm/validators/scalar-validator.mjs.map +1 -1
  240. package/esm/validators/string-validator.mjs.map +1 -1
  241. package/esm/validators/tuple-validator.d.mts.map +1 -1
  242. package/esm/validators/tuple-validator.mjs.map +1 -1
  243. package/esm/validators/union-validator.mjs.map +1 -1
  244. package/llms-full.txt +1166 -1168
  245. package/llms.txt +1 -1
  246. package/package.json +1 -1
  247. package/skills/bridge-standard-schema/SKILL.md +138 -138
  248. package/skills/define-structural-shape/SKILL.md +138 -138
  249. package/skills/extend-seal-with-plugins/SKILL.md +178 -178
  250. package/skills/generate-json-schema/SKILL.md +143 -143
  251. package/skills/handle-seal-errors/SKILL.md +148 -148
  252. package/skills/pick-seal-primitive/SKILL.md +149 -149
  253. package/cjs/object-DPPttDAF.cjs.map +0 -1
  254. package/cjs/required-methods-DJTm7yNP.cjs.map +0 -1
  255. package/cjs/string-C_pAtZPC.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"required-if-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-if-rules.ts"],"mappings":";;;;;AASA;;cAAa,cAAA,EAAgB,UAAU;EACrC,KAAA;EACA,KAAA;EACA,KAAA;AAAA;;;AAAK;AAyBP;cAAa,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA;;;;AAAK;cAwBM,sBAAA,EAAwB,UAAU;EAC7C,KAAA;EACA,KAAA;AAAA;;;;;cAwBW,gBAAA,EAAkB,UAAU;EACvC,KAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;;cA0BW,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;;cAsCW,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;;;;;cA2BW,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;AAFF;;;;AAAA,cA6Ba,yBAAA,EAA2B,UAAU;EAChD,MAAA;EACA,KAAA;AAAA;AA7BK;AA2BP;;;AA3BO,cAwDM,yBAAA,EAA2B,UAAU;EAChD,MAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"required-if-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-if-rules.ts"],"mappings":";;;;;AASA;cAAa,cAAA,EAAgB,UAAU;EACrC,KAAA;EACA,KAAA;EACA,KAAA;AAAA;;;;AAAK;cAyBM,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA;;;;;cAwBW,sBAAA,EAAwB,UAAU;EAC7C,KAAA;EACA,KAAA;AAAA;;;;;cAwBW,gBAAA,EAAkB,UAAU;EACvC,KAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;;cA0BW,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;;cAsCW,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;AAFF;;;;AAAA,cA6Ba,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;AA7BK;AA2BP;;;AA3BO,cAwDM,yBAAA,EAA2B,UAAU;EAChD,MAAA;EACA,KAAA;AAAA;;AA7BK;AA2BP;;cA6Ba,yBAAA,EAA2B,UAAU;EAChD,MAAA;EACA,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-if-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-if-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Required if rule - field is required if another field equals a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIf\",\r\n description: \"The field is required if another field equals a specific value\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { value: expectedValue } = this.context.options;\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field equals the expected value\r\n if (isEmptyValue(value) && fieldValue === expectedValue) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if empty rule - field is required if another field is empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfEmpty\",\r\n description: \"The field is required if :field is empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field is empty\r\n if (isEmptyValue(value) && isEmptyValue(fieldValue)) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if not empty rule - field is required if another field is not empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfNotEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfNotEmpty\",\r\n description: \"The field is required if :field is not empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field is not empty\r\n if (isEmptyValue(value) && !isEmptyValue(fieldValue)) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if in rule - field is required if another field's value is in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfIn\",\r\n description: \"The field is required if :field value is in the given array\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { values } = this.context.options;\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field's value is in the array\r\n if (isEmptyValue(value) && values.includes(fieldValue)) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n this.context.translationParams.values = this.context.options.values.join(\", \");\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if not in rule - field is required if another field's value is NOT in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfNotInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfNotIn\",\r\n description: \"The field is required if another field's value is NOT in the given array\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { values } = this.context.options;\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field's value is NOT in the array\r\n if (isEmptyValue(value) && !values.includes(fieldValue)) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n this.context.translationParams.values = this.context.options.values.join(\", \");\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Get multiple field values based on scope\r\n */\r\nfunction getFieldsValues(\r\n rule: SchemaRule<{ fields: string[]; scope?: \"global\" | \"sibling\" }>,\r\n context: any,\r\n): any[] {\r\n const { fields, scope = \"global\" } = (rule as any).context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n return fields.map((field: string) => get(source, field));\r\n}\r\n\r\n/**\r\n * Required if all empty rule - field is required if ALL specified fields are empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfAllEmptyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfAllEmpty\",\r\n description: \"The field is required if all :fields are empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValues = getFieldsValues(this, context);\r\n\r\n // Field is required if ALL other fields are empty\r\n const allEmpty = fieldValues.every((v) => isEmptyValue(v));\r\n if (isEmptyValue(value) && allEmpty) {\r\n this.context.options.fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if any empty rule - field is required if ANY of the specified fields is empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfAnyEmptyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfAnyEmpty\",\r\n description: \"The field is required if any of the :fields is empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValues = getFieldsValues(this, context);\r\n\r\n // Field is required if ANY other field is empty\r\n const anyEmpty = fieldValues.some((v) => isEmptyValue(v));\r\n if (isEmptyValue(value) && anyEmpty) {\r\n this.context.options.fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if all not empty rule - field is required if ALL specified fields are NOT empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfAllNotEmptyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfAllNotEmpty\",\r\n description: \"The field is required if all :fields are not empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValues = getFieldsValues(this, context);\r\n\r\n // Field is required if ALL other fields are NOT empty\r\n const allNotEmpty = fieldValues.every((v) => !isEmptyValue(v));\r\n if (isEmptyValue(value) && allNotEmpty) {\r\n this.context.options.fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required if any not empty rule - field is required if ANY of the specified fields is NOT empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredIfAnyNotEmptyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredIfAnyNotEmpty\",\r\n description: \"The field is required if any of the :fields is not empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValues = getFieldsValues(this, context);\r\n\r\n // Field is required if ANY other field is NOT empty\r\n const anyNotEmpty = fieldValues.some((v) => !isEmptyValue(v));\r\n if (isEmptyValue(value) && anyNotEmpty) {\r\n this.context.options.fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":"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"}
1
+ {"version":3,"file":"required-if-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-if-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Required if rule - field is required if another field equals a specific value\n * Supports both global and sibling scope\n */\nexport const requiredIfRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIf\",\n description: \"The field is required if another field equals a specific value\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field equals the expected value\n if (isEmptyValue(value) && fieldValue === expectedValue) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if empty rule - field is required if another field is empty\n * Supports both global and sibling scope\n */\nexport const requiredIfEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfEmpty\",\n description: \"The field is required if :field is empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field is empty\n if (isEmptyValue(value) && isEmptyValue(fieldValue)) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if not empty rule - field is required if another field is not empty\n * Supports both global and sibling scope\n */\nexport const requiredIfNotEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfNotEmpty\",\n description: \"The field is required if :field is not empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field is not empty\n if (isEmptyValue(value) && !isEmptyValue(fieldValue)) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if in rule - field is required if another field's value is in the given array\n * Supports both global and sibling scope\n */\nexport const requiredIfInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfIn\",\n description: \"The field is required if :field value is in the given array\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field's value is in the array\n if (isEmptyValue(value) && values.includes(fieldValue)) {\n this.context.translatableParams.field = this.context.options.field;\n this.context.translationParams.values = this.context.options.values.join(\", \");\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if not in rule - field is required if another field's value is NOT in the given array\n * Supports both global and sibling scope\n */\nexport const requiredIfNotInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfNotIn\",\n description: \"The field is required if another field's value is NOT in the given array\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field's value is NOT in the array\n if (isEmptyValue(value) && !values.includes(fieldValue)) {\n this.context.translatableParams.field = this.context.options.field;\n this.context.translationParams.values = this.context.options.values.join(\", \");\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Get multiple field values based on scope\n */\nfunction getFieldsValues(\n rule: SchemaRule<{ fields: string[]; scope?: \"global\" | \"sibling\" }>,\n context: any,\n): any[] {\n const { fields, scope = \"global\" } = (rule as any).context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n return fields.map((field: string) => get(source, field));\n}\n\n/**\n * Required if all empty rule - field is required if ALL specified fields are empty\n * Supports both global and sibling scope\n */\nexport const requiredIfAllEmptyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfAllEmpty\",\n description: \"The field is required if all :fields are empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValues = getFieldsValues(this, context);\n\n // Field is required if ALL other fields are empty\n const allEmpty = fieldValues.every((v) => isEmptyValue(v));\n if (isEmptyValue(value) && allEmpty) {\n this.context.options.fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if any empty rule - field is required if ANY of the specified fields is empty\n * Supports both global and sibling scope\n */\nexport const requiredIfAnyEmptyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfAnyEmpty\",\n description: \"The field is required if any of the :fields is empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValues = getFieldsValues(this, context);\n\n // Field is required if ANY other field is empty\n const anyEmpty = fieldValues.some((v) => isEmptyValue(v));\n if (isEmptyValue(value) && anyEmpty) {\n this.context.options.fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if all not empty rule - field is required if ALL specified fields are NOT empty\n * Supports both global and sibling scope\n */\nexport const requiredIfAllNotEmptyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfAllNotEmpty\",\n description: \"The field is required if all :fields are not empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValues = getFieldsValues(this, context);\n\n // Field is required if ALL other fields are NOT empty\n const allNotEmpty = fieldValues.every((v) => !isEmptyValue(v));\n if (isEmptyValue(value) && allNotEmpty) {\n this.context.options.fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required if any not empty rule - field is required if ANY of the specified fields is NOT empty\n * Supports both global and sibling scope\n */\nexport const requiredIfAnyNotEmptyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredIfAnyNotEmpty\",\n description: \"The field is required if any of the :fields is not empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValues = getFieldsValues(this, context);\n\n // Field is required if ANY other field is NOT empty\n const anyNotEmpty = fieldValues.some((v) => !isEmptyValue(v));\n if (isEmptyValue(value) && anyNotEmpty) {\n this.context.options.fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":"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"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/conditional/required-unless-rules.d.ts
4
3
  /**
5
4
  * Required unless rule - field is required unless another field equals a specific value
@@ -1 +1 @@
1
- {"version":3,"file":"required-unless-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-unless-rules.ts"],"mappings":";;;;;AAQA;;cAAa,kBAAA,EAAoB,UAAU;EACzC,KAAA;EACA,KAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"required-unless-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-unless-rules.ts"],"mappings":";;;;;AAQA;cAAa,kBAAA,EAAoB,UAAU;EACzC,KAAA;EACA,KAAA;EACA,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-unless-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-unless-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\nimport { isEmptyValue } from \"./../../helpers/is-empty-value\";\r\n\r\n/**\r\n * Required unless rule - field is required unless another field equals a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredUnlessRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredUnless\",\r\n description: \"The field is required unless another field equals a specific value\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { value: expectedValue } = this.context.options;\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required unless the other field equals the expected value\r\n if (isEmptyValue(value) && fieldValue !== expectedValue) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n this.context.translationParams.value = this.context.options.value;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;AAQA,MAAa,qBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,OAAO,kBAAkB,KAAK,QAAQ;EAC9C,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,eAAe;GACvD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,KAAK,QAAQ,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ;GAC5D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"required-unless-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-unless-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\nimport { isEmptyValue } from \"./../../helpers/is-empty-value\";\n\n/**\n * Required unless rule - field is required unless another field equals a specific value\n * Supports both global and sibling scope\n */\nexport const requiredUnlessRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredUnless\",\n description: \"The field is required unless another field equals a specific value\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is required unless the other field equals the expected value\n if (isEmptyValue(value) && fieldValue !== expectedValue) {\n this.context.translatableParams.field = this.context.options.field;\n this.context.translationParams.value = this.context.options.value;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,qBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,OAAO,kBAAkB,KAAK,QAAQ;EAC9C,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,eAAe;GACvD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,KAAK,QAAQ,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ;GAC5D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1,6 +1,5 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
2
  import { SchemaContext } from "../../types/context-types.mjs";
3
-
4
3
  //#region ../seal/src/rules/conditional/required-when-rule.d.ts
5
4
  /**
6
5
  * Required when callback returns true.
@@ -1 +1 @@
1
- {"version":3,"file":"required-when-rule.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-when-rule.ts"],"mappings":";;;;;;;AAiBA;;;;;;;;;;cAAa,gBAAA,EAAkB,UAAA;EAC7B,QAAA,GAAW,OAAA,EAAS,aAAA,eAA4B,OAAA;AAAA"}
1
+ {"version":3,"file":"required-when-rule.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-when-rule.ts"],"mappings":";;;;;;;AAiBA;;;;;;;;;cAAa,gBAAA,EAAkB,UAAA;EAC7B,QAAA,GAAW,OAAA,EAAS,aAAA,eAA4B,OAAA;AAAA"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/conditional/required-with-rules.d.ts
4
3
  /**
5
4
  * Required with rule - field is required if another field is present
@@ -1 +1 @@
1
- {"version":3,"file":"required-with-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-with-rules.ts"],"mappings":";;;;;AASA;;cAAa,gBAAA,EAAkB,UAAU;EACvC,KAAA;EACA,KAAA;AAAA;;;AAAK;AAwBP;cAAa,mBAAA,EAAqB,UAAU;EAC1C,MAAA;EACA,KAAA;AAAA;;;;AAAK;cA2BM,mBAAA,EAAqB,UAAU;EAC1C,MAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"required-with-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-with-rules.ts"],"mappings":";;;;;AASA;cAAa,gBAAA,EAAkB,UAAU;EACvC,KAAA;EACA,KAAA;AAAA;;;;AAAK;cAwBM,mBAAA,EAAqB,UAAU;EAC1C,MAAA;EACA,KAAA;AAAA;;;;;cA2BW,mBAAA,EAAqB,UAAU;EAC1C,MAAA;EACA,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-with-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-with-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Required with rule - field is required if another field is present\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWith\",\r\n description: \"The field is required if another field is present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field is present\r\n if (isEmptyValue(value) && fieldValue !== undefined) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required with all rule - field is required if all specified fields are present\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithAllRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWithAll\",\r\n description: \"The field is required if all specified fields are present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { fields, scope = \"global\" } = this.context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n\r\n // Check if all fields are present\r\n const allPresent = fields.every((field) => get(source, field) !== undefined);\r\n\r\n // Field is required if all other fields are present\r\n if (isEmptyValue(value) && allPresent) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required with any rule - field is required if any of the specified fields is present\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithAnyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWithAny\",\r\n description: \"The field is required if any of the specified fields is present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { fields, scope = \"global\" } = this.context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n\r\n // Check if any field is present\r\n const anyPresent = fields.some((field) => get(source, field) !== undefined);\r\n\r\n // Field is required if any other field is present\r\n if (isEmptyValue(value) && anyPresent) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AASA,MAAa,mBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,OAAO,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG3E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,MAAM,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG1E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"required-with-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-with-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Required with rule - field is required if another field is present\n * Supports both global and sibling scope\n */\nexport const requiredWithRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWith\",\n description: \"The field is required if another field is present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field is present\n if (isEmptyValue(value) && fieldValue !== undefined) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required with all rule - field is required if all specified fields are present\n * Supports both global and sibling scope\n */\nexport const requiredWithAllRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWithAll\",\n description: \"The field is required if all specified fields are present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if all fields are present\n const allPresent = fields.every((field) => get(source, field) !== undefined);\n\n // Field is required if all other fields are present\n if (isEmptyValue(value) && allPresent) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required with any rule - field is required if any of the specified fields is present\n * Supports both global and sibling scope\n */\nexport const requiredWithAnyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWithAny\",\n description: \"The field is required if any of the specified fields is present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if any field is present\n const anyPresent = fields.some((field) => get(source, field) !== undefined);\n\n // Field is required if any other field is present\n if (isEmptyValue(value) && anyPresent) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,mBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,OAAO,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG3E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,MAAM,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG1E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/conditional/required-without-rules.d.ts
4
3
  /**
5
4
  * Required without rule - field is required if another field is missing
@@ -1 +1 @@
1
- {"version":3,"file":"required-without-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-without-rules.ts"],"mappings":";;;;;AASA;;cAAa,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA;;;AAAK;AAwBP;cAAa,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;;;;AAAK;cA2BM,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"required-without-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-without-rules.ts"],"mappings":";;;;;AASA;cAAa,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA;;;;AAAK;cAwBM,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA;;;;;cA2BW,sBAAA,EAAwB,UAAU;EAC7C,MAAA;EACA,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-without-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-without-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\nimport { isEmptyValue } from \"./../../helpers/is-empty-value\";\r\n\r\n/**\r\n * Required without rule - field is required if another field is missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithoutRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWithout\",\r\n description: \"The field is required if another field is missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is required if the other field is missing\r\n if (isEmptyValue(value) && fieldValue === undefined) {\r\n this.context.translatableParams.field = this.context.options.field;\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required without all rule - field is required if all specified fields are missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithoutAllRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWithoutAll\",\r\n description: \"The field is required if all specified fields are missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { fields, scope = \"global\" } = this.context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n\r\n // Check if all fields are missing\r\n const allMissing = fields.every((field) => get(source, field) === undefined);\r\n\r\n // Field is required if all other fields are missing\r\n if (isEmptyValue(value) && allMissing) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Required without any rule - field is required if any of the specified fields is missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const requiredWithoutAnyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"requiredWithoutAny\",\r\n description: \"The field is required if any of the specified fields is missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input is required\",\r\n async validate(value: any, context) {\r\n const { fields, scope = \"global\" } = this.context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n\r\n // Check if any field is missing\r\n const anyMissing = fields.some((field) => get(source, field) === undefined);\r\n\r\n // Field is required if any other field is missing\r\n if (isEmptyValue(value) && anyMissing) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AASA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,yBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,OAAO,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG3E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,yBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,MAAM,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG1E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"required-without-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/conditional/required-without-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\nimport { isEmptyValue } from \"./../../helpers/is-empty-value\";\n\n/**\n * Required without rule - field is required if another field is missing\n * Supports both global and sibling scope\n */\nexport const requiredWithoutRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWithout\",\n description: \"The field is required if another field is missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is required if the other field is missing\n if (isEmptyValue(value) && fieldValue === undefined) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required without all rule - field is required if all specified fields are missing\n * Supports both global and sibling scope\n */\nexport const requiredWithoutAllRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWithoutAll\",\n description: \"The field is required if all specified fields are missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if all fields are missing\n const allMissing = fields.every((field) => get(source, field) === undefined);\n\n // Field is required if all other fields are missing\n if (isEmptyValue(value) && allMissing) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Required without any rule - field is required if any of the specified fields is missing\n * Supports both global and sibling scope\n */\nexport const requiredWithoutAnyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"requiredWithoutAny\",\n description: \"The field is required if any of the specified fields is missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input is required\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if any field is missing\n const anyMissing = fields.some((field) => get(source, field) === undefined);\n\n // Field is required if any other field is missing\n if (isEmptyValue(value) && anyMissing) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,aAAa,KAAK,KAAK,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,yBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,OAAO,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG3E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,yBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,QAAQ,QAAQ,aAAa,KAAK,QAAQ;EAClD,MAAM,SAAS,UAAU,YAAY,QAAQ,SAAS,QAAQ;EAG9D,MAAM,aAAa,OAAO,MAAM,UAAU,IAAI,QAAQ,KAAK,MAAM,MAAS;EAG1E,IAAI,aAAa,KAAK,KAAK,YACzB,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/core/equal.d.ts
4
3
  /**
5
4
  * Equal rule - value must be equal to a specific value
@@ -1 +1 @@
1
- {"version":3,"file":"equal.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/equal.ts"],"mappings":";;;;;AAMA;cAAa,SAAA,EAAW,UAAU;EAAG,KAAK;AAAA"}
1
+ {"version":3,"file":"equal.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/equal.ts"],"mappings":";;;;;cAMa,SAAA,EAAW,UAAU;EAAG,KAAK;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"equal.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/equal.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Equal rule - value must be equal to a specific value\r\n */\r\nexport const equalRule: SchemaRule<{ value: any }> = {\r\n name: \"equal\",\r\n defaultErrorMessage: \"The :input must be equal to :value\",\r\n async validate(value: any, context) {\r\n if (value !== this.context.options.value) {\r\n this.context.translatableParams.value = this.context.options.value;\r\n return invalidRule(this, context);\r\n }\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAMA,MAAa,YAAwC;CACnD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,UAAU,KAAK,QAAQ,QAAQ,OAAO;GACxC,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"equal.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/equal.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Equal rule - value must be equal to a specific value\n */\nexport const equalRule: SchemaRule<{ value: any }> = {\n name: \"equal\",\n defaultErrorMessage: \"The :input must be equal to :value\",\n async validate(value: any, context) {\n if (value !== this.context.options.value) {\n this.context.translatableParams.value = this.context.options.value;\n return invalidRule(this, context);\n }\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;AAMA,MAAa,YAAwC;CACnD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,UAAU,KAAK,QAAQ,QAAQ,OAAO;GACxC,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EACA,OAAO;CACT;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/core/forbidden.d.ts
4
3
  /**
5
4
  * Forbidden rule - value must not be present
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/forbidden.ts"],"mappings":";;;;;AAOA;cAAa,aAAA,EAAe,UAS3B"}
1
+ {"version":3,"file":"forbidden.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/forbidden.ts"],"mappings":";;;;;cAOa,aAAA,EAAe,UAS3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/forbidden.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Forbidden rule - value must not be present\r\n */\r\nexport const forbiddenRule: SchemaRule = {\r\n name: \"forbidden\",\r\n defaultErrorMessage: \"The :input is forbidden\",\r\n async validate(value: any, context) {\r\n if (!isEmptyValue(value)) {\r\n return invalidRule(this, context);\r\n }\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAA4B;CACvC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,CAAC,aAAa,KAAK,GACrB,OAAO,YAAY,MAAM,OAAO;EAElC,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"forbidden.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/forbidden.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Forbidden rule - value must not be present\n */\nexport const forbiddenRule: SchemaRule = {\n name: \"forbidden\",\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n if (!isEmptyValue(value)) {\n return invalidRule(this, context);\n }\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAA4B;CACvC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,CAAC,aAAa,KAAK,GACrB,OAAO,YAAY,MAAM,OAAO;EAElC,OAAO;CACT;AACF"}
@@ -0,0 +1,5 @@
1
+ import { equalRule } from "./equal.mjs";
2
+ import { forbiddenRule } from "./forbidden.mjs";
3
+ import { presentRule, requiredRule } from "./required.mjs";
4
+ import { unionRule } from "./union.mjs";
5
+ import { whenRule } from "./when.mjs";
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/core/required.d.ts
4
3
  /**
5
4
  * Required rule - value must be present and not empty
@@ -1 +1 @@
1
- {"version":3,"file":"required.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/required.ts"],"mappings":";;;;;AAOA;cAAa,YAAA,EAAc,UAW1B;;;AAAA;AAMD;cAAa,WAAA,EAAa,UAYzB"}
1
+ {"version":3,"file":"required.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/required.ts"],"mappings":";;;;;cAOa,YAAA,EAAc,UAW1B;;;;AAAA;cAMY,WAAA,EAAa,UAYzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"required.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/required.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Required rule - value must be present and not empty\r\n */\r\nexport const requiredRule: SchemaRule = {\r\n name: \"required\",\r\n defaultErrorMessage: \"The :input is required\",\r\n requiresValue: false,\r\n sortOrder: -2,\r\n async validate(value: any, context) {\r\n if (isEmptyValue(value)) {\r\n return invalidRule(this, context);\r\n }\r\n return VALID_RULE;\r\n },\r\n};\r\n\r\n/**\r\n * Present rule - key must exist in the data, but value can be anything\r\n * (empty string, null are all valid as long as the key exists)\r\n */\r\nexport const presentRule: SchemaRule = {\r\n name: \"present\",\r\n defaultErrorMessage: \"The :input field is required\",\r\n requiresValue: false,\r\n sortOrder: -2,\r\n async validate(value: any, context) {\r\n if (value === undefined) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAOA,MAAa,eAA2B;CACtC,MAAM;CACN,qBAAqB;CACrB,eAAe;CACf,WAAW;CACX,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,aAAa,KAAK,GACpB,OAAO,YAAY,MAAM,OAAO;EAElC,OAAO;CACT;AACF;;;;;AAMA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,eAAe;CACf,WAAW;CACX,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,UAAU,QACZ,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"required.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/required.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Required rule - value must be present and not empty\n */\nexport const requiredRule: SchemaRule = {\n name: \"required\",\n defaultErrorMessage: \"The :input is required\",\n requiresValue: false,\n sortOrder: -2,\n async validate(value: any, context) {\n if (isEmptyValue(value)) {\n return invalidRule(this, context);\n }\n return VALID_RULE;\n },\n};\n\n/**\n * Present rule - key must exist in the data, but value can be anything\n * (empty string, null are all valid as long as the key exists)\n */\nexport const presentRule: SchemaRule = {\n name: \"present\",\n defaultErrorMessage: \"The :input field is required\",\n requiresValue: false,\n sortOrder: -2,\n async validate(value: any, context) {\n if (value === undefined) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,eAA2B;CACtC,MAAM;CACN,qBAAqB;CACrB,eAAe;CACf,WAAW;CACX,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,aAAa,KAAK,GACpB,OAAO,YAAY,MAAM,OAAO;EAElC,OAAO;CACT;AACF;;;;;AAMA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,eAAe;CACf,WAAW;CACX,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,UAAU,QACZ,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/union.ts"],"mappings":";;;;;;AAOA;cAAa,SAAA,EAAW,UAAU;EAAG,UAAA,EAAY,aAAA;AAAA"}
1
+ {"version":3,"file":"union.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/union.ts"],"mappings":";;;;;;;cAOa,SAAA,EAAW,UAAU;EAAG,UAAA,EAAY,aAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"union.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/union.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\nimport type { BaseValidator } from \"../../validators/base-validator\";\r\n\r\n/**\r\n * Union rule - value must match at least one of the provided validators\r\n */\r\nexport const unionRule: SchemaRule<{ validators: BaseValidator[] }> = {\r\n name: \"union\",\r\n defaultErrorMessage: \"Value must match one of the allowed types\",\r\n async validate(value: any, context) {\r\n const validators = this.context.options.validators;\r\n const firstErrorOnly = context.configurations?.firstErrorOnly ?? true;\r\n const allErrors: string[] = [];\r\n\r\n // Try each validator\r\n for (const validator of validators) {\r\n // Skip if type doesn't match (optimization)\r\n if (!validator.matchesType(value)) {\r\n continue;\r\n }\r\n\r\n // Type matches - validate\r\n const result = await validator.validate(value, context);\r\n\r\n if (result.isValid) {\r\n // Success! Validator matched and validated\r\n return VALID_RULE;\r\n }\r\n\r\n // Failed - collect error message\r\n const errorMsg = result.errors?.[0]?.error || \"Validation failed\";\r\n allErrors.push(errorMsg);\r\n\r\n // If firstErrorOnly, stop after first failed validator\r\n if (firstErrorOnly) {\r\n break;\r\n }\r\n }\r\n\r\n // All failed or no validator matched the type\r\n if (allErrors.length > 0) {\r\n // At least one validator matched type but failed validation\r\n this.context.errorMessage = firstErrorOnly\r\n ? allErrors[0]\r\n : allErrors.join(\"; \");\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAOA,MAAa,YAAyD;CACpE,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,KAAK,QAAQ,QAAQ;EACxC,MAAM,iBAAiB,QAAQ,gBAAgB,kBAAkB;EACjE,MAAM,YAAsB,CAAC;EAG7B,KAAK,MAAM,aAAa,YAAY;GAElC,IAAI,CAAC,UAAU,YAAY,KAAK,GAC9B;GAIF,MAAM,SAAS,MAAM,UAAU,SAAS,OAAO,OAAO;GAEtD,IAAI,OAAO,SAET,OAAO;GAIT,MAAM,WAAW,OAAO,SAAS,EAAE,EAAE,SAAS;GAC9C,UAAU,KAAK,QAAQ;GAGvB,IAAI,gBACF;EAEJ;EAGA,IAAI,UAAU,SAAS,GAErB,KAAK,QAAQ,eAAe,iBACxB,UAAU,KACV,UAAU,KAAK,IAAI;EAGzB,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
1
+ {"version":3,"file":"union.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/union.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\nimport type { BaseValidator } from \"../../validators/base-validator\";\n\n/**\n * Union rule - value must match at least one of the provided validators\n */\nexport const unionRule: SchemaRule<{ validators: BaseValidator[] }> = {\n name: \"union\",\n defaultErrorMessage: \"Value must match one of the allowed types\",\n async validate(value: any, context) {\n const validators = this.context.options.validators;\n const firstErrorOnly = context.configurations?.firstErrorOnly ?? true;\n const allErrors: string[] = [];\n\n // Try each validator\n for (const validator of validators) {\n // Skip if type doesn't match (optimization)\n if (!validator.matchesType(value)) {\n continue;\n }\n\n // Type matches - validate\n const result = await validator.validate(value, context);\n\n if (result.isValid) {\n // Success! Validator matched and validated\n return VALID_RULE;\n }\n\n // Failed - collect error message\n const errorMsg = result.errors?.[0]?.error || \"Validation failed\";\n allErrors.push(errorMsg);\n\n // If firstErrorOnly, stop after first failed validator\n if (firstErrorOnly) {\n break;\n }\n }\n\n // All failed or no validator matched the type\n if (allErrors.length > 0) {\n // At least one validator matched type but failed validation\n this.context.errorMessage = firstErrorOnly\n ? allErrors[0]\n : allErrors.join(\"; \");\n }\n\n return invalidRule(this, context);\n },\n};\n"],"mappings":";;;;;;;AAOA,MAAa,YAAyD;CACpE,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,KAAK,QAAQ,QAAQ;EACxC,MAAM,iBAAiB,QAAQ,gBAAgB,kBAAkB;EACjE,MAAM,YAAsB,CAAC;EAG7B,KAAK,MAAM,aAAa,YAAY;GAElC,IAAI,CAAC,UAAU,YAAY,KAAK,GAC9B;GAIF,MAAM,SAAS,MAAM,UAAU,SAAS,OAAO,OAAO;GAEtD,IAAI,OAAO,SAET,OAAO;GAIT,MAAM,WAAW,OAAO,SAAS,EAAE,EAAE,SAAS;GAC9C,UAAU,KAAK,QAAQ;GAGvB,IAAI,gBACF;EAEJ;EAGA,IAAI,UAAU,SAAS,GAErB,KAAK,QAAQ,eAAe,iBACxB,UAAU,KACV,UAAU,KAAK,IAAI;EAGzB,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,6 +1,5 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
2
  import { WhenRuleOptions } from "../../types/conditional-types.mjs";
3
-
4
3
  //#region ../seal/src/rules/core/when.d.ts
5
4
  /**
6
5
  * When rule - conditional validation based on another field value
@@ -1 +1 @@
1
- {"version":3,"file":"when.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/when.ts"],"mappings":";;;;;;;cAOa,QAAA,EAAU,UAAU,CAAC,eAAA"}
1
+ {"version":3,"file":"when.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/core/when.ts"],"mappings":";;;;;;cAOa,QAAA,EAAU,UAAU,CAAC,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"when.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/when.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule, WhenRuleOptions } from \"../../types\";\r\n\r\n/**\r\n * When rule - conditional validation based on another field value\r\n */\r\nexport const whenRule: SchemaRule<WhenRuleOptions> = {\r\n name: \"when\",\r\n description: \"Apply conditional validation based on another field value\",\r\n async validate(value: any, context) {\r\n const fieldToCheck = this.context.options.field;\r\n const conditions = this.context.options.is;\r\n const otherwise = this.context.options.otherwise;\r\n const scope = this.context.options.scope || \"global\";\r\n\r\n const fieldValue =\r\n scope === \"global\"\r\n ? get(context.allValues, fieldToCheck)\r\n : get(context.parent, fieldToCheck);\r\n\r\n // Convert field value to string for key lookup\r\n // This handles boolean, number, and string field values\r\n const fieldValueKey = String(fieldValue);\r\n\r\n if (conditions[fieldValueKey]) {\r\n const result = await conditions[fieldValueKey].validate(value, context);\r\n if (result.isValid) {\r\n return VALID_RULE;\r\n }\r\n\r\n // Safe error access\r\n this.context.errorMessage =\r\n result.errors?.[0]?.error || \"Validation failed\";\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (otherwise) {\r\n const result = await otherwise.validate(value, context);\r\n\r\n if (result.isValid) {\r\n return VALID_RULE;\r\n }\r\n\r\n // Safe error access\r\n this.context.errorMessage =\r\n result.errors?.[0]?.error || \"Validation failed\";\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAOA,MAAa,WAAwC;CACnD,MAAM;CACN,aAAa;CACb,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,eAAe,KAAK,QAAQ,QAAQ;EAC1C,MAAM,aAAa,KAAK,QAAQ,QAAQ;EACxC,MAAM,YAAY,KAAK,QAAQ,QAAQ;EAGvC,MAAM,cAFQ,KAAK,QAAQ,QAAQ,SAAS,cAGhC,WACN,IAAI,QAAQ,WAAW,YAAY,IACnC,IAAI,QAAQ,QAAQ,YAAY;EAItC,MAAM,gBAAgB,OAAO,UAAU;EAEvC,IAAI,WAAW,gBAAgB;GAC7B,MAAM,SAAS,MAAM,WAAW,cAAc,CAAC,SAAS,OAAO,OAAO;GACtE,IAAI,OAAO,SACT,OAAO;GAIT,KAAK,QAAQ,eACX,OAAO,SAAS,EAAE,EAAE,SAAS;GAC/B,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,IAAI,WAAW;GACb,MAAM,SAAS,MAAM,UAAU,SAAS,OAAO,OAAO;GAEtD,IAAI,OAAO,SACT,OAAO;GAIT,KAAK,QAAQ,eACX,OAAO,SAAS,EAAE,EAAE,SAAS;GAC/B,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"when.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/core/when.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule, WhenRuleOptions } from \"../../types\";\n\n/**\n * When rule - conditional validation based on another field value\n */\nexport const whenRule: SchemaRule<WhenRuleOptions> = {\n name: \"when\",\n description: \"Apply conditional validation based on another field value\",\n async validate(value: any, context) {\n const fieldToCheck = this.context.options.field;\n const conditions = this.context.options.is;\n const otherwise = this.context.options.otherwise;\n const scope = this.context.options.scope || \"global\";\n\n const fieldValue =\n scope === \"global\"\n ? get(context.allValues, fieldToCheck)\n : get(context.parent, fieldToCheck);\n\n // Convert field value to string for key lookup\n // This handles boolean, number, and string field values\n const fieldValueKey = String(fieldValue);\n\n if (conditions[fieldValueKey]) {\n const result = await conditions[fieldValueKey].validate(value, context);\n if (result.isValid) {\n return VALID_RULE;\n }\n\n // Safe error access\n this.context.errorMessage =\n result.errors?.[0]?.error || \"Validation failed\";\n return invalidRule(this, context);\n }\n\n if (otherwise) {\n const result = await otherwise.validate(value, context);\n\n if (result.isValid) {\n return VALID_RULE;\n }\n\n // Safe error access\n this.context.errorMessage =\n result.errors?.[0]?.error || \"Validation failed\";\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,WAAwC;CACnD,MAAM;CACN,aAAa;CACb,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,eAAe,KAAK,QAAQ,QAAQ;EAC1C,MAAM,aAAa,KAAK,QAAQ,QAAQ;EACxC,MAAM,YAAY,KAAK,QAAQ,QAAQ;EAGvC,MAAM,cAFQ,KAAK,QAAQ,QAAQ,SAAS,cAGhC,WACN,IAAI,QAAQ,WAAW,YAAY,IACnC,IAAI,QAAQ,QAAQ,YAAY;EAItC,MAAM,gBAAgB,OAAO,UAAU;EAEvC,IAAI,WAAW,gBAAgB;GAC7B,MAAM,SAAS,MAAM,WAAW,cAAc,CAAC,SAAS,OAAO,OAAO;GACtE,IAAI,OAAO,SACT,OAAO;GAIT,KAAK,QAAQ,eACX,OAAO,SAAS,EAAE,EAAE,SAAS;GAC/B,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,IAAI,WAAW;GACb,MAAM,SAAS,MAAM,UAAU,SAAS,OAAO,OAAO;GAEtD,IAAI,OAAO,SACT,OAAO;GAIT,KAAK,QAAQ,eACX,OAAO,SAAS,EAAE,EAAE,SAAS;GAC/B,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/date/date-comparison-rules.d.ts
4
3
  /**
5
4
  * Between dates rule - date must be between start and end dates
@@ -1 +1 @@
1
- {"version":3,"file":"date-comparison-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-comparison-rules.ts"],"mappings":";;;;;AAMA;cAAa,gBAAA,EAAkB,UAAA;EAC7B,SAAA,EAAW,IAAA;EACX,OAAA,EAAS,IAAA;AAAA;;;;cAqBE,SAAA,EAAW,UAcvB;;;;cAKY,QAAA,EAAU,UAYtB;;AApDc;AAqBf;cAoCa,UAAA,EAAY,UAYxB;;;AAlCA;cAuCY,cAAA,EAAgB,UAc5B"}
1
+ {"version":3,"file":"date-comparison-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-comparison-rules.ts"],"mappings":";;;;;cAMa,gBAAA,EAAkB,UAAA;EAC7B,SAAA,EAAW,IAAA;EACX,OAAA,EAAS,IAAA;AAAA;;;;cAqBE,SAAA,EAAW,UAcvB;;;;cAKY,QAAA,EAAU,UAYtB;;;AApDc;cAyDF,UAAA,EAAY,UAYxB;;;;cAKY,cAAA,EAAgB,UAc5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"date-comparison-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-comparison-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Between dates rule - date must be between start and end dates\r\n */\r\nexport const betweenDatesRule: SchemaRule<{\r\n startDate: Date;\r\n endDate: Date;\r\n}> = {\r\n name: \"betweenDates\",\r\n defaultErrorMessage: \"The :input must be between :startDate and :endDate\",\r\n async validate(value: Date, context) {\r\n const { startDate, endDate } = this.context.options;\r\n const inputDate = new Date(value);\r\n\r\n if (inputDate >= startDate && inputDate <= endDate) {\r\n this.context.translationParams.startDate = startDate.toISOString();\r\n this.context.translationParams.endDate = endDate.toISOString();\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Today rule - date must be exactly today\r\n */\r\nexport const todayRule: SchemaRule = {\r\n name: \"today\",\r\n defaultErrorMessage: \"The :input must be today\",\r\n async validate(value: Date, context) {\r\n const today = new Date();\r\n today.setHours(0, 0, 0, 0);\r\n const inputDate = new Date(value);\r\n inputDate.setHours(0, 0, 0, 0);\r\n\r\n if (inputDate.getTime() === today.getTime()) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Past rule - date must be in the past\r\n */\r\nexport const pastRule: SchemaRule = {\r\n name: \"past\",\r\n defaultErrorMessage: \"The :input must be in the past\",\r\n async validate(value: Date, context) {\r\n const now = new Date();\r\n const inputDate = new Date(value);\r\n\r\n if (inputDate < now) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Future rule - date must be in the future\r\n */\r\nexport const futureRule: SchemaRule = {\r\n name: \"future\",\r\n defaultErrorMessage: \"The :input must be in the future\",\r\n async validate(value: Date, context) {\r\n const now = new Date();\r\n\r\n if (value > now) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * After today rule - date must be after today (not including today)\r\n */\r\nexport const afterTodayRule: SchemaRule = {\r\n name: \"afterToday\",\r\n defaultErrorMessage: \"The :input must be after today\",\r\n async validate(value: Date, context) {\r\n const today = new Date();\r\n today.setHours(0, 0, 0, 0);\r\n const inputDate = new Date(value);\r\n inputDate.setHours(0, 0, 0, 0);\r\n\r\n if (inputDate > today) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAMA,MAAa,mBAGR;CACH,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,WAAW,YAAY,KAAK,QAAQ;EAC5C,MAAM,YAAY,IAAI,KAAK,KAAK;EAEhC,IAAI,aAAa,aAAa,aAAa,SAAS;GAClD,KAAK,QAAQ,kBAAkB,YAAY,UAAU,YAAY;GACjE,KAAK,QAAQ,kBAAkB,UAAU,QAAQ,YAAY;GAC7D,OAAO;EACT;EAEA,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,YAAwB;CACnC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,wBAAQ,IAAI,KAAK;EACvB,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC;EACzB,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAE7B,IAAI,UAAU,QAAQ,MAAM,MAAM,QAAQ,GACxC,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,WAAuB;CAClC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,sBAAM,IAAI,KAAK;EAGrB,IAAI,IAFkB,KAAK,KAEf,IAAI,KACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,aAAyB;CACpC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAGnC,IAAI,wBAAQ,IAFI,KAEF,GACZ,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,iBAA6B;CACxC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,wBAAQ,IAAI,KAAK;EACvB,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC;EACzB,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAE7B,IAAI,YAAY,OACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
1
+ {"version":3,"file":"date-comparison-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-comparison-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Between dates rule - date must be between start and end dates\n */\nexport const betweenDatesRule: SchemaRule<{\n startDate: Date;\n endDate: Date;\n}> = {\n name: \"betweenDates\",\n defaultErrorMessage: \"The :input must be between :startDate and :endDate\",\n async validate(value: Date, context) {\n const { startDate, endDate } = this.context.options;\n const inputDate = new Date(value);\n\n if (inputDate >= startDate && inputDate <= endDate) {\n this.context.translationParams.startDate = startDate.toISOString();\n this.context.translationParams.endDate = endDate.toISOString();\n return VALID_RULE;\n }\n\n return invalidRule(this, context);\n },\n};\n\n/**\n * Today rule - date must be exactly today\n */\nexport const todayRule: SchemaRule = {\n name: \"today\",\n defaultErrorMessage: \"The :input must be today\",\n async validate(value: Date, context) {\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const inputDate = new Date(value);\n inputDate.setHours(0, 0, 0, 0);\n\n if (inputDate.getTime() === today.getTime()) {\n return VALID_RULE;\n }\n return invalidRule(this, context);\n },\n};\n\n/**\n * Past rule - date must be in the past\n */\nexport const pastRule: SchemaRule = {\n name: \"past\",\n defaultErrorMessage: \"The :input must be in the past\",\n async validate(value: Date, context) {\n const now = new Date();\n const inputDate = new Date(value);\n\n if (inputDate < now) {\n return VALID_RULE;\n }\n return invalidRule(this, context);\n },\n};\n\n/**\n * Future rule - date must be in the future\n */\nexport const futureRule: SchemaRule = {\n name: \"future\",\n defaultErrorMessage: \"The :input must be in the future\",\n async validate(value: Date, context) {\n const now = new Date();\n\n if (value > now) {\n return VALID_RULE;\n }\n\n return invalidRule(this, context);\n },\n};\n\n/**\n * After today rule - date must be after today (not including today)\n */\nexport const afterTodayRule: SchemaRule = {\n name: \"afterToday\",\n defaultErrorMessage: \"The :input must be after today\",\n async validate(value: Date, context) {\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const inputDate = new Date(value);\n inputDate.setHours(0, 0, 0, 0);\n\n if (inputDate > today) {\n return VALID_RULE;\n }\n return invalidRule(this, context);\n },\n};\n"],"mappings":";;;;;;;AAMA,MAAa,mBAGR;CACH,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,WAAW,YAAY,KAAK,QAAQ;EAC5C,MAAM,YAAY,IAAI,KAAK,KAAK;EAEhC,IAAI,aAAa,aAAa,aAAa,SAAS;GAClD,KAAK,QAAQ,kBAAkB,YAAY,UAAU,YAAY;GACjE,KAAK,QAAQ,kBAAkB,UAAU,QAAQ,YAAY;GAC7D,OAAO;EACT;EAEA,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,YAAwB;CACnC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,wBAAQ,IAAI,KAAK;EACvB,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC;EACzB,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAE7B,IAAI,UAAU,QAAQ,MAAM,MAAM,QAAQ,GACxC,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,WAAuB;CAClC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,sBAAM,IAAI,KAAK;EAGrB,IAAI,IAFkB,KAAK,KAEf,IAAI,KACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,aAAyB;CACpC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAGnC,IAAI,wBAAQ,IAFI,KAEF,GACZ,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,iBAA6B;CACxC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,wBAAQ,IAAI,KAAK;EACvB,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC;EACzB,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAE7B,IAAI,YAAY,OACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,6 +1,5 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
2
  import { WeekDay } from "../../types/date-types.mjs";
3
-
4
3
  //#region ../seal/src/rules/date/date-day-rules.d.ts
5
4
  /**
6
5
  * Weekend rule - date must be Saturday or Sunday
@@ -1 +1 @@
1
- {"version":3,"file":"date-day-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-day-rules.ts"],"mappings":";;;;;;AAQA;cAAa,WAAA,EAAa,UAazB;;;AAAA;cAKY,WAAA,EAAa,UAczB;;;;cAKY,YAAA,EAAc,UAAU;EAAG,IAAA,EAAM,OAAA;AAAA;;;;cAyBjC,eAAA,EAAiB,UAc7B"}
1
+ {"version":3,"file":"date-day-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-day-rules.ts"],"mappings":";;;;;;cAQa,WAAA,EAAa,UAazB;;;;cAKY,WAAA,EAAa,UAczB;AAdD;;;AAAA,cAmBa,YAAA,EAAc,UAAU;EAAG,IAAA,EAAM,OAAA;AAAA;;;;cAyBjC,eAAA,EAAiB,UAc7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"date-day-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-day-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\nimport type { WeekDay } from \"../../types/date-types\";\r\nimport { WEEK_DAYS } from \"../../types/date-types\";\r\n\r\n/**\r\n * Weekend rule - date must be Saturday or Sunday\r\n */\r\nexport const weekendRule: SchemaRule = {\r\n name: \"weekend\",\r\n defaultErrorMessage: \"The :input must be a weekend (Saturday or Sunday)\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const dayOfWeek = inputDate.getDay();\r\n\r\n // 0 = Sunday, 6 = Saturday\r\n if (dayOfWeek === 0 || dayOfWeek === 6) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Weekday rule - date must be Monday through Friday\r\n */\r\nexport const weekdayRule: SchemaRule = {\r\n name: \"weekday\",\r\n defaultErrorMessage: \"The :input must be a weekday (Monday-Friday)\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const dayOfWeek = inputDate.getDay();\r\n\r\n // 1-5 = Monday-Friday\r\n if (dayOfWeek >= 1 && dayOfWeek <= 5) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Weekdays rule - date must be one of specified weekdays\r\n */\r\nexport const weekdaysRule: SchemaRule<{ days: WeekDay[] }> = {\r\n name: \"weekdays\",\r\n defaultErrorMessage: \"The :input must be one of: :days\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const dayOfWeek = inputDate.getDay();\r\n const { days } = this.context.options;\r\n\r\n const allowedDays = days.map((day) => WEEK_DAYS[day]);\r\n\r\n if (allowedDays.includes(dayOfWeek)) {\r\n return VALID_RULE;\r\n }\r\n\r\n days.forEach((day) => {\r\n this.context.translatableParams[day] = day;\r\n });\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Business day rule - date must be Monday-Friday (no weekends)\r\n */\r\nexport const businessDayRule: SchemaRule = {\r\n name: \"businessDay\",\r\n defaultErrorMessage: \"The :input must be a business day\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const dayOfWeek = inputDate.getDay();\r\n\r\n // 1-5 = Monday-Friday\r\n if (dayOfWeek >= 1 && dayOfWeek <= 5) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAQA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,cAAc,KAAK,cAAc,GACnC,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,aAAa,KAAK,aAAa,GACjC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,eAAgD;CAC3D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EACnC,MAAM,EAAE,SAAS,KAAK,QAAQ;EAI9B,IAFoB,KAAK,KAAK,QAAQ,UAAU,IAElC,CAAC,CAAC,SAAS,SAAS,GAChC,OAAO;EAGT,KAAK,SAAS,QAAQ;GACpB,KAAK,QAAQ,mBAAmB,OAAO;EACzC,CAAC;EAED,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,kBAA8B;CACzC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,aAAa,KAAK,aAAa,GACjC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
1
+ {"version":3,"file":"date-day-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-day-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\nimport type { WeekDay } from \"../../types/date-types\";\nimport { WEEK_DAYS } from \"../../types/date-types\";\n\n/**\n * Weekend rule - date must be Saturday or Sunday\n */\nexport const weekendRule: SchemaRule = {\n name: \"weekend\",\n defaultErrorMessage: \"The :input must be a weekend (Saturday or Sunday)\",\n async validate(value: Date, context) {\n const inputDate = new Date(value);\n const dayOfWeek = inputDate.getDay();\n\n // 0 = Sunday, 6 = Saturday\n if (dayOfWeek === 0 || dayOfWeek === 6) {\n return VALID_RULE;\n }\n return invalidRule(this, context);\n },\n};\n\n/**\n * Weekday rule - date must be Monday through Friday\n */\nexport const weekdayRule: SchemaRule = {\n name: \"weekday\",\n defaultErrorMessage: \"The :input must be a weekday (Monday-Friday)\",\n async validate(value: Date, context) {\n const inputDate = new Date(value);\n const dayOfWeek = inputDate.getDay();\n\n // 1-5 = Monday-Friday\n if (dayOfWeek >= 1 && dayOfWeek <= 5) {\n return VALID_RULE;\n }\n\n return invalidRule(this, context);\n },\n};\n\n/**\n * Weekdays rule - date must be one of specified weekdays\n */\nexport const weekdaysRule: SchemaRule<{ days: WeekDay[] }> = {\n name: \"weekdays\",\n defaultErrorMessage: \"The :input must be one of: :days\",\n async validate(value: Date, context) {\n const inputDate = new Date(value);\n const dayOfWeek = inputDate.getDay();\n const { days } = this.context.options;\n\n const allowedDays = days.map((day) => WEEK_DAYS[day]);\n\n if (allowedDays.includes(dayOfWeek)) {\n return VALID_RULE;\n }\n\n days.forEach((day) => {\n this.context.translatableParams[day] = day;\n });\n\n return invalidRule(this, context);\n },\n};\n\n/**\n * Business day rule - date must be Monday-Friday (no weekends)\n */\nexport const businessDayRule: SchemaRule = {\n name: \"businessDay\",\n defaultErrorMessage: \"The :input must be a business day\",\n async validate(value: Date, context) {\n const inputDate = new Date(value);\n const dayOfWeek = inputDate.getDay();\n\n // 1-5 = Monday-Friday\n if (dayOfWeek >= 1 && dayOfWeek <= 5) {\n return VALID_RULE;\n }\n\n return invalidRule(this, context);\n },\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,cAAc,KAAK,cAAc,GACnC,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,aAAa,KAAK,aAAa,GACjC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,eAAgD;CAC3D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EACnC,MAAM,EAAE,SAAS,KAAK,QAAQ;EAI9B,IAFoB,KAAK,KAAK,QAAQ,UAAU,IAElC,CAAC,CAAC,SAAS,SAAS,GAChC,OAAO;EAGT,KAAK,SAAS,QAAQ;GACpB,KAAK,QAAQ,mBAAmB,OAAO;EACzC,CAAC;EAED,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,kBAA8B;CACzC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,YAAY,IADI,KAAK,KACD,CAAC,CAAC,OAAO;EAGnC,IAAI,aAAa,KAAK,aAAa,GACjC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/date/date-field-comparison-rules.d.ts
4
3
  /**
5
4
  * Before field rule - date must be < given date or field
@@ -1 +1 @@
1
- {"version":3,"file":"date-field-comparison-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-field-comparison-rules.ts"],"mappings":";;;;;AAUA;;;cAAa,eAAA,EAAiB,UAAU;EACtC,WAAA,EAAa,IAAA;EACb,KAAA;AAAA;;;AAAK;AAsCP;;cAAa,cAAA,EAAgB,UAAU;EACrC,WAAA,EAAa,IAAA;EACb,KAAA;AAAA;;;;AAAK;cAwCM,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"date-field-comparison-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-field-comparison-rules.ts"],"mappings":";;;;;AAUA;;cAAa,eAAA,EAAiB,UAAU;EACtC,WAAA,EAAa,IAAA;EACb,KAAA;AAAA;;;;AAAK;AAsCP;cAAa,cAAA,EAAgB,UAAU;EACrC,WAAA,EAAa,IAAA;EACb,KAAA;AAAA;;;;;cAwCW,mBAAA,EAAqB,UAAU;EAC1C,KAAA;EACA,KAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"date-field-comparison-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-field-comparison-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isDateValue } from \"../../helpers/date-helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Before field rule - date must be < given date or field\r\n * Smart detection: date value or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const beforeFieldRule: SchemaRule<{\r\n dateOrField: Date | string | number;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"beforeField\",\r\n description: \"The date must be before the given date or field\",\r\n defaultErrorMessage: \"The :input must be before :dateOrField\",\r\n async validate(value: Date, context) {\r\n const { dateOrField, scope = \"global\" } = this.context.options;\r\n let compareDate: Date;\r\n\r\n if (isDateValue(dateOrField)) {\r\n // Value comparison\r\n compareDate = new Date(dateOrField);\r\n } else {\r\n // Field comparison\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, dateOrField as string);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n compareDate = new Date(fieldValue);\r\n }\r\n\r\n const inputDate = new Date(value);\r\n\r\n if (inputDate < compareDate) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * After field rule - date must be > given date or field\r\n * Smart detection: date value or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const afterFieldRule: SchemaRule<{\r\n dateOrField: Date | string | number;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"afterField\",\r\n description: \"The date must be after the given date or field\",\r\n defaultErrorMessage: \"The :input must be after :dateOrField\",\r\n async validate(value: Date, context) {\r\n const { dateOrField, scope = \"global\" } = this.context.options;\r\n let compareDate: Date;\r\n\r\n if (isDateValue(dateOrField)) {\r\n // Value comparison\r\n compareDate = new Date(dateOrField);\r\n this.context.translationParams.dateOrField = compareDate.toISOString();\r\n } else {\r\n // Field comparison\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, dateOrField as string);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n compareDate = new Date(fieldValue);\r\n this.context.translatableParams.dateOrField = fieldValue;\r\n }\r\n\r\n const inputDate = new Date(value);\r\n\r\n if (inputDate > compareDate) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Same as field rule - date must be the same as another field's date\r\n * Supports both global and sibling scope\r\n */\r\nexport const sameAsFieldDateRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"sameAsFieldDate\",\r\n description: \"The date must be the same as another field's date\",\r\n defaultErrorMessage: \"The :input must be the same as :field\",\r\n async validate(value: Date, context) {\r\n const { field, scope = \"global\" } = this.context.options;\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, field);\r\n\r\n // Both fields must exist to be considered \"the same\"\r\n if (fieldValue === undefined || value === undefined) {\r\n this.context.translatableParams.field = fieldValue;\r\n return invalidRule(this, context);\r\n }\r\n\r\n const inputDate = new Date(value);\r\n inputDate.setHours(0, 0, 0, 0);\r\n const compareDate = new Date(fieldValue);\r\n compareDate.setHours(0, 0, 0, 0);\r\n\r\n if (inputDate.getTime() === compareDate.getTime()) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.field = fieldValue;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,kBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,aAAa,QAAQ,aAAa,KAAK,QAAQ;EACvD,IAAI;EAEJ,IAAI,YAAY,WAAW,GAEzB,cAAc,IAAI,KAAK,WAAW;OAC7B;GAGL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,WAAqB;GAEpD,IAAI,eAAe,QACjB,OAAO;GAGT,cAAc,IAAI,KAAK,UAAU;EACnC;EAIA,IAAI,IAFkB,KAAK,KAEf,IAAI,aACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;;AAOA,MAAa,iBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,aAAa,QAAQ,aAAa,KAAK,QAAQ;EACvD,IAAI;EAEJ,IAAI,YAAY,WAAW,GAAG;GAE5B,cAAc,IAAI,KAAK,WAAW;GAClC,KAAK,QAAQ,kBAAkB,cAAc,YAAY,YAAY;EACvE,OAAO;GAGL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,WAAqB;GAEpD,IAAI,eAAe,QACjB,OAAO;GAGT,cAAc,IAAI,KAAK,UAAU;GACjC,KAAK,QAAQ,mBAAmB,cAAc;EAChD;EAIA,IAAI,IAFkB,KAAK,KAEf,IAAI,aACd,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,OAAO,QAAQ,aAAa,KAAK,QAAQ;EAEjD,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,KAAK;EAGpC,IAAI,eAAe,UAAa,UAAU,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ;GACxC,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAC7B,MAAM,cAAc,IAAI,KAAK,UAAU;EACvC,YAAY,SAAS,GAAG,GAAG,GAAG,CAAC;EAE/B,IAAI,UAAU,QAAQ,MAAM,YAAY,QAAQ,GAC9C,OAAO;EAGT,KAAK,QAAQ,mBAAmB,QAAQ;EACxC,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
1
+ {"version":3,"file":"date-field-comparison-rules.mjs","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-field-comparison-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isDateValue } from \"../../helpers/date-helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Before field rule - date must be < given date or field\n * Smart detection: date value or field name\n * Supports both global and sibling scope\n */\nexport const beforeFieldRule: SchemaRule<{\n dateOrField: Date | string | number;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"beforeField\",\n description: \"The date must be before the given date or field\",\n defaultErrorMessage: \"The :input must be before :dateOrField\",\n async validate(value: Date, context) {\n const { dateOrField, scope = \"global\" } = this.context.options;\n let compareDate: Date;\n\n if (isDateValue(dateOrField)) {\n // Value comparison\n compareDate = new Date(dateOrField);\n } else {\n // Field comparison\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n const fieldValue = get(source, dateOrField as string);\n\n if (fieldValue === undefined) {\n return VALID_RULE;\n }\n\n compareDate = new Date(fieldValue);\n }\n\n const inputDate = new Date(value);\n\n if (inputDate < compareDate) {\n return VALID_RULE;\n }\n return invalidRule(this, context);\n },\n};\n\n/**\n * After field rule - date must be > given date or field\n * Smart detection: date value or field name\n * Supports both global and sibling scope\n */\nexport const afterFieldRule: SchemaRule<{\n dateOrField: Date | string | number;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"afterField\",\n description: \"The date must be after the given date or field\",\n defaultErrorMessage: \"The :input must be after :dateOrField\",\n async validate(value: Date, context) {\n const { dateOrField, scope = \"global\" } = this.context.options;\n let compareDate: Date;\n\n if (isDateValue(dateOrField)) {\n // Value comparison\n compareDate = new Date(dateOrField);\n this.context.translationParams.dateOrField = compareDate.toISOString();\n } else {\n // Field comparison\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n const fieldValue = get(source, dateOrField as string);\n\n if (fieldValue === undefined) {\n return VALID_RULE;\n }\n\n compareDate = new Date(fieldValue);\n this.context.translatableParams.dateOrField = fieldValue;\n }\n\n const inputDate = new Date(value);\n\n if (inputDate > compareDate) {\n return VALID_RULE;\n }\n\n return invalidRule(this, context);\n },\n};\n\n/**\n * Same as field rule - date must be the same as another field's date\n * Supports both global and sibling scope\n */\nexport const sameAsFieldDateRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"sameAsFieldDate\",\n description: \"The date must be the same as another field's date\",\n defaultErrorMessage: \"The :input must be the same as :field\",\n async validate(value: Date, context) {\n const { field, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n const fieldValue = get(source, field);\n\n // Both fields must exist to be considered \"the same\"\n if (fieldValue === undefined || value === undefined) {\n this.context.translatableParams.field = fieldValue;\n return invalidRule(this, context);\n }\n\n const inputDate = new Date(value);\n inputDate.setHours(0, 0, 0, 0);\n const compareDate = new Date(fieldValue);\n compareDate.setHours(0, 0, 0, 0);\n\n if (inputDate.getTime() === compareDate.getTime()) {\n return VALID_RULE;\n }\n\n this.context.translatableParams.field = fieldValue;\n return invalidRule(this, context);\n },\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,kBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,aAAa,QAAQ,aAAa,KAAK,QAAQ;EACvD,IAAI;EAEJ,IAAI,YAAY,WAAW,GAEzB,cAAc,IAAI,KAAK,WAAW;OAC7B;GAGL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,WAAqB;GAEpD,IAAI,eAAe,QACjB,OAAO;GAGT,cAAc,IAAI,KAAK,UAAU;EACnC;EAIA,IAAI,IAFkB,KAAK,KAEf,IAAI,aACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;;AAOA,MAAa,iBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,aAAa,QAAQ,aAAa,KAAK,QAAQ;EACvD,IAAI;EAEJ,IAAI,YAAY,WAAW,GAAG;GAE5B,cAAc,IAAI,KAAK,WAAW;GAClC,KAAK,QAAQ,kBAAkB,cAAc,YAAY,YAAY;EACvE,OAAO;GAGL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,WAAqB;GAEpD,IAAI,eAAe,QACjB,OAAO;GAGT,cAAc,IAAI,KAAK,UAAU;GACjC,KAAK,QAAQ,mBAAmB,cAAc;EAChD;EAIA,IAAI,IAFkB,KAAK,KAEf,IAAI,aACd,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;AAMA,MAAa,sBAGR;CACH,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,EAAE,OAAO,QAAQ,aAAa,KAAK,QAAQ;EAEjD,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,KAAK;EAGpC,IAAI,eAAe,UAAa,UAAU,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ;GACxC,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,UAAU,SAAS,GAAG,GAAG,GAAG,CAAC;EAC7B,MAAM,cAAc,IAAI,KAAK,UAAU;EACvC,YAAY,SAAS,GAAG,GAAG,GAAG,CAAC;EAE/B,IAAI,UAAU,QAAQ,MAAM,YAAY,QAAQ,GAC9C,OAAO;EAGT,KAAK,QAAQ,mBAAmB,QAAQ;EACxC,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { SchemaRule } from "../../types/rule-types.mjs";
2
-
3
2
  //#region ../seal/src/rules/date/date-period-rules.d.ts
4
3
  declare const MONTHS: {
5
4
  1: string;
@@ -1 +1 @@
1
- {"version":3,"file":"date-period-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-period-rules.ts"],"mappings":";;;cAIM,MAAA;;;;;;;;;;;;;;KAeM,KAAA,gBAAqB,MAAM;;;;cAK1B,SAAA,EAAW,UAAU;EAAG,KAAA,EAAO,KAAA;AAAA;;;;cAoB/B,QAAA,EAAU,UAAU;EAAG,IAAI;AAAA;;;;;cAoB3B,gBAAA,EAAkB,UAAU;EACvC,SAAA;EACA,OAAA;EACA,KAAA;AAAA;;;AAvBsC;AAoBxC;cA8Ea,iBAAA,EAAmB,UAAA;EAC9B,UAAA,EAAY,KAAA;EACZ,QAAA,EAAU,KAAA;EACV,KAAA;AAAA;;;;AA9EK;cA6JM,eAAA,EAAiB,UAAU;EACtC,QAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;cA0EW,WAAA,EAAa,UAAU;EAAG,OAAO;AAAA;;;;cAoBjC,gBAAA,EAAkB,UAAU;EACvC,SAAA;EACA,OAAA;AAAA;;;;;;cAyCW,WAAA,EAAa,UAAU;EAClC,WAAA;EACA,KAAA;AAAA;;;;AAjE4C;AAoB9C;cAmGa,WAAA,EAAa,UAAU;EAClC,WAAA;EACA,KAAA;AAAA;;;;AAnGO;AAyCT;cAgHa,YAAA,EAAc,UAAU;EACnC,YAAA;EACA,KAAA;AAAA;;;;AAhHK;AAsDP;cA+Ga,YAAA,EAAc,UAAU;EACnC,YAAA,EAAc,KAAA;EACd,KAAA;AAAA;;;;AA/GK;AAsDP;cA+Ga,UAAA,EAAY,UAAU;EACjC,UAAA;EACA,KAAA;AAAA;;;;AA/GK;AAqDP;cA+Ga,UAAA,EAAY,UAAU;EACjC,UAAA;EACA,KAAA;AAAA"}
1
+ {"version":3,"file":"date-period-rules.d.mts","names":[],"sources":["../../../../../../../../seal/src/rules/date/date-period-rules.ts"],"mappings":";;cAIM,MAAA;;;;;;;;;;;;;;KAeM,KAAA,gBAAqB,MAAM;;;;cAK1B,SAAA,EAAW,UAAU;EAAG,KAAA,EAAO,KAAA;AAAA;AAL5C;;;AAAA,cAyBa,QAAA,EAAU,UAAU;EAAG,IAAI;AAAA;;;;;cAoB3B,gBAAA,EAAkB,UAAU;EACvC,SAAA;EACA,OAAA;EACA,KAAA;AAAA;;;;AAvBsC;cAkG3B,iBAAA,EAAmB,UAAA;EAC9B,UAAA,EAAY,KAAA;EACZ,QAAA,EAAU,KAAA;EACV,KAAA;AAAA;;;;;cA+EW,eAAA,EAAiB,UAAU;EACtC,QAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;cA0EW,WAAA,EAAa,UAAU;EAAG,OAAO;AAAA;;;;cAoBjC,gBAAA,EAAkB,UAAU;EACvC,SAAA;EACA,OAAA;AAAA;;;;;;cAyCW,WAAA,EAAa,UAAU;EAClC,WAAA;EACA,KAAA;AAAA;AAjEF;;;;AAA8C;AAA9C,cAuHa,WAAA,EAAa,UAAU;EAClC,WAAA;EACA,KAAA;AAAA;;;;;AAnGO;cAyJI,YAAA,EAAc,UAAU;EACnC,YAAA;EACA,KAAA;AAAA;;;;;AAhHK;cAqKM,YAAA,EAAc,UAAU;EACnC,YAAA,EAAc,KAAA;EACd,KAAA;AAAA;;;;;AA/GK;cAqKM,UAAA,EAAY,UAAU;EACjC,UAAA;EACA,KAAA;AAAA;;;;;AA/GK;cAoKM,UAAA,EAAY,UAAU;EACjC,UAAA;EACA,KAAA;AAAA"}