alepha 0.14.2 → 0.14.3

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