@mrxsys/mrx-core 2.4.0 → 2.5.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 (312) hide show
  1. package/CHANGELOG.md +318 -33
  2. package/README.md +3 -3
  3. package/dist/chunk-1a3wj3m1.js +272 -0
  4. package/dist/chunk-370444pc.js +43 -0
  5. package/dist/chunk-5qtpggzv.js +38 -0
  6. package/dist/chunk-84mqvfsk.js +69 -0
  7. package/dist/chunk-cq973ydc.js +82 -0
  8. package/dist/chunk-f5z7x01b.js +352 -0
  9. package/dist/chunk-pc66jgqv.js +220 -0
  10. package/dist/chunk-s07amdhx.js +77 -0
  11. package/dist/chunk-v8v7982b.js +58 -0
  12. package/dist/chunk-vknq69e0.js +23 -0
  13. package/dist/chunk-yvyahr2h.js +40 -0
  14. package/dist/errors/baseError.d.ts +9 -0
  15. package/dist/errors/enums/httpErrorStatusCodes.d.ts +42 -0
  16. package/dist/errors/httpError.d.ts +14 -0
  17. package/dist/errors/index.d.ts +2 -0
  18. package/dist/errors/index.js +11 -0
  19. package/dist/errors/types/baseErrorOptions.d.ts +15 -0
  20. package/dist/errors/types/httpErrorOptions.d.ts +13 -0
  21. package/dist/errors/types/index.d.ts +2 -0
  22. package/dist/modules/data/data.d.ts +115 -0
  23. package/dist/modules/data/enums/dataErrorKeys.d.ts +3 -0
  24. package/dist/modules/data/index.d.ts +1 -0
  25. package/dist/modules/data/index.js +16 -0
  26. package/dist/modules/data/transformers/camelCase.d.ts +25 -0
  27. package/dist/modules/data/transformers/index.d.ts +4 -0
  28. package/dist/modules/data/transformers/index.js +32 -0
  29. package/dist/modules/data/transformers/kebabCase.d.ts +25 -0
  30. package/dist/modules/data/transformers/pascalCase.d.ts +25 -0
  31. package/dist/modules/data/transformers/snakeCase.d.ts +25 -0
  32. package/dist/modules/data/types/camelCase.d.ts +1 -0
  33. package/dist/modules/data/types/caseTransformer.d.ts +13 -0
  34. package/dist/modules/data/types/index.d.ts +10 -0
  35. package/dist/modules/data/types/kebabCase.d.ts +1 -0
  36. package/dist/modules/data/types/pascalCase.d.ts +2 -0
  37. package/dist/modules/data/types/snakeCase.d.ts +1 -0
  38. package/dist/modules/data/types/transformKeysCamelCase.d.ts +4 -0
  39. package/dist/modules/data/types/transformKeysKebabCase.d.ts +4 -0
  40. package/dist/modules/data/types/transformKeysPascalCase.d.ts +4 -0
  41. package/dist/modules/data/types/transformKeysSnakeCase.d.ts +4 -0
  42. package/dist/modules/data/types/transformObjectKeys.d.ts +9 -0
  43. package/dist/modules/database/enums/databaseErrorKeys.d.ts +28 -0
  44. package/dist/modules/database/enums/mssqlErrorCode.d.ts +25 -0
  45. package/dist/modules/database/events/index.d.ts +2 -0
  46. package/dist/modules/database/events/mssqlEventMap.d.ts +6 -0
  47. package/dist/modules/database/events/tableEventMap.d.ts +7 -0
  48. package/dist/modules/database/index.d.ts +2 -0
  49. package/dist/modules/database/index.js +14 -0
  50. package/dist/{database → modules/database}/mssql.d.ts +21 -25
  51. package/dist/{database → modules/database}/table.d.ts +6 -6
  52. package/dist/modules/database/types/index.d.ts +3 -0
  53. package/dist/{database → modules/database}/types/mssqlDatabaseOption.d.ts +16 -37
  54. package/dist/modules/database/types/mssqlEventLog.d.ts +14 -0
  55. package/dist/modules/database/types/queryContext.d.ts +11 -0
  56. package/dist/modules/elysia/crud/crud.d.ts +46 -0
  57. package/dist/modules/elysia/crud/index.d.ts +1 -0
  58. package/dist/modules/elysia/crud/index.js +299 -0
  59. package/dist/modules/elysia/crud/types/crudOperationBaseOptions.d.ts +6 -0
  60. package/dist/modules/elysia/crud/types/crudOperationCountOptions.d.ts +2 -0
  61. package/dist/modules/elysia/crud/types/crudOperationDeleteOneOptions.d.ts +2 -0
  62. package/dist/modules/elysia/crud/types/crudOperationDeleteOptions.d.ts +2 -0
  63. package/dist/modules/elysia/crud/types/crudOperationFindOneOptions.d.ts +2 -0
  64. package/dist/modules/elysia/crud/types/crudOperationFindOptions.d.ts +2 -0
  65. package/dist/modules/elysia/crud/types/crudOperationInsertOptions.d.ts +2 -0
  66. package/dist/modules/elysia/crud/types/crudOperationUpdateOneOptions.d.ts +2 -0
  67. package/dist/modules/elysia/crud/types/crudOperationUpdateOptions.d.ts +2 -0
  68. package/dist/modules/elysia/crud/types/crudOperationsOptions.d.ts +18 -0
  69. package/dist/modules/elysia/crud/types/crudOptions.d.ts +23 -0
  70. package/dist/modules/elysia/crud/types/index.d.ts +11 -0
  71. package/dist/modules/elysia/crudSchema/crudSchema.d.ts +18 -0
  72. package/dist/modules/elysia/crudSchema/index.d.ts +1 -0
  73. package/dist/modules/elysia/crudSchema/index.js +10 -0
  74. package/dist/modules/elysia/crudSchema/types/adaptiveWhereClauseSchema.d.ts +31 -0
  75. package/dist/modules/elysia/crudSchema/types/crudModelsType.d.ts +14 -0
  76. package/dist/modules/elysia/crudSchema/types/crudSchemaOperations.d.ts +10 -0
  77. package/dist/modules/elysia/crudSchema/types/crudSchemaOptions.d.ts +13 -0
  78. package/dist/modules/elysia/crudSchema/types/index.d.ts +8 -0
  79. package/dist/modules/elysia/crudSchema/types/orderSchema.d.ts +11 -0
  80. package/dist/modules/elysia/crudSchema/types/qSchema.d.ts +15 -0
  81. package/dist/modules/elysia/crudSchema/types/queryOptionsBuilderOptions.d.ts +11 -0
  82. package/dist/modules/elysia/crudSchema/types/selectedFieldSchema.d.ts +6 -0
  83. package/dist/modules/elysia/crudSchema/utils/createAdaptiveWhereClauseSchema.d.ts +17 -0
  84. package/dist/modules/elysia/crudSchema/utils/createCountResponse200Schema.d.ts +11 -0
  85. package/dist/modules/elysia/crudSchema/utils/createCountSchema.d.ts +16 -0
  86. package/dist/modules/elysia/crudSchema/utils/createDeleteSchema.d.ts +18 -0
  87. package/dist/modules/elysia/crudSchema/utils/createFiltersSchema.d.ts +17 -0
  88. package/dist/modules/elysia/crudSchema/utils/createFindSchema.d.ts +22 -0
  89. package/dist/modules/elysia/crudSchema/utils/createIdParamSchema.d.ts +4 -0
  90. package/dist/modules/elysia/crudSchema/utils/createInsertSchema.d.ts +8 -0
  91. package/dist/modules/elysia/crudSchema/utils/createOrderSchema.d.ts +12 -0
  92. package/dist/modules/elysia/crudSchema/utils/createPropertiesSchema.d.ts +12 -0
  93. package/dist/modules/elysia/crudSchema/utils/createQSchema.d.ts +12 -0
  94. package/dist/modules/elysia/crudSchema/utils/createResponse200Schema.d.ts +5 -0
  95. package/dist/modules/elysia/crudSchema/utils/createSelectedFieldsSchema.d.ts +12 -0
  96. package/dist/modules/elysia/crudSchema/utils/createUpdateOneSchema.d.ts +4 -0
  97. package/dist/modules/elysia/crudSchema/utils/createUpdateSchema.d.ts +10 -0
  98. package/dist/modules/elysia/crudSchema/utils/index.d.ts +15 -0
  99. package/dist/modules/elysia/crudSchema/utils/index.js +37 -0
  100. package/dist/modules/elysia/crudSchema/utils/isDateFromElysiaTypeBox.d.ts +2 -0
  101. package/dist/modules/elysia/dbResolver/dbResolver.d.ts +17 -0
  102. package/dist/modules/elysia/dbResolver/enums/dbResolverErrorKeys.d.ts +3 -0
  103. package/dist/modules/elysia/dbResolver/index.d.ts +1 -0
  104. package/dist/modules/elysia/dbResolver/index.js +14 -0
  105. package/dist/modules/elysia/dbResolver/types/dynamicDbOptions.d.ts +7 -0
  106. package/dist/modules/elysia/dbResolver/types/index.d.ts +1 -0
  107. package/dist/modules/elysia/error/error.d.ts +34 -0
  108. package/dist/modules/elysia/error/index.d.ts +1 -0
  109. package/dist/modules/elysia/error/index.js +58 -0
  110. package/dist/modules/elysia/jwt/enums/jwtErrorKeys.d.ts +4 -0
  111. package/dist/modules/elysia/jwt/index.d.ts +1 -0
  112. package/dist/modules/elysia/jwt/index.js +81 -0
  113. package/dist/modules/elysia/jwt/jwt.d.ts +119 -0
  114. package/dist/modules/elysia/jwt/types/index.d.ts +1 -0
  115. package/dist/modules/elysia/jwt/types/jwtOptions.d.ts +98 -0
  116. package/dist/modules/elysia/microservice/index.d.ts +1 -0
  117. package/dist/modules/elysia/microservice/index.js +96 -0
  118. package/dist/{elysia → modules/elysia/microservice}/microservice.d.ts +1 -1
  119. package/dist/modules/elysia/ratelimit/enums/ratelimitErrorKeys.d.ts +3 -0
  120. package/dist/modules/elysia/ratelimit/index.d.ts +1 -0
  121. package/dist/modules/elysia/ratelimit/index.js +55 -0
  122. package/dist/{elysia → modules/elysia/ratelimit}/ratelimit.d.ts +3 -13
  123. package/dist/modules/elysia/ratelimit/types/index.d.ts +1 -0
  124. package/dist/{elysia → modules/elysia/ratelimit}/types/rateLimitOptions.d.ts +6 -16
  125. package/dist/modules/logger/enums/loggerErrorKeys.d.ts +6 -0
  126. package/dist/modules/logger/events/index.d.ts +1 -0
  127. package/dist/modules/logger/events/loggerEvents.d.ts +11 -0
  128. package/dist/modules/logger/index.d.ts +1 -0
  129. package/dist/modules/logger/index.js +139 -0
  130. package/dist/modules/logger/logger.d.ts +189 -0
  131. package/dist/{logger → modules/logger}/strategies/consoleLogger.d.ts +4 -4
  132. package/dist/{logger → modules/logger}/strategies/fileLogger.d.ts +4 -4
  133. package/dist/modules/logger/strategies/index.d.ts +2 -0
  134. package/dist/modules/logger/strategies/index.js +44 -0
  135. package/dist/modules/logger/types/index.d.ts +6 -0
  136. package/dist/modules/logger/types/index.js +1 -0
  137. package/dist/{logger → modules/logger}/types/logStreamChunk.d.ts +4 -4
  138. package/dist/{logger → modules/logger}/types/loggerStrategy.d.ts +1 -1
  139. package/dist/modules/mailer/enums/mailerErrorKeys.d.ts +5 -0
  140. package/dist/modules/mailer/index.d.ts +1 -0
  141. package/dist/modules/mailer/index.js +64 -0
  142. package/dist/{mailer → modules/mailer}/smtp.d.ts +6 -6
  143. package/dist/modules/mailer/types/index.d.ts +3 -0
  144. package/dist/modules/mailer/types/index.js +1 -0
  145. package/dist/{mailer → modules/mailer}/types/smtpCredentials.d.ts +2 -2
  146. package/dist/{mailer → modules/mailer}/types/smtpOptions.d.ts +5 -5
  147. package/dist/{mailer → modules/mailer}/types/smtpPoolOptions.d.ts +1 -1
  148. package/dist/modules/repository/index.d.ts +1 -0
  149. package/dist/modules/repository/index.js +10 -0
  150. package/dist/modules/repository/repository.d.ts +421 -0
  151. package/dist/modules/repository/types/adaptiveWhereClause.d.ts +30 -0
  152. package/dist/modules/repository/types/filter.d.ts +43 -0
  153. package/dist/modules/repository/types/index.d.ts +8 -0
  154. package/dist/modules/repository/types/index.js +1 -0
  155. package/dist/modules/repository/types/orderByItem.d.ts +42 -0
  156. package/dist/modules/repository/types/queryOptions.d.ts +36 -0
  157. package/dist/{repository → modules/repository}/types/queryOptionsExtendPagination.d.ts +2 -2
  158. package/dist/{repository → modules/repository}/types/queryOptionsExtendStream.d.ts +1 -1
  159. package/dist/modules/repository/types/selectedFields.d.ts +37 -0
  160. package/dist/modules/singletonManager/enums/singletonManagerErrorKeys.d.ts +4 -0
  161. package/dist/modules/singletonManager/index.d.ts +1 -0
  162. package/dist/modules/singletonManager/index.js +8 -0
  163. package/dist/modules/singletonManager/singletonManager.d.ts +75 -0
  164. package/dist/modules/typedEventEmitter/index.d.ts +1 -0
  165. package/dist/modules/typedEventEmitter/index.js +7 -0
  166. package/dist/{typedEventEmitter → modules/typedEventEmitter}/typedEventEmitter.d.ts +33 -11
  167. package/dist/modules/typedEventEmitter/types/index.d.ts +1 -0
  168. package/dist/modules/typedEventEmitter/types/index.js +1 -0
  169. package/dist/utils/enums/utilsErrorKeys.d.ts +3 -0
  170. package/dist/utils/env.d.ts +1 -1
  171. package/dist/utils/index.d.ts +3 -3
  172. package/dist/utils/index.js +32 -1
  173. package/dist/utils/isDateString.d.ts +16 -0
  174. package/dist/utils/stream.d.ts +12 -1
  175. package/dist/utils/types/index.d.ts +1 -1
  176. package/dist/utils/types/streamWithAsyncIterable.d.ts +12 -5
  177. package/package.json +128 -128
  178. package/dist/chunk-1c7w5cx7.js +0 -3
  179. package/dist/chunk-40pg2cqx.js +0 -2
  180. package/dist/chunk-4v4tp5qj.js +0 -2
  181. package/dist/chunk-4w7nd4nw.js +0 -2
  182. package/dist/chunk-5nvsx7md.js +0 -2
  183. package/dist/chunk-89mnpfvy.js +0 -2
  184. package/dist/chunk-91srr77d.js +0 -2
  185. package/dist/chunk-9hj714bv.js +0 -2
  186. package/dist/chunk-9rss6865.js +0 -2
  187. package/dist/chunk-df9xr1f5.js +0 -2
  188. package/dist/chunk-dq00mfya.js +0 -2
  189. package/dist/chunk-fnb68m68.js +0 -2
  190. package/dist/chunk-g6a16nyh.js +0 -2
  191. package/dist/chunk-gtgpa8nc.js +0 -2
  192. package/dist/chunk-gxjax5n3.js +0 -2
  193. package/dist/chunk-h9er1sh5.js +0 -2
  194. package/dist/chunk-mwpajm9x.js +0 -2
  195. package/dist/chunk-n5w9cwwg.js +0 -2
  196. package/dist/chunk-pt7wrvtr.js +0 -2
  197. package/dist/chunk-qndyhwdn.js +0 -2
  198. package/dist/chunk-v5dfx8mh.js +0 -2
  199. package/dist/chunk-wgq0yyqw.js +0 -2
  200. package/dist/chunk-wtfcgg9s.js +0 -2
  201. package/dist/chunk-z00b1r18.js +0 -2
  202. package/dist/data/data.d.ts +0 -99
  203. package/dist/data/enums/dataErrorKeys.d.ts +0 -7
  204. package/dist/data/enums/index.d.ts +0 -1
  205. package/dist/data/enums/index.js +0 -2
  206. package/dist/data/index.d.ts +0 -1
  207. package/dist/data/index.js +0 -2
  208. package/dist/data/transformers/camelCase.d.ts +0 -25
  209. package/dist/data/transformers/index.d.ts +0 -4
  210. package/dist/data/transformers/index.js +0 -2
  211. package/dist/data/transformers/kebabCase.d.ts +0 -25
  212. package/dist/data/transformers/pascalCase.d.ts +0 -25
  213. package/dist/data/transformers/snakeCase.d.ts +0 -25
  214. package/dist/data/types/index.d.ts +0 -1
  215. package/dist/data/types/keyTransformer.d.ts +0 -11
  216. package/dist/database/enums/databaseErrorKeys.d.ts +0 -52
  217. package/dist/database/enums/index.d.ts +0 -2
  218. package/dist/database/enums/index.js +0 -2
  219. package/dist/database/enums/mssqlErrorCode.d.ts +0 -25
  220. package/dist/database/events/index.d.ts +0 -2
  221. package/dist/database/events/mssqlEventMap.d.ts +0 -6
  222. package/dist/database/events/tableEventMap.d.ts +0 -7
  223. package/dist/database/index.d.ts +0 -2
  224. package/dist/database/index.js +0 -2
  225. package/dist/database/types/index.d.ts +0 -3
  226. package/dist/database/types/mssqlEventLog.d.ts +0 -29
  227. package/dist/database/types/queryContext.d.ts +0 -11
  228. package/dist/elysia/advancedSearch.d.ts +0 -460
  229. package/dist/elysia/crud.d.ts +0 -609
  230. package/dist/elysia/dynamicDatabaseSelector.d.ts +0 -352
  231. package/dist/elysia/enums/elysiaErrorKeys.d.ts +0 -12
  232. package/dist/elysia/enums/httpStatusCode.d.ts +0 -241
  233. package/dist/elysia/enums/index.d.ts +0 -2
  234. package/dist/elysia/enums/index.js +0 -2
  235. package/dist/elysia/error.d.ts +0 -46
  236. package/dist/elysia/index.d.ts +0 -7
  237. package/dist/elysia/index.js +0 -2
  238. package/dist/elysia/jwt.d.ts +0 -46
  239. package/dist/elysia/schemas/index.d.ts +0 -2
  240. package/dist/elysia/schemas/index.js +0 -2
  241. package/dist/elysia/types/crudOptions.d.ts +0 -126
  242. package/dist/elysia/types/crudRoutes.d.ts +0 -2
  243. package/dist/elysia/types/dynamicDatabaseSelectorPluginOptions.d.ts +0 -30
  244. package/dist/elysia/types/index.d.ts +0 -5
  245. package/dist/elysia/types/jwtOptions.d.ts +0 -92
  246. package/dist/error/coreError.d.ts +0 -89
  247. package/dist/error/index.d.ts +0 -1
  248. package/dist/error/index.js +0 -2
  249. package/dist/error/types/coreErrorOptions.d.ts +0 -21
  250. package/dist/error/types/index.d.ts +0 -1
  251. package/dist/index.d.ts +0 -68
  252. package/dist/index.js +0 -2
  253. package/dist/logger/enums/index.d.ts +0 -1
  254. package/dist/logger/enums/index.js +0 -2
  255. package/dist/logger/enums/loggerErrorKeys.d.ts +0 -6
  256. package/dist/logger/events/index.d.ts +0 -1
  257. package/dist/logger/events/loggerEvents.d.ts +0 -4
  258. package/dist/logger/index.d.ts +0 -1
  259. package/dist/logger/index.js +0 -2
  260. package/dist/logger/logger.d.ts +0 -173
  261. package/dist/logger/strategies/index.d.ts +0 -2
  262. package/dist/logger/strategies/index.js +0 -2
  263. package/dist/logger/types/index.d.ts +0 -6
  264. package/dist/mailer/enums/index.d.ts +0 -1
  265. package/dist/mailer/enums/index.js +0 -2
  266. package/dist/mailer/enums/mailerErrorKeys.d.ts +0 -8
  267. package/dist/mailer/index.d.ts +0 -1
  268. package/dist/mailer/index.js +0 -2
  269. package/dist/mailer/types/index.d.ts +0 -3
  270. package/dist/repository/index.d.ts +0 -1
  271. package/dist/repository/index.js +0 -2
  272. package/dist/repository/repository.d.ts +0 -378
  273. package/dist/repository/types/advancedSearch.d.ts +0 -47
  274. package/dist/repository/types/index.d.ts +0 -8
  275. package/dist/repository/types/orderBy.d.ts +0 -21
  276. package/dist/repository/types/queryOptions.d.ts +0 -33
  277. package/dist/repository/types/selectedFields.d.ts +0 -16
  278. package/dist/repository/types/whereClause.d.ts +0 -15
  279. package/dist/singletonManager/enums/index.d.ts +0 -1
  280. package/dist/singletonManager/enums/index.js +0 -2
  281. package/dist/singletonManager/enums/singletonManagerErrorKeys.d.ts +0 -7
  282. package/dist/singletonManager/index.d.ts +0 -1
  283. package/dist/singletonManager/index.js +0 -2
  284. package/dist/singletonManager/singletonManager.d.ts +0 -112
  285. package/dist/store/index.d.ts +0 -1
  286. package/dist/store/index.js +0 -2
  287. package/dist/store/redis.d.ts +0 -6
  288. package/dist/typedEventEmitter/index.d.ts +0 -1
  289. package/dist/typedEventEmitter/index.js +0 -2
  290. package/dist/typedEventEmitter/types/index.d.ts +0 -1
  291. package/dist/utils/enums/index.d.ts +0 -1
  292. package/dist/utils/enums/index.js +0 -2
  293. package/dist/utils/enums/utilErrorKeys.d.ts +0 -4
  294. package/dist/utils/isIsoDateString.d.ts +0 -1
  295. /package/dist/{data → errors}/types/index.js +0 -0
  296. /package/dist/{database/events → modules/data/types}/index.js +0 -0
  297. /package/dist/{database/types → modules/database/events}/index.js +0 -0
  298. /package/dist/{elysia → modules/database}/types/index.js +0 -0
  299. /package/dist/{error → modules/elysia/crud}/types/index.js +0 -0
  300. /package/dist/{logger/events → modules/elysia/crudSchema/types}/index.js +0 -0
  301. /package/dist/{logger → modules/elysia/dbResolver}/types/index.js +0 -0
  302. /package/dist/{mailer → modules/elysia/jwt}/types/index.js +0 -0
  303. /package/dist/{elysia → modules/elysia/microservice}/schemas/info.d.ts +0 -0
  304. /package/dist/{elysia → modules/elysia/microservice}/schemas/ping.d.ts +0 -0
  305. /package/dist/{repository → modules/elysia/ratelimit}/types/index.js +0 -0
  306. /package/dist/{typedEventEmitter/types → modules/logger/events}/index.js +0 -0
  307. /package/dist/{logger → modules/logger}/types/bodiesIntersection.d.ts +0 -0
  308. /package/dist/{logger → modules/logger}/types/logLevels.d.ts +0 -0
  309. /package/dist/{logger → modules/logger}/types/strategyBody.d.ts +0 -0
  310. /package/dist/{logger → modules/logger}/types/strategyMap.d.ts +0 -0
  311. /package/dist/{repository → modules/repository}/types/transaction.d.ts +0 -0
  312. /package/dist/{typedEventEmitter → modules/typedEventEmitter}/types/eventMap.d.ts +0 -0
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{h as a,i as b,j as c,k as d,l as g,m as h,n as i,o as j,p as k,q as l,r as n}from"../chunk-pt7wrvtr.js";import"../chunk-gxjax5n3.js";import"../chunk-wtfcgg9s.js";import"../chunk-df9xr1f5.js";import"../chunk-v5dfx8mh.js";import"../chunk-mwpajm9x.js";import"../chunk-9rss6865.js";import"../chunk-5nvsx7md.js";import"../chunk-n5w9cwwg.js";import"../chunk-fnb68m68.js";import"../chunk-9hj714bv.js";import"../chunk-g6a16nyh.js";import"../chunk-z00b1r18.js";import"../chunk-qndyhwdn.js";import"../chunk-4w7nd4nw.js";export{n as rateLimitPlugin,l as microservicePlugin,k as jwtPlugin,j as errorPlugin,d as dynamicDatabaseSelectorPlugin,i as crudPlugin,g as createResponse200Schema,h as createInsertBodySchema,b as createBaseSearchSchemaWithPagination,a as createBaseSearchSchema,c as advancedSearchPlugin};
@@ -1,46 +0,0 @@
1
- import { Elysia } from 'elysia';
2
- import { type JWTPayload } from 'jose';
3
- import type { JWTOptions } from './types/jwtOptions';
4
- /**
5
- * The `jwtPlugin` provides JSON Web Token (JWT) authentication capabilities for Elysia applications.
6
- *
7
- * The plugin adds two primary methods to your Elysia context:
8
- * - `sign()`: Generate and sign new JWTs
9
- * - `verify()`: Validate and decode existing JWTs
10
- *
11
- * @template Name - The name to use for JWT functionality in the context (default: 'jwt')
12
- * @param options - Configuration options for the JWT plugin
13
- *
14
- * @returns An Elysia plugin that adds JWT functionality to the application context
15
- */
16
- export declare const jwtPlugin: <const Name extends string = "jwt">(options: JWTOptions<Name>) => Elysia<"", {
17
- decorator: { [name in Name]: {
18
- sign(additionalPayload?: JWTPayload, exp?: number | string | Date): Promise<string>;
19
- verify(jwt?: string): Promise<JWTPayload | false>;
20
- }; } extends infer T ? { [K in keyof T]: { [name in Name]: {
21
- sign(additionalPayload?: JWTPayload, exp?: number | string | Date): Promise<string>;
22
- verify(jwt?: string): Promise<JWTPayload | false>;
23
- }; }[K]; } : never;
24
- store: {};
25
- derive: {};
26
- resolve: {};
27
- }, {
28
- typebox: {};
29
- error: {};
30
- }, {
31
- schema: {};
32
- standaloneSchema: {};
33
- macro: {};
34
- macroFn: {};
35
- parser: {};
36
- }, {}, {
37
- derive: {};
38
- resolve: {};
39
- schema: import("elysia").MergeSchema<{}, {}, "">;
40
- standaloneSchema: import("elysia/types").PrettifySchema<{}>;
41
- }, {
42
- derive: {};
43
- resolve: {};
44
- schema: {};
45
- standaloneSchema: {};
46
- }>;
@@ -1,2 +0,0 @@
1
- export * from './info';
2
- export * from './ping';
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$ as m,_ as f}from"../../chunk-mwpajm9x.js";import"../../chunk-4w7nd4nw.js";export{m as pingResponse200Schema,f as infoResponse200Schema};
@@ -1,126 +0,0 @@
1
- import type { Static, TObject } from '@sinclair/typebox';
2
- import type { Context, DefinitionBase, Elysia, EphemeralType, MetadataBase, RouteBase, RouteSchema, SingletonBase } from 'elysia';
3
- import type { CRUDRoutes } from './crudRoutes';
4
- import type { DynamicDatabaseSelectorPluginOptions } from './dynamicDatabaseSelectorPluginOptions';
5
- /**
6
- * Options for the CRUD plugin
7
- *
8
- * @template TInferedObject - The type of the object to be used in the CRUD operations extending {@link TObject}
9
- * @template KEnumPermission - The type of the enum for permissions extending {@link String}
10
- */
11
- export interface CrudOptions<TInferedObject extends TObject, KEnumPermission extends string> {
12
- /**
13
- * Optional API path prefix for all generated routes.
14
- *
15
- * When specified, all routes will be prefixed with this path.
16
- * For example, if prefix is '/api/users', the find route will be '/api/users/count'.
17
- *
18
- * @defaultValue ''
19
- */
20
- prefix?: string;
21
- /**
22
- * The name of the table this CRUD interface will manage.
23
- *
24
- * This should match the database table name and will be used to identify
25
- * the repository and models in the generated API.
26
- */
27
- tableName: string;
28
- /**
29
- * Database configuration for the CRUD operations.
30
- *
31
- * This can either be a string (database name) for static connections or a
32
- * DynamicDatabaseSelectorPluginOptions object for dynamic database selection.
33
- *
34
- * @example
35
- * ```typescript
36
- * // Static database connection
37
- * database: 'my_database'
38
- *
39
- * // Dynamic database selection
40
- * database: {
41
- * baseDatabaseConfig: {
42
- * host: 'localhost',
43
- * port: 1433,
44
- * user: 'sa',
45
- * password: 'Password123'
46
- * },
47
- * headerKey: 'x-tenant-db'
48
- * }
49
- * ```
50
- *
51
- * @see {@link DynamicDatabaseSelectorPluginOptions}
52
- *
53
- */
54
- database: string | DynamicDatabaseSelectorPluginOptions;
55
- /**
56
- * The schema to be used for the CRUD operations {@link TInferedObject}
57
- * [TODO] - improve this description when working on the AND-188 ticket
58
- */
59
- baseSchema: TInferedObject;
60
- /**
61
- * Array of property names from the schema that should be required in insert operations.
62
- *
63
- * When specified, these properties will be required in the body of insert requests,
64
- * while other properties will remain optional.
65
- *
66
- * @example
67
- * ```typescript
68
- * // Makes name and email required for insertion, while other fields remain optional
69
- * insertPropertiesSchemaRequired: ['name', 'email']
70
- * ```
71
- */
72
- insertPropertiesSchemaRequired?: (keyof Static<TInferedObject>)[];
73
- /**
74
- * Array of route types to include in the generated API.
75
- *
76
- * @see {@link CRUDRoutes}
77
- *
78
- * @example
79
- * ```typescript
80
- * // Only generate read-only routes
81
- * includedRoutes: ['find', 'findOne', 'count']
82
- * ```
83
- */
84
- includedRoutes?: CRUDRoutes[];
85
- /**
86
- * Array of route types to exclude from the generated API.
87
- *
88
- * @see {@link CRUDRoutes}
89
- *
90
- * @example
91
- * ```typescript
92
- * // Generate all routes except delete operations
93
- * excludedRoutes?: ['delete', 'deleteOne']
94
- * ```
95
- */
96
- excludedRoutes?: CRUDRoutes[];
97
- /** This allows configuring permissions for each CRUD route. */
98
- permissionConfig: {
99
- /**
100
- * A bit tricky: this should be an instance of {@link Elysia} that must have two macros
101
- * called `needsOnePermission` and `needsMultiplePermissions`, each taking an array of permissions {@link KEnumPermission}
102
- * as a parameter and throwing a {@link CoreError} if the user does not have the required permission.
103
- */
104
- permissionsPlugin: Elysia<'', SingletonBase, DefinitionBase, MetadataBase & {
105
- schema: RouteSchema;
106
- macro: Partial<{
107
- readonly needsOnePermission: KEnumPermission[];
108
- readonly needsMultiplePermissions: KEnumPermission[];
109
- }>;
110
- macroFn: {
111
- readonly needsOnePermission: (permissions: KEnumPermission[]) => {
112
- beforeHandle: (ctx: Context) => Promise<void>;
113
- };
114
- readonly needsMultiplePermissions: (permissions: KEnumPermission[]) => {
115
- beforeHandle: (ctx: Context) => Promise<void>;
116
- };
117
- };
118
- }, RouteBase, EphemeralType, EphemeralType>;
119
- /**
120
- * The permissions to be used for the CRUD operations
121
- * @see {@link CRUDRoutes}
122
- * @see {@link KEnumPermission}
123
- */
124
- operationsPermissions: Partial<Record<CRUDRoutes, KEnumPermission[]>>;
125
- };
126
- }
@@ -1,2 +0,0 @@
1
- /** CRUD Routes is a type that represents the different CRUD operations */
2
- export type CRUDRoutes = 'insert' | 'find' | 'findOne' | 'update' | 'updateOne' | 'delete' | 'deleteOne' | 'count';
@@ -1,30 +0,0 @@
1
- import type { MSSQLDatabaseOptions } from '../../database/types';
2
- /**
3
- * Options to configure the dynamic database selector plugin.
4
- *
5
- * @example
6
- * ```typescript
7
- * const options: DynamicDatabaseSelectorPluginOptions = {
8
- * baseDatabaseConfig: {
9
- * host: 'localhost',
10
- * port: 1433,
11
- * user: 'sa',
12
- * password: 'Password123',
13
- * encrypt: true
14
- * },
15
- * headerKey: 'x-database-name'
16
- * };
17
- * ```
18
- */
19
- export interface DynamicDatabaseSelectorPluginOptions {
20
- /**
21
- * Options for the database connection
22
- * @see {@link MSSQLDatabaseOptions}
23
- */
24
- baseDatabaseConfig: Omit<MSSQLDatabaseOptions, 'databaseName'>;
25
- /**
26
- * The name of the key to be used in the header to select the database
27
- * @example 'x-database-name'
28
- */
29
- headerKey?: string;
30
- }
@@ -1,5 +0,0 @@
1
- export type * from './crudOptions';
2
- export type * from './crudRoutes';
3
- export type * from './dynamicDatabaseSelectorPluginOptions';
4
- export type * from './jwtOptions';
5
- export type * from './rateLimitOptions';
@@ -1,92 +0,0 @@
1
- import type { JWSHeaderParameters, JWTPayload } from 'jose';
2
- /**
3
- * Configuration options for the JWT plugin.
4
- *
5
- * @template TPluginName - The name to be used for accessing the JWT functionality in the Elysia context
6
- *
7
- * @example
8
- * ```typescript
9
- * const options: JWTOption = {
10
- * name: 'auth',
11
- * secret: process.env.JWT_SECRET || 'your-secret-key',
12
- * exp: '1d',
13
- * header: {
14
- * alg: 'HS256',
15
- * typ: 'JWT'
16
- * },
17
- * payload: {
18
- * iss: 'my-api',
19
- * aud: 'my-client'
20
- * }
21
- * };
22
- * ```
23
- */
24
- export interface JWTOptions<TPluginName extends string | undefined = 'jwt'> {
25
- /**
26
- * JWT name to add in context with decorate.
27
- *
28
- * This allows you to customize how you access the JWT functionality in your
29
- * route handlers. For example, if set to 'auth', you would use `auth.sign()`
30
- * instead of the default `jwt.sign()`.
31
- *
32
- * @defaultValue 'jwt'
33
- */
34
- name?: TPluginName;
35
- /**
36
- * Secret key used to sign and verify JWTs.
37
- *
38
- * @example
39
- * ```typescript
40
- * // Using a string secret
41
- * secret: 'your-very-secret-key'
42
- *
43
- * // Using an environment variable (recommended for production)
44
- * secret: process.env.JWT_SECRET
45
- * ```
46
- */
47
- secret: string;
48
- /**
49
- * JWT expiration setting. Applies as the default expiration for tokens.
50
- *
51
- * Controls how long tokens are valid before they expire. This setting provides
52
- * a good balance between security (limiting the window of opportunity for token misuse)
53
- * and user experience (not requiring frequent re-authentication).
54
- *
55
- * @defaultValue '15m' (15 minutes)
56
- *
57
- * @example
58
- * ```typescript
59
- * // Set tokens to expire after 1 hour
60
- * exp: '1h'
61
- *
62
- * // Set tokens to expire at a specific date
63
- * exp: new Date('2023-12-31')
64
- *
65
- * // Set tokens to expire after 3600 seconds (1 hour)
66
- * exp: 3600
67
- * ```
68
- */
69
- exp?: number | string | Date;
70
- /**
71
- * Default JWT header parameters to include in every JWT.
72
- *
73
- * This allows you to specify additional metadata about the token.
74
- */
75
- header?: JWSHeaderParameters;
76
- /**
77
- * Default payload values to include in every JWT.
78
- *
79
- * These values are merged with any additional payload provided during signing,
80
- * allowing you to set standard claims that should be included in all tokens
81
- * generated by your application.
82
- *
83
- * @example
84
- * ```typescript
85
- * payload: {
86
- * iss: 'my-api', // Issuer
87
- * aud: 'my-frontend', // Audience
88
- * }
89
- * ```
90
- */
91
- payload?: JWTPayload;
92
- }
@@ -1,89 +0,0 @@
1
- import type { CoreErrorOptions } from './types/coreErrorOptions';
2
- /**
3
- * A custom error class that extends the native {@link Error} class, providing additional properties
4
- * such as a unique identifier, error key, HTTP status code, and cause.
5
- *
6
- * @template T - The type of the cause of the error, which can be any object or error.
7
- *
8
- * @example
9
- * The following example demonstrates how to throw and catch a CoreError.
10
- * ```typescript
11
- * try {
12
- * throw new CoreError({
13
- * message: 'An error occurred',
14
- * key: 'example.error',
15
- * httpStatusCode: 400,
16
- * cause: new Error('Original error')
17
- * });
18
- * } catch (error) {
19
- * if (error instanceof CoreError) {
20
- * console.error(`Error UUID: ${error.uuid}`);
21
- * console.error(`Error Date: ${error.date}`);
22
- * console.error(`Error Key: ${error.key}`);
23
- * console.error(`HTTP Status Code: ${error.httpStatusCode}`);
24
- * console.error(`Cause: ${error.cause}`);
25
- * }
26
- * }
27
- * ```
28
- *
29
- * @example
30
- * The following example demonstrates how to create a CoreError with a custom cause type.
31
- * ```typescript
32
- * const coreError = new CoreError<{ foo: string }>({
33
- * message: 'Custom error with cause',
34
- * key: 'core-package.error.custom_error',
35
- * httpStatusCode: 500,
36
- * cause: { foo: 'bar' },
37
- * });
38
- * console.log(coreError.cause); // { foo: 'bar' }
39
- * ```
40
- */
41
- export declare class CoreError<const T = unknown> extends Error {
42
- /**
43
- * The cause of the error, typically used to store the original error or additional context.
44
- */
45
- readonly cause: T | undefined;
46
- /**
47
- * The unique identifier of the error, automatically generated using UUID v7.
48
- * This identifier is particularly useful for tracking errors in logs.
49
- */
50
- private readonly _uuid;
51
- /**
52
- * The date when the error was created, automatically set to the current date and time.
53
- */
54
- private readonly _date;
55
- /**
56
- * A unique key identifying the type of error, useful for localization or error handling.
57
- */
58
- private readonly _key;
59
- /**
60
- * The HTTP status code associated with the error, typically used in API responses.
61
- */
62
- private readonly _httpStatusCode;
63
- /**
64
- * Creates a new instance of the CoreError class.
65
- *
66
- * @param coreErrorOptions - The options for the Core error. ({@link CoreErrorOptions})
67
- */
68
- constructor(coreErrorOptions?: Readonly<CoreErrorOptions<T>>);
69
- /**
70
- * Gets the unique identifier of the error.
71
- * @returns The UUID of the error.
72
- */
73
- get uuid(): string;
74
- /**
75
- * Gets the date when the error was created.
76
- * @returns The creation date of the error.
77
- */
78
- get date(): Date;
79
- /**
80
- * Gets the error key, which identifies the type of error.
81
- * @returns The key associated with the error.
82
- */
83
- get key(): string;
84
- /**
85
- * Gets the HTTP status code associated with the error.
86
- * @returns The HTTP status code.
87
- */
88
- get httpStatusCode(): number;
89
- }
@@ -1 +0,0 @@
1
- export * from './coreError';
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ra as e}from"../chunk-z00b1r18.js";import"../chunk-4w7nd4nw.js";export{e as CoreError};
@@ -1,21 +0,0 @@
1
- /**
2
- * Represents the options for the Core error.
3
- */
4
- export interface CoreErrorOptions<T = unknown> {
5
- /**
6
- * The error message describing what went wrong.
7
- */
8
- message?: string;
9
- /**
10
- * A unique key identifying the type of error, useful for localization or error handling.
11
- */
12
- key?: string;
13
- /**
14
- * The HTTP status code associated with the error, typically used in API responses.
15
- */
16
- httpStatusCode?: number;
17
- /**
18
- * The cause of the error, which can be an original error or additional context.
19
- */
20
- cause?: T;
21
- }
@@ -1 +0,0 @@
1
- export type * from './coreErrorOptions';
package/dist/index.d.ts DELETED
@@ -1,68 +0,0 @@
1
- export * from './data/data';
2
- export * from './data/enums/dataErrorKeys';
3
- export * from './data/transformers/camelCase';
4
- export * from './data/transformers/kebabCase';
5
- export * from './data/transformers/pascalCase';
6
- export * from './data/transformers/snakeCase';
7
- export type * from './data/types/keyTransformer';
8
- export * from './database';
9
- export * from './database/enums/databaseErrorKeys';
10
- export * from './database/enums/mssqlErrorCode';
11
- export type * from './database/events/mssqlEventMap';
12
- export type * from './database/events/tableEventMap';
13
- export type * from './database/types/mssqlDatabaseOption';
14
- export type * from './database/types/mssqlEventLog';
15
- export type * from './database/types/queryContext';
16
- export * from './elysia/advancedSearch';
17
- export * from './elysia/crud';
18
- export * from './elysia/dynamicDatabaseSelector';
19
- export * from './elysia/error';
20
- export * from './elysia/jwt';
21
- export * from './elysia/microservice';
22
- export * from './elysia/ratelimit';
23
- export * from './elysia/enums/elysiaErrorKeys';
24
- export * from './elysia/enums/httpStatusCode';
25
- export * from './elysia/schemas/info';
26
- export * from './elysia/schemas/ping';
27
- export type * from './elysia/types/crudOptions';
28
- export type * from './elysia/types/crudRoutes';
29
- export type * from './elysia/types/dynamicDatabaseSelectorPluginOptions';
30
- export type * from './elysia/types/jwtOptions';
31
- export type * from './elysia/types/rateLimitOptions';
32
- export * from './error/coreError';
33
- export type * from './error/types/coreErrorOptions';
34
- export * from './logger/logger';
35
- export * from './logger/enums/loggerErrorKeys';
36
- export type * from './logger/events/loggerEvents';
37
- export * from './logger/strategies/consoleLogger';
38
- export * from './logger/strategies/fileLogger';
39
- export type * from './logger/types/bodiesIntersection';
40
- export type * from './logger/types/logLevels';
41
- export type * from './logger/types/logStreamChunk';
42
- export type * from './logger/types/loggerStrategy';
43
- export type * from './logger/types/strategyBody';
44
- export type * from './logger/types/strategyMap';
45
- export * from './mailer/smtp';
46
- export * from './mailer/enums/mailerErrorKeys';
47
- export type * from './mailer/types/smtpCredentials';
48
- export type * from './mailer/types/smtpOptions';
49
- export type * from './mailer/types/smtpPoolOptions';
50
- export * from './repository/repository';
51
- export type * from './repository/types/advancedSearch';
52
- export type * from './repository/types/orderBy';
53
- export type * from './repository/types/queryOptions';
54
- export type * from './repository/types/queryOptionsExtendPagination';
55
- export type * from './repository/types/queryOptionsExtendStream';
56
- export type * from './repository/types/selectedFields';
57
- export type * from './repository/types/transaction';
58
- export type * from './repository/types/whereClause';
59
- export * from './singletonManager/singletonManager';
60
- export * from './singletonManager/enums/singletonManagerErrorKeys';
61
- export * from './store/redis';
62
- export * from './typedEventEmitter/typedEventEmitter';
63
- export type * from './typedEventEmitter/types/eventMap';
64
- export * from './utils/env';
65
- export * from './utils/isIsoDateString';
66
- export * from './utils/stream';
67
- export * from './utils/enums/utilErrorKeys';
68
- export type * from './utils/types/streamWithAsyncIterable';
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{a as Tb}from"./chunk-dq00mfya.js";import{b as Vb}from"./chunk-89mnpfvy.js";import{c as Ub}from"./chunk-91srr77d.js";import{d as Ob,e as Pb}from"./chunk-1c7w5cx7.js";import{f as Rb}from"./chunk-h9er1sh5.js";import{g as Qb}from"./chunk-40pg2cqx.js";import{h as cb,i as fb,j as hb,k as wb,l as xb,m as zb,n as Ab,o as Bb,p as Cb,q as Hb,r as Lb}from"./chunk-pt7wrvtr.js";import{s as kb}from"./chunk-gxjax5n3.js";import{t as jb}from"./chunk-wtfcgg9s.js";import"./chunk-df9xr1f5.js";import{Y as qb,Z as Jb}from"./chunk-v5dfx8mh.js";import{$ as Gb,_ as Fb}from"./chunk-mwpajm9x.js";import{aa as Nb}from"./chunk-gtgpa8nc.js";import{ba as Mb}from"./chunk-wgq0yyqw.js";import{ca as d,da as o,ea as p,fa as v}from"./chunk-9rss6865.js";import{ga as a}from"./chunk-5nvsx7md.js";import{ha as y,ia as m,ja as l,ka as n}from"./chunk-4v4tp5qj.js";import"./database/index.js";import{la as t,ma as bb}from"./chunk-n5w9cwwg.js";import{na as s}from"./chunk-fnb68m68.js";import{oa as r,pa as i}from"./chunk-9hj714bv.js";import{qa as e}from"./chunk-g6a16nyh.js";import{ra as S}from"./chunk-z00b1r18.js";import{sa as E,ta as u}from"./chunk-qndyhwdn.js";import"./chunk-4w7nd4nw.js";export{Vb as validateEnv,Ub as utilErrorKeys,v as transformKeys,jb as singletonManagerErrorKeys,Lb as rateLimitPlugin,Gb as pingResponse200Schema,u as mssqlErrorCode,Hb as microservicePlugin,i as makeStreamAsyncIterable,Qb as mailerErrorKeys,Mb as loggerErrorKeys,Cb as jwtPlugin,r as isIsoDateString,Fb as infoResponse200Schema,Jb as httpStatusCode,p as filterByValue,o as filterByKeyInclusion,d as filterByKeyExclusion,Bb as errorPlugin,qb as elysiaErrorKeys,wb as dynamicDatabaseSelectorPlugin,E as databaseErrorKeys,a as dataErrorKeys,Ab as crudPlugin,xb as createResponse200Schema,zb as createInsertBodySchema,fb as createBaseSearchSchemaWithPagination,cb as createBaseSearchSchema,hb as advancedSearchPlugin,e as TypedEventEmitter,t as Table,n as SnakeCaseTransformer,kb as SingletonManager,Rb as SMTP,s as Repository,Tb as Redis,l as PascalCaseTransformer,bb as MSSQL,Nb as Logger,m as KebabCaseTransformer,Pb as FileLoggerStrategy,S as CoreError,Ob as ConsoleLoggerStrategy,y as CamelCaseTransformer};
@@ -1 +0,0 @@
1
- export * from './loggerErrorKeys';
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ba as e}from"../../chunk-wgq0yyqw.js";import"../../chunk-4w7nd4nw.js";export{e as loggerErrorKeys};
@@ -1,6 +0,0 @@
1
- export declare const loggerErrorKeys: {
2
- readonly stategyAlreadyAdded: "core.error.strategy_already_added";
3
- readonly strategyNotFound: "core.error.strategy_not_found";
4
- readonly noStrategyAdded: "core.error.no_strategy_added";
5
- readonly loggerStrategyError: "core.error.strategy_error";
6
- };
@@ -1 +0,0 @@
1
- export type * from './loggerEvents';
@@ -1,4 +0,0 @@
1
- export interface LoggerEvent {
2
- error: [Error];
3
- end: [];
4
- }
@@ -1 +0,0 @@
1
- export * from './logger';
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{aa as e}from"../chunk-gtgpa8nc.js";import"../chunk-wgq0yyqw.js";import"../chunk-g6a16nyh.js";import"../chunk-z00b1r18.js";import"../chunk-4w7nd4nw.js";export{e as Logger};