alepha 0.13.6 → 0.13.8

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 (487) hide show
  1. package/README.md +5 -2
  2. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  3. package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
  4. package/assets/swagger-ui/swagger-ui.css +1 -1
  5. package/dist/api/audits/index.browser.js +116 -0
  6. package/dist/api/audits/index.browser.js.map +1 -0
  7. package/dist/api/audits/index.d.ts +1194 -0
  8. package/dist/api/audits/index.js +674 -0
  9. package/dist/api/audits/index.js.map +1 -0
  10. package/dist/{api-files → api/files}/index.browser.js +5 -5
  11. package/dist/api/files/index.browser.js.map +1 -0
  12. package/dist/{api-files → api/files}/index.d.ts +16 -9
  13. package/dist/{api-files → api/files}/index.js +10 -10
  14. package/dist/api/files/index.js.map +1 -0
  15. package/dist/{api-jobs → api/jobs}/index.browser.js +5 -5
  16. package/dist/api/jobs/index.browser.js.map +1 -0
  17. package/dist/{api-jobs → api/jobs}/index.d.ts +35 -35
  18. package/dist/{api-jobs → api/jobs}/index.js +9 -9
  19. package/dist/api/jobs/index.js.map +1 -0
  20. package/dist/{api-notifications → api/notifications}/index.browser.js +11 -11
  21. package/dist/api/notifications/index.browser.js.map +1 -0
  22. package/dist/api/notifications/index.d.ts +327 -0
  23. package/dist/{api-notifications → api/notifications}/index.js +11 -11
  24. package/dist/api/notifications/index.js.map +1 -0
  25. package/dist/api/parameters/index.browser.js +60 -0
  26. package/dist/api/parameters/index.browser.js.map +1 -0
  27. package/dist/api/parameters/index.d.ts +761 -0
  28. package/dist/api/parameters/index.js +877 -0
  29. package/dist/api/parameters/index.js.map +1 -0
  30. package/dist/{api-users → api/users}/index.browser.js +6 -6
  31. package/dist/api/users/index.browser.js.map +1 -0
  32. package/dist/{api-users → api/users}/index.d.ts +259 -247
  33. package/dist/{api-users → api/users}/index.js +125 -112
  34. package/dist/api/users/index.js.map +1 -0
  35. package/dist/{api-verifications → api/verifications}/index.browser.js +5 -5
  36. package/dist/api/verifications/index.browser.js.map +1 -0
  37. package/dist/api/verifications/index.d.ts +248 -0
  38. package/dist/{api-verifications → api/verifications}/index.js +13 -12
  39. package/dist/api/verifications/index.js.map +1 -0
  40. package/dist/bin/index.js +1 -0
  41. package/dist/bin/index.js.map +1 -1
  42. package/dist/cache/{index.d.ts → core/index.d.ts} +4 -4
  43. package/dist/cache/{index.js → core/index.js} +5 -5
  44. package/dist/cache/core/index.js.map +1 -0
  45. package/dist/{cache-redis → cache/redis}/index.d.ts +2 -2
  46. package/dist/{cache-redis → cache/redis}/index.js +2 -2
  47. package/dist/cache/redis/index.js.map +1 -0
  48. package/dist/cli/index.d.ts +71 -9
  49. package/dist/cli/index.js +280 -79
  50. package/dist/cli/index.js.map +1 -1
  51. package/dist/command/index.d.ts +63 -2
  52. package/dist/command/index.js +30 -3
  53. package/dist/command/index.js.map +1 -1
  54. package/dist/core/index.browser.js +241 -61
  55. package/dist/core/index.browser.js.map +1 -1
  56. package/dist/core/index.d.ts +170 -90
  57. package/dist/core/index.js +264 -67
  58. package/dist/core/index.js.map +1 -1
  59. package/dist/core/index.native.js +248 -65
  60. package/dist/core/index.native.js.map +1 -1
  61. package/dist/email/index.js +15 -10554
  62. package/dist/email/index.js.map +1 -1
  63. package/dist/lock/{index.d.ts → core/index.d.ts} +5 -5
  64. package/dist/lock/{index.js → core/index.js} +5 -5
  65. package/dist/lock/core/index.js.map +1 -0
  66. package/dist/{lock-redis → lock/redis}/index.d.ts +2 -2
  67. package/dist/{lock-redis → lock/redis}/index.js +2 -2
  68. package/dist/lock/redis/index.js.map +1 -0
  69. package/dist/logger/index.d.ts +4 -4
  70. package/dist/logger/index.js +77 -72
  71. package/dist/logger/index.js.map +1 -1
  72. package/dist/orm/index.d.ts +5 -1
  73. package/dist/orm/index.js +24 -7
  74. package/dist/orm/index.js.map +1 -1
  75. package/dist/queue/core/index.d.ts +548 -0
  76. package/dist/queue/core/index.js +391 -0
  77. package/dist/queue/core/index.js.map +1 -0
  78. package/dist/queue/redis/index.d.ts +28 -0
  79. package/dist/queue/redis/index.js +43 -0
  80. package/dist/queue/redis/index.js.map +1 -0
  81. package/dist/scheduler/index.d.ts +7 -7
  82. package/dist/scheduler/index.js +1 -393
  83. package/dist/scheduler/index.js.map +1 -1
  84. package/dist/security/index.d.ts +1 -1
  85. package/dist/security/index.js +2 -1413
  86. package/dist/security/index.js.map +1 -1
  87. package/dist/{server-auth → server/auth}/index.browser.js +6 -6
  88. package/dist/server/auth/index.browser.js.map +1 -0
  89. package/dist/{server-auth → server/auth}/index.d.ts +175 -164
  90. package/dist/server/auth/index.js +742 -0
  91. package/dist/server/auth/index.js.map +1 -0
  92. package/dist/{server-cache → server/cache}/index.d.ts +2 -2
  93. package/dist/{server-cache → server/cache}/index.js +2 -2
  94. package/dist/server/cache/index.js.map +1 -0
  95. package/dist/{server-compress → server/compress}/index.d.ts +2 -2
  96. package/dist/{server-compress → server/compress}/index.js +2 -2
  97. package/dist/server/compress/index.js.map +1 -0
  98. package/dist/{server-cookies → server/cookies}/index.browser.js +3 -3
  99. package/dist/server/cookies/index.browser.js.map +1 -0
  100. package/dist/{server-cookies → server/cookies}/index.d.ts +4 -4
  101. package/dist/{server-cookies → server/cookies}/index.js +9 -5
  102. package/dist/server/cookies/index.js.map +1 -0
  103. package/dist/server/{index.browser.js → core/index.browser.js} +14 -14
  104. package/dist/server/core/index.browser.js.map +1 -0
  105. package/dist/server/{index.d.ts → core/index.d.ts} +46 -37
  106. package/dist/server/{index.js → core/index.js} +47 -33
  107. package/dist/server/core/index.js.map +1 -0
  108. package/dist/{server-cors → server/cors}/index.d.ts +3 -3
  109. package/dist/{server-cors → server/cors}/index.js +3 -3
  110. package/dist/server/cors/index.js.map +1 -0
  111. package/dist/{server-health → server/health}/index.d.ts +3 -3
  112. package/dist/{server-health → server/health}/index.js +3 -3
  113. package/dist/server/health/index.js.map +1 -0
  114. package/dist/{server-helmet → server/helmet}/index.d.ts +2 -2
  115. package/dist/{server-helmet → server/helmet}/index.js +2 -2
  116. package/dist/server/helmet/index.js.map +1 -0
  117. package/dist/{server-links → server/links}/index.browser.js +5 -5
  118. package/dist/server/links/index.browser.js.map +1 -0
  119. package/dist/{server-links → server/links}/index.d.ts +40 -40
  120. package/dist/{server-links → server/links}/index.js +7 -7
  121. package/dist/server/links/index.js.map +1 -0
  122. package/dist/{server-metrics → server/metrics}/index.d.ts +2 -2
  123. package/dist/server/metrics/index.js +74 -0
  124. package/dist/server/metrics/index.js.map +1 -0
  125. package/dist/{server-multipart → server/multipart}/index.d.ts +2 -2
  126. package/dist/{server-multipart → server/multipart}/index.js +2 -2
  127. package/dist/server/multipart/index.js.map +1 -0
  128. package/dist/{server-proxy → server/proxy}/index.d.ts +3 -3
  129. package/dist/{server-proxy → server/proxy}/index.js +3 -3
  130. package/dist/server/proxy/index.js.map +1 -0
  131. package/dist/{server-rate-limit → server/rate-limit}/index.d.ts +4 -4
  132. package/dist/{server-rate-limit → server/rate-limit}/index.js +4 -4
  133. package/dist/server/rate-limit/index.js.map +1 -0
  134. package/dist/{server-security → server/security}/index.browser.js +1 -1
  135. package/dist/server/security/index.browser.js.map +1 -0
  136. package/dist/{server-security → server/security}/index.d.ts +4 -4
  137. package/dist/{server-security → server/security}/index.js +4 -4
  138. package/dist/server/security/index.js.map +1 -0
  139. package/dist/{server-static → server/static}/index.d.ts +3 -3
  140. package/dist/{server-static → server/static}/index.js +3 -3
  141. package/dist/server/static/index.js.map +1 -0
  142. package/dist/{server-swagger → server/swagger}/index.d.ts +3 -3
  143. package/dist/{server-swagger → server/swagger}/index.js +4 -4
  144. package/dist/server/swagger/index.js.map +1 -0
  145. package/dist/thread/index.js +2 -2
  146. package/dist/thread/index.js.map +1 -1
  147. package/dist/topic/{index.d.ts → core/index.d.ts} +6 -6
  148. package/dist/topic/{index.js → core/index.js} +6 -6
  149. package/dist/topic/core/index.js.map +1 -0
  150. package/dist/{topic-redis → topic/redis}/index.d.ts +2 -2
  151. package/dist/{topic-redis → topic/redis}/index.js +2 -2
  152. package/dist/topic/redis/index.js.map +1 -0
  153. package/dist/vite/index.d.ts +13 -2
  154. package/dist/vite/index.js +114 -50
  155. package/dist/vite/index.js.map +1 -1
  156. package/dist/websocket/index.browser.js +3 -3
  157. package/dist/websocket/index.browser.js.map +1 -1
  158. package/dist/websocket/index.js +4 -4
  159. package/dist/websocket/index.js.map +1 -1
  160. package/package.json +160 -156
  161. package/src/api/audits/controllers/AuditController.ts +186 -0
  162. package/src/api/audits/entities/audits.ts +132 -0
  163. package/src/api/audits/index.browser.ts +18 -0
  164. package/src/api/audits/index.ts +58 -0
  165. package/src/api/audits/primitives/$audit.ts +159 -0
  166. package/src/api/audits/schemas/auditQuerySchema.ts +23 -0
  167. package/src/api/audits/schemas/auditResourceSchema.ts +9 -0
  168. package/src/api/audits/schemas/createAuditSchema.ts +27 -0
  169. package/src/api/audits/services/AuditService.ts +412 -0
  170. package/src/{api-files → api/files}/index.ts +1 -0
  171. package/src/api/parameters/controllers/ConfigController.ts +324 -0
  172. package/src/api/parameters/entities/parameters.ts +113 -0
  173. package/src/api/parameters/index.ts +60 -0
  174. package/src/api/parameters/primitives/$config.ts +351 -0
  175. package/src/api/parameters/schedulers/ConfigActivationScheduler.ts +30 -0
  176. package/src/api/parameters/services/ConfigStore.ts +491 -0
  177. package/src/{api-users → api/users}/atoms/realmAuthSettingsAtom.ts +19 -0
  178. package/src/{api-users → api/users}/controllers/UserRealmController.ts +0 -2
  179. package/src/{api-users → api/users}/index.ts +2 -0
  180. package/src/{api-users → api/users}/primitives/$userRealm.ts +18 -3
  181. package/src/{api-users → api/users}/providers/UserRealmProvider.ts +12 -10
  182. package/src/{api-users → api/users}/services/RegistrationService.ts +2 -1
  183. package/src/{api-users → api/users}/services/SessionService.ts +4 -0
  184. package/src/{api-users → api/users}/services/UserService.ts +3 -0
  185. package/src/{api-verifications → api/verifications}/index.ts +9 -1
  186. package/src/bin/index.ts +1 -0
  187. package/src/cli/apps/AlephaPackageBuilderCli.ts +73 -48
  188. package/src/cli/assets/appRouterTs.ts +1 -1
  189. package/src/cli/assets/biomeJson.ts +2 -2
  190. package/src/cli/assets/dummySpecTs.ts +7 -0
  191. package/src/cli/assets/editorconfig.ts +13 -0
  192. package/src/cli/assets/indexHtml.ts +1 -1
  193. package/src/cli/assets/mainBrowserTs.ts +1 -1
  194. package/src/cli/assets/mainTs.ts +14 -0
  195. package/src/cli/assets/viteConfigTs.ts +1 -1
  196. package/src/cli/commands/BiomeCommands.ts +2 -0
  197. package/src/cli/commands/CoreCommands.ts +38 -15
  198. package/src/cli/commands/VerifyCommands.ts +6 -2
  199. package/src/cli/commands/ViteCommands.ts +28 -18
  200. package/src/cli/services/AlephaCliUtils.ts +243 -37
  201. package/src/command/helpers/Asker.ts +0 -1
  202. package/src/command/primitives/$command.ts +67 -0
  203. package/src/command/providers/CliProvider.ts +39 -8
  204. package/src/core/Alepha.ts +40 -30
  205. package/src/core/helpers/jsonSchemaToTypeBox.ts +307 -0
  206. package/src/core/index.shared.ts +1 -0
  207. package/src/core/index.ts +30 -3
  208. package/src/core/providers/EventManager.ts +1 -1
  209. package/src/core/providers/SchemaValidator.ts +1 -1
  210. package/src/core/providers/StateManager.ts +23 -12
  211. package/src/core/providers/TypeProvider.ts +26 -34
  212. package/src/logger/index.ts +8 -6
  213. package/src/logger/primitives/$logger.ts +1 -1
  214. package/src/logger/providers/{SimpleFormatterProvider.ts → PrettyFormatterProvider.ts} +10 -1
  215. package/src/orm/index.ts +6 -0
  216. package/src/orm/services/PgRelationManager.ts +2 -2
  217. package/src/orm/services/PostgresModelBuilder.ts +11 -7
  218. package/src/orm/services/Repository.ts +16 -7
  219. package/src/orm/services/SqliteModelBuilder.ts +10 -0
  220. package/src/queue/{index.ts → core/index.ts} +2 -3
  221. package/src/queue/{primitives → core/primitives}/$queue.ts +17 -162
  222. package/src/queue/core/providers/MemoryQueueProvider.ts +19 -0
  223. package/src/queue/core/providers/QueueProvider.ts +23 -0
  224. package/src/queue/core/providers/WorkerProvider.ts +244 -0
  225. package/src/queue/redis/providers/RedisQueueProvider.ts +31 -0
  226. package/src/{server-auth → server/auth}/primitives/$auth.ts +7 -0
  227. package/src/{server-auth → server/auth}/providers/ServerAuthProvider.ts +51 -8
  228. package/src/{server-cookies → server/cookies}/index.ts +2 -1
  229. package/src/server/{index.ts → core/index.ts} +7 -0
  230. package/src/server/{primitives → core/primitives}/$action.ts +10 -1
  231. package/src/server/{providers → core/providers}/ServerBodyParserProvider.ts +11 -5
  232. package/src/server/{providers → core/providers}/ServerRouterProvider.ts +13 -7
  233. package/src/{server-rate-limit → server/rate-limit}/index.ts +1 -1
  234. package/src/{server-swagger → server/swagger}/providers/ServerSwaggerProvider.ts +1 -0
  235. package/src/thread/primitives/$thread.ts +2 -2
  236. package/src/vite/index.ts +0 -2
  237. package/src/vite/tasks/buildServer.ts +3 -4
  238. package/src/vite/tasks/copyAssets.ts +32 -8
  239. package/src/vite/tasks/generateCloudflare.ts +35 -19
  240. package/src/vite/tasks/generateDocker.ts +18 -4
  241. package/src/vite/tasks/generateSitemap.ts +5 -7
  242. package/src/vite/tasks/generateVercel.ts +76 -41
  243. package/src/vite/tasks/runAlepha.ts +16 -1
  244. package/src/websocket/providers/NodeWebSocketServerProvider.ts +3 -11
  245. package/src/websocket/services/WebSocketClient.ts +3 -3
  246. package/dist/api-files/index.browser.js.map +0 -1
  247. package/dist/api-files/index.js.map +0 -1
  248. package/dist/api-jobs/index.browser.js.map +0 -1
  249. package/dist/api-jobs/index.js.map +0 -1
  250. package/dist/api-notifications/index.browser.js.map +0 -1
  251. package/dist/api-notifications/index.d.ts +0 -327
  252. package/dist/api-notifications/index.js.map +0 -1
  253. package/dist/api-parameters/index.browser.js +0 -29
  254. package/dist/api-parameters/index.browser.js.map +0 -1
  255. package/dist/api-parameters/index.d.ts +0 -83
  256. package/dist/api-parameters/index.js +0 -63
  257. package/dist/api-parameters/index.js.map +0 -1
  258. package/dist/api-users/index.browser.js.map +0 -1
  259. package/dist/api-users/index.js.map +0 -1
  260. package/dist/api-verifications/index.browser.js.map +0 -1
  261. package/dist/api-verifications/index.d.ts +0 -229
  262. package/dist/api-verifications/index.js.map +0 -1
  263. package/dist/cache/index.js.map +0 -1
  264. package/dist/cache-redis/index.js.map +0 -1
  265. package/dist/cli/dist-BlfFtOk2.js +0 -2770
  266. package/dist/cli/dist-BlfFtOk2.js.map +0 -1
  267. package/dist/lock/index.js.map +0 -1
  268. package/dist/lock-redis/index.js.map +0 -1
  269. package/dist/queue/index.d.ts +0 -1265
  270. package/dist/queue/index.js +0 -1037
  271. package/dist/queue/index.js.map +0 -1
  272. package/dist/queue-redis/index.d.ts +0 -82
  273. package/dist/queue-redis/index.js +0 -872
  274. package/dist/queue-redis/index.js.map +0 -1
  275. package/dist/server/index.browser.js.map +0 -1
  276. package/dist/server/index.js.map +0 -1
  277. package/dist/server-auth/index.browser.js.map +0 -1
  278. package/dist/server-auth/index.js +0 -1943
  279. package/dist/server-auth/index.js.map +0 -1
  280. package/dist/server-cache/index.js.map +0 -1
  281. package/dist/server-compress/index.js.map +0 -1
  282. package/dist/server-cookies/index.browser.js.map +0 -1
  283. package/dist/server-cookies/index.js.map +0 -1
  284. package/dist/server-cors/index.js.map +0 -1
  285. package/dist/server-health/index.js.map +0 -1
  286. package/dist/server-helmet/index.js.map +0 -1
  287. package/dist/server-links/index.browser.js.map +0 -1
  288. package/dist/server-links/index.js.map +0 -1
  289. package/dist/server-metrics/index.js +0 -4532
  290. package/dist/server-metrics/index.js.map +0 -1
  291. package/dist/server-multipart/index.js.map +0 -1
  292. package/dist/server-proxy/index.js.map +0 -1
  293. package/dist/server-rate-limit/index.js.map +0 -1
  294. package/dist/server-security/index.browser.js.map +0 -1
  295. package/dist/server-security/index.js.map +0 -1
  296. package/dist/server-static/index.js.map +0 -1
  297. package/dist/server-swagger/index.js.map +0 -1
  298. package/dist/topic/index.js.map +0 -1
  299. package/dist/topic-redis/index.js.map +0 -1
  300. package/src/api-parameters/controllers/ParameterController.ts +0 -45
  301. package/src/api-parameters/entities/parameters.ts +0 -30
  302. package/src/api-parameters/index.ts +0 -21
  303. package/src/api-parameters/primitives/$config.ts +0 -79
  304. package/src/api-parameters/services/ParameterStore.ts +0 -23
  305. package/src/queue/interfaces/QueueJob.ts +0 -459
  306. package/src/queue/providers/MemoryQueueProvider.ts +0 -850
  307. package/src/queue/providers/QueueProvider.ts +0 -319
  308. package/src/queue/providers/WorkerProvider.ts +0 -344
  309. package/src/queue-redis/providers/RedisQueueProvider.ts +0 -1209
  310. /package/src/{api-files → api/files}/controllers/FileController.ts +0 -0
  311. /package/src/{api-files → api/files}/controllers/StorageStatsController.ts +0 -0
  312. /package/src/{api-files → api/files}/entities/files.ts +0 -0
  313. /package/src/{api-files → api/files}/index.browser.ts +0 -0
  314. /package/src/{api-files → api/files}/jobs/FileJobs.ts +0 -0
  315. /package/src/{api-files → api/files}/schemas/fileQuerySchema.ts +0 -0
  316. /package/src/{api-files → api/files}/schemas/fileResourceSchema.ts +0 -0
  317. /package/src/{api-files → api/files}/schemas/storageStatsSchema.ts +0 -0
  318. /package/src/{api-files → api/files}/services/FileService.ts +0 -0
  319. /package/src/{api-jobs → api/jobs}/controllers/JobController.ts +0 -0
  320. /package/src/{api-jobs → api/jobs}/entities/jobExecutions.ts +0 -0
  321. /package/src/{api-jobs → api/jobs}/index.browser.ts +0 -0
  322. /package/src/{api-jobs → api/jobs}/index.ts +0 -0
  323. /package/src/{api-jobs → api/jobs}/primitives/$job.ts +0 -0
  324. /package/src/{api-jobs → api/jobs}/providers/JobProvider.ts +0 -0
  325. /package/src/{api-jobs → api/jobs}/schemas/jobExecutionQuerySchema.ts +0 -0
  326. /package/src/{api-jobs → api/jobs}/schemas/jobExecutionResourceSchema.ts +0 -0
  327. /package/src/{api-jobs → api/jobs}/schemas/triggerJobSchema.ts +0 -0
  328. /package/src/{api-jobs → api/jobs}/services/JobService.ts +0 -0
  329. /package/src/{api-notifications → api/notifications}/controllers/NotificationController.ts +0 -0
  330. /package/src/{api-notifications → api/notifications}/entities/notifications.ts +0 -0
  331. /package/src/{api-notifications → api/notifications}/index.browser.ts +0 -0
  332. /package/src/{api-notifications → api/notifications}/index.ts +0 -0
  333. /package/src/{api-notifications → api/notifications}/jobs/NotificationJobs.ts +0 -0
  334. /package/src/{api-notifications → api/notifications}/primitives/$notification.ts +0 -0
  335. /package/src/{api-notifications → api/notifications}/queues/NotificationQueues.ts +0 -0
  336. /package/src/{api-notifications → api/notifications}/schemas/notificationContactPreferencesSchema.ts +0 -0
  337. /package/src/{api-notifications → api/notifications}/schemas/notificationContactSchema.ts +0 -0
  338. /package/src/{api-notifications → api/notifications}/schemas/notificationCreateSchema.ts +0 -0
  339. /package/src/{api-notifications → api/notifications}/schemas/notificationQuerySchema.ts +0 -0
  340. /package/src/{api-notifications → api/notifications}/services/NotificationSenderService.ts +0 -0
  341. /package/src/{api-notifications → api/notifications}/services/NotificationService.ts +0 -0
  342. /package/src/{api-parameters → api/parameters}/index.browser.ts +0 -0
  343. /package/src/{api-users → api/users}/controllers/IdentityController.ts +0 -0
  344. /package/src/{api-users → api/users}/controllers/SessionController.ts +0 -0
  345. /package/src/{api-users → api/users}/controllers/UserController.ts +0 -0
  346. /package/src/{api-users → api/users}/entities/identities.ts +0 -0
  347. /package/src/{api-users → api/users}/entities/sessions.ts +0 -0
  348. /package/src/{api-users → api/users}/entities/users.ts +0 -0
  349. /package/src/{api-users → api/users}/index.browser.ts +0 -0
  350. /package/src/{api-users → api/users}/notifications/UserNotifications.ts +0 -0
  351. /package/src/{api-users → api/users}/schemas/completePasswordResetRequestSchema.ts +0 -0
  352. /package/src/{api-users → api/users}/schemas/completeRegistrationRequestSchema.ts +0 -0
  353. /package/src/{api-users → api/users}/schemas/createUserSchema.ts +0 -0
  354. /package/src/{api-users → api/users}/schemas/identityQuerySchema.ts +0 -0
  355. /package/src/{api-users → api/users}/schemas/identityResourceSchema.ts +0 -0
  356. /package/src/{api-users → api/users}/schemas/loginSchema.ts +0 -0
  357. /package/src/{api-users → api/users}/schemas/passwordResetIntentResponseSchema.ts +0 -0
  358. /package/src/{api-users → api/users}/schemas/registerQuerySchema.ts +0 -0
  359. /package/src/{api-users → api/users}/schemas/registerRequestSchema.ts +0 -0
  360. /package/src/{api-users → api/users}/schemas/registerResponseSchema.ts +0 -0
  361. /package/src/{api-users → api/users}/schemas/registerSchema.ts +0 -0
  362. /package/src/{api-users → api/users}/schemas/registrationIntentResponseSchema.ts +0 -0
  363. /package/src/{api-users → api/users}/schemas/resetPasswordSchema.ts +0 -0
  364. /package/src/{api-users → api/users}/schemas/sessionQuerySchema.ts +0 -0
  365. /package/src/{api-users → api/users}/schemas/sessionResourceSchema.ts +0 -0
  366. /package/src/{api-users → api/users}/schemas/updateUserSchema.ts +0 -0
  367. /package/src/{api-users → api/users}/schemas/userQuerySchema.ts +0 -0
  368. /package/src/{api-users → api/users}/schemas/userRealmConfigSchema.ts +0 -0
  369. /package/src/{api-users → api/users}/schemas/userResourceSchema.ts +0 -0
  370. /package/src/{api-users → api/users}/services/CredentialService.ts +0 -0
  371. /package/src/{api-users → api/users}/services/IdentityService.ts +0 -0
  372. /package/src/{api-users → api/users}/services/SessionCrudService.ts +0 -0
  373. /package/src/{api-verifications → api/verifications}/controllers/VerificationController.ts +0 -0
  374. /package/src/{api-verifications → api/verifications}/entities/verifications.ts +0 -0
  375. /package/src/{api-verifications → api/verifications}/index.browser.ts +0 -0
  376. /package/src/{api-verifications → api/verifications}/jobs/VerificationJobs.ts +0 -0
  377. /package/src/{api-verifications → api/verifications}/parameters/VerificationParameters.ts +0 -0
  378. /package/src/{api-verifications → api/verifications}/schemas/requestVerificationCodeResponseSchema.ts +0 -0
  379. /package/src/{api-verifications → api/verifications}/schemas/validateVerificationCodeResponseSchema.ts +0 -0
  380. /package/src/{api-verifications → api/verifications}/schemas/verificationSettingsSchema.ts +0 -0
  381. /package/src/{api-verifications → api/verifications}/schemas/verificationTypeEnumSchema.ts +0 -0
  382. /package/src/{api-verifications → api/verifications}/services/VerificationService.ts +0 -0
  383. /package/src/cache/{errors → core/errors}/CacheError.ts +0 -0
  384. /package/src/cache/{index.ts → core/index.ts} +0 -0
  385. /package/src/cache/{primitives → core/primitives}/$cache.ts +0 -0
  386. /package/src/cache/{providers → core/providers}/CacheProvider.ts +0 -0
  387. /package/src/cache/{providers → core/providers}/MemoryCacheProvider.ts +0 -0
  388. /package/src/{cache-redis → cache/redis}/index.ts +0 -0
  389. /package/src/{cache-redis → cache/redis}/providers/RedisCacheProvider.ts +0 -0
  390. /package/src/lock/{index.ts → core/index.ts} +0 -0
  391. /package/src/lock/{primitives → core/primitives}/$lock.ts +0 -0
  392. /package/src/lock/{providers → core/providers}/LockProvider.ts +0 -0
  393. /package/src/lock/{providers → core/providers}/LockTopicProvider.ts +0 -0
  394. /package/src/lock/{providers → core/providers}/MemoryLockProvider.ts +0 -0
  395. /package/src/{lock-redis → lock/redis}/index.ts +0 -0
  396. /package/src/{lock-redis → lock/redis}/providers/RedisLockProvider.ts +0 -0
  397. /package/src/queue/{primitives → core/primitives}/$consumer.ts +0 -0
  398. /package/src/{queue-redis → queue/redis}/index.ts +0 -0
  399. /package/src/{server-auth → server/auth}/constants/routes.ts +0 -0
  400. /package/src/{server-auth → server/auth}/index.browser.ts +0 -0
  401. /package/src/{server-auth → server/auth}/index.shared.ts +0 -0
  402. /package/src/{server-auth → server/auth}/index.ts +0 -0
  403. /package/src/{server-auth → server/auth}/primitives/$authApple.ts +0 -0
  404. /package/src/{server-auth → server/auth}/primitives/$authCredentials.ts +0 -0
  405. /package/src/{server-auth → server/auth}/primitives/$authGithub.ts +0 -0
  406. /package/src/{server-auth → server/auth}/primitives/$authGoogle.ts +0 -0
  407. /package/src/{server-auth → server/auth}/schemas/authenticationProviderSchema.ts +0 -0
  408. /package/src/{server-auth → server/auth}/schemas/tokenResponseSchema.ts +0 -0
  409. /package/src/{server-auth → server/auth}/schemas/tokensSchema.ts +0 -0
  410. /package/src/{server-auth → server/auth}/schemas/userinfoResponseSchema.ts +0 -0
  411. /package/src/{server-cache → server/cache}/index.ts +0 -0
  412. /package/src/{server-cache → server/cache}/providers/ServerCacheProvider.ts +0 -0
  413. /package/src/{server-compress → server/compress}/index.ts +0 -0
  414. /package/src/{server-compress → server/compress}/providers/ServerCompressProvider.ts +0 -0
  415. /package/src/{server-cookies → server/cookies}/index.browser.ts +0 -0
  416. /package/src/{server-cookies → server/cookies}/primitives/$cookie.browser.ts +0 -0
  417. /package/src/{server-cookies → server/cookies}/primitives/$cookie.ts +0 -0
  418. /package/src/{server-cookies → server/cookies}/providers/ServerCookiesProvider.ts +0 -0
  419. /package/src/{server-cookies → server/cookies}/services/CookieParser.ts +0 -0
  420. /package/src/server/{constants → core/constants}/routeMethods.ts +0 -0
  421. /package/src/server/{errors → core/errors}/BadRequestError.ts +0 -0
  422. /package/src/server/{errors → core/errors}/ConflictError.ts +0 -0
  423. /package/src/server/{errors → core/errors}/ForbiddenError.ts +0 -0
  424. /package/src/server/{errors → core/errors}/HttpError.ts +0 -0
  425. /package/src/server/{errors → core/errors}/NotFoundError.ts +0 -0
  426. /package/src/server/{errors → core/errors}/UnauthorizedError.ts +0 -0
  427. /package/src/server/{errors → core/errors}/ValidationError.ts +0 -0
  428. /package/src/server/{helpers → core/helpers}/ServerReply.ts +0 -0
  429. /package/src/server/{helpers → core/helpers}/isMultipart.ts +0 -0
  430. /package/src/server/{index.browser.ts → core/index.browser.ts} +0 -0
  431. /package/src/server/{index.shared.ts → core/index.shared.ts} +0 -0
  432. /package/src/server/{interfaces → core/interfaces}/ServerRequest.ts +0 -0
  433. /package/src/server/{primitives → core/primitives}/$route.ts +0 -0
  434. /package/src/server/{providers → core/providers}/BunHttpServerProvider.ts +0 -0
  435. /package/src/server/{providers → core/providers}/NodeHttpServerProvider.ts +0 -0
  436. /package/src/server/{providers → core/providers}/ServerLoggerProvider.ts +0 -0
  437. /package/src/server/{providers → core/providers}/ServerNotReadyProvider.ts +0 -0
  438. /package/src/server/{providers → core/providers}/ServerProvider.ts +0 -0
  439. /package/src/server/{providers → core/providers}/ServerTimingProvider.ts +0 -0
  440. /package/src/server/{schemas → core/schemas}/errorSchema.ts +0 -0
  441. /package/src/server/{schemas → core/schemas}/okSchema.ts +0 -0
  442. /package/src/server/{services → core/services}/HttpClient.ts +0 -0
  443. /package/src/server/{services → core/services}/ServerRequestParser.ts +0 -0
  444. /package/src/server/{services → core/services}/UserAgentParser.ts +0 -0
  445. /package/src/{server-cors → server/cors}/index.ts +0 -0
  446. /package/src/{server-cors → server/cors}/primitives/$cors.ts +0 -0
  447. /package/src/{server-cors → server/cors}/providers/ServerCorsProvider.ts +0 -0
  448. /package/src/{server-health → server/health}/index.ts +0 -0
  449. /package/src/{server-health → server/health}/providers/ServerHealthProvider.ts +0 -0
  450. /package/src/{server-health → server/health}/schemas/healthSchema.ts +0 -0
  451. /package/src/{server-helmet → server/helmet}/index.ts +0 -0
  452. /package/src/{server-helmet → server/helmet}/providers/ServerHelmetProvider.ts +0 -0
  453. /package/src/{server-links → server/links}/index.browser.ts +0 -0
  454. /package/src/{server-links → server/links}/index.ts +0 -0
  455. /package/src/{server-links → server/links}/primitives/$client.ts +0 -0
  456. /package/src/{server-links → server/links}/primitives/$remote.ts +0 -0
  457. /package/src/{server-links → server/links}/providers/LinkProvider.ts +0 -0
  458. /package/src/{server-links → server/links}/providers/RemotePrimitiveProvider.ts +0 -0
  459. /package/src/{server-links → server/links}/providers/ServerLinksProvider.ts +0 -0
  460. /package/src/{server-links → server/links}/schemas/apiLinksResponseSchema.ts +0 -0
  461. /package/src/{server-metrics → server/metrics}/index.ts +0 -0
  462. /package/src/{server-metrics → server/metrics}/providers/ServerMetricsProvider.ts +0 -0
  463. /package/src/{server-multipart → server/multipart}/index.ts +0 -0
  464. /package/src/{server-multipart → server/multipart}/providers/ServerMultipartProvider.ts +0 -0
  465. /package/src/{server-proxy → server/proxy}/index.ts +0 -0
  466. /package/src/{server-proxy → server/proxy}/primitives/$proxy.ts +0 -0
  467. /package/src/{server-proxy → server/proxy}/providers/ServerProxyProvider.ts +0 -0
  468. /package/src/{server-rate-limit → server/rate-limit}/primitives/$rateLimit.ts +0 -0
  469. /package/src/{server-rate-limit → server/rate-limit}/providers/ServerRateLimitProvider.ts +0 -0
  470. /package/src/{server-security → server/security}/index.browser.ts +0 -0
  471. /package/src/{server-security → server/security}/index.ts +0 -0
  472. /package/src/{server-security → server/security}/primitives/$basicAuth.ts +0 -0
  473. /package/src/{server-security → server/security}/providers/ServerBasicAuthProvider.ts +0 -0
  474. /package/src/{server-security → server/security}/providers/ServerSecurityProvider.ts +0 -0
  475. /package/src/{server-static → server/static}/index.ts +0 -0
  476. /package/src/{server-static → server/static}/primitives/$serve.ts +0 -0
  477. /package/src/{server-static → server/static}/providers/ServerStaticProvider.ts +0 -0
  478. /package/src/{server-swagger → server/swagger}/index.ts +0 -0
  479. /package/src/{server-swagger → server/swagger}/primitives/$swagger.ts +0 -0
  480. /package/src/topic/{errors → core/errors}/TopicTimeoutError.ts +0 -0
  481. /package/src/topic/{index.ts → core/index.ts} +0 -0
  482. /package/src/topic/{primitives → core/primitives}/$subscriber.ts +0 -0
  483. /package/src/topic/{primitives → core/primitives}/$topic.ts +0 -0
  484. /package/src/topic/{providers → core/providers}/MemoryTopicProvider.ts +0 -0
  485. /package/src/topic/{providers → core/providers}/TopicProvider.ts +0 -0
  486. /package/src/{topic-redis → topic/redis}/index.ts +0 -0
  487. /package/src/{topic-redis → topic/redis}/providers/RedisTopicProvider.ts +0 -0
@@ -0,0 +1,1194 @@
1
+ import * as alepha349 from "alepha";
2
+ import { Alepha, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
+ import * as alepha_orm71 from "alepha/orm";
4
+ import { Page } from "alepha/orm";
5
+ import * as alepha_server0 from "alepha/server";
6
+ import { ServerRequest } from "alepha/server";
7
+ import * as alepha_logger0 from "alepha/logger";
8
+ import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
9
+ import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
10
+ import "alepha/datetime";
11
+ import "alepha/retry";
12
+ import "alepha/lock";
13
+ import "drizzle-orm/postgres-js";
14
+ import "postgres";
15
+ import "drizzle-orm/sqlite-core";
16
+
17
+ //#region ../../src/api/audits/entities/audits.d.ts
18
+ /**
19
+ * Audit severity levels for categorizing events.
20
+ */
21
+ declare const auditSeveritySchema: alepha349.TUnsafe<"info" | "warning" | "critical">;
22
+ type AuditSeverity = Static<typeof auditSeveritySchema>;
23
+ /**
24
+ * Audit log entity for tracking important system events.
25
+ *
26
+ * Stores comprehensive audit information including:
27
+ * - Who performed the action (userId, userRealm)
28
+ * - What happened (type, action, resource)
29
+ * - When it happened (createdAt)
30
+ * - Context and details (metadata, ipAddress, userAgent)
31
+ */
32
+ declare const audits: alepha_orm71.EntityPrimitive<alepha349.TObject<{
33
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
34
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
35
+ /**
36
+ * Audit event type (e.g., "auth", "user", "payment", "system").
37
+ * Used for categorizing and filtering audit events.
38
+ */
39
+ type: alepha349.TString;
40
+ /**
41
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
42
+ */
43
+ action: alepha349.TString;
44
+ /**
45
+ * Severity level of the event.
46
+ */
47
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
48
+ /**
49
+ * User ID who performed the action (null for system events).
50
+ */
51
+ userId: alepha349.TOptional<alepha349.TString>;
52
+ /**
53
+ * User realm for multi-tenant support.
54
+ */
55
+ userRealm: alepha349.TOptional<alepha349.TString>;
56
+ /**
57
+ * User email at the time of the event (denormalized for history).
58
+ */
59
+ userEmail: alepha349.TOptional<alepha349.TString>;
60
+ /**
61
+ * Resource type affected (e.g., "user", "order", "file").
62
+ */
63
+ resourceType: alepha349.TOptional<alepha349.TString>;
64
+ /**
65
+ * Resource ID affected.
66
+ */
67
+ resourceId: alepha349.TOptional<alepha349.TString>;
68
+ /**
69
+ * Human-readable description of the event.
70
+ */
71
+ description: alepha349.TOptional<alepha349.TString>;
72
+ /**
73
+ * Additional metadata/context as JSON.
74
+ */
75
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
76
+ /**
77
+ * Client IP address.
78
+ */
79
+ ipAddress: alepha349.TOptional<alepha349.TString>;
80
+ /**
81
+ * Client user agent.
82
+ */
83
+ userAgent: alepha349.TOptional<alepha349.TString>;
84
+ /**
85
+ * Session ID if applicable.
86
+ */
87
+ sessionId: alepha349.TOptional<alepha349.TString>;
88
+ /**
89
+ * Request ID for correlation.
90
+ */
91
+ requestId: alepha349.TOptional<alepha349.TString>;
92
+ /**
93
+ * Whether the action was successful.
94
+ */
95
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
96
+ /**
97
+ * Error message if the action failed.
98
+ */
99
+ errorMessage: alepha349.TOptional<alepha349.TString>;
100
+ }>>;
101
+ declare const auditEntitySchema: alepha349.TObject<{
102
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
103
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
104
+ /**
105
+ * Audit event type (e.g., "auth", "user", "payment", "system").
106
+ * Used for categorizing and filtering audit events.
107
+ */
108
+ type: alepha349.TString;
109
+ /**
110
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
111
+ */
112
+ action: alepha349.TString;
113
+ /**
114
+ * Severity level of the event.
115
+ */
116
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
117
+ /**
118
+ * User ID who performed the action (null for system events).
119
+ */
120
+ userId: alepha349.TOptional<alepha349.TString>;
121
+ /**
122
+ * User realm for multi-tenant support.
123
+ */
124
+ userRealm: alepha349.TOptional<alepha349.TString>;
125
+ /**
126
+ * User email at the time of the event (denormalized for history).
127
+ */
128
+ userEmail: alepha349.TOptional<alepha349.TString>;
129
+ /**
130
+ * Resource type affected (e.g., "user", "order", "file").
131
+ */
132
+ resourceType: alepha349.TOptional<alepha349.TString>;
133
+ /**
134
+ * Resource ID affected.
135
+ */
136
+ resourceId: alepha349.TOptional<alepha349.TString>;
137
+ /**
138
+ * Human-readable description of the event.
139
+ */
140
+ description: alepha349.TOptional<alepha349.TString>;
141
+ /**
142
+ * Additional metadata/context as JSON.
143
+ */
144
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
145
+ /**
146
+ * Client IP address.
147
+ */
148
+ ipAddress: alepha349.TOptional<alepha349.TString>;
149
+ /**
150
+ * Client user agent.
151
+ */
152
+ userAgent: alepha349.TOptional<alepha349.TString>;
153
+ /**
154
+ * Session ID if applicable.
155
+ */
156
+ sessionId: alepha349.TOptional<alepha349.TString>;
157
+ /**
158
+ * Request ID for correlation.
159
+ */
160
+ requestId: alepha349.TOptional<alepha349.TString>;
161
+ /**
162
+ * Whether the action was successful.
163
+ */
164
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
165
+ /**
166
+ * Error message if the action failed.
167
+ */
168
+ errorMessage: alepha349.TOptional<alepha349.TString>;
169
+ }>;
170
+ declare const auditEntityInsertSchema: alepha_orm71.TObjectInsert<alepha349.TObject<{
171
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
172
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
173
+ /**
174
+ * Audit event type (e.g., "auth", "user", "payment", "system").
175
+ * Used for categorizing and filtering audit events.
176
+ */
177
+ type: alepha349.TString;
178
+ /**
179
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
180
+ */
181
+ action: alepha349.TString;
182
+ /**
183
+ * Severity level of the event.
184
+ */
185
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
186
+ /**
187
+ * User ID who performed the action (null for system events).
188
+ */
189
+ userId: alepha349.TOptional<alepha349.TString>;
190
+ /**
191
+ * User realm for multi-tenant support.
192
+ */
193
+ userRealm: alepha349.TOptional<alepha349.TString>;
194
+ /**
195
+ * User email at the time of the event (denormalized for history).
196
+ */
197
+ userEmail: alepha349.TOptional<alepha349.TString>;
198
+ /**
199
+ * Resource type affected (e.g., "user", "order", "file").
200
+ */
201
+ resourceType: alepha349.TOptional<alepha349.TString>;
202
+ /**
203
+ * Resource ID affected.
204
+ */
205
+ resourceId: alepha349.TOptional<alepha349.TString>;
206
+ /**
207
+ * Human-readable description of the event.
208
+ */
209
+ description: alepha349.TOptional<alepha349.TString>;
210
+ /**
211
+ * Additional metadata/context as JSON.
212
+ */
213
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
214
+ /**
215
+ * Client IP address.
216
+ */
217
+ ipAddress: alepha349.TOptional<alepha349.TString>;
218
+ /**
219
+ * Client user agent.
220
+ */
221
+ userAgent: alepha349.TOptional<alepha349.TString>;
222
+ /**
223
+ * Session ID if applicable.
224
+ */
225
+ sessionId: alepha349.TOptional<alepha349.TString>;
226
+ /**
227
+ * Request ID for correlation.
228
+ */
229
+ requestId: alepha349.TOptional<alepha349.TString>;
230
+ /**
231
+ * Whether the action was successful.
232
+ */
233
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
234
+ /**
235
+ * Error message if the action failed.
236
+ */
237
+ errorMessage: alepha349.TOptional<alepha349.TString>;
238
+ }>>;
239
+ type AuditEntity = Static<typeof audits.schema>;
240
+ //#endregion
241
+ //#region ../../src/api/audits/schemas/auditQuerySchema.d.ts
242
+ /**
243
+ * Query schema for searching and filtering audit logs.
244
+ */
245
+ declare const auditQuerySchema: alepha349.TObject<{
246
+ page: alepha349.TOptional<alepha349.TInteger>;
247
+ size: alepha349.TOptional<alepha349.TInteger>;
248
+ sort: alepha349.TOptional<alepha349.TString>;
249
+ type: alepha349.TOptional<alepha349.TString>;
250
+ action: alepha349.TOptional<alepha349.TString>;
251
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
252
+ userId: alepha349.TOptional<alepha349.TString>;
253
+ userRealm: alepha349.TOptional<alepha349.TString>;
254
+ resourceType: alepha349.TOptional<alepha349.TString>;
255
+ resourceId: alepha349.TOptional<alepha349.TString>;
256
+ success: alepha349.TOptional<alepha349.TBoolean>;
257
+ from: alepha349.TOptional<alepha349.TString>;
258
+ to: alepha349.TOptional<alepha349.TString>;
259
+ search: alepha349.TOptional<alepha349.TString>;
260
+ }>;
261
+ type AuditQuery = Static<typeof auditQuerySchema>;
262
+ //#endregion
263
+ //#region ../../src/api/audits/schemas/createAuditSchema.d.ts
264
+ /**
265
+ * Schema for creating a new audit log entry.
266
+ */
267
+ declare const createAuditSchema: alepha349.TObject<{
268
+ type: alepha349.TString;
269
+ action: alepha349.TString;
270
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
271
+ userId: alepha349.TOptional<alepha349.TString>;
272
+ userRealm: alepha349.TOptional<alepha349.TString>;
273
+ userEmail: alepha349.TOptional<alepha349.TString>;
274
+ resourceType: alepha349.TOptional<alepha349.TString>;
275
+ resourceId: alepha349.TOptional<alepha349.TString>;
276
+ description: alepha349.TOptional<alepha349.TString>;
277
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
278
+ ipAddress: alepha349.TOptional<alepha349.TString>;
279
+ userAgent: alepha349.TOptional<alepha349.TString>;
280
+ sessionId: alepha349.TOptional<alepha349.TString>;
281
+ requestId: alepha349.TOptional<alepha349.TString>;
282
+ success: alepha349.TOptional<alepha349.TBoolean>;
283
+ errorMessage: alepha349.TOptional<alepha349.TString>;
284
+ }>;
285
+ type CreateAudit = Static<typeof createAuditSchema>;
286
+ //#endregion
287
+ //#region ../../src/api/audits/services/AuditService.d.ts
288
+ /**
289
+ * Registered audit type definition.
290
+ */
291
+ interface AuditTypeDefinition {
292
+ type: string;
293
+ description?: string;
294
+ actions: string[];
295
+ }
296
+ /**
297
+ * Service for managing audit logs.
298
+ *
299
+ * Provides methods for:
300
+ * - Creating audit entries
301
+ * - Querying audit history
302
+ * - Aggregating audit statistics
303
+ * - Managing registered audit types
304
+ */
305
+ declare class AuditService {
306
+ protected readonly alepha: Alepha;
307
+ protected readonly log: alepha_logger0.Logger;
308
+ protected readonly repo: alepha_orm71.Repository<alepha349.TObject<{
309
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
310
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
311
+ type: alepha349.TString;
312
+ action: alepha349.TString;
313
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
314
+ userId: alepha349.TOptional<alepha349.TString>;
315
+ userRealm: alepha349.TOptional<alepha349.TString>;
316
+ userEmail: alepha349.TOptional<alepha349.TString>;
317
+ resourceType: alepha349.TOptional<alepha349.TString>;
318
+ resourceId: alepha349.TOptional<alepha349.TString>;
319
+ description: alepha349.TOptional<alepha349.TString>;
320
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
321
+ ipAddress: alepha349.TOptional<alepha349.TString>;
322
+ userAgent: alepha349.TOptional<alepha349.TString>;
323
+ sessionId: alepha349.TOptional<alepha349.TString>;
324
+ requestId: alepha349.TOptional<alepha349.TString>;
325
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
326
+ errorMessage: alepha349.TOptional<alepha349.TString>;
327
+ }>>;
328
+ /**
329
+ * Registry of audit types and their allowed actions.
330
+ */
331
+ protected readonly auditTypes: Map<string, AuditTypeDefinition>;
332
+ /**
333
+ * Register an audit type with its allowed actions.
334
+ */
335
+ registerType(definition: AuditTypeDefinition): void;
336
+ /**
337
+ * Get all registered audit types.
338
+ */
339
+ getRegisteredTypes(): AuditTypeDefinition[];
340
+ /**
341
+ * Get current request context if available.
342
+ */
343
+ protected getRequestContext(): ServerRequest | undefined;
344
+ /**
345
+ * Create a new audit log entry.
346
+ * Automatically populates ipAddress, userAgent, and requestId from the current request context.
347
+ */
348
+ create(data: CreateAudit): Promise<AuditEntity>;
349
+ /**
350
+ * Record an audit event (convenience method).
351
+ */
352
+ record(type: string, action: string, options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
353
+ /**
354
+ * Record an authentication event.
355
+ */
356
+ recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh" | "mfa_setup" | "mfa_verify", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
357
+ /**
358
+ * Record a user management event.
359
+ */
360
+ recordUser(action: "create" | "update" | "delete" | "enable" | "disable" | "role_change", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
361
+ /**
362
+ * Record a data access event.
363
+ */
364
+ recordAccess(action: "view" | "export" | "download", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
365
+ /**
366
+ * Record a security event.
367
+ */
368
+ recordSecurity(action: "permission_denied" | "suspicious_activity" | "rate_limited" | "blocked", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
369
+ /**
370
+ * Record a system event.
371
+ */
372
+ recordSystem(action: "startup" | "shutdown" | "config_change" | "maintenance" | "error", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
373
+ /**
374
+ * Find audit entries with filtering and pagination.
375
+ */
376
+ find(query?: AuditQuery): Promise<Page<AuditEntity>>;
377
+ /**
378
+ * Get audit entry by ID.
379
+ */
380
+ getById(id: string): Promise<AuditEntity>;
381
+ /**
382
+ * Get audit entries for a specific user.
383
+ */
384
+ findByUser(userId: string, query?: Omit<AuditQuery, "userId">): Promise<Page<AuditEntity>>;
385
+ /**
386
+ * Get audit entries for a specific resource.
387
+ */
388
+ findByResource(resourceType: string, resourceId: string, query?: Omit<AuditQuery, "resourceType" | "resourceId">): Promise<Page<AuditEntity>>;
389
+ /**
390
+ * Get audit statistics for a time period.
391
+ */
392
+ getStats(options?: {
393
+ from?: Date;
394
+ to?: Date;
395
+ userRealm?: string;
396
+ }): Promise<AuditStats>;
397
+ /**
398
+ * Delete old audit entries (for retention policy).
399
+ */
400
+ deleteOlderThan(date: Date): Promise<number>;
401
+ }
402
+ /**
403
+ * Audit statistics summary.
404
+ */
405
+ interface AuditStats {
406
+ total: number;
407
+ byType: Record<string, number>;
408
+ bySeverity: Record<AuditSeverity, number>;
409
+ successRate: number;
410
+ recentFailures: AuditEntity[];
411
+ }
412
+ //#endregion
413
+ //#region ../../src/api/audits/controllers/AuditController.d.ts
414
+ /**
415
+ * REST API controller for audit log management.
416
+ *
417
+ * Provides endpoints for:
418
+ * - Querying audit logs with filtering
419
+ * - Creating audit entries
420
+ * - Getting audit statistics
421
+ * - Viewing registered audit types
422
+ */
423
+ declare class AuditController {
424
+ protected readonly url = "/audits";
425
+ protected readonly group = "audits";
426
+ protected readonly auditService: AuditService;
427
+ /**
428
+ * Find audit entries with filtering and pagination.
429
+ */
430
+ readonly findAudits: alepha_server0.ActionPrimitiveFn<{
431
+ query: alepha349.TObject<{
432
+ page: alepha349.TOptional<alepha349.TInteger>;
433
+ size: alepha349.TOptional<alepha349.TInteger>;
434
+ sort: alepha349.TOptional<alepha349.TString>;
435
+ type: alepha349.TOptional<alepha349.TString>;
436
+ action: alepha349.TOptional<alepha349.TString>;
437
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
438
+ userId: alepha349.TOptional<alepha349.TString>;
439
+ userRealm: alepha349.TOptional<alepha349.TString>;
440
+ resourceType: alepha349.TOptional<alepha349.TString>;
441
+ resourceId: alepha349.TOptional<alepha349.TString>;
442
+ success: alepha349.TOptional<alepha349.TBoolean>;
443
+ from: alepha349.TOptional<alepha349.TString>;
444
+ to: alepha349.TOptional<alepha349.TString>;
445
+ search: alepha349.TOptional<alepha349.TString>;
446
+ }>;
447
+ response: alepha349.TPage<alepha349.TObject<{
448
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
449
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
450
+ type: alepha349.TString;
451
+ action: alepha349.TString;
452
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
453
+ userId: alepha349.TOptional<alepha349.TString>;
454
+ userRealm: alepha349.TOptional<alepha349.TString>;
455
+ userEmail: alepha349.TOptional<alepha349.TString>;
456
+ resourceType: alepha349.TOptional<alepha349.TString>;
457
+ resourceId: alepha349.TOptional<alepha349.TString>;
458
+ description: alepha349.TOptional<alepha349.TString>;
459
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
460
+ ipAddress: alepha349.TOptional<alepha349.TString>;
461
+ userAgent: alepha349.TOptional<alepha349.TString>;
462
+ sessionId: alepha349.TOptional<alepha349.TString>;
463
+ requestId: alepha349.TOptional<alepha349.TString>;
464
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
465
+ errorMessage: alepha349.TOptional<alepha349.TString>;
466
+ }>>;
467
+ }>;
468
+ /**
469
+ * Get a single audit entry by ID.
470
+ */
471
+ readonly getAudit: alepha_server0.ActionPrimitiveFn<{
472
+ params: alepha349.TObject<{
473
+ id: alepha349.TString;
474
+ }>;
475
+ response: alepha349.TObject<{
476
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
477
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
478
+ type: alepha349.TString;
479
+ action: alepha349.TString;
480
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
481
+ userId: alepha349.TOptional<alepha349.TString>;
482
+ userRealm: alepha349.TOptional<alepha349.TString>;
483
+ userEmail: alepha349.TOptional<alepha349.TString>;
484
+ resourceType: alepha349.TOptional<alepha349.TString>;
485
+ resourceId: alepha349.TOptional<alepha349.TString>;
486
+ description: alepha349.TOptional<alepha349.TString>;
487
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
488
+ ipAddress: alepha349.TOptional<alepha349.TString>;
489
+ userAgent: alepha349.TOptional<alepha349.TString>;
490
+ sessionId: alepha349.TOptional<alepha349.TString>;
491
+ requestId: alepha349.TOptional<alepha349.TString>;
492
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
493
+ errorMessage: alepha349.TOptional<alepha349.TString>;
494
+ }>;
495
+ }>;
496
+ /**
497
+ * Create a new audit entry.
498
+ */
499
+ readonly createAudit: alepha_server0.ActionPrimitiveFn<{
500
+ body: alepha349.TObject<{
501
+ type: alepha349.TString;
502
+ action: alepha349.TString;
503
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
504
+ userId: alepha349.TOptional<alepha349.TString>;
505
+ userRealm: alepha349.TOptional<alepha349.TString>;
506
+ userEmail: alepha349.TOptional<alepha349.TString>;
507
+ resourceType: alepha349.TOptional<alepha349.TString>;
508
+ resourceId: alepha349.TOptional<alepha349.TString>;
509
+ description: alepha349.TOptional<alepha349.TString>;
510
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
511
+ ipAddress: alepha349.TOptional<alepha349.TString>;
512
+ userAgent: alepha349.TOptional<alepha349.TString>;
513
+ sessionId: alepha349.TOptional<alepha349.TString>;
514
+ requestId: alepha349.TOptional<alepha349.TString>;
515
+ success: alepha349.TOptional<alepha349.TBoolean>;
516
+ errorMessage: alepha349.TOptional<alepha349.TString>;
517
+ }>;
518
+ response: alepha349.TObject<{
519
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
520
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
521
+ type: alepha349.TString;
522
+ action: alepha349.TString;
523
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
524
+ userId: alepha349.TOptional<alepha349.TString>;
525
+ userRealm: alepha349.TOptional<alepha349.TString>;
526
+ userEmail: alepha349.TOptional<alepha349.TString>;
527
+ resourceType: alepha349.TOptional<alepha349.TString>;
528
+ resourceId: alepha349.TOptional<alepha349.TString>;
529
+ description: alepha349.TOptional<alepha349.TString>;
530
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
531
+ ipAddress: alepha349.TOptional<alepha349.TString>;
532
+ userAgent: alepha349.TOptional<alepha349.TString>;
533
+ sessionId: alepha349.TOptional<alepha349.TString>;
534
+ requestId: alepha349.TOptional<alepha349.TString>;
535
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
536
+ errorMessage: alepha349.TOptional<alepha349.TString>;
537
+ }>;
538
+ }>;
539
+ /**
540
+ * Get audit entries for a specific user.
541
+ */
542
+ readonly findByUser: alepha_server0.ActionPrimitiveFn<{
543
+ params: alepha349.TObject<{
544
+ userId: alepha349.TString;
545
+ }>;
546
+ query: alepha349.TObject<{
547
+ page: alepha349.TOptional<alepha349.TInteger>;
548
+ type: alepha349.TOptional<alepha349.TString>;
549
+ size: alepha349.TOptional<alepha349.TInteger>;
550
+ sort: alepha349.TOptional<alepha349.TString>;
551
+ action: alepha349.TOptional<alepha349.TString>;
552
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
553
+ userRealm: alepha349.TOptional<alepha349.TString>;
554
+ resourceType: alepha349.TOptional<alepha349.TString>;
555
+ resourceId: alepha349.TOptional<alepha349.TString>;
556
+ success: alepha349.TOptional<alepha349.TBoolean>;
557
+ from: alepha349.TOptional<alepha349.TString>;
558
+ to: alepha349.TOptional<alepha349.TString>;
559
+ search: alepha349.TOptional<alepha349.TString>;
560
+ }>;
561
+ response: alepha349.TPage<alepha349.TObject<{
562
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
563
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
564
+ type: alepha349.TString;
565
+ action: alepha349.TString;
566
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
567
+ userId: alepha349.TOptional<alepha349.TString>;
568
+ userRealm: alepha349.TOptional<alepha349.TString>;
569
+ userEmail: alepha349.TOptional<alepha349.TString>;
570
+ resourceType: alepha349.TOptional<alepha349.TString>;
571
+ resourceId: alepha349.TOptional<alepha349.TString>;
572
+ description: alepha349.TOptional<alepha349.TString>;
573
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
574
+ ipAddress: alepha349.TOptional<alepha349.TString>;
575
+ userAgent: alepha349.TOptional<alepha349.TString>;
576
+ sessionId: alepha349.TOptional<alepha349.TString>;
577
+ requestId: alepha349.TOptional<alepha349.TString>;
578
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
579
+ errorMessage: alepha349.TOptional<alepha349.TString>;
580
+ }>>;
581
+ }>;
582
+ /**
583
+ * Get audit entries for a specific resource.
584
+ */
585
+ readonly findByResource: alepha_server0.ActionPrimitiveFn<{
586
+ params: alepha349.TObject<{
587
+ resourceType: alepha349.TString;
588
+ resourceId: alepha349.TString;
589
+ }>;
590
+ query: alepha349.TObject<{
591
+ page: alepha349.TOptional<alepha349.TInteger>;
592
+ type: alepha349.TOptional<alepha349.TString>;
593
+ size: alepha349.TOptional<alepha349.TInteger>;
594
+ sort: alepha349.TOptional<alepha349.TString>;
595
+ action: alepha349.TOptional<alepha349.TString>;
596
+ severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
597
+ userId: alepha349.TOptional<alepha349.TString>;
598
+ userRealm: alepha349.TOptional<alepha349.TString>;
599
+ success: alepha349.TOptional<alepha349.TBoolean>;
600
+ from: alepha349.TOptional<alepha349.TString>;
601
+ to: alepha349.TOptional<alepha349.TString>;
602
+ search: alepha349.TOptional<alepha349.TString>;
603
+ }>;
604
+ response: alepha349.TPage<alepha349.TObject<{
605
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
606
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
607
+ type: alepha349.TString;
608
+ action: alepha349.TString;
609
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
610
+ userId: alepha349.TOptional<alepha349.TString>;
611
+ userRealm: alepha349.TOptional<alepha349.TString>;
612
+ userEmail: alepha349.TOptional<alepha349.TString>;
613
+ resourceType: alepha349.TOptional<alepha349.TString>;
614
+ resourceId: alepha349.TOptional<alepha349.TString>;
615
+ description: alepha349.TOptional<alepha349.TString>;
616
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
617
+ ipAddress: alepha349.TOptional<alepha349.TString>;
618
+ userAgent: alepha349.TOptional<alepha349.TString>;
619
+ sessionId: alepha349.TOptional<alepha349.TString>;
620
+ requestId: alepha349.TOptional<alepha349.TString>;
621
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
622
+ errorMessage: alepha349.TOptional<alepha349.TString>;
623
+ }>>;
624
+ }>;
625
+ /**
626
+ * Get audit statistics.
627
+ */
628
+ readonly getStats: alepha_server0.ActionPrimitiveFn<{
629
+ query: alepha349.TObject<{
630
+ from: alepha349.TOptional<alepha349.TString>;
631
+ to: alepha349.TOptional<alepha349.TString>;
632
+ userRealm: alepha349.TOptional<alepha349.TString>;
633
+ }>;
634
+ response: alepha349.TObject<{
635
+ total: alepha349.TInteger;
636
+ byType: alepha349.TRecord<"^.*$", alepha349.TInteger>;
637
+ bySeverity: alepha349.TObject<{
638
+ info: alepha349.TInteger;
639
+ warning: alepha349.TInteger;
640
+ critical: alepha349.TInteger;
641
+ }>;
642
+ successRate: alepha349.TNumber;
643
+ recentFailures: alepha349.TArray<alepha349.TObject<{
644
+ id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
645
+ createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
646
+ type: alepha349.TString;
647
+ action: alepha349.TString;
648
+ severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
649
+ userId: alepha349.TOptional<alepha349.TString>;
650
+ userRealm: alepha349.TOptional<alepha349.TString>;
651
+ userEmail: alepha349.TOptional<alepha349.TString>;
652
+ resourceType: alepha349.TOptional<alepha349.TString>;
653
+ resourceId: alepha349.TOptional<alepha349.TString>;
654
+ description: alepha349.TOptional<alepha349.TString>;
655
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
656
+ ipAddress: alepha349.TOptional<alepha349.TString>;
657
+ userAgent: alepha349.TOptional<alepha349.TString>;
658
+ sessionId: alepha349.TOptional<alepha349.TString>;
659
+ requestId: alepha349.TOptional<alepha349.TString>;
660
+ success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
661
+ errorMessage: alepha349.TOptional<alepha349.TString>;
662
+ }>>;
663
+ }>;
664
+ }>;
665
+ /**
666
+ * Get registered audit types.
667
+ */
668
+ readonly getTypes: alepha_server0.ActionPrimitiveFn<{
669
+ response: alepha349.TArray<alepha349.TObject<{
670
+ type: alepha349.TString;
671
+ description: alepha349.TOptional<alepha349.TString>;
672
+ actions: alepha349.TArray<alepha349.TString>;
673
+ }>>;
674
+ }>;
675
+ /**
676
+ * Get distinct values for filters.
677
+ */
678
+ readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
679
+ response: alepha349.TObject<{
680
+ types: alepha349.TArray<alepha349.TString>;
681
+ actions: alepha349.TArray<alepha349.TString>;
682
+ resourceTypes: alepha349.TArray<alepha349.TString>;
683
+ userRealms: alepha349.TArray<alepha349.TString>;
684
+ }>;
685
+ }>;
686
+ }
687
+ //#endregion
688
+ //#region ../../src/api/audits/primitives/$audit.d.ts
689
+ /**
690
+ * Options for creating an audit type primitive.
691
+ */
692
+ interface AuditPrimitiveOptions {
693
+ /**
694
+ * Unique audit type identifier (e.g., "auth", "payment", "order").
695
+ */
696
+ type: string;
697
+ /**
698
+ * Human-readable description of this audit type.
699
+ */
700
+ description?: string;
701
+ /**
702
+ * List of allowed actions for this audit type.
703
+ */
704
+ actions: string[];
705
+ }
706
+ /**
707
+ * Audit type primitive for registering domain-specific audit events.
708
+ *
709
+ * Provides a type-safe way to define and log audit events within a specific domain.
710
+ *
711
+ * @example
712
+ * ```ts
713
+ * class PaymentAudits {
714
+ * audit = $audit({
715
+ * type: "payment",
716
+ * description: "Payment-related audit events",
717
+ * actions: ["create", "refund", "cancel", "dispute"],
718
+ * });
719
+ *
720
+ * async logPaymentCreated(paymentId: string, userId: string, amount: number) {
721
+ * await this.audit.log("create", {
722
+ * userId,
723
+ * resourceType: "payment",
724
+ * resourceId: paymentId,
725
+ * description: `Payment of ${amount} created`,
726
+ * metadata: { amount },
727
+ * });
728
+ * }
729
+ * }
730
+ * ```
731
+ */
732
+ declare class AuditPrimitive extends Primitive<AuditPrimitiveOptions> {
733
+ protected readonly auditService: AuditService;
734
+ /**
735
+ * The audit type identifier.
736
+ */
737
+ get type(): string;
738
+ /**
739
+ * The audit type description.
740
+ */
741
+ get description(): string | undefined;
742
+ /**
743
+ * The allowed actions for this audit type.
744
+ */
745
+ get actions(): string[];
746
+ /**
747
+ * Log an audit event for this type.
748
+ */
749
+ log(action: string, options?: AuditLogOptions): Promise<void>;
750
+ /**
751
+ * Log a successful audit event.
752
+ */
753
+ logSuccess(action: string, options?: Omit<AuditLogOptions, "success">): Promise<void>;
754
+ /**
755
+ * Log a failed audit event.
756
+ */
757
+ logFailure(action: string, errorMessage: string, options?: Omit<AuditLogOptions, "success" | "errorMessage">): Promise<void>;
758
+ /**
759
+ * Called during initialization to register this audit type.
760
+ */
761
+ protected onInit(): void;
762
+ }
763
+ /**
764
+ * Options for logging an audit event.
765
+ */
766
+ interface AuditLogOptions {
767
+ severity?: "info" | "warning" | "critical";
768
+ userId?: string;
769
+ userRealm?: string;
770
+ userEmail?: string;
771
+ resourceType?: string;
772
+ resourceId?: string;
773
+ description?: string;
774
+ metadata?: Record<string, unknown>;
775
+ ipAddress?: string;
776
+ userAgent?: string;
777
+ sessionId?: string;
778
+ requestId?: string;
779
+ success?: boolean;
780
+ errorMessage?: string;
781
+ }
782
+ /**
783
+ * Create an audit type primitive.
784
+ *
785
+ * @example
786
+ * ```ts
787
+ * class OrderAudits {
788
+ * audit = $audit({
789
+ * type: "order",
790
+ * description: "Order management events",
791
+ * actions: ["create", "update", "cancel", "fulfill", "ship"],
792
+ * });
793
+ * }
794
+ * ```
795
+ */
796
+ declare const $audit: {
797
+ (options: AuditPrimitiveOptions): AuditPrimitive;
798
+ [KIND]: typeof AuditPrimitive;
799
+ };
800
+ //#endregion
801
+ //#region ../../src/orm/schemas/insertSchema.d.ts
802
+ /**
803
+ * Transforms a TObject schema for insert operations.
804
+ * All default properties at the root level are made optional.
805
+ *
806
+ * @example
807
+ * Before: { name: string; age: number(default=0); }
808
+ * After: { name: string; age?: number; }
809
+ */
810
+ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends {
811
+ [PG_DEFAULT]: any;
812
+ } | {
813
+ "~optional": true;
814
+ } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
815
+ //#endregion
816
+ //#region ../../src/orm/schemas/updateSchema.d.ts
817
+ /**
818
+ * Transforms a TObject schema for update operations.
819
+ * All optional properties at the root level are made nullable (i.e., `T | null`).
820
+ * This allows an API endpoint to explicitly accept `null` to clear an optional field in the database.
821
+ *
822
+ * @example
823
+ * Before: { name?: string; age: number; }
824
+ * After: { name?: string | null; age: number; }
825
+ */
826
+ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends TOptional<infer U> ? TOptional<TUnion<[U, TNull]>> : T["properties"][K] }>;
827
+ //#endregion
828
+ //#region ../../src/orm/primitives/$entity.d.ts
829
+ interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
830
+ /**
831
+ * The database table name that will be created for this entity.
832
+ * If not provided, name will be inferred from the $repository variable name.
833
+ */
834
+ name: string;
835
+ /**
836
+ * TypeBox schema defining the table structure and column types.
837
+ */
838
+ schema: T;
839
+ /**
840
+ * Database indexes to create for query optimization.
841
+ */
842
+ indexes?: (Keys | {
843
+ /**
844
+ * Single column to index.
845
+ */
846
+ column: Keys;
847
+ /**
848
+ * Whether this should be a unique index (enforces uniqueness constraint).
849
+ */
850
+ unique?: boolean;
851
+ /**
852
+ * Custom name for the index. If not provided, generates name automatically.
853
+ */
854
+ name?: string;
855
+ } | {
856
+ /**
857
+ * Multiple columns for composite index (order matters for query optimization).
858
+ */
859
+ columns: Keys[];
860
+ /**
861
+ * Whether this should be a unique index (enforces uniqueness constraint).
862
+ */
863
+ unique?: boolean;
864
+ /**
865
+ * Custom name for the index. If not provided, generates name automatically.
866
+ */
867
+ name?: string;
868
+ })[];
869
+ /**
870
+ * Foreign key constraints to maintain referential integrity.
871
+ */
872
+ foreignKeys?: Array<{
873
+ /**
874
+ * Optional name for the foreign key constraint.
875
+ */
876
+ name?: string;
877
+ /**
878
+ * Local columns that reference the foreign table.
879
+ */
880
+ columns: Array<keyof Static<T>>;
881
+ /**
882
+ * Referenced columns in the foreign table.
883
+ * Must be EntityColumn references from other entities.
884
+ */
885
+ foreignColumns: Array<() => EntityColumn<any>>;
886
+ }>;
887
+ /**
888
+ * Additional table constraints for data validation.
889
+ *
890
+ * Constraints enforce business rules at the database level, providing
891
+ * an additional layer of data integrity beyond application validation.
892
+ *
893
+ * **Constraint Types**:
894
+ * - **Unique constraints**: Prevent duplicate values across columns
895
+ * - **Check constraints**: Enforce custom validation rules with SQL expressions
896
+ *
897
+ * @example
898
+ * ```ts
899
+ * constraints: [
900
+ * {
901
+ * name: "unique_user_email",
902
+ * columns: ["email"],
903
+ * unique: true
904
+ * },
905
+ * {
906
+ * name: "valid_age_range",
907
+ * columns: ["age"],
908
+ * check: sql`age >= 0 AND age <= 150`
909
+ * },
910
+ * {
911
+ * name: "unique_user_username_per_tenant",
912
+ * columns: ["tenantId", "username"],
913
+ * unique: true
914
+ * }
915
+ * ]
916
+ * ```
917
+ */
918
+ constraints?: Array<{
919
+ /**
920
+ * Columns involved in this constraint.
921
+ */
922
+ columns: Array<keyof Static<T>>;
923
+ /**
924
+ * Optional name for the constraint.
925
+ */
926
+ name?: string;
927
+ /**
928
+ * Whether this is a unique constraint.
929
+ */
930
+ unique?: boolean | {};
931
+ /**
932
+ * SQL expression for check constraint validation.
933
+ */
934
+ check?: SQL;
935
+ }>;
936
+ /**
937
+ * Advanced Drizzle ORM configuration for complex table setups.
938
+ */
939
+ config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
940
+ }
941
+ declare class EntityPrimitive<T extends TObject = TObject> {
942
+ readonly options: EntityPrimitiveOptions<T>;
943
+ constructor(options: EntityPrimitiveOptions<T>);
944
+ alias(alias: string): this;
945
+ get cols(): EntityColumns<T>;
946
+ get name(): string;
947
+ get schema(): T;
948
+ get insertSchema(): TObjectInsert<T>;
949
+ get updateSchema(): TObjectUpdate<T>;
950
+ }
951
+ /**
952
+ * Convert a schema to columns.
953
+ */
954
+ type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
955
+ type EntityColumn<T extends TObject> = {
956
+ name: string;
957
+ entity: EntityPrimitive<T>;
958
+ };
959
+ type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
960
+ //#endregion
961
+ //#region ../../src/orm/constants/PG_SYMBOLS.d.ts
962
+ declare const PG_DEFAULT: unique symbol;
963
+ declare const PG_PRIMARY_KEY: unique symbol;
964
+ declare const PG_CREATED_AT: unique symbol;
965
+ declare const PG_UPDATED_AT: unique symbol;
966
+ declare const PG_DELETED_AT: unique symbol;
967
+ declare const PG_VERSION: unique symbol;
968
+ declare const PG_IDENTITY: unique symbol;
969
+ declare const PG_ENUM: unique symbol;
970
+ declare const PG_REF: unique symbol;
971
+ /**
972
+ * @deprecated Use `PG_IDENTITY` instead.
973
+ */
974
+ declare const PG_SERIAL: unique symbol;
975
+ type PgSymbols = {
976
+ [PG_DEFAULT]: {};
977
+ [PG_PRIMARY_KEY]: {};
978
+ [PG_CREATED_AT]: {};
979
+ [PG_UPDATED_AT]: {};
980
+ [PG_DELETED_AT]: {};
981
+ [PG_VERSION]: {};
982
+ [PG_IDENTITY]: PgIdentityOptions;
983
+ [PG_REF]: PgRefOptions;
984
+ [PG_ENUM]: PgEnumOptions;
985
+ /**
986
+ * @deprecated Use `PG_IDENTITY` instead.
987
+ */
988
+ [PG_SERIAL]: {};
989
+ };
990
+ type PgSymbolKeys = keyof PgSymbols;
991
+ type PgIdentityOptions = {
992
+ mode: "always" | "byDefault";
993
+ } & PgSequenceOptions & {
994
+ name?: string;
995
+ };
996
+ interface PgEnumOptions {
997
+ name?: string;
998
+ description?: string;
999
+ }
1000
+ interface PgRefOptions {
1001
+ ref: () => {
1002
+ name: string;
1003
+ entity: EntityPrimitive;
1004
+ };
1005
+ actions?: {
1006
+ onUpdate?: UpdateDeleteAction;
1007
+ onDelete?: UpdateDeleteAction;
1008
+ };
1009
+ }
1010
+ //#endregion
1011
+ //#region ../../src/orm/helpers/pgAttr.d.ts
1012
+ /**
1013
+ * Type representation.
1014
+ */
1015
+ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
1016
+ //#endregion
1017
+ //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
1018
+ declare module "alepha" {
1019
+ interface Env extends Partial<Static<typeof envSchema>> {}
1020
+ }
1021
+ declare const envSchema: alepha349.TObject<{
1022
+ /**
1023
+ * Main configuration for database connection.
1024
+ * Accept a string in the format of a Postgres connection URL.
1025
+ * Example: postgres://user:password@localhost:5432/database
1026
+ * or
1027
+ * Example: postgres://user:password@localhost:5432/database?sslmode=require
1028
+ */
1029
+ DATABASE_URL: alepha349.TOptional<alepha349.TString>;
1030
+ /**
1031
+ * In addition to the DATABASE_URL, you can specify the postgres schema name.
1032
+ *
1033
+ * It will monkey patch drizzle tables.
1034
+ */
1035
+ POSTGRES_SCHEMA: alepha349.TOptional<alepha349.TString>;
1036
+ }>;
1037
+ //#endregion
1038
+ //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
1039
+ /**
1040
+ * Configuration options for the Node.js SQLite database provider.
1041
+ */
1042
+ declare const nodeSqliteOptions: alepha349.Atom<alepha349.TObject<{
1043
+ path: alepha349.TOptional<alepha349.TString>;
1044
+ }>, "alepha.postgres.node-sqlite.options">;
1045
+ type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
1046
+ declare module "alepha" {
1047
+ interface State {
1048
+ [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
1049
+ }
1050
+ }
1051
+ /**
1052
+ * Add a fake support for SQLite in Node.js based on Postgres interfaces.
1053
+ *
1054
+ * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
1055
+ * This is NOT recommended for production use.
1056
+ */
1057
+ //#endregion
1058
+ //#region ../../src/orm/index.d.ts
1059
+ declare module "alepha" {
1060
+ interface Hooks {
1061
+ /**
1062
+ * Fires before creating an entity in the repository.
1063
+ */
1064
+ "repository:create:before": {
1065
+ tableName: string;
1066
+ data: any;
1067
+ };
1068
+ /**
1069
+ * Fires after creating an entity in the repository.
1070
+ */
1071
+ "repository:create:after": {
1072
+ tableName: string;
1073
+ data: any;
1074
+ entity: any;
1075
+ };
1076
+ /**
1077
+ * Fires before updating entities in the repository.
1078
+ */
1079
+ "repository:update:before": {
1080
+ tableName: string;
1081
+ where: any;
1082
+ data: any;
1083
+ };
1084
+ /**
1085
+ * Fires after updating entities in the repository.
1086
+ */
1087
+ "repository:update:after": {
1088
+ tableName: string;
1089
+ where: any;
1090
+ data: any;
1091
+ entities: any[];
1092
+ };
1093
+ /**
1094
+ * Fires before deleting entities from the repository.
1095
+ */
1096
+ "repository:delete:before": {
1097
+ tableName: string;
1098
+ where: any;
1099
+ };
1100
+ /**
1101
+ * Fires after deleting entities from the repository.
1102
+ */
1103
+ "repository:delete:after": {
1104
+ tableName: string;
1105
+ where: any;
1106
+ ids: Array<string | number>;
1107
+ };
1108
+ /**
1109
+ * Fires before reading entities from the repository.
1110
+ */
1111
+ "repository:read:before": {
1112
+ tableName: string;
1113
+ query: any;
1114
+ };
1115
+ /**
1116
+ * Fires after reading entities from the repository.
1117
+ */
1118
+ "repository:read:after": {
1119
+ tableName: string;
1120
+ query: any;
1121
+ entities: any[];
1122
+ };
1123
+ }
1124
+ }
1125
+ //#endregion
1126
+ //#region ../../src/api/audits/schemas/auditResourceSchema.d.ts
1127
+ /**
1128
+ * Resource schema for audit log responses.
1129
+ */
1130
+ declare const auditResourceSchema: alepha349.TObject<{
1131
+ id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1132
+ createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1133
+ type: alepha349.TString;
1134
+ action: alepha349.TString;
1135
+ severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
1136
+ userId: alepha349.TOptional<alepha349.TString>;
1137
+ userRealm: alepha349.TOptional<alepha349.TString>;
1138
+ userEmail: alepha349.TOptional<alepha349.TString>;
1139
+ resourceType: alepha349.TOptional<alepha349.TString>;
1140
+ resourceId: alepha349.TOptional<alepha349.TString>;
1141
+ description: alepha349.TOptional<alepha349.TString>;
1142
+ metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
1143
+ ipAddress: alepha349.TOptional<alepha349.TString>;
1144
+ userAgent: alepha349.TOptional<alepha349.TString>;
1145
+ sessionId: alepha349.TOptional<alepha349.TString>;
1146
+ requestId: alepha349.TOptional<alepha349.TString>;
1147
+ success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
1148
+ errorMessage: alepha349.TOptional<alepha349.TString>;
1149
+ }>;
1150
+ type AuditResource = Static<typeof auditResourceSchema>;
1151
+ //#endregion
1152
+ //#region ../../src/api/audits/index.d.ts
1153
+ /**
1154
+ * Provides audit logging API endpoints for Alepha applications.
1155
+ *
1156
+ * This module includes:
1157
+ * - Audit log CRUD operations
1158
+ * - Filtering and searching audit events
1159
+ * - Audit statistics and analytics
1160
+ * - `$audit` primitive for domain-specific audit types
1161
+ *
1162
+ * @module alepha.api.audits
1163
+ *
1164
+ * @example
1165
+ * ```ts
1166
+ * // In your app module
1167
+ * import { AlephaApiAudits } from "alepha/api/audits";
1168
+ *
1169
+ * const App = $module({
1170
+ * name: "app",
1171
+ * services: [AlephaApiAudits, ...],
1172
+ * });
1173
+ *
1174
+ * // Create domain-specific audit types
1175
+ * class PaymentAudits {
1176
+ * audit = $audit({
1177
+ * type: "payment",
1178
+ * actions: ["create", "refund", "cancel"],
1179
+ * });
1180
+ *
1181
+ * async onPaymentCreated(paymentId: string, userId: string) {
1182
+ * await this.audit.log("create", {
1183
+ * userId,
1184
+ * resourceType: "payment",
1185
+ * resourceId: paymentId,
1186
+ * });
1187
+ * }
1188
+ * }
1189
+ * ```
1190
+ */
1191
+ declare const AlephaApiAudits: alepha349.Service<alepha349.Module>;
1192
+ //#endregion
1193
+ export { $audit, AlephaApiAudits, AuditController, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
1194
+ //# sourceMappingURL=index.d.ts.map