@warlock.js/notifications 5.2.4 → 5.3.1

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 (393) hide show
  1. package/cjs/{src-DJA8APmy.cjs → esm-FB2hc0-o.cjs} +206 -298
  2. package/cjs/esm-FB2hc0-o.cjs.map +1 -0
  3. package/cjs/index.cjs +1 -1
  4. package/cjs/rabbitmq-driver-CIvkulXX.cjs +3 -0
  5. package/esm/index.d.mts +4 -0
  6. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/communicators/broker-registry.d.mts +1 -0
  7. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/communicators/broker-registry.mjs +5 -5
  8. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/communicators/broker-registry.mjs.map +1 -0
  9. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/communicators/broker.d.mts +1 -0
  10. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/communicators/broker.mjs +1 -7
  11. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/communicators/broker.mjs.map +1 -0
  12. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/communicators/index.mjs +3 -0
  13. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/contracts/broker-driver.contract.d.mts +1 -0
  14. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/contracts/channel.contract.d.mts +1 -0
  15. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/decorators/consumable.mjs +1 -1
  16. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/decorators/consumable.mjs.map +1 -0
  17. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/decorators/index.mjs +3 -0
  18. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/index.mjs +5 -0
  19. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/rabbitmq/index.mjs +4 -0
  20. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/rabbitmq/rabbitmq-channel.d.mts +1 -0
  21. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/drivers/rabbitmq/rabbitmq-channel.mjs +6 -13
  22. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/rabbitmq/rabbitmq-channel.mjs.map +1 -0
  23. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/rabbitmq/rabbitmq-driver.d.mts +1 -0
  24. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/drivers/rabbitmq/rabbitmq-driver.mjs +10 -11
  25. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/drivers/rabbitmq/rabbitmq-driver.mjs.map +1 -0
  26. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/index.d.mts +1 -0
  27. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/event-consumer.d.mts +1 -0
  28. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/message-managers/event-consumer.mjs +10 -22
  29. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/event-consumer.mjs.map +1 -0
  30. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/event-message.d.mts +1 -0
  31. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/message-managers/event-message.mjs +3 -20
  32. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/event-message.mjs.map +1 -0
  33. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/index.mjs +3 -0
  34. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/message-managers/prepare-consumer-subscription.mjs +1 -1
  35. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/message-managers/prepare-consumer-subscription.mjs.map +1 -0
  36. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/types/channel.types.d.mts +1 -0
  37. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/types/registry.types.d.mts +1 -0
  38. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/use-case-broadcast.mjs +1 -1
  39. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/use-case-broadcast.mjs.map +1 -0
  40. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/utils/connect-to-broker.d.mts +1 -0
  41. package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/utils/connect-to-broker.mjs +1 -1
  42. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/utils/connect-to-broker.mjs.map +1 -0
  43. package/esm/node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm/utils/index.mjs +3 -0
  44. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/config.mjs +1 -1
  45. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/config.mjs.map +1 -0
  46. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/factory/index.mjs +3 -0
  47. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/factory/validate.mjs +1 -1
  48. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/factory/validate.mjs.map +1 -0
  49. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/factory/validators.mjs +1 -1
  50. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/factory/validators.mjs.map +1 -0
  51. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/helpers/date-helpers.mjs +1 -1
  52. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/date-helpers.mjs.map +1 -0
  53. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/helpers/get-field-value.mjs +3 -3
  54. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/get-field-value.mjs.map +1 -0
  55. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/index.mjs +3 -0
  56. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/is-empty-value.mjs +10 -0
  57. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/is-empty-value.mjs.map +1 -0
  58. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/helpers/path-helpers.mjs +1 -1
  59. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/path-helpers.mjs.map +1 -0
  60. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/helpers/validation-helpers.mjs +1 -1
  61. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/helpers/validation-helpers.mjs.map +1 -0
  62. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/index.d.mts +10 -0
  63. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/index.mjs +7 -0
  64. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/mutators/array-mutators.mjs +3 -3
  65. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/array-mutators.mjs.map +1 -0
  66. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/mutators/date-mutators.mjs +3 -3
  67. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/date-mutators.mjs.map +1 -0
  68. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/index.mjs +7 -0
  69. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/mutators/number-mutators.mjs +4 -4
  70. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/number-mutators.mjs.map +1 -0
  71. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/mutators/object-mutators.mjs +4 -4
  72. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/object-mutators.mjs.map +1 -0
  73. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/scalar-mutators.mjs +9 -0
  74. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/scalar-mutators.mjs.map +1 -0
  75. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/mutators/string-mutators.mjs +11 -11
  76. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/mutators/string-mutators.mjs.map +1 -0
  77. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/array/array-rules.mjs +1 -1
  78. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/array/array-rules.mjs.map +1 -0
  79. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/array/index.mjs +3 -0
  80. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/color/color-rules.mjs +1 -1
  81. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/color/color-rules.mjs.map +1 -0
  82. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/color/index.mjs +3 -0
  83. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/enum.mjs +1 -1
  84. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/enum.mjs.map +1 -0
  85. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/equals-field-rules.mjs +1 -1
  86. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/equals-field-rules.mjs.map +1 -0
  87. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/index.mjs +8 -0
  88. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/instanceof.mjs +1 -1
  89. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/instanceof.mjs.map +1 -0
  90. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/literal.mjs +1 -1
  91. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/literal.mjs.map +1 -0
  92. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/type-rules.mjs +2 -2
  93. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/type-rules.mjs.map +1 -0
  94. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/common/unknown-key.mjs +1 -1
  95. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/common/unknown-key.mjs.map +1 -0
  96. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/forbidden-if-rules.mjs +1 -1
  97. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/forbidden-if-rules.mjs.map +1 -0
  98. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/index.mjs +12 -0
  99. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/present-if-rules.mjs +1 -1
  100. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/present-if-rules.mjs.map +1 -0
  101. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/present-unless-rules.mjs +1 -1
  102. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/present-unless-rules.mjs.map +1 -0
  103. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/present-with-rules.mjs +3 -3
  104. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/present-with-rules.mjs.map +1 -0
  105. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/present-without-rules.mjs +3 -3
  106. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/present-without-rules.mjs.map +1 -0
  107. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/required-if-rules.mjs +3 -3
  108. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/required-if-rules.mjs.map +1 -0
  109. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/required-unless-rules.mjs +1 -1
  110. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/required-unless-rules.mjs.map +1 -0
  111. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/required-when-rule.mjs +1 -1
  112. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/required-when-rule.mjs.map +1 -0
  113. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/required-with-rules.mjs +3 -3
  114. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/required-with-rules.mjs.map +1 -0
  115. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/conditional/required-without-rules.mjs +3 -3
  116. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/conditional/required-without-rules.mjs.map +1 -0
  117. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/core/equal.mjs +1 -1
  118. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/equal.mjs.map +1 -0
  119. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/core/forbidden.mjs +1 -1
  120. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/forbidden.mjs.map +1 -0
  121. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/index.mjs +7 -0
  122. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/core/required.mjs +1 -1
  123. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/required.mjs.map +1 -0
  124. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/core/union.mjs +1 -1
  125. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/union.mjs.map +1 -0
  126. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/core/when.mjs +3 -3
  127. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/core/when.mjs.map +1 -0
  128. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-comparison-rules.mjs +1 -1
  129. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-comparison-rules.mjs.map +1 -0
  130. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-day-rules.mjs +1 -1
  131. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-day-rules.mjs.map +1 -0
  132. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-field-comparison-rules.mjs +3 -3
  133. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-field-comparison-rules.mjs.map +1 -0
  134. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-period-rules.mjs +3 -3
  135. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-period-rules.mjs.map +1 -0
  136. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-relative-rules.mjs +1 -1
  137. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-relative-rules.mjs.map +1 -0
  138. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date-special-rules.mjs +1 -1
  139. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date-special-rules.mjs.map +1 -0
  140. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/date/date.mjs +3 -3
  141. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/date.mjs.map +1 -0
  142. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/date/index.mjs +9 -0
  143. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/index.mjs +57 -0
  144. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/length/index.mjs +3 -0
  145. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/length/length-rules.mjs +1 -1
  146. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/length/length-rules.mjs.map +1 -0
  147. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/number/index.mjs +3 -0
  148. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/number/number-rules.mjs +3 -3
  149. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/number/number-rules.mjs.map +1 -0
  150. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/scalar/accepted-rule.mjs +1 -1
  151. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/scalar/accepted-rule.mjs.map +1 -0
  152. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/scalar/declined-rule.mjs +1 -1
  153. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/scalar/declined-rule.mjs.map +1 -0
  154. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/scalar/index.mjs +4 -0
  155. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/alpha.mjs +1 -1
  156. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/alpha.mjs.map +1 -0
  157. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/credit-card.mjs +1 -1
  158. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/credit-card.mjs.map +1 -0
  159. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/email.mjs +2 -2
  160. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/email.mjs.map +1 -0
  161. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/id-formats.mjs +1 -1
  162. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/id-formats.mjs.map +1 -0
  163. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/index.mjs +13 -0
  164. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/ip.mjs +1 -1
  165. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/ip.mjs.map +1 -0
  166. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/matches.mjs +4 -0
  167. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/pattern.mjs +1 -1
  168. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/pattern.mjs.map +1 -0
  169. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/string-comparison.mjs +1 -1
  170. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/string-comparison.mjs.map +1 -0
  171. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/strong-password-rule.mjs +1 -1
  172. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/strong-password-rule.mjs.map +1 -0
  173. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/url.mjs +1 -1
  174. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/url.mjs.map +1 -0
  175. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/string/without-whitespace.mjs +1 -1
  176. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/rules/string/without-whitespace.mjs.map +1 -0
  177. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/json-schema.d.mts +32 -0
  178. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/json-schema.d.mts.map +1 -0
  179. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/standard-schema/json-schema.mjs +1 -1
  180. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/json-schema.mjs.map +1 -0
  181. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/standard-schema/map-result.mjs +1 -1
  182. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/map-result.mjs.map +1 -0
  183. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/types.d.mts +97 -0
  184. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/standard-schema/types.d.mts.map +1 -0
  185. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/conditional-types.d.mts +16 -0
  186. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/conditional-types.d.mts.map +1 -0
  187. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/context-types.d.mts +42 -0
  188. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/context-types.d.mts.map +1 -0
  189. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/data-transformer-types.d.mts +30 -0
  190. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/data-transformer-types.d.mts.map +1 -0
  191. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/types/date-types.mjs +1 -1
  192. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/date-types.mjs.map +1 -0
  193. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/mutator-types.d.mts +28 -0
  194. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/mutator-types.d.mts.map +1 -0
  195. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/result-types.d.mts +17 -0
  196. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/result-types.d.mts.map +1 -0
  197. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/rule-types.d.mts +53 -0
  198. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/rule-types.d.mts.map +1 -0
  199. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/schema-types.d.mts +11 -0
  200. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/types/schema-types.d.mts.map +1 -0
  201. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/any-validator.mjs +6 -9
  202. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/any-validator.mjs.map +1 -0
  203. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/array-validator.mjs +1 -2
  204. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/array-validator.mjs.map +1 -0
  205. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/base-validator.d.mts +492 -0
  206. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/base-validator.d.mts.map +1 -0
  207. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/base-validator.mjs +16 -49
  208. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/base-validator.mjs.map +1 -0
  209. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/boolean-validator.mjs +1 -1
  210. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/boolean-validator.mjs.map +1 -0
  211. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/computed-validator.mjs +1 -3
  212. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/computed-validator.mjs.map +1 -0
  213. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/date-validator.mjs +3 -3
  214. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/date-validator.mjs.map +1 -0
  215. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/discriminated-union-validator.mjs +2 -6
  216. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/discriminated-union-validator.mjs.map +1 -0
  217. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/float-validator.mjs +1 -1
  218. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/float-validator.mjs.map +1 -0
  219. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/index.mjs +28 -0
  220. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/instanceof-validator.mjs +1 -2
  221. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/instanceof-validator.mjs.map +1 -0
  222. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/int-validator.mjs +1 -1
  223. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/int-validator.mjs.map +1 -0
  224. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/lazy-validator.mjs +1 -3
  225. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/lazy-validator.mjs.map +1 -0
  226. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/literal-validator.mjs +1 -2
  227. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/literal-validator.mjs.map +1 -0
  228. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/managed-validator.mjs +1 -1
  229. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/managed-validator.mjs.map +1 -0
  230. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/equality-conditional-methods.d.mts +91 -0
  231. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/equality-conditional-methods.d.mts.map +1 -0
  232. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/methods/equality-conditional-methods.mjs +1 -1
  233. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/equality-conditional-methods.mjs.map +1 -0
  234. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/forbidden-methods.d.mts +59 -0
  235. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/forbidden-methods.d.mts.map +1 -0
  236. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/methods/forbidden-methods.mjs +1 -1
  237. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/forbidden-methods.mjs.map +1 -0
  238. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/present-methods.d.mts +103 -0
  239. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/present-methods.d.mts.map +1 -0
  240. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/methods/present-methods.mjs +1 -1
  241. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/present-methods.mjs.map +1 -0
  242. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/required-methods.d.mts +194 -0
  243. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/required-methods.d.mts.map +1 -0
  244. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/methods/required-methods.mjs +1 -1
  245. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/methods/required-methods.mjs.map +1 -0
  246. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/number-validator.mjs +1 -1
  247. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/number-validator.mjs.map +1 -0
  248. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/numeric-validator.mjs +2 -2
  249. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/numeric-validator.mjs.map +1 -0
  250. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/object-validator.mjs +7 -8
  251. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/object-validator.mjs.map +1 -0
  252. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/primitive-validator.mjs +1 -1
  253. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/primitive-validator.mjs.map +1 -0
  254. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/record-validator.mjs +2 -3
  255. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/record-validator.mjs.map +1 -0
  256. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/scalar-validator.mjs +1 -1
  257. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/scalar-validator.mjs.map +1 -0
  258. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/string-validator.mjs +1 -1
  259. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/string-validator.mjs.map +1 -0
  260. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/tuple-validator.mjs +1 -2
  261. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/tuple-validator.mjs.map +1 -0
  262. package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/validators/union-validator.mjs +1 -1
  263. package/esm/node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm/validators/union-validator.mjs.map +1 -0
  264. package/esm/queue/load-herald.d.mts.map +1 -1
  265. package/esm/queue/load-herald.mjs +1 -1
  266. package/package.json +6 -6
  267. package/cjs/rabbitmq-driver-BFvpezlq.cjs +0 -3
  268. package/cjs/src-DJA8APmy.cjs.map +0 -1
  269. package/esm/herald/src/communicators/broker-registry.mjs.map +0 -1
  270. package/esm/herald/src/communicators/broker.mjs.map +0 -1
  271. package/esm/herald/src/communicators/index.mjs +0 -4
  272. package/esm/herald/src/decorators/consumable.mjs.map +0 -1
  273. package/esm/herald/src/decorators/index.mjs +0 -3
  274. package/esm/herald/src/drivers/index.mjs +0 -5
  275. package/esm/herald/src/drivers/rabbitmq/index.mjs +0 -4
  276. package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +0 -1
  277. package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +0 -1
  278. package/esm/herald/src/message-managers/event-consumer.mjs.map +0 -1
  279. package/esm/herald/src/message-managers/event-message.mjs.map +0 -1
  280. package/esm/herald/src/message-managers/index.mjs +0 -4
  281. package/esm/herald/src/message-managers/prepare-consumer-subscription.mjs.map +0 -1
  282. package/esm/herald/src/use-case-broadcast.mjs.map +0 -1
  283. package/esm/herald/src/utils/connect-to-broker.mjs.map +0 -1
  284. package/esm/herald/src/utils/index.mjs +0 -3
  285. package/esm/seal/src/config.mjs.map +0 -1
  286. package/esm/seal/src/factory/index.mjs +0 -4
  287. package/esm/seal/src/factory/validate.mjs.map +0 -1
  288. package/esm/seal/src/factory/validators.mjs.map +0 -1
  289. package/esm/seal/src/helpers/date-helpers.mjs.map +0 -1
  290. package/esm/seal/src/helpers/get-field-value.mjs.map +0 -1
  291. package/esm/seal/src/helpers/index.mjs +0 -6
  292. package/esm/seal/src/helpers/is-empty-value.mjs +0 -10
  293. package/esm/seal/src/helpers/is-empty-value.mjs.map +0 -1
  294. package/esm/seal/src/helpers/path-helpers.mjs.map +0 -1
  295. package/esm/seal/src/helpers/validation-helpers.mjs.map +0 -1
  296. package/esm/seal/src/mutators/array-mutators.mjs.map +0 -1
  297. package/esm/seal/src/mutators/date-mutators.mjs.map +0 -1
  298. package/esm/seal/src/mutators/index.mjs +0 -8
  299. package/esm/seal/src/mutators/number-mutators.mjs.map +0 -1
  300. package/esm/seal/src/mutators/object-mutators.mjs.map +0 -1
  301. package/esm/seal/src/mutators/scalar-mutators.mjs +0 -9
  302. package/esm/seal/src/mutators/scalar-mutators.mjs.map +0 -1
  303. package/esm/seal/src/mutators/string-mutators.mjs.map +0 -1
  304. package/esm/seal/src/rules/array/array-rules.mjs.map +0 -1
  305. package/esm/seal/src/rules/array/index.mjs +0 -3
  306. package/esm/seal/src/rules/color/color-rules.mjs.map +0 -1
  307. package/esm/seal/src/rules/color/index.mjs +0 -3
  308. package/esm/seal/src/rules/common/enum.mjs.map +0 -1
  309. package/esm/seal/src/rules/common/equals-field-rules.mjs.map +0 -1
  310. package/esm/seal/src/rules/common/index.mjs +0 -8
  311. package/esm/seal/src/rules/common/instanceof.mjs.map +0 -1
  312. package/esm/seal/src/rules/common/literal.mjs.map +0 -1
  313. package/esm/seal/src/rules/common/type-rules.mjs.map +0 -1
  314. package/esm/seal/src/rules/common/unknown-key.mjs.map +0 -1
  315. package/esm/seal/src/rules/conditional/forbidden-if-rules.mjs.map +0 -1
  316. package/esm/seal/src/rules/conditional/index.mjs +0 -12
  317. package/esm/seal/src/rules/conditional/present-if-rules.mjs.map +0 -1
  318. package/esm/seal/src/rules/conditional/present-unless-rules.mjs.map +0 -1
  319. package/esm/seal/src/rules/conditional/present-with-rules.mjs.map +0 -1
  320. package/esm/seal/src/rules/conditional/present-without-rules.mjs.map +0 -1
  321. package/esm/seal/src/rules/conditional/required-if-rules.mjs.map +0 -1
  322. package/esm/seal/src/rules/conditional/required-unless-rules.mjs.map +0 -1
  323. package/esm/seal/src/rules/conditional/required-when-rule.mjs.map +0 -1
  324. package/esm/seal/src/rules/conditional/required-with-rules.mjs.map +0 -1
  325. package/esm/seal/src/rules/conditional/required-without-rules.mjs.map +0 -1
  326. package/esm/seal/src/rules/core/equal.mjs.map +0 -1
  327. package/esm/seal/src/rules/core/forbidden.mjs.map +0 -1
  328. package/esm/seal/src/rules/core/index.mjs +0 -7
  329. package/esm/seal/src/rules/core/required.mjs.map +0 -1
  330. package/esm/seal/src/rules/core/union.mjs.map +0 -1
  331. package/esm/seal/src/rules/core/when.mjs.map +0 -1
  332. package/esm/seal/src/rules/date/date-comparison-rules.mjs.map +0 -1
  333. package/esm/seal/src/rules/date/date-day-rules.mjs.map +0 -1
  334. package/esm/seal/src/rules/date/date-field-comparison-rules.mjs.map +0 -1
  335. package/esm/seal/src/rules/date/date-period-rules.mjs.map +0 -1
  336. package/esm/seal/src/rules/date/date-relative-rules.mjs.map +0 -1
  337. package/esm/seal/src/rules/date/date-special-rules.mjs.map +0 -1
  338. package/esm/seal/src/rules/date/date.mjs.map +0 -1
  339. package/esm/seal/src/rules/date/index.mjs +0 -9
  340. package/esm/seal/src/rules/index.mjs +0 -54
  341. package/esm/seal/src/rules/length/index.mjs +0 -3
  342. package/esm/seal/src/rules/length/length-rules.mjs.map +0 -1
  343. package/esm/seal/src/rules/number/index.mjs +0 -3
  344. package/esm/seal/src/rules/number/number-rules.mjs.map +0 -1
  345. package/esm/seal/src/rules/scalar/accepted-rule.mjs.map +0 -1
  346. package/esm/seal/src/rules/scalar/declined-rule.mjs.map +0 -1
  347. package/esm/seal/src/rules/scalar/index.mjs +0 -4
  348. package/esm/seal/src/rules/string/alpha.mjs.map +0 -1
  349. package/esm/seal/src/rules/string/credit-card.mjs.map +0 -1
  350. package/esm/seal/src/rules/string/email.mjs.map +0 -1
  351. package/esm/seal/src/rules/string/id-formats.mjs.map +0 -1
  352. package/esm/seal/src/rules/string/index.mjs +0 -13
  353. package/esm/seal/src/rules/string/ip.mjs.map +0 -1
  354. package/esm/seal/src/rules/string/matches.mjs +0 -4
  355. package/esm/seal/src/rules/string/pattern.mjs.map +0 -1
  356. package/esm/seal/src/rules/string/string-comparison.mjs.map +0 -1
  357. package/esm/seal/src/rules/string/strong-password-rule.mjs.map +0 -1
  358. package/esm/seal/src/rules/string/url.mjs.map +0 -1
  359. package/esm/seal/src/rules/string/without-whitespace.mjs.map +0 -1
  360. package/esm/seal/src/standard-schema/json-schema.mjs.map +0 -1
  361. package/esm/seal/src/standard-schema/map-result.mjs.map +0 -1
  362. package/esm/seal/src/types/date-types.mjs.map +0 -1
  363. package/esm/seal/src/validators/any-validator.mjs.map +0 -1
  364. package/esm/seal/src/validators/array-validator.mjs.map +0 -1
  365. package/esm/seal/src/validators/base-validator.mjs.map +0 -1
  366. package/esm/seal/src/validators/boolean-validator.mjs.map +0 -1
  367. package/esm/seal/src/validators/computed-validator.mjs.map +0 -1
  368. package/esm/seal/src/validators/date-validator.mjs.map +0 -1
  369. package/esm/seal/src/validators/discriminated-union-validator.mjs.map +0 -1
  370. package/esm/seal/src/validators/float-validator.mjs.map +0 -1
  371. package/esm/seal/src/validators/index.mjs +0 -28
  372. package/esm/seal/src/validators/instanceof-validator.mjs.map +0 -1
  373. package/esm/seal/src/validators/int-validator.mjs.map +0 -1
  374. package/esm/seal/src/validators/lazy-validator.mjs.map +0 -1
  375. package/esm/seal/src/validators/literal-validator.mjs.map +0 -1
  376. package/esm/seal/src/validators/managed-validator.mjs.map +0 -1
  377. package/esm/seal/src/validators/methods/equality-conditional-methods.mjs.map +0 -1
  378. package/esm/seal/src/validators/methods/forbidden-methods.mjs.map +0 -1
  379. package/esm/seal/src/validators/methods/present-methods.mjs.map +0 -1
  380. package/esm/seal/src/validators/methods/required-methods.mjs.map +0 -1
  381. package/esm/seal/src/validators/number-validator.mjs.map +0 -1
  382. package/esm/seal/src/validators/numeric-validator.mjs.map +0 -1
  383. package/esm/seal/src/validators/object-validator.mjs.map +0 -1
  384. package/esm/seal/src/validators/primitive-validator.mjs.map +0 -1
  385. package/esm/seal/src/validators/record-validator.mjs.map +0 -1
  386. package/esm/seal/src/validators/scalar-validator.mjs.map +0 -1
  387. package/esm/seal/src/validators/string-validator.mjs.map +0 -1
  388. package/esm/seal/src/validators/tuple-validator.mjs.map +0 -1
  389. package/esm/seal/src/validators/union-validator.mjs.map +0 -1
  390. /package/esm/{herald/src → node_modules/.pnpm/@warlock.js_herald@5.2.4_@s_301a5eb076404f4e7a51af7b45e7e429/node_modules/@warlock.js/herald/esm}/index.mjs +0 -0
  391. /package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/file/dimensions.mjs +0 -0
  392. /package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/file/file-size.mjs +0 -0
  393. /package/esm/{seal/src → node_modules/.pnpm/@warlock.js_seal@5.2.4/node_modules/@warlock.js/seal/esm}/rules/file/index.mjs +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/common/type-rules.ts"],"sourcesContent":["import { isObject, isPlainObject } from \"@mongez/supportive-is\";\r\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * String rule - validates string type\r\n */\r\nexport const stringRule: SchemaRule = {\r\n name: \"string\",\r\n defaultErrorMessage: \"The :input must be a string\",\r\n async validate(value: any, context) {\r\n if (typeof value === \"string\") {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Number rule - validates number type\r\n */\r\nexport const numberRule: SchemaRule = {\r\n name: \"number\",\r\n defaultErrorMessage: \"The :input must be a number\",\r\n async validate(value: any, context) {\r\n if (typeof value === \"number\") {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Boolean rule - validates boolean type\r\n */\r\nexport const booleanRule: SchemaRule = {\r\n name: \"boolean\",\r\n defaultErrorMessage: \"The :input must be a boolean\",\r\n async validate(value: any, context) {\r\n if (typeof value === \"boolean\") {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Int rule - validates integer type\r\n */\r\nexport const intRule: SchemaRule = {\r\n name: \"int\",\r\n defaultErrorMessage: \"The :input must be an integer\",\r\n async validate(value: any, context) {\r\n if (Number.isInteger(value)) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Float rule - validates float type\r\n */\r\nexport const floatRule: SchemaRule = {\r\n name: \"float\",\r\n defaultErrorMessage: \"The :input must be a float\",\r\n async validate(value: any, context) {\r\n if (Number.isFinite(value) && !Number.isInteger(value)) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Scalar rule - validates scalar value (string, number, or boolean)\r\n */\r\nexport const scalarRule: SchemaRule = {\r\n name: \"scalar\",\r\n defaultErrorMessage: \"The :input must be a scalar value\",\r\n async validate(value: any, context) {\r\n if ([\"string\", \"number\", \"boolean\"].includes(typeof value)) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Object rule - validates object type\r\n */\r\nexport const objectRule: SchemaRule = {\r\n name: \"object\",\r\n defaultErrorMessage: \"The :input must be an object\",\r\n async validate(value: any, context) {\r\n if (!!isObject(value) && value !== null) {\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 * Object rule - validates object type\r\n */\r\nexport const plainObjectRule: SchemaRule = {\r\n name: \"plainObject\",\r\n defaultErrorMessage: \"The :input must be an object\",\r\n async validate(value: any, context) {\r\n if (!!isPlainObject(value) && value !== null) {\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 * Array rule - validates array type\r\n */\r\nexport const arrayRule: SchemaRule = {\r\n name: \"array\",\r\n defaultErrorMessage: \"The :input must be an array\",\r\n async validate(value: any, context) {\r\n if (Array.isArray(value)) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAOA,MAAa,aAAyB;CACpC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,UAAU,UACnB,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,aAAyB;CACpC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,UAAU,UACnB,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,cAA0B;CACrC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,UAAU,WACnB,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,UAAsB;CACjC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,UAAU,KAAK,GACxB,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,YAAwB;CACnC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,SAAS,KAAK,KAAK,CAAC,OAAO,UAAU,KAAK,GACnD,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAmBA,MAAa,aAAyB;CACpC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,CAAC,CAAC,SAAS,KAAK,KAAK,UAAU,MACjC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,kBAA8B;CACzC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,CAAC,CAAC,cAAc,KAAK,KAAK,UAAU,MACtC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,YAAwB;CACnC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"unknown-key.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/common/unknown-key.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { Schema, SchemaRule } from \"../../types\";\n\n/**\n * Unknown key rule - validates that object doesn't have unknown keys\n */\nexport const unknownKeyRule: SchemaRule<{\n schema: Schema;\n allowedKeys: string[];\n}> = {\n name: \"unknownKeys\",\n defaultErrorMessage: \"The :input contains unknown keys: :unknownKeys\",\n async validate(value: any, context) {\n const schema = this.context.options.schema;\n const allowedKeys = [...Object.keys(schema), ...(this.context.options.allowedKeys || [])];\n\n const unknownKeys = Object.keys(value).filter((key) => !allowedKeys.includes(key));\n\n if (unknownKeys.length > 0) {\n this.context.translationParams.unknownKeys = unknownKeys.join(\", \");\n\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;AAMA,MAAa,iBAGR;CACH,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,SAAS,KAAK,QAAQ,QAAQ;EACpC,MAAM,cAAc,CAAC,GAAG,OAAO,KAAK,MAAM,GAAG,GAAI,KAAK,QAAQ,QAAQ,eAAe,CAAC,CAAE;EAExF,MAAM,cAAc,OAAO,KAAK,KAAK,CAAC,CAAC,QAAQ,QAAQ,CAAC,YAAY,SAAS,GAAG,CAAC;EAEjF,IAAI,YAAY,SAAS,GAAG;GAC1B,KAAK,QAAQ,kBAAkB,cAAc,YAAY,KAAK,IAAI;GAElE,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"forbidden-if-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/forbidden-if-rules.ts"],"sourcesContent":["import { 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 * Forbidden if rule - field is forbidden if another field equals a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIf\",\r\n description: \"The field is forbidden if another field equals a specific value\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\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 forbidden if it has a value and 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 = expectedValue;\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 * Forbidden if not rule - field is forbidden if another field does NOT equal a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfNotRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIfNot\",\r\n description: \"The field is forbidden if another field does NOT equal a specific value\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\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 forbidden if it has a value and the other field does NOT equal the expected value\r\n if (!isEmptyValue(value) && fieldValue !== expectedValue) {\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 * Forbidden if empty rule - field is forbidden if another field is empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIfEmpty\",\r\n description: \"The field is forbidden if another field is empty\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is forbidden if it has a value and the other field is empty\r\n if (!isEmptyValue(value) && isEmptyValue(fieldValue)) {\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 * Forbidden if not empty rule - field is forbidden if another field is not empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfNotEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIfNotEmpty\",\r\n description: \"The field is forbidden if another field is not empty\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field is forbidden if it has a value and the other field is not empty\r\n if (!isEmptyValue(value) && !isEmptyValue(fieldValue)) {\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 * Forbidden if in rule - field is forbidden if another field's value is in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIfIn\",\r\n description: \"The field is forbidden if another field's value is in the given array\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\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 forbidden if it has a value and the other field's value is in the array\r\n if (!isEmptyValue(value) && values.includes(fieldValue)) {\r\n this.context.translationParams.values = values.join(\", \");\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 * Forbidden if not in rule - field is forbidden if another field's value is NOT in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const forbiddenIfNotInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"forbiddenIfNotIn\",\r\n description: \"The field is forbidden if another field's value is NOT in the given array\",\r\n sortOrder: -2,\r\n defaultErrorMessage: \"The :input is forbidden\",\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 forbidden if it has a value and the other field's value is NOT in the array\r\n if (!isEmptyValue(value) && !values.includes(fieldValue)) {\r\n this.context.translationParams.values = values.join(\", \");\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"],"mappings":";;;;;;;;;;AAQA,MAAa,kBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,OAAO,kBAAkB,KAAK,QAAQ;EAC9C,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,CAAC,aAAa,KAAK,KAAK,eAAe,eAAe;GACxD,KAAK,QAAQ,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;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,uBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,WAAW,KAAK,QAAQ;EAChC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,OAAO,SAAS,UAAU,GAAG;GACxD,KAAK,QAAQ,kBAAkB,SAAS,OAAO,KAAK,IAAI;GACxD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1,12 +0,0 @@
1
- import { requiredIfAllEmptyRule, requiredIfAllNotEmptyRule, requiredIfAnyEmptyRule, requiredIfAnyNotEmptyRule, requiredIfEmptyRule, requiredIfInRule, requiredIfNotEmptyRule, requiredIfNotInRule, requiredIfRule } from "./required-if-rules.mjs";
2
- import { requiredUnlessRule } from "./required-unless-rules.mjs";
3
- import { requiredWhenRule } from "./required-when-rule.mjs";
4
- import { requiredWithAllRule, requiredWithAnyRule, requiredWithRule } from "./required-with-rules.mjs";
5
- import { requiredWithoutAllRule, requiredWithoutAnyRule, requiredWithoutRule } from "./required-without-rules.mjs";
6
- import { presentIfEmptyRule, presentIfInRule, presentIfNotEmptyRule, presentIfNotInRule, presentIfRule } from "./present-if-rules.mjs";
7
- import { presentUnlessRule } from "./present-unless-rules.mjs";
8
- import { presentWithAllRule, presentWithAnyRule, presentWithRule } from "./present-with-rules.mjs";
9
- import { presentWithoutAllRule, presentWithoutAnyRule, presentWithoutRule } from "./present-without-rules.mjs";
10
- import { forbiddenIfEmptyRule, forbiddenIfInRule, forbiddenIfNotEmptyRule, forbiddenIfNotInRule, forbiddenIfNotRule, forbiddenIfRule } from "./forbidden-if-rules.mjs";
11
-
12
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-if-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/present-if-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 * Present if rule - field must be present if another field equals a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentIfRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentIf\",\r\n description: \"The field must be present if another field equals a specific value\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if the other field equals the expected value\r\n if (value === undefined && fieldValue === expectedValue) {\r\n this.context.translationParams.value = 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 * Present if empty rule - field must be present if another field is empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentIfEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentIfEmpty\",\r\n description: \"The field must be present if another field is empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field must be present if the other field is empty\r\n if (value === undefined && isEmptyValue(fieldValue)) {\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 * Present if not empty rule - field must be present if another field is not empty\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentIfNotEmptyRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentIfNotEmpty\",\r\n description: \"The field must be present if another field is not empty\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field must be present if the other field is not empty\r\n if (value === undefined && !isEmptyValue(fieldValue)) {\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 * Present if in rule - field must be present if another field's value is in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentIfInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentIfIn\",\r\n description: \"The field must be present if another field's value is in the given array\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if the other field's value is in the array\r\n if (value === undefined && values.includes(fieldValue)) {\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 * Present if not in rule - field must be present if another field's value is NOT in the given array\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentIfNotInRule: SchemaRule<{\r\n field: string;\r\n values: any[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentIfNotIn\",\r\n description: \"The field must be present if another field's value is NOT in the given array\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if the other field's value is NOT in the array\r\n if (value === undefined && !values.includes(fieldValue)) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;AAQA,MAAa,gBAIR;CACH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AM,EAAE,WAAW,KAAK,QAAQ;EAChC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,UAAU,UAAa,CAAC,OAAO,SAAS,UAAU,GACpD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-unless-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/present-unless-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Present unless rule - field must be present unless another field equals a specific value\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentUnlessRule: SchemaRule<{\r\n field: string;\r\n value: any;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentUnless\",\r\n description: \"The field must be present unless another field equals a specific value\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present unless the other field equals the expected value\r\n if (value === undefined && fieldValue !== expectedValue) {\r\n this.context.translationParams.value = 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"],"mappings":";;;;;;;;;AAOA,MAAa,oBAIR;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,UAAU,UAAa,eAAe,eAAe;GACvD,KAAK,QAAQ,kBAAkB,QAAQ;GACvC,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-with-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/present-with-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Present with rule - field must be present if another field is present\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWith\",\r\n description: \"The field must be present if another field is present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // The field must be present if the other field is present\r\n if (value === undefined && 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 * Present with all rule - field must be present if all specified fields are present\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithAllRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWithAll\",\r\n description: \"The field must be present if all specified fields are present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if all other fields are present\r\n if (value === undefined && allPresent) {\r\n fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\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 * Present with any rule - field must be present if any of the specified fields is present\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithAnyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWithAny\",\r\n description: \"The field must be present if any of the specified fields is present\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if any other field is present\r\n if (value === undefined && anyPresent) {\r\n fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,kBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,UAAU,UAAa,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,qBAGR;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,UAAU,UAAa,YAAY;GACrC,OAAO,SAAS,UAAU;IACxB,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GAED,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,qBAGR;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,UAAU,UAAa,YAAY;GACrC,OAAO,SAAS,UAAU;IACxB,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GAED,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-without-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/present-without-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Present without rule - field must be present if another field is missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithoutRule: SchemaRule<{\r\n field: string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWithout\",\r\n description: \"The field must be present if another field is missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n\r\n // Field must be present if the other field is missing\r\n if (value === undefined && 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 * Present without all rule - field must be present if all specified fields are missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithoutAllRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWithoutAll\",\r\n description: \"The field must be present if all specified fields are missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if all other fields are missing\r\n if (value === undefined && allMissing) {\r\n fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\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 * Present without any rule - field must be present if any of the specified fields is missing\r\n * Supports both global and sibling scope\r\n */\r\nexport const presentWithoutAnyRule: SchemaRule<{\r\n fields: string[];\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"presentWithoutAny\",\r\n description: \"The field must be present if any of the specified fields is missing\",\r\n sortOrder: -2,\r\n requiresValue: false,\r\n defaultErrorMessage: \"The :input field must be present\",\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 must be present if any other field is missing\r\n if (value === undefined && anyMissing) {\r\n fields.forEach((field) => {\r\n this.context.translatableParams.field = field;\r\n });\r\n\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,qBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,UAAU,UAAa,eAAe,QAAW;GACnD,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,wBAGR;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,UAAU,UAAa,YAAY;GACrC,OAAO,SAAS,UAAU;IACxB,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GAED,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,wBAGR;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,UAAU,UAAa,YAAY;GACrC,OAAO,SAAS,UAAU;IACxB,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GAED,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
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":";;;;;;;;;;;;AASA,MAAa,iBAIR;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,KAA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;IAC7C,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GACD,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,4BAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAIlC,MAAM,cAHc,gBAAgB,MAAM,OAGZ,CAAC,CAAC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC;EAC7D,IAAI,aAAa,KAAK,KAAK,aAAa;GACtC,KAAK,QAAQ,QAAQ,OAAO,SAAS,UAAU;IAC7C,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GACD,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,4BAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAIlC,MAAM,cAHc,gBAAgB,MAAM,OAGZ,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;EAC5D,IAAI,aAAa,KAAK,KAAK,aAAa;GACtC,KAAK,QAAQ,QAAQ,OAAO,SAAS,UAAU;IAC7C,KAAK,QAAQ,mBAAmB,QAAQ;GAC1C,CAAC;GACD,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"required-when-rule.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/conditional/required-when-rule.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaContext, SchemaRule } from \"../../types\";\n\n/**\n * Required when callback returns true.\n *\n * The callback receives only the SchemaContext (not the value),\n * because \"required\" is about surrounding conditions, not the field itself.\n *\n * @example\n * ```ts\n * v.string().requiredWhen((context) => {\n * return context.allData.notificationMethod === 'email';\n * })\n * ```\n */\nexport const requiredWhenRule: SchemaRule<{\n callback: (context: SchemaContext) => boolean | Promise<boolean>;\n}> = {\n name: \"requiredWhen\",\n defaultErrorMessage: \"The :input is required\",\n requiresValue: false,\n sortOrder: -2,\n async validate(value, context) {\n const shouldBeRequired = await this.context.options.callback?.(context);\n\n if (shouldBeRequired && isEmptyValue(value)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,mBAER;CACH,MAAM;CACN,qBAAqB;CACrB,eAAe;CACf,WAAW;CACX,MAAM,SAAS,OAAO,SAAS;EAG7B,IAAI,MAF2B,KAAK,QAAQ,QAAQ,WAAW,OAAO,KAE9C,aAAa,KAAK,GACxC,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF"}
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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,7 +0,0 @@
1
- import { presentRule, requiredRule } from "./required.mjs";
2
- import { equalRule } from "./equal.mjs";
3
- import { forbiddenRule } from "./forbidden.mjs";
4
- import { unionRule } from "./union.mjs";
5
- import { whenRule } from "./when.mjs";
6
-
7
- export { };
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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;;;;AAwBA,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 +0,0 @@
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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date/date-period-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\nconst MONTHS = {\r\n 1: \"january\",\r\n 2: \"february\",\r\n 3: \"march\",\r\n 4: \"april\",\r\n 5: \"may\",\r\n 6: \"june\",\r\n 7: \"july\",\r\n 8: \"august\",\r\n 9: \"september\",\r\n 10: \"october\",\r\n 11: \"november\",\r\n 12: \"december\",\r\n};\r\n\r\nexport type Month = keyof typeof MONTHS;\r\n\r\n/**\r\n * Month rule - date must be in specific month (1-12)\r\n */\r\nexport const monthRule: SchemaRule<{ month: Month }> = {\r\n name: \"month\",\r\n defaultErrorMessage: \"The :input must be in month :month\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const month = inputDate.getMonth() + 1; // getMonth() returns 0-11\r\n\r\n if (month === this.context.options.month) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.month =\r\n MONTHS[this.context.options.month as keyof typeof MONTHS];\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Year rule - date must be in specific year\r\n */\r\nexport const yearRule: SchemaRule<{ year: number }> = {\r\n name: \"year\",\r\n defaultErrorMessage: \"The :input must be in year :year\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const year = inputDate.getFullYear();\r\n\r\n if (year === this.context.options.year) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.year = this.context.options.year;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between years rule - date must be between start and end years\r\n * Supports field names with sibling scope\r\n */\r\nexport const betweenYearsRule: SchemaRule<{\r\n startYear: number | string;\r\n endYear: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"betweenYears\",\r\n defaultErrorMessage: \"The :input must be between :startYear and :endYear\",\r\n async validate(value: Date, context) {\r\n const { startYear, endYear, scope = \"global\" } = this.context.options;\r\n const inputDate = new Date(value);\r\n const inputYear = inputDate.getFullYear();\r\n\r\n // Extract start year\r\n let compareStartYear: number;\r\n if (typeof startYear === \"number\") {\r\n compareStartYear = startYear;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, startYear);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n if (fieldValue instanceof Date) {\r\n compareStartYear = fieldValue.getFullYear();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareStartYear = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareStartYear = date.getFullYear();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n // Extract end year\r\n let compareEndYear: number;\r\n if (typeof endYear === \"number\") {\r\n compareEndYear = endYear;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, endYear);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n if (fieldValue instanceof Date) {\r\n compareEndYear = fieldValue.getFullYear();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareEndYear = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareEndYear = date.getFullYear();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n if (inputYear >= compareStartYear && inputYear <= compareEndYear) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.startYear = compareStartYear;\r\n this.context.translationParams.endYear = compareEndYear;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between months rule - date must be between start and end months (1-12)\r\n * Supports field names with sibling scope\r\n */\r\nexport const betweenMonthsRule: SchemaRule<{\r\n startMonth: Month | string;\r\n endMonth: Month | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"betweenMonths\",\r\n defaultErrorMessage: \"The :input must be between month :startMonth and :endMonth\",\r\n async validate(value: Date, context) {\r\n const { startMonth, endMonth, scope = \"global\" } = this.context.options;\r\n const inputDate = new Date(value);\r\n const inputMonth = inputDate.getMonth() + 1; // getMonth() returns 0-11\r\n\r\n // Extract start month\r\n let compareStartMonth: number;\r\n if (typeof startMonth === \"number\") {\r\n compareStartMonth = startMonth;\r\n this.context.translatableParams.startMonth = MONTHS[compareStartMonth as keyof typeof MONTHS];\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, startMonth);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.startMonth = startMonth;\r\n\r\n if (fieldValue instanceof Date) {\r\n compareStartMonth = fieldValue.getMonth() + 1;\r\n } else if (typeof fieldValue === \"number\") {\r\n compareStartMonth = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareStartMonth = date.getMonth() + 1;\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n // Extract end month\r\n let compareEndMonth: number;\r\n if (typeof endMonth === \"number\") {\r\n compareEndMonth = endMonth;\r\n this.context.translatableParams.endMonth = MONTHS[compareEndMonth as keyof typeof MONTHS];\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, endMonth);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.endMonth = endMonth;\r\n\r\n if (fieldValue instanceof Date) {\r\n compareEndMonth = fieldValue.getMonth() + 1;\r\n } else if (typeof fieldValue === \"number\") {\r\n compareEndMonth = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareEndMonth = date.getMonth() + 1;\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n if (inputMonth >= compareStartMonth && inputMonth <= compareEndMonth) {\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 * Between days rule - date must be between start and end days (1-31)\r\n * Supports field names with sibling scope\r\n */\r\nexport const betweenDaysRule: SchemaRule<{\r\n startDay: number | string;\r\n endDay: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"betweenDays\",\r\n defaultErrorMessage: \"The :input must be between day :startDay and :endDay\",\r\n async validate(value: Date, context) {\r\n const { startDay, endDay, scope = \"global\" } = this.context.options;\r\n const inputDate = new Date(value);\r\n const inputDay = inputDate.getDate();\r\n\r\n // Extract start day\r\n let compareStartDay: number;\r\n if (typeof startDay === \"number\") {\r\n compareStartDay = startDay;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, startDay);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n if (fieldValue instanceof Date) {\r\n compareStartDay = fieldValue.getDate();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareStartDay = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareStartDay = date.getDate();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n // Extract end day\r\n let compareEndDay: number;\r\n if (typeof endDay === \"number\") {\r\n compareEndDay = endDay;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, endDay);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n if (fieldValue instanceof Date) {\r\n compareEndDay = fieldValue.getDate();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareEndDay = fieldValue;\r\n } else {\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareEndDay = date.getDate();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n if (inputDay >= compareStartDay && inputDay <= compareEndDay) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.startDay = compareStartDay;\r\n this.context.translationParams.endDay = compareEndDay;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Quarter rule - date must be in specific quarter (1-4)\r\n */\r\nexport const quarterRule: SchemaRule<{ quarter: 1 | 2 | 3 | 4 }> = {\r\n name: \"quarter\",\r\n defaultErrorMessage: \"The :input must be in quarter :quarter\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const month = inputDate.getMonth() + 1;\r\n const quarter = Math.ceil(month / 3);\r\n\r\n if (quarter === this.context.options.quarter) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.quarter = this.context.options.quarter;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between times rule - time must be between start and end times (HH:MM format)\r\n */\r\nexport const betweenTimesRule: SchemaRule<{\r\n startTime: string;\r\n endTime: string;\r\n}> = {\r\n name: \"betweenTimes\",\r\n defaultErrorMessage: \"The :input must be between :startTime and :endTime\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const inputHour = inputDate.getHours();\r\n const inputMinute = inputDate.getMinutes();\r\n const inputTimeInMinutes = inputHour * 60 + inputMinute;\r\n\r\n const { startTime, endTime } = this.context.options;\r\n\r\n // Parse start time\r\n const [startHour, startMinute] = startTime.split(\":\").map(Number);\r\n const startTimeInMinutes = startHour * 60 + startMinute;\r\n\r\n // Parse end time\r\n const [endHour, endMinute] = endTime.split(\":\").map(Number);\r\n const endTimeInMinutes = endHour * 60 + endMinute;\r\n\r\n if (inputTimeInMinutes >= startTimeInMinutes && inputTimeInMinutes <= endTimeInMinutes) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.startTime = startTime;\r\n this.context.translationParams.endTime = endTime;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Min year rule - year must be >= given year or field\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const minYearRule: SchemaRule<{\r\n yearOrField: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"minYear\",\r\n description: \"The date year must be at least the given year or field\",\r\n defaultErrorMessage: \"The :input year must be higher than :yearOrField\",\r\n async validate(value: Date, context) {\r\n const { yearOrField, scope = \"global\" } = this.context.options;\r\n let compareYear: number;\r\n\r\n if (typeof yearOrField === \"number\") {\r\n compareYear = yearOrField;\r\n this.context.translationParams.yearOrField = yearOrField;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, yearOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.yearOrField = yearOrField;\r\n\r\n // If field contains a date, extract the year\r\n if (fieldValue instanceof Date) {\r\n compareYear = fieldValue.getFullYear();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareYear = fieldValue;\r\n } else {\r\n // Try to parse as date and extract year\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareYear = date.getFullYear();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputYear = inputDate.getFullYear();\r\n\r\n if (inputYear >= compareYear) {\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 * Max year rule - year must be <= given year or field\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const maxYearRule: SchemaRule<{\r\n yearOrField: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"maxYear\",\r\n description: \"The date year must be at most the given year or field\",\r\n defaultErrorMessage: \"The :input year must be at most :yearOrField\",\r\n async validate(value: Date, context) {\r\n const { yearOrField, scope = \"global\" } = this.context.options;\r\n let compareYear: number;\r\n\r\n if (typeof yearOrField === \"number\") {\r\n compareYear = yearOrField;\r\n this.context.translationParams.yearOrField = compareYear;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, yearOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.yearOrField = yearOrField;\r\n\r\n // If field contains a date, extract the year\r\n if (fieldValue instanceof Date) {\r\n compareYear = fieldValue.getFullYear();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareYear = fieldValue;\r\n } else {\r\n // Try to parse as date and extract year\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareYear = date.getFullYear();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputYear = inputDate.getFullYear();\r\n\r\n if (inputYear <= compareYear) {\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 * Min month rule - month must be >= given month or field (1-12)\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const minMonthRule: SchemaRule<{\r\n monthOrField: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"minMonth\",\r\n description: \"The date month must be at least the given month or field\",\r\n defaultErrorMessage: \"The :input month must be at least :monthOrField\",\r\n async validate(value: Date, context) {\r\n const { monthOrField, scope = \"global\" } = this.context.options;\r\n let compareMonth: number;\r\n\r\n if (typeof monthOrField === \"number\") {\r\n compareMonth = monthOrField;\r\n this.context.translationParams.monthOrField = compareMonth;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, monthOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.monthOrField = monthOrField;\r\n\r\n // If field contains a date, extract the month\r\n if (fieldValue instanceof Date) {\r\n compareMonth = fieldValue.getMonth() + 1; // getMonth() returns 0-11\r\n } else if (typeof fieldValue === \"number\") {\r\n compareMonth = fieldValue;\r\n } else {\r\n // Try to parse as date and extract month\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareMonth = date.getMonth() + 1;\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputMonth = inputDate.getMonth() + 1; // getMonth() returns 0-11\r\n\r\n if (inputMonth >= compareMonth) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Max month rule - month must be <= given month or field (1-12)\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const maxMonthRule: SchemaRule<{\r\n monthOrField: Month | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"maxMonth\",\r\n description: \"The date month must be at most the given month or field\",\r\n defaultErrorMessage: \"The :input month must be at most :monthOrField\",\r\n async validate(value: Date, context) {\r\n const { monthOrField, scope = \"global\" } = this.context.options;\r\n let compareMonth: number;\r\n\r\n if (typeof monthOrField === \"number\") {\r\n compareMonth = monthOrField;\r\n this.context.translatableParams.monthOrField = MONTHS[monthOrField];\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, monthOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.monthOrField = monthOrField;\r\n\r\n // If field contains a date, extract the month\r\n if (fieldValue instanceof Date) {\r\n compareMonth = fieldValue.getMonth() + 1; // getMonth() returns 0-11\r\n } else if (typeof fieldValue === \"number\") {\r\n compareMonth = fieldValue;\r\n } else {\r\n // Try to parse as date and extract month\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareMonth = date.getMonth() + 1;\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputMonth = inputDate.getMonth() + 1; // getMonth() returns 0-11\r\n\r\n if (inputMonth <= compareMonth) {\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 * Min day rule - day must be >= given day or field (1-31)\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const minDayRule: SchemaRule<{\r\n dayOrField: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"minDay\",\r\n description: \"The date day must be at least the given day or field\",\r\n defaultErrorMessage: \"The :input day must be higher than :dayOrField\",\r\n async validate(value: Date, context) {\r\n const { dayOrField, scope = \"global\" } = this.context.options;\r\n let compareDay: number;\r\n\r\n if (typeof dayOrField === \"number\") {\r\n compareDay = dayOrField;\r\n this.context.translationParams.dayOrField = dayOrField;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, dayOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.dayOrField = dayOrField;\r\n\r\n // If field contains a date, extract the day\r\n if (fieldValue instanceof Date) {\r\n compareDay = fieldValue.getDate();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareDay = fieldValue;\r\n } else {\r\n // Try to parse as date and extract day\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareDay = date.getDate();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputDay = inputDate.getDate();\r\n\r\n if (inputDay >= compareDay) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Max day rule - day must be <= given day or field (1-31)\r\n * Smart detection: number or field name\r\n * Supports both global and sibling scope\r\n */\r\nexport const maxDayRule: SchemaRule<{\r\n dayOrField: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"maxDay\",\r\n description: \"The date day must be at most the given day or field\",\r\n defaultErrorMessage: \"The :input day must be at most :dayOrField\",\r\n async validate(value: Date, context) {\r\n const { dayOrField, scope = \"global\" } = this.context.options;\r\n let compareDay: number;\r\n\r\n if (typeof dayOrField === \"number\") {\r\n compareDay = dayOrField;\r\n this.context.translationParams.dayOrField = dayOrField;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, dayOrField);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.dayOrField = dayOrField;\r\n\r\n // If field contains a date, extract the day\r\n if (fieldValue instanceof Date) {\r\n compareDay = fieldValue.getDate();\r\n } else if (typeof fieldValue === \"number\") {\r\n compareDay = fieldValue;\r\n } else {\r\n // Try to parse as date and extract day\r\n const date = new Date(fieldValue);\r\n if (!isNaN(date.getTime())) {\r\n compareDay = date.getDate();\r\n } else {\r\n return VALID_RULE;\r\n }\r\n }\r\n }\r\n\r\n const inputDate = new Date(value);\r\n const inputDay = inputDate.getDate();\r\n\r\n if (inputDay <= compareDay) {\r\n return VALID_RULE;\r\n }\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;AAIA,MAAM,SAAS;CACb,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;;;AAOA,MAAa,YAA0C;CACrD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAInC,IAFc,IADQ,KAAK,KACL,CAAC,CAAC,SAAS,IAAI,MAEvB,KAAK,QAAQ,QAAQ,OACjC,OAAO;EAGT,KAAK,QAAQ,mBAAmB,QAC9B,OAAO,KAAK,QAAQ,QAAQ;EAC9B,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,WAAyC;CACpD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAInC,IAFa,IADS,KAAK,KACN,CAAC,CAAC,YAEhB,MAAM,KAAK,QAAQ,QAAQ,MAChC,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,KAAK,KACF,CAAC,CAAC,QAEhB,KAAK,YACd,OAAO;EAET,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-relative-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/date/date-relative-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Within days rule - date must be within X days from now (past or future)\r\n */\r\nexport const withinDaysRule: SchemaRule<{ days: number }> = {\r\n name: \"withinDays\",\r\n defaultErrorMessage: \"The :input must be within :days days from now\",\r\n async validate(value: Date, context) {\r\n const now = new Date();\r\n const inputDate = new Date(value);\r\n const diffTime = Math.abs(inputDate.getTime() - now.getTime());\r\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n\r\n if (diffDays <= this.context.options.days) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.days = this.context.options.days;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Within past days rule - date must be within X days in the past\r\n */\r\nexport const withinPastDaysRule: SchemaRule<{ days: number }> = {\r\n name: \"withinPastDays\",\r\n defaultErrorMessage: \"The :input must be within the past :days days\",\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 invalidRule(this, context); // Must be in past\r\n }\r\n\r\n const diffTime = now.getTime() - inputDate.getTime();\r\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n\r\n if (diffDays <= this.context.options.days) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.days = this.context.options.days;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Within future days rule - date must be within X days in the future\r\n */\r\nexport const withinFutureDaysRule: SchemaRule<{ days: number }> = {\r\n name: \"withinFutureDays\",\r\n defaultErrorMessage: \"The :input must be within the next :days days\",\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 invalidRule(this, context); // Must be in future\r\n }\r\n\r\n const diffTime = inputDate.getTime() - now.getTime();\r\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n\r\n if (diffDays <= this.context.options.days) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.days = this.context.options.days;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAMA,MAAa,iBAA+C;CAC1D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,sBAAM,IAAI,KAAK;EACrB,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,MAAM,WAAW,KAAK,IAAI,UAAU,QAAQ,IAAI,IAAI,QAAQ,CAAC;EAG7D,IAFiB,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAE7C,KAAK,KAAK,QAAQ,QAAQ,MACnC,OAAO;EAGT,KAAK,QAAQ,kBAAkB,OAAO,KAAK,QAAQ,QAAQ;EAE3D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,qBAAmD;CAC9D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,sBAAM,IAAI,KAAK;EACrB,MAAM,YAAY,IAAI,KAAK,KAAK;EAEhC,IAAI,YAAY,KACd,OAAO,YAAY,MAAM,OAAO;EAGlC,MAAM,WAAW,IAAI,QAAQ,IAAI,UAAU,QAAQ;EAGnD,IAFiB,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAE7C,KAAK,KAAK,QAAQ,QAAQ,MACnC,OAAO;EAGT,KAAK,QAAQ,kBAAkB,OAAO,KAAK,QAAQ,QAAQ;EAE3D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,uBAAqD;CAChE,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,sBAAM,IAAI,KAAK;EACrB,MAAM,YAAY,IAAI,KAAK,KAAK;EAEhC,IAAI,YAAY,KACd,OAAO,YAAY,MAAM,OAAO;EAGlC,MAAM,WAAW,UAAU,QAAQ,IAAI,IAAI,QAAQ;EAGnD,IAFiB,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAE7C,KAAK,KAAK,QAAQ,QAAQ,MACnC,OAAO;EAGT,KAAK,QAAQ,kBAAkB,OAAO,KAAK,QAAQ,QAAQ;EAE3D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-special-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/date/date-special-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Birthday rule - valid birthday (not in future, reasonable age)\r\n */\r\nexport const birthdayRule: SchemaRule<{ minAge?: number; maxAge?: number }> = {\r\n name: \"birthday\",\r\n defaultErrorMessage: \"The :input must be a valid birthday\",\r\n async validate(birthDate: Date, context) {\r\n const today = new Date();\r\n\r\n // Must not be in the future\r\n if (birthDate > today) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n // Calculate age\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const monthDiff = today.getMonth() - birthDate.getMonth();\r\n\r\n if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n // Check minimum age (default: 0)\r\n const minAge = this.context.options.minAge ?? 0;\r\n if (age < minAge) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n // Check maximum age (default: 150)\r\n const maxAge = this.context.options.maxAge ?? 150;\r\n if (age > maxAge) {\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 * Between age rule - age must be between min and max years\r\n */\r\nexport const betweenAgeRule: SchemaRule<{ minAge: number; maxAge: number }> = {\r\n name: \"betweenAge\",\r\n defaultErrorMessage: \"Age must be between :minAge and :maxAge years\",\r\n async validate(value: Date, context) {\r\n const birthDate = new Date(value);\r\n const today = new Date();\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const monthDiff = today.getMonth() - birthDate.getMonth();\r\n\r\n if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n const { minAge, maxAge } = this.context.options;\r\n\r\n if (age >= minAge && age <= maxAge) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minAge = minAge;\r\n this.context.translationParams.maxAge = maxAge;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Leap year rule - date must be in a leap year\r\n */\r\nexport const leapYearRule: SchemaRule = {\r\n name: \"leapYear\",\r\n defaultErrorMessage: \"The :input must be in a leap year\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const year = inputDate.getFullYear();\r\n\r\n // Leap year logic: divisible by 4, except century years unless divisible by 400\r\n const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\r\n\r\n if (isLeapYear) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAMA,MAAa,eAAiE;CAC5E,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,WAAiB,SAAS;EACvC,MAAM,wBAAQ,IAAI,KAAK;EAGvB,IAAI,YAAY,OACd,OAAO,YAAY,MAAM,OAAO;EAIlC,IAAI,MAAM,MAAM,YAAY,IAAI,UAAU,YAAY;EACtD,MAAM,YAAY,MAAM,SAAS,IAAI,UAAU,SAAS;EAExD,IAAI,YAAY,KAAM,cAAc,KAAK,MAAM,QAAQ,IAAI,UAAU,QAAQ,GAC3E;EAIF,MAAM,SAAS,KAAK,QAAQ,QAAQ,UAAU;EAC9C,IAAI,MAAM,QACR,OAAO,YAAY,MAAM,OAAO;EAIlC,MAAM,SAAS,KAAK,QAAQ,QAAQ,UAAU;EAC9C,IAAI,MAAM,QACR,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;AAKA,MAAa,iBAAiE;CAC5E,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,MAAM,wBAAQ,IAAI,KAAK;EACvB,IAAI,MAAM,MAAM,YAAY,IAAI,UAAU,YAAY;EACtD,MAAM,YAAY,MAAM,SAAS,IAAI,UAAU,SAAS;EAExD,IAAI,YAAY,KAAM,cAAc,KAAK,MAAM,QAAQ,IAAI,UAAU,QAAQ,GAC3E;EAGF,MAAM,EAAE,QAAQ,WAAW,KAAK,QAAQ;EAExC,IAAI,OAAO,UAAU,OAAO,QAC1B,OAAO;EAGT,KAAK,QAAQ,kBAAkB,SAAS;EACxC,KAAK,QAAQ,kBAAkB,SAAS;EAExC,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,eAA2B;CACtC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAEnC,MAAM,OAAO,IADS,KAAK,KACN,CAAC,CAAC,YAAY;EAKnC,IAFoB,OAAO,MAAM,KAAK,OAAO,QAAQ,KAAM,OAAO,QAAQ,GAGxE,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/date/date.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\nimport type { WeekDay } from \"../../types/date-types\";\r\nimport { WEEK_DAYS } from \"../../types/date-types\";\r\n\r\n/**\r\n * Date rule - validates date format\r\n */\r\nexport const dateRule: SchemaRule = {\r\n name: \"date\",\r\n defaultErrorMessage: \"The :input must be a valid date\",\r\n async validate(value: any, context) {\r\n if (value instanceof Date && !isNaN(value.getTime())) {\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 * Min date rule - date must be >= given date or field\r\n * Smart detection: date value or field name\r\n */\r\nexport const minDateRule: SchemaRule<{\r\n dateOrField: Date | string | number;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"minDate\",\r\n description: \"The field must be at least the given date or field\",\r\n defaultErrorMessage: \"The :input must be at least :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 * Max date rule - date must be <= given date or field\r\n * Smart detection: date value or field name\r\n */\r\nexport const maxDateRule: SchemaRule<{\r\n dateOrField: Date | string | number;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"maxDate\",\r\n defaultErrorMessage: \"The :input must be at most :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 * From today rule - date must be today or in the future\r\n */\r\nexport const fromTodayRule: SchemaRule = {\r\n name: \"fromToday\",\r\n defaultErrorMessage: \"The :input must be today or in the future\",\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\r\n/**\r\n * Before today rule - date must be before today\r\n */\r\nexport const beforeTodayRule: SchemaRule = {\r\n name: \"beforeToday\",\r\n defaultErrorMessage: \"The :input must be before 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\r\n/**\r\n * From hour rule - time must be from specific hour onwards\r\n */\r\nexport const fromHourRule: SchemaRule<{ hour: number }> = {\r\n name: \"fromHour\",\r\n defaultErrorMessage: \"The :input must be from :hour:00 onwards\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const hour = inputDate.getHours();\r\n\r\n if (hour >= this.context.options.hour) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.hour = this.context.options.hour;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Before hour rule - time must be before specific hour\r\n */\r\nexport const beforeHourRule: SchemaRule<{ hour: number }> = {\r\n name: \"beforeHour\",\r\n defaultErrorMessage: \"The :input must be before :hour:00\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const hour = inputDate.getHours();\r\n\r\n if (hour < this.context.options.hour) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.hour = this.context.options.hour;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between hours rule - time must be between start and end hours\r\n */\r\nexport const betweenHoursRule: SchemaRule<{\r\n startHour: number;\r\n endHour: number;\r\n}> = {\r\n name: \"betweenHours\",\r\n defaultErrorMessage: \"The :input must be between :startHour:00 and :endHour:00\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const hour = inputDate.getHours();\r\n const { startHour, endHour } = this.context.options;\r\n\r\n if (hour >= startHour && hour <= endHour) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.startHour = startHour;\r\n this.context.translationParams.endHour = endHour;\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * From minute rule - time must be from specific minute onwards\r\n */\r\nexport const fromMinuteRule: SchemaRule<{ minute: number }> = {\r\n name: \"fromMinute\",\r\n defaultErrorMessage: \"The :input must be from minute :minute onwards\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const minute = inputDate.getMinutes();\r\n\r\n if (minute >= this.context.options.minute) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minute = this.context.options.minute;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Before minute rule - time must be before specific minute\r\n */\r\nexport const beforeMinuteRule: SchemaRule<{ minute: number }> = {\r\n name: \"beforeMinute\",\r\n defaultErrorMessage: \"The :input must be before minute :minute\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const minute = inputDate.getMinutes();\r\n\r\n if (minute < this.context.options.minute) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minute = this.context.options.minute;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between minutes rule - time must be between start and end minutes\r\n */\r\nexport const betweenMinutesRule: SchemaRule<{\r\n startMinute: number;\r\n endMinute: number;\r\n}> = {\r\n name: \"betweenMinutes\",\r\n defaultErrorMessage: \"The :input must be between minute :startMinute and :endMinute\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const minute = inputDate.getMinutes();\r\n const { startMinute, endMinute } = this.context.options;\r\n\r\n if (minute >= startMinute && minute <= endMinute) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.startMinute = startMinute;\r\n this.context.translationParams.endMinute = endMinute;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Age rule - calculate age from date\r\n */\r\nexport const ageRule: SchemaRule<{ years: number }> = {\r\n name: \"age\",\r\n defaultErrorMessage: \"The :input must be exactly :years years old\",\r\n async validate(value: Date, context) {\r\n const birthDate = new Date(value);\r\n const today = new Date();\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const monthDiff = today.getMonth() - birthDate.getMonth();\r\n\r\n if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n if (age === this.context.options.years) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.years = this.context.options.years;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Min age rule - minimum age requirement\r\n */\r\nexport const minAgeRule: SchemaRule<{ years: number }> = {\r\n name: \"minAge\",\r\n defaultErrorMessage: \"The :input must be at least :years years old\",\r\n async validate(value: Date, context) {\r\n const birthDate = new Date(value);\r\n const today = new Date();\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const monthDiff = today.getMonth() - birthDate.getMonth();\r\n\r\n if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n if (age >= this.context.options.years) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.years = this.context.options.years;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Max age rule - maximum age requirement\r\n */\r\nexport const maxAgeRule: SchemaRule<{ years: number }> = {\r\n name: \"maxAge\",\r\n defaultErrorMessage: \"The :input must be at most :years years old\",\r\n async validate(value: Date, context) {\r\n const birthDate = new Date(value);\r\n const today = new Date();\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const monthDiff = today.getMonth() - birthDate.getMonth();\r\n\r\n if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n if (age <= this.context.options.years) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.years = this.context.options.years;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Week day rule - date must be specific weekday\r\n */\r\nexport const weekDayRule: SchemaRule<{ day: WeekDay }> = {\r\n name: \"weekDay\",\r\n defaultErrorMessage: \"The :input must be a :day\",\r\n async validate(value: Date, context) {\r\n const inputDate = new Date(value);\r\n const dayOfWeek = inputDate.getDay();\r\n const expectedDay = WEEK_DAYS[this.context.options.day];\r\n\r\n if (dayOfWeek === expectedDay) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.day = this.context.options.day;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,WAAuB;CAClC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,iBAAiB,QAAQ,CAAC,MAAM,MAAM,QAAQ,CAAC,GACjD,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;AAMA,MAAa,cAGR;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,YAA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,IAAI,UAAU,QAAQ,GAC3E;EAGF,IAAI,OAAO,KAAK,QAAQ,QAAQ,OAC9B,OAAO;EAGT,KAAK,QAAQ,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ;EAE5D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,aAA4C;CACvD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EACnC,MAAM,YAAY,IAAI,KAAK,KAAK;EAChC,MAAM,wBAAQ,IAAI,KAAK;EACvB,IAAI,MAAM,MAAM,YAAY,IAAI,UAAU,YAAY;EACtD,MAAM,YAAY,MAAM,SAAS,IAAI,UAAU,SAAS;EAExD,IAAI,YAAY,KAAM,cAAc,KAAK,MAAM,QAAQ,IAAI,UAAU,QAAQ,GAC3E;EAGF,IAAI,OAAO,KAAK,QAAQ,QAAQ,OAC9B,OAAO;EAGT,KAAK,QAAQ,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ;EAE5D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,cAA4C;CACvD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAa,SAAS;EAKnC,IAHkB,IADI,KAAK,KACD,CAAC,CAAC,OAGhB,MAFQ,UAAU,KAAK,QAAQ,QAAQ,MAGjD,OAAO;EAGT,KAAK,QAAQ,mBAAmB,MAAM,KAAK,QAAQ,QAAQ;EAE3D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,9 +0,0 @@
1
- import { ageRule, beforeHourRule, beforeMinuteRule, beforeTodayRule, betweenHoursRule, betweenMinutesRule, dateRule, fromHourRule, fromMinuteRule, fromTodayRule, maxAgeRule, maxDateRule, minAgeRule, minDateRule, weekDayRule } from "./date.mjs";
2
- import { afterTodayRule, betweenDatesRule, futureRule, pastRule, todayRule } from "./date-comparison-rules.mjs";
3
- import { businessDayRule, weekdaysRule, weekendRule } from "./date-day-rules.mjs";
4
- import { afterFieldRule, beforeFieldRule, sameAsFieldDateRule } from "./date-field-comparison-rules.mjs";
5
- import { betweenDaysRule, betweenMonthsRule, betweenTimesRule, betweenYearsRule, maxDayRule, maxMonthRule, maxYearRule, minDayRule, minMonthRule, minYearRule, monthRule, quarterRule, yearRule } from "./date-period-rules.mjs";
6
- import { withinDaysRule, withinFutureDaysRule, withinPastDaysRule } from "./date-relative-rules.mjs";
7
- import { betweenAgeRule, birthdayRule, leapYearRule } from "./date-special-rules.mjs";
8
-
9
- export { };
@@ -1,54 +0,0 @@
1
- import { presentRule, requiredRule } from "./core/required.mjs";
2
- import { equalRule } from "./core/equal.mjs";
3
- import { forbiddenRule } from "./core/forbidden.mjs";
4
- import { unionRule } from "./core/union.mjs";
5
- import { whenRule } from "./core/when.mjs";
6
- import "./core/index.mjs";
7
- import { alphaNumericRule, alphaRule, isNumericRule } from "./string/alpha.mjs";
8
- import { isCreditCardRule } from "./string/credit-card.mjs";
9
- import { emailRule } from "./string/email.mjs";
10
- import { cuidRule, nanoidRule, ulidRule, uuidRule } from "./string/id-formats.mjs";
11
- import { ip4Rule, ip6Rule, ipRule, isIP, isIPv4, isIPv6 } from "./string/ip.mjs";
12
- import { patternRule } from "./string/pattern.mjs";
13
- import { containsRule, endsWithRule, notContainsRule, startsWithRule } from "./string/string-comparison.mjs";
14
- import { strongPasswordRule } from "./string/strong-password-rule.mjs";
15
- import { urlRule } from "./string/url.mjs";
16
- import { withoutWhitespaceRule } from "./string/without-whitespace.mjs";
17
- import "./string/index.mjs";
18
- import { betweenNumbersRule, evenRule, greaterThanRule, lessThanRule, maxRule, minRule, moduloRule, negativeRule, oddRule, positiveRule } from "./number/number-rules.mjs";
19
- import "./number/index.mjs";
20
- import { betweenLengthRule, lengthRule, maxLengthRule, maxWordsRule, minLengthRule, minWordsRule, wordsRule } from "./length/length-rules.mjs";
21
- import "./length/index.mjs";
22
- import { sortedArrayRule, uniqueArrayRule } from "./array/array-rules.mjs";
23
- import "./array/index.mjs";
24
- import { ageRule, beforeHourRule, beforeMinuteRule, beforeTodayRule, betweenHoursRule, betweenMinutesRule, dateRule, fromHourRule, fromMinuteRule, fromTodayRule, maxAgeRule, maxDateRule, minAgeRule, minDateRule, weekDayRule } from "./date/date.mjs";
25
- import { afterTodayRule, betweenDatesRule, futureRule, pastRule, todayRule } from "./date/date-comparison-rules.mjs";
26
- import { businessDayRule, weekdaysRule, weekendRule } from "./date/date-day-rules.mjs";
27
- import { afterFieldRule, beforeFieldRule, sameAsFieldDateRule } from "./date/date-field-comparison-rules.mjs";
28
- import { betweenDaysRule, betweenMonthsRule, betweenTimesRule, betweenYearsRule, maxDayRule, maxMonthRule, maxYearRule, minDayRule, minMonthRule, minYearRule, monthRule, quarterRule, yearRule } from "./date/date-period-rules.mjs";
29
- import { withinDaysRule, withinFutureDaysRule, withinPastDaysRule } from "./date/date-relative-rules.mjs";
30
- import { betweenAgeRule, birthdayRule, leapYearRule } from "./date/date-special-rules.mjs";
31
- import "./date/index.mjs";
32
- import "./file/index.mjs";
33
- import { colorRule, darkColorRule, hexColorRule, hslColorRule, lightColorRule, rgbColorRule, rgbaColorRule } from "./color/color-rules.mjs";
34
- import "./color/index.mjs";
35
- import { requiredIfAllEmptyRule, requiredIfAllNotEmptyRule, requiredIfAnyEmptyRule, requiredIfAnyNotEmptyRule, requiredIfEmptyRule, requiredIfInRule, requiredIfNotEmptyRule, requiredIfNotInRule, requiredIfRule } from "./conditional/required-if-rules.mjs";
36
- import { requiredUnlessRule } from "./conditional/required-unless-rules.mjs";
37
- import { requiredWhenRule } from "./conditional/required-when-rule.mjs";
38
- import { requiredWithAllRule, requiredWithAnyRule, requiredWithRule } from "./conditional/required-with-rules.mjs";
39
- import { requiredWithoutAllRule, requiredWithoutAnyRule, requiredWithoutRule } from "./conditional/required-without-rules.mjs";
40
- import { presentIfEmptyRule, presentIfInRule, presentIfNotEmptyRule, presentIfNotInRule, presentIfRule } from "./conditional/present-if-rules.mjs";
41
- import { presentUnlessRule } from "./conditional/present-unless-rules.mjs";
42
- import { presentWithAllRule, presentWithAnyRule, presentWithRule } from "./conditional/present-with-rules.mjs";
43
- import { presentWithoutAllRule, presentWithoutAnyRule, presentWithoutRule } from "./conditional/present-without-rules.mjs";
44
- import { forbiddenIfEmptyRule, forbiddenIfInRule, forbiddenIfNotEmptyRule, forbiddenIfNotInRule, forbiddenIfNotRule, forbiddenIfRule } from "./conditional/forbidden-if-rules.mjs";
45
- import "./conditional/index.mjs";
46
- import { allowedValuesRule, enumRule, inRule, notAllowedValuesRule } from "./common/enum.mjs";
47
- import { equalsFieldRule, notEqualsFieldRule } from "./common/equals-field-rules.mjs";
48
- import { instanceofRule } from "./common/instanceof.mjs";
49
- import { literalRule } from "./common/literal.mjs";
50
- import { arrayRule, booleanRule, floatRule, intRule, numberRule, objectRule, plainObjectRule, stringRule } from "./common/type-rules.mjs";
51
- import { unknownKeyRule } from "./common/unknown-key.mjs";
52
- import "./common/index.mjs";
53
-
54
- export { };
@@ -1,3 +0,0 @@
1
- import { betweenLengthRule, lengthRule, maxLengthRule, maxWordsRule, minLengthRule, minWordsRule, wordsRule } from "./length-rules.mjs";
2
-
3
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"length-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/length/length-rules.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Min length rule - validates minimum length\r\n * Works for any value with a length property (strings, arrays, etc.)\r\n */\r\nexport const minLengthRule: SchemaRule<{ minLength: number }> = {\r\n name: \"minLength\",\r\n defaultErrorMessage: \"The :input must be at least :minLength characters long\",\r\n async validate(value: any, context) {\r\n const length = typeof value?.length === \"number\" ? value.length : String(value || \"\").length;\r\n\r\n if (length >= this.context.options.minLength) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minLength = this.context.options.minLength;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Max length rule - validates maximum length\r\n * Works for any value with a length property (strings, arrays, etc.)\r\n */\r\nexport const maxLengthRule: SchemaRule<{ maxLength: number }> = {\r\n name: \"maxLength\",\r\n defaultErrorMessage: \"The :input must not exceed :maxLength characters\",\r\n async validate(value: any, context) {\r\n const length = typeof value?.length === \"number\" ? value.length : String(value || \"\").length;\r\n\r\n if (length <= this.context.options.maxLength) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.maxLength = this.context.options.maxLength;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between length rule - validates length is between min and max (inclusive)\r\n * Works for any value with a length property (strings, arrays, etc.)\r\n */\r\nexport const betweenLengthRule: SchemaRule<{\r\n minLength: number;\r\n maxLength: number;\r\n}> = {\r\n name: \"betweenLength\",\r\n defaultErrorMessage: \"The :input must be between :minLength and :maxLength characters long\",\r\n async validate(value: any, context) {\r\n const length = typeof value?.length === \"number\" ? value.length : String(value || \"\").length;\r\n\r\n if (length >= this.context.options.minLength && length <= this.context.options.maxLength) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minLength = this.context.options.minLength;\r\n this.context.translationParams.maxLength = this.context.options.maxLength;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Length rule - validates exact length\r\n * Works for any value with a length property (strings, arrays, etc.)\r\n */\r\nexport const lengthRule: SchemaRule<{ length: number }> = {\r\n name: \"length\",\r\n defaultErrorMessage: \"The :input must be exactly :length characters long\",\r\n async validate(value: any, context) {\r\n const length = typeof value?.length === \"number\" ? value.length : String(value || \"\").length;\r\n\r\n if (length === this.context.options.length) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.length = this.context.options.length;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Min words rule - validates minimum word count\r\n */\r\nexport const minWordsRule: SchemaRule<{ minWords: number }> = {\r\n name: \"minWords\",\r\n defaultErrorMessage: \"The :input must be at least :minWords words\",\r\n async validate(value: any, context) {\r\n if (String(value || \"\").split(\" \").length >= this.context.options.minWords) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.minWords = this.context.options.minWords;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Max words rule - validates maximum word count\r\n */\r\nexport const maxWordsRule: SchemaRule<{ maxWords: number }> = {\r\n name: \"maxWords\",\r\n defaultErrorMessage: \"The :input must be at most :maxWords words\",\r\n async validate(value: any, context) {\r\n if (String(value || \"\").split(\" \").length <= this.context.options.maxWords) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.maxWords = this.context.options.maxWords;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Words rule - validates exact word count\r\n */\r\nexport const wordsRule: SchemaRule<{ words: number }> = {\r\n name: \"words\",\r\n defaultErrorMessage: \"The :input must be exactly :words words\",\r\n async validate(value: any, context) {\r\n if (String(value || \"\").split(\" \").length === this.context.options.words) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.words = this.context.options.words;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAAmD;CAC9D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAGlC,KAFe,OAAO,OAAO,WAAW,WAAW,MAAM,SAAS,OAAO,SAAS,EAAE,CAAC,CAAC,WAExE,KAAK,QAAQ,QAAQ,WACjC,OAAO;EAGT,KAAK,QAAQ,kBAAkB,YAAY,KAAK,QAAQ,QAAQ;EAEhE,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;AAMA,MAAa,gBAAmD;CAC9D,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAGlC,KAFe,OAAO,OAAO,WAAW,WAAW,MAAM,SAAS,OAAO,SAAS,EAAE,CAAC,CAAC,WAExE,KAAK,QAAQ,QAAQ,WACjC,OAAO;EAGT,KAAK,Q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E,OAAO;EAGT,KAAK,QAAQ,kBAAkB,WAAW,KAAK,QAAQ,QAAQ;EAE/D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,YAA2C;CACtD,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,OAAO,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,KAAK,QAAQ,QAAQ,OACjE,OAAO;EAGT,KAAK,QAAQ,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ;EAE5D,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1,3 +0,0 @@
1
- import { betweenNumbersRule, evenRule, greaterThanRule, lessThanRule, maxRule, minRule, moduloRule, negativeRule, oddRule, positiveRule } from "./number-rules.mjs";
2
-
3
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"number-rules.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/number/number-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\r\nimport { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * Min rule - value must be equal or greater than minimum\r\n * Supports field names with sibling scope\r\n */\r\nexport const minRule: SchemaRule<{\r\n min: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"min\",\r\n defaultErrorMessage: \"The :input must be at least :min\",\r\n async validate(value: any, context) {\r\n const { min, scope = \"global\" } = this.context.options;\r\n let compareMin: number;\r\n\r\n if (typeof min === \"number\") {\r\n compareMin = min;\r\n this.context.translationParams.min = min;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, min);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.min = min;\r\n\r\n compareMin = Number(fieldValue);\r\n\r\n if (isNaN(compareMin)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n if (value >= compareMin) {\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 * Max rule - value must be equal or less than maximum\r\n * Supports field names with sibling scope\r\n */\r\nexport const maxRule: SchemaRule<{\r\n max: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"max\",\r\n defaultErrorMessage: \"The :input must equal to or less than :max\",\r\n async validate(value: any, context) {\r\n const { max, scope = \"global\" } = this.context.options;\r\n let compareMax: number;\r\n\r\n if (typeof max === \"number\") {\r\n compareMax = max;\r\n this.context.translationParams.max = max;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, max);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.max = max;\r\n\r\n compareMax = Number(fieldValue);\r\n\r\n if (isNaN(compareMax)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n if (value <= compareMax) {\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 * Greater than rule - value must be strictly greater than minimum\r\n * Supports field names with sibling scope\r\n */\r\nexport const greaterThanRule: SchemaRule<{\r\n value: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"greaterThan\",\r\n defaultErrorMessage: \"The :input must be greater than :value\",\r\n async validate(value: any, context) {\r\n const { value: compareValue, scope = \"global\" } = this.context.options;\r\n let compareNumber: number;\r\n\r\n if (typeof compareValue === \"number\") {\r\n compareNumber = compareValue;\r\n this.context.translationParams.value = compareValue;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, compareValue);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.value = compareValue;\r\n\r\n compareNumber = Number(fieldValue);\r\n\r\n if (isNaN(compareNumber)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n if (value > compareNumber) {\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 * Less than rule - value must be strictly less than maximum\r\n * Supports field names with sibling scope\r\n */\r\nexport const lessThanRule: SchemaRule<{\r\n value: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"lessThan\",\r\n defaultErrorMessage: \"The :input must be less than :value\",\r\n async validate(value: any, context) {\r\n const { value: compareValue, scope = \"global\" } = this.context.options;\r\n let compareNumber: number;\r\n\r\n if (typeof compareValue === \"number\") {\r\n compareNumber = compareValue;\r\n this.context.translationParams.value = compareValue;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, compareValue);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.value = compareValue;\r\n\r\n compareNumber = Number(fieldValue);\r\n\r\n if (isNaN(compareNumber)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n if (value < compareNumber) {\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 * Positive rule - value must be greater than 0\r\n */\r\nexport const positiveRule: SchemaRule = {\r\n name: \"positive\",\r\n defaultErrorMessage: \"The :input must be a positive number\",\r\n async validate(value: any, context) {\r\n if (value > 0) {\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 * Negative rule - value must be less than 0\r\n */\r\nexport const negativeRule: SchemaRule = {\r\n name: \"negative\",\r\n defaultErrorMessage: \"The :input must be a negative number\",\r\n async validate(value: any, context) {\r\n if (value < 0) {\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 * Odd rule - value must be an odd number\r\n */\r\nexport const oddRule: SchemaRule = {\r\n name: \"odd\",\r\n defaultErrorMessage: \"The :input must be an odd number\",\r\n async validate(value: any, context) {\r\n if (value % 2 !== 0) {\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 * Even rule - value must be an even number\r\n */\r\nexport const evenRule: SchemaRule = {\r\n name: \"even\",\r\n defaultErrorMessage: \"The :input must be an even number\",\r\n async validate(value: any, context) {\r\n if (value % 2 === 0) {\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 * Modulo rule - value must be divisible by given number\r\n */\r\nexport const moduloRule: SchemaRule<{ value: number }> = {\r\n name: \"modulo\",\r\n defaultErrorMessage: \"The :input must be divisible by :value\",\r\n async validate(value: any, context) {\r\n if (value % this.context.options.value === 0) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translationParams.value = this.context.options.value;\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n\r\n/**\r\n * Between rule - value must be between the given two numbers (Inclusive)\r\n * Supports field names with sibling scope\r\n */\r\nexport const betweenNumbersRule: SchemaRule<{\r\n min: number | string;\r\n max: number | string;\r\n scope?: \"global\" | \"sibling\";\r\n}> = {\r\n name: \"betweenNumbers\",\r\n defaultErrorMessage: \"The :input must be between :min and :max\",\r\n async validate(value: any, context) {\r\n const { min, max, scope = \"global\" } = this.context.options;\r\n\r\n // Extract min value\r\n let compareMin: number;\r\n if (typeof min === \"number\") {\r\n compareMin = min;\r\n this.context.translationParams.min = min;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, min);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.min = min;\r\n\r\n compareMin = Number(fieldValue);\r\n if (isNaN(compareMin)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n // Extract max value\r\n let compareMax: number;\r\n if (typeof max === \"number\") {\r\n compareMax = max;\r\n this.context.translationParams.max = max;\r\n } else {\r\n const source = scope === \"sibling\" ? context.parent : context.allValues;\r\n const fieldValue = get(source, max);\r\n\r\n if (fieldValue === undefined) {\r\n return VALID_RULE;\r\n }\r\n\r\n this.context.translatableParams.max = max;\r\n\r\n compareMax = Number(fieldValue);\r\n if (isNaN(compareMax)) {\r\n return VALID_RULE;\r\n }\r\n }\r\n\r\n if (value >= compareMin && value <= compareMax) {\r\n return VALID_RULE;\r\n }\r\n\r\n return invalidRule(this, context);\r\n },\r\n};\r\n"],"mappings":";;;;;;;;;;AAQA,MAAa,UAGR;CACH,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,KAAK,QAAQ,aAAa,KAAK,QAAQ;EAC/C,IAAI;EAEJ,IAAI,OAAO,QAAQ,UAAU;GAC3B,aAAa;GACb,KAAK,QAAQ,kBAAkB,MAAM;EACvC,OAAO;GAEL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,GAAG;GAElC,IAAI,eAAe,QACjB,OAAO;GAGT,KAAK,QAAQ,mBAAmB,MAAM;GAEtC,aAAa,OAAO,UAAU;GAE9B,IAAI,MAAM,UAAU,GAClB,OAAO;EAEX;EAEA,IAAI,SAAS,YACX,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;;AAMA,MAAa,UAGR;CACH,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,KAAK,QAAQ,aAAa,KAAK,QAAQ;EAC/C,IAAI;EAEJ,IAAI,OAAO,QAAQ,UAAU;GAC3B,aAAa;GACb,KAAK,QAAQ,kBAAkB,MAAM;EACvC,OAAO;GAEL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,GAAG;GAElC,IAAI,eAAe,QACjB,OAAO;GAGT,KAAK,QAAQ,mBAAmB,MAAM;GAEtC,aAAa,OAAO,UAAU;GAE9B,IAAI,MAAM,UAAU,GAClB,OAAO;EAEX;EAEA,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AkB,MAAM;EACvC,OAAO;GAEL,MAAM,aAAa,IADJ,UAAU,YAAY,QAAQ,SAAS,QAAQ,WAC/B,GAAG;GAElC,IAAI,eAAe,QACjB,OAAO;GAGT,KAAK,QAAQ,mBAAmB,MAAM;GAEtC,aAAa,OAAO,UAAU;GAC9B,IAAI,MAAM,UAAU,GAClB,OAAO;EAEX;EAEA,IAAI,SAAS,cAAc,SAAS,YAClC,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"accepted-rule.mjs","names":[],"sources":["../../../../../../../../../../seal/src/rules/scalar/accepted-rule.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\nconst isAcceptedValue = (value: any) => {\r\n return [\"1\", \"true\", \"yes\", \"y\", \"on\", 1, true, \"Yes\", \"Y\", \"On\"].includes(value);\r\n};\r\n\r\n/**\r\n * Validate value as accepted if it equals:\r\n * 1 | \"1\" | true | \"true\" | \"yes\" | \"y\" | \"on\"\r\n */\r\nexport const acceptedRule: SchemaRule = {\r\n name: \"accepted\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n description:\r\n \"The value must be accepted if it equals: 1 | '1' | true | 'true' | 'yes' | 'y' | 'on' | 1 | true | 'Yes' | 'Y' | 'On'\",\r\n async validate(value: any, context) {\r\n if (isAcceptedValue(value)) {\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 * Accepted value if another field's value equals to a specific value\r\n */\r\nexport const acceptedIfRule: SchemaRule<{ field: string; value: any }> = {\r\n name: \"acceptedIf\",\r\n description: \"The field must be accepted if :field's value equals to :value\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n const { value: expectedValue } = this.context.options;\r\n\r\n this.context.translatableParams.field = this.context.options.field;\r\n this.context.translatableParams.value = this.context.options.value;\r\n if (fieldValue !== expectedValue) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (!isAcceptedValue(value)) {\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 * Accepted if another field is not equal to the given value\r\n */\r\nexport const acceptedUnlessRule: SchemaRule<{ field: string; value: any }> = {\r\n name: \"acceptedUnless\",\r\n description: \"The field must be accepted if :field's value is not equal to :value\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n const { value: expectedValue } = this.context.options;\r\n\r\n this.context.translatableParams.field = this.context.options.field;\r\n this.context.translatableParams.value = this.context.options.value;\r\n\r\n if (fieldValue === expectedValue) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (!isAcceptedValue(value)) {\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 * Accepted if another field is required\r\n */\r\nexport const acceptedIfRequiredRule: SchemaRule<{ field: string }> = {\r\n name: \"acceptedIfRequired\",\r\n description: \"The field must be accepted if :field is required\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n this.context.translatableParams.field = this.context.options.field;\r\n\r\n if (isEmptyValue(fieldValue)) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (!isAcceptedValue(value)) {\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 * Accepted if another field is present\r\n */\r\nexport const acceptedIfPresentRule: SchemaRule<{ field: string }> = {\r\n name: \"acceptedIfPresent\",\r\n description: \"The field must be accepted if :field is present\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n this.context.translatableParams.field = this.context.options.field;\r\n\r\n if (fieldValue === undefined) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (!isAcceptedValue(value)) {\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 * Accepted if another field is missing\r\n */\r\nexport const acceptedWithoutRule: SchemaRule<{ field: string }> = {\r\n name: \"acceptedWithout\",\r\n description: \"The field must be accepted if :field is missing\",\r\n defaultErrorMessage: \"The :input must be accepted\",\r\n async validate(value: any, context) {\r\n const fieldValue = getFieldValue(this, context);\r\n this.context.translatableParams.field = this.context.options.field;\r\n\r\n if (fieldValue !== undefined) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n if (!isAcceptedValue(value)) {\r\n return invalidRule(this, context);\r\n }\r\n\r\n return VALID_RULE;\r\n },\r\n};\r\n"],"mappings":";;;;;;AAIA,MAAM,mBAAmB,UAAe;CACtC,OAAO;EAAC;EAAK;EAAQ;EAAO;EAAK;EAAM;EAAG;EAAM;EAAO;EAAK;CAAI,CAAC,CAAC,SAAS,KAAK;AAClF;;;;;AAMA,MAAa,eAA2B;CACtC,MAAM;CACN,qBAAqB;CACrB,aACE;CACF,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI,gBAAgB,KAAK,GACvB,OAAO;EAGT,OAAO,YAAY,MAAM,OAAO;CAClC;AACF;;;;AAKA,MAAa,iBAA4D;CACvE,MAAM;CACN,aAAa;CACb,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAC9C,MAAM,EAAE,OAAO,kBAAkB,KAAK,QAAQ;EAE9C,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;EAC7D,KAAK,QAAQ,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;EAC7D,IAAI,eAAe,eACjB,OAAO,YAAY,MAAM,OAAO;EAGlC,IAAI,CAAC,gBAAgB,KAAK,GACxB,OAAO,YAAY,MAAM,OA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