alepha 0.14.1 → 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 (402) hide show
  1. package/README.md +3 -3
  2. package/dist/api/audits/index.browser.js +5 -5
  3. package/dist/api/audits/index.browser.js.map +1 -1
  4. package/dist/api/audits/index.d.ts +784 -784
  5. package/dist/api/audits/index.d.ts.map +1 -1
  6. package/dist/api/audits/index.js +13 -13
  7. package/dist/api/audits/index.js.map +1 -1
  8. package/dist/api/files/index.browser.js +5 -5
  9. package/dist/api/files/index.browser.js.map +1 -1
  10. package/dist/api/files/index.d.ts +57 -57
  11. package/dist/api/files/index.d.ts.map +1 -1
  12. package/dist/api/files/index.js +71 -71
  13. package/dist/api/files/index.js.map +1 -1
  14. package/dist/api/jobs/index.browser.js +5 -5
  15. package/dist/api/jobs/index.browser.js.map +1 -1
  16. package/dist/api/jobs/index.d.ts +165 -165
  17. package/dist/api/jobs/index.d.ts.map +1 -1
  18. package/dist/api/jobs/index.js +10 -10
  19. package/dist/api/jobs/index.js.map +1 -1
  20. package/dist/api/notifications/index.browser.js +10 -10
  21. package/dist/api/notifications/index.browser.js.map +1 -1
  22. package/dist/api/notifications/index.d.ts +583 -171
  23. package/dist/api/notifications/index.d.ts.map +1 -1
  24. package/dist/api/notifications/index.js +12 -12
  25. package/dist/api/notifications/index.js.map +1 -1
  26. package/dist/api/parameters/index.browser.js +163 -10
  27. package/dist/api/parameters/index.browser.js.map +1 -1
  28. package/dist/api/parameters/index.d.ts +281 -276
  29. package/dist/api/parameters/index.d.ts.map +1 -1
  30. package/dist/api/parameters/index.js +196 -91
  31. package/dist/api/parameters/index.js.map +1 -1
  32. package/dist/api/users/index.browser.js +19 -19
  33. package/dist/api/users/index.browser.js.map +1 -1
  34. package/dist/api/users/index.d.ts +778 -764
  35. package/dist/api/users/index.d.ts.map +1 -1
  36. package/dist/api/users/index.js +831 -596
  37. package/dist/api/users/index.js.map +1 -1
  38. package/dist/api/verifications/index.browser.js +6 -6
  39. package/dist/api/verifications/index.browser.js.map +1 -1
  40. package/dist/api/verifications/index.d.ts +125 -125
  41. package/dist/api/verifications/index.d.ts.map +1 -1
  42. package/dist/api/verifications/index.js +6 -6
  43. package/dist/api/verifications/index.js.map +1 -1
  44. package/dist/batch/index.js.map +1 -1
  45. package/dist/bin/index.d.ts +1 -2
  46. package/dist/bin/index.js +0 -1
  47. package/dist/bin/index.js.map +1 -1
  48. package/dist/cache/core/index.js.map +1 -1
  49. package/dist/cli/index.d.ts +249 -218
  50. package/dist/cli/index.d.ts.map +1 -1
  51. package/dist/cli/index.js +951 -821
  52. package/dist/cli/index.js.map +1 -1
  53. package/dist/command/index.d.ts +40 -0
  54. package/dist/command/index.d.ts.map +1 -1
  55. package/dist/command/index.js +97 -17
  56. package/dist/command/index.js.map +1 -1
  57. package/dist/core/index.browser.js +14 -18
  58. package/dist/core/index.browser.js.map +1 -1
  59. package/dist/core/index.d.ts +29 -0
  60. package/dist/core/index.d.ts.map +1 -1
  61. package/dist/core/index.js +21 -24
  62. package/dist/core/index.js.map +1 -1
  63. package/dist/core/index.native.js +21 -24
  64. package/dist/core/index.native.js.map +1 -1
  65. package/dist/datetime/index.js.map +1 -1
  66. package/dist/fake/index.js +195 -168
  67. package/dist/fake/index.js.map +1 -1
  68. package/dist/file/index.d.ts +8 -0
  69. package/dist/file/index.d.ts.map +1 -1
  70. package/dist/file/index.js +3 -0
  71. package/dist/file/index.js.map +1 -1
  72. package/dist/lock/redis/index.js.map +1 -1
  73. package/dist/logger/index.js.map +1 -1
  74. package/dist/mcp/index.d.ts.map +1 -1
  75. package/dist/mcp/index.js.map +1 -1
  76. package/dist/orm/index.browser.js +26 -5
  77. package/dist/orm/index.browser.js.map +1 -1
  78. package/dist/orm/index.d.ts +146 -121
  79. package/dist/orm/index.d.ts.map +1 -1
  80. package/dist/orm/index.js +49 -24
  81. package/dist/orm/index.js.map +1 -1
  82. package/dist/redis/index.js.map +1 -1
  83. package/dist/retry/index.js.map +1 -1
  84. package/dist/router/index.js.map +1 -1
  85. package/dist/scheduler/index.d.ts +6 -6
  86. package/dist/scheduler/index.js.map +1 -1
  87. package/dist/security/index.d.ts +29 -29
  88. package/dist/security/index.d.ts.map +1 -1
  89. package/dist/security/index.js +1 -1
  90. package/dist/security/index.js.map +1 -1
  91. package/dist/server/auth/index.d.ts +171 -155
  92. package/dist/server/auth/index.d.ts.map +1 -1
  93. package/dist/server/auth/index.js +0 -1
  94. package/dist/server/auth/index.js.map +1 -1
  95. package/dist/server/cache/index.js.map +1 -1
  96. package/dist/server/compress/index.d.ts.map +1 -1
  97. package/dist/server/compress/index.js +2 -0
  98. package/dist/server/compress/index.js.map +1 -1
  99. package/dist/server/cookies/index.browser.js.map +1 -1
  100. package/dist/server/cookies/index.js.map +1 -1
  101. package/dist/server/core/index.browser.js.map +1 -1
  102. package/dist/server/core/index.d.ts.map +1 -1
  103. package/dist/server/core/index.js +1 -1
  104. package/dist/server/core/index.js.map +1 -1
  105. package/dist/server/health/index.d.ts +17 -17
  106. package/dist/server/helmet/index.js.map +1 -1
  107. package/dist/server/links/index.browser.js +22 -6
  108. package/dist/server/links/index.browser.js.map +1 -1
  109. package/dist/server/links/index.d.ts +46 -44
  110. package/dist/server/links/index.d.ts.map +1 -1
  111. package/dist/server/links/index.js +24 -41
  112. package/dist/server/links/index.js.map +1 -1
  113. package/dist/server/multipart/index.js.map +1 -1
  114. package/dist/server/rate-limit/index.js.map +1 -1
  115. package/dist/server/security/index.js.map +1 -1
  116. package/dist/server/swagger/index.d.ts +2 -1
  117. package/dist/server/swagger/index.d.ts.map +1 -1
  118. package/dist/server/swagger/index.js +8 -3
  119. package/dist/server/swagger/index.js.map +1 -1
  120. package/dist/thread/index.js.map +1 -1
  121. package/dist/topic/core/index.js.map +1 -1
  122. package/dist/vite/index.d.ts.map +1 -1
  123. package/dist/vite/index.js +12 -4
  124. package/dist/vite/index.js.map +1 -1
  125. package/dist/websocket/index.browser.js.map +1 -1
  126. package/dist/websocket/index.js.map +1 -1
  127. package/package.json +7 -7
  128. package/src/api/audits/controllers/{AuditController.ts → AdminAuditController.ts} +5 -6
  129. package/src/api/audits/entities/audits.ts +5 -5
  130. package/src/api/audits/index.browser.ts +1 -1
  131. package/src/api/audits/index.ts +3 -3
  132. package/src/api/audits/primitives/$audit.spec.ts +276 -0
  133. package/src/api/audits/services/AuditService.spec.ts +495 -0
  134. package/src/api/files/__tests__/$bucket.spec.ts +91 -0
  135. package/src/api/files/controllers/AdminFileStatsController.spec.ts +166 -0
  136. package/src/api/files/controllers/{StorageStatsController.ts → AdminFileStatsController.ts} +2 -2
  137. package/src/api/files/controllers/FileController.spec.ts +558 -0
  138. package/src/api/files/controllers/FileController.ts +4 -5
  139. package/src/api/files/entities/files.ts +5 -5
  140. package/src/api/files/index.browser.ts +1 -1
  141. package/src/api/files/index.ts +4 -4
  142. package/src/api/files/jobs/FileJobs.spec.ts +52 -0
  143. package/src/api/files/services/FileService.spec.ts +109 -0
  144. package/src/api/jobs/__tests__/JobController.spec.ts +343 -0
  145. package/src/api/jobs/controllers/{JobController.ts → AdminJobController.ts} +2 -2
  146. package/src/api/jobs/entities/jobExecutions.ts +5 -5
  147. package/src/api/jobs/index.ts +3 -3
  148. package/src/api/jobs/primitives/$job.spec.ts +476 -0
  149. package/src/api/notifications/controllers/{NotificationController.ts → AdminNotificationController.ts} +4 -5
  150. package/src/api/notifications/entities/notifications.ts +5 -5
  151. package/src/api/notifications/index.browser.ts +1 -1
  152. package/src/api/notifications/index.ts +4 -4
  153. package/src/api/parameters/controllers/{ConfigController.ts → AdminConfigController.ts} +46 -107
  154. package/src/api/parameters/entities/parameters.ts +7 -17
  155. package/src/api/parameters/index.ts +3 -3
  156. package/src/api/parameters/primitives/$config.spec.ts +356 -0
  157. package/src/api/parameters/schemas/activateConfigBodySchema.ts +12 -0
  158. package/src/api/parameters/schemas/checkScheduledResponseSchema.ts +8 -0
  159. package/src/api/parameters/schemas/configCurrentResponseSchema.ts +13 -0
  160. package/src/api/parameters/schemas/configHistoryResponseSchema.ts +9 -0
  161. package/src/api/parameters/schemas/configNameParamSchema.ts +10 -0
  162. package/src/api/parameters/schemas/configNamesResponseSchema.ts +8 -0
  163. package/src/api/parameters/schemas/configTreeNodeSchema.ts +13 -0
  164. package/src/api/parameters/schemas/configVersionParamSchema.ts +9 -0
  165. package/src/api/parameters/schemas/configVersionResponseSchema.ts +9 -0
  166. package/src/api/parameters/schemas/configsByStatusResponseSchema.ts +9 -0
  167. package/src/api/parameters/schemas/createConfigVersionBodySchema.ts +24 -0
  168. package/src/api/parameters/schemas/index.ts +15 -0
  169. package/src/api/parameters/schemas/parameterResponseSchema.ts +26 -0
  170. package/src/api/parameters/schemas/parameterStatusSchema.ts +13 -0
  171. package/src/api/parameters/schemas/rollbackConfigBodySchema.ts +15 -0
  172. package/src/api/parameters/schemas/statusParamSchema.ts +9 -0
  173. package/src/api/users/__tests__/EmailVerification.spec.ts +369 -0
  174. package/src/api/users/__tests__/PasswordReset.spec.ts +550 -0
  175. package/src/api/users/controllers/AdminIdentityController.spec.ts +365 -0
  176. package/src/api/users/controllers/{IdentityController.ts → AdminIdentityController.ts} +3 -4
  177. package/src/api/users/controllers/AdminSessionController.spec.ts +274 -0
  178. package/src/api/users/controllers/{SessionController.ts → AdminSessionController.ts} +3 -4
  179. package/src/api/users/controllers/AdminUserController.spec.ts +372 -0
  180. package/src/api/users/controllers/AdminUserController.ts +116 -0
  181. package/src/api/users/controllers/UserController.ts +4 -107
  182. package/src/api/users/controllers/UserRealmController.ts +3 -0
  183. package/src/api/users/entities/identities.ts +6 -6
  184. package/src/api/users/entities/sessions.ts +6 -6
  185. package/src/api/users/entities/users.ts +9 -9
  186. package/src/api/users/index.ts +13 -6
  187. package/src/api/users/primitives/$userRealm.ts +13 -8
  188. package/src/api/users/services/CredentialService.spec.ts +509 -0
  189. package/src/api/users/services/CredentialService.ts +46 -0
  190. package/src/api/users/services/IdentityService.ts +15 -0
  191. package/src/api/users/services/RegistrationService.spec.ts +630 -0
  192. package/src/api/users/services/RegistrationService.ts +18 -0
  193. package/src/api/users/services/SessionService.spec.ts +301 -0
  194. package/src/api/users/services/SessionService.ts +110 -1
  195. package/src/api/users/services/UserService.ts +67 -2
  196. package/src/api/verifications/__tests__/CodeVerification.spec.ts +318 -0
  197. package/src/api/verifications/__tests__/LinkVerification.spec.ts +279 -0
  198. package/src/api/verifications/entities/verifications.ts +6 -6
  199. package/src/api/verifications/jobs/VerificationJobs.spec.ts +50 -0
  200. package/src/batch/__tests__/startup-buffering.spec.ts +458 -0
  201. package/src/batch/primitives/$batch.spec.ts +766 -0
  202. package/src/batch/providers/BatchProvider.spec.ts +786 -0
  203. package/src/bin/index.ts +0 -1
  204. package/src/bucket/__tests__/shared.ts +194 -0
  205. package/src/bucket/primitives/$bucket.spec.ts +104 -0
  206. package/src/bucket/providers/FileStorageProvider.spec.ts +13 -0
  207. package/src/bucket/providers/LocalFileStorageProvider.spec.ts +77 -0
  208. package/src/bucket/providers/MemoryFileStorageProvider.spec.ts +82 -0
  209. package/src/cache/core/__tests__/shared.ts +377 -0
  210. package/src/cache/core/primitives/$cache.spec.ts +111 -0
  211. package/src/cache/redis/__tests__/cache-redis.spec.ts +70 -0
  212. package/src/cli/apps/AlephaCli.ts +54 -16
  213. package/src/cli/apps/AlephaPackageBuilderCli.ts +2 -1
  214. package/src/cli/assets/appRouterTs.ts +1 -1
  215. package/src/cli/commands/{ViteCommands.ts → build.ts} +2 -105
  216. package/src/cli/commands/clean.ts +14 -0
  217. package/src/cli/commands/{DrizzleCommands.ts → db.ts} +10 -117
  218. package/src/cli/commands/{DeployCommands.ts → deploy.ts} +1 -1
  219. package/src/cli/commands/dev.ts +69 -0
  220. package/src/cli/commands/format.ts +17 -0
  221. package/src/cli/commands/gen/changelog.spec.ts +315 -0
  222. package/src/cli/commands/{ChangelogCommands.ts → gen/changelog.ts} +16 -31
  223. package/src/cli/commands/gen/openapi.ts +71 -0
  224. package/src/cli/commands/gen.ts +18 -0
  225. package/src/cli/commands/{CoreCommands.ts → init.ts} +4 -40
  226. package/src/cli/commands/lint.ts +17 -0
  227. package/src/cli/commands/root.ts +41 -0
  228. package/src/cli/commands/run.ts +24 -0
  229. package/src/cli/commands/test.ts +42 -0
  230. package/src/cli/commands/typecheck.ts +24 -0
  231. package/src/cli/commands/{VerifyCommands.ts → verify.ts} +1 -13
  232. package/src/cli/defineConfig.ts +10 -1
  233. package/src/cli/index.ts +17 -7
  234. package/src/cli/services/AlephaCliUtils.ts +71 -32
  235. package/src/cli/services/GitMessageParser.ts +1 -1
  236. package/src/command/helpers/Asker.spec.ts +127 -0
  237. package/src/command/helpers/Runner.spec.ts +126 -0
  238. package/src/command/primitives/$command.spec.ts +1588 -0
  239. package/src/command/providers/CliProvider.ts +74 -24
  240. package/src/core/Alepha.ts +52 -4
  241. package/src/core/__tests__/Alepha-emit.spec.ts +22 -0
  242. package/src/core/__tests__/Alepha-graph.spec.ts +93 -0
  243. package/src/core/__tests__/Alepha-has.spec.ts +41 -0
  244. package/src/core/__tests__/Alepha-inject.spec.ts +93 -0
  245. package/src/core/__tests__/Alepha-register.spec.ts +81 -0
  246. package/src/core/__tests__/Alepha-start.spec.ts +176 -0
  247. package/src/core/__tests__/Alepha-with.spec.ts +14 -0
  248. package/src/core/__tests__/TypeBox-usecases.spec.ts +35 -0
  249. package/src/core/__tests__/TypeBoxLocale.spec.ts +15 -0
  250. package/src/core/__tests__/descriptor.spec.ts +34 -0
  251. package/src/core/__tests__/fixtures/A.ts +5 -0
  252. package/src/core/__tests__/pagination.spec.ts +77 -0
  253. package/src/core/helpers/jsonSchemaToTypeBox.ts +2 -2
  254. package/src/core/primitives/$atom.spec.ts +43 -0
  255. package/src/core/primitives/$hook.spec.ts +130 -0
  256. package/src/core/primitives/$inject.spec.ts +175 -0
  257. package/src/core/primitives/$module.spec.ts +115 -0
  258. package/src/core/providers/CodecManager.spec.ts +740 -0
  259. package/src/core/providers/EventManager.spec.ts +762 -0
  260. package/src/core/providers/EventManager.ts +4 -0
  261. package/src/core/providers/StateManager.spec.ts +365 -0
  262. package/src/core/providers/TypeProvider.spec.ts +1607 -0
  263. package/src/core/providers/TypeProvider.ts +20 -26
  264. package/src/datetime/primitives/$interval.spec.ts +103 -0
  265. package/src/datetime/providers/DateTimeProvider.spec.ts +86 -0
  266. package/src/email/primitives/$email.spec.ts +175 -0
  267. package/src/email/providers/LocalEmailProvider.spec.ts +341 -0
  268. package/src/fake/__tests__/keyName.example.ts +40 -0
  269. package/src/fake/__tests__/keyName.spec.ts +152 -0
  270. package/src/fake/__tests__/module.example.ts +32 -0
  271. package/src/fake/providers/FakeProvider.spec.ts +438 -0
  272. package/src/file/providers/FileSystemProvider.ts +8 -0
  273. package/src/file/providers/NodeFileSystemProvider.spec.ts +418 -0
  274. package/src/file/providers/NodeFileSystemProvider.ts +5 -0
  275. package/src/file/services/FileDetector.spec.ts +591 -0
  276. package/src/lock/core/__tests__/shared.ts +190 -0
  277. package/src/lock/core/providers/MemoryLockProvider.spec.ts +25 -0
  278. package/src/lock/redis/providers/RedisLockProvider.spec.ts +25 -0
  279. package/src/logger/__tests__/SimpleFormatterProvider.spec.ts +109 -0
  280. package/src/logger/primitives/$logger.spec.ts +108 -0
  281. package/src/logger/services/Logger.spec.ts +295 -0
  282. package/src/mcp/__tests__/errors.spec.ts +175 -0
  283. package/src/mcp/__tests__/integration.spec.ts +450 -0
  284. package/src/mcp/helpers/jsonrpc.spec.ts +380 -0
  285. package/src/mcp/primitives/$prompt.spec.ts +468 -0
  286. package/src/mcp/primitives/$resource.spec.ts +390 -0
  287. package/src/mcp/primitives/$tool.spec.ts +406 -0
  288. package/src/mcp/providers/McpServerProvider.spec.ts +797 -0
  289. package/src/orm/__tests__/$repository-crud.spec.ts +276 -0
  290. package/src/orm/__tests__/$repository-hooks.spec.ts +325 -0
  291. package/src/orm/__tests__/$repository-orderBy.spec.ts +128 -0
  292. package/src/orm/__tests__/$repository-pagination-sort.spec.ts +149 -0
  293. package/src/orm/__tests__/$repository-save.spec.ts +37 -0
  294. package/src/orm/__tests__/ModelBuilder-integration.spec.ts +490 -0
  295. package/src/orm/__tests__/ModelBuilder-types.spec.ts +186 -0
  296. package/src/orm/__tests__/PostgresProvider.spec.ts +46 -0
  297. package/src/orm/__tests__/delete-returning.spec.ts +256 -0
  298. package/src/orm/__tests__/deletedAt.spec.ts +80 -0
  299. package/src/orm/__tests__/enums.spec.ts +315 -0
  300. package/src/orm/__tests__/execute.spec.ts +72 -0
  301. package/src/orm/__tests__/fixtures/bigEntitySchema.ts +65 -0
  302. package/src/orm/__tests__/fixtures/userEntitySchema.ts +27 -0
  303. package/src/orm/__tests__/joins.spec.ts +1114 -0
  304. package/src/orm/__tests__/page.spec.ts +287 -0
  305. package/src/orm/__tests__/primaryKey.spec.ts +87 -0
  306. package/src/orm/__tests__/query-date-encoding.spec.ts +402 -0
  307. package/src/orm/__tests__/ref-auto-onDelete.spec.ts +156 -0
  308. package/src/orm/__tests__/references.spec.ts +102 -0
  309. package/src/orm/__tests__/security.spec.ts +710 -0
  310. package/src/orm/__tests__/sqlite.spec.ts +111 -0
  311. package/src/orm/__tests__/string-operators.spec.ts +429 -0
  312. package/src/orm/__tests__/timestamps.spec.ts +388 -0
  313. package/src/orm/__tests__/validation.spec.ts +183 -0
  314. package/src/orm/__tests__/version.spec.ts +64 -0
  315. package/src/orm/helpers/parseQueryString.spec.ts +196 -0
  316. package/src/orm/index.browser.ts +1 -1
  317. package/src/orm/index.ts +10 -6
  318. package/src/orm/primitives/$repository.spec.ts +137 -0
  319. package/src/orm/primitives/$sequence.spec.ts +29 -0
  320. package/src/orm/primitives/$transaction.spec.ts +82 -0
  321. package/src/orm/providers/{PostgresTypeProvider.ts → DatabaseTypeProvider.ts} +25 -3
  322. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -3
  323. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  324. package/src/orm/providers/drivers/CloudflareD1Provider.ts +1 -1
  325. package/src/orm/providers/drivers/DatabaseProvider.ts +1 -1
  326. package/src/orm/providers/drivers/NodePostgresProvider.ts +3 -3
  327. package/src/orm/providers/drivers/NodeSqliteProvider.ts +1 -1
  328. package/src/orm/providers/drivers/PglitePostgresProvider.ts +2 -2
  329. package/src/orm/services/ModelBuilder.spec.ts +575 -0
  330. package/src/orm/services/Repository.spec.ts +137 -0
  331. package/src/queue/core/__tests__/shared.ts +143 -0
  332. package/src/queue/core/providers/MemoryQueueProvider.spec.ts +23 -0
  333. package/src/queue/core/providers/WorkerProvider.spec.ts +378 -0
  334. package/src/queue/redis/providers/RedisQueueProvider.spec.ts +23 -0
  335. package/src/redis/__tests__/redis.spec.ts +58 -0
  336. package/src/retry/primitives/$retry.spec.ts +234 -0
  337. package/src/retry/providers/RetryProvider.spec.ts +438 -0
  338. package/src/router/__tests__/match.spec.ts +252 -0
  339. package/src/router/providers/RouterProvider.spec.ts +197 -0
  340. package/src/scheduler/__tests__/$scheduler-cron.spec.ts +25 -0
  341. package/src/scheduler/__tests__/$scheduler-interval.spec.ts +25 -0
  342. package/src/scheduler/__tests__/shared.ts +77 -0
  343. package/src/security/__tests__/bug-1-wildcard-after-start.spec.ts +229 -0
  344. package/src/security/__tests__/bug-2-password-validation.spec.ts +245 -0
  345. package/src/security/__tests__/bug-3-regex-vulnerability.spec.ts +407 -0
  346. package/src/security/__tests__/bug-4-oauth2-validation.spec.ts +439 -0
  347. package/src/security/__tests__/multi-layer-permissions.spec.ts +522 -0
  348. package/src/security/primitives/$permission.spec.ts +30 -0
  349. package/src/security/primitives/$permission.ts +2 -2
  350. package/src/security/primitives/$realm.spec.ts +101 -0
  351. package/src/security/primitives/$role.spec.ts +52 -0
  352. package/src/security/primitives/$serviceAccount.spec.ts +61 -0
  353. package/src/security/providers/SecurityProvider.spec.ts +350 -0
  354. package/src/server/auth/providers/ServerAuthProvider.ts +0 -2
  355. package/src/server/cache/providers/ServerCacheProvider.spec.ts +942 -0
  356. package/src/server/compress/providers/ServerCompressProvider.spec.ts +31 -0
  357. package/src/server/compress/providers/ServerCompressProvider.ts +2 -0
  358. package/src/server/cookies/providers/ServerCookiesProvider.spec.ts +253 -0
  359. package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +334 -0
  360. package/src/server/core/__tests__/ServerRouterProvider-requestId.spec.ts +129 -0
  361. package/src/server/core/primitives/$action.spec.ts +191 -0
  362. package/src/server/core/primitives/$route.spec.ts +65 -0
  363. package/src/server/core/providers/ServerBodyParserProvider.spec.ts +93 -0
  364. package/src/server/core/providers/ServerLoggerProvider.spec.ts +100 -0
  365. package/src/server/core/providers/ServerProvider.ts +3 -1
  366. package/src/server/core/services/HttpClient.spec.ts +123 -0
  367. package/src/server/core/services/UserAgentParser.spec.ts +111 -0
  368. package/src/server/cors/providers/ServerCorsProvider.spec.ts +481 -0
  369. package/src/server/health/providers/ServerHealthProvider.spec.ts +22 -0
  370. package/src/server/helmet/providers/ServerHelmetProvider.spec.ts +105 -0
  371. package/src/server/links/__tests__/$action.spec.ts +238 -0
  372. package/src/server/links/__tests__/fixtures/CrudApp.ts +122 -0
  373. package/src/server/links/__tests__/requestId.spec.ts +120 -0
  374. package/src/server/links/primitives/$remote.spec.ts +228 -0
  375. package/src/server/links/providers/LinkProvider.spec.ts +54 -0
  376. package/src/server/links/providers/LinkProvider.ts +49 -3
  377. package/src/server/links/providers/ServerLinksProvider.ts +1 -53
  378. package/src/server/links/schemas/apiLinksResponseSchema.ts +7 -0
  379. package/src/server/metrics/providers/ServerMetricsProvider.spec.ts +25 -0
  380. package/src/server/multipart/providers/ServerMultipartProvider.spec.ts +528 -0
  381. package/src/server/proxy/primitives/$proxy.spec.ts +87 -0
  382. package/src/server/rate-limit/__tests__/ActionRateLimit.spec.ts +211 -0
  383. package/src/server/rate-limit/providers/ServerRateLimitProvider.spec.ts +344 -0
  384. package/src/server/security/__tests__/BasicAuth.spec.ts +684 -0
  385. package/src/server/security/__tests__/ServerSecurityProvider-realm.spec.ts +388 -0
  386. package/src/server/security/providers/ServerSecurityProvider.spec.ts +123 -0
  387. package/src/server/static/primitives/$serve.spec.ts +193 -0
  388. package/src/server/swagger/__tests__/ui.spec.ts +52 -0
  389. package/src/server/swagger/primitives/$swagger.spec.ts +193 -0
  390. package/src/server/swagger/providers/ServerSwaggerProvider.ts +18 -8
  391. package/src/sms/primitives/$sms.spec.ts +165 -0
  392. package/src/sms/providers/LocalSmsProvider.spec.ts +224 -0
  393. package/src/sms/providers/MemorySmsProvider.spec.ts +193 -0
  394. package/src/thread/primitives/$thread.spec.ts +186 -0
  395. package/src/topic/core/__tests__/shared.ts +144 -0
  396. package/src/topic/core/providers/MemoryTopicProvider.spec.ts +23 -0
  397. package/src/topic/redis/providers/RedisTopicProvider.spec.ts +23 -0
  398. package/src/vite/plugins/viteAlephaDev.ts +16 -4
  399. package/src/vite/tasks/runAlepha.ts +7 -1
  400. package/src/websocket/__tests__/$websocket-new.spec.ts +195 -0
  401. package/src/websocket/primitives/$channel.spec.ts +30 -0
  402. package/src/cli/commands/BiomeCommands.ts +0 -29
@@ -2,15 +2,16 @@ import * as alepha23 from "alepha";
2
2
  import { Alepha, AlephaError, Page, PageQuery, Primitive, Static, StaticEncode, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
3
  import * as alepha_api_notifications0 from "alepha/api/notifications";
4
4
  import { VerificationController } from "alepha/api/verifications";
5
- import * as alepha_orm204 from "alepha/orm";
6
- import { Page as Page$1, Repository } from "alepha/orm";
7
5
  import * as alepha_server0 from "alepha/server";
8
- import * as alepha_logger1 from "alepha/logger";
6
+ import * as alepha_orm24 from "alepha/orm";
7
+ import { Page as Page$1, Repository } from "alepha/orm";
8
+ import { AuditService } from "alepha/api/audits";
9
+ import * as alepha_logger5 from "alepha/logger";
9
10
  import * as alepha_bucket0 from "alepha/bucket";
11
+ import * as alepha_server_links0 from "alepha/server/links";
10
12
  import * as alepha_cache0 from "alepha/cache";
11
13
  import { DateTime, DateTimeProvider } from "alepha/datetime";
12
14
  import { CryptoProvider, RealmPrimitive, RealmPrimitiveOptions, UserAccount } from "alepha/security";
13
- import * as alepha_server_links0 from "alepha/server/links";
14
15
  import { OAuth2Profile, ServerAuthProvider, WithLinkFn, WithLoginFn } from "alepha/server/auth";
15
16
  import { FileSystemProvider } from "alepha/file";
16
17
  import { FileController } from "alepha/api/files";
@@ -58,485 +59,91 @@ declare const realmAuthSettingsAtom: alepha23.Atom<alepha23.TObject<{
58
59
  }>, "alepha.api.users.realmAuthSettings">;
59
60
  type RealmAuthSettings = Static<typeof realmAuthSettingsAtom.schema>;
60
61
  //#endregion
61
- //#region ../../src/api/users/entities/identities.d.ts
62
- declare const identities: alepha_orm204.EntityPrimitive<alepha23.TObject<{
63
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
64
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
65
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
66
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
67
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
68
- password: alepha23.TOptional<alepha23.TString>;
69
- provider: alepha23.TString;
70
- providerUserId: alepha23.TOptional<alepha23.TString>;
71
- providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
72
- }>>;
73
- type IdentityEntity = Static<typeof identities.schema>;
74
- //#endregion
75
- //#region ../../src/api/users/entities/sessions.d.ts
76
- declare const sessions: alepha_orm204.EntityPrimitive<alepha23.TObject<{
77
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
78
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
79
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
80
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
81
- refreshToken: alepha23.TString;
82
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
83
- expiresAt: alepha23.TString;
84
- ip: alepha23.TOptional<alepha23.TString>;
85
- userAgent: alepha23.TOptional<alepha23.TObject<{
86
- os: alepha23.TString;
87
- browser: alepha23.TString;
88
- device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
89
- }>>;
90
- }>>;
91
- type SessionEntity = Static<typeof sessions.schema>;
92
- //#endregion
93
- //#region ../../src/api/users/entities/users.d.ts
94
- declare const DEFAULT_USER_REALM_NAME = "default";
95
- declare const users: alepha_orm204.EntityPrimitive<alepha23.TObject<{
96
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
97
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
98
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
99
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
100
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
101
- username: alepha23.TOptional<alepha23.TString>;
102
- email: alepha23.TOptional<alepha23.TString>;
103
- phoneNumber: alepha23.TOptional<alepha23.TString>;
104
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
105
- firstName: alepha23.TOptional<alepha23.TString>;
106
- lastName: alepha23.TOptional<alepha23.TString>;
107
- picture: alepha23.TOptional<alepha23.TString>;
108
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
109
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
110
- }>>;
111
- type UserEntity = Static<typeof users.schema>;
112
- //#endregion
113
- //#region ../../src/api/users/primitives/$userRealm.d.ts
114
- type UserRealmPrimitive = RealmPrimitive & WithLinkFn & WithLoginFn;
62
+ //#region ../../src/orm/schemas/insertSchema.d.ts
115
63
  /**
116
- * Already configured realm for user management.
117
- *
118
- * Realm contains two roles: `admin` and `user`.
119
- *
120
- * - `admin`: Has full access to all resources and permissions.
121
- * - `user`: Has access to their own resources and permissions, but cannot access admin-level resources.
122
- *
123
- * Realm uses session management for handling user sessions.
64
+ * Transforms a TObject schema for insert operations.
65
+ * All default properties at the root level are made optional.
124
66
  *
125
- * Environment Variables:
126
- * - `APP_SECRET`: Secret key for signing tokens (if not provided in options).
67
+ * @example
68
+ * Before: { name: string; age: number(default=0); }
69
+ * After: { name: string; age?: number; }
127
70
  */
128
- declare const $userRealm: (options?: UserRealmOptions) => UserRealmPrimitive;
129
- interface UserRealmOptions {
130
- /**
131
- * Secret key for signing tokens.
132
- *
133
- * If not provided, the secret from the SecurityProvider will be used (usually from the APP_SECRET environment variable).
134
- */
135
- secret?: string;
136
- /**
137
- * Realm configuration options.
138
- *
139
- * It's already pre-configured for user management with admin and user roles.
140
- */
141
- realm?: Partial<RealmPrimitiveOptions>;
142
- /**
143
- * Override entities.
144
- */
145
- entities?: {
146
- users?: Repository<typeof users.schema>;
147
- identities?: Repository<typeof identities.schema>;
148
- sessions?: Repository<typeof sessions.schema>;
149
- };
150
- settings?: Partial<RealmAuthSettings>;
151
- identities?: {
152
- credentials?: true;
153
- google?: true;
154
- github?: true;
155
- };
156
- modules?: {
157
- files?: boolean;
158
- audits?: boolean;
159
- jobs?: boolean;
160
- };
161
- }
162
- //#endregion
163
- //#region ../../src/api/users/providers/UserRealmProvider.d.ts
164
- interface UserRealmRepositories {
165
- identities: Repository<typeof identities.schema>;
166
- sessions: Repository<typeof sessions.schema>;
167
- users: Repository<typeof users.schema>;
168
- }
169
- interface UserRealm {
170
- name: string;
171
- repositories: UserRealmRepositories;
172
- settings: RealmAuthSettings;
173
- }
174
- declare class UserRealmProvider {
175
- protected readonly alepha: Alepha;
176
- protected readonly defaultIdentities: Repository<alepha23.TObject<{
177
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
178
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
179
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
180
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
181
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
182
- password: alepha23.TOptional<alepha23.TString>;
183
- provider: alepha23.TString;
184
- providerUserId: alepha23.TOptional<alepha23.TString>;
185
- providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
186
- }>>;
187
- protected readonly defaultSessions: Repository<alepha23.TObject<{
188
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
189
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
190
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
191
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
192
- refreshToken: alepha23.TString;
193
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
194
- expiresAt: alepha23.TString;
195
- ip: alepha23.TOptional<alepha23.TString>;
196
- userAgent: alepha23.TOptional<alepha23.TObject<{
197
- os: alepha23.TString;
198
- browser: alepha23.TString;
199
- device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
200
- }>>;
201
- }>>;
202
- protected readonly defaultUsers: Repository<alepha23.TObject<{
203
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
204
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
205
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
206
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
207
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
208
- username: alepha23.TOptional<alepha23.TString>;
209
- email: alepha23.TOptional<alepha23.TString>;
210
- phoneNumber: alepha23.TOptional<alepha23.TString>;
211
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
212
- firstName: alepha23.TOptional<alepha23.TString>;
213
- lastName: alepha23.TOptional<alepha23.TString>;
214
- picture: alepha23.TOptional<alepha23.TString>;
215
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
216
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
217
- }>>;
218
- protected realms: Map<string, UserRealm>;
219
- avatars: alepha_bucket0.BucketPrimitive;
220
- protected readonly onConfigure: alepha23.HookPrimitive<"configure">;
221
- register(userRealmName: string, userRealmOptions?: UserRealmOptions): UserRealm;
222
- /**
223
- * Gets a registered realm by name, auto-creating default if needed.
224
- */
225
- getRealm(userRealmName?: string): UserRealm;
226
- identityRepository(userRealmName?: string): Repository<typeof identities.schema>;
227
- sessionRepository(userRealmName?: string): Repository<typeof sessions.schema>;
228
- userRepository(userRealmName?: string): Repository<typeof users.schema>;
229
- }
71
+ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends {
72
+ [PG_DEFAULT]: any;
73
+ } | {
74
+ "~optional": true;
75
+ } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
230
76
  //#endregion
231
- //#region ../../src/api/users/schemas/identityQuerySchema.d.ts
232
- declare const identityQuerySchema: alepha23.TObject<{
233
- page: alepha23.TOptional<alepha23.TInteger>;
234
- size: alepha23.TOptional<alepha23.TInteger>;
235
- sort: alepha23.TOptional<alepha23.TString>;
236
- userId: alepha23.TOptional<alepha23.TString>;
237
- provider: alepha23.TOptional<alepha23.TString>;
238
- }>;
239
- type IdentityQuery = Static<typeof identityQuerySchema>;
77
+ //#region ../../src/orm/schemas/updateSchema.d.ts
78
+ /**
79
+ * Transforms a TObject schema for update operations.
80
+ * All optional properties at the root level are made nullable (i.e., `T | null`).
81
+ * This allows an API endpoint to explicitly accept `null` to clear an optional field in the database.
82
+ *
83
+ * @example
84
+ * Before: { name?: string; age: number; }
85
+ * After: { name?: string | null; age: number; }
86
+ */
87
+ 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] }>;
240
88
  //#endregion
241
- //#region ../../src/api/users/services/IdentityService.d.ts
242
- declare class IdentityService {
243
- protected readonly log: alepha_logger1.Logger;
244
- protected readonly userRealmProvider: UserRealmProvider;
245
- identities(userRealmName?: string): alepha_orm204.Repository<alepha23.TObject<{
246
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
247
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
248
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
249
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
250
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
251
- password: alepha23.TOptional<alepha23.TString>;
252
- provider: alepha23.TString;
253
- providerUserId: alepha23.TOptional<alepha23.TString>;
254
- providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
255
- }>>;
89
+ //#region ../../src/orm/primitives/$entity.d.ts
90
+ interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
256
91
  /**
257
- * Find identities with pagination and filtering.
92
+ * The database table name that will be created for this entity.
93
+ * If not provided, name will be inferred from the $repository variable name.
258
94
  */
259
- findIdentities(q?: IdentityQuery, userRealmName?: string): Promise<Page$1<IdentityEntity>>;
95
+ name: string;
260
96
  /**
261
- * Get an identity by ID.
97
+ * TypeBox schema defining the table structure and column types.
262
98
  */
263
- getIdentityById(id: string, userRealmName?: string): Promise<IdentityEntity>;
99
+ schema: T;
264
100
  /**
265
- * Delete an identity by ID.
101
+ * Database indexes to create for query optimization.
266
102
  */
267
- deleteIdentity(id: string, userRealmName?: string): Promise<void>;
268
- }
269
- //#endregion
270
- //#region ../../src/api/users/controllers/IdentityController.d.ts
271
- declare class IdentityController {
272
- protected readonly url = "/identities";
273
- protected readonly group = "identities";
274
- protected readonly identityService: IdentityService;
103
+ indexes?: (Keys | {
104
+ /**
105
+ * Single column to index.
106
+ */
107
+ column: Keys;
108
+ /**
109
+ * Whether this should be a unique index (enforces uniqueness constraint).
110
+ */
111
+ unique?: boolean;
112
+ /**
113
+ * Custom name for the index. If not provided, generates name automatically.
114
+ */
115
+ name?: string;
116
+ } | {
117
+ /**
118
+ * Multiple columns for composite index (order matters for query optimization).
119
+ */
120
+ columns: Keys[];
121
+ /**
122
+ * Whether this should be a unique index (enforces uniqueness constraint).
123
+ */
124
+ unique?: boolean;
125
+ /**
126
+ * Custom name for the index. If not provided, generates name automatically.
127
+ */
128
+ name?: string;
129
+ })[];
275
130
  /**
276
- * Find identities with pagination and filtering.
131
+ * Foreign key constraints to maintain referential integrity.
277
132
  */
278
- readonly findIdentities: alepha_server0.ActionPrimitiveFn<{
279
- query: alepha23.TObject<{
280
- page: alepha23.TOptional<alepha23.TInteger>;
281
- size: alepha23.TOptional<alepha23.TInteger>;
282
- sort: alepha23.TOptional<alepha23.TString>;
283
- userId: alepha23.TOptional<alepha23.TString>;
284
- provider: alepha23.TOptional<alepha23.TString>;
285
- userRealmName: alepha23.TOptional<alepha23.TString>;
286
- }>;
287
- response: alepha23.TPage<alepha23.TObject<{
288
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
289
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
290
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
291
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
292
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
293
- provider: alepha23.TString;
294
- providerUserId: alepha23.TOptional<alepha23.TString>;
295
- providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
296
- }>>;
297
- }>;
298
- /**
299
- * Get an identity by ID.
300
- */
301
- readonly getIdentity: alepha_server0.ActionPrimitiveFn<{
302
- params: alepha23.TObject<{
303
- id: alepha23.TString;
304
- }>;
305
- query: alepha23.TObject<{
306
- userRealmName: alepha23.TOptional<alepha23.TString>;
307
- }>;
308
- response: alepha23.TObject<{
309
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
310
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
311
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
312
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
313
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
314
- provider: alepha23.TString;
315
- providerUserId: alepha23.TOptional<alepha23.TString>;
316
- providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
317
- }>;
318
- }>;
319
- /**
320
- * Delete an identity.
321
- */
322
- readonly deleteIdentity: alepha_server0.ActionPrimitiveFn<{
323
- params: alepha23.TObject<{
324
- id: alepha23.TString;
325
- }>;
326
- query: alepha23.TObject<{
327
- userRealmName: alepha23.TOptional<alepha23.TString>;
328
- }>;
329
- response: alepha23.TObject<{
330
- ok: alepha23.TBoolean;
331
- id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
332
- count: alepha23.TOptional<alepha23.TNumber>;
333
- }>;
334
- }>;
335
- }
336
- //#endregion
337
- //#region ../../src/api/users/schemas/sessionQuerySchema.d.ts
338
- declare const sessionQuerySchema: alepha23.TObject<{
339
- page: alepha23.TOptional<alepha23.TInteger>;
340
- size: alepha23.TOptional<alepha23.TInteger>;
341
- sort: alepha23.TOptional<alepha23.TString>;
342
- userId: alepha23.TOptional<alepha23.TString>;
343
- }>;
344
- type SessionQuery = Static<typeof sessionQuerySchema>;
345
- //#endregion
346
- //#region ../../src/api/users/services/SessionCrudService.d.ts
347
- declare class SessionCrudService {
348
- protected readonly log: alepha_logger1.Logger;
349
- protected readonly userRealmProvider: UserRealmProvider;
350
- sessions(userRealmName?: string): alepha_orm204.Repository<alepha23.TObject<{
351
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
352
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
353
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
354
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
355
- refreshToken: alepha23.TString;
356
- userId: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_REF>;
357
- expiresAt: alepha23.TString;
358
- ip: alepha23.TOptional<alepha23.TString>;
359
- userAgent: alepha23.TOptional<alepha23.TObject<{
360
- os: alepha23.TString;
361
- browser: alepha23.TString;
362
- device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
363
- }>>;
364
- }>>;
365
- /**
366
- * Find sessions with pagination and filtering.
367
- */
368
- findSessions(q?: SessionQuery, userRealmName?: string): Promise<Page$1<SessionEntity>>;
369
- /**
370
- * Get a session by ID.
371
- */
372
- getSessionById(id: string, userRealmName?: string): Promise<SessionEntity>;
373
- /**
374
- * Delete a session by ID.
375
- */
376
- deleteSession(id: string, userRealmName?: string): Promise<void>;
377
- }
378
- //#endregion
379
- //#region ../../src/api/users/controllers/SessionController.d.ts
380
- declare class SessionController {
381
- protected readonly url = "/sessions";
382
- protected readonly group = "sessions";
383
- protected readonly sessionService: SessionCrudService;
384
- /**
385
- * Find sessions with pagination and filtering.
386
- */
387
- readonly findSessions: alepha_server0.ActionPrimitiveFn<{
388
- query: alepha23.TObject<{
389
- page: alepha23.TOptional<alepha23.TInteger>;
390
- size: alepha23.TOptional<alepha23.TInteger>;
391
- sort: alepha23.TOptional<alepha23.TString>;
392
- userId: alepha23.TOptional<alepha23.TString>;
393
- userRealmName: alepha23.TOptional<alepha23.TString>;
394
- }>;
395
- response: alepha23.TPage<alepha23.TObject<{
396
- id: alepha23.TString;
397
- version: alepha23.TNumber;
398
- createdAt: alepha23.TString;
399
- updatedAt: alepha23.TString;
400
- refreshToken: alepha23.TString;
401
- userId: alepha23.TString;
402
- expiresAt: alepha23.TString;
403
- ip: alepha23.TOptional<alepha23.TString>;
404
- userAgent: alepha23.TOptional<alepha23.TObject<{
405
- os: alepha23.TString;
406
- browser: alepha23.TString;
407
- device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
408
- }>>;
409
- }>>;
410
- }>;
411
- /**
412
- * Get a session by ID.
413
- */
414
- readonly getSession: alepha_server0.ActionPrimitiveFn<{
415
- params: alepha23.TObject<{
416
- id: alepha23.TString;
417
- }>;
418
- query: alepha23.TObject<{
419
- userRealmName: alepha23.TOptional<alepha23.TString>;
420
- }>;
421
- response: alepha23.TObject<{
422
- id: alepha23.TString;
423
- version: alepha23.TNumber;
424
- createdAt: alepha23.TString;
425
- updatedAt: alepha23.TString;
426
- refreshToken: alepha23.TString;
427
- userId: alepha23.TString;
428
- expiresAt: alepha23.TString;
429
- ip: alepha23.TOptional<alepha23.TString>;
430
- userAgent: alepha23.TOptional<alepha23.TObject<{
431
- os: alepha23.TString;
432
- browser: alepha23.TString;
433
- device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
434
- }>>;
435
- }>;
436
- }>;
437
- /**
438
- * Delete a session.
439
- */
440
- readonly deleteSession: alepha_server0.ActionPrimitiveFn<{
441
- params: alepha23.TObject<{
442
- id: alepha23.TString;
443
- }>;
444
- query: alepha23.TObject<{
445
- userRealmName: alepha23.TOptional<alepha23.TString>;
446
- }>;
447
- response: alepha23.TObject<{
448
- ok: alepha23.TBoolean;
449
- id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
450
- count: alepha23.TOptional<alepha23.TNumber>;
451
- }>;
452
- }>;
453
- }
454
- //#endregion
455
- //#region ../../src/orm/schemas/insertSchema.d.ts
456
- /**
457
- * Transforms a TObject schema for insert operations.
458
- * All default properties at the root level are made optional.
459
- *
460
- * @example
461
- * Before: { name: string; age: number(default=0); }
462
- * After: { name: string; age?: number; }
463
- */
464
- type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends {
465
- [PG_DEFAULT]: any;
466
- } | {
467
- "~optional": true;
468
- } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
469
- //#endregion
470
- //#region ../../src/orm/schemas/updateSchema.d.ts
471
- /**
472
- * Transforms a TObject schema for update operations.
473
- * All optional properties at the root level are made nullable (i.e., `T | null`).
474
- * This allows an API endpoint to explicitly accept `null` to clear an optional field in the database.
475
- *
476
- * @example
477
- * Before: { name?: string; age: number; }
478
- * After: { name?: string | null; age: number; }
479
- */
480
- 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] }>;
481
- //#endregion
482
- //#region ../../src/orm/primitives/$entity.d.ts
483
- interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
484
- /**
485
- * The database table name that will be created for this entity.
486
- * If not provided, name will be inferred from the $repository variable name.
487
- */
488
- name: string;
489
- /**
490
- * TypeBox schema defining the table structure and column types.
491
- */
492
- schema: T;
493
- /**
494
- * Database indexes to create for query optimization.
495
- */
496
- indexes?: (Keys | {
497
- /**
498
- * Single column to index.
499
- */
500
- column: Keys;
501
- /**
502
- * Whether this should be a unique index (enforces uniqueness constraint).
503
- */
504
- unique?: boolean;
505
- /**
506
- * Custom name for the index. If not provided, generates name automatically.
507
- */
508
- name?: string;
509
- } | {
510
- /**
511
- * Multiple columns for composite index (order matters for query optimization).
512
- */
513
- columns: Keys[];
514
- /**
515
- * Whether this should be a unique index (enforces uniqueness constraint).
516
- */
517
- unique?: boolean;
518
- /**
519
- * Custom name for the index. If not provided, generates name automatically.
520
- */
521
- name?: string;
522
- })[];
523
- /**
524
- * Foreign key constraints to maintain referential integrity.
525
- */
526
- foreignKeys?: Array<{
527
- /**
528
- * Optional name for the foreign key constraint.
529
- */
530
- name?: string;
531
- /**
532
- * Local columns that reference the foreign table.
533
- */
534
- columns: Array<keyof Static<T>>;
535
- /**
536
- * Referenced columns in the foreign table.
537
- * Must be EntityColumn references from other entities.
538
- */
539
- foreignColumns: Array<() => EntityColumn<any>>;
133
+ foreignKeys?: Array<{
134
+ /**
135
+ * Optional name for the foreign key constraint.
136
+ */
137
+ name?: string;
138
+ /**
139
+ * Local columns that reference the foreign table.
140
+ */
141
+ columns: Array<keyof Static<T>>;
142
+ /**
143
+ * Referenced columns in the foreign table.
144
+ * Must be EntityColumn references from other entities.
145
+ */
146
+ foreignColumns: Array<() => EntityColumn<any>>;
540
147
  }>;
541
148
  /**
542
149
  * Additional table constraints for data validation.
@@ -1303,7 +910,7 @@ declare abstract class ModelBuilder {
1303
910
  //#endregion
1304
911
  //#region ../../src/orm/providers/DrizzleKitProvider.d.ts
1305
912
  declare class DrizzleKitProvider {
1306
- protected readonly log: alepha_logger1.Logger;
913
+ protected readonly log: alepha_logger5.Logger;
1307
914
  protected readonly alepha: Alepha;
1308
915
  /**
1309
916
  * Synchronize database with current schema definitions.
@@ -1351,7 +958,7 @@ type DevMigrations = Static<typeof devMigrationsSchema>;
1351
958
  type SQLLike = SQLWrapper | string;
1352
959
  declare abstract class DatabaseProvider {
1353
960
  protected readonly alepha: Alepha;
1354
- protected readonly log: alepha_logger1.Logger;
961
+ protected readonly log: alepha_logger5.Logger;
1355
962
  protected abstract readonly builder: ModelBuilder;
1356
963
  protected abstract readonly kit: DrizzleKitProvider;
1357
964
  abstract readonly db: PgDatabase<any>;
@@ -1374,7 +981,7 @@ declare abstract class DatabaseProvider {
1374
981
  /**
1375
982
  * Base migration orchestration - handles environment logic
1376
983
  */
1377
- protected migrateDatabase(): Promise<void>;
984
+ migrate(): Promise<void>;
1378
985
  /**
1379
986
  * Production: run migrations from folder
1380
987
  */
@@ -1960,35 +1567,694 @@ declare module "alepha" {
1960
1567
  }
1961
1568
  }
1962
1569
  //#endregion
1963
- //#region ../../src/api/users/notifications/UserNotifications.d.ts
1964
- declare class UserNotifications {
1965
- readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1966
- email: alepha23.TString;
1967
- code: alepha23.TString;
1968
- expiresInMinutes: alepha23.TNumber;
1969
- }>>;
1970
- readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1971
- email: alepha23.TString;
1972
- code: alepha23.TString;
1973
- expiresInMinutes: alepha23.TNumber;
1974
- }>>;
1975
- readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1976
- phoneNumber: alepha23.TString;
1977
- code: alepha23.TString;
1978
- expiresInMinutes: alepha23.TNumber;
1979
- }>>;
1980
- readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1981
- email: alepha23.TString;
1982
- resetUrl: alepha23.TString;
1983
- expiresInMinutes: alepha23.TNumber;
1570
+ //#region ../../src/api/users/entities/identities.d.ts
1571
+ declare const identities: alepha_orm24.EntityPrimitive<alepha23.TObject<{
1572
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1573
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1574
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1575
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1576
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1577
+ password: alepha23.TOptional<alepha23.TString>;
1578
+ provider: alepha23.TString;
1579
+ providerUserId: alepha23.TOptional<alepha23.TString>;
1580
+ providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
1581
+ }>>;
1582
+ type IdentityEntity = Static<typeof identities.schema>;
1583
+ //#endregion
1584
+ //#region ../../src/api/users/entities/sessions.d.ts
1585
+ declare const sessions: alepha_orm24.EntityPrimitive<alepha23.TObject<{
1586
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1587
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1588
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1589
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1590
+ refreshToken: alepha23.TString;
1591
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1592
+ expiresAt: alepha23.TString;
1593
+ ip: alepha23.TOptional<alepha23.TString>;
1594
+ userAgent: alepha23.TOptional<alepha23.TObject<{
1595
+ os: alepha23.TString;
1596
+ browser: alepha23.TString;
1597
+ device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
1984
1598
  }>>;
1985
- readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1986
- email: alepha23.TString;
1599
+ }>>;
1600
+ type SessionEntity = Static<typeof sessions.schema>;
1601
+ //#endregion
1602
+ //#region ../../src/api/users/entities/users.d.ts
1603
+ declare const DEFAULT_USER_REALM_NAME = "default";
1604
+ declare const users: alepha_orm24.EntityPrimitive<alepha23.TObject<{
1605
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1606
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1607
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1608
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1609
+ realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
1610
+ username: alepha23.TOptional<alepha23.TString>;
1611
+ email: alepha23.TOptional<alepha23.TString>;
1612
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
1613
+ roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
1614
+ firstName: alepha23.TOptional<alepha23.TString>;
1615
+ lastName: alepha23.TOptional<alepha23.TString>;
1616
+ picture: alepha23.TOptional<alepha23.TString>;
1617
+ enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
1618
+ emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
1619
+ }>>;
1620
+ type UserEntity = Static<typeof users.schema>;
1621
+ //#endregion
1622
+ //#region ../../src/api/users/primitives/$userRealm.d.ts
1623
+ type UserRealmPrimitive = RealmPrimitive & WithLinkFn & WithLoginFn;
1624
+ /**
1625
+ * Already configured realm for user management.
1626
+ *
1627
+ * Realm contains two roles: `admin` and `user`.
1628
+ *
1629
+ * - `admin`: Has full access to all resources and permissions.
1630
+ * - `user`: Has access to their own resources and permissions, but cannot access admin-level resources.
1631
+ *
1632
+ * Realm uses session management for handling user sessions.
1633
+ *
1634
+ * Environment Variables:
1635
+ * - `APP_SECRET`: Secret key for signing tokens (if not provided in options).
1636
+ */
1637
+ declare const $userRealm: (options?: UserRealmOptions) => UserRealmPrimitive;
1638
+ interface UserRealmOptions {
1639
+ /**
1640
+ * Secret key for signing tokens.
1641
+ *
1642
+ * If not provided, the secret from the SecurityProvider will be used (usually from the APP_SECRET environment variable).
1643
+ */
1644
+ secret?: string;
1645
+ /**
1646
+ * Realm configuration options.
1647
+ *
1648
+ * It's already pre-configured for user management with admin and user roles.
1649
+ */
1650
+ realm?: Partial<RealmPrimitiveOptions>;
1651
+ /**
1652
+ * Override entities.
1653
+ */
1654
+ entities?: {
1655
+ users?: Repository<typeof users.schema>;
1656
+ identities?: Repository<typeof identities.schema>;
1657
+ sessions?: Repository<typeof sessions.schema>;
1658
+ };
1659
+ settings?: Partial<RealmAuthSettings>;
1660
+ identities?: {
1661
+ credentials?: true;
1662
+ google?: true;
1663
+ github?: true;
1664
+ };
1665
+ modules?: {
1666
+ files?: boolean;
1667
+ audits?: boolean;
1668
+ jobs?: boolean;
1669
+ };
1670
+ }
1671
+ //#endregion
1672
+ //#region ../../src/api/users/providers/UserRealmProvider.d.ts
1673
+ interface UserRealmRepositories {
1674
+ identities: Repository<typeof identities.schema>;
1675
+ sessions: Repository<typeof sessions.schema>;
1676
+ users: Repository<typeof users.schema>;
1677
+ }
1678
+ interface UserRealm {
1679
+ name: string;
1680
+ repositories: UserRealmRepositories;
1681
+ settings: RealmAuthSettings;
1682
+ }
1683
+ declare class UserRealmProvider {
1684
+ protected readonly alepha: Alepha;
1685
+ protected readonly defaultIdentities: Repository<alepha23.TObject<{
1686
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1687
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1688
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1689
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1690
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1691
+ password: alepha23.TOptional<alepha23.TString>;
1692
+ provider: alepha23.TString;
1693
+ providerUserId: alepha23.TOptional<alepha23.TString>;
1694
+ providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
1695
+ }>>;
1696
+ protected readonly defaultSessions: Repository<alepha23.TObject<{
1697
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1698
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1699
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1700
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1701
+ refreshToken: alepha23.TString;
1702
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1703
+ expiresAt: alepha23.TString;
1704
+ ip: alepha23.TOptional<alepha23.TString>;
1705
+ userAgent: alepha23.TOptional<alepha23.TObject<{
1706
+ os: alepha23.TString;
1707
+ browser: alepha23.TString;
1708
+ device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
1709
+ }>>;
1710
+ }>>;
1711
+ protected readonly defaultUsers: Repository<alepha23.TObject<{
1712
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1713
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1714
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1715
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1716
+ realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
1717
+ username: alepha23.TOptional<alepha23.TString>;
1718
+ email: alepha23.TOptional<alepha23.TString>;
1719
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
1720
+ roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
1721
+ firstName: alepha23.TOptional<alepha23.TString>;
1722
+ lastName: alepha23.TOptional<alepha23.TString>;
1723
+ picture: alepha23.TOptional<alepha23.TString>;
1724
+ enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
1725
+ emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
1726
+ }>>;
1727
+ protected realms: Map<string, UserRealm>;
1728
+ avatars: alepha_bucket0.BucketPrimitive;
1729
+ protected readonly onConfigure: alepha23.HookPrimitive<"configure">;
1730
+ register(userRealmName: string, userRealmOptions?: UserRealmOptions): UserRealm;
1731
+ /**
1732
+ * Gets a registered realm by name, auto-creating default if needed.
1733
+ */
1734
+ getRealm(userRealmName?: string): UserRealm;
1735
+ identityRepository(userRealmName?: string): Repository<typeof identities.schema>;
1736
+ sessionRepository(userRealmName?: string): Repository<typeof sessions.schema>;
1737
+ userRepository(userRealmName?: string): Repository<typeof users.schema>;
1738
+ }
1739
+ //#endregion
1740
+ //#region ../../src/api/users/schemas/identityQuerySchema.d.ts
1741
+ declare const identityQuerySchema: alepha23.TObject<{
1742
+ page: alepha23.TOptional<alepha23.TInteger>;
1743
+ size: alepha23.TOptional<alepha23.TInteger>;
1744
+ sort: alepha23.TOptional<alepha23.TString>;
1745
+ userId: alepha23.TOptional<alepha23.TString>;
1746
+ provider: alepha23.TOptional<alepha23.TString>;
1747
+ }>;
1748
+ type IdentityQuery = Static<typeof identityQuerySchema>;
1749
+ //#endregion
1750
+ //#region ../../src/api/users/services/IdentityService.d.ts
1751
+ declare class IdentityService {
1752
+ protected readonly log: alepha_logger5.Logger;
1753
+ protected readonly userRealmProvider: UserRealmProvider;
1754
+ protected readonly auditService: AuditService;
1755
+ identities(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
1756
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1757
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1758
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1759
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1760
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1761
+ password: alepha23.TOptional<alepha23.TString>;
1762
+ provider: alepha23.TString;
1763
+ providerUserId: alepha23.TOptional<alepha23.TString>;
1764
+ providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
1765
+ }>>;
1766
+ /**
1767
+ * Find identities with pagination and filtering.
1768
+ */
1769
+ findIdentities(q?: IdentityQuery, userRealmName?: string): Promise<Page$1<IdentityEntity>>;
1770
+ /**
1771
+ * Get an identity by ID.
1772
+ */
1773
+ getIdentityById(id: string, userRealmName?: string): Promise<IdentityEntity>;
1774
+ /**
1775
+ * Delete an identity by ID.
1776
+ */
1777
+ deleteIdentity(id: string, userRealmName?: string): Promise<void>;
1778
+ }
1779
+ //#endregion
1780
+ //#region ../../src/api/users/controllers/AdminIdentityController.d.ts
1781
+ declare class AdminIdentityController {
1782
+ protected readonly url = "/identities";
1783
+ protected readonly group = "admin:identities";
1784
+ protected readonly identityService: IdentityService;
1785
+ /**
1786
+ * Find identities with pagination and filtering.
1787
+ */
1788
+ readonly findIdentities: alepha_server0.ActionPrimitiveFn<{
1789
+ query: alepha23.TObject<{
1790
+ page: alepha23.TOptional<alepha23.TInteger>;
1791
+ size: alepha23.TOptional<alepha23.TInteger>;
1792
+ sort: alepha23.TOptional<alepha23.TString>;
1793
+ userId: alepha23.TOptional<alepha23.TString>;
1794
+ provider: alepha23.TOptional<alepha23.TString>;
1795
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1796
+ }>;
1797
+ response: alepha23.TPage<alepha23.TObject<{
1798
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1799
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1800
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1801
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1802
+ userId: PgAttr<alepha23.TString, typeof PG_REF>;
1803
+ provider: alepha23.TString;
1804
+ providerUserId: alepha23.TOptional<alepha23.TString>;
1805
+ providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
1806
+ }>>;
1807
+ }>;
1808
+ /**
1809
+ * Get an identity by ID.
1810
+ */
1811
+ readonly getIdentity: alepha_server0.ActionPrimitiveFn<{
1812
+ params: alepha23.TObject<{
1813
+ id: alepha23.TString;
1814
+ }>;
1815
+ query: alepha23.TObject<{
1816
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1817
+ }>;
1818
+ response: alepha23.TObject<{
1819
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1820
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1821
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1822
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1823
+ userId: PgAttr<alepha23.TString, typeof PG_REF>;
1824
+ provider: alepha23.TString;
1825
+ providerUserId: alepha23.TOptional<alepha23.TString>;
1826
+ providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
1827
+ }>;
1828
+ }>;
1829
+ /**
1830
+ * Delete an identity.
1831
+ */
1832
+ readonly deleteIdentity: alepha_server0.ActionPrimitiveFn<{
1833
+ params: alepha23.TObject<{
1834
+ id: alepha23.TString;
1835
+ }>;
1836
+ query: alepha23.TObject<{
1837
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1838
+ }>;
1839
+ response: alepha23.TObject<{
1840
+ ok: alepha23.TBoolean;
1841
+ id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
1842
+ count: alepha23.TOptional<alepha23.TNumber>;
1843
+ }>;
1844
+ }>;
1845
+ }
1846
+ //#endregion
1847
+ //#region ../../src/api/users/schemas/sessionQuerySchema.d.ts
1848
+ declare const sessionQuerySchema: alepha23.TObject<{
1849
+ page: alepha23.TOptional<alepha23.TInteger>;
1850
+ size: alepha23.TOptional<alepha23.TInteger>;
1851
+ sort: alepha23.TOptional<alepha23.TString>;
1852
+ userId: alepha23.TOptional<alepha23.TString>;
1853
+ }>;
1854
+ type SessionQuery = Static<typeof sessionQuerySchema>;
1855
+ //#endregion
1856
+ //#region ../../src/api/users/services/SessionCrudService.d.ts
1857
+ declare class SessionCrudService {
1858
+ protected readonly log: alepha_logger5.Logger;
1859
+ protected readonly userRealmProvider: UserRealmProvider;
1860
+ sessions(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
1861
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
1862
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
1863
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1864
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
1865
+ refreshToken: alepha23.TString;
1866
+ userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
1867
+ expiresAt: alepha23.TString;
1868
+ ip: alepha23.TOptional<alepha23.TString>;
1869
+ userAgent: alepha23.TOptional<alepha23.TObject<{
1870
+ os: alepha23.TString;
1871
+ browser: alepha23.TString;
1872
+ device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
1873
+ }>>;
1874
+ }>>;
1875
+ /**
1876
+ * Find sessions with pagination and filtering.
1877
+ */
1878
+ findSessions(q?: SessionQuery, userRealmName?: string): Promise<Page$1<SessionEntity>>;
1879
+ /**
1880
+ * Get a session by ID.
1881
+ */
1882
+ getSessionById(id: string, userRealmName?: string): Promise<SessionEntity>;
1883
+ /**
1884
+ * Delete a session by ID.
1885
+ */
1886
+ deleteSession(id: string, userRealmName?: string): Promise<void>;
1887
+ }
1888
+ //#endregion
1889
+ //#region ../../src/api/users/controllers/AdminSessionController.d.ts
1890
+ declare class AdminSessionController {
1891
+ protected readonly url = "/sessions";
1892
+ protected readonly group = "admin:sessions";
1893
+ protected readonly sessionService: SessionCrudService;
1894
+ /**
1895
+ * Find sessions with pagination and filtering.
1896
+ */
1897
+ readonly findSessions: alepha_server0.ActionPrimitiveFn<{
1898
+ query: alepha23.TObject<{
1899
+ page: alepha23.TOptional<alepha23.TInteger>;
1900
+ size: alepha23.TOptional<alepha23.TInteger>;
1901
+ sort: alepha23.TOptional<alepha23.TString>;
1902
+ userId: alepha23.TOptional<alepha23.TString>;
1903
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1904
+ }>;
1905
+ response: alepha23.TPage<alepha23.TObject<{
1906
+ id: alepha23.TString;
1907
+ version: alepha23.TNumber;
1908
+ createdAt: alepha23.TString;
1909
+ updatedAt: alepha23.TString;
1910
+ refreshToken: alepha23.TString;
1911
+ userId: alepha23.TString;
1912
+ expiresAt: alepha23.TString;
1913
+ ip: alepha23.TOptional<alepha23.TString>;
1914
+ userAgent: alepha23.TOptional<alepha23.TObject<{
1915
+ os: alepha23.TString;
1916
+ browser: alepha23.TString;
1917
+ device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
1918
+ }>>;
1919
+ }>>;
1920
+ }>;
1921
+ /**
1922
+ * Get a session by ID.
1923
+ */
1924
+ readonly getSession: alepha_server0.ActionPrimitiveFn<{
1925
+ params: alepha23.TObject<{
1926
+ id: alepha23.TString;
1927
+ }>;
1928
+ query: alepha23.TObject<{
1929
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1930
+ }>;
1931
+ response: alepha23.TObject<{
1932
+ id: alepha23.TString;
1933
+ version: alepha23.TNumber;
1934
+ createdAt: alepha23.TString;
1935
+ updatedAt: alepha23.TString;
1936
+ refreshToken: alepha23.TString;
1937
+ userId: alepha23.TString;
1938
+ expiresAt: alepha23.TString;
1939
+ ip: alepha23.TOptional<alepha23.TString>;
1940
+ userAgent: alepha23.TOptional<alepha23.TObject<{
1941
+ os: alepha23.TString;
1942
+ browser: alepha23.TString;
1943
+ device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
1944
+ }>>;
1945
+ }>;
1946
+ }>;
1947
+ /**
1948
+ * Delete a session.
1949
+ */
1950
+ readonly deleteSession: alepha_server0.ActionPrimitiveFn<{
1951
+ params: alepha23.TObject<{
1952
+ id: alepha23.TString;
1953
+ }>;
1954
+ query: alepha23.TObject<{
1955
+ userRealmName: alepha23.TOptional<alepha23.TString>;
1956
+ }>;
1957
+ response: alepha23.TObject<{
1958
+ ok: alepha23.TBoolean;
1959
+ id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
1960
+ count: alepha23.TOptional<alepha23.TNumber>;
1961
+ }>;
1962
+ }>;
1963
+ }
1964
+ //#endregion
1965
+ //#region ../../src/api/users/notifications/UserNotifications.d.ts
1966
+ declare class UserNotifications {
1967
+ readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1968
+ email: alepha23.TString;
1969
+ code: alepha23.TString;
1970
+ expiresInMinutes: alepha23.TNumber;
1971
+ }>>;
1972
+ readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1973
+ email: alepha23.TString;
1974
+ code: alepha23.TString;
1975
+ expiresInMinutes: alepha23.TNumber;
1976
+ }>>;
1977
+ readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1978
+ phoneNumber: alepha23.TString;
1979
+ code: alepha23.TString;
1980
+ expiresInMinutes: alepha23.TNumber;
1981
+ }>>;
1982
+ readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1983
+ email: alepha23.TString;
1984
+ resetUrl: alepha23.TString;
1985
+ expiresInMinutes: alepha23.TNumber;
1986
+ }>>;
1987
+ readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
1988
+ email: alepha23.TString;
1987
1989
  verifyUrl: alepha23.TString;
1988
1990
  expiresInMinutes: alepha23.TNumber;
1989
1991
  }>>;
1990
1992
  }
1991
1993
  //#endregion
1994
+ //#region ../../src/api/users/schemas/createUserSchema.d.ts
1995
+ declare const createUserSchema: alepha23.TObject<{
1996
+ id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
1997
+ version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
1998
+ email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
1999
+ createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
2000
+ updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
2001
+ username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2002
+ phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2003
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2004
+ firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2005
+ lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2006
+ picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2007
+ enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2008
+ emailVerified: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2009
+ }>;
2010
+ type CreateUser = Static<typeof createUserSchema>;
2011
+ //#endregion
2012
+ //#region ../../src/api/users/schemas/updateUserSchema.d.ts
2013
+ declare const updateUserSchema: alepha23.TObject<{
2014
+ email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2015
+ realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
2016
+ phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2017
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2018
+ firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2019
+ lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2020
+ picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2021
+ enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2022
+ }>;
2023
+ type UpdateUser = Static<typeof updateUserSchema>;
2024
+ //#endregion
2025
+ //#region ../../src/api/users/schemas/userQuerySchema.d.ts
2026
+ declare const userQuerySchema: alepha23.TObject<{
2027
+ page: alepha23.TOptional<alepha23.TInteger>;
2028
+ size: alepha23.TOptional<alepha23.TInteger>;
2029
+ sort: alepha23.TOptional<alepha23.TString>;
2030
+ email: alepha23.TOptional<alepha23.TString>;
2031
+ enabled: alepha23.TOptional<alepha23.TBoolean>;
2032
+ emailVerified: alepha23.TOptional<alepha23.TBoolean>;
2033
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2034
+ query: alepha23.TOptional<alepha23.TString>;
2035
+ }>;
2036
+ type UserQuery = Static<typeof userQuerySchema>;
2037
+ //#endregion
2038
+ //#region ../../src/api/users/services/UserService.d.ts
2039
+ declare class UserService {
2040
+ protected readonly log: alepha_logger5.Logger;
2041
+ protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
2042
+ protected readonly userNotifications: UserNotifications;
2043
+ protected readonly userRealmProvider: UserRealmProvider;
2044
+ protected readonly auditService: AuditService;
2045
+ users(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
2046
+ id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
2047
+ version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
2048
+ createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
2049
+ updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
2050
+ realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
2051
+ username: alepha23.TOptional<alepha23.TString>;
2052
+ email: alepha23.TOptional<alepha23.TString>;
2053
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
2054
+ roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
2055
+ firstName: alepha23.TOptional<alepha23.TString>;
2056
+ lastName: alepha23.TOptional<alepha23.TString>;
2057
+ picture: alepha23.TOptional<alepha23.TString>;
2058
+ enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
2059
+ emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
2060
+ }>>;
2061
+ /**
2062
+ * Request email verification for a user.
2063
+ * @param email - The email address to verify.
2064
+ * @param userRealmName - Optional realm name.
2065
+ * @param method - The verification method: "code" (default) or "link".
2066
+ * @param verifyUrl - Base URL for verification link (required when method is "link").
2067
+ */
2068
+ requestEmailVerification(email: string, userRealmName?: string, method?: "code" | "link", verifyUrl?: string): Promise<boolean>;
2069
+ /**
2070
+ * Verify a user's email using a valid verification token.
2071
+ * Supports both code (6-digit) and link (UUID) verification tokens.
2072
+ */
2073
+ verifyEmail(email: string, token: string, userRealmName?: string): Promise<void>;
2074
+ /**
2075
+ * Check if an email is verified.
2076
+ */
2077
+ isEmailVerified(email: string, userRealmName?: string): Promise<boolean>;
2078
+ /**
2079
+ * Find users with pagination and filtering.
2080
+ */
2081
+ findUsers(q?: UserQuery, userRealmName?: string): Promise<Page$1<UserEntity>>;
2082
+ /**
2083
+ * Get a user by ID.
2084
+ */
2085
+ getUserById(id: string, userRealmName?: string): Promise<UserEntity>;
2086
+ /**
2087
+ * Create a new user.
2088
+ */
2089
+ createUser(data: CreateUser, userRealmName?: string): Promise<UserEntity>;
2090
+ /**
2091
+ * Update an existing user.
2092
+ */
2093
+ updateUser(id: string, data: UpdateUser, userRealmName?: string): Promise<UserEntity>;
2094
+ /**
2095
+ * Delete a user by ID.
2096
+ */
2097
+ deleteUser(id: string, userRealmName?: string): Promise<void>;
2098
+ }
2099
+ //#endregion
2100
+ //#region ../../src/api/users/controllers/AdminUserController.d.ts
2101
+ declare class AdminUserController {
2102
+ protected readonly url = "/users";
2103
+ protected readonly group = "admin:users";
2104
+ protected readonly userService: UserService;
2105
+ /**
2106
+ * Find users with pagination and filtering.
2107
+ */
2108
+ readonly findUsers: alepha_server0.ActionPrimitiveFn<{
2109
+ query: alepha23.TObject<{
2110
+ page: alepha23.TOptional<alepha23.TInteger>;
2111
+ size: alepha23.TOptional<alepha23.TInteger>;
2112
+ sort: alepha23.TOptional<alepha23.TString>;
2113
+ email: alepha23.TOptional<alepha23.TString>;
2114
+ enabled: alepha23.TOptional<alepha23.TBoolean>;
2115
+ emailVerified: alepha23.TOptional<alepha23.TBoolean>;
2116
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2117
+ query: alepha23.TOptional<alepha23.TString>;
2118
+ userRealmName: alepha23.TOptional<alepha23.TString>;
2119
+ }>;
2120
+ response: alepha23.TPage<alepha23.TObject<{
2121
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2122
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
2123
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
2124
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
2125
+ realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
2126
+ username: alepha23.TOptional<alepha23.TString>;
2127
+ email: alepha23.TOptional<alepha23.TString>;
2128
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
2129
+ roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
2130
+ firstName: alepha23.TOptional<alepha23.TString>;
2131
+ lastName: alepha23.TOptional<alepha23.TString>;
2132
+ picture: alepha23.TOptional<alepha23.TString>;
2133
+ enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2134
+ emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2135
+ }>>;
2136
+ }>;
2137
+ /**
2138
+ * Get a user by ID.
2139
+ */
2140
+ readonly getUser: alepha_server0.ActionPrimitiveFn<{
2141
+ params: alepha23.TObject<{
2142
+ id: alepha23.TString;
2143
+ }>;
2144
+ query: alepha23.TObject<{
2145
+ userRealmName: alepha23.TOptional<alepha23.TString>;
2146
+ }>;
2147
+ response: alepha23.TObject<{
2148
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2149
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
2150
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
2151
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
2152
+ realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
2153
+ username: alepha23.TOptional<alepha23.TString>;
2154
+ email: alepha23.TOptional<alepha23.TString>;
2155
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
2156
+ roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
2157
+ firstName: alepha23.TOptional<alepha23.TString>;
2158
+ lastName: alepha23.TOptional<alepha23.TString>;
2159
+ picture: alepha23.TOptional<alepha23.TString>;
2160
+ enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2161
+ emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2162
+ }>;
2163
+ }>;
2164
+ /**
2165
+ * Create a new user.
2166
+ */
2167
+ readonly createUser: alepha_server0.ActionPrimitiveFn<{
2168
+ query: alepha23.TObject<{
2169
+ userRealmName: alepha23.TOptional<alepha23.TString>;
2170
+ }>;
2171
+ body: alepha23.TObject<{
2172
+ id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
2173
+ version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
2174
+ email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2175
+ createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
2176
+ updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
2177
+ username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2178
+ phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2179
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2180
+ firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2181
+ lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2182
+ picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2183
+ enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2184
+ emailVerified: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2185
+ }>;
2186
+ response: alepha23.TObject<{
2187
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2188
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
2189
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
2190
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
2191
+ realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
2192
+ username: alepha23.TOptional<alepha23.TString>;
2193
+ email: alepha23.TOptional<alepha23.TString>;
2194
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
2195
+ roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
2196
+ firstName: alepha23.TOptional<alepha23.TString>;
2197
+ lastName: alepha23.TOptional<alepha23.TString>;
2198
+ picture: alepha23.TOptional<alepha23.TString>;
2199
+ enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2200
+ emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2201
+ }>;
2202
+ }>;
2203
+ /**
2204
+ * Update a user.
2205
+ */
2206
+ readonly updateUser: alepha_server0.ActionPrimitiveFn<{
2207
+ params: alepha23.TObject<{
2208
+ id: alepha23.TString;
2209
+ }>;
2210
+ query: alepha23.TObject<{
2211
+ userRealmName: alepha23.TOptional<alepha23.TString>;
2212
+ }>;
2213
+ body: alepha23.TObject<{
2214
+ email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2215
+ realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
2216
+ phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2217
+ roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2218
+ firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2219
+ lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2220
+ picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2221
+ enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2222
+ }>;
2223
+ response: alepha23.TObject<{
2224
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2225
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
2226
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
2227
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
2228
+ realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
2229
+ username: alepha23.TOptional<alepha23.TString>;
2230
+ email: alepha23.TOptional<alepha23.TString>;
2231
+ phoneNumber: alepha23.TOptional<alepha23.TString>;
2232
+ roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
2233
+ firstName: alepha23.TOptional<alepha23.TString>;
2234
+ lastName: alepha23.TOptional<alepha23.TString>;
2235
+ picture: alepha23.TOptional<alepha23.TString>;
2236
+ enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2237
+ emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2238
+ }>;
2239
+ }>;
2240
+ /**
2241
+ * Delete a user.
2242
+ */
2243
+ readonly deleteUser: alepha_server0.ActionPrimitiveFn<{
2244
+ params: alepha23.TObject<{
2245
+ id: alepha23.TString;
2246
+ }>;
2247
+ query: alepha23.TObject<{
2248
+ userRealmName: alepha23.TOptional<alepha23.TString>;
2249
+ }>;
2250
+ response: alepha23.TObject<{
2251
+ ok: alepha23.TBoolean;
2252
+ id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
2253
+ count: alepha23.TOptional<alepha23.TNumber>;
2254
+ }>;
2255
+ }>;
2256
+ }
2257
+ //#endregion
1992
2258
  //#region ../../src/api/users/schemas/completePasswordResetRequestSchema.d.ts
1993
2259
  /**
1994
2260
  * Request schema for completing a password reset.
@@ -2028,12 +2294,13 @@ interface PasswordResetIntent {
2028
2294
  expiresAt: string;
2029
2295
  }
2030
2296
  declare class CredentialService {
2031
- protected readonly log: alepha_logger1.Logger;
2297
+ protected readonly log: alepha_logger5.Logger;
2032
2298
  protected readonly cryptoProvider: CryptoProvider;
2033
2299
  protected readonly dateTimeProvider: DateTimeProvider;
2034
2300
  protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
2035
2301
  protected readonly userNotifications: UserNotifications;
2036
2302
  protected readonly userRealmProvider: UserRealmProvider;
2303
+ protected readonly auditService: AuditService;
2037
2304
  protected readonly intentCache: alepha_cache0.CachePrimitiveFn<PasswordResetIntent, any[]>;
2038
2305
  users(userRealmName?: string): Repository$1<alepha23.TObject<{
2039
2306
  id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
@@ -2169,12 +2436,13 @@ interface RegistrationIntent {
2169
2436
  expiresAt: string;
2170
2437
  }
2171
2438
  declare class RegistrationService {
2172
- protected readonly log: alepha_logger1.Logger;
2439
+ protected readonly log: alepha_logger5.Logger;
2173
2440
  protected readonly dateTimeProvider: DateTimeProvider;
2174
2441
  protected readonly cryptoProvider: CryptoProvider;
2175
2442
  protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
2176
2443
  protected readonly userNotifications: UserNotifications;
2177
2444
  protected readonly userRealmProvider: UserRealmProvider;
2445
+ protected readonly auditService: AuditService;
2178
2446
  protected readonly intentCache: alepha_cache0.CachePrimitiveFn<RegistrationIntent, any[]>;
2179
2447
  /**
2180
2448
  * Phase 1: Create a registration intent.
@@ -2212,111 +2480,6 @@ declare class RegistrationService {
2212
2480
  protected verifyPhoneCode(phoneNumber: string, code: string): Promise<void>;
2213
2481
  }
2214
2482
  //#endregion
2215
- //#region ../../src/api/users/schemas/createUserSchema.d.ts
2216
- declare const createUserSchema: alepha23.TObject<{
2217
- id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
2218
- version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
2219
- email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2220
- createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
2221
- updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
2222
- username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2223
- phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2224
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2225
- firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2226
- lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2227
- picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2228
- enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2229
- emailVerified: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2230
- }>;
2231
- type CreateUser = Static<typeof createUserSchema>;
2232
- //#endregion
2233
- //#region ../../src/api/users/schemas/updateUserSchema.d.ts
2234
- declare const updateUserSchema: alepha23.TObject<{
2235
- email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2236
- realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
2237
- phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2238
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2239
- firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2240
- lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2241
- picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2242
- enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
2243
- }>;
2244
- type UpdateUser = Static<typeof updateUserSchema>;
2245
- //#endregion
2246
- //#region ../../src/api/users/schemas/userQuerySchema.d.ts
2247
- declare const userQuerySchema: alepha23.TObject<{
2248
- page: alepha23.TOptional<alepha23.TInteger>;
2249
- size: alepha23.TOptional<alepha23.TInteger>;
2250
- sort: alepha23.TOptional<alepha23.TString>;
2251
- email: alepha23.TOptional<alepha23.TString>;
2252
- enabled: alepha23.TOptional<alepha23.TBoolean>;
2253
- emailVerified: alepha23.TOptional<alepha23.TBoolean>;
2254
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2255
- query: alepha23.TOptional<alepha23.TString>;
2256
- }>;
2257
- type UserQuery = Static<typeof userQuerySchema>;
2258
- //#endregion
2259
- //#region ../../src/api/users/services/UserService.d.ts
2260
- declare class UserService {
2261
- protected readonly log: alepha_logger1.Logger;
2262
- protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
2263
- protected readonly userNotifications: UserNotifications;
2264
- protected readonly userRealmProvider: UserRealmProvider;
2265
- users(userRealmName?: string): alepha_orm204.Repository<alepha23.TObject<{
2266
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2267
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2268
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2269
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2270
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2271
- username: alepha23.TOptional<alepha23.TString>;
2272
- email: alepha23.TOptional<alepha23.TString>;
2273
- phoneNumber: alepha23.TOptional<alepha23.TString>;
2274
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2275
- firstName: alepha23.TOptional<alepha23.TString>;
2276
- lastName: alepha23.TOptional<alepha23.TString>;
2277
- picture: alepha23.TOptional<alepha23.TString>;
2278
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2279
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2280
- }>>;
2281
- /**
2282
- * Request email verification for a user.
2283
- * @param email - The email address to verify.
2284
- * @param userRealmName - Optional realm name.
2285
- * @param method - The verification method: "code" (default) or "link".
2286
- * @param verifyUrl - Base URL for verification link (required when method is "link").
2287
- */
2288
- requestEmailVerification(email: string, userRealmName?: string, method?: "code" | "link", verifyUrl?: string): Promise<boolean>;
2289
- /**
2290
- * Verify a user's email using a valid verification token.
2291
- * Supports both code (6-digit) and link (UUID) verification tokens.
2292
- */
2293
- verifyEmail(email: string, token: string, userRealmName?: string): Promise<void>;
2294
- /**
2295
- * Check if an email is verified.
2296
- */
2297
- isEmailVerified(email: string, userRealmName?: string): Promise<boolean>;
2298
- /**
2299
- * Find users with pagination and filtering.
2300
- */
2301
- findUsers(q?: UserQuery, userRealmName?: string): Promise<Page$1<UserEntity>>;
2302
- /**
2303
- * Get a user by ID.
2304
- */
2305
- getUserById(id: string, userRealmName?: string): Promise<UserEntity>;
2306
- /**
2307
- * Create a new user.
2308
- */
2309
- createUser(data: CreateUser, userRealmName?: string): Promise<UserEntity>;
2310
- /**
2311
- * Update an existing user.
2312
- */
2313
- updateUser(id: string, data: UpdateUser, userRealmName?: string): Promise<UserEntity>;
2314
- /**
2315
- * Delete a user by ID.
2316
- */
2317
- deleteUser(id: string, userRealmName?: string): Promise<void>;
2318
- }
2319
- //#endregion
2320
2483
  //#region ../../src/api/users/controllers/UserController.d.ts
2321
2484
  declare class UserController {
2322
2485
  protected readonly url = "/users";
@@ -2349,104 +2512,6 @@ declare class UserController {
2349
2512
  expiresAt: alepha23.TString;
2350
2513
  }>;
2351
2514
  }>;
2352
- /**
2353
- * Find users with pagination and filtering.
2354
- */
2355
- readonly findUsers: alepha_server0.ActionPrimitiveFn<{
2356
- query: alepha23.TObject<{
2357
- page: alepha23.TOptional<alepha23.TInteger>;
2358
- size: alepha23.TOptional<alepha23.TInteger>;
2359
- sort: alepha23.TOptional<alepha23.TString>;
2360
- email: alepha23.TOptional<alepha23.TString>;
2361
- enabled: alepha23.TOptional<alepha23.TBoolean>;
2362
- emailVerified: alepha23.TOptional<alepha23.TBoolean>;
2363
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2364
- query: alepha23.TOptional<alepha23.TString>;
2365
- userRealmName: alepha23.TOptional<alepha23.TString>;
2366
- }>;
2367
- response: alepha23.TPage<alepha23.TObject<{
2368
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2369
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2370
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2371
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2372
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2373
- username: alepha23.TOptional<alepha23.TString>;
2374
- email: alepha23.TOptional<alepha23.TString>;
2375
- phoneNumber: alepha23.TOptional<alepha23.TString>;
2376
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2377
- firstName: alepha23.TOptional<alepha23.TString>;
2378
- lastName: alepha23.TOptional<alepha23.TString>;
2379
- picture: alepha23.TOptional<alepha23.TString>;
2380
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2381
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2382
- }>>;
2383
- }>;
2384
- /**
2385
- * Get a user by ID.
2386
- */
2387
- readonly getUser: alepha_server0.ActionPrimitiveFn<{
2388
- params: alepha23.TObject<{
2389
- id: alepha23.TString;
2390
- }>;
2391
- query: alepha23.TObject<{
2392
- userRealmName: alepha23.TOptional<alepha23.TString>;
2393
- }>;
2394
- response: alepha23.TObject<{
2395
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2396
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2397
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2398
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2399
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2400
- username: alepha23.TOptional<alepha23.TString>;
2401
- email: alepha23.TOptional<alepha23.TString>;
2402
- phoneNumber: alepha23.TOptional<alepha23.TString>;
2403
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2404
- firstName: alepha23.TOptional<alepha23.TString>;
2405
- lastName: alepha23.TOptional<alepha23.TString>;
2406
- picture: alepha23.TOptional<alepha23.TString>;
2407
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2408
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2409
- }>;
2410
- }>;
2411
- /**
2412
- * Create a new user.
2413
- */
2414
- readonly createUser: alepha_server0.ActionPrimitiveFn<{
2415
- query: alepha23.TObject<{
2416
- userRealmName: alepha23.TOptional<alepha23.TString>;
2417
- }>;
2418
- body: alepha23.TObject<{
2419
- id: alepha23.TOptional<alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>>;
2420
- version: alepha23.TOptional<alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>>;
2421
- email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2422
- createdAt: alepha23.TOptional<alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>>;
2423
- updatedAt: alepha23.TOptional<alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>>;
2424
- username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2425
- phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2426
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2427
- firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2428
- lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2429
- picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2430
- enabled: alepha23.TOptional<alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>>;
2431
- emailVerified: alepha23.TOptional<alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>>;
2432
- }>;
2433
- response: alepha23.TObject<{
2434
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2435
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2436
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2437
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2438
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2439
- username: alepha23.TOptional<alepha23.TString>;
2440
- email: alepha23.TOptional<alepha23.TString>;
2441
- phoneNumber: alepha23.TOptional<alepha23.TString>;
2442
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2443
- firstName: alepha23.TOptional<alepha23.TString>;
2444
- lastName: alepha23.TOptional<alepha23.TString>;
2445
- picture: alepha23.TOptional<alepha23.TString>;
2446
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2447
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2448
- }>;
2449
- }>;
2450
2515
  /**
2451
2516
  * Phase 2: Complete registration using an intent.
2452
2517
  * Validates verification codes and creates the user.
@@ -2459,73 +2524,20 @@ declare class UserController {
2459
2524
  captchaToken: alepha23.TOptional<alepha23.TString>;
2460
2525
  }>;
2461
2526
  response: alepha23.TObject<{
2462
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2463
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2464
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2465
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2466
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2467
- username: alepha23.TOptional<alepha23.TString>;
2468
- email: alepha23.TOptional<alepha23.TString>;
2469
- phoneNumber: alepha23.TOptional<alepha23.TString>;
2470
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2471
- firstName: alepha23.TOptional<alepha23.TString>;
2472
- lastName: alepha23.TOptional<alepha23.TString>;
2473
- picture: alepha23.TOptional<alepha23.TString>;
2474
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2475
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2476
- }>;
2477
- }>;
2478
- /**
2479
- * Update a user.
2480
- */
2481
- readonly updateUser: alepha_server0.ActionPrimitiveFn<{
2482
- params: alepha23.TObject<{
2483
- id: alepha23.TString;
2484
- }>;
2485
- query: alepha23.TObject<{
2486
- userRealmName: alepha23.TOptional<alepha23.TString>;
2487
- }>;
2488
- body: alepha23.TObject<{
2489
- email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2490
- realm: alepha23.TOptional<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>>;
2491
- phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2492
- roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
2493
- firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2494
- lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2495
- picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
2496
- enabled: alepha23.TOptional<alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>>;
2497
- }>;
2498
- response: alepha23.TObject<{
2499
- id: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_PRIMARY_KEY>, typeof alepha_orm204.PG_DEFAULT>;
2500
- version: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TInteger, typeof alepha_orm204.PG_VERSION>, typeof alepha_orm204.PG_DEFAULT>;
2501
- createdAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_CREATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2502
- updatedAt: alepha_orm204.PgAttr<alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_UPDATED_AT>, typeof alepha_orm204.PG_DEFAULT>;
2503
- realm: alepha_orm204.PgAttr<alepha23.TString, typeof alepha_orm204.PG_DEFAULT>;
2527
+ id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2528
+ version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
2529
+ createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
2530
+ updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
2531
+ realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
2504
2532
  username: alepha23.TOptional<alepha23.TString>;
2505
2533
  email: alepha23.TOptional<alepha23.TString>;
2506
2534
  phoneNumber: alepha23.TOptional<alepha23.TString>;
2507
- roles: alepha_orm204.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm204.PG_DEFAULT>;
2535
+ roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
2508
2536
  firstName: alepha23.TOptional<alepha23.TString>;
2509
2537
  lastName: alepha23.TOptional<alepha23.TString>;
2510
2538
  picture: alepha23.TOptional<alepha23.TString>;
2511
- enabled: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2512
- emailVerified: alepha_orm204.PgAttr<alepha23.TBoolean, typeof alepha_orm204.PG_DEFAULT>;
2513
- }>;
2514
- }>;
2515
- /**
2516
- * Delete a user.
2517
- */
2518
- readonly deleteUser: alepha_server0.ActionPrimitiveFn<{
2519
- params: alepha23.TObject<{
2520
- id: alepha23.TString;
2521
- }>;
2522
- query: alepha23.TObject<{
2523
- userRealmName: alepha23.TOptional<alepha23.TString>;
2524
- }>;
2525
- response: alepha23.TObject<{
2526
- ok: alepha23.TBoolean;
2527
- id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
2528
- count: alepha23.TOptional<alepha23.TNumber>;
2539
+ enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2540
+ emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
2529
2541
  }>;
2530
2542
  }>;
2531
2543
  /**
@@ -2664,6 +2676,7 @@ declare class UserController {
2664
2676
  */
2665
2677
  declare class UserRealmController {
2666
2678
  protected readonly url = "/realms";
2679
+ protected readonly group = "realms";
2667
2680
  protected readonly userRealmProvider: UserRealmProvider;
2668
2681
  protected readonly serverAuthProvider: ServerAuthProvider;
2669
2682
  /**
@@ -2839,9 +2852,10 @@ declare class SessionService {
2839
2852
  protected readonly fsp: FileSystemProvider;
2840
2853
  protected readonly dateTimeProvider: DateTimeProvider;
2841
2854
  protected readonly cryptoProvider: CryptoProvider;
2842
- protected readonly log: alepha_logger1.Logger;
2855
+ protected readonly log: alepha_logger5.Logger;
2843
2856
  protected readonly userRealmProvider: UserRealmProvider;
2844
2857
  protected readonly fileController: alepha_server_links0.HttpVirtualClient<FileController>;
2858
+ protected readonly auditService: AuditService;
2845
2859
  users(userRealmName?: string): Repository$1<alepha23.TObject<{
2846
2860
  id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
2847
2861
  version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
@@ -2991,5 +3005,5 @@ declare class SessionService {
2991
3005
  */
2992
3006
  declare const AlephaApiUsers: alepha23.Service<alepha23.Module>;
2993
3007
  //#endregion
2994
- export { $userRealm, AlephaApiUsers, CompletePasswordResetRequest, CompleteRegistrationRequest, CreateUser, CredentialService, DEFAULT_USER_REALM_NAME, IdentityController, IdentityEntity, IdentityQuery, IdentityResource, IdentityService, LoginInput, PasswordResetIntentResponse, RealmAuthSettings, RegisterInput, RegistrationIntentResponse, RegistrationService, ResetPasswordInput, ResetPasswordRequest, SessionController, SessionCrudService, SessionEntity, SessionQuery, SessionResource, SessionService, UpdateUser, UserController, UserEntity, UserQuery, UserRealm, UserRealmConfig, UserRealmController, UserRealmOptions, UserRealmPrimitive, UserRealmProvider, UserRealmRepositories, UserResource, UserService, completePasswordResetRequestSchema, completeRegistrationRequestSchema, createUserSchema, identities, identityQuerySchema, identityResourceSchema, loginSchema, passwordResetIntentResponseSchema, realmAuthSettingsAtom, registerSchema, registrationIntentResponseSchema, resetPasswordRequestSchema, resetPasswordSchema, sessionQuerySchema, sessionResourceSchema, sessions, updateUserSchema, userQuerySchema, userRealmConfigSchema, userResourceSchema, users };
3008
+ export { $userRealm, AdminIdentityController, AdminSessionController, AdminUserController, AlephaApiUsers, CompletePasswordResetRequest, CompleteRegistrationRequest, CreateUser, CredentialService, DEFAULT_USER_REALM_NAME, IdentityEntity, IdentityQuery, IdentityResource, IdentityService, LoginInput, PasswordResetIntentResponse, RealmAuthSettings, RegisterInput, RegistrationIntentResponse, RegistrationService, ResetPasswordInput, ResetPasswordRequest, SessionCrudService, SessionEntity, SessionQuery, SessionResource, SessionService, UpdateUser, UserController, UserEntity, UserQuery, UserRealm, UserRealmConfig, UserRealmController, UserRealmOptions, UserRealmPrimitive, UserRealmProvider, UserRealmRepositories, UserResource, UserService, completePasswordResetRequestSchema, completeRegistrationRequestSchema, createUserSchema, identities, identityQuerySchema, identityResourceSchema, loginSchema, passwordResetIntentResponseSchema, realmAuthSettingsAtom, registerSchema, registrationIntentResponseSchema, resetPasswordRequestSchema, resetPasswordSchema, sessionQuerySchema, sessionResourceSchema, sessions, updateUserSchema, userQuerySchema, userRealmConfigSchema, userResourceSchema, users };
2995
3009
  //# sourceMappingURL=index.d.ts.map