@warlock.js/notifications 5.30.0 → 5.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/cjs/index.cjs +2 -2
  3. package/cjs/index.cjs.map +1 -1
  4. package/esm/channels/database-channel.d.mts +2 -3
  5. package/esm/channels/database-channel.d.mts.map +1 -1
  6. package/esm/channels/index.d.mts +2 -1
  7. package/esm/channels/index.mjs +1 -1
  8. package/esm/channels/mail-channel.d.mts +6 -4
  9. package/esm/channels/mail-channel.d.mts.map +1 -1
  10. package/esm/config.d.mts +13 -9
  11. package/esm/config.d.mts.map +1 -1
  12. package/esm/config.mjs.map +1 -1
  13. package/esm/contracts/channel.contract.d.mts +1 -3
  14. package/esm/contracts/channel.contract.d.mts.map +1 -1
  15. package/esm/contracts/index.d.mts +2 -1
  16. package/esm/contracts/notification.contract.d.mts +1 -3
  17. package/esm/contracts/notification.contract.d.mts.map +1 -1
  18. package/esm/contracts/preference-provider.contract.d.mts +1 -3
  19. package/esm/contracts/preference-provider.contract.d.mts.map +1 -1
  20. package/esm/contracts/queue-dispatcher.contract.d.mts +1 -3
  21. package/esm/contracts/queue-dispatcher.contract.d.mts.map +1 -1
  22. package/esm/contracts/rate-limiter.contract.d.mts +1 -3
  23. package/esm/contracts/rate-limiter.contract.d.mts.map +1 -1
  24. package/esm/dispatch/define-channel.d.mts +2 -2
  25. package/esm/dispatch/define-channel.d.mts.map +1 -1
  26. package/esm/dispatch/define-notification.d.mts +5 -6
  27. package/esm/dispatch/define-notification.d.mts.map +1 -1
  28. package/esm/dispatch/define-notification.mjs.map +1 -1
  29. package/esm/dispatch/index.d.mts +2 -1
  30. package/esm/dispatch/index.mjs +1 -1
  31. package/esm/dispatch/notifications-event-bus.d.mts +2 -3
  32. package/esm/dispatch/notifications-event-bus.d.mts.map +1 -1
  33. package/esm/dispatch/notify.d.mts +3 -5
  34. package/esm/dispatch/notify.d.mts.map +1 -1
  35. package/esm/dispatch/notify.mjs.map +1 -1
  36. package/esm/errors.d.mts +5 -6
  37. package/esm/errors.d.mts.map +1 -1
  38. package/esm/in-app/base-notifications-repository.d.mts +6 -6
  39. package/esm/in-app/base-notifications-repository.d.mts.map +1 -1
  40. package/esm/in-app/base-notifications-repository.mjs +1 -1
  41. package/esm/in-app/base-notifications-repository.mjs.map +1 -1
  42. package/esm/in-app/column-map.d.mts +11 -8
  43. package/esm/in-app/column-map.d.mts.map +1 -1
  44. package/esm/in-app/database-notification.d.mts +2 -3
  45. package/esm/in-app/database-notification.d.mts.map +1 -1
  46. package/esm/in-app/in-app.d.mts +6 -5
  47. package/esm/in-app/in-app.d.mts.map +1 -1
  48. package/esm/in-app/index.d.mts +2 -1
  49. package/esm/in-app/index.mjs +1 -1
  50. package/esm/index.d.mts +6 -0
  51. package/esm/migration/index.d.mts +2 -1
  52. package/esm/migration/index.mjs +1 -1
  53. package/esm/migration/notification-columns.d.mts +6 -7
  54. package/esm/migration/notification-columns.d.mts.map +1 -1
  55. package/esm/migration/notification-columns.mjs.map +1 -1
  56. package/esm/queue/bullmq-queue.d.mts +9 -7
  57. package/esm/queue/bullmq-queue.d.mts.map +1 -1
  58. package/esm/queue/bullmq-queue.mjs.map +1 -1
  59. package/esm/queue/herald-queue.d.mts +6 -4
  60. package/esm/queue/herald-queue.d.mts.map +1 -1
  61. package/esm/queue/index.d.mts +2 -1
  62. package/esm/queue/index.mjs +1 -1
  63. package/esm/queue/load-herald.d.mts +1 -2
  64. package/esm/queue/load-herald.d.mts.map +1 -1
  65. package/esm/queue/load-herald.mjs +1 -1
  66. package/esm/queue/load-queue.d.mts +2 -3
  67. package/esm/queue/load-queue.d.mts.map +1 -1
  68. package/esm/queue/notifications-worker.d.mts +5 -4
  69. package/esm/queue/notifications-worker.d.mts.map +1 -1
  70. package/esm/queue/notifications-worker.mjs.map +1 -1
  71. package/esm/queue/queue-package-not-installed.error.d.mts +1 -2
  72. package/esm/queue/queue-package-not-installed.error.d.mts.map +1 -1
  73. package/esm/types.d.mts +22 -18
  74. package/esm/types.d.mts.map +1 -1
  75. package/llms-full.txt +89 -81
  76. package/package.json +10 -9
  77. package/skills/configure-notifications/SKILL.md +7 -7
  78. package/skills/define-channel/SKILL.md +9 -7
  79. package/skills/define-notification/SKILL.md +22 -25
  80. package/skills/index.md +4 -1
  81. package/skills/notifications-basics/SKILL.md +12 -12
  82. package/skills/observe-notifications/SKILL.md +14 -10
  83. package/skills/send-ad-hoc/SKILL.md +9 -9
  84. package/skills/use-in-app/SKILL.md +6 -4
  85. package/skills/write-notification-migration/SKILL.md +10 -7
  86. package/cjs/channel_api-C5ZZDkgQ.cjs +0 -7463
  87. package/cjs/channel_api-C5ZZDkgQ.cjs.map +0 -1
  88. package/cjs/chunk-fl3r8ClO.cjs +0 -41
  89. package/cjs/rabbitmq-driver-BFoWr21L.cjs +0 -3
  90. package/cjs/src-eu2jxS21.cjs +0 -11190
  91. package/cjs/src-eu2jxS21.cjs.map +0 -1
  92. package/esm/_virtual/_rolldown/runtime.mjs +0 -32
  93. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs +0 -6
  94. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs.map +0 -1
  95. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/bool.mjs +0 -3
  96. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/color.mjs +0 -3
  97. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/date.mjs +0 -3
  98. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/float.mjs +0 -3
  99. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/id.mjs +0 -3
  100. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/int.mjs +0 -3
  101. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/nanoid.mjs +0 -3
  102. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/pick.mjs +0 -3
  103. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/random.mjs +0 -16
  104. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/sample.mjs +0 -3
  105. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/string.mjs +0 -3
  106. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/token.mjs +0 -3
  107. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/uuid.mjs +0 -3
  108. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/weighted.mjs +0 -3
  109. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/async/retry.mjs +0 -3
  110. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/index.mjs +0 -24
  111. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs +0 -82
  112. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs.map +0 -1
  113. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/number/round.mjs +0 -17
  114. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/number/round.mjs.map +0 -1
  115. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/except.mjs +0 -13
  116. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/except.mjs.map +0 -1
  117. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs +0 -18
  118. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs.map +0 -1
  119. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/omit.mjs +0 -17
  120. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/omit.mjs.map +0 -1
  121. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/unset.mjs +0 -30
  122. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/unset.mjs.map +0 -1
  123. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs +0 -19
  124. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs.map +0 -1
  125. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs +0 -18
  126. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs.map +0 -1
  127. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs +0 -14
  128. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs.map +0 -1
  129. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs +0 -18
  130. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs.map +0 -1
  131. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs +0 -22
  132. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs.map +0 -1
  133. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs +0 -17
  134. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs.map +0 -1
  135. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs +0 -21
  136. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs.map +0 -1
  137. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs +0 -21
  138. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs.map +0 -1
  139. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/trim.mjs +0 -20
  140. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/trim.mjs.map +0 -1
  141. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs +0 -15
  142. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs.map +0 -1
  143. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/words.mjs +0 -25
  144. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/words.mjs.map +0 -1
  145. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs +0 -11
  146. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs.map +0 -1
  147. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs +0 -100
  148. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs.map +0 -1
  149. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/tap.mjs +0 -27
  150. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/tap.mjs.map +0 -1
  151. package/esm/node_modules/.pnpm/@mongez_supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs +0 -358
  152. package/esm/node_modules/.pnpm/@mongez_supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs.map +0 -1
  153. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.mjs +0 -28
  154. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.mjs.map +0 -1
  155. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/api_args.mjs +0 -241
  156. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/api_args.mjs.map +0 -1
  157. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/bitset.mjs +0 -130
  158. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/bitset.mjs.map +0 -1
  159. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.mjs +0 -302
  160. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.mjs.map +0 -1
  161. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.mjs +0 -206
  162. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.mjs.map +0 -1
  163. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/codec.mjs +0 -273
  164. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/codec.mjs.map +0 -1
  165. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.mjs +0 -143
  166. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.mjs.map +0 -1
  167. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.mjs +0 -416
  168. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.mjs.map +0 -1
  169. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.mjs +0 -50
  170. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.mjs.map +0 -1
  171. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/defs.mjs +0 -4600
  172. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/defs.mjs.map +0 -1
  173. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.mjs +0 -29
  174. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.mjs.map +0 -1
  175. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.mjs +0 -28
  176. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.mjs.map +0 -1
  177. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/frame.mjs +0 -130
  178. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/frame.mjs.map +0 -1
  179. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/heartbeat.mjs +0 -40
  180. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/heartbeat.mjs.map +0 -1
  181. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/mux.mjs +0 -86
  182. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/mux.mjs.map +0 -1
  183. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/package.mjs +0 -41
  184. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/package.mjs.map +0 -1
  185. package/esm/node_modules/.pnpm/buffer-more-ints@1.0.0/node_modules/buffer-more-ints/buffer-more-ints.mjs +0 -360
  186. package/esm/node_modules/.pnpm/buffer-more-ints@1.0.0/node_modules/buffer-more-ints/buffer-more-ints.mjs.map +0 -1
  187. package/esm/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs +0 -305
  188. package/esm/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs.map +0 -1
  189. package/esm/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.mjs +0 -80
  190. package/esm/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.mjs.map +0 -1
  191. package/esm/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.mjs +0 -35
  192. package/esm/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.mjs.map +0 -1
  193. package/esm/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.mjs +0 -388
  194. package/esm/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.mjs.map +0 -1
  195. package/esm/packages/herald/src/communicators/broker-registry.mjs +0 -204
  196. package/esm/packages/herald/src/communicators/broker-registry.mjs.map +0 -1
  197. package/esm/packages/herald/src/communicators/broker.mjs +0 -110
  198. package/esm/packages/herald/src/communicators/broker.mjs.map +0 -1
  199. package/esm/packages/herald/src/communicators/index.mjs +0 -4
  200. package/esm/packages/herald/src/decorators/consumable.mjs +0 -36
  201. package/esm/packages/herald/src/decorators/consumable.mjs.map +0 -1
  202. package/esm/packages/herald/src/decorators/index.mjs +0 -3
  203. package/esm/packages/herald/src/drivers/index.mjs +0 -5
  204. package/esm/packages/herald/src/drivers/rabbitmq/index.mjs +0 -4
  205. package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs +0 -403
  206. package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +0 -1
  207. package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs +0 -303
  208. package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +0 -1
  209. package/esm/packages/herald/src/index.mjs +0 -16
  210. package/esm/packages/herald/src/message-managers/event-consumer.mjs +0 -76
  211. package/esm/packages/herald/src/message-managers/event-consumer.mjs.map +0 -1
  212. package/esm/packages/herald/src/message-managers/event-message.mjs +0 -85
  213. package/esm/packages/herald/src/message-managers/event-message.mjs.map +0 -1
  214. package/esm/packages/herald/src/message-managers/index.mjs +0 -4
  215. package/esm/packages/herald/src/message-managers/prepare-consumer-subscription.mjs +0 -42
  216. package/esm/packages/herald/src/message-managers/prepare-consumer-subscription.mjs.map +0 -1
  217. package/esm/packages/herald/src/use-case-broadcast.mjs +0 -30
  218. package/esm/packages/herald/src/use-case-broadcast.mjs.map +0 -1
  219. package/esm/packages/herald/src/utils/connect-to-broker.mjs +0 -168
  220. package/esm/packages/herald/src/utils/connect-to-broker.mjs.map +0 -1
  221. package/esm/packages/herald/src/utils/index.mjs +0 -3
  222. package/esm/packages/seal/src/config.mjs +0 -15
  223. package/esm/packages/seal/src/config.mjs.map +0 -1
  224. package/esm/packages/seal/src/factory/index.mjs +0 -4
  225. package/esm/packages/seal/src/factory/validate.mjs +0 -42
  226. package/esm/packages/seal/src/factory/validate.mjs.map +0 -1
  227. package/esm/packages/seal/src/factory/validators.mjs +0 -133
  228. package/esm/packages/seal/src/factory/validators.mjs.map +0 -1
  229. package/esm/packages/seal/src/helpers/date-helpers.mjs +0 -24
  230. package/esm/packages/seal/src/helpers/date-helpers.mjs.map +0 -1
  231. package/esm/packages/seal/src/helpers/get-field-value.mjs +0 -46
  232. package/esm/packages/seal/src/helpers/get-field-value.mjs.map +0 -1
  233. package/esm/packages/seal/src/helpers/index.mjs +0 -6
  234. package/esm/packages/seal/src/helpers/is-empty-value.mjs +0 -10
  235. package/esm/packages/seal/src/helpers/is-empty-value.mjs.map +0 -1
  236. package/esm/packages/seal/src/helpers/path-helpers.mjs +0 -12
  237. package/esm/packages/seal/src/helpers/path-helpers.mjs.map +0 -1
  238. package/esm/packages/seal/src/helpers/validation-helpers.mjs +0 -78
  239. package/esm/packages/seal/src/helpers/validation-helpers.mjs.map +0 -1
  240. package/esm/packages/seal/src/index.mjs +0 -88
  241. package/esm/packages/seal/src/mutators/array-mutators.mjs +0 -32
  242. package/esm/packages/seal/src/mutators/array-mutators.mjs.map +0 -1
  243. package/esm/packages/seal/src/mutators/boolean-mutators.mjs +0 -40
  244. package/esm/packages/seal/src/mutators/boolean-mutators.mjs.map +0 -1
  245. package/esm/packages/seal/src/mutators/date-mutators.mjs +0 -94
  246. package/esm/packages/seal/src/mutators/date-mutators.mjs.map +0 -1
  247. package/esm/packages/seal/src/mutators/index.mjs +0 -9
  248. package/esm/packages/seal/src/mutators/number-mutators.mjs +0 -52
  249. package/esm/packages/seal/src/mutators/number-mutators.mjs.map +0 -1
  250. package/esm/packages/seal/src/mutators/object-mutators.mjs +0 -30
  251. package/esm/packages/seal/src/mutators/object-mutators.mjs.map +0 -1
  252. package/esm/packages/seal/src/mutators/scalar-mutators.mjs +0 -9
  253. package/esm/packages/seal/src/mutators/scalar-mutators.mjs.map +0 -1
  254. package/esm/packages/seal/src/mutators/string-mutators.mjs +0 -186
  255. package/esm/packages/seal/src/mutators/string-mutators.mjs.map +0 -1
  256. package/esm/packages/seal/src/object.mjs +0 -13
  257. package/esm/packages/seal/src/object.mjs.map +0 -1
  258. package/esm/packages/seal/src/rules/array/array-rules.mjs +0 -41
  259. package/esm/packages/seal/src/rules/array/array-rules.mjs.map +0 -1
  260. package/esm/packages/seal/src/rules/array/index.mjs +0 -3
  261. package/esm/packages/seal/src/rules/color/color-rules.mjs +0 -104
  262. package/esm/packages/seal/src/rules/color/color-rules.mjs.map +0 -1
  263. package/esm/packages/seal/src/rules/color/index.mjs +0 -3
  264. package/esm/packages/seal/src/rules/common/enum.mjs +0 -77
  265. package/esm/packages/seal/src/rules/common/enum.mjs.map +0 -1
  266. package/esm/packages/seal/src/rules/common/equals-field-rules.mjs +0 -42
  267. package/esm/packages/seal/src/rules/common/equals-field-rules.mjs.map +0 -1
  268. package/esm/packages/seal/src/rules/common/index.mjs +0 -8
  269. package/esm/packages/seal/src/rules/common/instanceof.mjs +0 -23
  270. package/esm/packages/seal/src/rules/common/instanceof.mjs.map +0 -1
  271. package/esm/packages/seal/src/rules/common/literal.mjs +0 -31
  272. package/esm/packages/seal/src/rules/common/literal.mjs.map +0 -1
  273. package/esm/packages/seal/src/rules/common/type-rules.mjs +0 -97
  274. package/esm/packages/seal/src/rules/common/type-rules.mjs.map +0 -1
  275. package/esm/packages/seal/src/rules/common/unknown-key.mjs +0 -25
  276. package/esm/packages/seal/src/rules/common/unknown-key.mjs.map +0 -1
  277. package/esm/packages/seal/src/rules/conditional/forbidden-if-rules.mjs +0 -116
  278. package/esm/packages/seal/src/rules/conditional/forbidden-if-rules.mjs.map +0 -1
  279. package/esm/packages/seal/src/rules/conditional/index.mjs +0 -12
  280. package/esm/packages/seal/src/rules/conditional/present-if-rules.mjs +0 -97
  281. package/esm/packages/seal/src/rules/conditional/present-if-rules.mjs.map +0 -1
  282. package/esm/packages/seal/src/rules/conditional/present-unless-rules.mjs +0 -30
  283. package/esm/packages/seal/src/rules/conditional/present-unless-rules.mjs.map +0 -1
  284. package/esm/packages/seal/src/rules/conditional/present-with-rules.mjs +0 -76
  285. package/esm/packages/seal/src/rules/conditional/present-with-rules.mjs.map +0 -1
  286. package/esm/packages/seal/src/rules/conditional/present-without-rules.mjs +0 -76
  287. package/esm/packages/seal/src/rules/conditional/present-without-rules.mjs.map +0 -1
  288. package/esm/packages/seal/src/rules/conditional/required-if-rules.mjs +0 -204
  289. package/esm/packages/seal/src/rules/conditional/required-if-rules.mjs.map +0 -1
  290. package/esm/packages/seal/src/rules/conditional/required-unless-rules.mjs +0 -31
  291. package/esm/packages/seal/src/rules/conditional/required-unless-rules.mjs.map +0 -1
  292. package/esm/packages/seal/src/rules/conditional/required-when-rule.mjs +0 -32
  293. package/esm/packages/seal/src/rules/conditional/required-when-rule.mjs.map +0 -1
  294. package/esm/packages/seal/src/rules/conditional/required-with-rules.mjs +0 -67
  295. package/esm/packages/seal/src/rules/conditional/required-with-rules.mjs.map +0 -1
  296. package/esm/packages/seal/src/rules/conditional/required-without-rules.mjs +0 -67
  297. package/esm/packages/seal/src/rules/conditional/required-without-rules.mjs.map +0 -1
  298. package/esm/packages/seal/src/rules/core/equal.mjs +0 -22
  299. package/esm/packages/seal/src/rules/core/equal.mjs.map +0 -1
  300. package/esm/packages/seal/src/rules/core/forbidden.mjs +0 -20
  301. package/esm/packages/seal/src/rules/core/forbidden.mjs.map +0 -1
  302. package/esm/packages/seal/src/rules/core/index.mjs +0 -7
  303. package/esm/packages/seal/src/rules/core/required.mjs +0 -36
  304. package/esm/packages/seal/src/rules/core/required.mjs.map +0 -1
  305. package/esm/packages/seal/src/rules/core/union.mjs +0 -32
  306. package/esm/packages/seal/src/rules/core/union.mjs.map +0 -1
  307. package/esm/packages/seal/src/rules/core/when.mjs +0 -37
  308. package/esm/packages/seal/src/rules/core/when.mjs.map +0 -1
  309. package/esm/packages/seal/src/rules/date/date-comparison-rules.mjs +0 -78
  310. package/esm/packages/seal/src/rules/date/date-comparison-rules.mjs.map +0 -1
  311. package/esm/packages/seal/src/rules/date/date-day-rules.mjs +0 -49
  312. package/esm/packages/seal/src/rules/date/date-day-rules.mjs.map +0 -1
  313. package/esm/packages/seal/src/rules/date/date-field-comparison-rules.mjs +0 -82
  314. package/esm/packages/seal/src/rules/date/date-field-comparison-rules.mjs.map +0 -1
  315. package/esm/packages/seal/src/rules/date/date-period-rules.mjs +0 -401
  316. package/esm/packages/seal/src/rules/date/date-period-rules.mjs.map +0 -1
  317. package/esm/packages/seal/src/rules/date/date-relative-rules.mjs +0 -55
  318. package/esm/packages/seal/src/rules/date/date-relative-rules.mjs.map +0 -1
  319. package/esm/packages/seal/src/rules/date/date-special-rules.mjs +0 -58
  320. package/esm/packages/seal/src/rules/date/date-special-rules.mjs.map +0 -1
  321. package/esm/packages/seal/src/rules/date/date.mjs +0 -235
  322. package/esm/packages/seal/src/rules/date/date.mjs.map +0 -1
  323. package/esm/packages/seal/src/rules/date/index.mjs +0 -9
  324. package/esm/packages/seal/src/rules/file/dimensions.mjs +0 -3
  325. package/esm/packages/seal/src/rules/file/file-size.mjs +0 -3
  326. package/esm/packages/seal/src/rules/file/index.mjs +0 -4
  327. package/esm/packages/seal/src/rules/index.mjs +0 -54
  328. package/esm/packages/seal/src/rules/length/index.mjs +0 -3
  329. package/esm/packages/seal/src/rules/length/length-rules.mjs +0 -98
  330. package/esm/packages/seal/src/rules/length/length-rules.mjs.map +0 -1
  331. package/esm/packages/seal/src/rules/number/index.mjs +0 -3
  332. package/esm/packages/seal/src/rules/number/number-rules.mjs +0 -197
  333. package/esm/packages/seal/src/rules/number/number-rules.mjs.map +0 -1
  334. package/esm/packages/seal/src/rules/scalar/accepted-rule.mjs +0 -123
  335. package/esm/packages/seal/src/rules/scalar/accepted-rule.mjs.map +0 -1
  336. package/esm/packages/seal/src/rules/scalar/declined-rule.mjs +0 -123
  337. package/esm/packages/seal/src/rules/scalar/declined-rule.mjs.map +0 -1
  338. package/esm/packages/seal/src/rules/scalar/index.mjs +0 -4
  339. package/esm/packages/seal/src/rules/string/alpha.mjs +0 -41
  340. package/esm/packages/seal/src/rules/string/alpha.mjs.map +0 -1
  341. package/esm/packages/seal/src/rules/string/credit-card.mjs +0 -32
  342. package/esm/packages/seal/src/rules/string/credit-card.mjs.map +0 -1
  343. package/esm/packages/seal/src/rules/string/email.mjs +0 -20
  344. package/esm/packages/seal/src/rules/string/email.mjs.map +0 -1
  345. package/esm/packages/seal/src/rules/string/id-formats.mjs +0 -104
  346. package/esm/packages/seal/src/rules/string/id-formats.mjs.map +0 -1
  347. package/esm/packages/seal/src/rules/string/index.mjs +0 -13
  348. package/esm/packages/seal/src/rules/string/ip.mjs +0 -66
  349. package/esm/packages/seal/src/rules/string/ip.mjs.map +0 -1
  350. package/esm/packages/seal/src/rules/string/matches.mjs +0 -4
  351. package/esm/packages/seal/src/rules/string/pattern.mjs +0 -20
  352. package/esm/packages/seal/src/rules/string/pattern.mjs.map +0 -1
  353. package/esm/packages/seal/src/rules/string/string-comparison.mjs +0 -56
  354. package/esm/packages/seal/src/rules/string/string-comparison.mjs.map +0 -1
  355. package/esm/packages/seal/src/rules/string/strong-password-rule.mjs +0 -31
  356. package/esm/packages/seal/src/rules/string/strong-password-rule.mjs.map +0 -1
  357. package/esm/packages/seal/src/rules/string/url.mjs +0 -23
  358. package/esm/packages/seal/src/rules/string/url.mjs.map +0 -1
  359. package/esm/packages/seal/src/rules/string/without-whitespace.mjs +0 -19
  360. package/esm/packages/seal/src/rules/string/without-whitespace.mjs.map +0 -1
  361. package/esm/packages/seal/src/standard-schema/json-schema.mjs +0 -81
  362. package/esm/packages/seal/src/standard-schema/json-schema.mjs.map +0 -1
  363. package/esm/packages/seal/src/standard-schema/map-result.mjs +0 -26
  364. package/esm/packages/seal/src/standard-schema/map-result.mjs.map +0 -1
  365. package/esm/packages/seal/src/string.mjs +0 -13
  366. package/esm/packages/seal/src/string.mjs.map +0 -1
  367. package/esm/packages/seal/src/types/date-types.mjs +0 -17
  368. package/esm/packages/seal/src/types/date-types.mjs.map +0 -1
  369. package/esm/packages/seal/src/validators/any-validator.mjs +0 -38
  370. package/esm/packages/seal/src/validators/any-validator.mjs.map +0 -1
  371. package/esm/packages/seal/src/validators/array-validator.mjs +0 -186
  372. package/esm/packages/seal/src/validators/array-validator.mjs.map +0 -1
  373. package/esm/packages/seal/src/validators/base-validator.mjs +0 -720
  374. package/esm/packages/seal/src/validators/base-validator.mjs.map +0 -1
  375. package/esm/packages/seal/src/validators/boolean-validator.mjs +0 -175
  376. package/esm/packages/seal/src/validators/boolean-validator.mjs.map +0 -1
  377. package/esm/packages/seal/src/validators/computed-validator.mjs +0 -118
  378. package/esm/packages/seal/src/validators/computed-validator.mjs.map +0 -1
  379. package/esm/packages/seal/src/validators/date-validator.mjs +0 -640
  380. package/esm/packages/seal/src/validators/date-validator.mjs.map +0 -1
  381. package/esm/packages/seal/src/validators/discriminated-union-validator.mjs +0 -138
  382. package/esm/packages/seal/src/validators/discriminated-union-validator.mjs.map +0 -1
  383. package/esm/packages/seal/src/validators/float-validator.mjs +0 -18
  384. package/esm/packages/seal/src/validators/float-validator.mjs.map +0 -1
  385. package/esm/packages/seal/src/validators/index.mjs +0 -28
  386. package/esm/packages/seal/src/validators/instanceof-validator.mjs +0 -64
  387. package/esm/packages/seal/src/validators/instanceof-validator.mjs.map +0 -1
  388. package/esm/packages/seal/src/validators/int-validator.mjs +0 -30
  389. package/esm/packages/seal/src/validators/int-validator.mjs.map +0 -1
  390. package/esm/packages/seal/src/validators/lazy-validator.mjs +0 -87
  391. package/esm/packages/seal/src/validators/lazy-validator.mjs.map +0 -1
  392. package/esm/packages/seal/src/validators/literal-validator.mjs +0 -72
  393. package/esm/packages/seal/src/validators/literal-validator.mjs.map +0 -1
  394. package/esm/packages/seal/src/validators/managed-validator.mjs +0 -39
  395. package/esm/packages/seal/src/validators/managed-validator.mjs.map +0 -1
  396. package/esm/packages/seal/src/validators/methods/equality-conditional-methods.mjs +0 -129
  397. package/esm/packages/seal/src/validators/methods/equality-conditional-methods.mjs.map +0 -1
  398. package/esm/packages/seal/src/validators/methods/forbidden-methods.mjs +0 -131
  399. package/esm/packages/seal/src/validators/methods/forbidden-methods.mjs.map +0 -1
  400. package/esm/packages/seal/src/validators/methods/present-methods.mjs +0 -235
  401. package/esm/packages/seal/src/validators/methods/present-methods.mjs.map +0 -1
  402. package/esm/packages/seal/src/validators/methods/required-methods.mjs +0 -347
  403. package/esm/packages/seal/src/validators/methods/required-methods.mjs.map +0 -1
  404. package/esm/packages/seal/src/validators/number-validator.mjs +0 -331
  405. package/esm/packages/seal/src/validators/number-validator.mjs.map +0 -1
  406. package/esm/packages/seal/src/validators/numeric-validator.mjs +0 -27
  407. package/esm/packages/seal/src/validators/numeric-validator.mjs.map +0 -1
  408. package/esm/packages/seal/src/validators/object-validator.mjs +0 -445
  409. package/esm/packages/seal/src/validators/object-validator.mjs.map +0 -1
  410. package/esm/packages/seal/src/validators/primitive-validator.mjs +0 -88
  411. package/esm/packages/seal/src/validators/primitive-validator.mjs.map +0 -1
  412. package/esm/packages/seal/src/validators/record-validator.mjs +0 -112
  413. package/esm/packages/seal/src/validators/record-validator.mjs.map +0 -1
  414. package/esm/packages/seal/src/validators/scalar-validator.mjs +0 -173
  415. package/esm/packages/seal/src/validators/scalar-validator.mjs.map +0 -1
  416. package/esm/packages/seal/src/validators/string-validator.mjs +0 -459
  417. package/esm/packages/seal/src/validators/string-validator.mjs.map +0 -1
  418. package/esm/packages/seal/src/validators/tuple-validator.mjs +0 -134
  419. package/esm/packages/seal/src/validators/tuple-validator.mjs.map +0 -1
  420. package/esm/packages/seal/src/validators/union-validator.mjs +0 -66
  421. package/esm/packages/seal/src/validators/union-validator.mjs.map +0 -1
@@ -1,116 +0,0 @@
1
- import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
2
- import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
3
- import { getFieldValue } from "../../helpers/get-field-value.mjs";
4
- import "../../helpers/index.mjs";
5
-
6
- //#region ../../packages/seal/src/rules/conditional/forbidden-if-rules.ts
7
- /**
8
- * Forbidden if rule - field is forbidden if another field equals a specific value
9
- * Supports both global and sibling scope
10
- */
11
- const forbiddenIfRule = {
12
- name: "forbiddenIf",
13
- description: "The field is forbidden if another field equals a specific value",
14
- sortOrder: -2,
15
- defaultErrorMessage: "The :input is forbidden",
16
- async validate(value, context) {
17
- const { value: expectedValue } = this.context.options;
18
- const fieldValue = getFieldValue(this, context);
19
- if (!isEmptyValue(value) && fieldValue === expectedValue) {
20
- this.context.translatableParams.field = this.context.options.field;
21
- this.context.translationParams.value = expectedValue;
22
- return invalidRule(this, context);
23
- }
24
- return VALID_RULE;
25
- }
26
- };
27
- /**
28
- * Forbidden if not rule - field is forbidden if another field does NOT equal a specific value
29
- * Supports both global and sibling scope
30
- */
31
- const forbiddenIfNotRule = {
32
- name: "forbiddenIfNot",
33
- description: "The field is forbidden if another field does NOT equal a specific value",
34
- sortOrder: -2,
35
- defaultErrorMessage: "The :input is forbidden",
36
- async validate(value, context) {
37
- const { value: expectedValue } = this.context.options;
38
- const fieldValue = getFieldValue(this, context);
39
- if (!isEmptyValue(value) && fieldValue !== expectedValue) return invalidRule(this, context);
40
- return VALID_RULE;
41
- }
42
- };
43
- /**
44
- * Forbidden if empty rule - field is forbidden if another field is empty
45
- * Supports both global and sibling scope
46
- */
47
- const forbiddenIfEmptyRule = {
48
- name: "forbiddenIfEmpty",
49
- description: "The field is forbidden if another field is empty",
50
- sortOrder: -2,
51
- defaultErrorMessage: "The :input is forbidden",
52
- async validate(value, context) {
53
- const fieldValue = getFieldValue(this, context);
54
- if (!isEmptyValue(value) && isEmptyValue(fieldValue)) return invalidRule(this, context);
55
- return VALID_RULE;
56
- }
57
- };
58
- /**
59
- * Forbidden if not empty rule - field is forbidden if another field is not empty
60
- * Supports both global and sibling scope
61
- */
62
- const forbiddenIfNotEmptyRule = {
63
- name: "forbiddenIfNotEmpty",
64
- description: "The field is forbidden if another field is not empty",
65
- sortOrder: -2,
66
- defaultErrorMessage: "The :input is forbidden",
67
- async validate(value, context) {
68
- const fieldValue = getFieldValue(this, context);
69
- if (!isEmptyValue(value) && !isEmptyValue(fieldValue)) return invalidRule(this, context);
70
- return VALID_RULE;
71
- }
72
- };
73
- /**
74
- * Forbidden if in rule - field is forbidden if another field's value is in the given array
75
- * Supports both global and sibling scope
76
- */
77
- const forbiddenIfInRule = {
78
- name: "forbiddenIfIn",
79
- description: "The field is forbidden if another field's value is in the given array",
80
- sortOrder: -2,
81
- defaultErrorMessage: "The :input is forbidden",
82
- async validate(value, context) {
83
- const { values } = this.context.options;
84
- const fieldValue = getFieldValue(this, context);
85
- if (!isEmptyValue(value) && values.includes(fieldValue)) {
86
- this.context.translationParams.values = values.join(", ");
87
- this.context.translatableParams.field = this.context.options.field;
88
- return invalidRule(this, context);
89
- }
90
- return VALID_RULE;
91
- }
92
- };
93
- /**
94
- * Forbidden if not in rule - field is forbidden if another field's value is NOT in the given array
95
- * Supports both global and sibling scope
96
- */
97
- const forbiddenIfNotInRule = {
98
- name: "forbiddenIfNotIn",
99
- description: "The field is forbidden if another field's value is NOT in the given array",
100
- sortOrder: -2,
101
- defaultErrorMessage: "The :input is forbidden",
102
- async validate(value, context) {
103
- const { values } = this.context.options;
104
- const fieldValue = getFieldValue(this, context);
105
- if (!isEmptyValue(value) && !values.includes(fieldValue)) {
106
- this.context.translationParams.values = values.join(", ");
107
- this.context.translatableParams.field = this.context.options.field;
108
- return invalidRule(this, context);
109
- }
110
- return VALID_RULE;
111
- }
112
- };
113
-
114
- //#endregion
115
- export { forbiddenIfEmptyRule, forbiddenIfInRule, forbiddenIfNotEmptyRule, forbiddenIfNotInRule, forbiddenIfNotRule, forbiddenIfRule };
116
- //# sourceMappingURL=forbidden-if-rules.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forbidden-if-rules.mjs","names":[],"sources":["../../../../../../../../../../../../packages/seal/src/rules/conditional/forbidden-if-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport { isEmptyValue } from \"../../helpers/is-empty-value\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Forbidden if rule - field is forbidden if another field equals a specific value\n * Supports both global and sibling scope\n */\nexport const forbiddenIfRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIf\",\n description: \"The field is forbidden if another field equals a specific value\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field equals the expected value\n if (!isEmptyValue(value) && fieldValue === expectedValue) {\n this.context.translatableParams.field = this.context.options.field;\n this.context.translationParams.value = expectedValue;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Forbidden if not rule - field is forbidden if another field does NOT equal a specific value\n * Supports both global and sibling scope\n */\nexport const forbiddenIfNotRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIfNot\",\n description: \"The field is forbidden if another field does NOT equal a specific value\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field does NOT equal the expected value\n if (!isEmptyValue(value) && fieldValue !== expectedValue) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Forbidden if empty rule - field is forbidden if another field is empty\n * Supports both global and sibling scope\n */\nexport const forbiddenIfEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIfEmpty\",\n description: \"The field is forbidden if another field is empty\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field is empty\n if (!isEmptyValue(value) && isEmptyValue(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Forbidden if not empty rule - field is forbidden if another field is not empty\n * Supports both global and sibling scope\n */\nexport const forbiddenIfNotEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIfNotEmpty\",\n description: \"The field is forbidden if another field is not empty\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field is not empty\n if (!isEmptyValue(value) && !isEmptyValue(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Forbidden if in rule - field is forbidden if another field's value is in the given array\n * Supports both global and sibling scope\n */\nexport const forbiddenIfInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIfIn\",\n description: \"The field is forbidden if another field's value is in the given array\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field's value is in the array\n if (!isEmptyValue(value) && values.includes(fieldValue)) {\n this.context.translationParams.values = values.join(\", \");\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Forbidden if not in rule - field is forbidden if another field's value is NOT in the given array\n * Supports both global and sibling scope\n */\nexport const forbiddenIfNotInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"forbiddenIfNotIn\",\n description: \"The field is forbidden if another field's value is NOT in the given array\",\n sortOrder: -2,\n defaultErrorMessage: \"The :input is forbidden\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field is forbidden if it has a value and the other field's value is NOT in the array\n if (!isEmptyValue(value) && !values.includes(fieldValue)) {\n this.context.translationParams.values = values.join(\", \");\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\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,mBAAmB,QAAQ,KAAK,QAAQ,QAAQ;GAC7D,KAAK,QAAQ,kBAAkB,QAAQ;GACvC,OAAO,YAAY,MAAM,OAAO;EAClC;EAEA,OAAO;CACT;AACF;;;;;AAMA,MAAa,qBAIR;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,eACzC,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,uBAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,CAAC,aAAa,KAAK,KAAK,aAAa,UAAU,GACjD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,0BAGR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,UAAU,GAClD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,oBAIR;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,OAAO,SAAS,UAAU,GAAG;GACvD,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;;;;;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,97 +0,0 @@
1
- import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
2
- import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
3
- import { getFieldValue } from "../../helpers/get-field-value.mjs";
4
- import "../../helpers/index.mjs";
5
-
6
- //#region ../../packages/seal/src/rules/conditional/present-if-rules.ts
7
- /**
8
- * Present if rule - field must be present if another field equals a specific value
9
- * Supports both global and sibling scope
10
- */
11
- const presentIfRule = {
12
- name: "presentIf",
13
- description: "The field must be present if another field equals a specific value",
14
- sortOrder: -2,
15
- requiresValue: false,
16
- defaultErrorMessage: "The :input field must be present",
17
- async validate(value, context) {
18
- const { value: expectedValue } = this.context.options;
19
- const fieldValue = getFieldValue(this, context);
20
- if (value === void 0 && fieldValue === expectedValue) {
21
- this.context.translationParams.value = expectedValue;
22
- this.context.translatableParams.field = this.context.options.field;
23
- return invalidRule(this, context);
24
- }
25
- return VALID_RULE;
26
- }
27
- };
28
- /**
29
- * Present if empty rule - field must be present if another field is empty
30
- * Supports both global and sibling scope
31
- */
32
- const presentIfEmptyRule = {
33
- name: "presentIfEmpty",
34
- description: "The field must be present if another field is empty",
35
- sortOrder: -2,
36
- requiresValue: false,
37
- defaultErrorMessage: "The :input field must be present",
38
- async validate(value, context) {
39
- const fieldValue = getFieldValue(this, context);
40
- if (value === void 0 && isEmptyValue(fieldValue)) return invalidRule(this, context);
41
- return VALID_RULE;
42
- }
43
- };
44
- /**
45
- * Present if not empty rule - field must be present if another field is not empty
46
- * Supports both global and sibling scope
47
- */
48
- const presentIfNotEmptyRule = {
49
- name: "presentIfNotEmpty",
50
- description: "The field must be present if another field is not empty",
51
- sortOrder: -2,
52
- requiresValue: false,
53
- defaultErrorMessage: "The :input field must be present",
54
- async validate(value, context) {
55
- const fieldValue = getFieldValue(this, context);
56
- if (value === void 0 && !isEmptyValue(fieldValue)) return invalidRule(this, context);
57
- return VALID_RULE;
58
- }
59
- };
60
- /**
61
- * Present if in rule - field must be present if another field's value is in the given array
62
- * Supports both global and sibling scope
63
- */
64
- const presentIfInRule = {
65
- name: "presentIfIn",
66
- description: "The field must be present if another field's value is in the given array",
67
- sortOrder: -2,
68
- requiresValue: false,
69
- defaultErrorMessage: "The :input field must be present",
70
- async validate(value, context) {
71
- const { values } = this.context.options;
72
- const fieldValue = getFieldValue(this, context);
73
- if (value === void 0 && values.includes(fieldValue)) return invalidRule(this, context);
74
- return VALID_RULE;
75
- }
76
- };
77
- /**
78
- * Present if not in rule - field must be present if another field's value is NOT in the given array
79
- * Supports both global and sibling scope
80
- */
81
- const presentIfNotInRule = {
82
- name: "presentIfNotIn",
83
- description: "The field must be present if another field's value is NOT in the given array",
84
- sortOrder: -2,
85
- requiresValue: false,
86
- defaultErrorMessage: "The :input field must be present",
87
- async validate(value, context) {
88
- const { values } = this.context.options;
89
- const fieldValue = getFieldValue(this, context);
90
- if (value === void 0 && !values.includes(fieldValue)) return invalidRule(this, context);
91
- return VALID_RULE;
92
- }
93
- };
94
-
95
- //#endregion
96
- export { presentIfEmptyRule, presentIfInRule, presentIfNotEmptyRule, presentIfNotInRule, presentIfRule };
97
- //# sourceMappingURL=present-if-rules.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-if-rules.mjs","names":[],"sources":["../../../../../../../../../../../../packages/seal/src/rules/conditional/present-if-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\nimport { isEmptyValue } from \"./../../helpers/is-empty-value\";\n\n/**\n * Present if rule - field must be present if another field equals a specific value\n * Supports both global and sibling scope\n */\nexport const presentIfRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentIf\",\n description: \"The field must be present if another field equals a specific value\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field equals the expected value\n if (value === undefined && fieldValue === expectedValue) {\n this.context.translationParams.value = expectedValue;\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present if empty rule - field must be present if another field is empty\n * Supports both global and sibling scope\n */\nexport const presentIfEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentIfEmpty\",\n description: \"The field must be present if another field is empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field is empty\n if (value === undefined && isEmptyValue(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present if not empty rule - field must be present if another field is not empty\n * Supports both global and sibling scope\n */\nexport const presentIfNotEmptyRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentIfNotEmpty\",\n description: \"The field must be present if another field is not empty\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field is not empty\n if (value === undefined && !isEmptyValue(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present if in rule - field must be present if another field's value is in the given array\n * Supports both global and sibling scope\n */\nexport const presentIfInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentIfIn\",\n description: \"The field must be present if another field's value is in the given array\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field's value is in the array\n if (value === undefined && values.includes(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present if not in rule - field must be present if another field's value is NOT in the given array\n * Supports both global and sibling scope\n */\nexport const presentIfNotInRule: SchemaRule<{\n field: string;\n values: any[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentIfNotIn\",\n description: \"The field must be present if another field's value is NOT in the given array\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { values } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field's value is NOT in the array\n if (value === undefined && !values.includes(fieldValue)) {\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,gBAIR;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;;;;;AAMA,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,aAAa,UAAU,GAChD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,wBAGR;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,CAAC,aAAa,UAAU,GACjD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,kBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,EAAE,WAAW,KAAK,QAAQ;EAChC,MAAM,aAAa,cAAc,MAAM,OAAO;EAG9C,IAAI,UAAU,UAAa,OAAO,SAAS,UAAU,GACnD,OAAO,YAAY,MAAM,OAAO;EAGlC,OAAO;CACT;AACF;;;;;AAMA,MAAa,qBAIR;CACH,MAAM;CACN,aAAa;CACb,WAAW;CACX,eAAe;CACf,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,MAAM,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,30 +0,0 @@
1
- import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
2
- import { getFieldValue } from "../../helpers/get-field-value.mjs";
3
- import "../../helpers/index.mjs";
4
-
5
- //#region ../../packages/seal/src/rules/conditional/present-unless-rules.ts
6
- /**
7
- * Present unless rule - field must be present unless another field equals a specific value
8
- * Supports both global and sibling scope
9
- */
10
- const presentUnlessRule = {
11
- name: "presentUnless",
12
- description: "The field must be present unless another field equals a specific value",
13
- sortOrder: -2,
14
- requiresValue: false,
15
- defaultErrorMessage: "The :input field must be present",
16
- async validate(value, context) {
17
- const { value: expectedValue } = this.context.options;
18
- const fieldValue = getFieldValue(this, context);
19
- if (value === void 0 && fieldValue !== expectedValue) {
20
- this.context.translationParams.value = expectedValue;
21
- this.context.translatableParams.field = this.context.options.field;
22
- return invalidRule(this, context);
23
- }
24
- return VALID_RULE;
25
- }
26
- };
27
-
28
- //#endregion
29
- export { presentUnlessRule };
30
- //# sourceMappingURL=present-unless-rules.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-unless-rules.mjs","names":[],"sources":["../../../../../../../../../../../../packages/seal/src/rules/conditional/present-unless-rules.ts"],"sourcesContent":["import { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Present unless rule - field must be present unless another field equals a specific value\n * Supports both global and sibling scope\n */\nexport const presentUnlessRule: SchemaRule<{\n field: string;\n value: any;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentUnless\",\n description: \"The field must be present unless another field equals a specific value\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { value: expectedValue } = this.context.options;\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present unless the other field equals the expected value\n if (value === undefined && fieldValue !== expectedValue) {\n this.context.translationParams.value = expectedValue;\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\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,76 +0,0 @@
1
- import { get } from "../../../../../node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs";
2
- import "../../../../../node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/index.mjs";
3
- import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
4
- import { getFieldValue } from "../../helpers/get-field-value.mjs";
5
- import "../../helpers/index.mjs";
6
-
7
- //#region ../../packages/seal/src/rules/conditional/present-with-rules.ts
8
- /**
9
- * Present with rule - field must be present if another field is present
10
- * Supports both global and sibling scope
11
- */
12
- const presentWithRule = {
13
- name: "presentWith",
14
- description: "The field must be present if another field is present",
15
- sortOrder: -2,
16
- requiresValue: false,
17
- defaultErrorMessage: "The :input field must be present",
18
- async validate(value, context) {
19
- const fieldValue = getFieldValue(this, context);
20
- if (value === void 0 && fieldValue !== void 0) {
21
- this.context.translatableParams.field = this.context.options.field;
22
- return invalidRule(this, context);
23
- }
24
- return VALID_RULE;
25
- }
26
- };
27
- /**
28
- * Present with all rule - field must be present if all specified fields are present
29
- * Supports both global and sibling scope
30
- */
31
- const presentWithAllRule = {
32
- name: "presentWithAll",
33
- description: "The field must be present if all specified fields are present",
34
- sortOrder: -2,
35
- requiresValue: false,
36
- defaultErrorMessage: "The :input field must be present",
37
- async validate(value, context) {
38
- const { fields, scope = "global" } = this.context.options;
39
- const source = scope === "sibling" ? context.parent : context.allValues;
40
- const allPresent = fields.every((field) => get(source, field) !== void 0);
41
- if (value === void 0 && allPresent) {
42
- fields.forEach((field) => {
43
- this.context.translatableParams.field = field;
44
- });
45
- return invalidRule(this, context);
46
- }
47
- return VALID_RULE;
48
- }
49
- };
50
- /**
51
- * Present with any rule - field must be present if any of the specified fields is present
52
- * Supports both global and sibling scope
53
- */
54
- const presentWithAnyRule = {
55
- name: "presentWithAny",
56
- description: "The field must be present if any of the specified fields is present",
57
- sortOrder: -2,
58
- requiresValue: false,
59
- defaultErrorMessage: "The :input field must be present",
60
- async validate(value, context) {
61
- const { fields, scope = "global" } = this.context.options;
62
- const source = scope === "sibling" ? context.parent : context.allValues;
63
- const anyPresent = fields.some((field) => get(source, field) !== void 0);
64
- if (value === void 0 && anyPresent) {
65
- fields.forEach((field) => {
66
- this.context.translatableParams.field = field;
67
- });
68
- return invalidRule(this, context);
69
- }
70
- return VALID_RULE;
71
- }
72
- };
73
-
74
- //#endregion
75
- export { presentWithAllRule, presentWithAnyRule, presentWithRule };
76
- //# sourceMappingURL=present-with-rules.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-with-rules.mjs","names":[],"sources":["../../../../../../../../../../../../packages/seal/src/rules/conditional/present-with-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Present with rule - field must be present if another field is present\n * Supports both global and sibling scope\n */\nexport const presentWithRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWith\",\n description: \"The field must be present if another field is present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // The field must be present if the other field is present\n if (value === undefined && fieldValue !== undefined) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present with all rule - field must be present if all specified fields are present\n * Supports both global and sibling scope\n */\nexport const presentWithAllRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWithAll\",\n description: \"The field must be present if all specified fields are present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if all fields are present\n const allPresent = fields.every((field) => get(source, field) !== undefined);\n\n // Field must be present if all other fields are present\n if (value === undefined && allPresent) {\n fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present with any rule - field must be present if any of the specified fields is present\n * Supports both global and sibling scope\n */\nexport const presentWithAnyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWithAny\",\n description: \"The field must be present if any of the specified fields is present\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if any field is present\n const anyPresent = fields.some((field) => get(source, field) !== undefined);\n\n // Field must be present if any other field is present\n if (value === undefined && anyPresent) {\n fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\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,76 +0,0 @@
1
- import { get } from "../../../../../node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs";
2
- import "../../../../../node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/index.mjs";
3
- import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
4
- import { getFieldValue } from "../../helpers/get-field-value.mjs";
5
- import "../../helpers/index.mjs";
6
-
7
- //#region ../../packages/seal/src/rules/conditional/present-without-rules.ts
8
- /**
9
- * Present without rule - field must be present if another field is missing
10
- * Supports both global and sibling scope
11
- */
12
- const presentWithoutRule = {
13
- name: "presentWithout",
14
- description: "The field must be present if another field is missing",
15
- sortOrder: -2,
16
- requiresValue: false,
17
- defaultErrorMessage: "The :input field must be present",
18
- async validate(value, context) {
19
- const fieldValue = getFieldValue(this, context);
20
- if (value === void 0 && fieldValue === void 0) {
21
- this.context.translatableParams.field = this.context.options.field;
22
- return invalidRule(this, context);
23
- }
24
- return VALID_RULE;
25
- }
26
- };
27
- /**
28
- * Present without all rule - field must be present if all specified fields are missing
29
- * Supports both global and sibling scope
30
- */
31
- const presentWithoutAllRule = {
32
- name: "presentWithoutAll",
33
- description: "The field must be present if all specified fields are missing",
34
- sortOrder: -2,
35
- requiresValue: false,
36
- defaultErrorMessage: "The :input field must be present",
37
- async validate(value, context) {
38
- const { fields, scope = "global" } = this.context.options;
39
- const source = scope === "sibling" ? context.parent : context.allValues;
40
- const allMissing = fields.every((field) => get(source, field) === void 0);
41
- if (value === void 0 && allMissing) {
42
- fields.forEach((field) => {
43
- this.context.translatableParams.field = field;
44
- });
45
- return invalidRule(this, context);
46
- }
47
- return VALID_RULE;
48
- }
49
- };
50
- /**
51
- * Present without any rule - field must be present if any of the specified fields is missing
52
- * Supports both global and sibling scope
53
- */
54
- const presentWithoutAnyRule = {
55
- name: "presentWithoutAny",
56
- description: "The field must be present if any of the specified fields is missing",
57
- sortOrder: -2,
58
- requiresValue: false,
59
- defaultErrorMessage: "The :input field must be present",
60
- async validate(value, context) {
61
- const { fields, scope = "global" } = this.context.options;
62
- const source = scope === "sibling" ? context.parent : context.allValues;
63
- const anyMissing = fields.some((field) => get(source, field) === void 0);
64
- if (value === void 0 && anyMissing) {
65
- fields.forEach((field) => {
66
- this.context.translatableParams.field = field;
67
- });
68
- return invalidRule(this, context);
69
- }
70
- return VALID_RULE;
71
- }
72
- };
73
-
74
- //#endregion
75
- export { presentWithoutAllRule, presentWithoutAnyRule, presentWithoutRule };
76
- //# sourceMappingURL=present-without-rules.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present-without-rules.mjs","names":[],"sources":["../../../../../../../../../../../../packages/seal/src/rules/conditional/present-without-rules.ts"],"sourcesContent":["import { get } from \"@mongez/reinforcements\";\nimport { getFieldValue, invalidRule, VALID_RULE } from \"../../helpers\";\nimport type { SchemaRule } from \"../../types\";\n\n/**\n * Present without rule - field must be present if another field is missing\n * Supports both global and sibling scope\n */\nexport const presentWithoutRule: SchemaRule<{\n field: string;\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWithout\",\n description: \"The field must be present if another field is missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const fieldValue = getFieldValue(this, context);\n\n // Field must be present if the other field is missing\n if (value === undefined && fieldValue === undefined) {\n this.context.translatableParams.field = this.context.options.field;\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present without all rule - field must be present if all specified fields are missing\n * Supports both global and sibling scope\n */\nexport const presentWithoutAllRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWithoutAll\",\n description: \"The field must be present if all specified fields are missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if all fields are missing\n const allMissing = fields.every((field) => get(source, field) === undefined);\n\n // Field must be present if all other fields are missing\n if (value === undefined && allMissing) {\n fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\n\n/**\n * Present without any rule - field must be present if any of the specified fields is missing\n * Supports both global and sibling scope\n */\nexport const presentWithoutAnyRule: SchemaRule<{\n fields: string[];\n scope?: \"global\" | \"sibling\";\n}> = {\n name: \"presentWithoutAny\",\n description: \"The field must be present if any of the specified fields is missing\",\n sortOrder: -2,\n requiresValue: false,\n defaultErrorMessage: \"The :input field must be present\",\n async validate(value: any, context) {\n const { fields, scope = \"global\" } = this.context.options;\n const source = scope === \"sibling\" ? context.parent : context.allValues;\n\n // Check if any field is missing\n const anyMissing = fields.some((field) => get(source, field) === undefined);\n\n // Field must be present if any other field is missing\n if (value === undefined && anyMissing) {\n fields.forEach((field) => {\n this.context.translatableParams.field = field;\n });\n\n return invalidRule(this, context);\n }\n\n return VALID_RULE;\n },\n};\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"}