@mrxsys/mrx-core 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/dist/chunk-00s6t4tw.js +26 -0
  2. package/dist/{chunk-sepwfqdh.js → chunk-0601exyg.js} +2 -1
  3. package/dist/chunk-4mvsje21.js +7 -0
  4. package/dist/chunk-547mr88s.js +10 -0
  5. package/dist/chunk-5pwb7peq.js +9 -0
  6. package/dist/{chunk-syhskygx.js → chunk-6g29g0tk.js} +15 -24
  7. package/dist/{chunk-z1skzn1j.js → chunk-6tqh339a.js} +4 -3
  8. package/dist/{chunk-m18th1g5.js → chunk-75hgws2d.js} +18 -39
  9. package/dist/chunk-8y9b2m5a.js +53 -0
  10. package/dist/chunk-9cgzhc50.js +15 -0
  11. package/dist/chunk-9dzsj7f2.js +23 -0
  12. package/dist/{chunk-kv9hms2z.js → chunk-b23dvm2d.js} +2 -1
  13. package/dist/chunk-b6f6ez2w.js +8 -0
  14. package/dist/{chunk-zaje5tv4.js → chunk-c9vjf06h.js} +31 -30
  15. package/dist/chunk-d9skk4k9.js +249 -0
  16. package/dist/{chunk-5qtpggzv.js → chunk-grfyngq0.js} +3 -2
  17. package/dist/{chunk-4n72ks5x.js → chunk-h4dyeeqg.js} +4 -5
  18. package/dist/{chunk-9nw6qekv.js → chunk-h9t48r9q.js} +2 -1
  19. package/dist/{chunk-7g8k2epn.js → chunk-k9dtqf1p.js} +6 -9
  20. package/dist/{chunk-26brdrbz.js → chunk-kje1qysg.js} +59 -46
  21. package/dist/{chunk-4mt568fz.js → chunk-m3grz32t.js} +4 -3
  22. package/dist/{chunk-yvyahr2h.js → chunk-mvrxngm7.js} +2 -1
  23. package/dist/{chunk-j28jpfv2.js → chunk-n6d9ncnv.js} +2 -1
  24. package/dist/chunk-ngrxhdkb.js +32 -0
  25. package/dist/{chunk-79mw7w0g.js → chunk-nvt16s80.js} +2 -1
  26. package/dist/{chunk-yd82hdxv.js → chunk-w1547qd4.js} +2 -1
  27. package/dist/chunk-yagxbm1r.js +9 -0
  28. package/dist/{chunk-snqdnkk7.js → chunk-z9a175mk.js} +4 -3
  29. package/dist/{chunk-r1kcf1q6.js → chunk-zwrygafm.js} +5 -6
  30. package/dist/errors/base-error.d.ts +5 -0
  31. package/dist/errors/enums/index.d.ts +1 -1
  32. package/dist/errors/enums/index.js +1 -1
  33. package/dist/errors/http-error.d.ts +11 -0
  34. package/dist/errors/index.d.ts +2 -2
  35. package/dist/errors/index.js +3 -3
  36. package/dist/errors/utils/index.d.ts +1 -0
  37. package/dist/errors/utils/index.js +16 -0
  38. package/dist/errors/utils/is-nowarajs-error.ts.d.ts +4 -0
  39. package/dist/modules/data/data.d.ts +2 -2
  40. package/dist/modules/data/enums/index.d.ts +1 -1
  41. package/dist/modules/data/enums/index.js +1 -1
  42. package/dist/modules/data/index.js +3 -3
  43. package/dist/modules/data/transformers/{camelCase.d.ts → camel-case.d.ts} +2 -2
  44. package/dist/modules/data/transformers/index.d.ts +4 -4
  45. package/dist/modules/data/transformers/index.js +4 -4
  46. package/dist/modules/data/transformers/{kebabCase.d.ts → kebab-case.d.ts} +2 -2
  47. package/dist/modules/data/transformers/{pascalCase.d.ts → pascal-case.d.ts} +2 -2
  48. package/dist/modules/data/transformers/{snakeCase.d.ts → snake-case.d.ts} +2 -2
  49. package/dist/modules/data/types/index.d.ts +10 -10
  50. package/dist/modules/data/types/{pascalCase.d.ts → pascal-case.d.ts} +1 -1
  51. package/dist/modules/data/types/{transformKeysCamelCase.d.ts → transform-keys-camel-case.d.ts} +1 -1
  52. package/dist/modules/data/types/{transformKeysKebabCase.d.ts → transform-keys-kebab-case.d.ts} +1 -1
  53. package/dist/modules/data/types/{transformKeysPascalCase.d.ts → transform-keys-pascal-case.d.ts} +1 -1
  54. package/dist/modules/data/types/{transformKeysSnakeCase.d.ts → transform-keys-snake-case.d.ts} +1 -1
  55. package/dist/modules/data/types/{transformObjectKeys.d.ts → transform-object-keys.d.ts} +8 -8
  56. package/dist/modules/database/enums/index.d.ts +2 -2
  57. package/dist/modules/database/enums/index.js +1 -1
  58. package/dist/modules/database/events/index.d.ts +2 -2
  59. package/dist/modules/database/events/{mssqlEventMap.d.ts → mssql-event-map.d.ts} +1 -1
  60. package/dist/modules/database/events/{tableEventMap.d.ts → table-event-map.d.ts} +1 -1
  61. package/dist/modules/database/index.js +8 -8
  62. package/dist/modules/database/mssql.d.ts +3 -3
  63. package/dist/modules/database/table.d.ts +2 -2
  64. package/dist/modules/database/types/index.d.ts +3 -3
  65. package/dist/modules/elysia/cache/cache.d.ts +16 -133
  66. package/dist/modules/elysia/cache/index.js +8 -6
  67. package/dist/modules/elysia/cache/types/{cacheOptions.d.ts → cache-options.d.ts} +1 -1
  68. package/dist/modules/elysia/cache/types/index.d.ts +1 -1
  69. package/dist/modules/elysia/cache/utils/index.d.ts +1 -1
  70. package/dist/modules/elysia/cache/utils/index.js +1 -1
  71. package/dist/modules/elysia/{crudSchema/crudSchema.d.ts → crud/crud-schema.d.ts} +4 -4
  72. package/dist/modules/elysia/crud/crud.d.ts +34 -42
  73. package/dist/modules/elysia/crud/index.d.ts +1 -0
  74. package/dist/modules/elysia/crud/index.js +125 -280
  75. package/dist/modules/elysia/crud/operations/count.d.ts +258 -0
  76. package/dist/modules/elysia/crud/operations/delete.d.ts +258 -0
  77. package/dist/modules/elysia/crud/operations/deleteOne.d.ts +258 -0
  78. package/dist/modules/elysia/crud/operations/find.d.ts +258 -0
  79. package/dist/modules/elysia/crud/operations/findOne.d.ts +258 -0
  80. package/dist/modules/elysia/crud/operations/index.d.ts +8 -0
  81. package/dist/modules/elysia/crud/operations/index.js +33 -0
  82. package/dist/modules/elysia/crud/operations/insert.d.ts +258 -0
  83. package/dist/modules/elysia/crud/operations/update.d.ts +268 -0
  84. package/dist/modules/elysia/crud/operations/updateOne.d.ts +268 -0
  85. package/dist/modules/elysia/crud/operations/utils/get-db-injection.d.ts +8 -0
  86. package/dist/modules/elysia/{crudSchema/types/adaptiveWhereClauseSchema.d.ts → crud/types/adaptive-where-clause-schema.d.ts} +1 -1
  87. package/dist/modules/elysia/crud/types/count-response-200-schema.d.ts +5 -0
  88. package/dist/modules/elysia/crud/types/count-schema.d.ts +10 -0
  89. package/dist/modules/elysia/crud/types/crud-operation-base.d.ts +4 -0
  90. package/dist/modules/elysia/crud/types/crud-operation-count.d.ts +14 -0
  91. package/dist/modules/elysia/crud/types/crud-operation-delete-one.d.ts +14 -0
  92. package/dist/modules/elysia/crud/types/crud-operation-delete.d.ts +14 -0
  93. package/dist/modules/elysia/crud/types/crud-operation-find-one.d.ts +14 -0
  94. package/dist/modules/elysia/crud/types/crud-operation-find.d.ts +14 -0
  95. package/dist/modules/elysia/crud/types/crud-operation-insert.d.ts +14 -0
  96. package/dist/modules/elysia/crud/types/crud-operation-update-one.d.ts +16 -0
  97. package/dist/modules/elysia/crud/types/crud-operation-update.d.ts +14 -0
  98. package/dist/modules/elysia/crud/types/crud-operations.d.ts +19 -0
  99. package/dist/modules/elysia/crud/types/crud-options.d.ts +44 -0
  100. package/dist/modules/elysia/crud/types/crud-schema-models-type.d.ts +12 -0
  101. package/dist/modules/elysia/{crudSchema/types/crudSchemaOptions.d.ts → crud/types/crud-schema-options.d.ts} +1 -1
  102. package/dist/modules/elysia/crud/types/delete-schema.d.ts +12 -0
  103. package/dist/modules/elysia/crud/types/filter-schema.d.ts +9 -0
  104. package/dist/modules/elysia/crud/types/find-schema.d.ts +16 -0
  105. package/dist/modules/elysia/{crudSchema/utils/createIdParamSchema.d.ts → crud/types/id-param-schema.d.ts} +1 -1
  106. package/dist/modules/elysia/crud/types/index.d.ts +29 -11
  107. package/dist/modules/elysia/crud/types/insert-schema.d.ts +11 -0
  108. package/dist/modules/elysia/{crudSchema/types/orderSchema.d.ts → crud/types/order-schema.d.ts} +1 -1
  109. package/dist/modules/elysia/crud/types/properties-schema.d.ts +9 -0
  110. package/dist/modules/elysia/{crudSchema/types/qSchema.d.ts → crud/types/q-schema.d.ts} +1 -1
  111. package/dist/modules/elysia/crud/types/response-200-schema.d.ts +11 -0
  112. package/dist/modules/elysia/{crudSchema/types/selectedFieldSchema.d.ts → crud/types/selected-field-schema.d.ts} +1 -1
  113. package/dist/modules/elysia/crud/types/update-one-schema.d.ts +4 -0
  114. package/dist/modules/elysia/crud/types/update-schema.d.ts +13 -0
  115. package/dist/modules/elysia/{crudSchema/utils/createAdaptiveWhereClauseSchema.d.ts → crud/utils/create-adaptive-where-clause-schema.d.ts} +2 -2
  116. package/dist/modules/elysia/crud/utils/create-count-response-200-schema.d.ts +8 -0
  117. package/dist/modules/elysia/crud/utils/create-count-schema.d.ts +12 -0
  118. package/dist/modules/elysia/crud/utils/create-delete-schema.d.ts +12 -0
  119. package/dist/modules/elysia/{crudSchema/utils/createFiltersSchema.d.ts → crud/utils/create-filters-schema.d.ts} +3 -6
  120. package/dist/modules/elysia/crud/utils/create-find-schema.d.ts +12 -0
  121. package/dist/modules/elysia/crud/utils/create-id-param-schema.d.ts +2 -0
  122. package/dist/modules/elysia/crud/utils/create-insert-schema.d.ts +8 -0
  123. package/dist/modules/elysia/{crudSchema/utils/createOrderSchema.d.ts → crud/utils/create-order-schema.d.ts} +2 -2
  124. package/dist/modules/elysia/crud/utils/create-properties-schema.d.ts +12 -0
  125. package/dist/modules/elysia/{crudSchema/utils/createQSchema.d.ts → crud/utils/create-q-schema.d.ts} +2 -2
  126. package/dist/modules/elysia/crud/utils/create-response-200-schema.d.ts +3 -0
  127. package/dist/modules/elysia/{crudSchema/utils/createSelectedFieldsSchema.d.ts → crud/utils/create-selected-fields-schema.d.ts} +2 -2
  128. package/dist/modules/elysia/crud/utils/create-update-one-schema.d.ts +3 -0
  129. package/dist/modules/elysia/crud/utils/create-update-schema.d.ts +3 -0
  130. package/dist/modules/elysia/crud/utils/index.d.ts +16 -0
  131. package/dist/modules/elysia/{crudSchema → crud}/utils/index.js +7 -4
  132. package/dist/modules/elysia/{crudSchema/utils/isDateFromElysiaTypeBox.d.ts → crud/utils/is-date-from-elysia-typebox.d.ts} +1 -1
  133. package/dist/modules/elysia/db-resolver/db-resolver.d.ts +193 -0
  134. package/dist/modules/elysia/db-resolver/enums/db-resolver-error-keys.d.ts +3 -0
  135. package/dist/modules/elysia/db-resolver/enums/index.d.ts +1 -0
  136. package/dist/modules/elysia/{dbResolver → db-resolver}/enums/index.js +1 -1
  137. package/dist/modules/elysia/db-resolver/index.d.ts +1 -0
  138. package/dist/modules/elysia/db-resolver/index.js +18 -0
  139. package/dist/modules/elysia/error/error.d.ts +14 -3
  140. package/dist/modules/elysia/error/index.js +5 -5
  141. package/dist/modules/elysia/microservice/microservice.d.ts +17 -14
  142. package/dist/modules/elysia/rate-limit/enums/index.d.ts +1 -0
  143. package/dist/modules/elysia/{rateLimit → rate-limit}/enums/index.js +1 -1
  144. package/dist/modules/elysia/rate-limit/index.d.ts +1 -0
  145. package/dist/modules/elysia/{rateLimit → rate-limit}/index.js +12 -16
  146. package/dist/modules/elysia/{rateLimit/rateLimit.d.ts → rate-limit/rate-limit.d.ts} +5 -2
  147. package/dist/modules/elysia/rate-limit/types/index.d.ts +1 -0
  148. package/dist/modules/elysia/{rateLimit/types/rateLimitOptions.d.ts → rate-limit/types/rate-limit-options.d.ts} +1 -1
  149. package/dist/modules/jwt/enums/index.d.ts +2 -2
  150. package/dist/modules/jwt/enums/index.js +2 -2
  151. package/dist/modules/jwt/index.js +8 -15
  152. package/dist/modules/jwt/utils/index.d.ts +1 -1
  153. package/dist/modules/jwt/utils/index.js +3 -3
  154. package/dist/modules/kv-store/enums/index.d.ts +1 -0
  155. package/dist/modules/{kvStore → kv-store}/enums/index.js +1 -1
  156. package/dist/modules/kv-store/ioredis/index.d.ts +1 -0
  157. package/dist/modules/{kvStore → kv-store}/ioredis/index.js +7 -17
  158. package/dist/modules/{kvStore/ioredis/ioredisStore.d.ts → kv-store/ioredis/ioredis-store.d.ts} +1 -1
  159. package/dist/modules/kv-store/memory/index.d.ts +1 -0
  160. package/dist/modules/kv-store/memory/index.js +9 -0
  161. package/dist/modules/{kvStore/memory/memoryStore.d.ts → kv-store/memory/memory-store.d.ts} +1 -1
  162. package/dist/modules/kv-store/types/index.d.ts +1 -0
  163. package/dist/modules/logger/enums/index.d.ts +1 -1
  164. package/dist/modules/logger/enums/index.js +1 -1
  165. package/dist/modules/logger/enums/logger-error-keys.d.ts +6 -0
  166. package/dist/modules/logger/events/index.d.ts +1 -1
  167. package/dist/modules/logger/events/logger-events.d.ts +11 -0
  168. package/dist/modules/logger/index.js +40 -52
  169. package/dist/modules/logger/logger.d.ts +172 -172
  170. package/dist/modules/logger/sinks/console-logger.d.ts +22 -0
  171. package/dist/modules/logger/sinks/file-logger.d.ts +25 -0
  172. package/dist/modules/logger/sinks/index.d.ts +2 -0
  173. package/dist/modules/logger/{strategies → sinks}/index.js +6 -6
  174. package/dist/modules/logger/types/bodies-intersection.d.ts +2 -0
  175. package/dist/modules/logger/types/index.d.ts +6 -6
  176. package/dist/modules/logger/types/log-stream-chunk.d.ts +15 -0
  177. package/dist/modules/logger/types/{loggerStrategy.d.ts → logger-sink.d.ts} +3 -3
  178. package/dist/modules/logger/types/sink-body.d.ts +2 -0
  179. package/dist/modules/logger/types/sink-map.d.ts +2 -0
  180. package/dist/modules/mailer/enums/index.d.ts +1 -1
  181. package/dist/modules/mailer/enums/index.js +1 -1
  182. package/dist/modules/mailer/index.js +5 -8
  183. package/dist/modules/mailer/smtp.d.ts +1 -1
  184. package/dist/modules/mailer/types/index.d.ts +3 -3
  185. package/dist/modules/mailer/types/{smtpOptions.d.ts → smtp-options.d.ts} +2 -2
  186. package/dist/modules/repository/index.js +6 -6
  187. package/dist/modules/repository/repository.d.ts +5 -5
  188. package/dist/modules/repository/types/filter.d.ts +2 -2
  189. package/dist/modules/repository/types/index.d.ts +6 -6
  190. package/dist/modules/repository/types/{queryOptionsExtendPagination.d.ts → query-options-extend-pagination.d.ts} +1 -1
  191. package/dist/modules/repository/types/{queryOptionsExtendStream.d.ts → query-options-extend-stream.d.ts} +1 -1
  192. package/dist/modules/repository/types/{queryOptions.d.ts → query-options.d.ts} +4 -4
  193. package/dist/modules/singleton-manager/enums/index.d.ts +1 -0
  194. package/dist/modules/{singletonManager → singleton-manager}/enums/index.js +1 -1
  195. package/dist/modules/singleton-manager/enums/singleton-manager-error-keys.d.ts +4 -0
  196. package/dist/modules/singleton-manager/index.d.ts +1 -0
  197. package/dist/modules/singleton-manager/index.js +9 -0
  198. package/dist/modules/{singletonManager/singletonManager.d.ts → singleton-manager/singleton-manager.d.ts} +9 -11
  199. package/dist/modules/totp/enums/index.d.ts +1 -1
  200. package/dist/modules/totp/enums/index.js +1 -1
  201. package/dist/modules/totp/hotp.d.ts +1 -1
  202. package/dist/modules/totp/index.d.ts +1 -1
  203. package/dist/modules/totp/index.js +7 -13
  204. package/dist/modules/totp/{otpAuthUri.d.ts → otp-auth-uri.d.ts} +1 -1
  205. package/dist/modules/totp/totp.d.ts +2 -2
  206. package/dist/modules/totp/types/index.d.ts +3 -3
  207. package/dist/modules/totp/types/{verifyOptions.d.ts → verify-options.d.ts} +1 -1
  208. package/dist/modules/totp/utils/index.d.ts +5 -5
  209. package/dist/modules/totp/utils/index.js +7 -12
  210. package/dist/modules/typed-event-emitter/index.d.ts +1 -0
  211. package/dist/modules/{typedEventEmitter → typed-event-emitter}/index.js +1 -1
  212. package/dist/modules/typed-event-emitter/typed-event-emitter.d.ts +221 -0
  213. package/dist/modules/typed-event-emitter/types/index.d.ts +1 -0
  214. package/dist/shared/enums/index.d.ts +1 -0
  215. package/dist/{utils → shared}/enums/index.js +1 -1
  216. package/dist/shared/types/index.d.ts +3 -0
  217. package/dist/shared/types/tflatten.d.ts +5 -0
  218. package/dist/shared/utils/flatten.d.ts +3 -0
  219. package/dist/{utils → shared/utils}/index.d.ts +2 -1
  220. package/dist/{utils → shared/utils}/index.js +10 -9
  221. package/package.json +39 -41
  222. package/CHANGELOG.md +0 -98
  223. package/dist/chunk-45gt9273.js +0 -8
  224. package/dist/chunk-4xs0e8cm.js +0 -9
  225. package/dist/chunk-683sda6e.js +0 -28
  226. package/dist/chunk-7jsxw1ts.js +0 -40
  227. package/dist/chunk-dwfyt1m6.js +0 -6
  228. package/dist/chunk-g821m8gq.js +0 -77
  229. package/dist/chunk-hcc6g1fd.js +0 -7
  230. package/dist/chunk-ncc0m208.js +0 -8
  231. package/dist/chunk-vknq69e0.js +0 -23
  232. package/dist/chunk-y78xrx17.js +0 -54
  233. package/dist/errors/baseError.d.ts +0 -9
  234. package/dist/errors/httpError.d.ts +0 -14
  235. package/dist/errors/types/baseErrorOptions.d.ts +0 -15
  236. package/dist/errors/types/httpErrorOptions.d.ts +0 -13
  237. package/dist/errors/types/index.d.ts +0 -2
  238. package/dist/modules/elysia/crud/types/crudOperationBaseOptions.d.ts +0 -6
  239. package/dist/modules/elysia/crud/types/crudOperationCountOptions.d.ts +0 -2
  240. package/dist/modules/elysia/crud/types/crudOperationDeleteOneOptions.d.ts +0 -2
  241. package/dist/modules/elysia/crud/types/crudOperationDeleteOptions.d.ts +0 -2
  242. package/dist/modules/elysia/crud/types/crudOperationFindOneOptions.d.ts +0 -2
  243. package/dist/modules/elysia/crud/types/crudOperationFindOptions.d.ts +0 -2
  244. package/dist/modules/elysia/crud/types/crudOperationInsertOptions.d.ts +0 -2
  245. package/dist/modules/elysia/crud/types/crudOperationUpdateOneOptions.d.ts +0 -2
  246. package/dist/modules/elysia/crud/types/crudOperationUpdateOptions.d.ts +0 -2
  247. package/dist/modules/elysia/crud/types/crudOperationsOptions.d.ts +0 -18
  248. package/dist/modules/elysia/crud/types/crudOptions.d.ts +0 -25
  249. package/dist/modules/elysia/crudSchema/index.d.ts +0 -1
  250. package/dist/modules/elysia/crudSchema/index.js +0 -11
  251. package/dist/modules/elysia/crudSchema/types/crudModelsType.d.ts +0 -14
  252. package/dist/modules/elysia/crudSchema/types/index.d.ts +0 -8
  253. package/dist/modules/elysia/crudSchema/types/queryOptionsBuilderOptions.d.ts +0 -11
  254. package/dist/modules/elysia/crudSchema/utils/createCountResponse200Schema.d.ts +0 -11
  255. package/dist/modules/elysia/crudSchema/utils/createCountSchema.d.ts +0 -16
  256. package/dist/modules/elysia/crudSchema/utils/createDeleteSchema.d.ts +0 -18
  257. package/dist/modules/elysia/crudSchema/utils/createFindSchema.d.ts +0 -22
  258. package/dist/modules/elysia/crudSchema/utils/createInsertSchema.d.ts +0 -8
  259. package/dist/modules/elysia/crudSchema/utils/createPropertiesSchema.d.ts +0 -12
  260. package/dist/modules/elysia/crudSchema/utils/createResponse200Schema.d.ts +0 -5
  261. package/dist/modules/elysia/crudSchema/utils/createUpdateOneSchema.d.ts +0 -4
  262. package/dist/modules/elysia/crudSchema/utils/createUpdateSchema.d.ts +0 -10
  263. package/dist/modules/elysia/crudSchema/utils/index.d.ts +0 -15
  264. package/dist/modules/elysia/dbResolver/dbResolver.d.ts +0 -17
  265. package/dist/modules/elysia/dbResolver/enums/dbResolverErrorKeys.d.ts +0 -3
  266. package/dist/modules/elysia/dbResolver/enums/index.d.ts +0 -1
  267. package/dist/modules/elysia/dbResolver/index.d.ts +0 -1
  268. package/dist/modules/elysia/dbResolver/index.js +0 -18
  269. package/dist/modules/elysia/dbResolver/types/dynamicDbOptions.d.ts +0 -7
  270. package/dist/modules/elysia/dbResolver/types/index.d.ts +0 -1
  271. package/dist/modules/elysia/rateLimit/enums/index.d.ts +0 -1
  272. package/dist/modules/elysia/rateLimit/index.d.ts +0 -1
  273. package/dist/modules/elysia/rateLimit/types/index.d.ts +0 -1
  274. package/dist/modules/kvStore/enums/index.d.ts +0 -1
  275. package/dist/modules/kvStore/ioredis/index.d.ts +0 -1
  276. package/dist/modules/kvStore/memory/index.d.ts +0 -1
  277. package/dist/modules/kvStore/memory/index.js +0 -9
  278. package/dist/modules/kvStore/types/index.d.ts +0 -1
  279. package/dist/modules/kvStore/types/index.js +0 -1
  280. package/dist/modules/logger/enums/loggerErrorKeys.d.ts +0 -6
  281. package/dist/modules/logger/events/loggerEvents.d.ts +0 -11
  282. package/dist/modules/logger/strategies/consoleLogger.d.ts +0 -22
  283. package/dist/modules/logger/strategies/fileLogger.d.ts +0 -25
  284. package/dist/modules/logger/strategies/index.d.ts +0 -2
  285. package/dist/modules/logger/types/bodiesIntersection.d.ts +0 -2
  286. package/dist/modules/logger/types/logStreamChunk.d.ts +0 -15
  287. package/dist/modules/logger/types/strategyBody.d.ts +0 -2
  288. package/dist/modules/logger/types/strategyMap.d.ts +0 -2
  289. package/dist/modules/singletonManager/enums/index.d.ts +0 -1
  290. package/dist/modules/singletonManager/enums/singletonManagerErrorKeys.d.ts +0 -4
  291. package/dist/modules/singletonManager/index.d.ts +0 -1
  292. package/dist/modules/singletonManager/index.js +0 -9
  293. package/dist/modules/typedEventEmitter/index.d.ts +0 -1
  294. package/dist/modules/typedEventEmitter/typedEventEmitter.d.ts +0 -221
  295. package/dist/modules/typedEventEmitter/types/index.d.ts +0 -1
  296. package/dist/modules/typedEventEmitter/types/index.js +0 -1
  297. package/dist/utils/enums/index.d.ts +0 -1
  298. package/dist/utils/types/index.d.ts +0 -2
  299. package/dist/utils/types/index.js +0 -1
  300. package/dist/errors/enums/{httpErrorStatusCodes.d.ts → http-status-codes.d.ts} +0 -0
  301. package/dist/modules/data/enums/{dataErrorKeys.d.ts → data-error-keys.d.ts} +0 -0
  302. package/dist/modules/data/types/{camelCase.d.ts → camel-case.d.ts} +0 -0
  303. package/dist/modules/data/types/{caseTransformer.d.ts → case-transformer.d.ts} +0 -0
  304. package/dist/modules/data/types/{kebabCase.d.ts → kebab-case.d.ts} +0 -0
  305. package/dist/modules/data/types/{snakeCase.d.ts → snake-case.d.ts} +0 -0
  306. package/dist/modules/database/enums/{databaseErrorKeys.d.ts → database-error-keys.d.ts} +15 -15
  307. package/dist/modules/database/enums/{mssqlErrorCode.d.ts → mssql-error-code.d.ts} +12 -12
  308. package/dist/modules/database/types/{mssqlDatabaseOption.d.ts → mssql-database-option.d.ts} +0 -0
  309. package/dist/modules/database/types/{mssqlEventLog.d.ts → mssql-event-log.d.ts} +0 -0
  310. package/dist/modules/database/types/{queryContext.d.ts → query-context.d.ts} +0 -0
  311. package/dist/modules/elysia/cache/types/{cacheItem.d.ts → cache-item.d.ts} +0 -0
  312. package/dist/modules/elysia/cache/utils/{generateCacheKey.d.ts → generate-cache-key.d.ts} +0 -0
  313. package/dist/modules/elysia/{crudSchema/types/crudSchemaOperations.d.ts → crud/types/crud-schema-operations.d.ts} +0 -0
  314. package/dist/modules/elysia/{rateLimit/enums/rateLimitErrorKeys.d.ts → rate-limit/enums/rate-limit-error-keys.d.ts} +0 -0
  315. package/dist/{errors → modules/elysia/rate-limit}/types/index.js +0 -0
  316. package/dist/modules/jwt/enums/{jwtErrorKeys.d.ts → jwt-error-keys.d.ts} +2 -2
  317. package/dist/modules/jwt/enums/{parseHumanTimeToSecondsErrorKeys.d.ts → parse-human-time-to-seconds-error-keys.d.ts} +0 -0
  318. package/dist/modules/jwt/utils/{parseHumanTimeToSeconds.d.ts → parse-human-time-to-seconds.d.ts} +0 -0
  319. package/dist/modules/{kvStore/enums/kvStoreErrorKeys.d.ts → kv-store/enums/kv-store-error-keys.d.ts} +2 -2
  320. package/dist/modules/{kvStore/memory/types/memoryStoreEntry.d.ts → kv-store/memory/types/memory-store-entry.d.ts} +0 -0
  321. package/dist/modules/{elysia/crudSchema → kv-store}/types/index.js +0 -0
  322. package/dist/modules/{kvStore/types/kvStore.d.ts → kv-store/types/kv-store.d.ts} +0 -0
  323. package/dist/modules/logger/types/{logLevels.d.ts → log-levels.d.ts} +0 -0
  324. package/dist/modules/mailer/enums/{mailerErrorKeys.d.ts → mailer-error-keys.d.ts} +1 -1
  325. package/dist/modules/mailer/types/{smtpCredentials.d.ts → smtp-credentials.d.ts} +0 -0
  326. package/dist/modules/mailer/types/{smtpPoolOptions.d.ts → smtp-pool-options.d.ts} +0 -0
  327. package/dist/modules/repository/types/{adaptiveWhereClause.d.ts → adaptive-where-clause.d.ts} +0 -0
  328. package/dist/modules/repository/types/{orderByItem.d.ts → order-by-item.d.ts} +0 -0
  329. package/dist/modules/repository/types/{selectedFields.d.ts → selected-fields.d.ts} +0 -0
  330. package/dist/modules/totp/enums/{totpErrorKeys.d.ts → totp-error-keys.d.ts} +2 -2
  331. /package/dist/modules/totp/types/{otpAuthUri.d.ts → otp-auth-uri.d.ts} +0 -0
  332. /package/dist/modules/totp/types/{totpOptions.d.ts → totp-options.d.ts} +0 -0
  333. /package/dist/modules/totp/utils/{createCounterBuffer.d.ts → create-counter-buffer.d.ts} +0 -0
  334. /package/dist/modules/totp/utils/{dynamicTruncation.d.ts → dynamic-truncation.d.ts} +0 -0
  335. /package/dist/modules/totp/utils/{generateHmac.d.ts → generate-hmac.d.ts} +0 -0
  336. /package/dist/modules/totp/utils/{generateSecretBytes.d.ts → generate-secret-bytes.d.ts} +0 -0
  337. /package/dist/modules/totp/utils/{timeRemaining.d.ts → time-remaining.d.ts} +0 -0
  338. /package/dist/modules/{typedEventEmitter/types/eventMap.d.ts → typed-event-emitter/types/event-map.d.ts} +0 -0
  339. /package/dist/modules/{elysia/dbResolver → typed-event-emitter}/types/index.js +0 -0
  340. /package/dist/{utils/enums/utilsErrorKeys.d.ts → shared/enums/utils-error-keys.d.ts} +0 -0
  341. /package/dist/{modules/elysia/rateLimit → shared}/types/index.js +0 -0
  342. /package/dist/{utils/types/renameKey.d.ts → shared/types/rename-key.d.ts} +0 -0
  343. /package/dist/{utils/types/streamWithAsyncIterable.d.ts → shared/types/stream-with-async-iterable.d.ts} +0 -0
  344. /package/dist/{utils → shared/utils}/env.d.ts +0 -0
  345. /package/dist/{utils/isDateString.d.ts → shared/utils/is-date-string.d.ts} +0 -0
  346. /package/dist/{utils → shared/utils}/stream.d.ts +0 -0
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ MemoryStore
4
+ } from "../../../chunk-k9dtqf1p.js";
5
+ import"../../../chunk-6tqh339a.js";
6
+ import"../../../chunk-9cgzhc50.js";
7
+ export {
8
+ MemoryStore
9
+ };
@@ -1,4 +1,4 @@
1
- import type { KvStore } from '../../../modules/kvStore/types/kvStore';
1
+ import type { KvStore } from '../../../modules/kv-store/types/kv-store';
2
2
  /**
3
3
  * In-memory key-value store implementation with automatic cleanup of expired entries.
4
4
  *
@@ -0,0 +1 @@
1
+ export type { KvStore } from './kv-store';
@@ -1 +1 @@
1
- export { LOGGER_ERROR_KEYS } from './loggerErrorKeys';
1
+ export { LOGGER_ERROR_KEYS } from './logger-error-keys';
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  LOGGER_ERROR_KEYS
4
- } from "../../../chunk-4xs0e8cm.js";
4
+ } from "../../../chunk-547mr88s.js";
5
5
  export {
6
6
  LOGGER_ERROR_KEYS
7
7
  };
@@ -0,0 +1,6 @@
1
+ export declare const LOGGER_ERROR_KEYS: {
2
+ readonly NO_SINK_ADDED: "logger.error.no_sink_added";
3
+ readonly SINK_ALREADY_ADDED: "logger.error.sink_already_added";
4
+ readonly SINK_ERROR: "logger.error.sink_error";
5
+ readonly SINK_NOT_FOUND: "logger.error.sink_not_found";
6
+ };
@@ -1 +1 @@
1
- export type { LoggerEvent } from './loggerEvents';
1
+ export type { LoggerEvent } from './logger-events';
@@ -0,0 +1,11 @@
1
+ import type { BaseError } from '../../../errors/base-error';
2
+ export interface LoggerEvent {
3
+ error: [
4
+ BaseError<{
5
+ sinkName: string;
6
+ object: unknown;
7
+ error: Error;
8
+ }>
9
+ ];
10
+ end: [];
11
+ }
@@ -1,110 +1,98 @@
1
1
  // @bun
2
2
  import {
3
3
  LOGGER_ERROR_KEYS
4
- } from "../../chunk-4xs0e8cm.js";
4
+ } from "../../chunk-547mr88s.js";
5
5
  import {
6
6
  TypedEventEmitter
7
- } from "../../chunk-yvyahr2h.js";
7
+ } from "../../chunk-mvrxngm7.js";
8
8
  import {
9
9
  BaseError
10
- } from "../../chunk-vknq69e0.js";
10
+ } from "../../chunk-9cgzhc50.js";
11
11
 
12
12
  // source/modules/logger/logger.ts
13
13
  import { once } from "events";
14
14
  import { Transform } from "stream";
15
15
  class Logger extends TypedEventEmitter {
16
- _strategies;
16
+ _sinks;
17
17
  _logStream;
18
18
  _pendingLogs = [];
19
19
  _maxPendingLogs;
20
20
  _isWriting = false;
21
- constructor(strategies = {}, maxPendingLogs = 1e4) {
21
+ constructor(sinks = {}, maxPendingLogs = 1e4) {
22
22
  super();
23
- this._strategies = strategies;
23
+ this._sinks = sinks;
24
24
  this._maxPendingLogs = maxPendingLogs;
25
25
  this._logStream = new Transform({
26
26
  objectMode: true,
27
27
  transform: (chunk, _, callback) => {
28
- this._executeStrategies(chunk.level, new Date(chunk.date), chunk.object, chunk.strategiesNames).then(() => callback()).catch((error) => {
28
+ this._executeStrategies(chunk.level, new Date(chunk.date), chunk.object, chunk.sinksNames).then(() => callback()).catch((error) => {
29
29
  this.emit("error", error);
30
30
  callback();
31
31
  });
32
32
  }
33
33
  });
34
34
  }
35
- registerStrategy(name, strategy) {
36
- if (this._strategies[name])
37
- throw new BaseError({
38
- message: LOGGER_ERROR_KEYS.STRATEGY_ALREADY_ADDED,
39
- cause: { strategyName: name }
40
- });
35
+ registerSink(name, sink) {
36
+ if (this._sinks[name])
37
+ throw new BaseError(LOGGER_ERROR_KEYS.SINK_ALREADY_ADDED, { sinkName: name });
41
38
  return new Logger({
42
- ...this._strategies,
43
- [name]: strategy
39
+ ...this._sinks,
40
+ [name]: sink
44
41
  }, this._maxPendingLogs);
45
42
  }
46
- unregisterStrategy(name) {
47
- if (!(name in this._strategies))
48
- throw new BaseError({
49
- message: LOGGER_ERROR_KEYS.STRATEGY_NOT_FOUND,
50
- cause: { strategyName: name }
51
- });
52
- const { [name]: _, ...rest } = this._strategies;
43
+ unregisterSink(name) {
44
+ if (!(name in this._sinks))
45
+ throw new BaseError(LOGGER_ERROR_KEYS.SINK_NOT_FOUND, { sinkName: name });
46
+ const { [name]: _, ...rest } = this._sinks;
53
47
  return new Logger(rest, this._maxPendingLogs);
54
48
  }
55
- registerStrategies(strategies) {
56
- return strategies.reduce((logger, [name, strategy]) => logger.registerStrategy(name, strategy), this);
49
+ registerSinks(sinks) {
50
+ return sinks.reduce((logger, [name, sink]) => logger.registerSink(name, sink), this);
57
51
  }
58
- unregisterStrategies(names) {
52
+ unregisterSinks(names) {
59
53
  let logger = this;
60
54
  for (const name of names)
61
- logger = logger.unregisterStrategy(name);
55
+ logger = logger.unregisterSink(name);
62
56
  return logger;
63
57
  }
64
- clearStrategies() {
58
+ clearSinks() {
65
59
  return new Logger({}, this._maxPendingLogs);
66
60
  }
67
- error(object, strategiesNames) {
68
- this._out("ERROR", object, strategiesNames);
61
+ error(object, sinksNames) {
62
+ this._out("ERROR", object, sinksNames);
69
63
  }
70
- warn(object, strategiesNames) {
71
- this._out("WARN", object, strategiesNames);
64
+ warn(object, sinksNames) {
65
+ this._out("WARN", object, sinksNames);
72
66
  }
73
- info(object, strategiesNames) {
74
- this._out("INFO", object, strategiesNames);
67
+ info(object, sinksNames) {
68
+ this._out("INFO", object, sinksNames);
75
69
  }
76
- debug(object, strategiesNames) {
77
- this._out("DEBUG", object, strategiesNames);
70
+ debug(object, sinksNames) {
71
+ this._out("DEBUG", object, sinksNames);
78
72
  }
79
- log(object, strategiesNames) {
80
- this._out("LOG", object, strategiesNames);
73
+ log(object, sinksNames) {
74
+ this._out("LOG", object, sinksNames);
81
75
  }
82
- async _executeStrategies(level, date, object, strategiesNames) {
83
- await Promise.all(strategiesNames.map(async (name) => {
76
+ async _executeStrategies(level, date, object, sinksNames) {
77
+ await Promise.all(sinksNames.map(async (name) => {
84
78
  try {
85
- await this._strategies[name]?.log(level, date, object);
79
+ await this._sinks[name]?.log(level, date, object);
86
80
  } catch (error) {
87
- throw new BaseError({
88
- message: LOGGER_ERROR_KEYS.STRATEGY_ERROR,
89
- cause: { strategyName: name, object, error }
90
- });
81
+ throw new BaseError(LOGGER_ERROR_KEYS.SINK_ERROR, { sinkName: name, object, error });
91
82
  }
92
83
  }));
93
84
  }
94
- _out(level, object, strategiesNames) {
95
- const strategyKeys = Object.keys(this._strategies);
96
- if (strategyKeys.length === 0)
97
- throw new BaseError({
98
- message: LOGGER_ERROR_KEYS.NO_STRATEGY_ADDED,
99
- cause: { level, object }
100
- });
85
+ _out(level, object, sinksNames) {
86
+ const sinkKeys = Object.keys(this._sinks);
87
+ if (sinkKeys.length === 0)
88
+ throw new BaseError(LOGGER_ERROR_KEYS.NO_SINK_ADDED, { level, object });
101
89
  if (this._pendingLogs.length >= this._maxPendingLogs)
102
90
  return;
103
91
  const log = {
104
92
  date: new Date().toISOString(),
105
93
  level,
106
94
  object,
107
- strategiesNames: strategiesNames ? strategiesNames : strategyKeys
95
+ sinksNames: sinksNames ? sinksNames : sinkKeys
108
96
  };
109
97
  this._pendingLogs.push(log);
110
98
  if (!this._isWriting) {
@@ -1,189 +1,189 @@
1
- import { TypedEventEmitter } from '../../modules/typedEventEmitter/typedEventEmitter';
2
- import type { LoggerEvent } from './events/loggerEvents';
3
- import type { BodiesIntersection } from './types/bodiesIntersection';
4
- import type { LoggerStrategy } from './types/loggerStrategy';
5
- import type { StrategyMap } from './types/strategyMap';
1
+ import { TypedEventEmitter } from '../../modules/typed-event-emitter/typed-event-emitter';
2
+ import type { LoggerEvent } from './events/logger-events';
3
+ import type { BodiesIntersection } from './types/bodies-intersection';
4
+ import type { LoggerSink } from './types/logger-sink';
5
+ import type { SinkMap } from './types/sink-map';
6
6
  /**
7
- * Logger provides a flexible, type-safe logging system that allows multiple strategies for log output.
8
- * The logger uses a transform stream to process log entries and execute the logging strategies.
9
- *
10
- * Logger extends the TypedEventEmitter class to emit typed events when an error occurs or when the logger ends.
11
- * The logger can log messages with different levels: error, warn, info, debug, and log.
12
- *
13
- * @template TStrategies - The map of strategy names to LoggerStrategy types.
14
- */
15
- export declare class Logger<TStrategies extends StrategyMap = {}> extends TypedEventEmitter<LoggerEvent> {
16
- /**
17
- * The map of strategies.
18
- */
19
- private readonly _strategies;
20
- /**
21
- * The transform stream for processing log entries.
22
- */
7
+ * Logger provides a flexible, type-safe logging system that allows multiple sinks for log output.
8
+ * The logger uses a transform stream to process log entries and execute the logging sinks.
9
+ *
10
+ * Logger extends the TypedEventEmitter class to emit typed events when an error occurs or when the logger ends.
11
+ * The logger can log messages with different levels: error, warn, info, debug, and log.
12
+ *
13
+ * @template TSinks - The map of sink names to LoggerStrategy types.
14
+ */
15
+ export declare class Logger<TSinks extends SinkMap = {}> extends TypedEventEmitter<LoggerEvent> {
16
+ /**
17
+ * The map of sinks.
18
+ */
19
+ private readonly _sinks;
20
+ /**
21
+ * The transform stream for processing log entries.
22
+ */
23
23
  private readonly _logStream;
24
24
  /**
25
- * The queue of pending log entries.
26
- */
25
+ * The queue of pending log entries.
26
+ */
27
27
  private readonly _pendingLogs;
28
28
  /**
29
- * The maximum number of pending logs.
30
- * @defaultValue 10_000
31
- */
29
+ * The maximum number of pending logs.
30
+ * @defaultValue 10_000
31
+ */
32
32
  private readonly _maxPendingLogs;
33
33
  /**
34
- * Flag to indicate if the logger is currently writing logs.
35
- */
34
+ * Flag to indicate if the logger is currently writing logs.
35
+ */
36
36
  private _isWriting;
37
37
  /**
38
- * Construct a Logger.
39
- *
40
- * @template TStrategies - The map of strategy names to LoggerStrategy types.
41
- *
42
- * @param strategies - Initial strategies map.
43
- *
44
- * @param maxPendingLogs - Maximum number of logs in the queue (default: 10_000)
45
- */
46
- constructor(strategies?: TStrategies, maxPendingLogs?: number);
47
- /**
48
- * Register a new logging strategy.
49
- *
50
- * @template Key - The name of the strategy.
51
- * @template Strategy - The strategy type.
52
- *
53
- * @param name - The name of the strategy.
54
- * @param strategy - The strategy to add. It must implement {@link LoggerStrategy}.
55
- *
56
- * @throws ({@link BaseError}) - If the strategy is already added.
57
- *
58
- * @returns A new Logger instance with the added strategy.
59
- */
60
- registerStrategy<Key extends string, Strategy extends LoggerStrategy>(name: Key, strategy: Strategy): Logger<TStrategies & Record<Key, Strategy>>;
61
- /**
62
- * Unregister a logging strategy.
63
- *
64
- * @template Key - The name of the strategy.
65
- *
66
- * @param name - The name of the strategy to remove.
67
- *
68
- * @throws ({@link BaseError}) - If the strategy is not found.
69
- *
70
- * @returns A new Logger instance without the removed strategy.
71
- */
72
- unregisterStrategy<Key extends keyof TStrategies>(name: Key): Logger<Omit<TStrategies, Key>>;
73
- /**
74
- * Register multiple strategies at once.
75
- *
76
- * @template TNew - The new strategies to add.
77
- *
78
- * @param strategies - An array of tuples where each tuple contains the strategy name and the strategy instance.
79
- *
80
- * @throws ({@link BaseError}) - If any strategy is already added.
81
- *
82
- * @returns A new Logger instance with the added strategies.
83
- */
84
- registerStrategies<TNew extends [string, LoggerStrategy][] = [string, LoggerStrategy][]>(strategies: TNew): Logger<TStrategies & {
85
- [K in TNew[number][0]]: Extract<TNew[number], [K, LoggerStrategy]>[1];
38
+ * Construct a Logger.
39
+ *
40
+ * @template TStrategies - The map of sink names to LoggerStrategy types.
41
+ *
42
+ * @param sinks - Initial sinks map.
43
+ *
44
+ * @param maxPendingLogs - Maximum number of logs in the queue (default: 10_000)
45
+ */
46
+ constructor(sinks?: TSinks, maxPendingLogs?: number);
47
+ /**
48
+ * Register a new logging sink.
49
+ *
50
+ * @template Key - The name of the sink.
51
+ * @template Sink - The sink type.
52
+ *
53
+ * @param name - The name of the sink.
54
+ * @param sink - The sink to add. It must implement {@link LoggerSink}.
55
+ *
56
+ * @throws ({@link BaseError}) - If the sink is already added.
57
+ *
58
+ * @returns A new Logger instance with the added sink.
59
+ */
60
+ registerSink<Key extends string, Sink extends LoggerSink>(name: Key, sink: Sink): Logger<TSinks & Record<Key, Sink>>;
61
+ /**
62
+ * Unregister a logging sink.
63
+ *
64
+ * @template Key - The name of the sink.
65
+ *
66
+ * @param name - The name of the sink to remove.
67
+ *
68
+ * @throws ({@link BaseError}) - If the sink is not found.
69
+ *
70
+ * @returns A new Logger instance without the removed sink.
71
+ */
72
+ unregisterSink<Key extends keyof TSinks>(name: Key): Logger<Omit<TSinks, Key>>;
73
+ /**
74
+ * Register multiple sinks at once.
75
+ *
76
+ * @template TNew - The new sinks to add.
77
+ *
78
+ * @param sinks - An array of tuples where each tuple contains the sink name and the sink instance.
79
+ *
80
+ * @throws ({@link BaseError}) - If any sink is already added.
81
+ *
82
+ * @returns A new Logger instance with the added sinks.
83
+ */
84
+ registerSinks<TNew extends [string, LoggerSink][] = [string, LoggerSink][]>(sinks: TNew): Logger<TSinks & {
85
+ [K in TNew[number][0]]: Extract<TNew[number], [K, LoggerSink]>[1];
86
86
  }>;
87
87
  /**
88
- * Unregister multiple strategies at once.
89
- *
90
- * @template Keys - The names of the strategies to remove.
91
- *
92
- * @param names - An array of strategy names to remove.
93
- *
94
- * @throws ({@link BaseError}) - If any strategy is not found.
95
- *
96
- * @returns A new Logger instance without the removed strategies.
97
- */
98
- unregisterStrategies<Keys extends Extract<keyof TStrategies, string>>(names: Keys[]): Logger<Omit<TStrategies, Keys>>;
99
- /**
100
- * Remove all strategies.
101
- *
102
- * @returns A new Logger instance without any strategies.
103
- */
104
- clearStrategies(): Logger;
105
- /**
106
- * Log an error message.
107
- *
108
- * @template SNames - The names of the strategies to use.
109
- *
110
- * @param object - The object to log.
111
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
112
- *
113
- * @throws ({@link BaseError}) - If no strategy is added.
114
- */
115
- error<SNames extends (keyof TStrategies)[] = (keyof TStrategies)[]>(object: BodiesIntersection<TStrategies, SNames[number]>, strategiesNames?: SNames): void;
116
- /**
117
- * Log a warning message.
118
- *
119
- * @template SNames - The names of the strategies to use.
120
- *
121
- * @param object - The object to log.
122
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
123
- *
124
- * @throws ({@link BaseError}) - If no strategy is added.
125
- */
126
- warn<SNames extends (keyof TStrategies)[] = (keyof TStrategies)[]>(object: BodiesIntersection<TStrategies, SNames[number]>, strategiesNames?: SNames): void;
127
- /**
128
- * Log an info message.
129
- *
130
- * @template SNames - The names of the strategies to use.
131
- *
132
- * @param object - The object to log.
133
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
134
- *
135
- * @throws ({@link BaseError}) - If no strategy is added.
136
- */
137
- info<SNames extends (keyof TStrategies)[] = (keyof TStrategies)[]>(object: BodiesIntersection<TStrategies, SNames[number]>, strategiesNames?: SNames): void;
138
- /**
139
- * Log a debug message.
140
- *
141
- * @template SNames - The names of the strategies to use.
142
- *
143
- * @param object - The object to log.
144
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
145
- *
146
- * @throws ({@link BaseError}) - If no strategy is added.
147
- */
148
- debug<SNames extends (keyof TStrategies)[] = (keyof TStrategies)[]>(object: BodiesIntersection<TStrategies, SNames[number]>, strategiesNames?: SNames): void;
149
- /**
150
- * Log a generic message.
151
- *
152
- * @template SNames - The names of the strategies to use.
153
- *
154
- * @param object - The object to log.
155
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
156
- *
157
- * @throws ({@link BaseError}) - If no strategy is added.
158
- */
159
- log<SNames extends (keyof TStrategies)[] = (keyof TStrategies)[]>(object: BodiesIntersection<TStrategies, SNames[number]>, strategiesNames?: SNames): void;
160
- /**
161
- * Internal: execute all strategies for a log event.
162
- *
163
- * @template TLogObject - The type of the log object.
164
- *
165
- * @param level - The log level.
166
- * @param date - The date of the log event.
167
- * @param object - The object to log.
168
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
169
- *
170
- * @throws ({@link BaseError}) - If a strategy throws.
171
- */
88
+ * Unregister multiple sinks at once.
89
+ *
90
+ * @template Keys - The names of the sinks to remove.
91
+ *
92
+ * @param names - An array of sink names to remove.
93
+ *
94
+ * @throws ({@link BaseError}) - If any sink is not found.
95
+ *
96
+ * @returns A new Logger instance without the removed sinks.
97
+ */
98
+ unregisterSinks<Keys extends Extract<keyof TSinks, string>>(names: Keys[]): Logger<Omit<TSinks, Keys>>;
99
+ /**
100
+ * Remove all sinks.
101
+ *
102
+ * @returns A new Logger instance without any sinks.
103
+ */
104
+ clearSinks(): Logger;
105
+ /**
106
+ * Log an error message.
107
+ *
108
+ * @template SNames - The names of the sinks to use.
109
+ *
110
+ * @param object - The object to log.
111
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
112
+ *
113
+ * @throws ({@link BaseError}) - If no sink is added.
114
+ */
115
+ error<SNames extends (keyof TSinks)[] = (keyof TSinks)[]>(object: BodiesIntersection<TSinks, SNames[number]>, sinksNames?: SNames): void;
116
+ /**
117
+ * Log a warning message.
118
+ *
119
+ * @template SNames - The names of the sinks to use.
120
+ *
121
+ * @param object - The object to log.
122
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
123
+ *
124
+ * @throws ({@link BaseError}) - If no sink is added.
125
+ */
126
+ warn<SNames extends (keyof TSinks)[] = (keyof TSinks)[]>(object: BodiesIntersection<TSinks, SNames[number]>, sinksNames?: SNames): void;
127
+ /**
128
+ * Log an info message.
129
+ *
130
+ * @template SNames - The names of the sinks to use.
131
+ *
132
+ * @param object - The object to log.
133
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
134
+ *
135
+ * @throws ({@link BaseError}) - If no sink is added.
136
+ */
137
+ info<SNames extends (keyof TSinks)[] = (keyof TSinks)[]>(object: BodiesIntersection<TSinks, SNames[number]>, sinksNames?: SNames): void;
138
+ /**
139
+ * Log a debug message.
140
+ *
141
+ * @template SNames - The names of the sinks to use.
142
+ *
143
+ * @param object - The object to log.
144
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
145
+ *
146
+ * @throws ({@link BaseError}) - If no sink is added.
147
+ */
148
+ debug<SNames extends (keyof TSinks)[] = (keyof TSinks)[]>(object: BodiesIntersection<TSinks, SNames[number]>, sinksNames?: SNames): void;
149
+ /**
150
+ * Log a generic message.
151
+ *
152
+ * @template SNames - The names of the sinks to use.
153
+ *
154
+ * @param object - The object to log.
155
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
156
+ *
157
+ * @throws ({@link BaseError}) - If no sink is added.
158
+ */
159
+ log<SNames extends (keyof TSinks)[] = (keyof TSinks)[]>(object: BodiesIntersection<TSinks, SNames[number]>, sinksNames?: SNames): void;
160
+ /**
161
+ * Internal: execute all sinks for a log event.
162
+ *
163
+ * @template TLogObject - The type of the log object.
164
+ *
165
+ * @param level - The log level.
166
+ * @param date - The date of the log event.
167
+ * @param object - The object to log.
168
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
169
+ *
170
+ * @throws ({@link BaseError}) - If a sink throws.
171
+ */
172
172
  private _executeStrategies;
173
173
  /**
174
- * Internal: queue a log event and start writing if not already.
175
- *
176
- * @template TLogObject - The type of the log object.
177
- *
178
- * @param level - The log level.
179
- * @param object - The object to log.
180
- * @param strategiesNames - The names of the strategies to use. If not provided, all strategies will be used.
181
- *
182
- * @throws ({@link BaseError}) - If no strategy is added.
183
- */
174
+ * Internal: queue a log event and start writing if not already.
175
+ *
176
+ * @template TLogObject - The type of the log object.
177
+ *
178
+ * @param level - The log level.
179
+ * @param object - The object to log.
180
+ * @param sinksNames - The names of the sinks to use. If not provided, all sinks will be used.
181
+ *
182
+ * @throws ({@link BaseError}) - If no sink is added.
183
+ */
184
184
  private _out;
185
185
  /**
186
- * Internal: process the log queue and emit 'end' when done.
187
- */
186
+ * Internal: process the log queue and emit 'end' when done.
187
+ */
188
188
  private _writeLog;
189
189
  }
@@ -0,0 +1,22 @@
1
+ import type { LogLevels } from '../../../modules/logger/types/log-levels';
2
+ import type { LoggerSink } from '../../../modules/logger/types/logger-sink';
3
+ /**
4
+ * ConsoleLoggerSink implements LoggerSink to provide logging functionality to the console.
5
+ */
6
+ export declare class ConsoleLoggerSink implements LoggerSink {
7
+ private readonly _colorize;
8
+ /**
9
+ * Initializes the ConsoleLoggerSink.
10
+ *
11
+ * @param colorize - Indicates if the output should be colorized. (Default is false.)
12
+ */
13
+ constructor(colorize?: boolean);
14
+ /**
15
+ * Logs a message to the console with the specified log level.
16
+ *
17
+ * @param level - The log level at which the message should be logged.
18
+ * @param date - The date at which the message was logged.
19
+ * @param object - The object to log.
20
+ */
21
+ log(level: LogLevels, date: Date, object: unknown): void;
22
+ }
@@ -0,0 +1,25 @@
1
+ import type { LogLevels } from '../../../modules/logger/types/log-levels';
2
+ import type { LoggerSink } from '../../../modules/logger/types/logger-sink';
3
+ /**
4
+ * FileLoggerSink implements LoggerSink to provide logging functionality to the file system.
5
+ */
6
+ export declare class FileLoggerSink implements LoggerSink {
7
+ /**
8
+ * Path to the file to log to.
9
+ */
10
+ private readonly _path;
11
+ /**
12
+ * Constructor FileLoggerSink
13
+ *
14
+ * @param path - Path to the file to log to.
15
+ */
16
+ constructor(path: string);
17
+ /**
18
+ * Logs a message to the file system with the specified log level.
19
+ *
20
+ * @param level - The log level at which the message should be logged.
21
+ * @param date - The date at which the message was logged.
22
+ * @param object - The object to log.
23
+ */
24
+ log(level: LogLevels, date: Date, object: unknown): Promise<void>;
25
+ }
@@ -0,0 +1,2 @@
1
+ export { ConsoleLoggerSink } from './console-logger.ts';
2
+ export { FileLoggerSink } from './file-logger.ts';