@bgord/bun 1.14.7 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/dist/ab-variant-selector.service.js +2 -2
  2. package/dist/ab-variant-selector.service.js.map +1 -1
  3. package/dist/ab-variant-weight.vo.d.ts +3 -3
  4. package/dist/ab-variant-weight.vo.d.ts.map +1 -1
  5. package/dist/ab-variant-weight.vo.js +4 -8
  6. package/dist/ab-variant-weight.vo.js.map +1 -1
  7. package/dist/basic-auth-password.vo.d.ts +3 -3
  8. package/dist/basic-auth-password.vo.d.ts.map +1 -1
  9. package/dist/basic-auth-password.vo.js +4 -8
  10. package/dist/basic-auth-password.vo.js.map +1 -1
  11. package/dist/basic-auth-username.vo.d.ts +3 -3
  12. package/dist/basic-auth-username.vo.d.ts.map +1 -1
  13. package/dist/basic-auth-username.vo.js +4 -8
  14. package/dist/basic-auth-username.vo.js.map +1 -1
  15. package/dist/binary.vo.d.ts +3 -5
  16. package/dist/binary.vo.d.ts.map +1 -1
  17. package/dist/binary.vo.js +6 -16
  18. package/dist/binary.vo.js.map +1 -1
  19. package/dist/client-ip.vo.d.ts +3 -3
  20. package/dist/client-ip.vo.d.ts.map +1 -1
  21. package/dist/client-ip.vo.js +4 -3
  22. package/dist/client-ip.vo.js.map +1 -1
  23. package/dist/client-user-agent.vo.d.ts +3 -3
  24. package/dist/client-user-agent.vo.d.ts.map +1 -1
  25. package/dist/client-user-agent.vo.js +4 -7
  26. package/dist/client-user-agent.vo.js.map +1 -1
  27. package/dist/client.vo.d.ts.map +1 -1
  28. package/dist/client.vo.js +10 -3
  29. package/dist/client.vo.js.map +1 -1
  30. package/dist/command-envelope.d.ts +4 -4
  31. package/dist/commit-sha-value.vo.d.ts +3 -3
  32. package/dist/commit-sha-value.vo.d.ts.map +1 -1
  33. package/dist/commit-sha-value.vo.js +4 -7
  34. package/dist/commit-sha-value.vo.js.map +1 -1
  35. package/dist/commit-sha.vo.d.ts.map +1 -1
  36. package/dist/commit-sha.vo.js +2 -1
  37. package/dist/commit-sha.vo.js.map +1 -1
  38. package/dist/correlation-id.vo.d.ts +3 -3
  39. package/dist/correlation-id.vo.d.ts.map +1 -1
  40. package/dist/correlation.middleware.d.ts.map +1 -1
  41. package/dist/correlation.middleware.js +3 -2
  42. package/dist/correlation.middleware.js.map +1 -1
  43. package/dist/encryption-key-value.vo.d.ts +3 -3
  44. package/dist/encryption-key-value.vo.d.ts.map +1 -1
  45. package/dist/encryption-key-value.vo.js +4 -7
  46. package/dist/encryption-key-value.vo.js.map +1 -1
  47. package/dist/encryption-key.vo.d.ts.map +1 -1
  48. package/dist/encryption-key.vo.js +2 -1
  49. package/dist/encryption-key.vo.js.map +1 -1
  50. package/dist/environment-loader-encrypted.adapter.d.ts +1 -1
  51. package/dist/environment-loader-encrypted.adapter.d.ts.map +1 -1
  52. package/dist/environment-loader-encrypted.adapter.js +8 -1
  53. package/dist/environment-loader-encrypted.adapter.js.map +1 -1
  54. package/dist/environment-loader-noop.adapter.d.ts +1 -1
  55. package/dist/environment-loader-noop.adapter.d.ts.map +1 -1
  56. package/dist/environment-loader-noop.adapter.js +8 -4
  57. package/dist/environment-loader-noop.adapter.js.map +1 -1
  58. package/dist/environment-loader-process-safe.adapter.d.ts +1 -1
  59. package/dist/environment-loader-process-safe.adapter.d.ts.map +1 -1
  60. package/dist/environment-loader-process-safe.adapter.js +12 -3
  61. package/dist/environment-loader-process-safe.adapter.js.map +1 -1
  62. package/dist/environment-loader-process.adapter.d.ts +1 -1
  63. package/dist/environment-loader-process.adapter.d.ts.map +1 -1
  64. package/dist/environment-loader-process.adapter.js +8 -1
  65. package/dist/environment-loader-process.adapter.js.map +1 -1
  66. package/dist/environment-loader.port.d.ts +5 -2
  67. package/dist/environment-loader.port.d.ts.map +1 -1
  68. package/dist/environment-loader.port.js +1 -1
  69. package/dist/environment-loader.port.js.map +1 -1
  70. package/dist/event-envelope.d.ts +8 -8
  71. package/dist/event-envelope.d.ts.map +1 -1
  72. package/dist/event-envelope.js +3 -3
  73. package/dist/event-envelope.js.map +1 -1
  74. package/dist/event-store-with-logger.adapter.d.ts.map +1 -1
  75. package/dist/event-store-with-logger.adapter.js +1 -0
  76. package/dist/event-store-with-logger.adapter.js.map +1 -1
  77. package/dist/event-stream.vo.d.ts +3 -3
  78. package/dist/event-stream.vo.d.ts.map +1 -1
  79. package/dist/event-stream.vo.js +2 -5
  80. package/dist/event-stream.vo.js.map +1 -1
  81. package/dist/event-validator-registry.adapter.d.ts +12 -0
  82. package/dist/event-validator-registry.adapter.d.ts.map +1 -0
  83. package/dist/event-validator-registry.adapter.js +32 -0
  84. package/dist/event-validator-registry.adapter.js.map +1 -0
  85. package/dist/event-validator-registry.port.d.ts +3 -0
  86. package/dist/event-validator-registry.port.d.ts.map +1 -1
  87. package/dist/event-validator-registry.port.js +1 -1
  88. package/dist/event-validator-registry.port.js.map +1 -1
  89. package/dist/file-draft-zip.service.d.ts.map +1 -1
  90. package/dist/file-draft-zip.service.js +2 -1
  91. package/dist/file-draft-zip.service.js.map +1 -1
  92. package/dist/hash-bucket.vo.js +1 -1
  93. package/dist/hash-bucket.vo.js.map +1 -1
  94. package/dist/hash-value.vo.d.ts +3 -3
  95. package/dist/hash-value.vo.d.ts.map +1 -1
  96. package/dist/hash-value.vo.js +4 -7
  97. package/dist/hash-value.vo.js.map +1 -1
  98. package/dist/hash.vo.d.ts.map +1 -1
  99. package/dist/hash.vo.js +2 -1
  100. package/dist/hash.vo.js.map +1 -1
  101. package/dist/hcaptcha-secret-key.vo.d.ts +3 -3
  102. package/dist/hcaptcha-secret-key.vo.d.ts.map +1 -1
  103. package/dist/hcaptcha-secret-key.vo.js +4 -7
  104. package/dist/hcaptcha-secret-key.vo.js.map +1 -1
  105. package/dist/hcaptcha-site-key.vo.d.ts +3 -3
  106. package/dist/hcaptcha-site-key.vo.d.ts.map +1 -1
  107. package/dist/hcaptcha-site-key.vo.js +4 -7
  108. package/dist/hcaptcha-site-key.vo.js.map +1 -1
  109. package/dist/healthcheck-hono.handler.d.ts +3 -3
  110. package/dist/healthcheck.handler.d.ts +3 -3
  111. package/dist/healthcheck.handler.d.ts.map +1 -1
  112. package/dist/healthcheck.handler.js +4 -4
  113. package/dist/healthcheck.handler.js.map +1 -1
  114. package/dist/http-logger.middleware.js +1 -1
  115. package/dist/http-logger.middleware.js.map +1 -1
  116. package/dist/i18n.service.d.ts +2 -1
  117. package/dist/i18n.service.d.ts.map +1 -1
  118. package/dist/i18n.service.js +2 -1
  119. package/dist/i18n.service.js.map +1 -1
  120. package/dist/image-info-noop.adapter.d.ts.map +1 -1
  121. package/dist/image-info-noop.adapter.js +3 -2
  122. package/dist/image-info-noop.adapter.js.map +1 -1
  123. package/dist/image-info-sharp.adapter.d.ts.map +1 -1
  124. package/dist/image-info-sharp.adapter.js +4 -3
  125. package/dist/image-info-sharp.adapter.js.map +1 -1
  126. package/dist/in-flight-requests-tracker.service.d.ts.map +1 -1
  127. package/dist/in-flight-requests-tracker.service.js +2 -2
  128. package/dist/in-flight-requests-tracker.service.js.map +1 -1
  129. package/dist/index.d.ts +1 -2
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +1 -2
  132. package/dist/index.js.map +1 -1
  133. package/dist/logger.port.d.ts +1 -3
  134. package/dist/logger.port.d.ts.map +1 -1
  135. package/dist/logger.port.js +0 -2
  136. package/dist/logger.port.js.map +1 -1
  137. package/dist/mailer-content-html.vo.d.ts +3 -3
  138. package/dist/mailer-content-html.vo.d.ts.map +1 -1
  139. package/dist/mailer-content-html.vo.js +4 -8
  140. package/dist/mailer-content-html.vo.js.map +1 -1
  141. package/dist/mailer-subject.vo.d.ts +3 -3
  142. package/dist/mailer-subject.vo.d.ts.map +1 -1
  143. package/dist/mailer-subject.vo.js +4 -8
  144. package/dist/mailer-subject.vo.js.map +1 -1
  145. package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.d.ts.map +1 -1
  146. package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.js +2 -1
  147. package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.js.map +1 -1
  148. package/dist/modules/history/events/HISTORY_CLEARED_EVENT.d.ts +14 -14
  149. package/dist/modules/history/events/HISTORY_CLEARED_EVENT.d.ts.map +1 -1
  150. package/dist/modules/history/events/HISTORY_CLEARED_EVENT.js +4 -4
  151. package/dist/modules/history/events/HISTORY_CLEARED_EVENT.js.map +1 -1
  152. package/dist/modules/history/events/HISTORY_POPULATED_EVENT.d.ts +17 -17
  153. package/dist/modules/history/events/HISTORY_POPULATED_EVENT.d.ts.map +1 -1
  154. package/dist/modules/history/events/HISTORY_POPULATED_EVENT.js +4 -4
  155. package/dist/modules/history/events/HISTORY_POPULATED_EVENT.js.map +1 -1
  156. package/dist/modules/history/value-objects/history-created-at.d.ts +3 -3
  157. package/dist/modules/history/value-objects/history-created-at.d.ts.map +1 -1
  158. package/dist/modules/history/value-objects/history-id.d.ts +1 -1
  159. package/dist/modules/history/value-objects/history-id.d.ts.map +1 -1
  160. package/dist/modules/history/value-objects/history-operation.d.ts +2 -2
  161. package/dist/modules/history/value-objects/history-operation.d.ts.map +1 -1
  162. package/dist/modules/history/value-objects/history-operation.js +2 -5
  163. package/dist/modules/history/value-objects/history-operation.js.map +1 -1
  164. package/dist/modules/history/value-objects/history-payload.d.ts +7 -3
  165. package/dist/modules/history/value-objects/history-payload.d.ts.map +1 -1
  166. package/dist/modules/history/value-objects/history-payload.js +8 -6
  167. package/dist/modules/history/value-objects/history-payload.js.map +1 -1
  168. package/dist/modules/history/value-objects/history-subject.d.ts +3 -3
  169. package/dist/modules/history/value-objects/history-subject.d.ts.map +1 -1
  170. package/dist/modules/history/value-objects/history-subject.js +2 -5
  171. package/dist/modules/history/value-objects/history-subject.js.map +1 -1
  172. package/dist/modules/history/value-objects/history.d.ts +21 -17
  173. package/dist/modules/history/value-objects/history.d.ts.map +1 -1
  174. package/dist/modules/history/value-objects/history.js +3 -3
  175. package/dist/modules/history/value-objects/history.js.map +1 -1
  176. package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.d.ts.map +1 -1
  177. package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.js +2 -1
  178. package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.js.map +1 -1
  179. package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.d.ts +12 -12
  180. package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.d.ts.map +1 -1
  181. package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.js +4 -4
  182. package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.js.map +1 -1
  183. package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.d.ts +15 -15
  184. package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.d.ts.map +1 -1
  185. package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.js +4 -4
  186. package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.js.map +1 -1
  187. package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.d.ts +14 -14
  188. package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.d.ts.map +1 -1
  189. package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.js +4 -4
  190. package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.js.map +1 -1
  191. package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.d.ts +14 -14
  192. package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.d.ts.map +1 -1
  193. package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.js +4 -4
  194. package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.js.map +1 -1
  195. package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.d.ts +21 -21
  196. package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.d.ts.map +1 -1
  197. package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.js +7 -7
  198. package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.js.map +1 -1
  199. package/dist/modules/system/services/passage-of-time-hourly.service.d.ts.map +1 -1
  200. package/dist/modules/system/services/passage-of-time-hourly.service.js +2 -1
  201. package/dist/modules/system/services/passage-of-time-hourly.service.js.map +1 -1
  202. package/dist/modules/system/services/passage-of-time-minute.service.d.ts.map +1 -1
  203. package/dist/modules/system/services/passage-of-time-minute.service.js +2 -1
  204. package/dist/modules/system/services/passage-of-time-minute.service.js.map +1 -1
  205. package/dist/node-env.vo.d.ts +0 -5
  206. package/dist/node-env.vo.d.ts.map +1 -1
  207. package/dist/node-env.vo.js +0 -3
  208. package/dist/node-env.vo.js.map +1 -1
  209. package/dist/nonce-provider-crypto.adapter.d.ts.map +1 -1
  210. package/dist/nonce-provider-crypto.adapter.js +2 -1
  211. package/dist/nonce-provider-crypto.adapter.js.map +1 -1
  212. package/dist/nonce-provider-noop.adapter.d.ts.map +1 -1
  213. package/dist/nonce-provider-noop.adapter.js +2 -1
  214. package/dist/nonce-provider-noop.adapter.js.map +1 -1
  215. package/dist/nonce-value.vo.d.ts +3 -3
  216. package/dist/nonce-value.vo.d.ts.map +1 -1
  217. package/dist/nonce-value.vo.js +4 -7
  218. package/dist/nonce-value.vo.js.map +1 -1
  219. package/dist/port.vo.d.ts +3 -3
  220. package/dist/port.vo.d.ts.map +1 -1
  221. package/dist/port.vo.js +4 -9
  222. package/dist/port.vo.js.map +1 -1
  223. package/dist/prerequisite-verifier-outside-connectivity.adapter.d.ts.map +1 -1
  224. package/dist/prerequisite-verifier-outside-connectivity.adapter.js +2 -1
  225. package/dist/prerequisite-verifier-outside-connectivity.adapter.js.map +1 -1
  226. package/dist/recaptcha-secret-key.vo.d.ts +3 -3
  227. package/dist/recaptcha-secret-key.vo.d.ts.map +1 -1
  228. package/dist/recaptcha-secret-key.vo.js +4 -7
  229. package/dist/recaptcha-secret-key.vo.js.map +1 -1
  230. package/dist/recaptcha-site-key.vo.d.ts +3 -3
  231. package/dist/recaptcha-site-key.vo.d.ts.map +1 -1
  232. package/dist/recaptcha-site-key.vo.js +4 -7
  233. package/dist/recaptcha-site-key.vo.js.map +1 -1
  234. package/dist/redactor-error-cause-depth-limit.strategy.js +2 -2
  235. package/dist/redactor-error-cause-depth-limit.strategy.js.map +1 -1
  236. package/dist/redactor-metadata-compact-array.strategy.d.ts.map +1 -1
  237. package/dist/redactor-metadata-compact-array.strategy.js +1 -1
  238. package/dist/redactor-metadata-compact-array.strategy.js.map +1 -1
  239. package/dist/redactor-metadata-compact-object.strategy.d.ts.map +1 -1
  240. package/dist/redactor-metadata-compact-object.strategy.js +1 -1
  241. package/dist/redactor-metadata-compact-object.strategy.js.map +1 -1
  242. package/dist/remote-file-storage-disk.adapter.d.ts.map +1 -1
  243. package/dist/remote-file-storage-disk.adapter.js +2 -1
  244. package/dist/remote-file-storage-disk.adapter.js.map +1 -1
  245. package/dist/retry-backoff-exponential.strategy.d.ts.map +1 -1
  246. package/dist/retry-backoff-exponential.strategy.js +2 -1
  247. package/dist/retry-backoff-exponential.strategy.js.map +1 -1
  248. package/dist/retry-backoff-fibonacci.strategy.d.ts.map +1 -1
  249. package/dist/retry-backoff-fibonacci.strategy.js +2 -1
  250. package/dist/retry-backoff-fibonacci.strategy.js.map +1 -1
  251. package/dist/retry-backoff-linear.strategy.d.ts.map +1 -1
  252. package/dist/retry-backoff-linear.strategy.js +2 -1
  253. package/dist/retry-backoff-linear.strategy.js.map +1 -1
  254. package/dist/retry.service.d.ts.map +1 -1
  255. package/dist/retry.service.js +1 -1
  256. package/dist/retry.service.js.map +1 -1
  257. package/dist/security-countermeasure-ban.strategy.d.ts.map +1 -1
  258. package/dist/security-countermeasure-ban.strategy.js +3 -2
  259. package/dist/security-countermeasure-ban.strategy.js.map +1 -1
  260. package/dist/security-countermeasure-mirage.strategy.d.ts.map +1 -1
  261. package/dist/security-countermeasure-mirage.strategy.js +2 -1
  262. package/dist/security-countermeasure-mirage.strategy.js.map +1 -1
  263. package/dist/security-countermeasure-name.vo.d.ts +3 -5
  264. package/dist/security-countermeasure-name.vo.d.ts.map +1 -1
  265. package/dist/security-countermeasure-name.vo.js +4 -11
  266. package/dist/security-countermeasure-name.vo.js.map +1 -1
  267. package/dist/security-countermeasure-noop.strategy.d.ts.map +1 -1
  268. package/dist/security-countermeasure-noop.strategy.js +2 -1
  269. package/dist/security-countermeasure-noop.strategy.js.map +1 -1
  270. package/dist/security-countermeasure-report.strategy.d.ts.map +1 -1
  271. package/dist/security-countermeasure-report.strategy.js +2 -1
  272. package/dist/security-countermeasure-report.strategy.js.map +1 -1
  273. package/dist/security-countermeasure-tarpit.strategy.d.ts.map +1 -1
  274. package/dist/security-countermeasure-tarpit.strategy.js +2 -1
  275. package/dist/security-countermeasure-tarpit.strategy.js.map +1 -1
  276. package/dist/security-rule-and.strategy.d.ts.map +1 -1
  277. package/dist/security-rule-and.strategy.js +2 -1
  278. package/dist/security-rule-and.strategy.js.map +1 -1
  279. package/dist/security-rule-bait-routes.strategy.d.ts.map +1 -1
  280. package/dist/security-rule-bait-routes.strategy.js +2 -1
  281. package/dist/security-rule-bait-routes.strategy.js.map +1 -1
  282. package/dist/security-rule-fail.strategy.d.ts.map +1 -1
  283. package/dist/security-rule-fail.strategy.js +2 -1
  284. package/dist/security-rule-fail.strategy.js.map +1 -1
  285. package/dist/security-rule-honey-pot-field.strategy.d.ts.map +1 -1
  286. package/dist/security-rule-honey-pot-field.strategy.js +2 -1
  287. package/dist/security-rule-honey-pot-field.strategy.js.map +1 -1
  288. package/dist/security-rule-name.vo.d.ts +3 -5
  289. package/dist/security-rule-name.vo.d.ts.map +1 -1
  290. package/dist/security-rule-name.vo.js +5 -12
  291. package/dist/security-rule-name.vo.js.map +1 -1
  292. package/dist/security-rule-or.strategy.d.ts.map +1 -1
  293. package/dist/security-rule-or.strategy.js +2 -1
  294. package/dist/security-rule-or.strategy.js.map +1 -1
  295. package/dist/security-rule-pass.strategy.d.ts.map +1 -1
  296. package/dist/security-rule-pass.strategy.js +2 -1
  297. package/dist/security-rule-pass.strategy.js.map +1 -1
  298. package/dist/security-rule-user-agent.strategy.d.ts.map +1 -1
  299. package/dist/security-rule-user-agent.strategy.js +2 -1
  300. package/dist/security-rule-user-agent.strategy.js.map +1 -1
  301. package/dist/security-rule-violation-threshold.strategy.d.ts.map +1 -1
  302. package/dist/security-rule-violation-threshold.strategy.js +3 -2
  303. package/dist/security-rule-violation-threshold.strategy.js.map +1 -1
  304. package/dist/shield-body-limit.strategy.d.ts.map +1 -1
  305. package/dist/shield-body-limit.strategy.js +3 -2
  306. package/dist/shield-body-limit.strategy.js.map +1 -1
  307. package/dist/shield-recaptcha.strategy.d.ts.map +1 -1
  308. package/dist/shield-recaptcha.strategy.js +2 -1
  309. package/dist/shield-recaptcha.strategy.js.map +1 -1
  310. package/dist/smtp-host.vo.d.ts +3 -3
  311. package/dist/smtp-host.vo.d.ts.map +1 -1
  312. package/dist/smtp-host.vo.js +4 -8
  313. package/dist/smtp-host.vo.js.map +1 -1
  314. package/dist/smtp-pass.vo.d.ts +3 -3
  315. package/dist/smtp-pass.vo.d.ts.map +1 -1
  316. package/dist/smtp-pass.vo.js +4 -8
  317. package/dist/smtp-pass.vo.js.map +1 -1
  318. package/dist/smtp-port.vo.d.ts +3 -3
  319. package/dist/smtp-port.vo.d.ts.map +1 -1
  320. package/dist/smtp-user.vo.d.ts +3 -3
  321. package/dist/smtp-user.vo.d.ts.map +1 -1
  322. package/dist/smtp-user.vo.js +4 -8
  323. package/dist/smtp-user.vo.js.map +1 -1
  324. package/dist/time-zone-offset.middleware.d.ts.map +1 -1
  325. package/dist/time-zone-offset.middleware.js +3 -2
  326. package/dist/time-zone-offset.middleware.js.map +1 -1
  327. package/dist/timekeeper-google.adapter.d.ts +2 -1
  328. package/dist/timekeeper-google.adapter.d.ts.map +1 -1
  329. package/dist/timekeeper-google.adapter.js +2 -1
  330. package/dist/timekeeper-google.adapter.js.map +1 -1
  331. package/dist/tsconfig.tsbuildinfo +1 -1
  332. package/dist/uuid.vo.d.ts +3 -3
  333. package/dist/uuid.vo.d.ts.map +1 -1
  334. package/dist/uuid.vo.js +2 -2
  335. package/dist/uuid.vo.js.map +1 -1
  336. package/dist/woodchopper-dispatcher-async.strategy.d.ts.map +1 -1
  337. package/dist/woodchopper-dispatcher-async.strategy.js +2 -2
  338. package/dist/woodchopper-dispatcher-async.strategy.js.map +1 -1
  339. package/dist/woodchopper.js +7 -7
  340. package/dist/woodchopper.js.map +1 -1
  341. package/package.json +8 -9
  342. package/readme.md +1 -2
  343. package/src/ab-variant-selector.service.ts +2 -2
  344. package/src/ab-variant-weight.vo.ts +10 -9
  345. package/src/basic-auth-password.vo.ts +9 -9
  346. package/src/basic-auth-username.vo.ts +9 -9
  347. package/src/binary.vo.ts +10 -17
  348. package/src/client-ip.vo.ts +8 -5
  349. package/src/client-user-agent.vo.ts +8 -8
  350. package/src/client.vo.ts +7 -3
  351. package/src/commit-sha-value.vo.ts +8 -8
  352. package/src/commit-sha.vo.ts +2 -1
  353. package/src/correlation-id.vo.ts +2 -2
  354. package/src/correlation.middleware.ts +3 -2
  355. package/src/encryption-key-value.vo.ts +8 -8
  356. package/src/encryption-key.vo.ts +2 -1
  357. package/src/environment-loader-encrypted.adapter.ts +10 -5
  358. package/src/environment-loader-noop.adapter.ts +10 -8
  359. package/src/environment-loader-process-safe.adapter.ts +14 -9
  360. package/src/environment-loader-process.adapter.ts +10 -5
  361. package/src/environment-loader.port.ts +5 -2
  362. package/src/event-envelope.ts +3 -3
  363. package/src/event-store-with-logger.adapter.ts +1 -0
  364. package/src/event-stream.vo.ts +7 -6
  365. package/src/event-validator-registry.adapter.ts +44 -0
  366. package/src/event-validator-registry.port.ts +2 -0
  367. package/src/file-draft-zip.service.ts +2 -1
  368. package/src/hash-bucket.vo.ts +1 -1
  369. package/src/hash-value.vo.ts +8 -8
  370. package/src/hash.vo.ts +2 -1
  371. package/src/hcaptcha-secret-key.vo.ts +8 -8
  372. package/src/hcaptcha-site-key.vo.ts +8 -8
  373. package/src/healthcheck.handler.ts +7 -7
  374. package/src/http-logger.middleware.ts +1 -1
  375. package/src/i18n.service.ts +2 -1
  376. package/src/image-info-noop.adapter.ts +3 -2
  377. package/src/image-info-sharp.adapter.ts +4 -3
  378. package/src/in-flight-requests-tracker.service.ts +2 -2
  379. package/src/index.ts +1 -2
  380. package/src/logger.port.ts +1 -3
  381. package/src/mailer-content-html.vo.ts +9 -9
  382. package/src/mailer-subject.vo.ts +9 -9
  383. package/src/modules/history/event-handlers/onHistoryPopulatedEvent.ts +2 -1
  384. package/src/modules/history/events/HISTORY_CLEARED_EVENT.ts +5 -5
  385. package/src/modules/history/events/HISTORY_POPULATED_EVENT.ts +5 -5
  386. package/src/modules/history/value-objects/history-created-at.ts +2 -2
  387. package/src/modules/history/value-objects/history-operation.ts +6 -5
  388. package/src/modules/history/value-objects/history-payload.ts +15 -9
  389. package/src/modules/history/value-objects/history-subject.ts +7 -6
  390. package/src/modules/history/value-objects/history.ts +5 -5
  391. package/src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts +2 -1
  392. package/src/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.ts +5 -5
  393. package/src/modules/preferences/events/USER_LANGUAGE_SET_EVENT.ts +5 -5
  394. package/src/modules/system/events/HOUR_HAS_PASSED_EVENT.ts +5 -5
  395. package/src/modules/system/events/MINUTE_HAS_PASSED_EVENT.ts +5 -5
  396. package/src/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.ts +8 -8
  397. package/src/modules/system/services/passage-of-time-hourly.service.ts +2 -1
  398. package/src/modules/system/services/passage-of-time-minute.service.ts +2 -1
  399. package/src/node-env.vo.ts +0 -6
  400. package/src/nonce-provider-crypto.adapter.ts +2 -1
  401. package/src/nonce-provider-noop.adapter.ts +2 -1
  402. package/src/nonce-value.vo.ts +8 -8
  403. package/src/port.vo.ts +12 -10
  404. package/src/prerequisite-verifier-outside-connectivity.adapter.ts +2 -1
  405. package/src/recaptcha-secret-key.vo.ts +8 -8
  406. package/src/recaptcha-site-key.vo.ts +8 -8
  407. package/src/redactor-error-cause-depth-limit.strategy.ts +2 -2
  408. package/src/redactor-metadata-compact-array.strategy.ts +1 -1
  409. package/src/redactor-metadata-compact-object.strategy.ts +1 -1
  410. package/src/remote-file-storage-disk.adapter.ts +2 -1
  411. package/src/retry-backoff-exponential.strategy.ts +2 -1
  412. package/src/retry-backoff-fibonacci.strategy.ts +2 -1
  413. package/src/retry-backoff-linear.strategy.ts +2 -1
  414. package/src/retry.service.ts +1 -2
  415. package/src/security-countermeasure-ban.strategy.ts +3 -2
  416. package/src/security-countermeasure-mirage.strategy.ts +2 -1
  417. package/src/security-countermeasure-name.vo.ts +8 -12
  418. package/src/security-countermeasure-noop.strategy.ts +2 -1
  419. package/src/security-countermeasure-report.strategy.ts +2 -1
  420. package/src/security-countermeasure-tarpit.strategy.ts +2 -1
  421. package/src/security-rule-and.strategy.ts +2 -1
  422. package/src/security-rule-bait-routes.strategy.ts +2 -1
  423. package/src/security-rule-fail.strategy.ts +2 -1
  424. package/src/security-rule-honey-pot-field.strategy.ts +2 -1
  425. package/src/security-rule-name.vo.ts +9 -13
  426. package/src/security-rule-or.strategy.ts +2 -1
  427. package/src/security-rule-pass.strategy.ts +2 -1
  428. package/src/security-rule-user-agent.strategy.ts +2 -1
  429. package/src/security-rule-violation-threshold.strategy.ts +3 -2
  430. package/src/shield-body-limit.strategy.ts +3 -2
  431. package/src/shield-recaptcha.strategy.ts +3 -1
  432. package/src/smtp-host.vo.ts +9 -9
  433. package/src/smtp-pass.vo.ts +9 -9
  434. package/src/smtp-port.vo.ts +2 -2
  435. package/src/smtp-user.vo.ts +9 -9
  436. package/src/time-zone-offset.middleware.ts +3 -2
  437. package/src/timekeeper-google.adapter.ts +2 -1
  438. package/src/uuid.vo.ts +3 -3
  439. package/src/woodchopper-dispatcher-async.strategy.ts +2 -2
  440. package/src/woodchopper.ts +7 -7
  441. package/dist/environment-schema.port.d.ts +0 -4
  442. package/dist/environment-schema.port.d.ts.map +0 -1
  443. package/dist/environment-schema.port.js +0 -2
  444. package/dist/environment-schema.port.js.map +0 -1
  445. package/dist/event-validator-registry-zod.adapter.d.ts +0 -24
  446. package/dist/event-validator-registry-zod.adapter.d.ts.map +0 -1
  447. package/dist/event-validator-registry-zod.adapter.js +0 -25
  448. package/dist/event-validator-registry-zod.adapter.js.map +0 -1
  449. package/src/environment-schema.port.ts +0 -3
  450. package/src/event-validator-registry-zod.adapter.ts +0 -47
@@ -1,14 +1,14 @@
1
1
  import * as tools from "@bgord/tools";
2
- import * as z from "zod/v4";
2
+ import * as v from "valibot";
3
3
  import { CommandEnvelopeSchema } from "../../../command-envelope";
4
4
  import { UUID } from "../../../uuid.vo";
5
5
 
6
6
  export const SET_USER_LANGUAGE_COMMAND = "SET_USER_LANGUAGE_COMMAND";
7
7
 
8
- export const SetUserLanguageCommand = z.object({
8
+ export const SetUserLanguageCommand = v.object({
9
9
  ...CommandEnvelopeSchema,
10
- name: z.literal(SET_USER_LANGUAGE_COMMAND),
11
- payload: z.object({ language: tools.Language, userId: UUID }),
10
+ name: v.literal(SET_USER_LANGUAGE_COMMAND),
11
+ payload: v.object({ language: tools.Language, userId: UUID }),
12
12
  });
13
13
 
14
- export type SetUserLanguageCommandType = z.infer<typeof SetUserLanguageCommand>;
14
+ export type SetUserLanguageCommandType = v.InferOutput<typeof SetUserLanguageCommand>;
@@ -1,14 +1,14 @@
1
1
  import * as tools from "@bgord/tools";
2
- import * as z from "zod/v4";
2
+ import * as v from "valibot";
3
3
  import { EventEnvelopeSchema } from "../../../event-envelope";
4
4
  import { UUID } from "../../../uuid.vo";
5
5
 
6
6
  export const USER_LANGUAGE_SET_EVENT = "USER_LANGUAGE_SET_EVENT";
7
7
 
8
- export const UserLanguageSetEvent = z.object({
8
+ export const UserLanguageSetEvent = v.object({
9
9
  ...EventEnvelopeSchema,
10
- name: z.literal(USER_LANGUAGE_SET_EVENT),
11
- payload: z.object({ userId: UUID, language: tools.Language }),
10
+ name: v.literal(USER_LANGUAGE_SET_EVENT),
11
+ payload: v.object({ userId: UUID, language: tools.Language }),
12
12
  });
13
13
 
14
- export type UserLanguageSetEventType = z.infer<typeof UserLanguageSetEvent>;
14
+ export type UserLanguageSetEventType = v.InferOutput<typeof UserLanguageSetEvent>;
@@ -1,13 +1,13 @@
1
1
  import * as tools from "@bgord/tools";
2
- import * as z from "zod/v4";
2
+ import * as v from "valibot";
3
3
  import { EventEnvelopeSchema } from "../../../event-envelope";
4
4
 
5
5
  export const HOUR_HAS_PASSED_EVENT = "HOUR_HAS_PASSED_EVENT";
6
6
 
7
- export const HourHasPassedEvent = z.object({
7
+ export const HourHasPassedEvent = v.object({
8
8
  ...EventEnvelopeSchema,
9
- name: z.literal(HOUR_HAS_PASSED_EVENT),
10
- payload: z.object({ timestamp: tools.TimestampValue }),
9
+ name: v.literal(HOUR_HAS_PASSED_EVENT),
10
+ payload: v.object({ timestamp: tools.TimestampValue }),
11
11
  });
12
12
 
13
- export type HourHasPassedEventType = z.infer<typeof HourHasPassedEvent>;
13
+ export type HourHasPassedEventType = v.InferOutput<typeof HourHasPassedEvent>;
@@ -1,13 +1,13 @@
1
1
  import * as tools from "@bgord/tools";
2
- import * as z from "zod/v4";
2
+ import * as v from "valibot";
3
3
  import { EventEnvelopeSchema } from "../../../event-envelope";
4
4
 
5
5
  export const MINUTE_HAS_PASSED_EVENT = "MINUTE_HAS_PASSED_EVENT";
6
6
 
7
- export const MinuteHasPassedEvent = z.object({
7
+ export const MinuteHasPassedEvent = v.object({
8
8
  ...EventEnvelopeSchema,
9
- name: z.literal(MINUTE_HAS_PASSED_EVENT),
10
- payload: z.object({ timestamp: tools.TimestampValue }),
9
+ name: v.literal(MINUTE_HAS_PASSED_EVENT),
10
+ payload: v.object({ timestamp: tools.TimestampValue }),
11
11
  });
12
12
 
13
- export type MinuteHasPassedEventType = z.infer<typeof MinuteHasPassedEvent>;
13
+ export type MinuteHasPassedEventType = v.InferOutput<typeof MinuteHasPassedEvent>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  import { ClientIp } from "../../../client-ip.vo";
3
3
  import { ClientUserAgent } from "../../../client-user-agent.vo";
4
4
  import { EventEnvelopeSchema } from "../../../event-envelope";
@@ -8,16 +8,16 @@ import { UUID } from "../../../uuid.vo";
8
8
 
9
9
  export const SECURITY_VIOLATION_DETECTED_EVENT = "SECURITY_VIOLATION_DETECTED_EVENT";
10
10
 
11
- export const SecurityViolationDetectedEvent = z.object({
11
+ export const SecurityViolationDetectedEvent = v.object({
12
12
  ...EventEnvelopeSchema,
13
- name: z.literal(SECURITY_VIOLATION_DETECTED_EVENT),
14
- payload: z.object({
13
+ name: v.literal(SECURITY_VIOLATION_DETECTED_EVENT),
14
+ payload: v.object({
15
15
  rule: SecurityRuleName,
16
- client: z.object({ ip: ClientIp.optional(), ua: ClientUserAgent.optional() }),
17
- userId: UUID.or(z.undefined()),
16
+ client: v.object({ ip: v.optional(ClientIp), ua: v.optional(ClientUserAgent) }),
17
+ userId: v.optional(UUID),
18
18
  countermeasure: SecurityCountermeasureName,
19
- action: z.string(),
19
+ action: v.string(),
20
20
  }),
21
21
  });
22
22
 
23
- export type SecurityViolationDetectedEventType = z.infer<typeof SecurityViolationDetectedEvent>;
23
+ export type SecurityViolationDetectedEventType = v.InferOutput<typeof SecurityViolationDetectedEvent>;
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { ClockPort } from "../../../clock.port";
2
3
  import { createEventEnvelope } from "../../../event-envelope";
3
4
  import type { EventStorePort } from "../../../event-store.port";
@@ -24,7 +25,7 @@ export class PassageOfTimeHourly implements UnitOfWork {
24
25
  label = "PassageOfTime";
25
26
 
26
27
  async process() {
27
- const event = HourHasPassedEvent.parse({
28
+ const event = v.parse(HourHasPassedEvent, {
28
29
  ...createEventEnvelope("passage_of_time", this.deps),
29
30
  name: HOUR_HAS_PASSED_EVENT,
30
31
  payload: { timestamp: this.deps.Clock.now().ms },
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { ClockPort } from "../../../clock.port";
2
3
  import { createEventEnvelope } from "../../../event-envelope";
3
4
  import type { EventStorePort } from "../../../event-store.port";
@@ -24,7 +25,7 @@ export class PassageOfTimeMinute implements UnitOfWork {
24
25
  label = "PassageOfTime";
25
26
 
26
27
  async process() {
27
- const event = MinuteHasPassedEvent.parse({
28
+ const event = v.parse(MinuteHasPassedEvent, {
28
29
  ...createEventEnvelope("passage_of_time", this.deps),
29
30
  name: MINUTE_HAS_PASSED_EVENT,
30
31
  payload: { timestamp: this.deps.Clock.now().ms },
@@ -1,12 +1,6 @@
1
- import * as z from "zod/v4";
2
-
3
1
  export enum NodeEnvironmentEnum {
4
2
  local = "local",
5
3
  test = "test",
6
4
  staging = "staging",
7
5
  production = "production",
8
6
  }
9
-
10
- export const NodeEnvironmentError = { Invalid: "node.environment.invalid" } as const;
11
-
12
- export const NodeEnvironment = z.enum(NodeEnvironmentEnum, NodeEnvironmentError.Invalid);
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { NonceProviderPort } from "./nonce-provider.port";
2
3
  import { NonceValue, type NonceValueType } from "./nonce-value.vo";
3
4
 
@@ -6,6 +7,6 @@ export class NonceProviderCryptoAdapter implements NonceProviderPort {
6
7
  const buffer = new Uint8Array(8);
7
8
  crypto.getRandomValues(buffer);
8
9
 
9
- return NonceValue.parse(buffer.toHex());
10
+ return v.parse(NonceValue, buffer.toHex());
10
11
  }
11
12
  }
@@ -1,8 +1,9 @@
1
+ import * as v from "valibot";
1
2
  import type { NonceProviderPort } from "./nonce-provider.port";
2
3
  import { NonceValue, type NonceValueType } from "./nonce-value.vo";
3
4
 
4
5
  export class NonceProviderNoopAdapter implements NonceProviderPort {
5
6
  generate(): NonceValueType {
6
- return NonceValue.parse("0000000000000000");
7
+ return v.parse(NonceValue, "0000000000000000");
7
8
  }
8
9
  }
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const NonceValueError = {
4
4
  Type: "nonce.value.type",
@@ -8,11 +8,11 @@ export const NonceValueError = {
8
8
  // 16 hex chars allowed
9
9
  const CHARS_WHITELIST = /^[a-fA-F0-9]{16}$/;
10
10
 
11
- // Stryker disable all
12
- export const NonceValue = z
13
- // Stryker restore all
14
- .string(NonceValueError.Type)
15
- .regex(CHARS_WHITELIST, NonceValueError.InvalidHex)
16
- .brand("NonceValue");
11
+ export const NonceValue = v.pipe(
12
+ v.string(NonceValueError.Type),
13
+ v.regex(CHARS_WHITELIST, NonceValueError.InvalidHex),
14
+ // Stryker disable next-line StringLiteral
15
+ v.brand("NonceValue"),
16
+ );
17
17
 
18
- export type NonceValueType = z.infer<typeof NonceValue>;
18
+ export type NonceValueType = v.InferOutput<typeof NonceValue>;
package/src/port.vo.ts CHANGED
@@ -1,14 +1,16 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const PortError = { Type: "port.type", Invalid: "port.invalid" } as const;
4
4
 
5
- // Stryker disable all
6
- export const Port = z.coerce
7
- // Stryker restore all
8
- .number(PortError.Type)
9
- .int(PortError.Type)
10
- .min(0, PortError.Invalid)
11
- .max(99999, PortError.Invalid)
12
- .brand("Port");
5
+ export const Port = v.pipe(
6
+ v.unknown(),
7
+ v.transform(Number),
8
+ v.number(PortError.Type),
9
+ v.integer(PortError.Type),
10
+ v.minValue(0, PortError.Invalid),
11
+ v.maxValue(99999, PortError.Invalid),
12
+ // Stryker disable next-line StringLiteral
13
+ v.brand("Port"),
14
+ );
13
15
 
14
- export type PortType = z.infer<typeof Port>;
16
+ export type PortType = v.InferOutput<typeof Port>;
@@ -1,4 +1,5 @@
1
1
  import * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import {
3
4
  PrerequisiteVerification,
4
5
  type PrerequisiteVerificationResult,
@@ -6,7 +7,7 @@ import {
6
7
  } from "./prerequisite-verifier.port";
7
8
 
8
9
  export class PrerequisiteVerifierOutsideConnectivityAdapter implements PrerequisiteVerifierPort {
9
- private static readonly URL = tools.UrlWithoutSlash.parse("https://google.com");
10
+ private static readonly URL = v.parse(tools.UrlWithoutSlash, "https://google.com");
10
11
 
11
12
  async verify(): Promise<PrerequisiteVerificationResult> {
12
13
  try {
@@ -1,15 +1,15 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const RecaptchaSecretKeyError = {
4
4
  Type: "recaptcha.secret.key.type",
5
5
  Length: "recaptcha.secret.key.length",
6
6
  };
7
7
 
8
- // Stryker disable all
9
- export const RecaptchaSecretKey = z
10
- // Stryker restore all
11
- .string(RecaptchaSecretKeyError.Type)
12
- .length(40, RecaptchaSecretKeyError.Length)
13
- .brand("RecaptchaSecretKey");
8
+ export const RecaptchaSecretKey = v.pipe(
9
+ v.string(RecaptchaSecretKeyError.Type),
10
+ v.length(40, RecaptchaSecretKeyError.Length),
11
+ // Stryker disable next-line StringLiteral
12
+ v.brand("RecaptchaSecretKey"),
13
+ );
14
14
 
15
- export type RecaptchaSecretKeyType = z.infer<typeof RecaptchaSecretKey>;
15
+ export type RecaptchaSecretKeyType = v.InferOutput<typeof RecaptchaSecretKey>;
@@ -1,12 +1,12 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const RecaptchaSiteKeyError = { Type: "recaptcha.site.key.type", Length: "recaptcha.site.key.length" };
4
4
 
5
- // Stryker disable all
6
- export const RecaptchaSiteKey = z
7
- // Stryker restore all
8
- .string(RecaptchaSiteKeyError.Type)
9
- .length(40, RecaptchaSiteKeyError.Length)
10
- .brand("RecaptchaSiteKey");
5
+ export const RecaptchaSiteKey = v.pipe(
6
+ v.string(RecaptchaSiteKeyError.Type),
7
+ v.length(40, RecaptchaSiteKeyError.Length),
8
+ // Stryker disable next-line StringLiteral
9
+ v.brand("RecaptchaSiteKey"),
10
+ );
11
11
 
12
- export type RecaptchaSiteKeyType = z.infer<typeof RecaptchaSiteKey>;
12
+ export type RecaptchaSiteKeyType = v.InferOutput<typeof RecaptchaSiteKey>;
@@ -12,11 +12,11 @@ export class RedactorErrorCauseDepthLimit implements RedactorStrategy {
12
12
  // Stryker restore all
13
13
  if (!ErrorNormalizer.isNormalizedError(input.error)) return input;
14
14
 
15
- return { ...input, error: this.limit(input.error, tools.IntegerNonNegative.parse(0)) };
15
+ return { ...input, error: this.limit(input.error, tools.Int.nonNegative(0)) };
16
16
  }
17
17
 
18
18
  private limit(error: NormalizedError, depth: tools.IntegerNonNegativeType): NormalizedError {
19
19
  if (!error.cause || depth >= this.max) return { ...error, cause: undefined };
20
- return { ...error, cause: this.limit(error.cause, tools.IntegerNonNegative.parse(depth + 1)) };
20
+ return { ...error, cause: this.limit(error.cause, tools.Int.nonNegative(depth + 1)) };
21
21
  }
22
22
  }
@@ -6,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
6
6
  type RedactorMetadataCompactArrayOptions = { maxItems?: tools.IntegerPositiveType };
7
7
 
8
8
  export class RedactorMetadataCompactArray implements RedactorStrategy {
9
- private static readonly DEFAULT_MAX_ITEMS = tools.IntegerPositive.parse(20);
9
+ private static readonly DEFAULT_MAX_ITEMS = tools.Int.positive(20);
10
10
 
11
11
  private readonly maxItems: tools.IntegerPositiveType;
12
12
 
@@ -6,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
6
6
  type RedactorMetadataCompactObjectOptions = { maxKeys?: tools.IntegerPositiveType };
7
7
 
8
8
  export class RedactorMetadataCompactObject implements RedactorStrategy {
9
- private static readonly DEFAULT_MAX_KEYS = tools.IntegerPositive.parse(20);
9
+ private static readonly DEFAULT_MAX_KEYS = tools.Int.positive(20);
10
10
 
11
11
  private readonly maxKeys: tools.IntegerPositiveType;
12
12
 
@@ -1,4 +1,5 @@
1
1
  import * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import type { DirectoryEnsurerPort } from "./directory-ensurer.port";
3
4
  import type { FileCleanerPort } from "./file-cleaner.port";
4
5
  import type { FileCopierPort } from "./file-copier.port";
@@ -31,7 +32,7 @@ export class RemoteFileStorageDiskAdapter implements RemoteFileStoragePort {
31
32
  const parts = key.split("/");
32
33
  const filename = tools.Filename.fromString(parts.pop() as string);
33
34
 
34
- const directory = tools.DirectoryPathAbsoluteSchema.parse(`${this.config.root}/${parts.join("/")}`);
35
+ const directory = v.parse(tools.DirectoryPathAbsoluteSchema, `${this.config.root}/${parts.join("/")}`);
35
36
 
36
37
  return tools.FilePathAbsolute.fromPartsSafe(directory, filename);
37
38
  }
@@ -1,10 +1,11 @@
1
1
  import * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
3
4
 
4
5
  export class RetryBackoffExponentialStrategy implements RetryBackoffStrategy {
5
6
  constructor(private readonly delay: tools.Duration) {}
6
7
 
7
8
  next(attempt: tools.IntegerPositiveType): tools.Duration {
8
- return this.delay.times(tools.MultiplicationFactor.parse(2 ** (attempt - 1)));
9
+ return this.delay.times(v.parse(tools.MultiplicationFactor, 2 ** (attempt - 1)));
9
10
  }
10
11
  }
@@ -1,11 +1,12 @@
1
1
  import * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
3
4
 
4
5
  export class RetryBackoffFibonacciStrategy implements RetryBackoffStrategy {
5
6
  constructor(private readonly delay: tools.Duration) {}
6
7
 
7
8
  next(attempt: tools.IntegerPositiveType): tools.Duration {
8
- return this.delay.times(tools.MultiplicationFactor.parse(this.fibonacci(attempt)));
9
+ return this.delay.times(v.parse(tools.MultiplicationFactor, this.fibonacci(attempt)));
9
10
  }
10
11
 
11
12
  private fibonacci(n: number): number {
@@ -1,10 +1,11 @@
1
1
  import * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
3
4
 
4
5
  export class RetryBackoffLinearStrategy implements RetryBackoffStrategy {
5
6
  constructor(private readonly delay: tools.Duration) {}
6
7
 
7
8
  next(attempt: tools.IntegerPositiveType): tools.Duration {
8
- return this.delay.times(tools.MultiplicationFactor.parse(attempt));
9
+ return this.delay.times(v.parse(tools.MultiplicationFactor, attempt));
9
10
  }
10
11
  }
@@ -27,8 +27,7 @@ export class Retry {
27
27
  lastError = error;
28
28
 
29
29
  if (attempt === config.max || (config.when && !config.when(error))) break;
30
-
31
- await this.deps.Sleeper.wait(config.backoff.next(tools.IntegerPositive.parse(attempt)));
30
+ await this.deps.Sleeper.wait(config.backoff.next(tools.Int.positive(attempt)));
32
31
  }
33
32
  }
34
33
 
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { ClockPort } from "./clock.port";
2
3
  import { CorrelationStorage } from "./correlation-storage.service";
3
4
  import { createEventEnvelope } from "./event-envelope";
@@ -50,7 +51,7 @@ export class SecurityCountermeasureBanStrategy implements SecurityCountermeasure
50
51
  metadata: context,
51
52
  });
52
53
 
53
- const event = SecurityViolationDetectedEvent.parse({
54
+ const event = v.parse(SecurityViolationDetectedEvent, {
54
55
  ...createEventEnvelope("security", this.deps),
55
56
  name: SECURITY_VIOLATION_DETECTED_EVENT,
56
57
  payload: { action: action.kind, ...context },
@@ -62,6 +63,6 @@ export class SecurityCountermeasureBanStrategy implements SecurityCountermeasure
62
63
  }
63
64
 
64
65
  get name(): SecurityCountermeasureNameType {
65
- return SecurityCountermeasureName.parse("ban");
66
+ return v.parse(SecurityCountermeasureName, "ban");
66
67
  }
67
68
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { CorrelationStorage } from "./correlation-storage.service";
2
3
  import type { LoggerPort } from "./logger.port";
3
4
  import type { SecurityContext } from "./security-context.vo";
@@ -29,6 +30,6 @@ export class SecurityCountermeasureMirageStrategy implements SecurityCountermeas
29
30
  }
30
31
 
31
32
  get name(): SecurityCountermeasureNameType {
32
- return SecurityCountermeasureName.parse("mirage");
33
+ return v.parse(SecurityCountermeasureName, "mirage");
33
34
  }
34
35
  }
@@ -1,22 +1,18 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const SecurityCountermeasureNameError = {
4
4
  Type: "security.countermeasure.name.type",
5
- Empty: "security.countermeasure.name.empty",
6
- TooLong: "security.countermeasure.name.too.long",
7
5
  BadChars: "security.countermeasure.name.bad.chars",
8
6
  };
9
7
 
10
8
  // One to sixty four letters, digits, or underscores
11
9
  const CHARS_WHITELIST = /^[a-zA-Z0-9_]{1,64}$/;
12
10
 
13
- // Stryker disable all
14
- export const SecurityCountermeasureName = z
15
- // Stryker restore all
16
- .string(SecurityCountermeasureNameError.Type)
17
- .min(1, SecurityCountermeasureNameError.Empty)
18
- .max(64, SecurityCountermeasureNameError.TooLong)
19
- .regex(CHARS_WHITELIST, SecurityCountermeasureNameError.BadChars)
20
- .brand("SecurityCountermeasureName");
11
+ export const SecurityCountermeasureName = v.pipe(
12
+ v.string(SecurityCountermeasureNameError.Type),
13
+ v.regex(CHARS_WHITELIST, SecurityCountermeasureNameError.BadChars),
14
+ // Stryker disable next-line StringLiteral
15
+ v.brand("SecurityCountermeasureName"),
16
+ );
21
17
 
22
- export type SecurityCountermeasureNameType = z.infer<typeof SecurityCountermeasureName>;
18
+ export type SecurityCountermeasureNameType = v.InferOutput<typeof SecurityCountermeasureName>;
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { SecurityAction, SecurityCountermeasureStrategy } from "./security-countermeasure.strategy";
2
3
  import {
3
4
  SecurityCountermeasureName,
@@ -10,6 +11,6 @@ export class SecurityCountermeasureNoopStrategy implements SecurityCountermeasur
10
11
  }
11
12
 
12
13
  get name(): SecurityCountermeasureNameType {
13
- return SecurityCountermeasureName.parse("noop");
14
+ return v.parse(SecurityCountermeasureName, "noop");
14
15
  }
15
16
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { CorrelationStorage } from "./correlation-storage.service";
2
3
  import type { LoggerPort } from "./logger.port";
3
4
  import type { SecurityContext } from "./security-context.vo";
@@ -25,6 +26,6 @@ export class SecurityCountermeasureReportStrategy implements SecurityCountermeas
25
26
  }
26
27
 
27
28
  get name(): SecurityCountermeasureNameType {
28
- return SecurityCountermeasureName.parse("report");
29
+ return v.parse(SecurityCountermeasureName, "report");
29
30
  }
30
31
  }
@@ -1,4 +1,5 @@
1
1
  import type * as tools from "@bgord/tools";
2
+ import * as v from "valibot";
2
3
  import { CorrelationStorage } from "./correlation-storage.service";
3
4
  import type { LoggerPort } from "./logger.port";
4
5
  import type { SecurityContext } from "./security-context.vo";
@@ -30,6 +31,6 @@ export class SecurityCountermeasureTarpitStrategy implements SecurityCountermeas
30
31
  }
31
32
 
32
33
  get name(): SecurityCountermeasureNameType {
33
- return SecurityCountermeasureName.parse("tarpit");
34
+ return v.parse(SecurityCountermeasureName, "tarpit");
34
35
  }
35
36
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { RequestContext } from "./request-context.port";
2
3
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
3
4
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
@@ -20,6 +21,6 @@ export class SecurityRuleAndStrategy implements SecurityRuleStrategy {
20
21
  }
21
22
 
22
23
  get name(): SecurityRuleNameType {
23
- return SecurityRuleName.parse(`and_${this.rules.map((rule) => rule.name).join("_")}`);
24
+ return v.parse(SecurityRuleName, `and_${this.rules.map((rule) => rule.name).join("_")}`);
24
25
  }
25
26
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { HasRequestPath } from "./request-context.port";
2
3
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
3
4
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
@@ -10,6 +11,6 @@ export class SecurityRuleBaitRoutesStrategy implements SecurityRuleStrategy {
10
11
  }
11
12
 
12
13
  get name(): SecurityRuleNameType {
13
- return SecurityRuleName.parse("bait_routes");
14
+ return v.parse(SecurityRuleName, "bait_routes");
14
15
  }
15
16
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
2
3
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
3
4
 
@@ -7,6 +8,6 @@ export class SecurityRuleFailStrategy implements SecurityRuleStrategy {
7
8
  }
8
9
 
9
10
  get name(): SecurityRuleNameType {
10
- return SecurityRuleName.parse("fail");
11
+ return v.parse(SecurityRuleName, "fail");
11
12
  }
12
13
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { HasRequestJSON } from "./request-context.port";
2
3
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
3
4
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
@@ -14,6 +15,6 @@ export class SecurityRuleHoneyPotFieldStrategy implements SecurityRuleStrategy {
14
15
  }
15
16
 
16
17
  get name(): SecurityRuleNameType {
17
- return SecurityRuleName.parse("honey_pot_field");
18
+ return v.parse(SecurityRuleName, "honey_pot_field");
18
19
  }
19
20
  }
@@ -1,22 +1,18 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
 
3
3
  export const SecurityRuleNameError = {
4
4
  Type: "security.rule.name.type",
5
- Empty: "security.rule.name.empty",
6
- TooLong: "security.rule.name.too.long",
7
5
  BadChars: "security.rule.name.bad.chars",
8
6
  };
9
7
 
10
- // One to sixty four letters, digits, or underscores
8
+ // One to five hundred twelve letters, digits, or underscores
11
9
  const CHARS_WHITELIST = /^[a-zA-Z0-9_]{1,512}$/;
12
10
 
13
- // Stryker disable all
14
- export const SecurityRuleName = z
15
- // Stryker restore all
16
- .string(SecurityRuleNameError.Type)
17
- .min(1, SecurityRuleNameError.Empty)
18
- .max(512, SecurityRuleNameError.TooLong)
19
- .regex(CHARS_WHITELIST, SecurityRuleNameError.BadChars)
20
- .brand("SecurityRuleName");
11
+ export const SecurityRuleName = v.pipe(
12
+ v.string(SecurityRuleNameError.Type),
13
+ v.regex(CHARS_WHITELIST, SecurityRuleNameError.BadChars),
14
+ // Stryker disable next-line StringLiteral
15
+ v.brand("SecurityRuleName"),
16
+ );
21
17
 
22
- export type SecurityRuleNameType = z.infer<typeof SecurityRuleName>;
18
+ export type SecurityRuleNameType = v.InferOutput<typeof SecurityRuleName>;
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { RequestContext } from "./request-context.port";
2
3
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
3
4
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
@@ -20,6 +21,6 @@ export class SecurityRuleOrStrategy implements SecurityRuleStrategy {
20
21
  }
21
22
 
22
23
  get name(): SecurityRuleNameType {
23
- return SecurityRuleName.parse(`or_${this.rules.map((rule) => rule.name).join("_")}`);
24
+ return v.parse(SecurityRuleName, `or_${this.rules.map((rule) => rule.name).join("_")}`);
24
25
  }
25
26
  }
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import type { SecurityRuleStrategy } from "./security-rule.strategy";
2
3
  import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
3
4
 
@@ -7,6 +8,6 @@ export class SecurityRulePassStrategy implements SecurityRuleStrategy {
7
8
  }
8
9
 
9
10
  get name(): SecurityRuleNameType {
10
- return SecurityRuleName.parse("pass");
11
+ return v.parse(SecurityRuleName, "pass");
11
12
  }
12
13
  }