alepha 0.14.2 → 0.14.4

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 (405) hide show
  1. package/README.md +1 -1
  2. package/dist/api/audits/index.browser.js +5 -5
  3. package/dist/api/audits/index.browser.js.map +1 -1
  4. package/dist/api/audits/index.d.ts +706 -785
  5. package/dist/api/audits/index.d.ts.map +1 -1
  6. package/dist/api/audits/index.js +13 -13
  7. package/dist/api/audits/index.js.map +1 -1
  8. package/dist/api/files/index.browser.js +5 -5
  9. package/dist/api/files/index.browser.js.map +1 -1
  10. package/dist/api/files/index.d.ts +58 -137
  11. package/dist/api/files/index.d.ts.map +1 -1
  12. package/dist/api/files/index.js +71 -71
  13. package/dist/api/files/index.js.map +1 -1
  14. package/dist/api/jobs/index.browser.js +5 -5
  15. package/dist/api/jobs/index.browser.js.map +1 -1
  16. package/dist/api/jobs/index.d.ts +29 -108
  17. package/dist/api/jobs/index.d.ts.map +1 -1
  18. package/dist/api/jobs/index.js +10 -10
  19. package/dist/api/jobs/index.js.map +1 -1
  20. package/dist/api/notifications/index.browser.js +10 -10
  21. package/dist/api/notifications/index.browser.js.map +1 -1
  22. package/dist/api/notifications/index.d.ts +504 -171
  23. package/dist/api/notifications/index.d.ts.map +1 -1
  24. package/dist/api/notifications/index.js +12 -12
  25. package/dist/api/notifications/index.js.map +1 -1
  26. package/dist/api/parameters/index.browser.js +163 -10
  27. package/dist/api/parameters/index.browser.js.map +1 -1
  28. package/dist/api/parameters/index.d.ts +277 -351
  29. package/dist/api/parameters/index.d.ts.map +1 -1
  30. package/dist/api/parameters/index.js +196 -91
  31. package/dist/api/parameters/index.js.map +1 -1
  32. package/dist/api/users/index.browser.js +19 -19
  33. package/dist/api/users/index.browser.js.map +1 -1
  34. package/dist/api/users/index.d.ts +787 -852
  35. package/dist/api/users/index.d.ts.map +1 -1
  36. package/dist/api/users/index.js +827 -596
  37. package/dist/api/users/index.js.map +1 -1
  38. package/dist/api/verifications/index.browser.js +6 -6
  39. package/dist/api/verifications/index.browser.js.map +1 -1
  40. package/dist/api/verifications/index.d.ts +128 -128
  41. package/dist/api/verifications/index.d.ts.map +1 -1
  42. package/dist/api/verifications/index.js +6 -6
  43. package/dist/api/verifications/index.js.map +1 -1
  44. package/dist/bin/index.d.ts +1 -2
  45. package/dist/bin/index.js +0 -1
  46. package/dist/bin/index.js.map +1 -1
  47. package/dist/cli/index.d.ts +252 -131
  48. package/dist/cli/index.d.ts.map +1 -1
  49. package/dist/cli/index.js +595 -395
  50. package/dist/cli/index.js.map +1 -1
  51. package/dist/command/index.d.ts +46 -11
  52. package/dist/command/index.d.ts.map +1 -1
  53. package/dist/command/index.js +99 -19
  54. package/dist/command/index.js.map +1 -1
  55. package/dist/core/index.browser.js +40 -22
  56. package/dist/core/index.browser.js.map +1 -1
  57. package/dist/core/index.d.ts +45 -1
  58. package/dist/core/index.d.ts.map +1 -1
  59. package/dist/core/index.js +40 -22
  60. package/dist/core/index.js.map +1 -1
  61. package/dist/core/index.native.js +40 -22
  62. package/dist/core/index.native.js.map +1 -1
  63. package/dist/fake/index.js +195 -168
  64. package/dist/fake/index.js.map +1 -1
  65. package/dist/file/index.d.ts +8 -0
  66. package/dist/file/index.d.ts.map +1 -1
  67. package/dist/file/index.js +3 -0
  68. package/dist/file/index.js.map +1 -1
  69. package/dist/logger/index.d.ts +1 -1
  70. package/dist/logger/index.d.ts.map +1 -1
  71. package/dist/logger/index.js +12 -2
  72. package/dist/logger/index.js.map +1 -1
  73. package/dist/mcp/index.js +1 -1
  74. package/dist/mcp/index.js.map +1 -1
  75. package/dist/orm/index.d.ts +59 -195
  76. package/dist/orm/index.d.ts.map +1 -1
  77. package/dist/orm/index.js +201 -430
  78. package/dist/orm/index.js.map +1 -1
  79. package/dist/security/index.d.ts +1 -1
  80. package/dist/security/index.d.ts.map +1 -1
  81. package/dist/security/index.js +1 -1
  82. package/dist/security/index.js.map +1 -1
  83. package/dist/server/auth/index.d.ts +171 -155
  84. package/dist/server/auth/index.d.ts.map +1 -1
  85. package/dist/server/auth/index.js +0 -1
  86. package/dist/server/auth/index.js.map +1 -1
  87. package/dist/server/cache/index.d.ts +12 -0
  88. package/dist/server/cache/index.d.ts.map +1 -1
  89. package/dist/server/cache/index.js +55 -2
  90. package/dist/server/cache/index.js.map +1 -1
  91. package/dist/server/compress/index.d.ts +6 -0
  92. package/dist/server/compress/index.d.ts.map +1 -1
  93. package/dist/server/compress/index.js +38 -1
  94. package/dist/server/compress/index.js.map +1 -1
  95. package/dist/server/core/index.browser.js +2 -2
  96. package/dist/server/core/index.browser.js.map +1 -1
  97. package/dist/server/core/index.d.ts +10 -10
  98. package/dist/server/core/index.d.ts.map +1 -1
  99. package/dist/server/core/index.js +7 -4
  100. package/dist/server/core/index.js.map +1 -1
  101. package/dist/server/links/index.browser.js +22 -6
  102. package/dist/server/links/index.browser.js.map +1 -1
  103. package/dist/server/links/index.d.ts +46 -44
  104. package/dist/server/links/index.d.ts.map +1 -1
  105. package/dist/server/links/index.js +24 -41
  106. package/dist/server/links/index.js.map +1 -1
  107. package/dist/server/static/index.d.ts.map +1 -1
  108. package/dist/server/static/index.js +4 -0
  109. package/dist/server/static/index.js.map +1 -1
  110. package/dist/server/swagger/index.d.ts +2 -1
  111. package/dist/server/swagger/index.d.ts.map +1 -1
  112. package/dist/server/swagger/index.js +9 -5
  113. package/dist/server/swagger/index.js.map +1 -1
  114. package/dist/vite/index.d.ts +101 -106
  115. package/dist/vite/index.d.ts.map +1 -1
  116. package/dist/vite/index.js +574 -503
  117. package/dist/vite/index.js.map +1 -1
  118. package/dist/websocket/index.d.ts +7 -7
  119. package/package.json +7 -7
  120. package/src/api/audits/controllers/{AuditController.ts → AdminAuditController.ts} +5 -6
  121. package/src/api/audits/entities/audits.ts +5 -5
  122. package/src/api/audits/index.browser.ts +1 -1
  123. package/src/api/audits/index.ts +3 -3
  124. package/src/api/audits/primitives/$audit.spec.ts +276 -0
  125. package/src/api/audits/services/AuditService.spec.ts +495 -0
  126. package/src/api/files/__tests__/$bucket.spec.ts +91 -0
  127. package/src/api/files/controllers/AdminFileStatsController.spec.ts +166 -0
  128. package/src/api/files/controllers/{StorageStatsController.ts → AdminFileStatsController.ts} +2 -2
  129. package/src/api/files/controllers/FileController.spec.ts +558 -0
  130. package/src/api/files/controllers/FileController.ts +4 -5
  131. package/src/api/files/entities/files.ts +5 -5
  132. package/src/api/files/index.browser.ts +1 -1
  133. package/src/api/files/index.ts +4 -4
  134. package/src/api/files/jobs/FileJobs.spec.ts +52 -0
  135. package/src/api/files/services/FileService.spec.ts +109 -0
  136. package/src/api/jobs/__tests__/JobController.spec.ts +343 -0
  137. package/src/api/jobs/controllers/{JobController.ts → AdminJobController.ts} +2 -2
  138. package/src/api/jobs/entities/jobExecutions.ts +5 -5
  139. package/src/api/jobs/index.ts +3 -3
  140. package/src/api/jobs/primitives/$job.spec.ts +476 -0
  141. package/src/api/notifications/controllers/{NotificationController.ts → AdminNotificationController.ts} +4 -5
  142. package/src/api/notifications/entities/notifications.ts +5 -5
  143. package/src/api/notifications/index.browser.ts +1 -1
  144. package/src/api/notifications/index.ts +4 -4
  145. package/src/api/parameters/controllers/{ConfigController.ts → AdminConfigController.ts} +46 -107
  146. package/src/api/parameters/entities/parameters.ts +7 -17
  147. package/src/api/parameters/index.ts +3 -3
  148. package/src/api/parameters/primitives/$config.spec.ts +356 -0
  149. package/src/api/parameters/schemas/activateConfigBodySchema.ts +12 -0
  150. package/src/api/parameters/schemas/checkScheduledResponseSchema.ts +8 -0
  151. package/src/api/parameters/schemas/configCurrentResponseSchema.ts +13 -0
  152. package/src/api/parameters/schemas/configHistoryResponseSchema.ts +9 -0
  153. package/src/api/parameters/schemas/configNameParamSchema.ts +10 -0
  154. package/src/api/parameters/schemas/configNamesResponseSchema.ts +8 -0
  155. package/src/api/parameters/schemas/configTreeNodeSchema.ts +13 -0
  156. package/src/api/parameters/schemas/configVersionParamSchema.ts +9 -0
  157. package/src/api/parameters/schemas/configVersionResponseSchema.ts +9 -0
  158. package/src/api/parameters/schemas/configsByStatusResponseSchema.ts +9 -0
  159. package/src/api/parameters/schemas/createConfigVersionBodySchema.ts +24 -0
  160. package/src/api/parameters/schemas/index.ts +15 -0
  161. package/src/api/parameters/schemas/parameterResponseSchema.ts +26 -0
  162. package/src/api/parameters/schemas/parameterStatusSchema.ts +13 -0
  163. package/src/api/parameters/schemas/rollbackConfigBodySchema.ts +15 -0
  164. package/src/api/parameters/schemas/statusParamSchema.ts +9 -0
  165. package/src/api/users/__tests__/EmailVerification.spec.ts +369 -0
  166. package/src/api/users/__tests__/PasswordReset.spec.ts +550 -0
  167. package/src/api/users/controllers/AdminIdentityController.spec.ts +365 -0
  168. package/src/api/users/controllers/{IdentityController.ts → AdminIdentityController.ts} +3 -4
  169. package/src/api/users/controllers/AdminSessionController.spec.ts +274 -0
  170. package/src/api/users/controllers/{SessionController.ts → AdminSessionController.ts} +3 -4
  171. package/src/api/users/controllers/AdminUserController.spec.ts +372 -0
  172. package/src/api/users/controllers/AdminUserController.ts +116 -0
  173. package/src/api/users/controllers/UserController.ts +4 -107
  174. package/src/api/users/controllers/UserRealmController.ts +3 -0
  175. package/src/api/users/entities/identities.ts +6 -6
  176. package/src/api/users/entities/sessions.ts +6 -6
  177. package/src/api/users/entities/users.ts +9 -9
  178. package/src/api/users/index.ts +9 -6
  179. package/src/api/users/primitives/$userRealm.ts +13 -8
  180. package/src/api/users/services/CredentialService.spec.ts +509 -0
  181. package/src/api/users/services/CredentialService.ts +46 -0
  182. package/src/api/users/services/IdentityService.ts +15 -0
  183. package/src/api/users/services/RegistrationService.spec.ts +630 -0
  184. package/src/api/users/services/RegistrationService.ts +18 -0
  185. package/src/api/users/services/SessionService.spec.ts +301 -0
  186. package/src/api/users/services/SessionService.ts +110 -1
  187. package/src/api/users/services/UserService.ts +67 -2
  188. package/src/api/verifications/__tests__/CodeVerification.spec.ts +318 -0
  189. package/src/api/verifications/__tests__/LinkVerification.spec.ts +279 -0
  190. package/src/api/verifications/entities/verifications.ts +6 -6
  191. package/src/api/verifications/jobs/VerificationJobs.spec.ts +50 -0
  192. package/src/batch/__tests__/startup-buffering.spec.ts +458 -0
  193. package/src/batch/primitives/$batch.spec.ts +766 -0
  194. package/src/batch/providers/BatchProvider.spec.ts +786 -0
  195. package/src/bin/index.ts +0 -1
  196. package/src/bucket/__tests__/shared.ts +194 -0
  197. package/src/bucket/primitives/$bucket.spec.ts +104 -0
  198. package/src/bucket/providers/FileStorageProvider.spec.ts +13 -0
  199. package/src/bucket/providers/LocalFileStorageProvider.spec.ts +77 -0
  200. package/src/bucket/providers/MemoryFileStorageProvider.spec.ts +82 -0
  201. package/src/cache/core/__tests__/shared.ts +377 -0
  202. package/src/cache/core/primitives/$cache.spec.ts +111 -0
  203. package/src/cache/redis/__tests__/cache-redis.spec.ts +70 -0
  204. package/src/cli/apps/AlephaCli.ts +25 -6
  205. package/src/cli/atoms/buildOptions.ts +88 -0
  206. package/src/cli/commands/build.ts +32 -69
  207. package/src/cli/commands/db.ts +0 -4
  208. package/src/cli/commands/dev.ts +34 -10
  209. package/src/cli/commands/gen/changelog.spec.ts +315 -0
  210. package/src/cli/commands/{changelog.ts → gen/changelog.ts} +9 -9
  211. package/src/cli/commands/gen/env.ts +53 -0
  212. package/src/cli/commands/gen/openapi.ts +71 -0
  213. package/src/cli/commands/gen/resource.ts +15 -0
  214. package/src/cli/commands/gen.ts +24 -0
  215. package/src/cli/commands/init.ts +2 -1
  216. package/src/cli/commands/root.ts +12 -3
  217. package/src/cli/commands/test.ts +0 -1
  218. package/src/cli/commands/typecheck.ts +5 -0
  219. package/src/cli/commands/verify.ts +1 -1
  220. package/src/cli/defineConfig.ts +49 -7
  221. package/src/cli/index.ts +2 -2
  222. package/src/cli/services/AlephaCliUtils.ts +105 -55
  223. package/src/cli/services/GitMessageParser.ts +1 -1
  224. package/src/command/helpers/Asker.spec.ts +127 -0
  225. package/src/command/helpers/Runner.spec.ts +126 -0
  226. package/src/command/helpers/Runner.ts +1 -1
  227. package/src/command/primitives/$command.spec.ts +1588 -0
  228. package/src/command/primitives/$command.ts +0 -6
  229. package/src/command/providers/CliProvider.ts +75 -27
  230. package/src/core/Alepha.ts +87 -0
  231. package/src/core/__tests__/Alepha-emit.spec.ts +22 -0
  232. package/src/core/__tests__/Alepha-graph.spec.ts +93 -0
  233. package/src/core/__tests__/Alepha-has.spec.ts +41 -0
  234. package/src/core/__tests__/Alepha-inject.spec.ts +93 -0
  235. package/src/core/__tests__/Alepha-register.spec.ts +81 -0
  236. package/src/core/__tests__/Alepha-start.spec.ts +176 -0
  237. package/src/core/__tests__/Alepha-with.spec.ts +14 -0
  238. package/src/core/__tests__/TypeBox-usecases.spec.ts +35 -0
  239. package/src/core/__tests__/TypeBoxLocale.spec.ts +15 -0
  240. package/src/core/__tests__/descriptor.spec.ts +34 -0
  241. package/src/core/__tests__/fixtures/A.ts +5 -0
  242. package/src/core/__tests__/pagination.spec.ts +77 -0
  243. package/src/core/helpers/jsonSchemaToTypeBox.ts +2 -2
  244. package/src/core/primitives/$atom.spec.ts +43 -0
  245. package/src/core/primitives/$hook.spec.ts +130 -0
  246. package/src/core/primitives/$inject.spec.ts +175 -0
  247. package/src/core/primitives/$module.spec.ts +115 -0
  248. package/src/core/providers/CodecManager.spec.ts +740 -0
  249. package/src/core/providers/EventManager.spec.ts +762 -0
  250. package/src/core/providers/EventManager.ts +4 -0
  251. package/src/core/providers/StateManager.spec.ts +365 -0
  252. package/src/core/providers/TypeProvider.spec.ts +1607 -0
  253. package/src/core/providers/TypeProvider.ts +20 -26
  254. package/src/datetime/primitives/$interval.spec.ts +103 -0
  255. package/src/datetime/providers/DateTimeProvider.spec.ts +86 -0
  256. package/src/email/primitives/$email.spec.ts +175 -0
  257. package/src/email/providers/LocalEmailProvider.spec.ts +341 -0
  258. package/src/fake/__tests__/keyName.example.ts +40 -0
  259. package/src/fake/__tests__/keyName.spec.ts +152 -0
  260. package/src/fake/__tests__/module.example.ts +32 -0
  261. package/src/fake/providers/FakeProvider.spec.ts +438 -0
  262. package/src/file/providers/FileSystemProvider.ts +8 -0
  263. package/src/file/providers/NodeFileSystemProvider.spec.ts +418 -0
  264. package/src/file/providers/NodeFileSystemProvider.ts +5 -0
  265. package/src/file/services/FileDetector.spec.ts +591 -0
  266. package/src/lock/core/__tests__/shared.ts +190 -0
  267. package/src/lock/core/providers/MemoryLockProvider.spec.ts +25 -0
  268. package/src/lock/redis/providers/RedisLockProvider.spec.ts +25 -0
  269. package/src/logger/__tests__/SimpleFormatterProvider.spec.ts +109 -0
  270. package/src/logger/index.ts +15 -3
  271. package/src/logger/primitives/$logger.spec.ts +108 -0
  272. package/src/logger/services/Logger.spec.ts +295 -0
  273. package/src/mcp/__tests__/errors.spec.ts +175 -0
  274. package/src/mcp/__tests__/integration.spec.ts +450 -0
  275. package/src/mcp/helpers/jsonrpc.spec.ts +380 -0
  276. package/src/mcp/primitives/$prompt.spec.ts +468 -0
  277. package/src/mcp/primitives/$resource.spec.ts +390 -0
  278. package/src/mcp/primitives/$tool.spec.ts +406 -0
  279. package/src/mcp/providers/McpServerProvider.spec.ts +797 -0
  280. package/src/mcp/transports/StdioMcpTransport.ts +1 -1
  281. package/src/orm/__tests__/$repository-crud.spec.ts +276 -0
  282. package/src/orm/__tests__/$repository-hooks.spec.ts +325 -0
  283. package/src/orm/__tests__/$repository-orderBy.spec.ts +128 -0
  284. package/src/orm/__tests__/$repository-pagination-sort.spec.ts +149 -0
  285. package/src/orm/__tests__/$repository-save.spec.ts +37 -0
  286. package/src/orm/__tests__/ModelBuilder-integration.spec.ts +490 -0
  287. package/src/orm/__tests__/ModelBuilder-types.spec.ts +186 -0
  288. package/src/orm/__tests__/PostgresProvider.spec.ts +46 -0
  289. package/src/orm/__tests__/delete-returning.spec.ts +256 -0
  290. package/src/orm/__tests__/deletedAt.spec.ts +80 -0
  291. package/src/orm/__tests__/enums.spec.ts +315 -0
  292. package/src/orm/__tests__/execute.spec.ts +72 -0
  293. package/src/orm/__tests__/fixtures/bigEntitySchema.ts +65 -0
  294. package/src/orm/__tests__/fixtures/userEntitySchema.ts +27 -0
  295. package/src/orm/__tests__/joins.spec.ts +1114 -0
  296. package/src/orm/__tests__/page.spec.ts +287 -0
  297. package/src/orm/__tests__/primaryKey.spec.ts +87 -0
  298. package/src/orm/__tests__/query-date-encoding.spec.ts +402 -0
  299. package/src/orm/__tests__/ref-auto-onDelete.spec.ts +156 -0
  300. package/src/orm/__tests__/references.spec.ts +102 -0
  301. package/src/orm/__tests__/security.spec.ts +710 -0
  302. package/src/orm/__tests__/sqlite.spec.ts +111 -0
  303. package/src/orm/__tests__/string-operators.spec.ts +429 -0
  304. package/src/orm/__tests__/timestamps.spec.ts +388 -0
  305. package/src/orm/__tests__/validation.spec.ts +183 -0
  306. package/src/orm/__tests__/version.spec.ts +64 -0
  307. package/src/orm/helpers/parseQueryString.spec.ts +196 -0
  308. package/src/orm/index.ts +2 -8
  309. package/src/orm/primitives/$repository.spec.ts +137 -0
  310. package/src/orm/primitives/$sequence.spec.ts +29 -0
  311. package/src/orm/primitives/$transaction.spec.ts +82 -0
  312. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -3
  313. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  314. package/src/orm/providers/drivers/CloudflareD1Provider.ts +1 -1
  315. package/src/orm/providers/drivers/DatabaseProvider.ts +1 -1
  316. package/src/orm/providers/drivers/NodePostgresProvider.ts +3 -3
  317. package/src/orm/providers/drivers/NodeSqliteProvider.ts +1 -1
  318. package/src/orm/providers/drivers/PglitePostgresProvider.ts +2 -2
  319. package/src/orm/services/ModelBuilder.spec.ts +575 -0
  320. package/src/orm/services/Repository.spec.ts +137 -0
  321. package/src/queue/core/__tests__/shared.ts +143 -0
  322. package/src/queue/core/providers/MemoryQueueProvider.spec.ts +23 -0
  323. package/src/queue/core/providers/WorkerProvider.spec.ts +394 -0
  324. package/src/queue/redis/providers/RedisQueueProvider.spec.ts +23 -0
  325. package/src/redis/__tests__/redis.spec.ts +58 -0
  326. package/src/retry/primitives/$retry.spec.ts +234 -0
  327. package/src/retry/providers/RetryProvider.spec.ts +438 -0
  328. package/src/router/__tests__/match.spec.ts +252 -0
  329. package/src/router/providers/RouterProvider.spec.ts +197 -0
  330. package/src/scheduler/__tests__/$scheduler-cron.spec.ts +25 -0
  331. package/src/scheduler/__tests__/$scheduler-interval.spec.ts +25 -0
  332. package/src/scheduler/__tests__/shared.ts +77 -0
  333. package/src/security/__tests__/bug-1-wildcard-after-start.spec.ts +229 -0
  334. package/src/security/__tests__/bug-2-password-validation.spec.ts +245 -0
  335. package/src/security/__tests__/bug-3-regex-vulnerability.spec.ts +407 -0
  336. package/src/security/__tests__/bug-4-oauth2-validation.spec.ts +439 -0
  337. package/src/security/__tests__/multi-layer-permissions.spec.ts +522 -0
  338. package/src/security/primitives/$permission.spec.ts +30 -0
  339. package/src/security/primitives/$permission.ts +2 -2
  340. package/src/security/primitives/$realm.spec.ts +101 -0
  341. package/src/security/primitives/$role.spec.ts +52 -0
  342. package/src/security/primitives/$serviceAccount.spec.ts +61 -0
  343. package/src/security/providers/SecurityProvider.spec.ts +350 -0
  344. package/src/server/auth/providers/ServerAuthProvider.ts +0 -2
  345. package/src/server/cache/providers/ServerCacheProvider.spec.ts +1125 -0
  346. package/src/server/cache/providers/ServerCacheProvider.ts +94 -9
  347. package/src/server/compress/providers/ServerCompressProvider.spec.ts +31 -0
  348. package/src/server/compress/providers/ServerCompressProvider.ts +63 -2
  349. package/src/server/cookies/providers/ServerCookiesProvider.spec.ts +253 -0
  350. package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +334 -0
  351. package/src/server/core/__tests__/ServerRouterProvider-requestId.spec.ts +129 -0
  352. package/src/server/core/helpers/ServerReply.ts +2 -2
  353. package/src/server/core/primitives/$action.spec.ts +191 -0
  354. package/src/server/core/primitives/$route.spec.ts +65 -0
  355. package/src/server/core/providers/ServerBodyParserProvider.spec.ts +93 -0
  356. package/src/server/core/providers/ServerLoggerProvider.spec.ts +100 -0
  357. package/src/server/core/providers/ServerProvider.ts +14 -2
  358. package/src/server/core/services/HttpClient.spec.ts +123 -0
  359. package/src/server/core/services/UserAgentParser.spec.ts +111 -0
  360. package/src/server/cors/providers/ServerCorsProvider.spec.ts +481 -0
  361. package/src/server/health/providers/ServerHealthProvider.spec.ts +22 -0
  362. package/src/server/helmet/providers/ServerHelmetProvider.spec.ts +105 -0
  363. package/src/server/links/__tests__/$action.spec.ts +238 -0
  364. package/src/server/links/__tests__/fixtures/CrudApp.ts +122 -0
  365. package/src/server/links/__tests__/requestId.spec.ts +120 -0
  366. package/src/server/links/primitives/$remote.spec.ts +228 -0
  367. package/src/server/links/providers/LinkProvider.spec.ts +54 -0
  368. package/src/server/links/providers/LinkProvider.ts +49 -3
  369. package/src/server/links/providers/ServerLinksProvider.ts +1 -53
  370. package/src/server/links/schemas/apiLinksResponseSchema.ts +7 -0
  371. package/src/server/metrics/providers/ServerMetricsProvider.spec.ts +25 -0
  372. package/src/server/multipart/providers/ServerMultipartProvider.spec.ts +528 -0
  373. package/src/server/proxy/primitives/$proxy.spec.ts +87 -0
  374. package/src/server/rate-limit/__tests__/ActionRateLimit.spec.ts +211 -0
  375. package/src/server/rate-limit/providers/ServerRateLimitProvider.spec.ts +344 -0
  376. package/src/server/security/__tests__/BasicAuth.spec.ts +684 -0
  377. package/src/server/security/__tests__/ServerSecurityProvider-realm.spec.ts +388 -0
  378. package/src/server/security/providers/ServerSecurityProvider.spec.ts +123 -0
  379. package/src/server/static/primitives/$serve.spec.ts +193 -0
  380. package/src/server/static/providers/ServerStaticProvider.ts +10 -0
  381. package/src/server/swagger/__tests__/ui.spec.ts +52 -0
  382. package/src/server/swagger/primitives/$swagger.spec.ts +193 -0
  383. package/src/server/swagger/providers/ServerSwaggerProvider.ts +19 -12
  384. package/src/sms/primitives/$sms.spec.ts +165 -0
  385. package/src/sms/providers/LocalSmsProvider.spec.ts +224 -0
  386. package/src/sms/providers/MemorySmsProvider.spec.ts +193 -0
  387. package/src/thread/primitives/$thread.spec.ts +186 -0
  388. package/src/topic/core/__tests__/shared.ts +144 -0
  389. package/src/topic/core/providers/MemoryTopicProvider.spec.ts +23 -0
  390. package/src/topic/redis/providers/RedisTopicProvider.spec.ts +23 -0
  391. package/src/vite/helpers/importViteReact.ts +13 -0
  392. package/src/vite/index.ts +1 -21
  393. package/src/vite/plugins/viteAlephaDev.ts +32 -5
  394. package/src/vite/plugins/viteAlephaSsrPreload.ts +222 -0
  395. package/src/vite/tasks/buildClient.ts +11 -0
  396. package/src/vite/tasks/buildServer.ts +47 -3
  397. package/src/vite/tasks/devServer.ts +69 -0
  398. package/src/vite/tasks/index.ts +2 -1
  399. package/src/vite/tasks/runAlepha.ts +7 -1
  400. package/src/websocket/__tests__/$websocket-new.spec.ts +195 -0
  401. package/src/websocket/primitives/$channel.spec.ts +30 -0
  402. package/src/cli/assets/viteConfigTs.ts +0 -14
  403. package/src/cli/commands/run.ts +0 -24
  404. package/src/vite/plugins/viteAlepha.ts +0 -37
  405. package/src/vite/plugins/viteAlephaBuild.ts +0 -281
@@ -1,245 +1,566 @@
1
- import * as alepha349 from "alepha";
1
+ import * as alepha587 from "alepha";
2
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
3
  import * as alepha_server0 from "alepha/server";
6
4
  import { ServerRequest } from "alepha/server";
5
+ import * as alepha_orm12 from "alepha/orm";
6
+ import { Page } from "alepha/orm";
7
7
  import * as alepha_logger0 from "alepha/logger";
8
- import "bun";
9
- import "bun:sqlite";
10
- import "drizzle-orm/bun-sql";
11
- import "drizzle-orm/bun-sqlite";
12
8
  import "drizzle-orm/d1";
13
9
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
14
10
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
15
11
  import "alepha/datetime";
16
12
  import "alepha/retry";
17
- import "alepha/lock";
18
13
  import "drizzle-orm/sqlite-core";
14
+ import "alepha/lock";
19
15
  import "drizzle-orm/postgres-js";
20
16
  import "postgres";
21
17
 
22
- //#region ../../src/api/audits/entities/audits.d.ts
18
+ //#region ../../src/orm/schemas/insertSchema.d.ts
23
19
  /**
24
- * Audit severity levels for categorizing events.
20
+ * Transforms a TObject schema for insert operations.
21
+ * All default properties at the root level are made optional.
22
+ *
23
+ * @example
24
+ * Before: { name: string; age: number(default=0); }
25
+ * After: { name: string; age?: number; }
25
26
  */
26
- declare const auditSeveritySchema: alepha349.TUnsafe<"info" | "warning" | "critical">;
27
- type AuditSeverity = Static<typeof auditSeveritySchema>;
27
+ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends {
28
+ [PG_DEFAULT]: any;
29
+ } | {
30
+ "~optional": true;
31
+ } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
32
+ //#endregion
33
+ //#region ../../src/orm/schemas/updateSchema.d.ts
28
34
  /**
29
- * Audit log entity for tracking important system events.
35
+ * Transforms a TObject schema for update operations.
36
+ * All optional properties at the root level are made nullable (i.e., `T | null`).
37
+ * This allows an API endpoint to explicitly accept `null` to clear an optional field in the database.
30
38
  *
31
- * Stores comprehensive audit information including:
32
- * - Who performed the action (userId, userRealm)
33
- * - What happened (type, action, resource)
34
- * - When it happened (createdAt)
35
- * - Context and details (metadata, ipAddress, userAgent)
39
+ * @example
40
+ * Before: { name?: string; age: number; }
41
+ * After: { name?: string | null; age: number; }
36
42
  */
37
- declare const audits: alepha_orm71.EntityPrimitive<alepha349.TObject<{
38
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
39
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
40
- /**
41
- * Audit event type (e.g., "auth", "user", "payment", "system").
42
- * Used for categorizing and filtering audit events.
43
- */
44
- type: alepha349.TString;
45
- /**
46
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
47
- */
48
- action: alepha349.TString;
49
- /**
50
- * Severity level of the event.
51
- */
52
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
53
- /**
54
- * User ID who performed the action (null for system events).
55
- */
56
- userId: alepha349.TOptional<alepha349.TString>;
57
- /**
58
- * User realm for multi-tenant support.
59
- */
60
- userRealm: alepha349.TOptional<alepha349.TString>;
61
- /**
62
- * User email at the time of the event (denormalized for history).
63
- */
64
- userEmail: alepha349.TOptional<alepha349.TString>;
65
- /**
66
- * Resource type affected (e.g., "user", "order", "file").
67
- */
68
- resourceType: alepha349.TOptional<alepha349.TString>;
43
+ 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] }>;
44
+ //#endregion
45
+ //#region ../../src/orm/primitives/$entity.d.ts
46
+ interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
69
47
  /**
70
- * Resource ID affected.
48
+ * The database table name that will be created for this entity.
49
+ * If not provided, name will be inferred from the $repository variable name.
71
50
  */
72
- resourceId: alepha349.TOptional<alepha349.TString>;
51
+ name: string;
73
52
  /**
74
- * Human-readable description of the event.
53
+ * TypeBox schema defining the table structure and column types.
75
54
  */
76
- description: alepha349.TOptional<alepha349.TString>;
55
+ schema: T;
77
56
  /**
78
- * Additional metadata/context as JSON.
57
+ * Database indexes to create for query optimization.
79
58
  */
80
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
59
+ indexes?: (Keys | {
60
+ /**
61
+ * Single column to index.
62
+ */
63
+ column: Keys;
64
+ /**
65
+ * Whether this should be a unique index (enforces uniqueness constraint).
66
+ */
67
+ unique?: boolean;
68
+ /**
69
+ * Custom name for the index. If not provided, generates name automatically.
70
+ */
71
+ name?: string;
72
+ } | {
73
+ /**
74
+ * Multiple columns for composite index (order matters for query optimization).
75
+ */
76
+ columns: Keys[];
77
+ /**
78
+ * Whether this should be a unique index (enforces uniqueness constraint).
79
+ */
80
+ unique?: boolean;
81
+ /**
82
+ * Custom name for the index. If not provided, generates name automatically.
83
+ */
84
+ name?: string;
85
+ })[];
81
86
  /**
82
- * Client IP address.
87
+ * Foreign key constraints to maintain referential integrity.
83
88
  */
84
- ipAddress: alepha349.TOptional<alepha349.TString>;
89
+ foreignKeys?: Array<{
90
+ /**
91
+ * Optional name for the foreign key constraint.
92
+ */
93
+ name?: string;
94
+ /**
95
+ * Local columns that reference the foreign table.
96
+ */
97
+ columns: Array<keyof Static<T>>;
98
+ /**
99
+ * Referenced columns in the foreign table.
100
+ * Must be EntityColumn references from other entities.
101
+ */
102
+ foreignColumns: Array<() => EntityColumn<any>>;
103
+ }>;
85
104
  /**
86
- * Client user agent.
105
+ * Additional table constraints for data validation.
106
+ *
107
+ * Constraints enforce business rules at the database level, providing
108
+ * an additional layer of data integrity beyond application validation.
109
+ *
110
+ * **Constraint Types**:
111
+ * - **Unique constraints**: Prevent duplicate values across columns
112
+ * - **Check constraints**: Enforce custom validation rules with SQL expressions
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * constraints: [
117
+ * {
118
+ * name: "unique_user_email",
119
+ * columns: ["email"],
120
+ * unique: true
121
+ * },
122
+ * {
123
+ * name: "valid_age_range",
124
+ * columns: ["age"],
125
+ * check: sql`age >= 0 AND age <= 150`
126
+ * },
127
+ * {
128
+ * name: "unique_user_username_per_tenant",
129
+ * columns: ["tenantId", "username"],
130
+ * unique: true
131
+ * }
132
+ * ]
133
+ * ```
87
134
  */
88
- userAgent: alepha349.TOptional<alepha349.TString>;
135
+ constraints?: Array<{
136
+ /**
137
+ * Columns involved in this constraint.
138
+ */
139
+ columns: Array<keyof Static<T>>;
140
+ /**
141
+ * Optional name for the constraint.
142
+ */
143
+ name?: string;
144
+ /**
145
+ * Whether this is a unique constraint.
146
+ */
147
+ unique?: boolean | {};
148
+ /**
149
+ * SQL expression for check constraint validation.
150
+ */
151
+ check?: SQL;
152
+ }>;
89
153
  /**
90
- * Session ID if applicable.
154
+ * Advanced Drizzle ORM configuration for complex table setups.
91
155
  */
92
- sessionId: alepha349.TOptional<alepha349.TString>;
156
+ config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
157
+ }
158
+ declare class EntityPrimitive<T extends TObject = TObject> {
159
+ readonly options: EntityPrimitiveOptions<T>;
160
+ constructor(options: EntityPrimitiveOptions<T>);
161
+ alias(alias: string): this;
162
+ get cols(): EntityColumns<T>;
163
+ get name(): string;
164
+ get schema(): T;
165
+ get insertSchema(): TObjectInsert<T>;
166
+ get updateSchema(): TObjectUpdate<T>;
167
+ }
168
+ /**
169
+ * Convert a schema to columns.
170
+ */
171
+ type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
172
+ type EntityColumn<T extends TObject> = {
173
+ name: string;
174
+ entity: EntityPrimitive<T>;
175
+ };
176
+ type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
177
+ //#endregion
178
+ //#region ../../src/orm/constants/PG_SYMBOLS.d.ts
179
+ declare const PG_DEFAULT: unique symbol;
180
+ declare const PG_PRIMARY_KEY: unique symbol;
181
+ declare const PG_CREATED_AT: unique symbol;
182
+ declare const PG_UPDATED_AT: unique symbol;
183
+ declare const PG_DELETED_AT: unique symbol;
184
+ declare const PG_VERSION: unique symbol;
185
+ declare const PG_IDENTITY: unique symbol;
186
+ declare const PG_ENUM: unique symbol;
187
+ declare const PG_REF: unique symbol;
188
+ /**
189
+ * @deprecated Use `PG_IDENTITY` instead.
190
+ */
191
+ declare const PG_SERIAL: unique symbol;
192
+ type PgSymbols = {
193
+ [PG_DEFAULT]: {};
194
+ [PG_PRIMARY_KEY]: {};
195
+ [PG_CREATED_AT]: {};
196
+ [PG_UPDATED_AT]: {};
197
+ [PG_DELETED_AT]: {};
198
+ [PG_VERSION]: {};
199
+ [PG_IDENTITY]: PgIdentityOptions;
200
+ [PG_REF]: PgRefOptions;
201
+ [PG_ENUM]: PgEnumOptions;
93
202
  /**
94
- * Request ID for correlation.
203
+ * @deprecated Use `PG_IDENTITY` instead.
95
204
  */
96
- requestId: alepha349.TOptional<alepha349.TString>;
205
+ [PG_SERIAL]: {};
206
+ };
207
+ type PgSymbolKeys = keyof PgSymbols;
208
+ type PgIdentityOptions = {
209
+ mode: "always" | "byDefault";
210
+ } & PgSequenceOptions & {
211
+ name?: string;
212
+ };
213
+ interface PgEnumOptions {
214
+ name?: string;
215
+ description?: string;
216
+ }
217
+ interface PgRefOptions {
218
+ ref: () => {
219
+ name: string;
220
+ entity: EntityPrimitive;
221
+ };
222
+ actions?: {
223
+ onUpdate?: UpdateDeleteAction;
224
+ onDelete?: UpdateDeleteAction;
225
+ };
226
+ }
227
+ //#endregion
228
+ //#region ../../src/orm/helpers/pgAttr.d.ts
229
+ /**
230
+ * Type representation.
231
+ */
232
+ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
233
+ //#endregion
234
+ //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
235
+ declare module "alepha" {
236
+ interface Env extends Partial<Static<typeof envSchema>> {}
237
+ }
238
+ declare const envSchema: alepha587.TObject<{
97
239
  /**
98
- * Whether the action was successful.
240
+ * Main configuration for database connection.
241
+ * Accept a string in the format of a Postgres connection URL.
242
+ * Example: postgres://user:password@localhost:5432/database
243
+ * or
244
+ * Example: postgres://user:password@localhost:5432/database?sslmode=require
99
245
  */
100
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
246
+ DATABASE_URL: alepha587.TOptional<alepha587.TString>;
101
247
  /**
102
- * Error message if the action failed.
248
+ * In addition to the DATABASE_URL, you can specify the postgres schema name.
249
+ *
250
+ * It will monkey patch drizzle tables.
103
251
  */
104
- errorMessage: alepha349.TOptional<alepha349.TString>;
105
- }>>;
106
- declare const auditEntitySchema: alepha349.TObject<{
107
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
108
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
109
- /**
110
- * Audit event type (e.g., "auth", "user", "payment", "system").
252
+ POSTGRES_SCHEMA: alepha587.TOptional<alepha587.TString>;
253
+ }>;
254
+ //#endregion
255
+ //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
256
+ /**
257
+ * Configuration options for the Node.js SQLite database provider.
258
+ */
259
+ declare const nodeSqliteOptions: alepha587.Atom<alepha587.TObject<{
260
+ path: alepha587.TOptional<alepha587.TString>;
261
+ }>, "alepha.postgres.node-sqlite.options">;
262
+ type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
263
+ declare module "alepha" {
264
+ interface State {
265
+ [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
266
+ }
267
+ }
268
+ /**
269
+ * Add a fake support for SQLite in Node.js based on Postgres interfaces.
270
+ *
271
+ * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
272
+ * This is NOT recommended for production use.
273
+ */
274
+ //#endregion
275
+ //#region ../../src/orm/index.d.ts
276
+ declare module "alepha" {
277
+ interface Hooks {
278
+ /**
279
+ * Fires before creating an entity in the repository.
280
+ */
281
+ "repository:create:before": {
282
+ tableName: string;
283
+ data: any;
284
+ };
285
+ /**
286
+ * Fires after creating an entity in the repository.
287
+ */
288
+ "repository:create:after": {
289
+ tableName: string;
290
+ data: any;
291
+ entity: any;
292
+ };
293
+ /**
294
+ * Fires before updating entities in the repository.
295
+ */
296
+ "repository:update:before": {
297
+ tableName: string;
298
+ where: any;
299
+ data: any;
300
+ };
301
+ /**
302
+ * Fires after updating entities in the repository.
303
+ */
304
+ "repository:update:after": {
305
+ tableName: string;
306
+ where: any;
307
+ data: any;
308
+ entities: any[];
309
+ };
310
+ /**
311
+ * Fires before deleting entities from the repository.
312
+ */
313
+ "repository:delete:before": {
314
+ tableName: string;
315
+ where: any;
316
+ };
317
+ /**
318
+ * Fires after deleting entities from the repository.
319
+ */
320
+ "repository:delete:after": {
321
+ tableName: string;
322
+ where: any;
323
+ ids: Array<string | number>;
324
+ };
325
+ /**
326
+ * Fires before reading entities from the repository.
327
+ */
328
+ "repository:read:before": {
329
+ tableName: string;
330
+ query: any;
331
+ };
332
+ /**
333
+ * Fires after reading entities from the repository.
334
+ */
335
+ "repository:read:after": {
336
+ tableName: string;
337
+ query: any;
338
+ entities: any[];
339
+ };
340
+ }
341
+ }
342
+ //#endregion
343
+ //#region ../../src/api/audits/entities/audits.d.ts
344
+ /**
345
+ * Audit severity levels for categorizing events.
346
+ */
347
+ declare const auditSeveritySchema: alepha587.TUnsafe<"info" | "warning" | "critical">;
348
+ type AuditSeverity = Static<typeof auditSeveritySchema>;
349
+ /**
350
+ * Audit log entity for tracking important system events.
351
+ *
352
+ * Stores comprehensive audit information including:
353
+ * - Who performed the action (userId, userRealm)
354
+ * - What happened (type, action, resource)
355
+ * - When it happened (createdAt)
356
+ * - Context and details (metadata, ipAddress, userAgent)
357
+ */
358
+ declare const audits: alepha_orm12.EntityPrimitive<alepha587.TObject<{
359
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
360
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
361
+ /**
362
+ * Audit event type (e.g., "auth", "user", "payment", "system").
363
+ * Used for categorizing and filtering audit events.
364
+ */
365
+ type: alepha587.TString;
366
+ /**
367
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
368
+ */
369
+ action: alepha587.TString;
370
+ /**
371
+ * Severity level of the event.
372
+ */
373
+ severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
374
+ /**
375
+ * User ID who performed the action (null for system events).
376
+ */
377
+ userId: alepha587.TOptional<alepha587.TString>;
378
+ /**
379
+ * User realm for multi-tenant support.
380
+ */
381
+ userRealm: alepha587.TOptional<alepha587.TString>;
382
+ /**
383
+ * User email at the time of the event (denormalized for history).
384
+ */
385
+ userEmail: alepha587.TOptional<alepha587.TString>;
386
+ /**
387
+ * Resource type affected (e.g., "user", "order", "file").
388
+ */
389
+ resourceType: alepha587.TOptional<alepha587.TString>;
390
+ /**
391
+ * Resource ID affected.
392
+ */
393
+ resourceId: alepha587.TOptional<alepha587.TString>;
394
+ /**
395
+ * Human-readable description of the event.
396
+ */
397
+ description: alepha587.TOptional<alepha587.TString>;
398
+ /**
399
+ * Additional metadata/context as JSON.
400
+ */
401
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
402
+ /**
403
+ * Client IP address.
404
+ */
405
+ ipAddress: alepha587.TOptional<alepha587.TString>;
406
+ /**
407
+ * Client user agent.
408
+ */
409
+ userAgent: alepha587.TOptional<alepha587.TString>;
410
+ /**
411
+ * Session ID if applicable.
412
+ */
413
+ sessionId: alepha587.TOptional<alepha587.TString>;
414
+ /**
415
+ * Request ID for correlation.
416
+ */
417
+ requestId: alepha587.TOptional<alepha587.TString>;
418
+ /**
419
+ * Whether the action was successful.
420
+ */
421
+ success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
422
+ /**
423
+ * Error message if the action failed.
424
+ */
425
+ errorMessage: alepha587.TOptional<alepha587.TString>;
426
+ }>>;
427
+ declare const auditEntitySchema: alepha587.TObject<{
428
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
429
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
430
+ /**
431
+ * Audit event type (e.g., "auth", "user", "payment", "system").
111
432
  * Used for categorizing and filtering audit events.
112
433
  */
113
- type: alepha349.TString;
434
+ type: alepha587.TString;
114
435
  /**
115
436
  * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
116
437
  */
117
- action: alepha349.TString;
438
+ action: alepha587.TString;
118
439
  /**
119
440
  * Severity level of the event.
120
441
  */
121
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
442
+ severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
122
443
  /**
123
444
  * User ID who performed the action (null for system events).
124
445
  */
125
- userId: alepha349.TOptional<alepha349.TString>;
446
+ userId: alepha587.TOptional<alepha587.TString>;
126
447
  /**
127
448
  * User realm for multi-tenant support.
128
449
  */
129
- userRealm: alepha349.TOptional<alepha349.TString>;
450
+ userRealm: alepha587.TOptional<alepha587.TString>;
130
451
  /**
131
452
  * User email at the time of the event (denormalized for history).
132
453
  */
133
- userEmail: alepha349.TOptional<alepha349.TString>;
454
+ userEmail: alepha587.TOptional<alepha587.TString>;
134
455
  /**
135
456
  * Resource type affected (e.g., "user", "order", "file").
136
457
  */
137
- resourceType: alepha349.TOptional<alepha349.TString>;
458
+ resourceType: alepha587.TOptional<alepha587.TString>;
138
459
  /**
139
460
  * Resource ID affected.
140
461
  */
141
- resourceId: alepha349.TOptional<alepha349.TString>;
462
+ resourceId: alepha587.TOptional<alepha587.TString>;
142
463
  /**
143
464
  * Human-readable description of the event.
144
465
  */
145
- description: alepha349.TOptional<alepha349.TString>;
466
+ description: alepha587.TOptional<alepha587.TString>;
146
467
  /**
147
468
  * Additional metadata/context as JSON.
148
469
  */
149
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
470
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
150
471
  /**
151
472
  * Client IP address.
152
473
  */
153
- ipAddress: alepha349.TOptional<alepha349.TString>;
474
+ ipAddress: alepha587.TOptional<alepha587.TString>;
154
475
  /**
155
476
  * Client user agent.
156
477
  */
157
- userAgent: alepha349.TOptional<alepha349.TString>;
478
+ userAgent: alepha587.TOptional<alepha587.TString>;
158
479
  /**
159
480
  * Session ID if applicable.
160
481
  */
161
- sessionId: alepha349.TOptional<alepha349.TString>;
482
+ sessionId: alepha587.TOptional<alepha587.TString>;
162
483
  /**
163
484
  * Request ID for correlation.
164
485
  */
165
- requestId: alepha349.TOptional<alepha349.TString>;
486
+ requestId: alepha587.TOptional<alepha587.TString>;
166
487
  /**
167
488
  * Whether the action was successful.
168
489
  */
169
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
490
+ success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
170
491
  /**
171
492
  * Error message if the action failed.
172
493
  */
173
- errorMessage: alepha349.TOptional<alepha349.TString>;
494
+ errorMessage: alepha587.TOptional<alepha587.TString>;
174
495
  }>;
175
- declare const auditEntityInsertSchema: alepha_orm71.TObjectInsert<alepha349.TObject<{
176
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
177
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
496
+ declare const auditEntityInsertSchema: alepha_orm12.TObjectInsert<alepha587.TObject<{
497
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
498
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
178
499
  /**
179
500
  * Audit event type (e.g., "auth", "user", "payment", "system").
180
501
  * Used for categorizing and filtering audit events.
181
502
  */
182
- type: alepha349.TString;
503
+ type: alepha587.TString;
183
504
  /**
184
505
  * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
185
506
  */
186
- action: alepha349.TString;
507
+ action: alepha587.TString;
187
508
  /**
188
509
  * Severity level of the event.
189
510
  */
190
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
511
+ severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
191
512
  /**
192
513
  * User ID who performed the action (null for system events).
193
514
  */
194
- userId: alepha349.TOptional<alepha349.TString>;
515
+ userId: alepha587.TOptional<alepha587.TString>;
195
516
  /**
196
517
  * User realm for multi-tenant support.
197
518
  */
198
- userRealm: alepha349.TOptional<alepha349.TString>;
519
+ userRealm: alepha587.TOptional<alepha587.TString>;
199
520
  /**
200
521
  * User email at the time of the event (denormalized for history).
201
522
  */
202
- userEmail: alepha349.TOptional<alepha349.TString>;
523
+ userEmail: alepha587.TOptional<alepha587.TString>;
203
524
  /**
204
525
  * Resource type affected (e.g., "user", "order", "file").
205
526
  */
206
- resourceType: alepha349.TOptional<alepha349.TString>;
527
+ resourceType: alepha587.TOptional<alepha587.TString>;
207
528
  /**
208
529
  * Resource ID affected.
209
530
  */
210
- resourceId: alepha349.TOptional<alepha349.TString>;
531
+ resourceId: alepha587.TOptional<alepha587.TString>;
211
532
  /**
212
533
  * Human-readable description of the event.
213
534
  */
214
- description: alepha349.TOptional<alepha349.TString>;
535
+ description: alepha587.TOptional<alepha587.TString>;
215
536
  /**
216
537
  * Additional metadata/context as JSON.
217
538
  */
218
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
539
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
219
540
  /**
220
541
  * Client IP address.
221
542
  */
222
- ipAddress: alepha349.TOptional<alepha349.TString>;
543
+ ipAddress: alepha587.TOptional<alepha587.TString>;
223
544
  /**
224
545
  * Client user agent.
225
546
  */
226
- userAgent: alepha349.TOptional<alepha349.TString>;
547
+ userAgent: alepha587.TOptional<alepha587.TString>;
227
548
  /**
228
549
  * Session ID if applicable.
229
550
  */
230
- sessionId: alepha349.TOptional<alepha349.TString>;
551
+ sessionId: alepha587.TOptional<alepha587.TString>;
231
552
  /**
232
553
  * Request ID for correlation.
233
554
  */
234
- requestId: alepha349.TOptional<alepha349.TString>;
555
+ requestId: alepha587.TOptional<alepha587.TString>;
235
556
  /**
236
557
  * Whether the action was successful.
237
558
  */
238
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
559
+ success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
239
560
  /**
240
561
  * Error message if the action failed.
241
562
  */
242
- errorMessage: alepha349.TOptional<alepha349.TString>;
563
+ errorMessage: alepha587.TOptional<alepha587.TString>;
243
564
  }>>;
244
565
  type AuditEntity = Static<typeof audits.schema>;
245
566
  //#endregion
@@ -247,21 +568,21 @@ type AuditEntity = Static<typeof audits.schema>;
247
568
  /**
248
569
  * Query schema for searching and filtering audit logs.
249
570
  */
250
- declare const auditQuerySchema: alepha349.TObject<{
251
- page: alepha349.TOptional<alepha349.TInteger>;
252
- size: alepha349.TOptional<alepha349.TInteger>;
253
- sort: alepha349.TOptional<alepha349.TString>;
254
- type: alepha349.TOptional<alepha349.TString>;
255
- action: alepha349.TOptional<alepha349.TString>;
256
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
257
- userId: alepha349.TOptional<alepha349.TString>;
258
- userRealm: alepha349.TOptional<alepha349.TString>;
259
- resourceType: alepha349.TOptional<alepha349.TString>;
260
- resourceId: alepha349.TOptional<alepha349.TString>;
261
- success: alepha349.TOptional<alepha349.TBoolean>;
262
- from: alepha349.TOptional<alepha349.TString>;
263
- to: alepha349.TOptional<alepha349.TString>;
264
- search: alepha349.TOptional<alepha349.TString>;
571
+ declare const auditQuerySchema: alepha587.TObject<{
572
+ page: alepha587.TOptional<alepha587.TInteger>;
573
+ size: alepha587.TOptional<alepha587.TInteger>;
574
+ sort: alepha587.TOptional<alepha587.TString>;
575
+ type: alepha587.TOptional<alepha587.TString>;
576
+ action: alepha587.TOptional<alepha587.TString>;
577
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
578
+ userId: alepha587.TOptional<alepha587.TString>;
579
+ userRealm: alepha587.TOptional<alepha587.TString>;
580
+ resourceType: alepha587.TOptional<alepha587.TString>;
581
+ resourceId: alepha587.TOptional<alepha587.TString>;
582
+ success: alepha587.TOptional<alepha587.TBoolean>;
583
+ from: alepha587.TOptional<alepha587.TString>;
584
+ to: alepha587.TOptional<alepha587.TString>;
585
+ search: alepha587.TOptional<alepha587.TString>;
265
586
  }>;
266
587
  type AuditQuery = Static<typeof auditQuerySchema>;
267
588
  //#endregion
@@ -269,23 +590,23 @@ type AuditQuery = Static<typeof auditQuerySchema>;
269
590
  /**
270
591
  * Schema for creating a new audit log entry.
271
592
  */
272
- declare const createAuditSchema: alepha349.TObject<{
273
- type: alepha349.TString;
274
- action: alepha349.TString;
275
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
276
- userId: alepha349.TOptional<alepha349.TString>;
277
- userRealm: alepha349.TOptional<alepha349.TString>;
278
- userEmail: alepha349.TOptional<alepha349.TString>;
279
- resourceType: alepha349.TOptional<alepha349.TString>;
280
- resourceId: alepha349.TOptional<alepha349.TString>;
281
- description: alepha349.TOptional<alepha349.TString>;
282
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
283
- ipAddress: alepha349.TOptional<alepha349.TString>;
284
- userAgent: alepha349.TOptional<alepha349.TString>;
285
- sessionId: alepha349.TOptional<alepha349.TString>;
286
- requestId: alepha349.TOptional<alepha349.TString>;
287
- success: alepha349.TOptional<alepha349.TBoolean>;
288
- errorMessage: alepha349.TOptional<alepha349.TString>;
593
+ declare const createAuditSchema: alepha587.TObject<{
594
+ type: alepha587.TString;
595
+ action: alepha587.TString;
596
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
597
+ userId: alepha587.TOptional<alepha587.TString>;
598
+ userRealm: alepha587.TOptional<alepha587.TString>;
599
+ userEmail: alepha587.TOptional<alepha587.TString>;
600
+ resourceType: alepha587.TOptional<alepha587.TString>;
601
+ resourceId: alepha587.TOptional<alepha587.TString>;
602
+ description: alepha587.TOptional<alepha587.TString>;
603
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
604
+ ipAddress: alepha587.TOptional<alepha587.TString>;
605
+ userAgent: alepha587.TOptional<alepha587.TString>;
606
+ sessionId: alepha587.TOptional<alepha587.TString>;
607
+ requestId: alepha587.TOptional<alepha587.TString>;
608
+ success: alepha587.TOptional<alepha587.TBoolean>;
609
+ errorMessage: alepha587.TOptional<alepha587.TString>;
289
610
  }>;
290
611
  type CreateAudit = Static<typeof createAuditSchema>;
291
612
  //#endregion
@@ -310,25 +631,25 @@ interface AuditTypeDefinition {
310
631
  declare class AuditService {
311
632
  protected readonly alepha: Alepha;
312
633
  protected readonly log: alepha_logger0.Logger;
313
- protected readonly repo: alepha_orm71.Repository<alepha349.TObject<{
314
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
315
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
316
- type: alepha349.TString;
317
- action: alepha349.TString;
318
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
319
- userId: alepha349.TOptional<alepha349.TString>;
320
- userRealm: alepha349.TOptional<alepha349.TString>;
321
- userEmail: alepha349.TOptional<alepha349.TString>;
322
- resourceType: alepha349.TOptional<alepha349.TString>;
323
- resourceId: alepha349.TOptional<alepha349.TString>;
324
- description: alepha349.TOptional<alepha349.TString>;
325
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
326
- ipAddress: alepha349.TOptional<alepha349.TString>;
327
- userAgent: alepha349.TOptional<alepha349.TString>;
328
- sessionId: alepha349.TOptional<alepha349.TString>;
329
- requestId: alepha349.TOptional<alepha349.TString>;
330
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
331
- errorMessage: alepha349.TOptional<alepha349.TString>;
634
+ protected readonly repo: alepha_orm12.Repository<alepha587.TObject<{
635
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
636
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
637
+ type: alepha587.TString;
638
+ action: alepha587.TString;
639
+ severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
640
+ userId: alepha587.TOptional<alepha587.TString>;
641
+ userRealm: alepha587.TOptional<alepha587.TString>;
642
+ userEmail: alepha587.TOptional<alepha587.TString>;
643
+ resourceType: alepha587.TOptional<alepha587.TString>;
644
+ resourceId: alepha587.TOptional<alepha587.TString>;
645
+ description: alepha587.TOptional<alepha587.TString>;
646
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
647
+ ipAddress: alepha587.TOptional<alepha587.TString>;
648
+ userAgent: alepha587.TOptional<alepha587.TString>;
649
+ sessionId: alepha587.TOptional<alepha587.TString>;
650
+ requestId: alepha587.TOptional<alepha587.TString>;
651
+ success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
652
+ errorMessage: alepha587.TOptional<alepha587.TString>;
332
653
  }>>;
333
654
  /**
334
655
  * Registry of audit types and their allowed actions.
@@ -415,7 +736,7 @@ interface AuditStats {
415
736
  recentFailures: AuditEntity[];
416
737
  }
417
738
  //#endregion
418
- //#region ../../src/api/audits/controllers/AuditController.d.ts
739
+ //#region ../../src/api/audits/controllers/AdminAuditController.d.ts
419
740
  /**
420
741
  * REST API controller for audit log management.
421
742
  *
@@ -425,245 +746,245 @@ interface AuditStats {
425
746
  * - Getting audit statistics
426
747
  * - Viewing registered audit types
427
748
  */
428
- declare class AuditController {
749
+ declare class AdminAuditController {
429
750
  protected readonly url = "/audits";
430
- protected readonly group = "audits";
751
+ protected readonly group = "admin:audits";
431
752
  protected readonly auditService: AuditService;
432
753
  /**
433
754
  * Find audit entries with filtering and pagination.
434
755
  */
435
756
  readonly findAudits: alepha_server0.ActionPrimitiveFn<{
436
- query: alepha349.TObject<{
437
- page: alepha349.TOptional<alepha349.TInteger>;
438
- size: alepha349.TOptional<alepha349.TInteger>;
439
- sort: alepha349.TOptional<alepha349.TString>;
440
- type: alepha349.TOptional<alepha349.TString>;
441
- action: alepha349.TOptional<alepha349.TString>;
442
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
443
- userId: alepha349.TOptional<alepha349.TString>;
444
- userRealm: alepha349.TOptional<alepha349.TString>;
445
- resourceType: alepha349.TOptional<alepha349.TString>;
446
- resourceId: alepha349.TOptional<alepha349.TString>;
447
- success: alepha349.TOptional<alepha349.TBoolean>;
448
- from: alepha349.TOptional<alepha349.TString>;
449
- to: alepha349.TOptional<alepha349.TString>;
450
- search: alepha349.TOptional<alepha349.TString>;
757
+ query: alepha587.TObject<{
758
+ page: alepha587.TOptional<alepha587.TInteger>;
759
+ size: alepha587.TOptional<alepha587.TInteger>;
760
+ sort: alepha587.TOptional<alepha587.TString>;
761
+ type: alepha587.TOptional<alepha587.TString>;
762
+ action: alepha587.TOptional<alepha587.TString>;
763
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
764
+ userId: alepha587.TOptional<alepha587.TString>;
765
+ userRealm: alepha587.TOptional<alepha587.TString>;
766
+ resourceType: alepha587.TOptional<alepha587.TString>;
767
+ resourceId: alepha587.TOptional<alepha587.TString>;
768
+ success: alepha587.TOptional<alepha587.TBoolean>;
769
+ from: alepha587.TOptional<alepha587.TString>;
770
+ to: alepha587.TOptional<alepha587.TString>;
771
+ search: alepha587.TOptional<alepha587.TString>;
451
772
  }>;
452
- response: alepha349.TPage<alepha349.TObject<{
453
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
454
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
455
- type: alepha349.TString;
456
- action: alepha349.TString;
457
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
458
- userId: alepha349.TOptional<alepha349.TString>;
459
- userRealm: alepha349.TOptional<alepha349.TString>;
460
- userEmail: alepha349.TOptional<alepha349.TString>;
461
- resourceType: alepha349.TOptional<alepha349.TString>;
462
- resourceId: alepha349.TOptional<alepha349.TString>;
463
- description: alepha349.TOptional<alepha349.TString>;
464
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
465
- ipAddress: alepha349.TOptional<alepha349.TString>;
466
- userAgent: alepha349.TOptional<alepha349.TString>;
467
- sessionId: alepha349.TOptional<alepha349.TString>;
468
- requestId: alepha349.TOptional<alepha349.TString>;
469
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
470
- errorMessage: alepha349.TOptional<alepha349.TString>;
773
+ response: alepha587.TPage<alepha587.TObject<{
774
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
775
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
776
+ type: alepha587.TString;
777
+ action: alepha587.TString;
778
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
779
+ userId: alepha587.TOptional<alepha587.TString>;
780
+ userRealm: alepha587.TOptional<alepha587.TString>;
781
+ userEmail: alepha587.TOptional<alepha587.TString>;
782
+ resourceType: alepha587.TOptional<alepha587.TString>;
783
+ resourceId: alepha587.TOptional<alepha587.TString>;
784
+ description: alepha587.TOptional<alepha587.TString>;
785
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
786
+ ipAddress: alepha587.TOptional<alepha587.TString>;
787
+ userAgent: alepha587.TOptional<alepha587.TString>;
788
+ sessionId: alepha587.TOptional<alepha587.TString>;
789
+ requestId: alepha587.TOptional<alepha587.TString>;
790
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
791
+ errorMessage: alepha587.TOptional<alepha587.TString>;
471
792
  }>>;
472
793
  }>;
473
794
  /**
474
795
  * Get a single audit entry by ID.
475
796
  */
476
797
  readonly getAudit: alepha_server0.ActionPrimitiveFn<{
477
- params: alepha349.TObject<{
478
- id: alepha349.TString;
798
+ params: alepha587.TObject<{
799
+ id: alepha587.TString;
479
800
  }>;
480
- response: alepha349.TObject<{
481
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
482
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
483
- type: alepha349.TString;
484
- action: alepha349.TString;
485
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
486
- userId: alepha349.TOptional<alepha349.TString>;
487
- userRealm: alepha349.TOptional<alepha349.TString>;
488
- userEmail: alepha349.TOptional<alepha349.TString>;
489
- resourceType: alepha349.TOptional<alepha349.TString>;
490
- resourceId: alepha349.TOptional<alepha349.TString>;
491
- description: alepha349.TOptional<alepha349.TString>;
492
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
493
- ipAddress: alepha349.TOptional<alepha349.TString>;
494
- userAgent: alepha349.TOptional<alepha349.TString>;
495
- sessionId: alepha349.TOptional<alepha349.TString>;
496
- requestId: alepha349.TOptional<alepha349.TString>;
497
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
498
- errorMessage: alepha349.TOptional<alepha349.TString>;
801
+ response: alepha587.TObject<{
802
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
803
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
804
+ type: alepha587.TString;
805
+ action: alepha587.TString;
806
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
807
+ userId: alepha587.TOptional<alepha587.TString>;
808
+ userRealm: alepha587.TOptional<alepha587.TString>;
809
+ userEmail: alepha587.TOptional<alepha587.TString>;
810
+ resourceType: alepha587.TOptional<alepha587.TString>;
811
+ resourceId: alepha587.TOptional<alepha587.TString>;
812
+ description: alepha587.TOptional<alepha587.TString>;
813
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
814
+ ipAddress: alepha587.TOptional<alepha587.TString>;
815
+ userAgent: alepha587.TOptional<alepha587.TString>;
816
+ sessionId: alepha587.TOptional<alepha587.TString>;
817
+ requestId: alepha587.TOptional<alepha587.TString>;
818
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
819
+ errorMessage: alepha587.TOptional<alepha587.TString>;
499
820
  }>;
500
821
  }>;
501
822
  /**
502
823
  * Create a new audit entry.
503
824
  */
504
825
  readonly createAudit: alepha_server0.ActionPrimitiveFn<{
505
- body: alepha349.TObject<{
506
- type: alepha349.TString;
507
- action: alepha349.TString;
508
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
509
- userId: alepha349.TOptional<alepha349.TString>;
510
- userRealm: alepha349.TOptional<alepha349.TString>;
511
- userEmail: alepha349.TOptional<alepha349.TString>;
512
- resourceType: alepha349.TOptional<alepha349.TString>;
513
- resourceId: alepha349.TOptional<alepha349.TString>;
514
- description: alepha349.TOptional<alepha349.TString>;
515
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
516
- ipAddress: alepha349.TOptional<alepha349.TString>;
517
- userAgent: alepha349.TOptional<alepha349.TString>;
518
- sessionId: alepha349.TOptional<alepha349.TString>;
519
- requestId: alepha349.TOptional<alepha349.TString>;
520
- success: alepha349.TOptional<alepha349.TBoolean>;
521
- errorMessage: alepha349.TOptional<alepha349.TString>;
826
+ body: alepha587.TObject<{
827
+ type: alepha587.TString;
828
+ action: alepha587.TString;
829
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
830
+ userId: alepha587.TOptional<alepha587.TString>;
831
+ userRealm: alepha587.TOptional<alepha587.TString>;
832
+ userEmail: alepha587.TOptional<alepha587.TString>;
833
+ resourceType: alepha587.TOptional<alepha587.TString>;
834
+ resourceId: alepha587.TOptional<alepha587.TString>;
835
+ description: alepha587.TOptional<alepha587.TString>;
836
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
837
+ ipAddress: alepha587.TOptional<alepha587.TString>;
838
+ userAgent: alepha587.TOptional<alepha587.TString>;
839
+ sessionId: alepha587.TOptional<alepha587.TString>;
840
+ requestId: alepha587.TOptional<alepha587.TString>;
841
+ success: alepha587.TOptional<alepha587.TBoolean>;
842
+ errorMessage: alepha587.TOptional<alepha587.TString>;
522
843
  }>;
523
- response: alepha349.TObject<{
524
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
525
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
526
- type: alepha349.TString;
527
- action: alepha349.TString;
528
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
529
- userId: alepha349.TOptional<alepha349.TString>;
530
- userRealm: alepha349.TOptional<alepha349.TString>;
531
- userEmail: alepha349.TOptional<alepha349.TString>;
532
- resourceType: alepha349.TOptional<alepha349.TString>;
533
- resourceId: alepha349.TOptional<alepha349.TString>;
534
- description: alepha349.TOptional<alepha349.TString>;
535
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
536
- ipAddress: alepha349.TOptional<alepha349.TString>;
537
- userAgent: alepha349.TOptional<alepha349.TString>;
538
- sessionId: alepha349.TOptional<alepha349.TString>;
539
- requestId: alepha349.TOptional<alepha349.TString>;
540
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
541
- errorMessage: alepha349.TOptional<alepha349.TString>;
844
+ response: alepha587.TObject<{
845
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
846
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
847
+ type: alepha587.TString;
848
+ action: alepha587.TString;
849
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
850
+ userId: alepha587.TOptional<alepha587.TString>;
851
+ userRealm: alepha587.TOptional<alepha587.TString>;
852
+ userEmail: alepha587.TOptional<alepha587.TString>;
853
+ resourceType: alepha587.TOptional<alepha587.TString>;
854
+ resourceId: alepha587.TOptional<alepha587.TString>;
855
+ description: alepha587.TOptional<alepha587.TString>;
856
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
857
+ ipAddress: alepha587.TOptional<alepha587.TString>;
858
+ userAgent: alepha587.TOptional<alepha587.TString>;
859
+ sessionId: alepha587.TOptional<alepha587.TString>;
860
+ requestId: alepha587.TOptional<alepha587.TString>;
861
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
862
+ errorMessage: alepha587.TOptional<alepha587.TString>;
542
863
  }>;
543
864
  }>;
544
865
  /**
545
866
  * Get audit entries for a specific user.
546
867
  */
547
868
  readonly findByUser: alepha_server0.ActionPrimitiveFn<{
548
- params: alepha349.TObject<{
549
- userId: alepha349.TString;
869
+ params: alepha587.TObject<{
870
+ userId: alepha587.TString;
550
871
  }>;
551
- query: alepha349.TObject<{
552
- page: alepha349.TOptional<alepha349.TInteger>;
553
- type: alepha349.TOptional<alepha349.TString>;
554
- size: alepha349.TOptional<alepha349.TInteger>;
555
- sort: alepha349.TOptional<alepha349.TString>;
556
- action: alepha349.TOptional<alepha349.TString>;
557
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
558
- userRealm: alepha349.TOptional<alepha349.TString>;
559
- resourceType: alepha349.TOptional<alepha349.TString>;
560
- resourceId: alepha349.TOptional<alepha349.TString>;
561
- success: alepha349.TOptional<alepha349.TBoolean>;
562
- from: alepha349.TOptional<alepha349.TString>;
563
- to: alepha349.TOptional<alepha349.TString>;
564
- search: alepha349.TOptional<alepha349.TString>;
872
+ query: alepha587.TObject<{
873
+ type: alepha587.TOptional<alepha587.TString>;
874
+ search: alepha587.TOptional<alepha587.TString>;
875
+ action: alepha587.TOptional<alepha587.TString>;
876
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
877
+ sort: alepha587.TOptional<alepha587.TString>;
878
+ userRealm: alepha587.TOptional<alepha587.TString>;
879
+ resourceType: alepha587.TOptional<alepha587.TString>;
880
+ resourceId: alepha587.TOptional<alepha587.TString>;
881
+ success: alepha587.TOptional<alepha587.TBoolean>;
882
+ page: alepha587.TOptional<alepha587.TInteger>;
883
+ size: alepha587.TOptional<alepha587.TInteger>;
884
+ from: alepha587.TOptional<alepha587.TString>;
885
+ to: alepha587.TOptional<alepha587.TString>;
565
886
  }>;
566
- response: alepha349.TPage<alepha349.TObject<{
567
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
568
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
569
- type: alepha349.TString;
570
- action: alepha349.TString;
571
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
572
- userId: alepha349.TOptional<alepha349.TString>;
573
- userRealm: alepha349.TOptional<alepha349.TString>;
574
- userEmail: alepha349.TOptional<alepha349.TString>;
575
- resourceType: alepha349.TOptional<alepha349.TString>;
576
- resourceId: alepha349.TOptional<alepha349.TString>;
577
- description: alepha349.TOptional<alepha349.TString>;
578
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
579
- ipAddress: alepha349.TOptional<alepha349.TString>;
580
- userAgent: alepha349.TOptional<alepha349.TString>;
581
- sessionId: alepha349.TOptional<alepha349.TString>;
582
- requestId: alepha349.TOptional<alepha349.TString>;
583
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
584
- errorMessage: alepha349.TOptional<alepha349.TString>;
887
+ response: alepha587.TPage<alepha587.TObject<{
888
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
889
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
890
+ type: alepha587.TString;
891
+ action: alepha587.TString;
892
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
893
+ userId: alepha587.TOptional<alepha587.TString>;
894
+ userRealm: alepha587.TOptional<alepha587.TString>;
895
+ userEmail: alepha587.TOptional<alepha587.TString>;
896
+ resourceType: alepha587.TOptional<alepha587.TString>;
897
+ resourceId: alepha587.TOptional<alepha587.TString>;
898
+ description: alepha587.TOptional<alepha587.TString>;
899
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
900
+ ipAddress: alepha587.TOptional<alepha587.TString>;
901
+ userAgent: alepha587.TOptional<alepha587.TString>;
902
+ sessionId: alepha587.TOptional<alepha587.TString>;
903
+ requestId: alepha587.TOptional<alepha587.TString>;
904
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
905
+ errorMessage: alepha587.TOptional<alepha587.TString>;
585
906
  }>>;
586
907
  }>;
587
908
  /**
588
909
  * Get audit entries for a specific resource.
589
910
  */
590
911
  readonly findByResource: alepha_server0.ActionPrimitiveFn<{
591
- params: alepha349.TObject<{
592
- resourceType: alepha349.TString;
593
- resourceId: alepha349.TString;
912
+ params: alepha587.TObject<{
913
+ resourceType: alepha587.TString;
914
+ resourceId: alepha587.TString;
594
915
  }>;
595
- query: alepha349.TObject<{
596
- page: alepha349.TOptional<alepha349.TInteger>;
597
- type: alepha349.TOptional<alepha349.TString>;
598
- size: alepha349.TOptional<alepha349.TInteger>;
599
- sort: alepha349.TOptional<alepha349.TString>;
600
- action: alepha349.TOptional<alepha349.TString>;
601
- severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
602
- userId: alepha349.TOptional<alepha349.TString>;
603
- userRealm: alepha349.TOptional<alepha349.TString>;
604
- success: alepha349.TOptional<alepha349.TBoolean>;
605
- from: alepha349.TOptional<alepha349.TString>;
606
- to: alepha349.TOptional<alepha349.TString>;
607
- search: alepha349.TOptional<alepha349.TString>;
916
+ query: alepha587.TObject<{
917
+ type: alepha587.TOptional<alepha587.TString>;
918
+ search: alepha587.TOptional<alepha587.TString>;
919
+ action: alepha587.TOptional<alepha587.TString>;
920
+ severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
921
+ sort: alepha587.TOptional<alepha587.TString>;
922
+ userId: alepha587.TOptional<alepha587.TString>;
923
+ userRealm: alepha587.TOptional<alepha587.TString>;
924
+ success: alepha587.TOptional<alepha587.TBoolean>;
925
+ page: alepha587.TOptional<alepha587.TInteger>;
926
+ size: alepha587.TOptional<alepha587.TInteger>;
927
+ from: alepha587.TOptional<alepha587.TString>;
928
+ to: alepha587.TOptional<alepha587.TString>;
608
929
  }>;
609
- response: alepha349.TPage<alepha349.TObject<{
610
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
611
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
612
- type: alepha349.TString;
613
- action: alepha349.TString;
614
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
615
- userId: alepha349.TOptional<alepha349.TString>;
616
- userRealm: alepha349.TOptional<alepha349.TString>;
617
- userEmail: alepha349.TOptional<alepha349.TString>;
618
- resourceType: alepha349.TOptional<alepha349.TString>;
619
- resourceId: alepha349.TOptional<alepha349.TString>;
620
- description: alepha349.TOptional<alepha349.TString>;
621
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
622
- ipAddress: alepha349.TOptional<alepha349.TString>;
623
- userAgent: alepha349.TOptional<alepha349.TString>;
624
- sessionId: alepha349.TOptional<alepha349.TString>;
625
- requestId: alepha349.TOptional<alepha349.TString>;
626
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
627
- errorMessage: alepha349.TOptional<alepha349.TString>;
930
+ response: alepha587.TPage<alepha587.TObject<{
931
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
932
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
933
+ type: alepha587.TString;
934
+ action: alepha587.TString;
935
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
936
+ userId: alepha587.TOptional<alepha587.TString>;
937
+ userRealm: alepha587.TOptional<alepha587.TString>;
938
+ userEmail: alepha587.TOptional<alepha587.TString>;
939
+ resourceType: alepha587.TOptional<alepha587.TString>;
940
+ resourceId: alepha587.TOptional<alepha587.TString>;
941
+ description: alepha587.TOptional<alepha587.TString>;
942
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
943
+ ipAddress: alepha587.TOptional<alepha587.TString>;
944
+ userAgent: alepha587.TOptional<alepha587.TString>;
945
+ sessionId: alepha587.TOptional<alepha587.TString>;
946
+ requestId: alepha587.TOptional<alepha587.TString>;
947
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
948
+ errorMessage: alepha587.TOptional<alepha587.TString>;
628
949
  }>>;
629
950
  }>;
630
951
  /**
631
952
  * Get audit statistics.
632
953
  */
633
954
  readonly getStats: alepha_server0.ActionPrimitiveFn<{
634
- query: alepha349.TObject<{
635
- from: alepha349.TOptional<alepha349.TString>;
636
- to: alepha349.TOptional<alepha349.TString>;
637
- userRealm: alepha349.TOptional<alepha349.TString>;
955
+ query: alepha587.TObject<{
956
+ from: alepha587.TOptional<alepha587.TString>;
957
+ to: alepha587.TOptional<alepha587.TString>;
958
+ userRealm: alepha587.TOptional<alepha587.TString>;
638
959
  }>;
639
- response: alepha349.TObject<{
640
- total: alepha349.TInteger;
641
- byType: alepha349.TRecord<"^.*$", alepha349.TInteger>;
642
- bySeverity: alepha349.TObject<{
643
- info: alepha349.TInteger;
644
- warning: alepha349.TInteger;
645
- critical: alepha349.TInteger;
960
+ response: alepha587.TObject<{
961
+ total: alepha587.TInteger;
962
+ byType: alepha587.TRecord<"^.*$", alepha587.TInteger>;
963
+ bySeverity: alepha587.TObject<{
964
+ info: alepha587.TInteger;
965
+ warning: alepha587.TInteger;
966
+ critical: alepha587.TInteger;
646
967
  }>;
647
- successRate: alepha349.TNumber;
648
- recentFailures: alepha349.TArray<alepha349.TObject<{
649
- id: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_PRIMARY_KEY>, typeof alepha_orm71.PG_DEFAULT>;
650
- createdAt: alepha_orm71.PgAttr<alepha_orm71.PgAttr<alepha349.TString, typeof alepha_orm71.PG_CREATED_AT>, typeof alepha_orm71.PG_DEFAULT>;
651
- type: alepha349.TString;
652
- action: alepha349.TString;
653
- severity: alepha_orm71.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm71.PG_DEFAULT>;
654
- userId: alepha349.TOptional<alepha349.TString>;
655
- userRealm: alepha349.TOptional<alepha349.TString>;
656
- userEmail: alepha349.TOptional<alepha349.TString>;
657
- resourceType: alepha349.TOptional<alepha349.TString>;
658
- resourceId: alepha349.TOptional<alepha349.TString>;
659
- description: alepha349.TOptional<alepha349.TString>;
660
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
661
- ipAddress: alepha349.TOptional<alepha349.TString>;
662
- userAgent: alepha349.TOptional<alepha349.TString>;
663
- sessionId: alepha349.TOptional<alepha349.TString>;
664
- requestId: alepha349.TOptional<alepha349.TString>;
665
- success: alepha_orm71.PgAttr<alepha349.TBoolean, typeof alepha_orm71.PG_DEFAULT>;
666
- errorMessage: alepha349.TOptional<alepha349.TString>;
968
+ successRate: alepha587.TNumber;
969
+ recentFailures: alepha587.TArray<alepha587.TObject<{
970
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
971
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
972
+ type: alepha587.TString;
973
+ action: alepha587.TString;
974
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
975
+ userId: alepha587.TOptional<alepha587.TString>;
976
+ userRealm: alepha587.TOptional<alepha587.TString>;
977
+ userEmail: alepha587.TOptional<alepha587.TString>;
978
+ resourceType: alepha587.TOptional<alepha587.TString>;
979
+ resourceId: alepha587.TOptional<alepha587.TString>;
980
+ description: alepha587.TOptional<alepha587.TString>;
981
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
982
+ ipAddress: alepha587.TOptional<alepha587.TString>;
983
+ userAgent: alepha587.TOptional<alepha587.TString>;
984
+ sessionId: alepha587.TOptional<alepha587.TString>;
985
+ requestId: alepha587.TOptional<alepha587.TString>;
986
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
987
+ errorMessage: alepha587.TOptional<alepha587.TString>;
667
988
  }>>;
668
989
  }>;
669
990
  }>;
@@ -671,21 +992,21 @@ declare class AuditController {
671
992
  * Get registered audit types.
672
993
  */
673
994
  readonly getTypes: alepha_server0.ActionPrimitiveFn<{
674
- response: alepha349.TArray<alepha349.TObject<{
675
- type: alepha349.TString;
676
- description: alepha349.TOptional<alepha349.TString>;
677
- actions: alepha349.TArray<alepha349.TString>;
995
+ response: alepha587.TArray<alepha587.TObject<{
996
+ type: alepha587.TString;
997
+ description: alepha587.TOptional<alepha587.TString>;
998
+ actions: alepha587.TArray<alepha587.TString>;
678
999
  }>>;
679
1000
  }>;
680
1001
  /**
681
1002
  * Get distinct values for filters.
682
1003
  */
683
1004
  readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
684
- response: alepha349.TObject<{
685
- types: alepha349.TArray<alepha349.TString>;
686
- actions: alepha349.TArray<alepha349.TString>;
687
- resourceTypes: alepha349.TArray<alepha349.TString>;
688
- userRealms: alepha349.TArray<alepha349.TString>;
1005
+ response: alepha587.TObject<{
1006
+ types: alepha587.TArray<alepha587.TString>;
1007
+ actions: alepha587.TArray<alepha587.TString>;
1008
+ resourceTypes: alepha587.TArray<alepha587.TString>;
1009
+ userRealms: alepha587.TArray<alepha587.TString>;
689
1010
  }>;
690
1011
  }>;
691
1012
  }
@@ -803,429 +1124,29 @@ declare const $audit: {
803
1124
  [KIND]: typeof AuditPrimitive;
804
1125
  };
805
1126
  //#endregion
806
- //#region ../../src/orm/schemas/insertSchema.d.ts
807
- /**
808
- * Transforms a TObject schema for insert operations.
809
- * All default properties at the root level are made optional.
810
- *
811
- * @example
812
- * Before: { name: string; age: number(default=0); }
813
- * After: { name: string; age?: number; }
814
- */
815
- type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends {
816
- [PG_DEFAULT]: any;
817
- } | {
818
- "~optional": true;
819
- } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
820
- //#endregion
821
- //#region ../../src/orm/schemas/updateSchema.d.ts
822
- /**
823
- * Transforms a TObject schema for update operations.
824
- * All optional properties at the root level are made nullable (i.e., `T | null`).
825
- * This allows an API endpoint to explicitly accept `null` to clear an optional field in the database.
826
- *
827
- * @example
828
- * Before: { name?: string; age: number; }
829
- * After: { name?: string | null; age: number; }
830
- */
831
- 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] }>;
832
- //#endregion
833
- //#region ../../src/orm/primitives/$entity.d.ts
834
- interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
835
- /**
836
- * The database table name that will be created for this entity.
837
- * If not provided, name will be inferred from the $repository variable name.
838
- */
839
- name: string;
840
- /**
841
- * TypeBox schema defining the table structure and column types.
842
- */
843
- schema: T;
844
- /**
845
- * Database indexes to create for query optimization.
846
- */
847
- indexes?: (Keys | {
848
- /**
849
- * Single column to index.
850
- */
851
- column: Keys;
852
- /**
853
- * Whether this should be a unique index (enforces uniqueness constraint).
854
- */
855
- unique?: boolean;
856
- /**
857
- * Custom name for the index. If not provided, generates name automatically.
858
- */
859
- name?: string;
860
- } | {
861
- /**
862
- * Multiple columns for composite index (order matters for query optimization).
863
- */
864
- columns: Keys[];
865
- /**
866
- * Whether this should be a unique index (enforces uniqueness constraint).
867
- */
868
- unique?: boolean;
869
- /**
870
- * Custom name for the index. If not provided, generates name automatically.
871
- */
872
- name?: string;
873
- })[];
874
- /**
875
- * Foreign key constraints to maintain referential integrity.
876
- */
877
- foreignKeys?: Array<{
878
- /**
879
- * Optional name for the foreign key constraint.
880
- */
881
- name?: string;
882
- /**
883
- * Local columns that reference the foreign table.
884
- */
885
- columns: Array<keyof Static<T>>;
886
- /**
887
- * Referenced columns in the foreign table.
888
- * Must be EntityColumn references from other entities.
889
- */
890
- foreignColumns: Array<() => EntityColumn<any>>;
891
- }>;
892
- /**
893
- * Additional table constraints for data validation.
894
- *
895
- * Constraints enforce business rules at the database level, providing
896
- * an additional layer of data integrity beyond application validation.
897
- *
898
- * **Constraint Types**:
899
- * - **Unique constraints**: Prevent duplicate values across columns
900
- * - **Check constraints**: Enforce custom validation rules with SQL expressions
901
- *
902
- * @example
903
- * ```ts
904
- * constraints: [
905
- * {
906
- * name: "unique_user_email",
907
- * columns: ["email"],
908
- * unique: true
909
- * },
910
- * {
911
- * name: "valid_age_range",
912
- * columns: ["age"],
913
- * check: sql`age >= 0 AND age <= 150`
914
- * },
915
- * {
916
- * name: "unique_user_username_per_tenant",
917
- * columns: ["tenantId", "username"],
918
- * unique: true
919
- * }
920
- * ]
921
- * ```
922
- */
923
- constraints?: Array<{
924
- /**
925
- * Columns involved in this constraint.
926
- */
927
- columns: Array<keyof Static<T>>;
928
- /**
929
- * Optional name for the constraint.
930
- */
931
- name?: string;
932
- /**
933
- * Whether this is a unique constraint.
934
- */
935
- unique?: boolean | {};
936
- /**
937
- * SQL expression for check constraint validation.
938
- */
939
- check?: SQL;
940
- }>;
941
- /**
942
- * Advanced Drizzle ORM configuration for complex table setups.
943
- */
944
- config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
945
- }
946
- declare class EntityPrimitive<T extends TObject = TObject> {
947
- readonly options: EntityPrimitiveOptions<T>;
948
- constructor(options: EntityPrimitiveOptions<T>);
949
- alias(alias: string): this;
950
- get cols(): EntityColumns<T>;
951
- get name(): string;
952
- get schema(): T;
953
- get insertSchema(): TObjectInsert<T>;
954
- get updateSchema(): TObjectUpdate<T>;
955
- }
956
- /**
957
- * Convert a schema to columns.
958
- */
959
- type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
960
- type EntityColumn<T extends TObject> = {
961
- name: string;
962
- entity: EntityPrimitive<T>;
963
- };
964
- type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
965
- //#endregion
966
- //#region ../../src/orm/constants/PG_SYMBOLS.d.ts
967
- declare const PG_DEFAULT: unique symbol;
968
- declare const PG_PRIMARY_KEY: unique symbol;
969
- declare const PG_CREATED_AT: unique symbol;
970
- declare const PG_UPDATED_AT: unique symbol;
971
- declare const PG_DELETED_AT: unique symbol;
972
- declare const PG_VERSION: unique symbol;
973
- declare const PG_IDENTITY: unique symbol;
974
- declare const PG_ENUM: unique symbol;
975
- declare const PG_REF: unique symbol;
976
- /**
977
- * @deprecated Use `PG_IDENTITY` instead.
978
- */
979
- declare const PG_SERIAL: unique symbol;
980
- type PgSymbols = {
981
- [PG_DEFAULT]: {};
982
- [PG_PRIMARY_KEY]: {};
983
- [PG_CREATED_AT]: {};
984
- [PG_UPDATED_AT]: {};
985
- [PG_DELETED_AT]: {};
986
- [PG_VERSION]: {};
987
- [PG_IDENTITY]: PgIdentityOptions;
988
- [PG_REF]: PgRefOptions;
989
- [PG_ENUM]: PgEnumOptions;
990
- /**
991
- * @deprecated Use `PG_IDENTITY` instead.
992
- */
993
- [PG_SERIAL]: {};
994
- };
995
- type PgSymbolKeys = keyof PgSymbols;
996
- type PgIdentityOptions = {
997
- mode: "always" | "byDefault";
998
- } & PgSequenceOptions & {
999
- name?: string;
1000
- };
1001
- interface PgEnumOptions {
1002
- name?: string;
1003
- description?: string;
1004
- }
1005
- interface PgRefOptions {
1006
- ref: () => {
1007
- name: string;
1008
- entity: EntityPrimitive;
1009
- };
1010
- actions?: {
1011
- onUpdate?: UpdateDeleteAction;
1012
- onDelete?: UpdateDeleteAction;
1013
- };
1014
- }
1015
- //#endregion
1016
- //#region ../../src/orm/helpers/pgAttr.d.ts
1017
- /**
1018
- * Type representation.
1019
- */
1020
- type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
1021
- //#endregion
1022
- //#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
1023
- declare module "alepha" {
1024
- interface Env extends Partial<Static<typeof envSchema$1>> {}
1025
- }
1026
- declare const envSchema$1: alepha349.TObject<{
1027
- /**
1028
- * Main configuration for database connection.
1029
- * Accept a string in the format of a Postgres connection URL.
1030
- * Example: postgres://user:password@localhost:5432/database
1031
- * or
1032
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
1033
- */
1034
- DATABASE_URL: alepha349.TOptional<alepha349.TString>;
1035
- /**
1036
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
1037
- */
1038
- POSTGRES_SCHEMA: alepha349.TOptional<alepha349.TString>;
1039
- }>;
1040
- /**
1041
- * Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
1042
- *
1043
- * This provider uses Bun's built-in SQL class for PostgreSQL connections,
1044
- * which provides excellent performance on the Bun runtime.
1045
- *
1046
- * @example
1047
- * ```ts
1048
- * // Set DATABASE_URL environment variable
1049
- * // DATABASE_URL=postgres://user:password@localhost:5432/database
1050
- *
1051
- * // Or configure programmatically
1052
- * alepha.with({
1053
- * provide: DatabaseProvider,
1054
- * use: BunPostgresProvider,
1055
- * });
1056
- * ```
1057
- */
1058
- //#endregion
1059
- //#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
1060
- /**
1061
- * Configuration options for the Bun SQLite database provider.
1062
- */
1063
- declare const bunSqliteOptions: alepha349.Atom<alepha349.TObject<{
1064
- path: alepha349.TOptional<alepha349.TString>;
1065
- }>, "alepha.postgres.bun-sqlite.options">;
1066
- type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
1067
- declare module "alepha" {
1068
- interface State {
1069
- [bunSqliteOptions.key]: BunSqliteProviderOptions;
1070
- }
1071
- }
1072
- /**
1073
- * Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
1074
- *
1075
- * This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
1076
- * which provides excellent performance on the Bun runtime.
1077
- *
1078
- * @example
1079
- * ```ts
1080
- * // Set DATABASE_URL environment variable
1081
- * // DATABASE_URL=sqlite://./my-database.db
1082
- *
1083
- * // Or configure programmatically
1084
- * alepha.with({
1085
- * provide: DatabaseProvider,
1086
- * use: BunSqliteProvider,
1087
- * });
1088
- *
1089
- * // Or use options atom
1090
- * alepha.store.mut(bunSqliteOptions, (old) => ({
1091
- * ...old,
1092
- * path: ":memory:",
1093
- * }));
1094
- * ```
1095
- */
1096
- //#endregion
1097
- //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
1098
- declare module "alepha" {
1099
- interface Env extends Partial<Static<typeof envSchema>> {}
1100
- }
1101
- declare const envSchema: alepha349.TObject<{
1102
- /**
1103
- * Main configuration for database connection.
1104
- * Accept a string in the format of a Postgres connection URL.
1105
- * Example: postgres://user:password@localhost:5432/database
1106
- * or
1107
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
1108
- */
1109
- DATABASE_URL: alepha349.TOptional<alepha349.TString>;
1110
- /**
1111
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
1112
- *
1113
- * It will monkey patch drizzle tables.
1114
- */
1115
- POSTGRES_SCHEMA: alepha349.TOptional<alepha349.TString>;
1116
- }>;
1117
- //#endregion
1118
- //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
1119
- /**
1120
- * Configuration options for the Node.js SQLite database provider.
1121
- */
1122
- declare const nodeSqliteOptions: alepha349.Atom<alepha349.TObject<{
1123
- path: alepha349.TOptional<alepha349.TString>;
1124
- }>, "alepha.postgres.node-sqlite.options">;
1125
- type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
1126
- declare module "alepha" {
1127
- interface State {
1128
- [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
1129
- }
1130
- }
1131
- /**
1132
- * Add a fake support for SQLite in Node.js based on Postgres interfaces.
1133
- *
1134
- * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
1135
- * This is NOT recommended for production use.
1136
- */
1137
- //#endregion
1138
- //#region ../../src/orm/index.d.ts
1139
- declare module "alepha" {
1140
- interface Hooks {
1141
- /**
1142
- * Fires before creating an entity in the repository.
1143
- */
1144
- "repository:create:before": {
1145
- tableName: string;
1146
- data: any;
1147
- };
1148
- /**
1149
- * Fires after creating an entity in the repository.
1150
- */
1151
- "repository:create:after": {
1152
- tableName: string;
1153
- data: any;
1154
- entity: any;
1155
- };
1156
- /**
1157
- * Fires before updating entities in the repository.
1158
- */
1159
- "repository:update:before": {
1160
- tableName: string;
1161
- where: any;
1162
- data: any;
1163
- };
1164
- /**
1165
- * Fires after updating entities in the repository.
1166
- */
1167
- "repository:update:after": {
1168
- tableName: string;
1169
- where: any;
1170
- data: any;
1171
- entities: any[];
1172
- };
1173
- /**
1174
- * Fires before deleting entities from the repository.
1175
- */
1176
- "repository:delete:before": {
1177
- tableName: string;
1178
- where: any;
1179
- };
1180
- /**
1181
- * Fires after deleting entities from the repository.
1182
- */
1183
- "repository:delete:after": {
1184
- tableName: string;
1185
- where: any;
1186
- ids: Array<string | number>;
1187
- };
1188
- /**
1189
- * Fires before reading entities from the repository.
1190
- */
1191
- "repository:read:before": {
1192
- tableName: string;
1193
- query: any;
1194
- };
1195
- /**
1196
- * Fires after reading entities from the repository.
1197
- */
1198
- "repository:read:after": {
1199
- tableName: string;
1200
- query: any;
1201
- entities: any[];
1202
- };
1203
- }
1204
- }
1205
- //#endregion
1206
1127
  //#region ../../src/api/audits/schemas/auditResourceSchema.d.ts
1207
1128
  /**
1208
1129
  * Resource schema for audit log responses.
1209
1130
  */
1210
- declare const auditResourceSchema: alepha349.TObject<{
1211
- id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1212
- createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1213
- type: alepha349.TString;
1214
- action: alepha349.TString;
1215
- severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
1216
- userId: alepha349.TOptional<alepha349.TString>;
1217
- userRealm: alepha349.TOptional<alepha349.TString>;
1218
- userEmail: alepha349.TOptional<alepha349.TString>;
1219
- resourceType: alepha349.TOptional<alepha349.TString>;
1220
- resourceId: alepha349.TOptional<alepha349.TString>;
1221
- description: alepha349.TOptional<alepha349.TString>;
1222
- metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
1223
- ipAddress: alepha349.TOptional<alepha349.TString>;
1224
- userAgent: alepha349.TOptional<alepha349.TString>;
1225
- sessionId: alepha349.TOptional<alepha349.TString>;
1226
- requestId: alepha349.TOptional<alepha349.TString>;
1227
- success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
1228
- errorMessage: alepha349.TOptional<alepha349.TString>;
1131
+ declare const auditResourceSchema: alepha587.TObject<{
1132
+ id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1133
+ createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1134
+ type: alepha587.TString;
1135
+ action: alepha587.TString;
1136
+ severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
1137
+ userId: alepha587.TOptional<alepha587.TString>;
1138
+ userRealm: alepha587.TOptional<alepha587.TString>;
1139
+ userEmail: alepha587.TOptional<alepha587.TString>;
1140
+ resourceType: alepha587.TOptional<alepha587.TString>;
1141
+ resourceId: alepha587.TOptional<alepha587.TString>;
1142
+ description: alepha587.TOptional<alepha587.TString>;
1143
+ metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
1144
+ ipAddress: alepha587.TOptional<alepha587.TString>;
1145
+ userAgent: alepha587.TOptional<alepha587.TString>;
1146
+ sessionId: alepha587.TOptional<alepha587.TString>;
1147
+ requestId: alepha587.TOptional<alepha587.TString>;
1148
+ success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
1149
+ errorMessage: alepha587.TOptional<alepha587.TString>;
1229
1150
  }>;
1230
1151
  type AuditResource = Static<typeof auditResourceSchema>;
1231
1152
  //#endregion
@@ -1268,7 +1189,7 @@ type AuditResource = Static<typeof auditResourceSchema>;
1268
1189
  * }
1269
1190
  * ```
1270
1191
  */
1271
- declare const AlephaApiAudits: alepha349.Service<alepha349.Module>;
1192
+ declare const AlephaApiAudits: alepha587.Service<alepha587.Module>;
1272
1193
  //#endregion
1273
- export { $audit, AlephaApiAudits, AuditController, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
1194
+ export { $audit, AdminAuditController, AlephaApiAudits, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
1274
1195
  //# sourceMappingURL=index.d.ts.map