@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
@@ -0,0 +1,2 @@
1
+ import type { CrudOperationBaseOptions } from './crudOperationBaseOptions';
2
+ export type CrudOperationUpdateOneOptions = CrudOperationBaseOptions;
@@ -0,0 +1,2 @@
1
+ import type { CrudOperationBaseOptions } from './crudOperationBaseOptions';
2
+ export type CrudOperationUpdateOptions = CrudOperationBaseOptions;
@@ -0,0 +1,18 @@
1
+ import type { CrudOperationCountOptions } from './crudOperationCountOptions';
2
+ import type { CrudOperationDeleteOneOptions } from './crudOperationDeleteOneOptions';
3
+ import type { CrudOperationDeleteOptions } from './crudOperationDeleteOptions';
4
+ import type { CrudOperationFindOneOptions } from './crudOperationFindOneOptions';
5
+ import type { CrudOperationFindOptions } from './crudOperationFindOptions';
6
+ import type { CrudOperationInsertOptions } from './crudOperationInsertOptions';
7
+ import type { CrudOperationUpdateOneOptions } from './crudOperationUpdateOneOptions';
8
+ import type { CrudOperationUpdateOptions } from './crudOperationUpdateOptions';
9
+ export interface CrudOperationsOptions {
10
+ readonly find?: CrudOperationFindOptions | true;
11
+ readonly findOne?: CrudOperationFindOneOptions | true;
12
+ readonly insert?: CrudOperationInsertOptions | true;
13
+ readonly update?: CrudOperationUpdateOptions | true;
14
+ readonly updateOne?: CrudOperationUpdateOneOptions | true;
15
+ readonly delete?: CrudOperationDeleteOptions | true;
16
+ readonly deleteOne?: CrudOperationDeleteOneOptions | true;
17
+ readonly count?: CrudOperationCountOptions | true;
18
+ }
@@ -0,0 +1,23 @@
1
+ import type { TObject } from '@sinclair/typebox';
2
+ import type { DynamicDbOptions } from '../../../../modules/elysia/dbResolver/types/dynamicDbOptions';
3
+ import type { CrudOperationsOptions } from './crudOperationsOptions';
4
+ /**
5
+ * Options for the CRUD plugin
6
+ *
7
+ * @template TSourceSchema - The type of the object to be used in the CRUD operations extending {@link TObject}
8
+ * @template KEnumPermission - The type of the enum for permissions extending {@link String}
9
+ */
10
+ export interface CrudOptions<TDatabase extends DynamicDbOptions | string, TTableName extends string, TSourceSchema extends TObject, TOperations extends CrudOperationsOptions = CrudOperationsOptions, TSourceFindSchema extends TObject = TSourceSchema, TSourceCountSchema extends TObject = TSourceSchema, TSourceInsertSchema extends TObject = TSourceSchema, TSourceUpdateSchema extends TObject = TSourceSchema, TSourceDeleteSchema extends TObject = TSourceSchema, TSourceResponseSchema extends TObject = TSourceSchema> {
11
+ readonly database: TDatabase;
12
+ readonly tableName: TTableName;
13
+ readonly schema: {
14
+ readonly sourceSchema: TSourceSchema;
15
+ readonly sourceFindSchema?: TSourceFindSchema;
16
+ readonly sourceCountSchema?: TSourceCountSchema;
17
+ readonly sourceInsertSchema?: TSourceInsertSchema;
18
+ readonly sourceUpdateSchema?: TSourceUpdateSchema;
19
+ readonly sourceDeleteSchema?: TSourceDeleteSchema;
20
+ readonly sourceResponseSchema?: TSourceResponseSchema;
21
+ };
22
+ readonly operations?: TOperations;
23
+ }
@@ -0,0 +1,11 @@
1
+ export type { CrudOperationBaseOptions } from './crudOperationBaseOptions';
2
+ export type { CrudOperationCountOptions } from './crudOperationCountOptions';
3
+ export type { CrudOperationDeleteOneOptions } from './crudOperationDeleteOneOptions';
4
+ export type { CrudOperationDeleteOptions } from './crudOperationDeleteOptions';
5
+ export type { CrudOperationFindOneOptions } from './crudOperationFindOneOptions';
6
+ export type { CrudOperationFindOptions } from './crudOperationFindOptions';
7
+ export type { CrudOperationInsertOptions } from './crudOperationInsertOptions';
8
+ export type { CrudOperationsOptions } from './crudOperationsOptions';
9
+ export type { CrudOperationUpdateOneOptions } from './crudOperationUpdateOneOptions';
10
+ export type { CrudOperationUpdateOptions } from './crudOperationUpdateOptions';
11
+ export type { CrudOptions } from './crudOptions';
@@ -0,0 +1,18 @@
1
+ import type { TObject } from '@sinclair/typebox/type';
2
+ import { Elysia, type SingletonBase } from 'elysia';
3
+ import type { CrudModelsType } from './types/crudModelsType';
4
+ import type { CrudSchemaOperations } from './types/crudSchemaOperations';
5
+ import type { CrudSchemaOptions } from './types/crudSchemaOptions';
6
+ export declare const crudSchema: <const TSourceSchemaName extends string, const TSourceSchema extends TObject, const TSourceInsertSchema extends TObject = TSourceSchema, const TSourceFindSchema extends TObject = TSourceSchema, const TSourceCountSchema extends TObject = TSourceSchema, const TSourceUpdateSchema extends TObject = TSourceSchema, const TSourceDeleteSchema extends TObject = TSourceSchema, const TSourceResponseSchema extends TObject = TSourceSchema, const TOperations extends CrudSchemaOperations = {
7
+ count: true;
8
+ find: true;
9
+ findOne: true;
10
+ insert: true;
11
+ update: true;
12
+ updateOne: true;
13
+ delete: true;
14
+ deleteOne: true;
15
+ }>({ sourceSchemaName, sourceSchema, sourceInsertSchema, sourceFindSchema, sourceCountSchema, sourceUpdateSchema, sourceDeleteSchema, sourceResponseSchema, operations }: CrudSchemaOptions<TSourceSchemaName, TSourceSchema, TSourceInsertSchema, TSourceFindSchema, TSourceCountSchema, TSourceUpdateSchema, TSourceDeleteSchema, TSourceResponseSchema, TOperations>) => Elysia<TSourceSchemaName, SingletonBase, {
16
+ typebox: CrudModelsType<TSourceSchemaName, TOperations, TSourceInsertSchema, TSourceFindSchema, TSourceCountSchema, TSourceUpdateSchema, TSourceDeleteSchema, TSourceResponseSchema>;
17
+ error: {};
18
+ }>;
@@ -0,0 +1 @@
1
+ export { crudSchema } from './crudSchema';
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import {
3
+ crudSchema
4
+ } from "../../../chunk-s07amdhx.js";
5
+ import"../../../chunk-f5z7x01b.js";
6
+ import"../../../chunk-cq973ydc.js";
7
+ import"../../../chunk-vknq69e0.js";
8
+ export {
9
+ crudSchema
10
+ };
@@ -0,0 +1,31 @@
1
+ import type { TArray, TBoolean, TDate, TInteger, TNumber, TObject, TPartial, TSchema, TString, TTuple } from '@sinclair/typebox';
2
+ export type AdaptiveWhereClauseSchema<TFieldSchema extends TSchema> = TPartial<(TFieldSchema extends TString ? TObject<{
3
+ $eq: TFieldSchema;
4
+ $neq: TFieldSchema;
5
+ $isNull: TBoolean;
6
+ } & {
7
+ $in: TArray<TFieldSchema>;
8
+ $nin: TArray<TFieldSchema>;
9
+ $like: TString;
10
+ $nlike: TString;
11
+ }> : TFieldSchema extends TNumber | TDate | TInteger ? TObject<{
12
+ $eq: TFieldSchema;
13
+ $neq: TFieldSchema;
14
+ $isNull: TBoolean;
15
+ } & {
16
+ $in: TArray<TFieldSchema>;
17
+ $nin: TArray<TFieldSchema>;
18
+ $like: TString;
19
+ $nlike: TString;
20
+ } & {
21
+ $lt: TFieldSchema;
22
+ $lte: TFieldSchema;
23
+ $gt: TFieldSchema;
24
+ $gte: TFieldSchema;
25
+ $between: TTuple<[TFieldSchema, TFieldSchema]>;
26
+ $nbetween: TTuple<[TFieldSchema, TFieldSchema]>;
27
+ }> : TObject<{
28
+ $eq: TBoolean;
29
+ $neq: TBoolean;
30
+ $isNull: TBoolean;
31
+ }>)>;
@@ -0,0 +1,14 @@
1
+ import type { TArray, TObject, TUnion } from '@sinclair/typebox';
2
+ import type { createCountResponse200Schema } from '../../../../modules/elysia/crudSchema/utils/createCountResponse200Schema';
3
+ import type { createCountSchema } from '../../../../modules/elysia/crudSchema/utils/createCountSchema';
4
+ import type { createDeleteSchema } from '../../../../modules/elysia/crudSchema/utils/createDeleteSchema';
5
+ import type { createFindSchema } from '../../../../modules/elysia/crudSchema/utils/createFindSchema';
6
+ import type { createIdParamSchema } from '../../../../modules/elysia/crudSchema/utils/createIdParamSchema';
7
+ import type { createResponse200Schema } from '../../../../modules/elysia/crudSchema/utils/createResponse200Schema';
8
+ import type { createUpdateOneSchema } from '../../../../modules/elysia/crudSchema/utils/createUpdateOneSchema';
9
+ import type { createUpdateSchema } from '../../../../modules/elysia/crudSchema/utils/createUpdateSchema';
10
+ import type { CrudSchemaOperations } from './crudSchemaOperations';
11
+ export type CrudModelsType<TSourceSchemaName extends string, TOperations extends CrudSchemaOperations, TSourceInsertSchema extends TObject, TSourceFindSchema extends TObject, TSourceCountSchema extends TObject, TSourceUpdateSchema extends TObject, TSourceDeleteSchema extends TObject, TSourceResponseSchema extends TObject> = (TOperations['insert'] extends true ? Record<`${TSourceSchemaName}Insert`, TUnion<[
12
+ TSourceInsertSchema,
13
+ TArray<TSourceInsertSchema>
14
+ ]>> : {}) & ((TOperations['find'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Find`, ReturnType<typeof createFindSchema<TSourceFindSchema>>> : {}) & ((TOperations['count'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Count`, ReturnType<typeof createCountSchema<TSourceCountSchema>>> : {}) & (TOperations['update'] extends true ? Record<`${TSourceSchemaName}Update`, ReturnType<typeof createUpdateSchema<TSourceUpdateSchema>>> : {}) & (TOperations['updateOne'] extends true ? Record<`${TSourceSchemaName}UpdateOne`, ReturnType<typeof createUpdateOneSchema<TSourceUpdateSchema>>> : {}) & (TOperations['delete'] extends true ? Record<`${TSourceSchemaName}Delete`, ReturnType<typeof createDeleteSchema<TSourceDeleteSchema>>> : {}) & (((TOperations['findOne'] extends true ? true : TOperations['updateOne'] extends true ? true : TOperations['deleteOne'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}IdParam`, ReturnType<typeof createIdParamSchema>> : {})) & ((TOperations['find'] extends true ? true : TOperations['findOne'] extends true ? true : TOperations['insert'] extends true ? true : TOperations['update'] extends true ? true : TOperations['updateOne'] extends true ? true : TOperations['delete'] extends true ? true : TOperations['deleteOne'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Response200`, ReturnType<typeof createResponse200Schema<TSourceResponseSchema>>> : {}) & (TOperations['count'] extends true ? Record<`${TSourceSchemaName}CountResponse200`, ReturnType<typeof createCountResponse200Schema>> : {});
@@ -0,0 +1,10 @@
1
+ export interface CrudSchemaOperations {
2
+ count?: boolean;
3
+ find?: boolean;
4
+ findOne?: boolean;
5
+ insert?: boolean;
6
+ update?: boolean;
7
+ updateOne?: boolean;
8
+ delete?: boolean;
9
+ deleteOne?: boolean;
10
+ }
@@ -0,0 +1,13 @@
1
+ import type { TObject } from '@sinclair/typebox/type';
2
+ import type { CrudSchemaOperations } from './crudSchemaOperations';
3
+ export interface CrudSchemaOptions<TSourceSchemaName extends string, TSourceSchema extends TObject, TSourceInsertSchema extends TObject = TSourceSchema, TSourceFindSchema extends TObject = TSourceSchema, TSourceCountSchema extends TObject = TSourceSchema, TSourceUpdateSchema extends TObject = TSourceSchema, TSourceDeleteSchema extends TObject = TSourceSchema, TSourceResponseSchema extends TObject = TSourceSchema, TOperations extends CrudSchemaOperations = CrudSchemaOperations> {
4
+ readonly sourceSchemaName: TSourceSchemaName;
5
+ readonly sourceSchema: TSourceSchema;
6
+ readonly sourceFindSchema?: TSourceFindSchema;
7
+ readonly sourceCountSchema?: TSourceCountSchema;
8
+ readonly sourceInsertSchema?: TSourceInsertSchema;
9
+ readonly sourceUpdateSchema?: TSourceUpdateSchema;
10
+ readonly sourceDeleteSchema?: TSourceDeleteSchema;
11
+ readonly sourceResponseSchema?: TSourceResponseSchema;
12
+ readonly operations?: TOperations;
13
+ }
@@ -0,0 +1,8 @@
1
+ export type { AdaptiveWhereClauseSchema } from './adaptiveWhereClauseSchema';
2
+ export type { CrudModelsType } from './crudModelsType';
3
+ export type { CrudSchemaOperations } from './crudSchemaOperations';
4
+ export type { CrudSchemaOptions } from './crudSchemaOptions';
5
+ export type { OrderSchema } from './orderSchema';
6
+ export type { QSchema } from './qSchema';
7
+ export type { QueryOptionsBuilderOptions } from './queryOptionsBuilderOptions';
8
+ export type { SelectedFieldsSchema } from './selectedFieldSchema';
@@ -0,0 +1,11 @@
1
+ import type { TArray, TKeyOf, TLiteral, TObject, TUnion } from '@sinclair/typebox';
2
+ export type OrderSchema<TSourceSchema extends TObject> = TUnion<[
3
+ TObject<{
4
+ selectedField: TKeyOf<TSourceSchema>;
5
+ direction: TUnion<[TLiteral<'asc'>, TLiteral<'desc'>]>;
6
+ }>,
7
+ TArray<TObject<{
8
+ selectedField: TKeyOf<TSourceSchema>;
9
+ direction: TUnion<[TLiteral<'asc'>, TLiteral<'desc'>]>;
10
+ }>>
11
+ ]>;
@@ -0,0 +1,15 @@
1
+ import type { TArray, TKeyOf, TNumber, TObject, TString, TUnion } from '@sinclair/typebox';
2
+ export type QSchema<TSourceSchema extends TObject> = TUnion<[
3
+ TObject<{
4
+ selectedFields: TUnion<[
5
+ TKeyOf<TSourceSchema>,
6
+ TArray<TKeyOf<TSourceSchema>>
7
+ ]>;
8
+ value: TUnion<[
9
+ TNumber,
10
+ TString
11
+ ]>;
12
+ }>,
13
+ TNumber,
14
+ TString
15
+ ]>;
@@ -0,0 +1,11 @@
1
+ import type { TObject } from '@sinclair/typebox';
2
+ export interface QueryOptionsBuilderOptions<TSourceSchemaName extends string, TSourceSchema extends TObject> {
3
+ /**
4
+ * The name of the schema to be used for referencing the query options model.
5
+ */
6
+ readonly sourceSchemaName: TSourceSchemaName;
7
+ /**
8
+ * The source schema that defines the structure of the query options model.
9
+ */
10
+ readonly sourceSchema: TSourceSchema;
11
+ }
@@ -0,0 +1,6 @@
1
+ import type { TArray, TKeyOf, TLiteral, TObject, TUnion } from '@sinclair/typebox';
2
+ export type SelectedFieldsSchema<TSourceSchema extends TObject> = TUnion<[
3
+ TKeyOf<TSourceSchema>,
4
+ TLiteral<'*'>,
5
+ TArray<TKeyOf<TSourceSchema>>
6
+ ]>;
@@ -0,0 +1,17 @@
1
+ import { type TSchema } from '@sinclair/typebox';
2
+ import type { AdaptiveWhereClauseSchema } from '../../../../modules/elysia/crudSchema/types/adaptiveWhereClauseSchema';
3
+ /**
4
+ * Creates an adaptive where clause schema with appropriate operators based on the field type.
5
+ *
6
+ * Generates different sets of query operators depending on the schema type:
7
+ * - All types: $eq, $neq, $isNull
8
+ * - String/Number/Date types: additional $in, $nin, $like, $nlike operators
9
+ * - Number/Date types: additional comparison operators ($lt, $lte, $gt, $gte, $between, $nbetween)
10
+ *
11
+ * @template TFieldSchema - The TypeBox schema type to create where clauses for
12
+ *
13
+ * @param schema - The base field schema to generate where clause operators for
14
+ *
15
+ * @returns An adaptive where clause schema with operators appropriate for the field type
16
+ */
17
+ export declare const createAdaptiveWhereClauseSchema: <const TFieldSchema extends TSchema>(schema: TFieldSchema) => AdaptiveWhereClauseSchema<TFieldSchema>;
@@ -0,0 +1,11 @@
1
+ import type { TNumber, TObject, TString } from '@sinclair/typebox/type';
2
+ /**
3
+ * Creates a schema for the response of a count operation.
4
+ * The response will contain a message and the count as content.
5
+ *
6
+ * @returns The schema for the count response.
7
+ */
8
+ export declare const createCountResponse200Schema: () => TObject<{
9
+ message: TString;
10
+ content: TNumber;
11
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { TArray, TObject, TPartial, TUnion } from '@sinclair/typebox';
2
+ import { createFiltersSchema } from './createFiltersSchema';
3
+ /**
4
+ * Creates a count schema for counting records with optional filtering.
5
+ *
6
+ * @template TSourceSchema - The TypeBox object schema to create count capabilities for
7
+ *
8
+ * @param schema - The base object schema to create count schema for.
9
+ *
10
+ * @returns A TypeBox partial object schema containing queryOptions with filters for counting operations
11
+ */
12
+ export declare const createCountSchema: <const TSourceSchema extends TObject>(schema: TSourceSchema) => TPartial<TObject<{
13
+ queryOptions: TPartial<TObject<{
14
+ filters: TUnion<[TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>, TArray<TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>>]>;
15
+ }>>;
16
+ }>>;
@@ -0,0 +1,18 @@
1
+ import type { TArray, TObject, TPartial, TUnion, TOptional } from '@sinclair/typebox';
2
+ import { createFiltersSchema } from './createFiltersSchema';
3
+ import { createSelectedFieldsSchema } from './createSelectedFieldsSchema';
4
+ /**
5
+ * Creates a delete schema for deleting records with optional selected fields and required filtering.
6
+ *
7
+ * @template TSourceSchema - The TypeBox object schema to create delete capabilities for
8
+ *
9
+ * @param schema - The base object schema to create delete schema for.
10
+ *
11
+ * @returns A TypeBox object schema containing queryOptions with selected fields and filters for delete operations
12
+ */
13
+ export declare const createDeleteSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TObject<{
14
+ queryOptions: TObject<{
15
+ selectedFields: TOptional<ReturnType<typeof createSelectedFieldsSchema>>;
16
+ filters: TUnion<[TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>, TArray<TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>>]>;
17
+ }>;
18
+ }>;
@@ -0,0 +1,17 @@
1
+ import type { TComposite, TObject } from '@sinclair/typebox/type';
2
+ import type { QSchema } from '../../../../modules/elysia/crudSchema/types/qSchema';
3
+ import { createPropertiesSchema } from './createPropertiesSchema';
4
+ /**
5
+ * Creates a filters schema that combines search queries and property filters.
6
+ * The resulting schema includes a $q property for query operations and properties
7
+ * from the source schema for field-specific filtering.
8
+ *
9
+ * @template TSourceSchema - The TypeBox object schema to create filters for
10
+ *
11
+ * @param schema - The base object schema to create filters for
12
+ *
13
+ * @returns A composite TypeBox schema containing query and property filter capabilities
14
+ */
15
+ export declare const createFiltersSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TComposite<[TObject<{
16
+ $q: QSchema<TSourceSchema>;
17
+ }>, ReturnType<typeof createPropertiesSchema<TSourceSchema>>]>;
@@ -0,0 +1,22 @@
1
+ import type { TArray, TNumber, TObject, TPartial, TUnion } from '@sinclair/typebox';
2
+ import { createFiltersSchema } from './createFiltersSchema';
3
+ import { createOrderSchema } from './createOrderSchema';
4
+ import { createSelectedFieldsSchema } from './createSelectedFieldsSchema';
5
+ /**
6
+ * Creates a find schema.
7
+ *
8
+ * @template TSourceSchema - The TypeBox object schema to create search capabilities for.
9
+ *
10
+ * @param schema - The base object schema to create search schemas for.
11
+ *
12
+ * @returns A TypeBox object schema for search with selected fields, order by, filters, limit, and offset
13
+ */
14
+ export declare const createFindSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TPartial<TObject<{
15
+ queryOptions: TPartial<TObject<{
16
+ selectedFields: ReturnType<typeof createSelectedFieldsSchema>;
17
+ orderBy: ReturnType<typeof createOrderSchema>;
18
+ filters: TUnion<[TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>, TArray<TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>>]>;
19
+ limit: TNumber;
20
+ offset: TNumber;
21
+ }>>;
22
+ }>>;
@@ -0,0 +1,4 @@
1
+ import type { TNumber, TObject, TString, TUnion } from '@sinclair/typebox/type';
2
+ export declare const createIdParamSchema: () => TObject<{
3
+ id: TUnion<[TString, TNumber]>;
4
+ }>;
@@ -0,0 +1,8 @@
1
+ import type { TArray, TObject, TOptional, TUnion } from '@sinclair/typebox/type';
2
+ import { createSelectedFieldsSchema } from './createSelectedFieldsSchema';
3
+ export declare const createInsertSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TObject<{
4
+ queryOptions: TOptional<TObject<{
5
+ selectedFields: ReturnType<typeof createSelectedFieldsSchema>;
6
+ }>>;
7
+ data: TUnion<[TSourceSchema, TArray<TSourceSchema>]>;
8
+ }>;
@@ -0,0 +1,12 @@
1
+ import type { TObject } from '@sinclair/typebox';
2
+ import type { OrderSchema } from '../../../../modules/elysia/crudSchema/types/orderSchema';
3
+ /**
4
+ * Creates order schema for query options.
5
+ *
6
+ * @template TSourceSchema - The TypeBox object schema to create order by for. Extends {@link TObject}
7
+ *
8
+ * @param schema - The base object schema to create order by for. {@link TSourceSchema}
9
+ *
10
+ * @returns A tuple schema with field name and direction
11
+ */
12
+ export declare const createOrderSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => OrderSchema<TSourceSchema>;
@@ -0,0 +1,12 @@
1
+ import type { Static, TObject, TUnion } from '@sinclair/typebox/type';
2
+ import { createAdaptiveWhereClauseSchema } from './createAdaptiveWhereClauseSchema';
3
+ /**
4
+ * Creates property schemas.
5
+ *
6
+ * @template TSourceSchema - The TypeBox object schema to create property schemas for
7
+ *
8
+ * @param schema - The base object schema to create property schemas for.
9
+ *
10
+ * @returns Record of property schemas with union types
11
+ */
12
+ export declare const createPropertiesSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TObject<{ [K in keyof Static<TSourceSchema>]: TUnion<[ReturnType<typeof createAdaptiveWhereClauseSchema<TSourceSchema["properties"][K]>>, TSourceSchema["properties"][K]]>; }>;
@@ -0,0 +1,12 @@
1
+ import type { TObject } from '@sinclair/typebox';
2
+ import type { QSchema } from '../../../../modules/elysia/crudSchema/types/qSchema';
3
+ /**
4
+ * Creates a search query schema
5
+ *
6
+ * @template TSourceSchema - The TypeBox object schema to create search queries for. Extends {@link TObject}
7
+ *
8
+ * @param schema - The base object schema to create search queries for. {@link TSourceSchema}
9
+ *
10
+ * @returns A union schema for search queries
11
+ */
12
+ export declare const createQSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => QSchema<TSourceSchema>;
@@ -0,0 +1,5 @@
1
+ import type { Static, TArray, TLiteral, TObject, TPartial, TString, TUndefined, TUnion } from '@sinclair/typebox/type';
2
+ export declare const createResponse200Schema: <TSourceResponseSchema extends TObject>(schema: TSourceResponseSchema) => TObject<{
3
+ message: TString;
4
+ content: TArray<TPartial<TObject<{ [K in keyof Static<TSourceResponseSchema>]: TUnion<[TUndefined, TLiteral<"">, TSourceResponseSchema["properties"][K]]>; }>>>;
5
+ }>;
@@ -0,0 +1,12 @@
1
+ import type { TObject } from '@sinclair/typebox';
2
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crudSchema/types/selectedFieldSchema';
3
+ /**
4
+ * Creates a schema for field selection in search results.
5
+ *
6
+ * @template TSourceSchema - The TypeBox object schema to create field selection for. Extends {@link TObject}
7
+ *
8
+ * @param schema - The base object schema to create field selection for. {@link TSourceSchema}
9
+ *
10
+ * @returns A TypeBox union schema for selected fields
11
+ */
12
+ export declare const createSelectedFieldsSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => SelectedFieldsSchema<TSourceSchema>;
@@ -0,0 +1,4 @@
1
+ import type { TObject, TPartial } from '@sinclair/typebox';
2
+ export declare const createUpdateOneSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TObject<{
3
+ data: TPartial<TSourceSchema>;
4
+ }>;
@@ -0,0 +1,10 @@
1
+ import type { TArray, TObject, TPartial, TUnion, TOptional } from '@sinclair/typebox';
2
+ import { createFiltersSchema } from './createFiltersSchema';
3
+ import { createSelectedFieldsSchema } from './createSelectedFieldsSchema';
4
+ export declare const createUpdateSchema: <TSourceSchema extends TObject>(schema: TSourceSchema) => TObject<{
5
+ queryOptions: TObject<{
6
+ selectedFields: TOptional<ReturnType<typeof createSelectedFieldsSchema>>;
7
+ filters: TUnion<[TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>, TArray<TPartial<ReturnType<typeof createFiltersSchema<TSourceSchema>>>>]>;
8
+ }>;
9
+ data: TPartial<TSourceSchema>;
10
+ }>;
@@ -0,0 +1,15 @@
1
+ export { createAdaptiveWhereClauseSchema } from './createAdaptiveWhereClauseSchema';
2
+ export { createCountResponse200Schema } from './createCountResponse200Schema';
3
+ export { createCountSchema } from './createCountSchema';
4
+ export { createDeleteSchema } from './createDeleteSchema';
5
+ export { createFiltersSchema } from './createFiltersSchema';
6
+ export { createFindSchema } from './createFindSchema';
7
+ export { createIdParamSchema } from './createIdParamSchema';
8
+ export { createOrderSchema } from './createOrderSchema';
9
+ export { createPropertiesSchema } from './createPropertiesSchema';
10
+ export { createQSchema } from './createQSchema';
11
+ export { createResponse200Schema } from './createResponse200Schema';
12
+ export { createSelectedFieldsSchema } from './createSelectedFieldsSchema';
13
+ export { createUpdateOneSchema } from './createUpdateOneSchema';
14
+ export { createUpdateSchema } from './createUpdateSchema';
15
+ export { isDateFromElysiaTypeBox } from './isDateFromElysiaTypeBox';
@@ -0,0 +1,37 @@
1
+ // @bun
2
+ import {
3
+ createAdaptiveWhereClauseSchema,
4
+ createCountResponse200Schema,
5
+ createCountSchema,
6
+ createDeleteSchema,
7
+ createFiltersSchema,
8
+ createFindSchema,
9
+ createIdParamSchema,
10
+ createOrderSchema,
11
+ createPropertiesSchema,
12
+ createQSchema,
13
+ createResponse200Schema,
14
+ createSelectedFieldsSchema,
15
+ createUpdateOneSchema,
16
+ createUpdateSchema,
17
+ isDateFromElysiaTypeBox
18
+ } from "../../../../chunk-f5z7x01b.js";
19
+ import"../../../../chunk-cq973ydc.js";
20
+ import"../../../../chunk-vknq69e0.js";
21
+ export {
22
+ isDateFromElysiaTypeBox,
23
+ createUpdateSchema,
24
+ createUpdateOneSchema,
25
+ createSelectedFieldsSchema,
26
+ createResponse200Schema,
27
+ createQSchema,
28
+ createPropertiesSchema,
29
+ createOrderSchema,
30
+ createIdParamSchema,
31
+ createFindSchema,
32
+ createFiltersSchema,
33
+ createDeleteSchema,
34
+ createCountSchema,
35
+ createCountResponse200Schema,
36
+ createAdaptiveWhereClauseSchema
37
+ };
@@ -0,0 +1,2 @@
1
+ import { type TSchema } from '@sinclair/typebox/type';
2
+ export declare const isDateFromElysiaTypeBox: <TFieldSchema extends TSchema>(schema: TFieldSchema) => boolean;
@@ -0,0 +1,17 @@
1
+ import type { TObject, TString } from '@sinclair/typebox';
2
+ import { Elysia, type DefinitionBase, type SingletonBase } from 'elysia';
3
+ import { MSSQL } from '../../../modules/database/mssql';
4
+ import type { DynamicDbOptions } from './types/dynamicDbOptions';
5
+ export declare const dbResolver: <const TDatabase extends DynamicDbOptions | string>(database: TDatabase) => Elysia<"dbResolverPlugin", {
6
+ decorator: SingletonBase["decorator"];
7
+ store: SingletonBase["store"];
8
+ derive: SingletonBase["derive"];
9
+ resolve: Record<TDatabase extends string ? "staticDB" : "dynamicDB", MSSQL>;
10
+ }, TDatabase extends string ? DefinitionBase : {
11
+ typebox: {
12
+ ResolveDbHeader: TObject<{
13
+ "database-using": TString;
14
+ }>;
15
+ };
16
+ error: {};
17
+ }>;
@@ -0,0 +1,3 @@
1
+ export declare const DB_RESOLVER_ERROR_KEYS: {
2
+ readonly DB_RESOLVER_HEADER_KEY_NOT_FOUND: "elysia.dbResolver.error.key_not_found";
3
+ };
@@ -0,0 +1 @@
1
+ export { dbResolver } from './dbResolver';
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ dbResolver
4
+ } from "../../../chunk-v8v7982b.js";
5
+ import"../../../chunk-370444pc.js";
6
+ import"../../../chunk-pc66jgqv.js";
7
+ import"../../../chunk-1a3wj3m1.js";
8
+ import"../../../chunk-5qtpggzv.js";
9
+ import"../../../chunk-yvyahr2h.js";
10
+ import"../../../chunk-84mqvfsk.js";
11
+ import"../../../chunk-vknq69e0.js";
12
+ export {
13
+ dbResolver
14
+ };
@@ -0,0 +1,7 @@
1
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssqlDatabaseOption';
2
+ export interface DynamicDbOptions {
3
+ /**
4
+ * Options for the database connection
5
+ */
6
+ readonly config: Omit<MSSQLDatabaseOptions, 'databaseName'>;
7
+ }
@@ -0,0 +1 @@
1
+ export type { DynamicDbOptions } from './dynamicDbOptions';
@@ -0,0 +1,34 @@
1
+ import { Elysia } from 'elysia';
2
+ import { BaseError } from '../../../errors/baseError';
3
+ import { HttpError } from '../../../errors/httpError';
4
+ /**
5
+ * The `errorPlugin` provides an error handling system for Elysia applications.
6
+ */
7
+ export declare const error: Elysia<"", {
8
+ decorator: {};
9
+ store: {};
10
+ derive: {};
11
+ resolve: {};
12
+ }, {
13
+ typebox: {};
14
+ error: {
15
+ readonly BaseError: BaseError<any>;
16
+ readonly HttpError: HttpError<any>;
17
+ };
18
+ }, {
19
+ schema: import("elysia").MergeSchema<import("elysia").MergeSchema<{}, {}, "">, {}, "">;
20
+ standaloneSchema: {};
21
+ macro: {};
22
+ macroFn: {};
23
+ parser: {};
24
+ }, {}, {
25
+ derive: {};
26
+ resolve: {};
27
+ schema: {};
28
+ standaloneSchema: {};
29
+ }, {
30
+ derive: {};
31
+ resolve: {};
32
+ schema: {};
33
+ standaloneSchema: {};
34
+ }>;
@@ -0,0 +1 @@
1
+ export { error } from './error';