@warlock.js/notifications 4.15.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cjs/channel_api-CH3DxhRU.cjs +7463 -0
  3. package/cjs/channel_api-CH3DxhRU.cjs.map +1 -0
  4. package/cjs/chunk-fl3r8ClO.cjs +41 -0
  5. package/cjs/index.cjs +34 -4
  6. package/cjs/index.cjs.map +1 -1
  7. package/cjs/rabbitmq-driver-CJtyxjUQ.cjs +3 -0
  8. package/cjs/src-Cus6pYPC.cjs +10981 -0
  9. package/cjs/src-Cus6pYPC.cjs.map +1 -0
  10. package/esm/_virtual/_rolldown/runtime.mjs +32 -0
  11. package/esm/herald/src/communicators/broker-registry.mjs +204 -0
  12. package/esm/herald/src/communicators/broker-registry.mjs.map +1 -0
  13. package/esm/herald/src/communicators/broker.mjs +110 -0
  14. package/esm/herald/src/communicators/broker.mjs.map +1 -0
  15. package/esm/herald/src/communicators/index.mjs +4 -0
  16. package/esm/herald/src/decorators/consumable.mjs +36 -0
  17. package/esm/herald/src/decorators/consumable.mjs.map +1 -0
  18. package/esm/herald/src/decorators/index.mjs +3 -0
  19. package/esm/herald/src/drivers/index.mjs +5 -0
  20. package/esm/herald/src/drivers/rabbitmq/index.mjs +4 -0
  21. package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs +403 -0
  22. package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +1 -0
  23. package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs +303 -0
  24. package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +1 -0
  25. package/esm/herald/src/index.mjs +16 -0
  26. package/esm/herald/src/message-managers/event-consumer.mjs +76 -0
  27. package/esm/herald/src/message-managers/event-consumer.mjs.map +1 -0
  28. package/esm/herald/src/message-managers/event-message.mjs +85 -0
  29. package/esm/herald/src/message-managers/event-message.mjs.map +1 -0
  30. package/esm/herald/src/message-managers/index.mjs +4 -0
  31. package/esm/herald/src/message-managers/prepare-consumer-subscription.mjs +42 -0
  32. package/esm/herald/src/message-managers/prepare-consumer-subscription.mjs.map +1 -0
  33. package/esm/herald/src/use-case-broadcast.mjs +30 -0
  34. package/esm/herald/src/use-case-broadcast.mjs.map +1 -0
  35. package/esm/herald/src/utils/connect-to-broker.mjs +168 -0
  36. package/esm/herald/src/utils/connect-to-broker.mjs.map +1 -0
  37. package/esm/herald/src/utils/index.mjs +3 -0
  38. package/esm/in-app/base-notifications-repository.d.mts +15 -1
  39. package/esm/in-app/base-notifications-repository.d.mts.map +1 -1
  40. package/esm/in-app/base-notifications-repository.mjs +33 -3
  41. package/esm/in-app/base-notifications-repository.mjs.map +1 -1
  42. package/esm/in-app/in-app.d.mts +3 -3
  43. package/esm/in-app/in-app.d.mts.map +1 -1
  44. package/esm/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs +6 -0
  45. package/esm/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs.map +1 -0
  46. package/esm/node_modules/@mongez/reinforcements/esm/Random/bool.mjs +3 -0
  47. package/esm/node_modules/@mongez/reinforcements/esm/Random/color.mjs +3 -0
  48. package/esm/node_modules/@mongez/reinforcements/esm/Random/date.mjs +3 -0
  49. package/esm/node_modules/@mongez/reinforcements/esm/Random/float.mjs +3 -0
  50. package/esm/node_modules/@mongez/reinforcements/esm/Random/id.mjs +3 -0
  51. package/esm/node_modules/@mongez/reinforcements/esm/Random/int.mjs +3 -0
  52. package/esm/node_modules/@mongez/reinforcements/esm/Random/nanoid.mjs +3 -0
  53. package/esm/node_modules/@mongez/reinforcements/esm/Random/pick.mjs +3 -0
  54. package/esm/node_modules/@mongez/reinforcements/esm/Random/random.mjs +16 -0
  55. package/esm/node_modules/@mongez/reinforcements/esm/Random/sample.mjs +3 -0
  56. package/esm/node_modules/@mongez/reinforcements/esm/Random/string.mjs +3 -0
  57. package/esm/node_modules/@mongez/reinforcements/esm/Random/token.mjs +3 -0
  58. package/esm/node_modules/@mongez/reinforcements/esm/Random/uuid.mjs +3 -0
  59. package/esm/node_modules/@mongez/reinforcements/esm/Random/weighted.mjs +3 -0
  60. package/esm/node_modules/@mongez/reinforcements/esm/async/retry.mjs +3 -0
  61. package/esm/node_modules/@mongez/reinforcements/esm/index.mjs +24 -0
  62. package/esm/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs +82 -0
  63. package/esm/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs.map +1 -0
  64. package/esm/node_modules/@mongez/reinforcements/esm/number/round.mjs +17 -0
  65. package/esm/node_modules/@mongez/reinforcements/esm/number/round.mjs.map +1 -0
  66. package/esm/node_modules/@mongez/reinforcements/esm/object/except.mjs +13 -0
  67. package/esm/node_modules/@mongez/reinforcements/esm/object/except.mjs.map +1 -0
  68. package/esm/node_modules/@mongez/reinforcements/esm/object/get.mjs +18 -0
  69. package/esm/node_modules/@mongez/reinforcements/esm/object/get.mjs.map +1 -0
  70. package/esm/node_modules/@mongez/reinforcements/esm/object/omit.mjs +17 -0
  71. package/esm/node_modules/@mongez/reinforcements/esm/object/omit.mjs.map +1 -0
  72. package/esm/node_modules/@mongez/reinforcements/esm/object/unset.mjs +30 -0
  73. package/esm/node_modules/@mongez/reinforcements/esm/object/unset.mjs.map +1 -0
  74. package/esm/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs +19 -0
  75. package/esm/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs.map +1 -0
  76. package/esm/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs +18 -0
  77. package/esm/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs.map +1 -0
  78. package/esm/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs +14 -0
  79. package/esm/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs.map +1 -0
  80. package/esm/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs +18 -0
  81. package/esm/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs.map +1 -0
  82. package/esm/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs +22 -0
  83. package/esm/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs.map +1 -0
  84. package/esm/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs +17 -0
  85. package/esm/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs.map +1 -0
  86. package/esm/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs +21 -0
  87. package/esm/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs.map +1 -0
  88. package/esm/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs +21 -0
  89. package/esm/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs.map +1 -0
  90. package/esm/node_modules/@mongez/reinforcements/esm/string/trim.mjs +20 -0
  91. package/esm/node_modules/@mongez/reinforcements/esm/string/trim.mjs.map +1 -0
  92. package/esm/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs +15 -0
  93. package/esm/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs.map +1 -0
  94. package/esm/node_modules/@mongez/reinforcements/esm/string/words.mjs +25 -0
  95. package/esm/node_modules/@mongez/reinforcements/esm/string/words.mjs.map +1 -0
  96. package/esm/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs +11 -0
  97. package/esm/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs.map +1 -0
  98. package/esm/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs +100 -0
  99. package/esm/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs.map +1 -0
  100. package/esm/node_modules/@mongez/reinforcements/esm/utils/tap.mjs +27 -0
  101. package/esm/node_modules/@mongez/reinforcements/esm/utils/tap.mjs.map +1 -0
  102. package/esm/node_modules/@mongez/supportive-is/esm/index.mjs +353 -0
  103. package/esm/node_modules/@mongez/supportive-is/esm/index.mjs.map +1 -0
  104. package/esm/node_modules/amqplib/channel_api.mjs +28 -0
  105. package/esm/node_modules/amqplib/channel_api.mjs.map +1 -0
  106. package/esm/node_modules/amqplib/lib/api_args.mjs +241 -0
  107. package/esm/node_modules/amqplib/lib/api_args.mjs.map +1 -0
  108. package/esm/node_modules/amqplib/lib/bitset.mjs +130 -0
  109. package/esm/node_modules/amqplib/lib/bitset.mjs.map +1 -0
  110. package/esm/node_modules/amqplib/lib/channel.mjs +302 -0
  111. package/esm/node_modules/amqplib/lib/channel.mjs.map +1 -0
  112. package/esm/node_modules/amqplib/lib/channel_model.mjs +206 -0
  113. package/esm/node_modules/amqplib/lib/channel_model.mjs.map +1 -0
  114. package/esm/node_modules/amqplib/lib/codec.mjs +273 -0
  115. package/esm/node_modules/amqplib/lib/codec.mjs.map +1 -0
  116. package/esm/node_modules/amqplib/lib/connect.mjs +143 -0
  117. package/esm/node_modules/amqplib/lib/connect.mjs.map +1 -0
  118. package/esm/node_modules/amqplib/lib/connection.mjs +416 -0
  119. package/esm/node_modules/amqplib/lib/connection.mjs.map +1 -0
  120. package/esm/node_modules/amqplib/lib/credentials.mjs +50 -0
  121. package/esm/node_modules/amqplib/lib/credentials.mjs.map +1 -0
  122. package/esm/node_modules/amqplib/lib/defs.mjs +4600 -0
  123. package/esm/node_modules/amqplib/lib/defs.mjs.map +1 -0
  124. package/esm/node_modules/amqplib/lib/error.mjs +29 -0
  125. package/esm/node_modules/amqplib/lib/error.mjs.map +1 -0
  126. package/esm/node_modules/amqplib/lib/format.mjs +28 -0
  127. package/esm/node_modules/amqplib/lib/format.mjs.map +1 -0
  128. package/esm/node_modules/amqplib/lib/frame.mjs +130 -0
  129. package/esm/node_modules/amqplib/lib/frame.mjs.map +1 -0
  130. package/esm/node_modules/amqplib/lib/heartbeat.mjs +40 -0
  131. package/esm/node_modules/amqplib/lib/heartbeat.mjs.map +1 -0
  132. package/esm/node_modules/amqplib/lib/mux.mjs +86 -0
  133. package/esm/node_modules/amqplib/lib/mux.mjs.map +1 -0
  134. package/esm/node_modules/amqplib/package.mjs +41 -0
  135. package/esm/node_modules/amqplib/package.mjs.map +1 -0
  136. package/esm/node_modules/buffer-more-ints/buffer-more-ints.mjs +360 -0
  137. package/esm/node_modules/buffer-more-ints/buffer-more-ints.mjs.map +1 -0
  138. package/esm/node_modules/dayjs/dayjs.min.mjs +305 -0
  139. package/esm/node_modules/dayjs/dayjs.min.mjs.map +1 -0
  140. package/esm/node_modules/querystringify/index.mjs +80 -0
  141. package/esm/node_modules/querystringify/index.mjs.map +1 -0
  142. package/esm/node_modules/requires-port/index.mjs +35 -0
  143. package/esm/node_modules/requires-port/index.mjs.map +1 -0
  144. package/esm/node_modules/url-parse/index.mjs +388 -0
  145. package/esm/node_modules/url-parse/index.mjs.map +1 -0
  146. package/esm/queue/load-herald.mjs +1 -1
  147. package/esm/seal/src/config.mjs +15 -0
  148. package/esm/seal/src/config.mjs.map +1 -0
  149. package/esm/seal/src/factory/index.mjs +4 -0
  150. package/esm/seal/src/factory/validate.mjs +34 -0
  151. package/esm/seal/src/factory/validate.mjs.map +1 -0
  152. package/esm/seal/src/factory/validators.mjs +132 -0
  153. package/esm/seal/src/factory/validators.mjs.map +1 -0
  154. package/esm/seal/src/helpers/date-helpers.mjs +24 -0
  155. package/esm/seal/src/helpers/date-helpers.mjs.map +1 -0
  156. package/esm/seal/src/helpers/get-field-value.mjs +46 -0
  157. package/esm/seal/src/helpers/get-field-value.mjs.map +1 -0
  158. package/esm/seal/src/helpers/index.mjs +6 -0
  159. package/esm/seal/src/helpers/is-empty-value.mjs +10 -0
  160. package/esm/seal/src/helpers/is-empty-value.mjs.map +1 -0
  161. package/esm/seal/src/helpers/path-helpers.mjs +12 -0
  162. package/esm/seal/src/helpers/path-helpers.mjs.map +1 -0
  163. package/esm/seal/src/helpers/validation-helpers.mjs +72 -0
  164. package/esm/seal/src/helpers/validation-helpers.mjs.map +1 -0
  165. package/esm/seal/src/index.mjs +87 -0
  166. package/esm/seal/src/mutators/array-mutators.mjs +32 -0
  167. package/esm/seal/src/mutators/array-mutators.mjs.map +1 -0
  168. package/esm/seal/src/mutators/date-mutators.mjs +94 -0
  169. package/esm/seal/src/mutators/date-mutators.mjs.map +1 -0
  170. package/esm/seal/src/mutators/index.mjs +8 -0
  171. package/esm/seal/src/mutators/number-mutators.mjs +52 -0
  172. package/esm/seal/src/mutators/number-mutators.mjs.map +1 -0
  173. package/esm/seal/src/mutators/object-mutators.mjs +30 -0
  174. package/esm/seal/src/mutators/object-mutators.mjs.map +1 -0
  175. package/esm/seal/src/mutators/scalar-mutators.mjs +9 -0
  176. package/esm/seal/src/mutators/scalar-mutators.mjs.map +1 -0
  177. package/esm/seal/src/mutators/string-mutators.mjs +186 -0
  178. package/esm/seal/src/mutators/string-mutators.mjs.map +1 -0
  179. package/esm/seal/src/rules/array/array-rules.mjs +41 -0
  180. package/esm/seal/src/rules/array/array-rules.mjs.map +1 -0
  181. package/esm/seal/src/rules/array/index.mjs +3 -0
  182. package/esm/seal/src/rules/color/color-rules.mjs +104 -0
  183. package/esm/seal/src/rules/color/color-rules.mjs.map +1 -0
  184. package/esm/seal/src/rules/color/index.mjs +3 -0
  185. package/esm/seal/src/rules/common/enum.mjs +77 -0
  186. package/esm/seal/src/rules/common/enum.mjs.map +1 -0
  187. package/esm/seal/src/rules/common/equals-field-rules.mjs +42 -0
  188. package/esm/seal/src/rules/common/equals-field-rules.mjs.map +1 -0
  189. package/esm/seal/src/rules/common/index.mjs +8 -0
  190. package/esm/seal/src/rules/common/instanceof.mjs +23 -0
  191. package/esm/seal/src/rules/common/instanceof.mjs.map +1 -0
  192. package/esm/seal/src/rules/common/literal.mjs +31 -0
  193. package/esm/seal/src/rules/common/literal.mjs.map +1 -0
  194. package/esm/seal/src/rules/common/type-rules.mjs +97 -0
  195. package/esm/seal/src/rules/common/type-rules.mjs.map +1 -0
  196. package/esm/seal/src/rules/common/unknown-key.mjs +25 -0
  197. package/esm/seal/src/rules/common/unknown-key.mjs.map +1 -0
  198. package/esm/seal/src/rules/conditional/forbidden-if-rules.mjs +116 -0
  199. package/esm/seal/src/rules/conditional/forbidden-if-rules.mjs.map +1 -0
  200. package/esm/seal/src/rules/conditional/index.mjs +12 -0
  201. package/esm/seal/src/rules/conditional/present-if-rules.mjs +97 -0
  202. package/esm/seal/src/rules/conditional/present-if-rules.mjs.map +1 -0
  203. package/esm/seal/src/rules/conditional/present-unless-rules.mjs +30 -0
  204. package/esm/seal/src/rules/conditional/present-unless-rules.mjs.map +1 -0
  205. package/esm/seal/src/rules/conditional/present-with-rules.mjs +76 -0
  206. package/esm/seal/src/rules/conditional/present-with-rules.mjs.map +1 -0
  207. package/esm/seal/src/rules/conditional/present-without-rules.mjs +76 -0
  208. package/esm/seal/src/rules/conditional/present-without-rules.mjs.map +1 -0
  209. package/esm/seal/src/rules/conditional/required-if-rules.mjs +204 -0
  210. package/esm/seal/src/rules/conditional/required-if-rules.mjs.map +1 -0
  211. package/esm/seal/src/rules/conditional/required-unless-rules.mjs +31 -0
  212. package/esm/seal/src/rules/conditional/required-unless-rules.mjs.map +1 -0
  213. package/esm/seal/src/rules/conditional/required-when-rule.mjs +32 -0
  214. package/esm/seal/src/rules/conditional/required-when-rule.mjs.map +1 -0
  215. package/esm/seal/src/rules/conditional/required-with-rules.mjs +67 -0
  216. package/esm/seal/src/rules/conditional/required-with-rules.mjs.map +1 -0
  217. package/esm/seal/src/rules/conditional/required-without-rules.mjs +67 -0
  218. package/esm/seal/src/rules/conditional/required-without-rules.mjs.map +1 -0
  219. package/esm/seal/src/rules/core/equal.mjs +22 -0
  220. package/esm/seal/src/rules/core/equal.mjs.map +1 -0
  221. package/esm/seal/src/rules/core/forbidden.mjs +20 -0
  222. package/esm/seal/src/rules/core/forbidden.mjs.map +1 -0
  223. package/esm/seal/src/rules/core/index.mjs +7 -0
  224. package/esm/seal/src/rules/core/required.mjs +36 -0
  225. package/esm/seal/src/rules/core/required.mjs.map +1 -0
  226. package/esm/seal/src/rules/core/union.mjs +30 -0
  227. package/esm/seal/src/rules/core/union.mjs.map +1 -0
  228. package/esm/seal/src/rules/core/when.mjs +37 -0
  229. package/esm/seal/src/rules/core/when.mjs.map +1 -0
  230. package/esm/seal/src/rules/date/date-comparison-rules.mjs +78 -0
  231. package/esm/seal/src/rules/date/date-comparison-rules.mjs.map +1 -0
  232. package/esm/seal/src/rules/date/date-day-rules.mjs +49 -0
  233. package/esm/seal/src/rules/date/date-day-rules.mjs.map +1 -0
  234. package/esm/seal/src/rules/date/date-field-comparison-rules.mjs +82 -0
  235. package/esm/seal/src/rules/date/date-field-comparison-rules.mjs.map +1 -0
  236. package/esm/seal/src/rules/date/date-period-rules.mjs +399 -0
  237. package/esm/seal/src/rules/date/date-period-rules.mjs.map +1 -0
  238. package/esm/seal/src/rules/date/date-relative-rules.mjs +55 -0
  239. package/esm/seal/src/rules/date/date-relative-rules.mjs.map +1 -0
  240. package/esm/seal/src/rules/date/date-special-rules.mjs +58 -0
  241. package/esm/seal/src/rules/date/date-special-rules.mjs.map +1 -0
  242. package/esm/seal/src/rules/date/date.mjs +235 -0
  243. package/esm/seal/src/rules/date/date.mjs.map +1 -0
  244. package/esm/seal/src/rules/date/index.mjs +9 -0
  245. package/esm/seal/src/rules/file/dimensions.mjs +3 -0
  246. package/esm/seal/src/rules/file/file-size.mjs +3 -0
  247. package/esm/seal/src/rules/file/index.mjs +4 -0
  248. package/esm/seal/src/rules/index.mjs +54 -0
  249. package/esm/seal/src/rules/length/index.mjs +3 -0
  250. package/esm/seal/src/rules/length/length-rules.mjs +98 -0
  251. package/esm/seal/src/rules/length/length-rules.mjs.map +1 -0
  252. package/esm/seal/src/rules/number/index.mjs +3 -0
  253. package/esm/seal/src/rules/number/number-rules.mjs +197 -0
  254. package/esm/seal/src/rules/number/number-rules.mjs.map +1 -0
  255. package/esm/seal/src/rules/scalar/accepted-rule.mjs +116 -0
  256. package/esm/seal/src/rules/scalar/accepted-rule.mjs.map +1 -0
  257. package/esm/seal/src/rules/scalar/declined-rule.mjs +116 -0
  258. package/esm/seal/src/rules/scalar/declined-rule.mjs.map +1 -0
  259. package/esm/seal/src/rules/scalar/index.mjs +4 -0
  260. package/esm/seal/src/rules/string/alpha.mjs +41 -0
  261. package/esm/seal/src/rules/string/alpha.mjs.map +1 -0
  262. package/esm/seal/src/rules/string/credit-card.mjs +32 -0
  263. package/esm/seal/src/rules/string/credit-card.mjs.map +1 -0
  264. package/esm/seal/src/rules/string/email.mjs +20 -0
  265. package/esm/seal/src/rules/string/email.mjs.map +1 -0
  266. package/esm/seal/src/rules/string/id-formats.mjs +104 -0
  267. package/esm/seal/src/rules/string/id-formats.mjs.map +1 -0
  268. package/esm/seal/src/rules/string/index.mjs +13 -0
  269. package/esm/seal/src/rules/string/ip.mjs +66 -0
  270. package/esm/seal/src/rules/string/ip.mjs.map +1 -0
  271. package/esm/seal/src/rules/string/matches.mjs +4 -0
  272. package/esm/seal/src/rules/string/pattern.mjs +20 -0
  273. package/esm/seal/src/rules/string/pattern.mjs.map +1 -0
  274. package/esm/seal/src/rules/string/string-comparison.mjs +56 -0
  275. package/esm/seal/src/rules/string/string-comparison.mjs.map +1 -0
  276. package/esm/seal/src/rules/string/strong-password-rule.mjs +31 -0
  277. package/esm/seal/src/rules/string/strong-password-rule.mjs.map +1 -0
  278. package/esm/seal/src/rules/string/url.mjs +23 -0
  279. package/esm/seal/src/rules/string/url.mjs.map +1 -0
  280. package/esm/seal/src/rules/string/without-whitespace.mjs +19 -0
  281. package/esm/seal/src/rules/string/without-whitespace.mjs.map +1 -0
  282. package/esm/seal/src/standard-schema/json-schema.mjs +81 -0
  283. package/esm/seal/src/standard-schema/json-schema.mjs.map +1 -0
  284. package/esm/seal/src/standard-schema/map-result.mjs +26 -0
  285. package/esm/seal/src/standard-schema/map-result.mjs.map +1 -0
  286. package/esm/seal/src/types/date-types.mjs +17 -0
  287. package/esm/seal/src/types/date-types.mjs.map +1 -0
  288. package/esm/seal/src/validators/any-validator.mjs +38 -0
  289. package/esm/seal/src/validators/any-validator.mjs.map +1 -0
  290. package/esm/seal/src/validators/array-validator.mjs +177 -0
  291. package/esm/seal/src/validators/array-validator.mjs.map +1 -0
  292. package/esm/seal/src/validators/base-validator.mjs +691 -0
  293. package/esm/seal/src/validators/base-validator.mjs.map +1 -0
  294. package/esm/seal/src/validators/boolean-validator.mjs +126 -0
  295. package/esm/seal/src/validators/boolean-validator.mjs.map +1 -0
  296. package/esm/seal/src/validators/computed-validator.mjs +118 -0
  297. package/esm/seal/src/validators/computed-validator.mjs.map +1 -0
  298. package/esm/seal/src/validators/date-validator.mjs +639 -0
  299. package/esm/seal/src/validators/date-validator.mjs.map +1 -0
  300. package/esm/seal/src/validators/discriminated-union-validator.mjs +129 -0
  301. package/esm/seal/src/validators/discriminated-union-validator.mjs.map +1 -0
  302. package/esm/seal/src/validators/float-validator.mjs +18 -0
  303. package/esm/seal/src/validators/float-validator.mjs.map +1 -0
  304. package/esm/seal/src/validators/index.mjs +28 -0
  305. package/esm/seal/src/validators/instanceof-validator.mjs +64 -0
  306. package/esm/seal/src/validators/instanceof-validator.mjs.map +1 -0
  307. package/esm/seal/src/validators/int-validator.mjs +30 -0
  308. package/esm/seal/src/validators/int-validator.mjs.map +1 -0
  309. package/esm/seal/src/validators/lazy-validator.mjs +87 -0
  310. package/esm/seal/src/validators/lazy-validator.mjs.map +1 -0
  311. package/esm/seal/src/validators/literal-validator.mjs +71 -0
  312. package/esm/seal/src/validators/literal-validator.mjs.map +1 -0
  313. package/esm/seal/src/validators/managed-validator.mjs +39 -0
  314. package/esm/seal/src/validators/managed-validator.mjs.map +1 -0
  315. package/esm/seal/src/validators/methods/equality-conditional-methods.mjs +129 -0
  316. package/esm/seal/src/validators/methods/equality-conditional-methods.mjs.map +1 -0
  317. package/esm/seal/src/validators/methods/forbidden-methods.mjs +131 -0
  318. package/esm/seal/src/validators/methods/forbidden-methods.mjs.map +1 -0
  319. package/esm/seal/src/validators/methods/present-methods.mjs +235 -0
  320. package/esm/seal/src/validators/methods/present-methods.mjs.map +1 -0
  321. package/esm/seal/src/validators/methods/required-methods.mjs +347 -0
  322. package/esm/seal/src/validators/methods/required-methods.mjs.map +1 -0
  323. package/esm/seal/src/validators/number-validator.mjs +310 -0
  324. package/esm/seal/src/validators/number-validator.mjs.map +1 -0
  325. package/esm/seal/src/validators/numeric-validator.mjs +27 -0
  326. package/esm/seal/src/validators/numeric-validator.mjs.map +1 -0
  327. package/esm/seal/src/validators/object-validator.mjs +442 -0
  328. package/esm/seal/src/validators/object-validator.mjs.map +1 -0
  329. package/esm/seal/src/validators/primitive-validator.mjs +89 -0
  330. package/esm/seal/src/validators/primitive-validator.mjs.map +1 -0
  331. package/esm/seal/src/validators/record-validator.mjs +112 -0
  332. package/esm/seal/src/validators/record-validator.mjs.map +1 -0
  333. package/esm/seal/src/validators/scalar-validator.mjs +172 -0
  334. package/esm/seal/src/validators/scalar-validator.mjs.map +1 -0
  335. package/esm/seal/src/validators/string-validator.mjs +459 -0
  336. package/esm/seal/src/validators/string-validator.mjs.map +1 -0
  337. package/esm/seal/src/validators/tuple-validator.mjs +134 -0
  338. package/esm/seal/src/validators/tuple-validator.mjs.map +1 -0
  339. package/esm/seal/src/validators/union-validator.mjs +66 -0
  340. package/esm/seal/src/validators/union-validator.mjs.map +1 -0
  341. package/llms-full.txt +5 -1
  342. package/package.json +5 -5
  343. package/skills/send-ad-hoc/SKILL.md +1 -1
  344. package/skills/use-in-app/SKILL.md +4 -0
@@ -0,0 +1,388 @@
1
+ import { __commonJSMin } from "../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_requires_port } from "../requires-port/index.mjs";
3
+ import { require_querystringify } from "../querystringify/index.mjs";
4
+
5
+ //#region ../node_modules/url-parse/index.js
6
+ var require_url_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
+ var required = require_requires_port(), qs = require_querystringify(), controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, CRHTLF = /[\n\r\t]/g, slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, port = /:\d+$/, protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, windowsDriveLetter = /^[a-zA-Z]:/;
8
+ /**
9
+ * Remove control characters and whitespace from the beginning of a string.
10
+ *
11
+ * @param {Object|String} str String to trim.
12
+ * @returns {String} A new string representing `str` stripped of control
13
+ * characters and whitespace from its beginning.
14
+ * @public
15
+ */
16
+ function trimLeft(str) {
17
+ return (str ? str : "").toString().replace(controlOrWhitespace, "");
18
+ }
19
+ /**
20
+ * These are the parse rules for the URL parser, it informs the parser
21
+ * about:
22
+ *
23
+ * 0. The char it Needs to parse, if it's a string it should be done using
24
+ * indexOf, RegExp using exec and NaN means set as current value.
25
+ * 1. The property we should set when parsing this value.
26
+ * 2. Indication if it's backwards or forward parsing, when set as number it's
27
+ * the value of extra chars that should be split off.
28
+ * 3. Inherit from location if non existing in the parser.
29
+ * 4. `toLowerCase` the resulting value.
30
+ */
31
+ var rules = [
32
+ ["#", "hash"],
33
+ ["?", "query"],
34
+ function sanitize(address, url) {
35
+ return isSpecial(url.protocol) ? address.replace(/\\/g, "/") : address;
36
+ },
37
+ ["/", "pathname"],
38
+ [
39
+ "@",
40
+ "auth",
41
+ 1
42
+ ],
43
+ [
44
+ NaN,
45
+ "host",
46
+ void 0,
47
+ 1,
48
+ 1
49
+ ],
50
+ [
51
+ /:(\d*)$/,
52
+ "port",
53
+ void 0,
54
+ 1
55
+ ],
56
+ [
57
+ NaN,
58
+ "hostname",
59
+ void 0,
60
+ 1,
61
+ 1
62
+ ]
63
+ ];
64
+ /**
65
+ * These properties should not be copied or inherited from. This is only needed
66
+ * for all non blob URL's as a blob URL does not include a hash, only the
67
+ * origin.
68
+ *
69
+ * @type {Object}
70
+ * @private
71
+ */
72
+ var ignore = {
73
+ hash: 1,
74
+ query: 1
75
+ };
76
+ /**
77
+ * The location object differs when your code is loaded through a normal page,
78
+ * Worker or through a worker using a blob. And with the blobble begins the
79
+ * trouble as the location object will contain the URL of the blob, not the
80
+ * location of the page where our code is loaded in. The actual origin is
81
+ * encoded in the `pathname` so we can thankfully generate a good "default"
82
+ * location from it so we can generate proper relative URL's again.
83
+ *
84
+ * @param {Object|String} loc Optional default location object.
85
+ * @returns {Object} lolcation object.
86
+ * @public
87
+ */
88
+ function lolcation(loc) {
89
+ var globalVar;
90
+ if (typeof window !== "undefined") globalVar = window;
91
+ else if (typeof global !== "undefined") globalVar = global;
92
+ else if (typeof self !== "undefined") globalVar = self;
93
+ else globalVar = {};
94
+ var location = globalVar.location || {};
95
+ loc = loc || location;
96
+ var finaldestination = {}, type = typeof loc, key;
97
+ if ("blob:" === loc.protocol) finaldestination = new Url(unescape(loc.pathname), {});
98
+ else if ("string" === type) {
99
+ finaldestination = new Url(loc, {});
100
+ for (key in ignore) delete finaldestination[key];
101
+ } else if ("object" === type) {
102
+ for (key in loc) {
103
+ if (key in ignore) continue;
104
+ finaldestination[key] = loc[key];
105
+ }
106
+ if (finaldestination.slashes === void 0) finaldestination.slashes = slashes.test(loc.href);
107
+ }
108
+ return finaldestination;
109
+ }
110
+ /**
111
+ * Check whether a protocol scheme is special.
112
+ *
113
+ * @param {String} The protocol scheme of the URL
114
+ * @return {Boolean} `true` if the protocol scheme is special, else `false`
115
+ * @private
116
+ */
117
+ function isSpecial(scheme) {
118
+ return scheme === "file:" || scheme === "ftp:" || scheme === "http:" || scheme === "https:" || scheme === "ws:" || scheme === "wss:";
119
+ }
120
+ /**
121
+ * @typedef ProtocolExtract
122
+ * @type Object
123
+ * @property {String} protocol Protocol matched in the URL, in lowercase.
124
+ * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
125
+ * @property {String} rest Rest of the URL that is not part of the protocol.
126
+ */
127
+ /**
128
+ * Extract protocol information from a URL with/without double slash ("//").
129
+ *
130
+ * @param {String} address URL we want to extract from.
131
+ * @param {Object} location
132
+ * @return {ProtocolExtract} Extracted information.
133
+ * @private
134
+ */
135
+ function extractProtocol(address, location) {
136
+ address = trimLeft(address);
137
+ address = address.replace(CRHTLF, "");
138
+ location = location || {};
139
+ var match = protocolre.exec(address);
140
+ var protocol = match[1] ? match[1].toLowerCase() : "";
141
+ var forwardSlashes = !!match[2];
142
+ var otherSlashes = !!match[3];
143
+ var slashesCount = 0;
144
+ var rest;
145
+ if (forwardSlashes) if (otherSlashes) {
146
+ rest = match[2] + match[3] + match[4];
147
+ slashesCount = match[2].length + match[3].length;
148
+ } else {
149
+ rest = match[2] + match[4];
150
+ slashesCount = match[2].length;
151
+ }
152
+ else if (otherSlashes) {
153
+ rest = match[3] + match[4];
154
+ slashesCount = match[3].length;
155
+ } else rest = match[4];
156
+ if (protocol === "file:") {
157
+ if (slashesCount >= 2) rest = rest.slice(2);
158
+ } else if (isSpecial(protocol)) rest = match[4];
159
+ else if (protocol) {
160
+ if (forwardSlashes) rest = rest.slice(2);
161
+ } else if (slashesCount >= 2 && isSpecial(location.protocol)) rest = match[4];
162
+ return {
163
+ protocol,
164
+ slashes: forwardSlashes || isSpecial(protocol),
165
+ slashesCount,
166
+ rest
167
+ };
168
+ }
169
+ /**
170
+ * Resolve a relative URL pathname against a base URL pathname.
171
+ *
172
+ * @param {String} relative Pathname of the relative URL.
173
+ * @param {String} base Pathname of the base URL.
174
+ * @return {String} Resolved pathname.
175
+ * @private
176
+ */
177
+ function resolve(relative, base) {
178
+ if (relative === "") return base;
179
+ var path = (base || "/").split("/").slice(0, -1).concat(relative.split("/")), i = path.length, last = path[i - 1], unshift = false, up = 0;
180
+ while (i--) if (path[i] === ".") path.splice(i, 1);
181
+ else if (path[i] === "..") {
182
+ path.splice(i, 1);
183
+ up++;
184
+ } else if (up) {
185
+ if (i === 0) unshift = true;
186
+ path.splice(i, 1);
187
+ up--;
188
+ }
189
+ if (unshift) path.unshift("");
190
+ if (last === "." || last === "..") path.push("");
191
+ return path.join("/");
192
+ }
193
+ /**
194
+ * The actual URL instance. Instead of returning an object we've opted-in to
195
+ * create an actual constructor as it's much more memory efficient and
196
+ * faster and it pleases my OCD.
197
+ *
198
+ * It is worth noting that we should not use `URL` as class name to prevent
199
+ * clashes with the global URL instance that got introduced in browsers.
200
+ *
201
+ * @constructor
202
+ * @param {String} address URL we want to parse.
203
+ * @param {Object|String} [location] Location defaults for relative paths.
204
+ * @param {Boolean|Function} [parser] Parser for the query string.
205
+ * @private
206
+ */
207
+ function Url(address, location, parser) {
208
+ address = trimLeft(address);
209
+ address = address.replace(CRHTLF, "");
210
+ if (!(this instanceof Url)) return new Url(address, location, parser);
211
+ var relative, extracted, parse, instruction, index, key, instructions = rules.slice(), type = typeof location, url = this, i = 0;
212
+ if ("object" !== type && "string" !== type) {
213
+ parser = location;
214
+ location = null;
215
+ }
216
+ if (parser && "function" !== typeof parser) parser = qs.parse;
217
+ location = lolcation(location);
218
+ extracted = extractProtocol(address || "", location);
219
+ relative = !extracted.protocol && !extracted.slashes;
220
+ url.slashes = extracted.slashes || relative && location.slashes;
221
+ url.protocol = extracted.protocol || location.protocol || "";
222
+ address = extracted.rest;
223
+ if (extracted.protocol === "file:" && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url.protocol))) instructions[3] = [/(.*)/, "pathname"];
224
+ for (; i < instructions.length; i++) {
225
+ instruction = instructions[i];
226
+ if (typeof instruction === "function") {
227
+ address = instruction(address, url);
228
+ continue;
229
+ }
230
+ parse = instruction[0];
231
+ key = instruction[1];
232
+ if (parse !== parse) url[key] = address;
233
+ else if ("string" === typeof parse) {
234
+ index = parse === "@" ? address.lastIndexOf(parse) : address.indexOf(parse);
235
+ if (~index) if ("number" === typeof instruction[2]) {
236
+ url[key] = address.slice(0, index);
237
+ address = address.slice(index + instruction[2]);
238
+ } else {
239
+ url[key] = address.slice(index);
240
+ address = address.slice(0, index);
241
+ }
242
+ } else if (index = parse.exec(address)) {
243
+ url[key] = index[1];
244
+ address = address.slice(0, index.index);
245
+ }
246
+ url[key] = url[key] || (relative && instruction[3] ? location[key] || "" : "");
247
+ if (instruction[4]) url[key] = url[key].toLowerCase();
248
+ }
249
+ if (parser) url.query = parser(url.query);
250
+ if (relative && location.slashes && url.pathname.charAt(0) !== "/" && (url.pathname !== "" || location.pathname !== "")) url.pathname = resolve(url.pathname, location.pathname);
251
+ if (url.pathname.charAt(0) !== "/" && isSpecial(url.protocol)) url.pathname = "/" + url.pathname;
252
+ if (!required(url.port, url.protocol)) {
253
+ url.host = url.hostname;
254
+ url.port = "";
255
+ }
256
+ url.username = url.password = "";
257
+ if (url.auth) {
258
+ index = url.auth.indexOf(":");
259
+ if (~index) {
260
+ url.username = url.auth.slice(0, index);
261
+ url.username = encodeURIComponent(decodeURIComponent(url.username));
262
+ url.password = url.auth.slice(index + 1);
263
+ url.password = encodeURIComponent(decodeURIComponent(url.password));
264
+ } else url.username = encodeURIComponent(decodeURIComponent(url.auth));
265
+ url.auth = url.password ? url.username + ":" + url.password : url.username;
266
+ }
267
+ url.origin = url.protocol !== "file:" && isSpecial(url.protocol) && url.host ? url.protocol + "//" + url.host : "null";
268
+ url.href = url.toString();
269
+ }
270
+ /**
271
+ * This is convenience method for changing properties in the URL instance to
272
+ * insure that they all propagate correctly.
273
+ *
274
+ * @param {String} part Property we need to adjust.
275
+ * @param {Mixed} value The newly assigned value.
276
+ * @param {Boolean|Function} fn When setting the query, it will be the function
277
+ * used to parse the query.
278
+ * When setting the protocol, double slash will be
279
+ * removed from the final url if it is true.
280
+ * @returns {URL} URL instance for chaining.
281
+ * @public
282
+ */
283
+ function set(part, value, fn) {
284
+ var url = this;
285
+ switch (part) {
286
+ case "query":
287
+ if ("string" === typeof value && value.length) value = (fn || qs.parse)(value);
288
+ url[part] = value;
289
+ break;
290
+ case "port":
291
+ url[part] = value;
292
+ if (!required(value, url.protocol)) {
293
+ url.host = url.hostname;
294
+ url[part] = "";
295
+ } else if (value) url.host = url.hostname + ":" + value;
296
+ break;
297
+ case "hostname":
298
+ url[part] = value;
299
+ if (url.port) value += ":" + url.port;
300
+ url.host = value;
301
+ break;
302
+ case "host":
303
+ url[part] = value;
304
+ if (port.test(value)) {
305
+ value = value.split(":");
306
+ url.port = value.pop();
307
+ url.hostname = value.join(":");
308
+ } else {
309
+ url.hostname = value;
310
+ url.port = "";
311
+ }
312
+ break;
313
+ case "protocol":
314
+ url.protocol = value.toLowerCase();
315
+ url.slashes = !fn;
316
+ break;
317
+ case "pathname":
318
+ case "hash":
319
+ if (value) {
320
+ var char = part === "pathname" ? "/" : "#";
321
+ url[part] = value.charAt(0) !== char ? char + value : value;
322
+ } else url[part] = value;
323
+ break;
324
+ case "username":
325
+ case "password":
326
+ url[part] = encodeURIComponent(value);
327
+ break;
328
+ case "auth":
329
+ var index = value.indexOf(":");
330
+ if (~index) {
331
+ url.username = value.slice(0, index);
332
+ url.username = encodeURIComponent(decodeURIComponent(url.username));
333
+ url.password = value.slice(index + 1);
334
+ url.password = encodeURIComponent(decodeURIComponent(url.password));
335
+ } else url.username = encodeURIComponent(decodeURIComponent(value));
336
+ }
337
+ for (var i = 0; i < rules.length; i++) {
338
+ var ins = rules[i];
339
+ if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
340
+ }
341
+ url.auth = url.password ? url.username + ":" + url.password : url.username;
342
+ url.origin = url.protocol !== "file:" && isSpecial(url.protocol) && url.host ? url.protocol + "//" + url.host : "null";
343
+ url.href = url.toString();
344
+ return url;
345
+ }
346
+ /**
347
+ * Transform the properties back in to a valid and full URL string.
348
+ *
349
+ * @param {Function} stringify Optional query stringify function.
350
+ * @returns {String} Compiled version of the URL.
351
+ * @public
352
+ */
353
+ function toString(stringify) {
354
+ if (!stringify || "function" !== typeof stringify) stringify = qs.stringify;
355
+ var query, url = this, host = url.host, protocol = url.protocol;
356
+ if (protocol && protocol.charAt(protocol.length - 1) !== ":") protocol += ":";
357
+ var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? "//" : "");
358
+ if (url.username) {
359
+ result += url.username;
360
+ if (url.password) result += ":" + url.password;
361
+ result += "@";
362
+ } else if (url.password) {
363
+ result += ":" + url.password;
364
+ result += "@";
365
+ } else if (url.protocol !== "file:" && isSpecial(url.protocol) && !host && url.pathname !== "/") result += "@";
366
+ if (host[host.length - 1] === ":" || port.test(url.hostname) && !url.port) host += ":";
367
+ result += host + url.pathname;
368
+ query = "object" === typeof url.query ? stringify(url.query) : url.query;
369
+ if (query) result += "?" !== query.charAt(0) ? "?" + query : query;
370
+ if (url.hash) result += url.hash;
371
+ return result;
372
+ }
373
+ Url.prototype = {
374
+ set,
375
+ toString
376
+ };
377
+ Url.extractProtocol = extractProtocol;
378
+ Url.location = lolcation;
379
+ Url.trimLeft = trimLeft;
380
+ Url.qs = qs;
381
+ module.exports = Url;
382
+ }));
383
+
384
+ //#endregion
385
+ export default require_url_parse();
386
+
387
+ export { require_url_parse };
388
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../node_modules/url-parse/index.js"],"sourcesContent":["'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CAEA,IAAI,oCACA,+BACA,sBAAsB,8EACtB,SAAS,aACT,UAAU,iCACV,OAAO,SACP,aAAa,oDACb,qBAAqB;;;;;;;;;CAUzB,SAAS,SAAS,KAAK;EACrB,QAAQ,MAAM,MAAM,GAAE,CAAE,SAAS,CAAC,CAAC,QAAQ,qBAAqB,EAAE;CACpE;;;;;;;;;;;;;CAcA,IAAI,QAAQ;EACV,CAAC,KAAK,MAAM;EACZ,CAAC,KAAK,OAAO;EACb,SAAS,SAAS,SAAS,KAAK;GAC9B,OAAO,UAAU,IAAI,QAAQ,IAAI,QAAQ,QAAQ,OAAO,GAAG,IAAI;EACjE;EACA,CAAC,KAAK,UAAU;EAChB;GAAC;GAAK;GAAQ;EAAC;EACf;GAAC;GAAK;GAAQ;GAAW;GAAG;EAAC;EAC7B;GAAC;GAAW;GAAQ;GAAW;EAAC;EAChC;GAAC;GAAK;GAAY;GAAW;GAAG;EAAC;CACnC;;;;;;;;;CAUA,IAAI,SAAS;EAAE,MAAM;EAAG,OAAO;CAAE;;;;;;;;;;;;;CAcjC,SAAS,UAAU,KAAK;EACtB,IAAI;EAEJ,IAAI,OAAO,WAAW,aAAa,YAAY;OAC1C,IAAI,OAAO,WAAW,aAAa,YAAY;OAC/C,IAAI,OAAO,SAAS,aAAa,YAAY;OAC7C,YAAY,CAAC;EAElB,IAAI,WAAW,UAAU,YAAY,CAAC;EACtC,MAAM,OAAO;EAEb,IAAI,mBAAmB,CAAC,GACpB,OAAO,OAAO,KACd;EAEJ,IAAI,YAAY,IAAI,UAClB,mBAAmB,IAAI,IAAI,SAAS,IAAI,QAAQ,GAAG,CAAC,CAAC;OAChD,IAAI,aAAa,MAAM;GAC5B,mBAAmB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WAAW,UAAU,IAAI,QAAQ,KAAK,IAAI,OACpE,IAAI,WAAU,OAAM,IAAI,OACxB;EAEJ,IAAI,OAAO,IAAI,SAAS;EAExB,OAAO;CACT;;;;;;;;CASA,SAAS,SAAS,WAAW;EAC3B,IAAI,CAAC,aAAa,eAAe,OAAO,WAAW,YAAY,GAAG;EAElE,IAAI,OACA,MAAM,MACN,OAAO,IAAI,MACX,WAAW,IAAI;EAEnB,IAAI,YAAY,SAAS,OAAO,SAAS,SAAS,CAAC,MAAM,KAAK,YAAY;EAE1E,IAAI,SACF,YACE,IAAI,YAAY,IAAI,WAAY,UAAU,IAAI,QAAQ,IAAI,OAAO;EAErE,IAAI,IAAI,UAAU;GAChB,UAAU,IAAI;GACd,IAAI,IAAI,UAAU,UAAU,MAAK,IAAI;GACrC,UAAU;EACZ,OAAO,IAAI,IAAI,UAAU;GACvB,UAAU,MAAK,IAAI;GACnB,UAAU;EACZ,OAAO,IACL,IAAI,aAAa,WACjB,UAAU,IAAI,QAAQ,KACtB,CAAC,QACD,IAAI,aAAa,KAMjB,UAAU;EAQZ,IAAI,KAAK,KAAK,SAAS,OAAO,OAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,CAAC,IAAI,MACpE,QAAQ;EAGV,UAAU,OAAO,IAAI;EAErB,QAAQ,aAAa,OAAO,IAAI,QAAQ,UAAU,IAAI,KAAK,IAAI,IAAI;EACnE,IAAI,OAAO,UAAU,QAAQ,MAAM,OAAO,CAAC,IAAI,MAAK,QAAQ;EAE5D,IAAI,IAAI,MAAM,UAAU,IAAI;EAE5B,OAAO;CACT;CAEA,IAAI,YAAY;EAAO;EAAe;CAAS;CAM/C,IAAI,kBAAkB;CACtB,IAAI,WAAW;CACf,IAAI,WAAW;CACf,IAAI,KAAK;CAET,OAAO,UAAU"}
@@ -21,7 +21,7 @@ Or with your preferred package manager:
21
21
  async function loadHerald() {
22
22
  if (heraldModule) return heraldModule;
23
23
  try {
24
- heraldModule = await import("@warlock.js/herald");
24
+ heraldModule = await import("../herald/src/index.mjs");
25
25
  return heraldModule;
26
26
  } catch {
27
27
  throw new Error(INSTALL_INSTRUCTIONS);
@@ -0,0 +1,15 @@
1
+ //#region ../seal/src/config.ts
2
+ /**
3
+ * Global Seal configuration
4
+ */
5
+ const config = { firstErrorOnly: true };
6
+ /**
7
+ * Get current Seal configuration
8
+ */
9
+ function getSealConfig() {
10
+ return config;
11
+ }
12
+
13
+ //#endregion
14
+ export { getSealConfig };
15
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../../../../../../seal/src/config.ts"],"sourcesContent":["/**\r\n * Seal Configuration\r\n *\r\n * Global configuration for the Seal validation library\r\n */\r\n\r\nimport type { AttributeTranslation, RuleTranslation } from \"./types\";\r\n\r\nexport type TranslateRuleCallback = (\r\n ruleTranslation: RuleTranslation,\r\n) => string;\r\n\r\nexport type TranslateAttributeCallback = (\r\n attributeTranslation: AttributeTranslation,\r\n) => string;\r\n\r\nexport type SealConfig = {\r\n /**\r\n * Translation function for error messages\r\n * Default: returns the key with attributes replaced\r\n */\r\n translateRule?: TranslateRuleCallback;\r\n /**\r\n * Translation function for attribute messages\r\n */\r\n translateAttribute?: TranslateAttributeCallback;\r\n\r\n /**\r\n * Default to first error only in validation\r\n * Default: true\r\n */\r\n firstErrorOnly?: boolean;\r\n};\r\n\r\n/**\r\n * Global Seal configuration\r\n */\r\nconst config: SealConfig = {\r\n firstErrorOnly: true,\r\n};\r\n\r\n/**\r\n * Configure Seal globally\r\n *\r\n * @example\r\n * ```ts\r\n * import { configureSeal } from \"@warlock.js/seal\";\r\n * import { trans } from \"@mongez/localization\";\r\n *\r\n * configureSeal({\r\n * translateRule: (ruleTranslation) => trans(`validation.${ruleTranslation.rule.name}`, ruleTranslation.attributes),\r\n * translateAttribute: (attributeTranslation) => trans(`validation.attributes.${attributeTranslation.rule.name}.${attributeTranslation.attribute}`, attributeTranslation.context.allValues),\r\n * });\r\n * ```\r\n */\r\nexport function configureSeal(options: Partial<SealConfig>): void {\r\n Object.assign(config, options);\r\n}\r\n\r\n/**\r\n * Get current Seal configuration\r\n */\r\nexport function getSealConfig(): SealConfig {\r\n return config;\r\n}\r\n\r\n/**\r\n * Reset configuration to defaults\r\n */\r\nexport function resetSealConfig(): void {\r\n delete config.translateRule;\r\n delete config.translateAttribute;\r\n\r\n config.firstErrorOnly = true;\r\n}\r\n"],"mappings":";;;;AAqCA,MAAM,SAAqB,EACzB,gBAAgB,KAClB;;;;AAuBA,SAAgB,gBAA4B;CAC1C,OAAO;AACT"}
@@ -0,0 +1,4 @@
1
+ import { validate } from "./validate.mjs";
2
+ import { v } from "./validators.mjs";
3
+
4
+ export { };
@@ -0,0 +1,34 @@
1
+ import { getSealConfig } from "../config.mjs";
2
+
3
+ //#region ../seal/src/factory/validate.ts
4
+ /**
5
+ * Validate data against a schema
6
+ */
7
+ const validate = async (schema, data, { context: extendedContext, ...configurations } = getSealConfig() || {}) => {
8
+ const context = {
9
+ allValues: data,
10
+ parent: null,
11
+ value: data,
12
+ key: "",
13
+ path: "",
14
+ context: extendedContext,
15
+ rootContext: extendedContext,
16
+ translateRule(ruleTranslation) {
17
+ return configurations.translateRule?.(ruleTranslation) ?? "";
18
+ },
19
+ translateAttribute(attributeTranslation) {
20
+ return configurations.translateAttribute?.(attributeTranslation) ?? "";
21
+ },
22
+ configurations
23
+ };
24
+ const result = await schema.validate(data, context);
25
+ if (!result.isValid) return {
26
+ ...result,
27
+ data: void 0
28
+ };
29
+ return result;
30
+ };
31
+
32
+ //#endregion
33
+ export { validate };
34
+ //# sourceMappingURL=validate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.mjs","names":[],"sources":["../../../../../../../../../seal/src/factory/validate.ts"],"sourcesContent":["import { getSealConfig } from \"../config\";\r\nimport type { SchemaContext, ValidationResult } from \"../types\";\r\nimport type { BaseValidator } from \"../validators\";\r\nimport { type ValidateOptions } from \"./validators\";\r\n\r\n/**\r\n * Validate data against a schema\r\n */\r\nexport const validate = async <T extends BaseValidator>(\r\n schema: T,\r\n data: any, // Temporarily use any - will fix type inference\r\n { context: extendedContext, ...configurations }: ValidateOptions = getSealConfig() || {},\r\n): Promise<ValidationResult> => {\r\n const context: SchemaContext = {\r\n allValues: data,\r\n parent: null,\r\n value: data,\r\n key: \"\",\r\n path: \"\",\r\n context: extendedContext,\r\n rootContext: extendedContext,\r\n translateRule(ruleTranslation) {\r\n return configurations.translateRule?.(ruleTranslation) ?? \"\";\r\n },\r\n translateAttribute(attributeTranslation) {\r\n return configurations.translateAttribute?.(attributeTranslation) ?? \"\";\r\n },\r\n configurations,\r\n };\r\n\r\n const result = await schema.validate(data, context);\r\n\r\n // A failed validation never hands back the input it just rejected.\r\n //\r\n // `object` used to return the raw input on failure while `discriminatedUnion`\r\n // returned `undefined` — the same call shape with two different contracts.\r\n // The object behaviour was the dangerous one: validating an outbound DTO\r\n // specifically to keep internal fields out of a response, then doing the\r\n // natural `const { data } = await v.validate(dto, record); reply.send(data)`,\r\n // shipped every field the schema existed to exclude. A guard that returns the\r\n // unsafe value on failure reads as safe and isn't.\r\n if (!result.isValid) {\r\n return { ...result, data: undefined };\r\n }\r\n\r\n return result;\r\n};\r\n"],"mappings":";;;;;;AAQA,MAAa,WAAW,OACtB,QACA,MACA,EAAE,SAAS,iBAAiB,GAAG,mBAAoC,cAAc,KAAK,CAAC,MACzD;CAC9B,MAAM,UAAyB;EAC7B,WAAW;EACX,QAAQ;EACR,OAAO;EACP,KAAK;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,cAAc,iBAAiB;GAC7B,OAAO,eAAe,gBAAgB,eAAe,KAAK;EAC5D;EACA,mBAAmB,sBAAsB;GACvC,OAAO,eAAe,qBAAqB,oBAAoB,KAAK;EACtE;EACA;CACF;CAEA,MAAM,SAAS,MAAM,OAAO,SAAS,MAAM,OAAO;CAWlD,IAAI,CAAC,OAAO,SACV,OAAO;EAAE,GAAG;EAAQ,MAAM;CAAU;CAGtC,OAAO;AACT"}
@@ -0,0 +1,132 @@
1
+ import { validate } from "./validate.mjs";
2
+ import { AnyValidator } from "../validators/any-validator.mjs";
3
+ import { ArrayValidator } from "../validators/array-validator.mjs";
4
+ import "../validators/methods/equality-conditional-methods.mjs";
5
+ import "../validators/methods/forbidden-methods.mjs";
6
+ import "../validators/methods/present-methods.mjs";
7
+ import "../validators/methods/required-methods.mjs";
8
+ import { BooleanValidator } from "../validators/boolean-validator.mjs";
9
+ import { ComputedValidator } from "../validators/computed-validator.mjs";
10
+ import { DateValidator } from "../validators/date-validator.mjs";
11
+ import { LiteralValidator } from "../validators/literal-validator.mjs";
12
+ import { DiscriminatedUnionValidator } from "../validators/discriminated-union-validator.mjs";
13
+ import { NumberValidator } from "../validators/number-validator.mjs";
14
+ import { FloatValidator } from "../validators/float-validator.mjs";
15
+ import { InstanceOfValidator } from "../validators/instanceof-validator.mjs";
16
+ import { IntValidator } from "../validators/int-validator.mjs";
17
+ import { LazyValidator } from "../validators/lazy-validator.mjs";
18
+ import { ManagedValidator } from "../validators/managed-validator.mjs";
19
+ import { NumericValidator } from "../validators/numeric-validator.mjs";
20
+ import { ObjectValidator } from "../validators/object-validator.mjs";
21
+ import { RecordValidator } from "../validators/record-validator.mjs";
22
+ import { ScalarValidator } from "../validators/scalar-validator.mjs";
23
+ import { StringValidator } from "../validators/string-validator.mjs";
24
+ import { TupleValidator } from "../validators/tuple-validator.mjs";
25
+ import { UnionValidator } from "../validators/union-validator.mjs";
26
+
27
+ //#region ../seal/src/factory/validators.ts
28
+ /**
29
+ * Seal factory object - creates instances of validators
30
+ *
31
+ * Use 'v' to create validation schemas (seals) for your data
32
+ */
33
+ const v = {
34
+ /** Create an object validator */
35
+ object: (schema, errorMessage) => new ObjectValidator(schema, errorMessage),
36
+ /** Create an any validator */
37
+ any: () => new AnyValidator(),
38
+ /** Create an array validator */
39
+ array: (validator, errorMessage) => new ArrayValidator(validator, errorMessage),
40
+ /** Create a record validator - object with dynamic keys and consistent value types */
41
+ record: (validator, errorMessage) => new RecordValidator(validator || v.any(), errorMessage),
42
+ /** Create a tuple validator - fixed-length array with position-specific types */
43
+ tuple: (validators, errorMessage) => new TupleValidator(validators, errorMessage),
44
+ /** Create a date validator */
45
+ date: (errorMessage) => new DateValidator(errorMessage),
46
+ /**
47
+ * Create a literal validator — narrows to the union of given literal values
48
+ *
49
+ * @example
50
+ * v.literal("items") // type: "items"
51
+ * v.literal("draft", "published") // type: "draft" | "published"
52
+ * v.literal(1, 2, 3) // type: 1 | 2 | 3
53
+ */
54
+ literal: (...values) => new LiteralValidator(values),
55
+ /**
56
+ * Create an instanceof validator — value must be `instanceof` the constructor
57
+ *
58
+ * @example
59
+ * v.instanceof(File) // type: File
60
+ * v.instanceof(Buffer) // type: Buffer
61
+ * v.instanceof(MyClass) // type: MyClass
62
+ */
63
+ instanceof: (ctor, errorMessage) => new InstanceOfValidator(ctor, errorMessage),
64
+ /**
65
+ * Create a lazy validator — defers resolution of the inner validator until
66
+ * validate-time. Use for recursive or forward-referenced schemas.
67
+ *
68
+ * @example
69
+ * type Category = { name: string; children: Category[] };
70
+ *
71
+ * const category: ObjectValidator<...> = v.object({
72
+ * name: v.string(),
73
+ * children: v.array(v.lazy(() => category)),
74
+ * });
75
+ */
76
+ lazy: (thunk) => new LazyValidator(thunk),
77
+ /** Create a string validator */
78
+ string: (errorMessage) => new StringValidator(errorMessage),
79
+ /** Create an email validator */
80
+ email: (emailErrorMessage, errorMessage) => new StringValidator(errorMessage).email(emailErrorMessage),
81
+ /**
82
+ * Create an enum validator — preserves the literal union of accepted
83
+ * values in the inferred Standard Schema output.
84
+ *
85
+ * Two input shapes:
86
+ * - Tuple of literals: `v.enum(["draft", "published"])` →
87
+ * `StandardSchemaV1<"draft" | "published">`
88
+ * - TypeScript enum object: `v.enum(Status)` →
89
+ * `StandardSchemaV1<Status[keyof Status]>`
90
+ *
91
+ * Implementation is loosely typed; the public `ValidatorV.enum`
92
+ * surface declares the precise overloads.
93
+ */
94
+ enum: ((values, errorMessage) => Array.isArray(values) ? new StringValidator().oneOf(values, errorMessage) : new ScalarValidator().enum(values, errorMessage)),
95
+ /** Create a number validator */
96
+ number: (errorMessage) => new NumberValidator(errorMessage),
97
+ /** Create a numeric validator */
98
+ numeric: (errorMessage) => new NumericValidator(errorMessage),
99
+ /** Create an integer validator */
100
+ int: (errorMessage) => new IntValidator(errorMessage),
101
+ /** Create a float validator */
102
+ float: (errorMessage) => new FloatValidator(errorMessage),
103
+ /** Create a boolean validator */
104
+ boolean: (errorMessage) => new BooleanValidator(errorMessage),
105
+ /** Create a scalar validator */
106
+ scalar: (errorMessage) => new ScalarValidator(errorMessage),
107
+ /** Create a union validator - validates against multiple types */
108
+ union: (validators, errorMessage) => new UnionValidator().union(validators, errorMessage),
109
+ /**
110
+ * Create a discriminated union — routes payloads by a shared literal
111
+ * discriminator field. Each branch must be a `v.object(...)` with the
112
+ * discriminator typed as `v.literal(...)`.
113
+ *
114
+ * @example
115
+ * const email = v.object({ type: v.literal("email"), email: v.string().email() });
116
+ * const sms = v.object({ type: v.literal("sms"), phone: v.string() });
117
+ * const notif = v.discriminatedUnion("type", [email, sms]);
118
+ * // type T = Infer<typeof notif>;
119
+ * // → { type: "email", email: string } | { type: "sms", phone: string }
120
+ */
121
+ discriminatedUnion: (discriminator, validators) => new DiscriminatedUnionValidator(discriminator, validators),
122
+ /** Create a computed field validator - derives value from other validated fields */
123
+ computed: (callback, resultValidator) => new ComputedValidator(callback, resultValidator),
124
+ /** Create a managed field validator - framework-injected value */
125
+ managed: (callback, resultValidator) => new ManagedValidator(callback, resultValidator),
126
+ /** Validate data against a schema */
127
+ validate
128
+ };
129
+
130
+ //#endregion
131
+ export { v };
132
+ //# sourceMappingURL=validators.mjs.map