@venizia/ignis-helpers 0.4.7-0 → 0.4.7-2

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 (311) hide show
  1. package/LICENSE.md +1 -3
  2. package/README.md +7 -8
  3. package/dist/esm/common/redact.d.ts +25 -17
  4. package/dist/esm/common/redact.d.ts.map +1 -1
  5. package/dist/esm/common/redact.js +50 -46
  6. package/dist/esm/common/redact.js.map +1 -1
  7. package/dist/esm/common/resolvers.d.ts +7 -5
  8. package/dist/esm/common/resolvers.d.ts.map +1 -1
  9. package/dist/esm/common/resolvers.js +11 -9
  10. package/dist/esm/common/resolvers.js.map +1 -1
  11. package/dist/esm/core.d.ts +5 -3
  12. package/dist/esm/core.d.ts.map +1 -1
  13. package/dist/esm/core.js +7 -3
  14. package/dist/esm/core.js.map +1 -1
  15. package/dist/esm/modules/base.d.ts +1 -1
  16. package/dist/esm/modules/base.d.ts.map +1 -1
  17. package/dist/esm/modules/base.js +14 -5
  18. package/dist/esm/modules/base.js.map +1 -1
  19. package/dist/esm/modules/cron/helper.js +4 -4
  20. package/dist/esm/modules/cron/helper.js.map +1 -1
  21. package/dist/esm/modules/crypto/algorithms/aes-legacy.algorithm.js +3 -3
  22. package/dist/esm/modules/crypto/algorithms/aes-legacy.algorithm.js.map +1 -1
  23. package/dist/esm/modules/crypto/algorithms/aes.algorithm.js +5 -5
  24. package/dist/esm/modules/crypto/algorithms/aes.algorithm.js.map +1 -1
  25. package/dist/esm/modules/crypto/algorithms/base.algorithm.js +3 -3
  26. package/dist/esm/modules/crypto/algorithms/base.algorithm.js.map +1 -1
  27. package/dist/esm/modules/crypto/algorithms/hash.algorithm.d.ts +15 -5
  28. package/dist/esm/modules/crypto/algorithms/hash.algorithm.d.ts.map +1 -1
  29. package/dist/esm/modules/crypto/algorithms/hash.algorithm.js +16 -4
  30. package/dist/esm/modules/crypto/algorithms/hash.algorithm.js.map +1 -1
  31. package/dist/esm/modules/env/app-env.d.ts.map +1 -1
  32. package/dist/esm/modules/env/app-env.js +2 -2
  33. package/dist/esm/modules/env/app-env.js.map +1 -1
  34. package/dist/esm/modules/logger/base/base.d.ts.map +1 -1
  35. package/dist/esm/modules/logger/base/base.js +3 -3
  36. package/dist/esm/modules/logger/base/base.js.map +1 -1
  37. package/dist/esm/modules/logger/base/console.d.ts +9 -4
  38. package/dist/esm/modules/logger/base/console.d.ts.map +1 -1
  39. package/dist/esm/modules/logger/base/console.js +15 -4
  40. package/dist/esm/modules/logger/base/console.js.map +1 -1
  41. package/dist/esm/modules/logger/common/constants.d.ts +23 -22
  42. package/dist/esm/modules/logger/common/constants.d.ts.map +1 -1
  43. package/dist/esm/modules/logger/common/constants.js +43 -46
  44. package/dist/esm/modules/logger/common/constants.js.map +1 -1
  45. package/dist/esm/modules/logger/common/debug-gate.d.ts +33 -0
  46. package/dist/esm/modules/logger/common/debug-gate.d.ts.map +1 -0
  47. package/dist/esm/modules/logger/common/debug-gate.js +51 -0
  48. package/dist/esm/modules/logger/common/debug-gate.js.map +1 -0
  49. package/dist/esm/modules/logger/common/index.d.ts +1 -0
  50. package/dist/esm/modules/logger/common/index.d.ts.map +1 -1
  51. package/dist/esm/modules/logger/common/index.js +1 -0
  52. package/dist/esm/modules/logger/common/index.js.map +1 -1
  53. package/dist/esm/modules/logger/common/types.d.ts +7 -0
  54. package/dist/esm/modules/logger/common/types.d.ts.map +1 -1
  55. package/dist/esm/modules/logger/common/types.js +16 -0
  56. package/dist/esm/modules/logger/common/types.js.map +1 -1
  57. package/dist/esm/modules/logger/factory.d.ts +29 -10
  58. package/dist/esm/modules/logger/factory.d.ts.map +1 -1
  59. package/dist/esm/modules/logger/factory.js +108 -48
  60. package/dist/esm/modules/logger/factory.js.map +1 -1
  61. package/dist/esm/modules/logger/formatting/deep-splat.d.ts +10 -6
  62. package/dist/esm/modules/logger/formatting/deep-splat.d.ts.map +1 -1
  63. package/dist/esm/modules/logger/formatting/deep-splat.js +73 -62
  64. package/dist/esm/modules/logger/formatting/deep-splat.js.map +1 -1
  65. package/dist/esm/modules/logger/formatting/error-prettier.d.ts.map +1 -1
  66. package/dist/esm/modules/logger/formatting/error-prettier.js +8 -6
  67. package/dist/esm/modules/logger/formatting/error-prettier.js.map +1 -1
  68. package/dist/esm/modules/logger/hf/logger.d.ts.map +1 -1
  69. package/dist/esm/modules/logger/hf/logger.js +5 -5
  70. package/dist/esm/modules/logger/hf/logger.js.map +1 -1
  71. package/dist/esm/modules/logger/index.d.ts +0 -1
  72. package/dist/esm/modules/logger/index.d.ts.map +1 -1
  73. package/dist/esm/modules/logger/index.js +0 -1
  74. package/dist/esm/modules/logger/index.js.map +1 -1
  75. package/dist/esm/modules/logger/pino/backing.d.ts +0 -9
  76. package/dist/esm/modules/logger/pino/backing.d.ts.map +1 -1
  77. package/dist/esm/modules/logger/pino/backing.js +3 -8
  78. package/dist/esm/modules/logger/pino/backing.js.map +1 -1
  79. package/dist/esm/modules/logger/pino/destination.d.ts +6 -9
  80. package/dist/esm/modules/logger/pino/destination.d.ts.map +1 -1
  81. package/dist/esm/modules/logger/pino/destination.js +12 -13
  82. package/dist/esm/modules/logger/pino/destination.js.map +1 -1
  83. package/dist/esm/modules/logger/pino/logger.js +2 -2
  84. package/dist/esm/modules/logger/pino/logger.js.map +1 -1
  85. package/dist/esm/modules/logger/winston/common/constants.d.ts.map +1 -1
  86. package/dist/esm/modules/logger/winston/common/constants.js +7 -6
  87. package/dist/esm/modules/logger/winston/common/constants.js.map +1 -1
  88. package/dist/esm/modules/logger/winston/define.d.ts +0 -7
  89. package/dist/esm/modules/logger/winston/define.d.ts.map +1 -1
  90. package/dist/esm/modules/logger/winston/define.js +0 -5
  91. package/dist/esm/modules/logger/winston/define.js.map +1 -1
  92. package/dist/esm/modules/logger/winston/formats.d.ts +2 -0
  93. package/dist/esm/modules/logger/winston/formats.d.ts.map +1 -1
  94. package/dist/esm/modules/logger/winston/formats.js +17 -4
  95. package/dist/esm/modules/logger/winston/formats.js.map +1 -1
  96. package/dist/esm/modules/logger/winston/index.d.ts +3 -2
  97. package/dist/esm/modules/logger/winston/index.d.ts.map +1 -1
  98. package/dist/esm/modules/logger/winston/index.js +3 -2
  99. package/dist/esm/modules/logger/winston/index.js.map +1 -1
  100. package/dist/esm/modules/logger/winston/logger-factory.js +4 -4
  101. package/dist/esm/modules/logger/winston/logger-factory.js.map +1 -1
  102. package/dist/esm/modules/network/http-request/base-network-request.helper.js +2 -2
  103. package/dist/esm/modules/network/http-request/base-network-request.helper.js.map +1 -1
  104. package/dist/esm/modules/network/http-request/common/index.d.ts +0 -1
  105. package/dist/esm/modules/network/http-request/common/index.d.ts.map +1 -1
  106. package/dist/esm/modules/network/http-request/common/index.js +0 -1
  107. package/dist/esm/modules/network/http-request/common/index.js.map +1 -1
  108. package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.d.ts.map +1 -1
  109. package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.js +4 -2
  110. package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.js.map +1 -1
  111. package/dist/esm/modules/network/http-request/fetcher/node-fetcher.d.ts.map +1 -1
  112. package/dist/esm/modules/network/http-request/fetcher/node-fetcher.js +6 -4
  113. package/dist/esm/modules/network/http-request/fetcher/node-fetcher.js.map +1 -1
  114. package/dist/esm/modules/network/tcp-socket/base-tcp-client.helper.js +4 -4
  115. package/dist/esm/modules/network/tcp-socket/base-tcp-client.helper.js.map +1 -1
  116. package/dist/esm/modules/network/tcp-socket/base-tcp-server.helper.js +4 -4
  117. package/dist/esm/modules/network/tcp-socket/base-tcp-server.helper.js.map +1 -1
  118. package/dist/esm/modules/network/udp-socket/network-udp-client.helper.js +2 -2
  119. package/dist/esm/modules/network/udp-socket/network-udp-client.helper.js.map +1 -1
  120. package/dist/esm/modules/network/utilities/query-string.d.ts +22 -20
  121. package/dist/esm/modules/network/utilities/query-string.d.ts.map +1 -1
  122. package/dist/esm/modules/network/utilities/query-string.js +48 -46
  123. package/dist/esm/modules/network/utilities/query-string.js.map +1 -1
  124. package/dist/esm/modules/network/utilities/url-safety/common/errors.d.ts +0 -10
  125. package/dist/esm/modules/network/utilities/url-safety/common/errors.d.ts.map +1 -1
  126. package/dist/esm/modules/network/utilities/url-safety/common/errors.js +0 -11
  127. package/dist/esm/modules/network/utilities/url-safety/common/errors.js.map +1 -1
  128. package/dist/esm/modules/network/utilities/url-safety/policy.d.ts +10 -0
  129. package/dist/esm/modules/network/utilities/url-safety/policy.d.ts.map +1 -1
  130. package/dist/esm/modules/network/utilities/url-safety/policy.js +11 -0
  131. package/dist/esm/modules/network/utilities/url-safety/policy.js.map +1 -1
  132. package/dist/esm/modules/queue/bullmq/helper.d.ts.map +1 -1
  133. package/dist/esm/modules/queue/bullmq/helper.js +6 -6
  134. package/dist/esm/modules/queue/bullmq/helper.js.map +1 -1
  135. package/dist/esm/modules/queue/common/hook.d.ts +14 -12
  136. package/dist/esm/modules/queue/common/hook.d.ts.map +1 -1
  137. package/dist/esm/modules/queue/common/hook.js +21 -19
  138. package/dist/esm/modules/queue/common/hook.js.map +1 -1
  139. package/dist/esm/modules/queue/common/index.d.ts +0 -1
  140. package/dist/esm/modules/queue/common/index.d.ts.map +1 -1
  141. package/dist/esm/modules/queue/common/index.js +0 -1
  142. package/dist/esm/modules/queue/common/index.js.map +1 -1
  143. package/dist/esm/modules/queue/internal/sequential/helper.js +8 -8
  144. package/dist/esm/modules/queue/internal/sequential/helper.js.map +1 -1
  145. package/dist/esm/modules/queue/kafka/base.js +3 -3
  146. package/dist/esm/modules/queue/kafka/base.js.map +1 -1
  147. package/dist/esm/modules/queue/kafka/bundler/index.d.ts +0 -2
  148. package/dist/esm/modules/queue/kafka/bundler/index.d.ts.map +1 -1
  149. package/dist/esm/modules/queue/kafka/bundler/index.js +0 -2
  150. package/dist/esm/modules/queue/kafka/bundler/index.js.map +1 -1
  151. package/dist/esm/modules/queue/kafka/bundler/plugins.d.ts +8 -2
  152. package/dist/esm/modules/queue/kafka/bundler/plugins.d.ts.map +1 -1
  153. package/dist/esm/modules/queue/kafka/bundler/plugins.js +64 -7
  154. package/dist/esm/modules/queue/kafka/bundler/plugins.js.map +1 -1
  155. package/dist/esm/modules/queue/kafka/consumer.d.ts.map +1 -1
  156. package/dist/esm/modules/queue/kafka/consumer.js +22 -22
  157. package/dist/esm/modules/queue/kafka/consumer.js.map +1 -1
  158. package/dist/esm/modules/queue/mqtt/helper.js +10 -10
  159. package/dist/esm/modules/queue/mqtt/helper.js.map +1 -1
  160. package/dist/esm/modules/redis/base/abstract.helper.js +8 -8
  161. package/dist/esm/modules/redis/base/abstract.helper.js.map +1 -1
  162. package/dist/esm/modules/redis/cluster/cluster.helper.js +2 -2
  163. package/dist/esm/modules/redis/cluster/cluster.helper.js.map +1 -1
  164. package/dist/esm/modules/redis/factory.d.ts +13 -9
  165. package/dist/esm/modules/redis/factory.d.ts.map +1 -1
  166. package/dist/esm/modules/redis/factory.js +15 -13
  167. package/dist/esm/modules/redis/factory.js.map +1 -1
  168. package/dist/esm/modules/redis/sentinel/sentinel.helper.js +2 -2
  169. package/dist/esm/modules/redis/sentinel/sentinel.helper.js.map +1 -1
  170. package/dist/esm/modules/redis/single/single.helper.js +2 -2
  171. package/dist/esm/modules/redis/single/single.helper.js.map +1 -1
  172. package/dist/esm/modules/redis/utility.d.ts +13 -11
  173. package/dist/esm/modules/redis/utility.d.ts.map +1 -1
  174. package/dist/esm/modules/redis/utility.js +46 -44
  175. package/dist/esm/modules/redis/utility.js.map +1 -1
  176. package/dist/esm/modules/retry/helper.js +2 -2
  177. package/dist/esm/modules/retry/helper.js.map +1 -1
  178. package/dist/esm/modules/secrets/factory.d.ts +5 -3
  179. package/dist/esm/modules/secrets/factory.d.ts.map +1 -1
  180. package/dist/esm/modules/secrets/factory.js +36 -34
  181. package/dist/esm/modules/secrets/factory.js.map +1 -1
  182. package/dist/esm/modules/socket/socket-io/server/helper.d.ts.map +1 -1
  183. package/dist/esm/modules/socket/socket-io/server/helper.js +11 -11
  184. package/dist/esm/modules/socket/socket-io/server/helper.js.map +1 -1
  185. package/dist/esm/modules/socket/websocket/emitter/helper.d.ts.map +1 -1
  186. package/dist/esm/modules/socket/websocket/emitter/helper.js +3 -3
  187. package/dist/esm/modules/socket/websocket/emitter/helper.js.map +1 -1
  188. package/dist/esm/modules/socket/websocket/server/delivery.d.ts.map +1 -1
  189. package/dist/esm/modules/socket/websocket/server/delivery.js +5 -6
  190. package/dist/esm/modules/socket/websocket/server/delivery.js.map +1 -1
  191. package/dist/esm/modules/socket/websocket/server/helper.d.ts.map +1 -1
  192. package/dist/esm/modules/socket/websocket/server/helper.js +7 -7
  193. package/dist/esm/modules/socket/websocket/server/helper.js.map +1 -1
  194. package/dist/esm/modules/storage/base.js +7 -7
  195. package/dist/esm/modules/storage/base.js.map +1 -1
  196. package/dist/esm/modules/storage/bun-s3/helper.d.ts.map +1 -1
  197. package/dist/esm/modules/storage/bun-s3/helper.js +25 -18
  198. package/dist/esm/modules/storage/bun-s3/helper.js.map +1 -1
  199. package/dist/esm/modules/storage/bun-s3/utility.d.ts +95 -77
  200. package/dist/esm/modules/storage/bun-s3/utility.d.ts.map +1 -1
  201. package/dist/esm/modules/storage/bun-s3/utility.js +261 -239
  202. package/dist/esm/modules/storage/bun-s3/utility.js.map +1 -1
  203. package/dist/esm/modules/storage/common/errors.d.ts +0 -4
  204. package/dist/esm/modules/storage/common/errors.d.ts.map +1 -1
  205. package/dist/esm/modules/storage/common/errors.js +0 -10
  206. package/dist/esm/modules/storage/common/errors.js.map +1 -1
  207. package/dist/esm/modules/storage/common/utility.d.ts +11 -5
  208. package/dist/esm/modules/storage/common/utility.d.ts.map +1 -1
  209. package/dist/esm/modules/storage/common/utility.js +30 -17
  210. package/dist/esm/modules/storage/common/utility.js.map +1 -1
  211. package/dist/esm/modules/uid/uuid/helper.d.ts +1 -1
  212. package/dist/esm/modules/uid/uuid/helper.d.ts.map +1 -1
  213. package/dist/esm/modules/uid/uuid/helper.js +7 -7
  214. package/dist/esm/modules/uid/uuid/helper.js.map +1 -1
  215. package/dist/esm/modules/uid/uuid/v4.d.ts +11 -8
  216. package/dist/esm/modules/uid/uuid/v4.d.ts.map +1 -1
  217. package/dist/esm/modules/uid/uuid/v4.js +51 -46
  218. package/dist/esm/modules/uid/uuid/v4.js.map +1 -1
  219. package/dist/esm/modules/uid/uuid/v5.d.ts +17 -14
  220. package/dist/esm/modules/uid/uuid/v5.d.ts.map +1 -1
  221. package/dist/esm/modules/uid/uuid/v5.js +83 -78
  222. package/dist/esm/modules/uid/uuid/v5.js.map +1 -1
  223. package/dist/esm/modules/uid/uuid/v7.d.ts +15 -10
  224. package/dist/esm/modules/uid/uuid/v7.d.ts.map +1 -1
  225. package/dist/esm/modules/uid/uuid/v7.js +88 -79
  226. package/dist/esm/modules/uid/uuid/v7.js.map +1 -1
  227. package/dist/esm/modules/worker-thread/bus/base.js +2 -2
  228. package/dist/esm/modules/worker-thread/bus/base.js.map +1 -1
  229. package/dist/esm/modules/worker-thread/worker/base.d.ts.map +1 -1
  230. package/dist/esm/modules/worker-thread/worker/base.js +4 -3
  231. package/dist/esm/modules/worker-thread/worker/base.js.map +1 -1
  232. package/dist/esm/utilities/error.utility.d.ts +7 -0
  233. package/dist/esm/utilities/error.utility.d.ts.map +1 -0
  234. package/dist/esm/utilities/error.utility.js +9 -0
  235. package/dist/esm/utilities/error.utility.js.map +1 -0
  236. package/dist/esm/utilities/form-body.utility.d.ts +12 -10
  237. package/dist/esm/utilities/form-body.utility.d.ts.map +1 -1
  238. package/dist/esm/utilities/form-body.utility.js +19 -17
  239. package/dist/esm/utilities/form-body.utility.js.map +1 -1
  240. package/dist/esm/utilities/hr-time.utility.d.ts +7 -5
  241. package/dist/esm/utilities/hr-time.utility.d.ts.map +1 -1
  242. package/dist/esm/utilities/hr-time.utility.js +11 -9
  243. package/dist/esm/utilities/hr-time.utility.js.map +1 -1
  244. package/dist/esm/utilities/index.d.ts +2 -2
  245. package/dist/esm/utilities/index.d.ts.map +1 -1
  246. package/dist/esm/utilities/index.js +2 -2
  247. package/dist/esm/utilities/index.js.map +1 -1
  248. package/dist/esm/utilities/module.utility.d.ts.map +1 -1
  249. package/dist/esm/utilities/module.utility.js +1 -0
  250. package/dist/esm/utilities/module.utility.js.map +1 -1
  251. package/dist/esm/utilities/parse.utility.d.ts +89 -43
  252. package/dist/esm/utilities/parse.utility.d.ts.map +1 -1
  253. package/dist/esm/utilities/parse.utility.js +173 -141
  254. package/dist/esm/utilities/parse.utility.js.map +1 -1
  255. package/dist/esm/utilities/performance.utility.d.ts +15 -13
  256. package/dist/esm/utilities/performance.utility.d.ts.map +1 -1
  257. package/dist/esm/utilities/performance.utility.js +34 -29
  258. package/dist/esm/utilities/performance.utility.js.map +1 -1
  259. package/dist/esm/utilities/promise.utility.d.ts +20 -18
  260. package/dist/esm/utilities/promise.utility.d.ts.map +1 -1
  261. package/dist/esm/utilities/promise.utility.js +41 -51
  262. package/dist/esm/utilities/promise.utility.js.map +1 -1
  263. package/dist/esm/utilities/request.utility.d.ts +35 -29
  264. package/dist/esm/utilities/request.utility.d.ts.map +1 -1
  265. package/dist/esm/utilities/request.utility.js +118 -115
  266. package/dist/esm/utilities/request.utility.js.map +1 -1
  267. package/package.json +4 -15
  268. package/dist/esm/modules/logger/resolver.d.ts +0 -33
  269. package/dist/esm/modules/logger/resolver.d.ts.map +0 -1
  270. package/dist/esm/modules/logger/resolver.js +0 -95
  271. package/dist/esm/modules/logger/resolver.js.map +0 -1
  272. package/dist/esm/modules/logger/slot.d.ts +0 -23
  273. package/dist/esm/modules/logger/slot.d.ts.map +0 -1
  274. package/dist/esm/modules/logger/slot.js +0 -119
  275. package/dist/esm/modules/logger/slot.js.map +0 -1
  276. package/dist/esm/modules/logger/winston/formatters/deep-splat.d.ts +0 -4
  277. package/dist/esm/modules/logger/winston/formatters/deep-splat.d.ts.map +0 -1
  278. package/dist/esm/modules/logger/winston/formatters/deep-splat.js +0 -14
  279. package/dist/esm/modules/logger/winston/formatters/deep-splat.js.map +0 -1
  280. package/dist/esm/modules/logger/winston/formatters/index.d.ts +0 -2
  281. package/dist/esm/modules/logger/winston/formatters/index.d.ts.map +0 -1
  282. package/dist/esm/modules/logger/winston/formatters/index.js +0 -2
  283. package/dist/esm/modules/logger/winston/formatters/index.js.map +0 -1
  284. package/dist/esm/modules/network/http-request/common/types.d.ts +0 -2
  285. package/dist/esm/modules/network/http-request/common/types.d.ts.map +0 -1
  286. package/dist/esm/modules/network/http-request/common/types.js +0 -2
  287. package/dist/esm/modules/network/http-request/common/types.js.map +0 -1
  288. package/dist/esm/modules/queue/common/types.d.ts +0 -2
  289. package/dist/esm/modules/queue/common/types.d.ts.map +0 -1
  290. package/dist/esm/modules/queue/common/types.js +0 -2
  291. package/dist/esm/modules/queue/common/types.js.map +0 -1
  292. package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts +0 -4
  293. package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts.map +0 -1
  294. package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.js +0 -28
  295. package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.js.map +0 -1
  296. package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts +0 -4
  297. package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts.map +0 -1
  298. package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.js +0 -26
  299. package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.js.map +0 -1
  300. package/dist/esm/modules/storage/minio/helper.d.ts +0 -55
  301. package/dist/esm/modules/storage/minio/helper.d.ts.map +0 -1
  302. package/dist/esm/modules/storage/minio/helper.js +0 -177
  303. package/dist/esm/modules/storage/minio/helper.js.map +0 -1
  304. package/dist/esm/modules/storage/minio/index.d.ts +0 -2
  305. package/dist/esm/modules/storage/minio/index.d.ts.map +0 -1
  306. package/dist/esm/modules/storage/minio/index.js +0 -2
  307. package/dist/esm/modules/storage/minio/index.js.map +0 -1
  308. package/dist/esm/utilities/sleep.utility.d.ts +0 -2
  309. package/dist/esm/utilities/sleep.utility.d.ts.map +0 -1
  310. package/dist/esm/utilities/sleep.utility.js +0 -4
  311. package/dist/esm/utilities/sleep.utility.js.map +0 -1
package/LICENSE.md CHANGED
@@ -37,7 +37,7 @@ This monorepo contains the following packages, all licensed under MIT:
37
37
  | `@venizia/ignis-helpers` | Utility helpers - logging, cron, Redis, queues, storage |
38
38
  | `@venizia/ignis-inversion` | Dependency Injection & IoC container |
39
39
  | `@venizia/dev-configs` | Shared oxlint, ESLint, TypeScript configurations |
40
- | `@venizia/ignis-docs` | Documentation and MCP Server |
40
+ | `@venizia/ignis-docs` | Documentation site content |
41
41
 
42
42
  ---
43
43
 
@@ -79,8 +79,6 @@ Ignis uses the following open-source libraries. We are grateful to the authors a
79
79
  | Library | License | Description |
80
80
  |---------|---------|-------------|
81
81
  | [VitePress](https://github.com/vuejs/vitepress) | MIT | Static site generator |
82
- | [Fuse.js](https://github.com/krisk/fuse) | Apache-2.0 | Fuzzy search library |
83
- | [gray-matter](https://github.com/jonschlinkert/gray-matter) | MIT | Front-matter parser |
84
82
 
85
83
  ---
86
84
 
package/README.md CHANGED
@@ -12,18 +12,18 @@ The root entry loads with no optional peer installed. Every third-party backend
12
12
 
13
13
  ## Example
14
14
 
15
- Register a logger provider once at the entrypoint, then take scoped loggers and helpers anywhere:
15
+ Choose a logger provider once at the entrypoint, then take scoped loggers and helpers anywhere:
16
16
 
17
17
  ```typescript
18
18
  // bun add pino ioredis
19
- import { createRedisHelper, LoggerFactory, RedisModes } from '@venizia/ignis-helpers';
19
+ import { LoggerFactory, RedisHelperFactory, RedisModes } from '@venizia/ignis-helpers';
20
20
  import { PinoLogger } from '@venizia/ignis-helpers/pino';
21
21
 
22
22
  LoggerFactory.use({ provider: PinoLogger });
23
23
 
24
24
  const logger = LoggerFactory.getLogger(['CacheService']);
25
25
 
26
- const redis = createRedisHelper({
26
+ const redis = RedisHelperFactory.create({
27
27
  mode: RedisModes.SINGLE,
28
28
  name: 'cache',
29
29
  host: '127.0.0.1',
@@ -37,7 +37,7 @@ const user = await redis.get({ key: 'user:1', transform: JSON.parse });
37
37
  logger.for('warmup').info('Cache warmed | user: %j', user);
38
38
  ```
39
39
 
40
- Notice that your code only ever types against `ILogger`. `LoggerFactory.use()` swaps the backend for every logger handed out so far. With no provider registered, the factory falls back to winston on the first log call.
40
+ Notice that your code only ever types against `ILogger`. `LoggerFactory.use()` swaps the backend for every logger handed out so far. With no provider chosen, the factory uses the console; `@venizia/ignis` selects Winston when an application starts.
41
41
 
42
42
  Dates and IDs need no peer at all:
43
43
 
@@ -60,17 +60,16 @@ A helper that imports an optional peer as a value lives only on its own sub-path
60
60
 
61
61
  | Sub-path | What it gives | Extra peers |
62
62
  |---|---|---|
63
- | `.` | Everything peer-free: `LoggerFactory`, `ILogger`, `HfLogger`, Redis helpers (`createRedisHelper`), `SequentialQueueHelper`, disk and in-memory storage, `AES` / `RSA` / `ECDH`, fetch and TCP / TLS / UDP helpers, Bun WebSocket server, `createSecretsHelper`, `ApplicationEnvironment`, `WorkerPoolHelper`, `RetryHelper`, `TemporalHelper`, `UuidHelper`, `SnowflakeUidHelper`, `ModuleUtility`, `getError` | none to load. `ioredis` to use Redis; `hono` for the JSX types |
63
+ | `.` | Everything peer-free: `LoggerFactory`, `ILogger`, `HfLogger`, Redis helpers (`RedisHelperFactory`), `SequentialQueueHelper`, disk and in-memory storage, `AES` / `RSA` / `ECDH`, fetch and TCP / TLS / UDP helpers, Bun WebSocket server, `SecretsHelperFactory`, `ApplicationEnvironment`, `WorkerPoolHelper`, `RetryHelper`, `TemporalHelper`, `UuidHelper`, `SnowflakeUidHelper`, `ModuleUtility`, `getError` | none to load. `ioredis` to use Redis; `hono` for the JSX types |
64
64
  | `./core` | Browser-safe runtime classes: `BaseHelper`, the error module, `RetryHelper`, `TemporalHelper`, `UuidHelper`, `TreeBuilder`, `TreeWalker`, `SlugHelper`, `UrlPolicy`, parse utilities | none |
65
65
  | `./common` | Constants, types, redaction and resolvers | none |
66
- | `./uuid` | `UuidHelper` and the standalone `uuidV4`, `uuidV5`, `uuidV7` | none |
66
+ | `./uuid` | `UuidHelper` and the standalone `UuidV4Generator`, `UuidV5Generator`, `UuidV7Generator` | none |
67
67
  | `./temporal` | `TemporalHelper` and the `Native`, `Dayjs`, `Luxon` temporal adapters | none (your own `dayjs` or `luxon` if you pick that adapter) |
68
68
  | `./winston` | `WinstonLogger` | `winston`, `winston-transport`, `winston-daily-rotate-file` |
69
69
  | `./pino` | `PinoLogger` | `pino` (`pino-pretty` for text output, `pino-roll` for file rotation) |
70
70
  | `./bullmq` | `BullMQHelper` | `bullmq` |
71
71
  | `./mqtt` | `MQTTClientHelper` | `mqtt` |
72
72
  | `./kafka` | `KafkaProducerHelper`, `KafkaConsumerHelper`, `KafkaAdminHelper`, schema registry, bundler plugins | `@platformatic/kafka` |
73
- | `./minio` | `MinioHelper` | `minio` |
74
73
  | `./bun-s3` | `BunS3Helper` | none - Bun's native S3 client (Bun only) |
75
74
  | `./socket-io` | `SocketIOServerHelper`, `SocketIOClientHelper` | `socket.io`, `@socket.io/redis-adapter`, `@socket.io/redis-emitter`; `socket.io-client` for the client |
76
75
  | `./axios` | `AxiosFetcher`, `AxiosNetworkRequest` | `axios` |
@@ -91,7 +90,7 @@ import { ModuleUtility } from '@venizia/ignis-helpers';
91
90
  ModuleUtility.register({ modules: { ioredis } });
92
91
  ```
93
92
 
94
- A binary must also call `LoggerFactory.use()` explicitly - the winston fallback cannot reach a bundle. Details: [Module Utility](https://ignis.venizia.ai/references/utilities/module).
93
+ A binary needs no `LoggerFactory.use()`: the console is the default logger. Details: [Module Utility](https://ignis.venizia.ai/references/utilities/module).
95
94
 
96
95
  ## Where it sits
97
96
 
@@ -1,19 +1,27 @@
1
1
  export declare const REDACTED = "[REDACTED]";
2
- /**
3
- * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not
4
- * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.
5
- *
6
- * `depth` bounds the walk, exactly as {@link toJsonSafe} already does. It defaults to `Infinity` for
7
- * callers that really do want the whole graph, but the logger passes its own bound: rendering only
8
- * inspects a handful of levels, so walking to `Infinity` did work whose result was thrown away -
9
- * 12x on a deep graph, and a `RangeError` on a very deep chain.
10
- */
11
- export declare const redactSecrets: (value: unknown, seen?: WeakSet<object>, depth?: number) => unknown;
12
- /** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */
13
- export declare const toJsonSafe: (opts: {
14
- value: unknown;
15
- depth?: number;
16
- }) => unknown;
17
- /** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */
18
- export declare const redactUrlCredentials: (url: string) => string;
2
+ export declare class RedactUtility {
3
+ /**
4
+ * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not
5
+ * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.
6
+ *
7
+ * `depth` bounds the walk, exactly as {@link RedactUtility.toJsonSafe} already does. It defaults to
8
+ * `Infinity` for callers that really do want the whole graph, but the logger passes its own bound:
9
+ * rendering only inspects a handful of levels, so walking to `Infinity` did work whose result was
10
+ * thrown away - 12x on a deep graph, and a `RangeError` on a very deep chain.
11
+ */
12
+ static redactSecrets(opts: {
13
+ value: unknown;
14
+ seen?: WeakSet<object>;
15
+ depth?: number;
16
+ }): unknown;
17
+ /** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */
18
+ static toJsonSafe(opts: {
19
+ value: unknown;
20
+ depth?: number;
21
+ }): unknown;
22
+ /** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link RedactUtility.redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */
23
+ static redactUrlCredentials(opts: {
24
+ url: string;
25
+ }): string;
26
+ }
19
27
  //# sourceMappingURL=redact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../src/common/redact.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,QAAQ,eAAe,CAAC;AA0HrC;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,OAAO,EACd,OAAO,OAAO,CAAC,MAAM,CAAC,EACtB,QAAO,MAAiB,KACvB,OAWF,CAAC;AAEF,4dAA4d;AAC5d,eAAO,MAAM,UAAU,GAAI,MAAM;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,OASrE,CAAC;AAEF,sPAAsP;AACtP,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,MAmBlD,CAAC"}
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../src/common/redact.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,QAAQ,eAAe,CAAC;AA0HrC,qBAAa,aAAa;IACxB;;;;;;;;OAQG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IAe/F,4dAA4d;IAC5d,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IAWpE,oQAAoQ;IACpQ,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;CAsB3D"}
@@ -104,53 +104,57 @@ const deepSanitize = (value, context) => {
104
104
  }
105
105
  return result;
106
106
  };
107
- /**
108
- * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not
109
- * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.
110
- *
111
- * `depth` bounds the walk, exactly as {@link toJsonSafe} already does. It defaults to `Infinity` for
112
- * callers that really do want the whole graph, but the logger passes its own bound: rendering only
113
- * inspects a handful of levels, so walking to `Infinity` did work whose result was thrown away -
114
- * 12x on a deep graph, and a `RangeError` on a very deep chain.
115
- */
116
- export const redactSecrets = (value, seen, depth = Infinity) => {
117
- if (!isRedactionEnabled()) {
118
- return value;
119
- }
120
- return deepSanitize(value, {
121
- seen: seen ?? new WeakSet(),
122
- doRedact: true,
123
- depth,
124
- maxStringLength: resolveMaxStringLength(),
125
- });
126
- };
127
- /** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */
128
- export const toJsonSafe = (opts) => {
129
- return deepSanitize(opts.value, {
130
- seen: new WeakSet(),
131
- doRedact: isRedactionEnabled(),
132
- depth: opts.depth ?? Infinity,
133
- // Capping is STRUCTURAL, like the projection itself: turning redaction off is about key masking,
134
- // never about letting a 300 KB base64 field through.
135
- maxStringLength: resolveMaxStringLength(),
136
- });
137
- };
138
- /** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */
139
- export const redactUrlCredentials = (url) => {
140
- if (!isRedactionEnabled()) {
141
- return url;
142
- }
143
- let parsed;
144
- try {
145
- parsed = new URL(url);
107
+ export class RedactUtility {
108
+ /**
109
+ * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not
110
+ * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.
111
+ *
112
+ * `depth` bounds the walk, exactly as {@link RedactUtility.toJsonSafe} already does. It defaults to
113
+ * `Infinity` for callers that really do want the whole graph, but the logger passes its own bound:
114
+ * rendering only inspects a handful of levels, so walking to `Infinity` did work whose result was
115
+ * thrown away - 12x on a deep graph, and a `RangeError` on a very deep chain.
116
+ */
117
+ static redactSecrets(opts) {
118
+ const { value, seen, depth = Infinity } = opts;
119
+ if (!isRedactionEnabled()) {
120
+ return value;
121
+ }
122
+ return deepSanitize(value, {
123
+ seen: seen ?? new WeakSet(),
124
+ doRedact: true,
125
+ depth,
126
+ maxStringLength: resolveMaxStringLength(),
127
+ });
146
128
  }
147
- catch {
148
- return url;
129
+ /** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */
130
+ static toJsonSafe(opts) {
131
+ return deepSanitize(opts.value, {
132
+ seen: new WeakSet(),
133
+ doRedact: isRedactionEnabled(),
134
+ depth: opts.depth ?? Infinity,
135
+ // Capping is STRUCTURAL, like the projection itself: turning redaction off is about key masking,
136
+ // never about letting a 300 KB base64 field through.
137
+ maxStringLength: resolveMaxStringLength(),
138
+ });
149
139
  }
150
- if (!parsed.password) {
151
- return url;
140
+ /** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link RedactUtility.redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */
141
+ static redactUrlCredentials(opts) {
142
+ const { url } = opts;
143
+ if (!isRedactionEnabled()) {
144
+ return url;
145
+ }
146
+ let parsed;
147
+ try {
148
+ parsed = new URL(url);
149
+ }
150
+ catch {
151
+ return url;
152
+ }
153
+ if (!parsed.password) {
154
+ return url;
155
+ }
156
+ parsed.password = REDACTED;
157
+ return decodeURIComponent(parsed.toString());
152
158
  }
153
- parsed.password = REDACTED;
154
- return decodeURIComponent(parsed.toString());
155
- };
159
+ }
156
160
  //# sourceMappingURL=redact.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redact.js","sourceRoot":"","sources":["../../../src/common/redact.ts"],"names":[],"mappings":"AAEA,gHAAgH;AAChH,MAAM,kBAAkB,GAAG,IAAI,MAAM,CACnC;IACE,qDAAqD;IACrD,6EAA6E;IAC7E,0EAA0E;IAC1E,oEAAoE;IAEpE,iKAAiK;IACjK,qCAAqC;IAErC,8MAA8M;IAC9M,yBAAyB;IAEzB,8RAA8R;IAC9R,2BAA2B;IAE3B,4JAA4J;IAC5J,qDAAqD;IAErD,yIAAyI;IACzI,+BAA+B;IAE/B,2MAA2M;IAC3M,gFAAgF;IAChF,6DAA6D;CAC9D,CAAC,IAAI,CAAC,EAAE,CAAC,EACV,GAAG,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,8KAA8K;AAC9K,MAAM,kBAAkB,GAAG,GAAY,EAAE,CACvC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,wBAAwB,KAAK,OAAO,CAAC;AAEhE,uGAAuG;AACvG,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC,MAAM,sBAAsB,GAAG,GAAW,EAAE;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,gCAAgC,CAAC,CAAC;IACrF,OAAO,MAAM,CAAC,QAAQ,CAAC,UAA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ACjG,qDAAqD;QACrD,eAAe,EAAE,sBAAsB,EAAE;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,sPAAsP;AACtP,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAU,EAAE;IAC1D,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;QAC1B,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,MAAW,CAAC;IAEhB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,OAAO,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import { type AnyObject } from './types';\n\n/** Keys whose VALUES must never reach a log line - matched case-insensitively on the key name, at any depth. */\nconst SECRET_KEY_PATTERN = new RegExp(\n [\n // Options-object spellings (camelCase / snake_case).\n '^(pass|password|passphrase|secret|token|apiKey|api_key|accessKey|access_key',\n '|secretKey|secret_key|privateKey|private_key|key|cert|ca|pfx|credentials',\n '|authorization|auth|jwtSecret|applicationSecret|connectionString)$',\n\n // Vault wire spellings (snake_case): node-vault's AppRole login/response bodies carry these exact keys, and none are matched by the anchored options list above.\n '|^(client_token|secret_id|role_id)$',\n\n // Any `*_token` (snake_case) or `*Token` (camelCase) key; a preceding character is required so the bare word `token` (already covered above) is not the whole match, and so ordinary words are not swallowed.\n '|_token$|[a-z0-9]token$',\n\n // The `*Secret` counterpart the `*Token` rule always lacked. `clientSecret` / `client_secret` is the RFC 6749 parameter name and a live field on the search connector's model options, and `webhookSecret` is the standard spelling everywhere; none of them matched the anchored list above.\n '|_secret$|[a-z0-9]secret$',\n\n // Connection descriptors: `connectionString` was anchored above but its snake_case twin was not, and `dsn` is the third common spelling for the same thing.\n '|^(connection_string|dsn|database_url|databaseUrl)$',\n\n // Any `*_password` / `*Password` key - `dbPassword`, `admin_password`. The bare word is anchored above; this catches the prefixed forms.\n '|_password$|[a-z0-9]password$',\n\n // HTTP HEADER spellings: header names are kebab-case and often `x-`-prefixed, none of which the camelCase list above matches; `vault` is included so `X-Vault-Token` (node-vault's auth header) is caught.\n '|^(x-)?(api|auth|access|secret|session|csrf|xsrf|vault)-(key|token|secret|id)$',\n '|^(cookie|set-cookie|proxy-authorization|www-authenticate)$',\n ].join(''),\n 'i',\n);\n\nexport const REDACTED = '[REDACTED]';\n\n/** Kill-switch for local debugging: only the literal `false` disables redaction (fail-closed); read per call so it can be flipped at runtime. Never disable in production. */\nconst isRedactionEnabled = (): boolean =>\n globalThis.process?.env?.APP_ENV_LOGGER_DO_REDACT !== 'false';\n\n/** Longest string a log line carries whole. `APP_ENV_LOGGER_MAX_STRING_LENGTH=0` turns capping off. */\nconst DEFAULT_MAX_STRING_LENGTH = 2048;\n\nconst resolveMaxStringLength = (): number => {\n const configured = Number(globalThis.process?.env?.APP_ENV_LOGGER_MAX_STRING_LENGTH);\n return Number.isFinite(configured) && configured >= 0 ? configured : DEFAULT_MAX_STRING_LENGTH;\n};\n\n/**\n * Keys whose value is long BY NATURE and useless truncated. A stack trace is the whole reason you\n * are reading the line.\n */\nconst UNCAPPED_KEYS = new Set(['stack', 'stacktrace', 'stack_trace']);\n\n/**\n * Caps a long string, keeping the ORIGINAL LENGTH in the marker - that number is what tells you the\n * payload was a 300 KB image rather than a truncated sentence.\n *\n * A base64 body is the case this exists for: one `data:image/png;base64,...` field turns a request\n * log into hundreds of kilobytes, and nothing about it is readable.\n */\nconst capString = (opts: { value: string; key?: string; limit: number }): string => {\n const { value, key, limit } = opts;\n\n if (limit === 0 || value.length <= limit || (key && UNCAPPED_KEYS.has(key.toLowerCase()))) {\n return value;\n }\n\n return `${value.slice(0, limit)}... [truncated, ${value.length} chars total]`;\n};\n\ntype TSanitizeContext = {\n seen: WeakSet<object>;\n doRedact: boolean;\n /** Levels still allowed BELOW the current one; `Infinity` walks the whole graph. */\n depth: number;\n /** Longest string kept whole; 0 keeps every string. */\n maxStringLength: number;\n /** The key this value was found under, so a stack trace can be exempted from capping. */\n key?: string;\n};\n\nconst deepSanitize = (value: unknown, context: TSanitizeContext): unknown => {\n const { seen, doRedact, depth } = context;\n\n if (typeof value === 'string') {\n return capString({ value, key: context.key, limit: context.maxStringLength });\n }\n\n if (value === null || typeof value !== 'object') {\n return value;\n }\n\n // A Date holds its value in an internal slot, so the generic branch below - which reads Object.keys() - would flatten it to `{}`. Checked BEFORE `seen`: a Date cannot carry a cycle, and entering the set would make a second reference to the same instance read as `[Circular]`.\n if (value instanceof Date) {\n return value;\n }\n\n if (seen.has(value)) {\n return '[Circular]';\n }\n\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {\n return `[Binary ${(value as ArrayBufferView).byteLength ?? 0} bytes]`;\n }\n\n if (depth <= 0) {\n return Array.isArray(value) ? '[Array]' : '[Object]';\n }\n\n seen.add(value);\n const nested: TSanitizeContext = {\n seen,\n doRedact,\n depth: depth - 1,\n maxStringLength: context.maxStringLength,\n };\n\n // Error keeps name/message/stack NON-enumerable, so Object.keys() skips them and naive redaction would drop the message - reproject into a plain object carrying those fields plus its redacted enumerable own-props.\n if (value instanceof Error) {\n const source = value;\n const result: AnyObject = {\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n\n for (const [key, entry] of Object.entries(source)) {\n result[key] =\n doRedact && SECRET_KEY_PATTERN.test(key)\n ? REDACTED\n : deepSanitize(entry, { ...nested, key });\n }\n\n return result;\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => deepSanitize(entry, nested));\n }\n\n const source = value;\n const result: AnyObject = {};\n\n for (const [key, entry] of Object.entries(source)) {\n if (doRedact && SECRET_KEY_PATTERN.test(key)) {\n result[key] = REDACTED;\n continue;\n }\n\n result[key] = deepSanitize(entry, { ...nested, key });\n }\n\n return result;\n};\n\n/**\n * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not\n * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.\n *\n * `depth` bounds the walk, exactly as {@link toJsonSafe} already does. It defaults to `Infinity` for\n * callers that really do want the whole graph, but the logger passes its own bound: rendering only\n * inspects a handful of levels, so walking to `Infinity` did work whose result was thrown away -\n * 12x on a deep graph, and a `RangeError` on a very deep chain.\n */\nexport const redactSecrets = (\n value: unknown,\n seen?: WeakSet<object>,\n depth: number = Infinity,\n): unknown => {\n if (!isRedactionEnabled()) {\n return value;\n }\n\n return deepSanitize(value, {\n seen: seen ?? new WeakSet<object>(),\n doRedact: true,\n depth,\n maxStringLength: resolveMaxStringLength(),\n });\n};\n\n/** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */\nexport const toJsonSafe = (opts: { value: unknown; depth?: number }): unknown => {\n return deepSanitize(opts.value, {\n seen: new WeakSet<object>(),\n doRedact: isRedactionEnabled(),\n depth: opts.depth ?? Infinity,\n // Capping is STRUCTURAL, like the projection itself: turning redaction off is about key masking,\n // never about letting a 300 KB base64 field through.\n maxStringLength: resolveMaxStringLength(),\n });\n};\n\n/** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */\nexport const redactUrlCredentials = (url: string): string => {\n if (!isRedactionEnabled()) {\n return url;\n }\n\n let parsed: URL;\n\n try {\n parsed = new URL(url);\n } catch {\n return url;\n }\n\n if (!parsed.password) {\n return url;\n }\n\n parsed.password = REDACTED;\n return decodeURIComponent(par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AAC,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,GAAG,CAAC;QACb,CAAC;QAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,OAAO,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["import { type AnyObject } from './types';\n\n/** Keys whose VALUES must never reach a log line - matched case-insensitively on the key name, at any depth. */\nconst SECRET_KEY_PATTERN = new RegExp(\n [\n // Options-object spellings (camelCase / snake_case).\n '^(pass|password|passphrase|secret|token|apiKey|api_key|accessKey|access_key',\n '|secretKey|secret_key|privateKey|private_key|key|cert|ca|pfx|credentials',\n '|authorization|auth|jwtSecret|applicationSecret|connectionString)$',\n\n // Vault wire spellings (snake_case): node-vault's AppRole login/response bodies carry these exact keys, and none are matched by the anchored options list above.\n '|^(client_token|secret_id|role_id)$',\n\n // Any `*_token` (snake_case) or `*Token` (camelCase) key; a preceding character is required so the bare word `token` (already covered above) is not the whole match, and so ordinary words are not swallowed.\n '|_token$|[a-z0-9]token$',\n\n // The `*Secret` counterpart the `*Token` rule always lacked. `clientSecret` / `client_secret` is the RFC 6749 parameter name and a live field on the search connector's model options, and `webhookSecret` is the standard spelling everywhere; none of them matched the anchored list above.\n '|_secret$|[a-z0-9]secret$',\n\n // Connection descriptors: `connectionString` was anchored above but its snake_case twin was not, and `dsn` is the third common spelling for the same thing.\n '|^(connection_string|dsn|database_url|databaseUrl)$',\n\n // Any `*_password` / `*Password` key - `dbPassword`, `admin_password`. The bare word is anchored above; this catches the prefixed forms.\n '|_password$|[a-z0-9]password$',\n\n // HTTP HEADER spellings: header names are kebab-case and often `x-`-prefixed, none of which the camelCase list above matches; `vault` is included so `X-Vault-Token` (node-vault's auth header) is caught.\n '|^(x-)?(api|auth|access|secret|session|csrf|xsrf|vault)-(key|token|secret|id)$',\n '|^(cookie|set-cookie|proxy-authorization|www-authenticate)$',\n ].join(''),\n 'i',\n);\n\nexport const REDACTED = '[REDACTED]';\n\n/** Kill-switch for local debugging: only the literal `false` disables redaction (fail-closed); read per call so it can be flipped at runtime. Never disable in production. */\nconst isRedactionEnabled = (): boolean =>\n globalThis.process?.env?.APP_ENV_LOGGER_DO_REDACT !== 'false';\n\n/** Longest string a log line carries whole. `APP_ENV_LOGGER_MAX_STRING_LENGTH=0` turns capping off. */\nconst DEFAULT_MAX_STRING_LENGTH = 2048;\n\nconst resolveMaxStringLength = (): number => {\n const configured = Number(globalThis.process?.env?.APP_ENV_LOGGER_MAX_STRING_LENGTH);\n return Number.isFinite(configured) && configured >= 0 ? configured : DEFAULT_MAX_STRING_LENGTH;\n};\n\n/**\n * Keys whose value is long BY NATURE and useless truncated. A stack trace is the whole reason you\n * are reading the line.\n */\nconst UNCAPPED_KEYS = new Set(['stack', 'stacktrace', 'stack_trace']);\n\n/**\n * Caps a long string, keeping the ORIGINAL LENGTH in the marker - that number is what tells you the\n * payload was a 300 KB image rather than a truncated sentence.\n *\n * A base64 body is the case this exists for: one `data:image/png;base64,...` field turns a request\n * log into hundreds of kilobytes, and nothing about it is readable.\n */\nconst capString = (opts: { value: string; key?: string; limit: number }): string => {\n const { value, key, limit } = opts;\n\n if (limit === 0 || value.length <= limit || (key && UNCAPPED_KEYS.has(key.toLowerCase()))) {\n return value;\n }\n\n return `${value.slice(0, limit)}... [truncated, ${value.length} chars total]`;\n};\n\ntype TSanitizeContext = {\n seen: WeakSet<object>;\n doRedact: boolean;\n /** Levels still allowed BELOW the current one; `Infinity` walks the whole graph. */\n depth: number;\n /** Longest string kept whole; 0 keeps every string. */\n maxStringLength: number;\n /** The key this value was found under, so a stack trace can be exempted from capping. */\n key?: string;\n};\n\nconst deepSanitize = (value: unknown, context: TSanitizeContext): unknown => {\n const { seen, doRedact, depth } = context;\n\n if (typeof value === 'string') {\n return capString({ value, key: context.key, limit: context.maxStringLength });\n }\n\n if (value === null || typeof value !== 'object') {\n return value;\n }\n\n // A Date holds its value in an internal slot, so the generic branch below - which reads Object.keys() - would flatten it to `{}`. Checked BEFORE `seen`: a Date cannot carry a cycle, and entering the set would make a second reference to the same instance read as `[Circular]`.\n if (value instanceof Date) {\n return value;\n }\n\n if (seen.has(value)) {\n return '[Circular]';\n }\n\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {\n return `[Binary ${(value as ArrayBufferView).byteLength ?? 0} bytes]`;\n }\n\n if (depth <= 0) {\n return Array.isArray(value) ? '[Array]' : '[Object]';\n }\n\n seen.add(value);\n const nested: TSanitizeContext = {\n seen,\n doRedact,\n depth: depth - 1,\n maxStringLength: context.maxStringLength,\n };\n\n // Error keeps name/message/stack NON-enumerable, so Object.keys() skips them and naive redaction would drop the message - reproject into a plain object carrying those fields plus its redacted enumerable own-props.\n if (value instanceof Error) {\n const source = value;\n const result: AnyObject = {\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n\n for (const [key, entry] of Object.entries(source)) {\n result[key] =\n doRedact && SECRET_KEY_PATTERN.test(key)\n ? REDACTED\n : deepSanitize(entry, { ...nested, key });\n }\n\n return result;\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => deepSanitize(entry, nested));\n }\n\n const source = value;\n const result: AnyObject = {};\n\n for (const [key, entry] of Object.entries(source)) {\n if (doRedact && SECRET_KEY_PATTERN.test(key)) {\n result[key] = REDACTED;\n continue;\n }\n\n result[key] = deepSanitize(entry, { ...nested, key });\n }\n\n return result;\n};\n\nexport class RedactUtility {\n /**\n * Redacts every secret-looking KEY (not value shape - buffers/typed arrays are summarized, not\n * serialized). `APP_ENV_LOGGER_DO_REDACT=false` makes this the identity function.\n *\n * `depth` bounds the walk, exactly as {@link RedactUtility.toJsonSafe} already does. It defaults to\n * `Infinity` for callers that really do want the whole graph, but the logger passes its own bound:\n * rendering only inspects a handful of levels, so walking to `Infinity` did work whose result was\n * thrown away - 12x on a deep graph, and a `RangeError` on a very deep chain.\n */\n static redactSecrets(opts: { value: unknown; seen?: WeakSet<object>; depth?: number }): unknown {\n const { value, seen, depth = Infinity } = opts;\n\n if (!isRedactionEnabled()) {\n return value;\n }\n\n return deepSanitize(value, {\n seen: seen ?? new WeakSet<object>(),\n doRedact: true,\n depth,\n maxStringLength: resolveMaxStringLength(),\n });\n }\n\n /** Projects a value into something `JSON.stringify` can render: it answers `[Circular]` for the WHOLE payload when one cycle sits anywhere inside it, so cycles must be broken per-branch first. `depth` bounds the walk the way `util.inspect` does - a log argument may hold a live connector or request context, whose graph is effectively unbounded. The projection itself is unconditional: `APP_ENV_LOGGER_DO_REDACT=false` turns off the key masking, never the structural pass. */\n static toJsonSafe(opts: { value: unknown; depth?: number }): unknown {\n return deepSanitize(opts.value, {\n seen: new WeakSet<object>(),\n doRedact: isRedactionEnabled(),\n depth: opts.depth ?? Infinity,\n // Capping is STRUCTURAL, like the projection itself: turning redaction off is about key masking,\n // never about letting a 300 KB base64 field through.\n maxStringLength: resolveMaxStringLength(),\n });\n }\n\n /** Strips credentials from a connection URL's authority section (`user:hunter2@host` -> `user:[REDACTED]@host`) - {@link RedactUtility.redactSecrets} matches on KEY names and can't see them there. A value that fails to parse as a URL is returned unchanged. */\n static redactUrlCredentials(opts: { url: string }): string {\n const { url } = opts;\n\n if (!isRedactionEnabled()) {\n return url;\n }\n\n let parsed: URL;\n\n try {\n parsed = new URL(url);\n } catch {\n return url;\n }\n\n if (!parsed.password) {\n return url;\n }\n\n parsed.password = REDACTED;\n return decodeURIComponent(parsed.toString());\n }\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  import type { TClass, TResolver } from './types/index.js';
2
- export { isClass, isEmpty, omit, resolveValue, resolveValueAsync } from '@venizia/ignis-inversion';
3
- /** Resolves a class reference, passing through string binding keys as-is. */
4
- export declare const resolveClass: <T>(opts: {
5
- ref: TClass<T> | TResolver<TClass<T>> | string;
6
- }) => TClass<T> | string;
2
+ export { isClass, ObjectUtility, ResolverUtility } from '@venizia/ignis-inversion';
3
+ export declare class ClassResolver {
4
+ /** Resolves a class reference, passing through string binding keys as-is. */
5
+ static resolveClass<T>(opts: {
6
+ ref: TClass<T> | TResolver<TClass<T>> | string;
7
+ }): TClass<T> | string;
8
+ }
7
9
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/common/resolvers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKjD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEnG,6EAA6E;AAC7E,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM;IACpC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;CAChD,KAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAOf,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/common/resolvers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKjD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEnF,qBAAa,aAAa;IACxB,6EAA6E;IAC7E,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE;QAC3B,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;KAChD,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM;CAQvB"}
@@ -1,14 +1,16 @@
1
- import { resolveValue } from '@venizia/ignis-inversion';
1
+ import { ResolverUtility } from '@venizia/ignis-inversion';
2
2
  // The resolver vocabulary and its two readers live in inversion, the lowest layer, because the
3
3
  // container branches on them. Re-exported here so the rest of the stack reaches them through the
4
4
  // package it already depends on, instead of each layer redeclaring them.
5
- export { isClass, isEmpty, omit, resolveValue, resolveValueAsync } from '@venizia/ignis-inversion';
6
- /** Resolves a class reference, passing through string binding keys as-is. */
7
- export const resolveClass = (opts) => {
8
- const { ref } = opts;
9
- if (typeof ref === 'string') {
10
- return ref;
5
+ export { isClass, ObjectUtility, ResolverUtility } from '@venizia/ignis-inversion';
6
+ export class ClassResolver {
7
+ /** Resolves a class reference, passing through string binding keys as-is. */
8
+ static resolveClass(opts) {
9
+ const { ref } = opts;
10
+ if (typeof ref === 'string') {
11
+ return ref;
12
+ }
13
+ return ResolverUtility.resolveValue({ value: ref });
11
14
  }
12
- return resolveValue({ value: ref });
13
- };
15
+ }
14
16
  //# sourceMappingURL=resolvers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.js","sourceRoot":"","sources":["../../../src/common/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,+FAA+F;AAC/F,iGAAiG;AACjG,yEAAyE;AACzE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEnG,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAI,IAE/B,EAAsB,EAAE;IACvB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACrB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AACtC,CAAC,CAAC","sourcesContent":["import { resolveValue } from '@venizia/ignis-inversion';\n\nimport type { TClass, TResolver } from './types';\n\n// The resolver vocabulary and its two readers live in inversion, the lowest layer, because the\n// container branches on them. Re-exported here so the rest of the stack reaches them through the\n// package it already depends on, instead of each layer redeclaring them.\nexport { isClass, isEmpty, omit, resolveValue, resolveValueAsync } from '@venizia/ignis-inversion';\n\n/** Resolves a class reference, passing through string binding keys as-is. */\nexport const resolveClass = <T>(opts: {\n ref: TClass<T> | TResolver<TClass<T>> | string;\n}): TClass<T> | string => {\n const { ref } = opts;\n if (typeof ref === 'string') {\n return ref;\n }\n\n return resolveValue({ value: ref });\n};\n"]}
1
+ {"version":3,"file":"resolvers.js","sourceRoot":"","sources":["../../../src/common/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,+FAA+F;AAC/F,iGAAiG;AACjG,yEAAyE;AACzE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEnF,MAAM,OAAO,aAAa;IACxB,6EAA6E;IAC7E,MAAM,CAAC,YAAY,CAAI,IAEtB;QACC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC;QACb,CAAC;QAED,OAAO,eAAe,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { ResolverUtility } from '@venizia/ignis-inversion';\n\nimport type { TClass, TResolver } from './types';\n\n// The resolver vocabulary and its two readers live in inversion, the lowest layer, because the\n// container branches on them. Re-exported here so the rest of the stack reaches them through the\n// package it already depends on, instead of each layer redeclaring them.\nexport { isClass, ObjectUtility, ResolverUtility } from '@venizia/ignis-inversion';\n\nexport class ClassResolver {\n /** Resolves a class reference, passing through string binding keys as-is. */\n static resolveClass<T>(opts: {\n ref: TClass<T> | TResolver<TClass<T>> | string;\n }): TClass<T> | string {\n const { ref } = opts;\n if (typeof ref === 'string') {\n return ref;\n }\n\n return ResolverUtility.resolveValue({ value: ref });\n }\n}\n"]}
@@ -3,6 +3,8 @@ export { EnvironmentNames } from './modules/env/names.js';
3
3
  export * from './modules/error/index.js';
4
4
  export { LogLevels } from './modules/logger/common/types.js';
5
5
  export type { ILogger, ILoggerProvider, TLogLevel } from './modules/logger/common/types.js';
6
+ export { ConsoleLogger } from './modules/logger/base/console.js';
7
+ export { LoggerFactory } from './modules/logger/factory.js';
6
8
  export * from './modules/network/http-request/fetcher/base-fetcher.js';
7
9
  export * from './modules/network/http-request/fetcher/node-fetcher.js';
8
10
  export * from './modules/network/http-request/base-network-request.helper.js';
@@ -24,9 +26,9 @@ export type { IBuildOptions, IHeightWhereOptions, ILeavesOptions, INodeWithPath,
24
26
  export { TreeWalker } from './modules/tree/walk.js';
25
27
  export { BuildInfoRegistry } from './utilities/build-info.utility.js';
26
28
  export type { IBuildInfo, TBuildInfoRecord } from './utilities/build-info.utility.js';
27
- export { blankToUndefined, int, keysToCamel, toBoolean, toCamel } from './utilities/parse.utility.js';
28
- export { executeWithPerformanceMeasure } from './utilities/performance.utility.js';
29
- export { readFormBody, RequestBodyErrors } from './utilities/form-body.utility.js';
29
+ export { ParseUtility } from './utilities/parse.utility.js';
30
+ export { PerformanceUtility } from './utilities/performance.utility.js';
31
+ export { FormBodyUtility, RequestBodyErrors } from './utilities/form-body.utility.js';
30
32
  export { ProjectRootRegistry } from './utilities/project-root.utility.js';
31
33
  export { AESAlgorithms } from './modules/crypto/algorithms/aes.constants.js';
32
34
  export type { AESAlgorithmType } from './modules/crypto/algorithms/aes.constants.js';
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,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AM,kCAAkC,CAAC;AAChG,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAKvE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,YAAY,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC"}
package/dist/esm/core.js CHANGED
@@ -4,6 +4,10 @@ export { BaseHelper } from './modules/base.js';
4
4
  export { EnvironmentNames } from './modules/env/names.js';
5
5
  export * from './modules/error/index.js';
6
6
  export { LogLevels } from './modules/logger/common/types.js';
7
+ // The one way to get a logger, the same in the browser and on the server: `LoggerFactory` imports nothing from node, and its
8
+ // default provider is the console. An application chooses another with `LoggerFactory.use({ provider, level })`.
9
+ export { ConsoleLogger } from './modules/logger/base/console.js';
10
+ export { LoggerFactory } from './modules/logger/factory.js';
7
11
  export * from './modules/network/http-request/fetcher/base-fetcher.js';
8
12
  // The node fetcher carries no node builtin - its one `querystring.stringify` is written out - so the
9
13
  // framework HTTP layer is reachable from a browser bundle, and a connector on HTTP need not
@@ -29,9 +33,9 @@ export { TreeWalker } from './modules/tree/walk.js';
29
33
  // cannot itself become a subpath. Named one at a time here instead of widening the barrel: every
30
34
  // symbol below is verified free of node builtins/globals.
31
35
  export { BuildInfoRegistry } from './utilities/build-info.utility.js';
32
- export { blankToUndefined, int, keysToCamel, toBoolean, toCamel } from './utilities/parse.utility.js';
33
- export { executeWithPerformanceMeasure } from './utilities/performance.utility.js';
34
- export { readFormBody, RequestBodyErrors } from './utilities/form-body.utility.js';
36
+ export { ParseUtility } from './utilities/parse.utility.js';
37
+ export { PerformanceUtility } from './utilities/performance.utility.js';
38
+ export { FormBodyUtility, RequestBodyErrors } from './utilities/form-body.utility.js';
35
39
  export { ProjectRootRegistry } from './utilities/project-root.utility.js';
36
40
  // Type-only: erased at compile time, so re-exporting these carries no runtime/bundle cost even
37
41
  // though the concrete classes they describe (crypto algorithms, the ioredis-backed helper) are not
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,6FAA6F;AAC7F,8DAA8D;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,cAAc,qDAAqD,CAAC;AACpE,qGAAqG;AACrG,4FAA4F;AAC5F,oBAAoB;AACpB,cAAc,qDAAqD,CAAC;AACpE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,iGAAiG;AACjG,yFAAyF;AACzF,cAAc,yDAAyD,CAAC;AAExE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAG5F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAcrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,gGAAgG;AAChG,6FAA6F;AAC7F,iGAAiG;AACjG,0DAA0D;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,+FAA+F;AAC/F,mGAAmG;AACnG,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["export { BaseHelper } from './modules/base';\n// By name, never `export *` from `./modules/env`: that barrel also carries `Environment` and\n// `applicationEnvironment`, both of which read `process.env`.\nexport { EnvironmentNames } from './modules/env/names';\nexport * from './modules/error';\nexport { LogLevels } from './modules/logger/common/types';\nexport type { ILogger, ILoggerProvider, TLogLevel } from './modules/logger/common/types';\nexport * from './modules/network/http-request/fetcher/base-fetcher';\n// The node fetcher carries no node builtin - its one `querystring.stringify` is written out - so the\n// framework HTTP layer is reachable from a browser bundle, and a connector on HTTP need not\n// re-implement one.\nexport * from './modules/network/http-request/fetcher/node-fetcher';\nexport * from './modules/network/http-request/base-network-request.helper';\nexport * from './modules/pool';\nexport * from './modules/queue/internal/hf';\nexport * from './modules/temporal';\nexport * from './modules/uid';\n// The url guard, pure half only: `UrlPolicy` decides a url and a literal address with string and\n// number work. Its sibling `UrlIngest` reaches `node:dns` and stays out of this subpath.\nexport * from './modules/network/utilities/url-safety/common/constants';\nexport type { IUrlSafetyPolicy } from './modules/network/utilities/url-safety/common/types';\nexport * from './modules/network/utilities/url-safety/policy';\nexport * from './modules/network/utilities/query-string';\nexport { RetryBackoffStrategies, RetryJitterModes } from './modules/retry/common/constants';\nexport type { TRetryBackoffStrategy, TRetryJitterMode } from './modules/retry/common/constants';\nexport type { IRetryBackoffOptions, IRetryContext } from './modules/retry/common/types';\nexport { RetryHelper } from './modules/retry/helper';\nexport { SlugHelper } from './modules/slug/helper';\nexport { TreeBuilder } from './modules/tree/builder';\nexport type {\n IBuildOptions,\n IHeightWhereOptions,\n ILeavesOptions,\n INodeWithPath,\n IPrintOptions,\n ITreeNode,\n IWalkAsyncOptions,\n IWalkOptions,\n TNodePredicate,\n TOnVisit,\n TOnVisitAsync,\n} from './modules/tree/common/types';\nexport { TreeWalker } from './modules/tree/walk';\n\n// Pure value/type utilities that already live under the root barrel's `./utilities` re-export -\n// that barrel also carries node-only siblings (module.utility.ts, request.utility.ts), so it\n// cannot itself become a subpath. Named one at a time here instead of widening the barrel: every\n// symbol below is verified free of node builtins/globals.\nexport { BuildInfoRegistry } from './utilities/build-info.utility';\nexport type { IBuildInfo, TBuildInfoRecord } from './utilities/build-info.utility';\nexport { blankToUndefined, int, keysToCamel, toBoolean, toCamel } from './utilities/parse.utility';\nexport { executeWithPerformanceMeasure } from './utilities/performance.utility';\nexport { readFormBody, RequestBodyErrors } from './utilities/form-body.utility';\nexport { ProjectRootRegistry } from './utilities/project-root.utility';\n\n// Type-only: erased at compile time, so re-exporting these carries no runtime/bundle cost even\n// though the concrete classes they describe (crypto algorithms, the ioredis-backed helper) are not\n// themselves part of this pure surface.\nexport { AESAlgorithms } from './modules/crypto/algorithms/aes.constants';\nexport type { AESAlgorithmType } from './modules/crypto/algorithms/aes.constants';\nexport type { IPayloadCipher } from './modules/crypto/common/types';\nexport type { IRedisHelper } from './modules/redis/common/interfaces';\n"]}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,6FAA6F;AAC7F,8DAA8D;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,6HAA6H;AAC7H,iHAAiH;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,cAAc,qDAAqD,CAAC;AACpE,qGAAqG;AACrG,4FAA4F;AAC5F,oBAAoB;AACpB,cAAc,qDAAqD,CAAC;AACpE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,iGAAiG;AACjG,yFAAyF;AACzF,cAAc,yDAAyD,CAAC;AAExE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAG5F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAcrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,gGAAgG;AAChG,6FAA6F;AAC7F,iGAAiG;AACjG,0DAA0D;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,+FAA+F;AAC/F,mGAAmG;AACnG,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["export { BaseHelper } from './modules/base';\n// By name, never `export *` from `./modules/env`: that barrel also carries `Environment` and\n// `applicationEnvironment`, both of which read `process.env`.\nexport { EnvironmentNames } from './modules/env/names';\nexport * from './modules/error';\nexport { LogLevels } from './modules/logger/common/types';\nexport type { ILogger, ILoggerProvider, TLogLevel } from './modules/logger/common/types';\n// The one way to get a logger, the same in the browser and on the server: `LoggerFactory` imports nothing from node, and its\n// default provider is the console. An application chooses another with `LoggerFactory.use({ provider, level })`.\nexport { ConsoleLogger } from './modules/logger/base/console';\nexport { LoggerFactory } from './modules/logger/factory';\nexport * from './modules/network/http-request/fetcher/base-fetcher';\n// The node fetcher carries no node builtin - its one `querystring.stringify` is written out - so the\n// framework HTTP layer is reachable from a browser bundle, and a connector on HTTP need not\n// re-implement one.\nexport * from './modules/network/http-request/fetcher/node-fetcher';\nexport * from './modules/network/http-request/base-network-request.helper';\nexport * from './modules/pool';\nexport * from './modules/queue/internal/hf';\nexport * from './modules/temporal';\nexport * from './modules/uid';\n// The url guard, pure half only: `UrlPolicy` decides a url and a literal address with string and\n// number work. Its sibling `UrlIngest` reaches `node:dns` and stays out of this subpath.\nexport * from './modules/network/utilities/url-safety/common/constants';\nexport type { IUrlSafetyPolicy } from './modules/network/utilities/url-safety/common/types';\nexport * from './modules/network/utilities/url-safety/policy';\nexport * from './modules/network/utilities/query-string';\nexport { RetryBackoffStrategies, RetryJitterModes } from './modules/retry/common/constants';\nexport type { TRetryBackoffStrategy, TRetryJitterMode } from './modules/retry/common/constants';\nexport type { IRetryBackoffOptions, IRetryContext } from './modules/retry/common/types';\nexport { RetryHelper } from './modules/retry/helper';\nexport { SlugHelper } from './modules/slug/helper';\nexport { TreeBuilder } from './modules/tree/builder';\nexport type {\n IBuildOptions,\n IHeightWhereOptions,\n ILeavesOptions,\n INodeWithPath,\n IPrintOptions,\n ITreeNode,\n IWalkAsyncOptions,\n IWalkOptions,\n TNodePredicate,\n TOnVisit,\n TOnVisitAsync,\n} from './modules/tree/common/types';\nexport { TreeWalker } from './modules/tree/walk';\n\n// Pure value/type utilities that already live under the root barrel's `./utilities` re-export -\n// that barrel also carries node-only siblings (module.utility.ts, request.utility.ts), so it\n// cannot itself become a subpath. Named one at a time here instead of widening the barrel: every\n// symbol below is verified free of node builtins/globals.\nexport { BuildInfoRegistry } from './utilities/build-info.utility';\nexport type { IBuildInfo, TBuildInfoRecord } from './utilities/build-info.utility';\nexport { ParseUtility } from './utilities/parse.utility';\nexport { PerformanceUtility } from './utilities/performance.utility';\nexport { FormBodyUtility, RequestBodyErrors } from './utilities/form-body.utility';\nexport { ProjectRootRegistry } from './utilities/project-root.utility';\n\n// Type-only: erased at compile time, so re-exporting these carries no runtime/bundle cost even\n// though the concrete classes they describe (crypto algorithms, the ioredis-backed helper) are not\n// themselves part of this pure surface.\nexport { AESAlgorithms } from './modules/crypto/algorithms/aes.constants';\nexport type { AESAlgorithmType } from './modules/crypto/algorithms/aes.constants';\nexport type { IPayloadCipher } from './modules/crypto/common/types';\nexport type { IRedisHelper } from './modules/redis/common/interfaces';\n"]}
@@ -8,7 +8,7 @@ export declare class BaseHelper {
8
8
  });
9
9
  /** The helper's logger, resolved on first read - a helper that never logs never builds one. */
10
10
  get logger(): ILogger;
11
- /** Installs one logger on this helper - a test spy, or a host overriding the global resolver. */
11
+ /** Installs one logger on this helper - a test spy, or a host overriding the factory's logger. */
12
12
  set logger(value: ILogger);
13
13
  getIdentifier(): string;
14
14
  getLogger(): ILogger;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/modules/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG7D,qBAAa,UAAU;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAKxD,+FAA+F;IAC/F,IAAI,MAAM,IAAI,OAAO,CAWpB;IAED,iGAAiG;IACjG,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED,aAAa;IAIb,SAAS,IAAI,OAAO;CAGrB"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/modules/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAY7D,qBAAa,UAAU;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAKxD,+FAA+F;IAC/F,IAAI,MAAM,IAAI,OAAO,CAWpB;IAED,kGAAkG;IAClG,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED,aAAa;IAIb,SAAS,IAAI,OAAO;CAGrB"}
@@ -1,4 +1,13 @@
1
- import { pinHelperLogger, resolveHelperLogger } from './logger/slot.js';
1
+ import { LoggerFactory } from './logger/factory.js';
2
+ /** Pins a logger on a helper instance: later reads are a plain property read, not its getter. A module function, not a private static: a mixin that extends `BaseHelper` could not be emitted with a private member. */
3
+ const pinLogger = (opts) => {
4
+ Object.defineProperty(opts.helper, 'logger', {
5
+ value: opts.logger,
6
+ writable: true,
7
+ configurable: true,
8
+ enumerable: false,
9
+ });
10
+ };
2
11
  export class BaseHelper {
3
12
  constructor(opts) {
4
13
  this.scope = opts.scope ?? '';
@@ -7,16 +16,16 @@ export class BaseHelper {
7
16
  /** The helper's logger, resolved on first read - a helper that never logs never builds one. */
8
17
  get logger() {
9
18
  const scopes = [this.scope, this.identifier].filter((scope) => typeof scope === 'string' && scope.length > 0);
10
- const logger = resolveHelperLogger({ scopes });
19
+ const logger = LoggerFactory.getLogger(scopes);
11
20
  // Read off a prototype (reflection walks them), pinning would shadow this getter for every instance.
12
21
  if (Object.hasOwn(this, 'scope')) {
13
- pinHelperLogger({ helper: this, logger });
22
+ pinLogger({ helper: this, logger });
14
23
  }
15
24
  return logger;
16
25
  }
17
- /** Installs one logger on this helper - a test spy, or a host overriding the global resolver. */
26
+ /** Installs one logger on this helper - a test spy, or a host overriding the factory's logger. */
18
27
  set logger(value) {
19
- pinHelperLogger({ helper: this, logger: value });
28
+ pinLogger({ helper: this, logger: value });
20
29
  }
21
30
  getIdentifier() {
22
31
  return this.identifier;
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/modules/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,MAAM,OAAO,UAAU;IAIrB,YAAY,IAA4C;QACtD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,+FAA+F;IAC/F,IAAI,MAAM;QACR,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CACjD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CACzD,CAAC;QACF,MAAM,MAAM,GAAG,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAE/C,qGAAqG;QACrG,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;YACjC,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,iGAAiG;IACjG,IAAI,MAAM,CAAC,KAAc;QACvB,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["import { type ILogger } from '@/modules/logger/common/types';\nimport { pinHelperLogger, resolveHelperLogger } from '@/modules/logger/slot';\n\nexport class BaseHelper {\n scope: string;\n identifier: string;\n\n constructor(opts: { scope: string; identifier?: string }) {\n this.scope = opts.scope ?? '';\n this.identifier = opts.identifier ?? '';\n }\n\n /** The helper's logger, resolved on first read - a helper that never logs never builds one. */\n get logger(): ILogger {\n const scopes = [this.scope, this.identifier].filter(\n (scope) => typeof scope === 'string' && scope.length > 0,\n );\n const logger = resolveHelperLogger({ scopes });\n\n // Read off a prototype (reflection walks them), pinning would shadow this getter for every instance.\n if (Object.hasOwn(this, 'scope')) {\n pinHelperLogger({ helper: this, logger });\n }\n return logger;\n }\n\n /** Installs one logger on this helper - a test spy, or a host overriding the global resolver. */\n set logger(value: ILogger) {\n pinHelperLogger({ helper: this, logger: value });\n }\n\n getIdentifier() {\n return this.identifier;\n }\n\n getLogger(): ILogger {\n return this.logger;\n }\n}\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AAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["import { LoggerFactory } from '@/modules/logger/factory';\nimport { type ILogger } from '@/modules/logger/common/types';\n\n/** Pins a logger on a helper instance: later reads are a plain property read, not its getter. A module function, not a private static: a mixin that extends `BaseHelper` could not be emitted with a private member. */\nconst pinLogger = (opts: { helper: object; logger: ILogger }): void => {\n Object.defineProperty(opts.helper, 'logger', {\n value: opts.logger,\n writable: true,\n configurable: true,\n enumerable: false,\n });\n};\n\nexport class BaseHelper {\n scope: string;\n identifier: string;\n\n constructor(opts: { scope: string; identifier?: string }) {\n this.scope = opts.scope ?? '';\n this.identifier = opts.identifier ?? '';\n }\n\n /** The helper's logger, resolved on first read - a helper that never logs never builds one. */\n get logger(): ILogger {\n const scopes = [this.scope, this.identifier].filter(\n (scope) => typeof scope === 'string' && scope.length > 0,\n );\n const logger = LoggerFactory.getLogger(scopes);\n\n // Read off a prototype (reflection walks them), pinning would shadow this getter for every instance.\n if (Object.hasOwn(this, 'scope')) {\n pinLogger({ helper: this, logger });\n }\n return logger;\n }\n\n /** Installs one logger on this helper - a test spy, or a host overriding the factory's logger. */\n set logger(value: ILogger) {\n pinLogger({ helper: this, logger: value });\n }\n\n getIdentifier() {\n return this.identifier;\n }\n\n getLogger(): ILogger {\n return this.logger;\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { isEmpty } from '@venizia/ignis-inversion';
1
+ import { ObjectUtility } from '@venizia/ignis-inversion';
2
2
  import { BaseHelper } from '../base.js';
3
- import { voidExecution } from '../../utilities/promise.utility.js';
3
+ import { PromiseUtility } from '../../utilities/promise.utility.js';
4
4
  import { CronJob, CronTime } from 'cron';
5
5
  import { ApplicationError } from '../error/index.js';
6
6
  export class CronHelper extends BaseHelper {
@@ -20,7 +20,7 @@ export class CronHelper extends BaseHelper {
20
20
  }
21
21
  /** Builds the job. Synchronous, so the constructor still THROWS on a bad cronTime. */
22
22
  buildInstance() {
23
- if (!this.cronTime || isEmpty({ value: this.cronTime })) {
23
+ if (!this.cronTime || ObjectUtility.isEmpty({ value: this.cronTime })) {
24
24
  throw ApplicationError.getError({
25
25
  message: '[CronHelper][configure] Invalid cronTime to configure application cron!',
26
26
  });
@@ -76,7 +76,7 @@ export class CronHelper extends BaseHelper {
76
76
  this.instance.setTime(nextCronTime);
77
77
  this.cronTime = cronTime;
78
78
  if (shouldFireOnTick) {
79
- voidExecution({
79
+ PromiseUtility.voidExecution({
80
80
  logger: this.logger,
81
81
  scope: this.modifyCronTime.name,
82
82
  execution: this.instance.fireOnTick(),
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/modules/cron/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAA8B,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAW5C,MAAM,OAAO,UAAW,SAAQ,UAAU;IAUxC,YAAY,IAAwB;QAClC,KAAK,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QAEhF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QACpF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;Q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CAAC;IAED,SAAS,CAAC,IAA0B;QAClC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,MAAM,OAAO,GAAuB;YAClC,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;QAEF,OAAO,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["import { isEmpty } from '@venizia/ignis-inversion';\nimport { BaseHelper } from '@/modules/base';\nimport { voidExecution } from '@/utilities/promise.utility';\nimport { CronJob, type CronOnCompleteCommand, CronTime } from 'cron';\nimport { ApplicationError } from '../error';\n\nexport interface ICronHelperOptions {\n cronTime: string;\n onTick: () => void | Promise<void>;\n onCompleted?: CronOnCompleteCommand | null;\n autoStart?: boolean;\n tz?: string;\n errorHandler?: (error: unknown) => void | null;\n}\n\nexport class CronHelper extends BaseHelper {\n private cronTime: string;\n private onTick: () => void | Promise<void>;\n private onCompleted?: CronOnCompleteCommand | null;\n private autoStart: boolean;\n private tz?: string;\n private errorHandler?: (error: unknown) => void | null;\n\n public instance: CronJob;\n\n constructor(opts: ICronHelperOptions) {\n super({ scope: CronHelper.name, identifier: opts.cronTime ?? CronHelper.name });\n\n const { cronTime, onTick, onCompleted, autoStart = false, tz, errorHandler } = opts;\n this.cronTime = cronTime;\n this.onTick = onTick;\n this.onCompleted = onCompleted;\n this.autoStart = autoStart ?? false;\n this.tz = tz;\n this.errorHandler = errorHandler;\n\n this.buildInstance();\n }\n\n static newInstance(opts: ICronHelperOptions) {\n return new CronHelper(opts);\n }\n\n /** Builds the job. Synchronous, so the constructor still THROWS on a bad cronTime. */\n protected buildInstance(): void {\n if (!this.cronTime || isEmpty({ value: this.cronTime })) {\n throw ApplicationError.getError({\n message: '[CronHelper][configure] Invalid cronTime to configure application cron!',\n });\n }\n\n try {\n this.instance = CronJob.from({\n cronTime: this.cronTime,\n onTick: this.onTick,\n onComplete: this.onCompleted,\n start: this.autoStart,\n errorHandler: this.errorHandler,\n timeZone: this.tz,\n });\n } catch (error) {\n throw ApplicationError.getError({\n message: `[CronHelper][configure] Invalid cron expression | cronTime: ${this.cronTime} | error: ${error}`,\n });\n }\n }\n\n /** Async because `CronJob.stop()` resolves only once an in-flight tick finishes; fire-and-forgetting it would let the replacement job start while the old handler is still running. */\n async configure(): Promise<void> {\n if (this.instance) {\n await this.instance.stop();\n }\n\n this.buildInstance();\n }\n\n start() {\n if (!this.instance) {\n this.logger.for('start').error(' Invalid cron instance to start cronjob!');\n return;\n }\n\n this.instance.start();\n }\n\n async stop() {\n if (!this.instance) {\n this.logger.for(this.stop.name).error('Invalid cron instance to stop cronjob!');\n return;\n }\n\n await this.instance.stop();\n }\n\n modifyCronTime(opts: { cronTime: string; shouldFireOnTick?: boolean }) {\n const { cronTime, shouldFireOnTick = false } = opts;\n\n let nextCronTime: CronTime;\n try {\n nextCronTime = new CronTime(cronTime, this.tz);\n } catch (error) {\n throw ApplicationError.getError({\n message: `[CronHelper][modifyCronTime] Invalid cron expression | cronTime: ${cronTime} | error: ${error}`,\n });\n }\n\n this.instance.setTime(nextCronTime);\n this.cronTime = cronTime;\n\n if (shouldFireOnTick) {\n voidExecution({\n logger: this.logger,\n scope: this.modifyCronTime.name,\n execution: this.instance.fireOnTick(),\n });\n }\n }\n\n duplicate(opts: { cronTime: string }) {\n const { cronTime } = opts;\n\n const options: ICronHelperOptions = {\n cronTime: cronTime,\n onTick: this.onTick,\n onCompleted: this.onCompleted,\n autoStart: this.autoStart,\n tz: this.tz,\n errorHandler: this.errorHandler,\n };\n\n return CronHelper.newInstance(options);\n }\n}\n"]}
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/modules/cron/helper.ts"],"names":[],"mappings":"A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AED,cAAc,CAAC,IAAsD;QACnE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;QAEpD,IAAI,YAAsB,CAAC;QAC3B,IAAI,CAAC;YACH,YAAY,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,gBAAgB,CAAC,QAAQ,CAAC;gBAC9B,OAAO,EAAE,oEAAoE,QAAQ,aAAa,KAAK,EAAE;aAC1G,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,gBAAgB,EAAE,CAAC;YACrB,cAAc,CAAC,aAAa,CAAC;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI;gBAC/B,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;aACtC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,SAAS,CAAC,IAA0B;QAClC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,MAAM,OAAO,GAAuB;YAClC,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;QAEF,OAAO,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["import { ObjectUtility } from '@venizia/ignis-inversion';\nimport { BaseHelper } from '@/modules/base';\nimport { PromiseUtility } from '@/utilities/promise.utility';\nimport { CronJob, type CronOnCompleteCommand, CronTime } from 'cron';\nimport { ApplicationError } from '../error';\n\nexport interface ICronHelperOptions {\n cronTime: string;\n onTick: () => void | Promise<void>;\n onCompleted?: CronOnCompleteCommand | null;\n autoStart?: boolean;\n tz?: string;\n errorHandler?: (error: unknown) => void | null;\n}\n\nexport class CronHelper extends BaseHelper {\n private cronTime: string;\n private onTick: () => void | Promise<void>;\n private onCompleted?: CronOnCompleteCommand | null;\n private autoStart: boolean;\n private tz?: string;\n private errorHandler?: (error: unknown) => void | null;\n\n public instance: CronJob;\n\n constructor(opts: ICronHelperOptions) {\n super({ scope: CronHelper.name, identifier: opts.cronTime ?? CronHelper.name });\n\n const { cronTime, onTick, onCompleted, autoStart = false, tz, errorHandler } = opts;\n this.cronTime = cronTime;\n this.onTick = onTick;\n this.onCompleted = onCompleted;\n this.autoStart = autoStart ?? false;\n this.tz = tz;\n this.errorHandler = errorHandler;\n\n this.buildInstance();\n }\n\n static newInstance(opts: ICronHelperOptions) {\n return new CronHelper(opts);\n }\n\n /** Builds the job. Synchronous, so the constructor still THROWS on a bad cronTime. */\n protected buildInstance(): void {\n if (!this.cronTime || ObjectUtility.isEmpty({ value: this.cronTime })) {\n throw ApplicationError.getError({\n message: '[CronHelper][configure] Invalid cronTime to configure application cron!',\n });\n }\n\n try {\n this.instance = CronJob.from({\n cronTime: this.cronTime,\n onTick: this.onTick,\n onComplete: this.onCompleted,\n start: this.autoStart,\n errorHandler: this.errorHandler,\n timeZone: this.tz,\n });\n } catch (error) {\n throw ApplicationError.getError({\n message: `[CronHelper][configure] Invalid cron expression | cronTime: ${this.cronTime} | error: ${error}`,\n });\n }\n }\n\n /** Async because `CronJob.stop()` resolves only once an in-flight tick finishes; fire-and-forgetting it would let the replacement job start while the old handler is still running. */\n async configure(): Promise<void> {\n if (this.instance) {\n await this.instance.stop();\n }\n\n this.buildInstance();\n }\n\n start() {\n if (!this.instance) {\n this.logger.for('start').error(' Invalid cron instance to start cronjob!');\n return;\n }\n\n this.instance.start();\n }\n\n async stop() {\n if (!this.instance) {\n this.logger.for(this.stop.name).error('Invalid cron instance to stop cronjob!');\n return;\n }\n\n await this.instance.stop();\n }\n\n modifyCronTime(opts: { cronTime: string; shouldFireOnTick?: boolean }) {\n const { cronTime, shouldFireOnTick = false } = opts;\n\n let nextCronTime: CronTime;\n try {\n nextCronTime = new CronTime(cronTime, this.tz);\n } catch (error) {\n throw ApplicationError.getError({\n message: `[CronHelper][modifyCronTime] Invalid cron expression | cronTime: ${cronTime} | error: ${error}`,\n });\n }\n\n this.instance.setTime(nextCronTime);\n this.cronTime = cronTime;\n\n if (shouldFireOnTick) {\n PromiseUtility.voidExecution({\n logger: this.logger,\n scope: this.modifyCronTime.name,\n execution: this.instance.fireOnTick(),\n });\n }\n }\n\n duplicate(opts: { cronTime: string }) {\n const { cronTime } = opts;\n\n const options: ICronHelperOptions = {\n cronTime: cronTime,\n onTick: this.onTick,\n onCompleted: this.onCompleted,\n autoStart: this.autoStart,\n tz: this.tz,\n errorHandler: this.errorHandler,\n };\n\n return CronHelper.newInstance(options);\n }\n}\n"]}