alepha 0.14.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/README.md +2 -5
  2. package/dist/api/audits/index.d.ts +620 -811
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/files/index.d.ts +185 -377
  5. package/dist/api/files/index.d.ts.map +1 -1
  6. package/dist/api/files/index.js +0 -1
  7. package/dist/api/files/index.js.map +1 -1
  8. package/dist/api/jobs/index.d.ts +245 -435
  9. package/dist/api/jobs/index.d.ts.map +1 -1
  10. package/dist/api/notifications/index.d.ts +238 -429
  11. package/dist/api/notifications/index.d.ts.map +1 -1
  12. package/dist/api/parameters/index.d.ts +236 -427
  13. package/dist/api/parameters/index.d.ts.map +1 -1
  14. package/dist/api/users/index.browser.js +1 -2
  15. package/dist/api/users/index.browser.js.map +1 -1
  16. package/dist/api/users/index.d.ts +1010 -1196
  17. package/dist/api/users/index.d.ts.map +1 -1
  18. package/dist/api/users/index.js +178 -151
  19. package/dist/api/users/index.js.map +1 -1
  20. package/dist/api/verifications/index.d.ts +17 -17
  21. package/dist/api/verifications/index.d.ts.map +1 -1
  22. package/dist/batch/index.d.ts +122 -122
  23. package/dist/batch/index.d.ts.map +1 -1
  24. package/dist/batch/index.js +1 -2
  25. package/dist/batch/index.js.map +1 -1
  26. package/dist/bucket/index.d.ts +163 -163
  27. package/dist/bucket/index.d.ts.map +1 -1
  28. package/dist/cache/core/index.d.ts +46 -46
  29. package/dist/cache/core/index.d.ts.map +1 -1
  30. package/dist/cache/redis/index.d.ts.map +1 -1
  31. package/dist/cli/index.d.ts +384 -285
  32. package/dist/cli/index.d.ts.map +1 -1
  33. package/dist/cli/index.js +1113 -623
  34. package/dist/cli/index.js.map +1 -1
  35. package/dist/command/index.d.ts +299 -300
  36. package/dist/command/index.d.ts.map +1 -1
  37. package/dist/command/index.js +13 -9
  38. package/dist/command/index.js.map +1 -1
  39. package/dist/core/index.browser.js +445 -103
  40. package/dist/core/index.browser.js.map +1 -1
  41. package/dist/core/index.d.ts +733 -625
  42. package/dist/core/index.d.ts.map +1 -1
  43. package/dist/core/index.js +446 -103
  44. package/dist/core/index.js.map +1 -1
  45. package/dist/core/index.native.js +445 -103
  46. package/dist/core/index.native.js.map +1 -1
  47. package/dist/datetime/index.d.ts +44 -44
  48. package/dist/datetime/index.d.ts.map +1 -1
  49. package/dist/datetime/index.js +4 -4
  50. package/dist/datetime/index.js.map +1 -1
  51. package/dist/email/index.d.ts +97 -50
  52. package/dist/email/index.d.ts.map +1 -1
  53. package/dist/email/index.js +129 -33
  54. package/dist/email/index.js.map +1 -1
  55. package/dist/fake/index.d.ts +7981 -14
  56. package/dist/fake/index.d.ts.map +1 -1
  57. package/dist/file/index.d.ts +523 -390
  58. package/dist/file/index.d.ts.map +1 -1
  59. package/dist/file/index.js +253 -1
  60. package/dist/file/index.js.map +1 -1
  61. package/dist/lock/core/index.d.ts +208 -208
  62. package/dist/lock/core/index.d.ts.map +1 -1
  63. package/dist/lock/redis/index.d.ts.map +1 -1
  64. package/dist/logger/index.d.ts +25 -26
  65. package/dist/logger/index.d.ts.map +1 -1
  66. package/dist/logger/index.js +12 -2
  67. package/dist/logger/index.js.map +1 -1
  68. package/dist/mcp/index.d.ts +197 -197
  69. package/dist/mcp/index.d.ts.map +1 -1
  70. package/dist/mcp/index.js +1 -1
  71. package/dist/mcp/index.js.map +1 -1
  72. package/dist/orm/chunk-DtkW-qnP.js +38 -0
  73. package/dist/orm/index.browser.js.map +1 -1
  74. package/dist/orm/index.bun.js +2814 -0
  75. package/dist/orm/index.bun.js.map +1 -0
  76. package/dist/orm/index.d.ts +1228 -1216
  77. package/dist/orm/index.d.ts.map +1 -1
  78. package/dist/orm/index.js +2041 -1967
  79. package/dist/orm/index.js.map +1 -1
  80. package/dist/queue/core/index.d.ts +248 -248
  81. package/dist/queue/core/index.d.ts.map +1 -1
  82. package/dist/queue/redis/index.d.ts.map +1 -1
  83. package/dist/redis/index.bun.js +285 -0
  84. package/dist/redis/index.bun.js.map +1 -0
  85. package/dist/redis/index.d.ts +118 -136
  86. package/dist/redis/index.d.ts.map +1 -1
  87. package/dist/redis/index.js +18 -38
  88. package/dist/redis/index.js.map +1 -1
  89. package/dist/retry/index.d.ts +69 -69
  90. package/dist/retry/index.d.ts.map +1 -1
  91. package/dist/router/index.d.ts +6 -6
  92. package/dist/router/index.d.ts.map +1 -1
  93. package/dist/scheduler/index.d.ts +25 -25
  94. package/dist/scheduler/index.d.ts.map +1 -1
  95. package/dist/security/index.browser.js +5 -1
  96. package/dist/security/index.browser.js.map +1 -1
  97. package/dist/security/index.d.ts +417 -254
  98. package/dist/security/index.d.ts.map +1 -1
  99. package/dist/security/index.js +386 -86
  100. package/dist/security/index.js.map +1 -1
  101. package/dist/server/auth/index.d.ts +110 -110
  102. package/dist/server/auth/index.d.ts.map +1 -1
  103. package/dist/server/auth/index.js +20 -20
  104. package/dist/server/auth/index.js.map +1 -1
  105. package/dist/server/cache/index.d.ts +62 -47
  106. package/dist/server/cache/index.d.ts.map +1 -1
  107. package/dist/server/cache/index.js +56 -3
  108. package/dist/server/cache/index.js.map +1 -1
  109. package/dist/server/compress/index.d.ts +6 -0
  110. package/dist/server/compress/index.d.ts.map +1 -1
  111. package/dist/server/compress/index.js +36 -1
  112. package/dist/server/compress/index.js.map +1 -1
  113. package/dist/server/cookies/index.d.ts +6 -6
  114. package/dist/server/cookies/index.d.ts.map +1 -1
  115. package/dist/server/cookies/index.js +3 -3
  116. package/dist/server/cookies/index.js.map +1 -1
  117. package/dist/server/core/index.browser.js +2 -2
  118. package/dist/server/core/index.browser.js.map +1 -1
  119. package/dist/server/core/index.d.ts +242 -150
  120. package/dist/server/core/index.d.ts.map +1 -1
  121. package/dist/server/core/index.js +294 -125
  122. package/dist/server/core/index.js.map +1 -1
  123. package/dist/server/cors/index.d.ts +11 -12
  124. package/dist/server/cors/index.d.ts.map +1 -1
  125. package/dist/server/health/index.d.ts +0 -1
  126. package/dist/server/health/index.d.ts.map +1 -1
  127. package/dist/server/helmet/index.d.ts +2 -2
  128. package/dist/server/helmet/index.d.ts.map +1 -1
  129. package/dist/server/links/index.browser.js.map +1 -1
  130. package/dist/server/links/index.d.ts +123 -124
  131. package/dist/server/links/index.d.ts.map +1 -1
  132. package/dist/server/links/index.js +1 -2
  133. package/dist/server/links/index.js.map +1 -1
  134. package/dist/server/metrics/index.d.ts.map +1 -1
  135. package/dist/server/multipart/index.d.ts +6 -6
  136. package/dist/server/multipart/index.d.ts.map +1 -1
  137. package/dist/server/proxy/index.d.ts +102 -103
  138. package/dist/server/proxy/index.d.ts.map +1 -1
  139. package/dist/server/rate-limit/index.d.ts +16 -16
  140. package/dist/server/rate-limit/index.d.ts.map +1 -1
  141. package/dist/server/static/index.d.ts +44 -44
  142. package/dist/server/static/index.d.ts.map +1 -1
  143. package/dist/server/static/index.js +4 -0
  144. package/dist/server/static/index.js.map +1 -1
  145. package/dist/server/swagger/index.d.ts +48 -49
  146. package/dist/server/swagger/index.d.ts.map +1 -1
  147. package/dist/server/swagger/index.js +3 -5
  148. package/dist/server/swagger/index.js.map +1 -1
  149. package/dist/sms/index.d.ts +13 -11
  150. package/dist/sms/index.d.ts.map +1 -1
  151. package/dist/sms/index.js +7 -7
  152. package/dist/sms/index.js.map +1 -1
  153. package/dist/thread/index.d.ts +71 -72
  154. package/dist/thread/index.d.ts.map +1 -1
  155. package/dist/topic/core/index.d.ts +318 -318
  156. package/dist/topic/core/index.d.ts.map +1 -1
  157. package/dist/topic/redis/index.d.ts +6 -6
  158. package/dist/topic/redis/index.d.ts.map +1 -1
  159. package/dist/vite/index.d.ts +5805 -249
  160. package/dist/vite/index.d.ts.map +1 -1
  161. package/dist/vite/index.js +599 -513
  162. package/dist/vite/index.js.map +1 -1
  163. package/dist/websocket/index.browser.js +6 -6
  164. package/dist/websocket/index.browser.js.map +1 -1
  165. package/dist/websocket/index.d.ts +247 -247
  166. package/dist/websocket/index.d.ts.map +1 -1
  167. package/dist/websocket/index.js +6 -6
  168. package/dist/websocket/index.js.map +1 -1
  169. package/package.json +9 -14
  170. package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
  171. package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
  172. package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
  173. package/src/api/users/entities/users.ts +1 -1
  174. package/src/api/users/index.ts +8 -8
  175. package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
  176. package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
  177. package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
  178. package/src/api/users/services/CredentialService.ts +7 -7
  179. package/src/api/users/services/IdentityService.ts +4 -4
  180. package/src/api/users/services/RegistrationService.spec.ts +25 -27
  181. package/src/api/users/services/RegistrationService.ts +38 -27
  182. package/src/api/users/services/SessionCrudService.ts +3 -3
  183. package/src/api/users/services/SessionService.spec.ts +3 -3
  184. package/src/api/users/services/SessionService.ts +28 -9
  185. package/src/api/users/services/UserService.ts +7 -7
  186. package/src/batch/providers/BatchProvider.ts +1 -2
  187. package/src/cli/apps/AlephaCli.ts +0 -2
  188. package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
  189. package/src/cli/assets/apiHelloControllerTs.ts +18 -0
  190. package/src/cli/assets/apiIndexTs.ts +16 -0
  191. package/src/cli/assets/claudeMd.ts +303 -0
  192. package/src/cli/assets/mainBrowserTs.ts +2 -2
  193. package/src/cli/assets/mainServerTs.ts +24 -0
  194. package/src/cli/assets/webAppRouterTs.ts +15 -0
  195. package/src/cli/assets/webHelloComponentTsx.ts +16 -0
  196. package/src/cli/assets/webIndexTs.ts +16 -0
  197. package/src/cli/atoms/buildOptions.ts +88 -0
  198. package/src/cli/commands/build.ts +70 -87
  199. package/src/cli/commands/db.ts +21 -22
  200. package/src/cli/commands/deploy.ts +17 -5
  201. package/src/cli/commands/dev.ts +22 -14
  202. package/src/cli/commands/format.ts +8 -2
  203. package/src/cli/commands/gen/env.ts +53 -0
  204. package/src/cli/commands/gen/openapi.ts +1 -1
  205. package/src/cli/commands/gen/resource.ts +15 -0
  206. package/src/cli/commands/gen.ts +7 -1
  207. package/src/cli/commands/init.ts +74 -30
  208. package/src/cli/commands/lint.ts +8 -2
  209. package/src/cli/commands/test.ts +8 -3
  210. package/src/cli/commands/typecheck.ts +5 -1
  211. package/src/cli/commands/verify.ts +5 -3
  212. package/src/cli/defineConfig.ts +49 -7
  213. package/src/cli/index.ts +0 -1
  214. package/src/cli/services/AlephaCliUtils.ts +39 -589
  215. package/src/cli/services/PackageManagerUtils.ts +301 -0
  216. package/src/cli/services/ProjectScaffolder.ts +306 -0
  217. package/src/command/helpers/Runner.spec.ts +2 -2
  218. package/src/command/helpers/Runner.ts +16 -4
  219. package/src/command/primitives/$command.ts +0 -6
  220. package/src/command/providers/CliProvider.ts +1 -3
  221. package/src/core/Alepha.ts +42 -0
  222. package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
  223. package/src/core/index.shared.ts +1 -0
  224. package/src/core/index.ts +2 -0
  225. package/src/core/primitives/$hook.ts +6 -2
  226. package/src/core/primitives/$module.spec.ts +4 -0
  227. package/src/core/providers/AlsProvider.ts +1 -1
  228. package/src/core/providers/CodecManager.spec.ts +12 -6
  229. package/src/core/providers/CodecManager.ts +26 -6
  230. package/src/core/providers/EventManager.ts +169 -13
  231. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
  232. package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
  233. package/src/core/providers/StateManager.spec.ts +27 -16
  234. package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
  235. package/src/email/providers/LocalEmailProvider.ts +52 -15
  236. package/src/email/providers/NodemailerEmailProvider.ts +167 -56
  237. package/src/file/errors/FileError.ts +7 -0
  238. package/src/file/index.ts +9 -1
  239. package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
  240. package/src/logger/index.ts +15 -3
  241. package/src/mcp/transports/StdioMcpTransport.ts +1 -1
  242. package/src/orm/index.browser.ts +1 -19
  243. package/src/orm/index.bun.ts +77 -0
  244. package/src/orm/index.shared-server.ts +22 -0
  245. package/src/orm/index.shared.ts +15 -0
  246. package/src/orm/index.ts +13 -39
  247. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
  248. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  249. package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
  250. package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
  251. package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
  252. package/src/orm/services/Repository.ts +8 -0
  253. package/src/queue/core/providers/WorkerProvider.spec.ts +48 -32
  254. package/src/redis/index.bun.ts +35 -0
  255. package/src/redis/providers/BunRedisProvider.ts +12 -43
  256. package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
  257. package/src/redis/providers/NodeRedisProvider.ts +16 -34
  258. package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
  259. package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
  260. package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
  261. package/src/security/index.browser.ts +5 -0
  262. package/src/security/index.ts +90 -7
  263. package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
  264. package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
  265. package/src/security/primitives/$role.ts +5 -5
  266. package/src/security/primitives/$serviceAccount.spec.ts +5 -5
  267. package/src/security/primitives/$serviceAccount.ts +3 -3
  268. package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
  269. package/src/server/auth/primitives/$auth.ts +10 -10
  270. package/src/server/auth/primitives/$authCredentials.ts +3 -3
  271. package/src/server/auth/primitives/$authGithub.ts +3 -3
  272. package/src/server/auth/primitives/$authGoogle.ts +3 -3
  273. package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
  274. package/src/server/cache/providers/ServerCacheProvider.spec.ts +183 -0
  275. package/src/server/cache/providers/ServerCacheProvider.ts +95 -10
  276. package/src/server/compress/providers/ServerCompressProvider.ts +61 -2
  277. package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
  278. package/src/server/core/helpers/ServerReply.ts +2 -2
  279. package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
  280. package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
  281. package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
  282. package/src/server/core/providers/ServerProvider.ts +155 -22
  283. package/src/server/core/providers/ServerRouterProvider.ts +259 -115
  284. package/src/server/core/providers/ServerTimingProvider.ts +2 -2
  285. package/src/server/links/index.ts +1 -1
  286. package/src/server/links/providers/LinkProvider.ts +1 -1
  287. package/src/server/static/providers/ServerStaticProvider.ts +10 -0
  288. package/src/server/swagger/index.ts +1 -1
  289. package/src/server/swagger/providers/ServerSwaggerProvider.ts +5 -8
  290. package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
  291. package/src/sms/providers/LocalSmsProvider.ts +8 -7
  292. package/src/vite/helpers/boot.ts +28 -17
  293. package/src/vite/helpers/importViteReact.ts +13 -0
  294. package/src/vite/index.ts +1 -21
  295. package/src/vite/plugins/viteAlephaDev.ts +16 -1
  296. package/src/vite/plugins/viteAlephaSsrPreload.ts +222 -0
  297. package/src/vite/tasks/buildClient.ts +11 -0
  298. package/src/vite/tasks/buildServer.ts +59 -4
  299. package/src/vite/tasks/devServer.ts +71 -0
  300. package/src/vite/tasks/generateCloudflare.ts +7 -0
  301. package/src/vite/tasks/index.ts +2 -1
  302. package/dist/server/security/index.browser.js +0 -13
  303. package/dist/server/security/index.browser.js.map +0 -1
  304. package/dist/server/security/index.d.ts +0 -173
  305. package/dist/server/security/index.d.ts.map +0 -1
  306. package/dist/server/security/index.js +0 -311
  307. package/dist/server/security/index.js.map +0 -1
  308. package/src/cli/assets/appRouterTs.ts +0 -9
  309. package/src/cli/assets/mainTs.ts +0 -13
  310. package/src/cli/assets/viteConfigTs.ts +0 -14
  311. package/src/cli/commands/run.ts +0 -24
  312. package/src/server/security/index.browser.ts +0 -10
  313. package/src/server/security/index.ts +0 -94
  314. package/src/vite/plugins/viteAlepha.ts +0 -37
  315. package/src/vite/plugins/viteAlephaBuild.ts +0 -281
  316. /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
  317. /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
@@ -3,22 +3,15 @@ import { KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } f
3
3
  import * as alepha_server0 from "alepha/server";
4
4
  import { DateTimeProvider } from "alepha/datetime";
5
5
  import * as alepha_logger0 from "alepha/logger";
6
- import * as alepha_orm14 from "alepha/orm";
6
+ import * as alepha_orm0 from "alepha/orm";
7
7
  import * as alepha_topic0 from "alepha/topic";
8
8
  import * as alepha_scheduler0 from "alepha/scheduler";
9
- import "bun";
10
- import "bun:sqlite";
11
- import "drizzle-orm/bun-sql";
12
- import "drizzle-orm/bun-sqlite";
13
9
  import "drizzle-orm/d1";
14
10
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
15
11
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
16
12
  import "alepha/retry";
17
- import "alepha/lock";
18
13
  import * as typebox0 from "typebox";
19
14
  import "drizzle-orm/sqlite-core";
20
- import "drizzle-orm/postgres-js";
21
- import "postgres";
22
15
  import { UserAccount } from "alepha/security";
23
16
 
24
17
  //#region ../../src/api/parameters/schemas/parameterStatusSchema.d.ts
@@ -38,66 +31,66 @@ type ParameterStatus = Static<typeof parameterStatusSchema>;
38
31
  * - Activation scheduling
39
32
  * - Audit trail (creator info)
40
33
  */
41
- declare const parameters: alepha_orm14.EntityPrimitive<alepha624.TObject<{
42
- id: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_PRIMARY_KEY>, typeof alepha_orm14.PG_DEFAULT>;
43
- createdAt: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_CREATED_AT>, typeof alepha_orm14.PG_DEFAULT>;
44
- updatedAt: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_UPDATED_AT>, typeof alepha_orm14.PG_DEFAULT>;
45
- /**
46
- * Configuration name using dot notation for tree hierarchy.
47
- * Examples: "app.features", "app.pricing.tiers", "system.limits"
48
- */
34
+ declare const parameters: alepha_orm0.EntityPrimitive<alepha624.TObject<{
35
+ id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
36
+ createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
37
+ updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
38
+ /**
39
+ * Configuration name using dot notation for tree hierarchy.
40
+ * Examples: "app.features", "app.pricing.tiers", "system.limits"
41
+ */
49
42
  name: alepha624.TString;
50
43
  /**
51
- * The configuration content as JSON.
52
- */
44
+ * The configuration content as JSON.
45
+ */
53
46
  content: alepha624.TRecord<string, alepha624.TAny>;
54
47
  /**
55
- * Schema version hash for detecting schema changes.
56
- * Used for auto-migration when schema evolves.
57
- */
48
+ * Schema version hash for detecting schema changes.
49
+ * Used for auto-migration when schema evolves.
50
+ */
58
51
  schemaHash: alepha624.TString;
59
52
  /**
60
- * Current status of this parameter version.
61
- */
62
- status: alepha_orm14.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm14.PG_DEFAULT>;
53
+ * Current status of this parameter version.
54
+ */
55
+ status: alepha_orm0.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm0.PG_DEFAULT>;
63
56
  /**
64
- * When this version should become active.
65
- * Default is immediate (now).
66
- */
57
+ * When this version should become active.
58
+ * Default is immediate (now).
59
+ */
67
60
  activationDate: alepha624.TString;
68
61
  /**
69
- * When this version was deactivated (became expired).
70
- * Null if still active or scheduled.
71
- */
62
+ * When this version was deactivated (became expired).
63
+ * Null if still active or scheduled.
64
+ */
72
65
  expiredAt: alepha624.TOptional<alepha624.TString>;
73
66
  /**
74
- * Version number for this configuration.
75
- * Auto-incremented per config name.
76
- */
67
+ * Version number for this configuration.
68
+ * Auto-incremented per config name.
69
+ */
77
70
  version: alepha624.TInteger;
78
71
  /**
79
- * Optional description of changes in this version.
80
- */
72
+ * Optional description of changes in this version.
73
+ */
81
74
  changeDescription: alepha624.TOptional<alepha624.TString>;
82
75
  /**
83
- * Optional tags for filtering/categorization.
84
- */
76
+ * Optional tags for filtering/categorization.
77
+ */
85
78
  tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
86
79
  /**
87
- * Creator user ID (if available).
88
- */
80
+ * Creator user ID (if available).
81
+ */
89
82
  creatorId: alepha624.TOptional<alepha624.TString>;
90
83
  /**
91
- * Creator display name for audit trail.
92
- */
84
+ * Creator display name for audit trail.
85
+ */
93
86
  creatorName: alepha624.TOptional<alepha624.TString>;
94
87
  /**
95
- * Previous content before this change (for rollback reference).
96
- */
88
+ * Previous content before this change (for rollback reference).
89
+ */
97
90
  previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
98
91
  /**
99
- * Migration log if schema changed.
100
- */
92
+ * Migration log if schema changed.
93
+ */
101
94
  migrationLog: alepha624.TOptional<alepha624.TString>;
102
95
  }>>;
103
96
  type Parameter = Static<typeof parameters.schema>;
@@ -133,114 +126,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
133
126
  //#region ../../src/orm/primitives/$entity.d.ts
134
127
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
135
128
  /**
136
- * The database table name that will be created for this entity.
137
- * If not provided, name will be inferred from the $repository variable name.
138
- */
129
+ * The database table name that will be created for this entity.
130
+ * If not provided, name will be inferred from the $repository variable name.
131
+ */
139
132
  name: string;
140
133
  /**
141
- * TypeBox schema defining the table structure and column types.
142
- */
134
+ * TypeBox schema defining the table structure and column types.
135
+ */
143
136
  schema: T;
144
137
  /**
145
- * Database indexes to create for query optimization.
146
- */
138
+ * Database indexes to create for query optimization.
139
+ */
147
140
  indexes?: (Keys | {
148
141
  /**
149
- * Single column to index.
150
- */
142
+ * Single column to index.
143
+ */
151
144
  column: Keys;
152
145
  /**
153
- * Whether this should be a unique index (enforces uniqueness constraint).
154
- */
146
+ * Whether this should be a unique index (enforces uniqueness constraint).
147
+ */
155
148
  unique?: boolean;
156
149
  /**
157
- * Custom name for the index. If not provided, generates name automatically.
158
- */
150
+ * Custom name for the index. If not provided, generates name automatically.
151
+ */
159
152
  name?: string;
160
153
  } | {
161
154
  /**
162
- * Multiple columns for composite index (order matters for query optimization).
163
- */
155
+ * Multiple columns for composite index (order matters for query optimization).
156
+ */
164
157
  columns: Keys[];
165
158
  /**
166
- * Whether this should be a unique index (enforces uniqueness constraint).
167
- */
159
+ * Whether this should be a unique index (enforces uniqueness constraint).
160
+ */
168
161
  unique?: boolean;
169
162
  /**
170
- * Custom name for the index. If not provided, generates name automatically.
171
- */
163
+ * Custom name for the index. If not provided, generates name automatically.
164
+ */
172
165
  name?: string;
173
166
  })[];
174
167
  /**
175
- * Foreign key constraints to maintain referential integrity.
176
- */
168
+ * Foreign key constraints to maintain referential integrity.
169
+ */
177
170
  foreignKeys?: Array<{
178
171
  /**
179
- * Optional name for the foreign key constraint.
180
- */
172
+ * Optional name for the foreign key constraint.
173
+ */
181
174
  name?: string;
182
175
  /**
183
- * Local columns that reference the foreign table.
184
- */
176
+ * Local columns that reference the foreign table.
177
+ */
185
178
  columns: Array<keyof Static<T>>;
186
179
  /**
187
- * Referenced columns in the foreign table.
188
- * Must be EntityColumn references from other entities.
189
- */
180
+ * Referenced columns in the foreign table.
181
+ * Must be EntityColumn references from other entities.
182
+ */
190
183
  foreignColumns: Array<() => EntityColumn<any>>;
191
184
  }>;
192
185
  /**
193
- * Additional table constraints for data validation.
194
- *
195
- * Constraints enforce business rules at the database level, providing
196
- * an additional layer of data integrity beyond application validation.
197
- *
198
- * **Constraint Types**:
199
- * - **Unique constraints**: Prevent duplicate values across columns
200
- * - **Check constraints**: Enforce custom validation rules with SQL expressions
201
- *
202
- * @example
203
- * ```ts
204
- * constraints: [
205
- * {
206
- * name: "unique_user_email",
207
- * columns: ["email"],
208
- * unique: true
209
- * },
210
- * {
211
- * name: "valid_age_range",
212
- * columns: ["age"],
213
- * check: sql`age >= 0 AND age <= 150`
214
- * },
215
- * {
216
- * name: "unique_user_username_per_tenant",
217
- * columns: ["tenantId", "username"],
218
- * unique: true
219
- * }
220
- * ]
221
- * ```
222
- */
186
+ * Additional table constraints for data validation.
187
+ *
188
+ * Constraints enforce business rules at the database level, providing
189
+ * an additional layer of data integrity beyond application validation.
190
+ *
191
+ * **Constraint Types**:
192
+ * - **Unique constraints**: Prevent duplicate values across columns
193
+ * - **Check constraints**: Enforce custom validation rules with SQL expressions
194
+ *
195
+ * @example
196
+ * ```ts
197
+ * constraints: [
198
+ * {
199
+ * name: "unique_user_email",
200
+ * columns: ["email"],
201
+ * unique: true
202
+ * },
203
+ * {
204
+ * name: "valid_age_range",
205
+ * columns: ["age"],
206
+ * check: sql`age >= 0 AND age <= 150`
207
+ * },
208
+ * {
209
+ * name: "unique_user_username_per_tenant",
210
+ * columns: ["tenantId", "username"],
211
+ * unique: true
212
+ * }
213
+ * ]
214
+ * ```
215
+ */
223
216
  constraints?: Array<{
224
217
  /**
225
- * Columns involved in this constraint.
226
- */
218
+ * Columns involved in this constraint.
219
+ */
227
220
  columns: Array<keyof Static<T>>;
228
221
  /**
229
- * Optional name for the constraint.
230
- */
222
+ * Optional name for the constraint.
223
+ */
231
224
  name?: string;
232
225
  /**
233
- * Whether this is a unique constraint.
234
- */
226
+ * Whether this is a unique constraint.
227
+ */
235
228
  unique?: boolean | {};
236
229
  /**
237
- * SQL expression for check constraint validation.
238
- */
230
+ * SQL expression for check constraint validation.
231
+ */
239
232
  check?: SQL;
240
233
  }>;
241
234
  /**
242
- * Advanced Drizzle ORM configuration for complex table setups.
243
- */
235
+ * Advanced Drizzle ORM configuration for complex table setups.
236
+ */
244
237
  config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
245
238
  }
246
239
  declare class EntityPrimitive<T extends TObject = TObject> {
@@ -288,8 +281,8 @@ type PgSymbols = {
288
281
  [PG_REF]: PgRefOptions;
289
282
  [PG_ENUM]: PgEnumOptions;
290
283
  /**
291
- * @deprecated Use `PG_IDENTITY` instead.
292
- */
284
+ * @deprecated Use `PG_IDENTITY` instead.
285
+ */
293
286
  [PG_SERIAL]: {};
294
287
  };
295
288
  type PgSymbolKeys = keyof PgSymbols;
@@ -319,190 +312,6 @@ interface PgRefOptions {
319
312
  */
320
313
  type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
321
314
  //#endregion
322
- //#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
323
- declare module "alepha" {
324
- interface Env extends Partial<Static<typeof envSchema$1>> {}
325
- }
326
- declare const envSchema$1: alepha624.TObject<{
327
- /**
328
- * Main configuration for database connection.
329
- * Accept a string in the format of a Postgres connection URL.
330
- * Example: postgres://user:password@localhost:5432/database
331
- * or
332
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
333
- */
334
- DATABASE_URL: alepha624.TOptional<alepha624.TString>;
335
- /**
336
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
337
- */
338
- POSTGRES_SCHEMA: alepha624.TOptional<alepha624.TString>;
339
- }>;
340
- /**
341
- * Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
342
- *
343
- * This provider uses Bun's built-in SQL class for PostgreSQL connections,
344
- * which provides excellent performance on the Bun runtime.
345
- *
346
- * @example
347
- * ```ts
348
- * // Set DATABASE_URL environment variable
349
- * // DATABASE_URL=postgres://user:password@localhost:5432/database
350
- *
351
- * // Or configure programmatically
352
- * alepha.with({
353
- * provide: DatabaseProvider,
354
- * use: BunPostgresProvider,
355
- * });
356
- * ```
357
- */
358
- //#endregion
359
- //#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
360
- /**
361
- * Configuration options for the Bun SQLite database provider.
362
- */
363
- declare const bunSqliteOptions: alepha624.Atom<alepha624.TObject<{
364
- path: alepha624.TOptional<alepha624.TString>;
365
- }>, "alepha.postgres.bun-sqlite.options">;
366
- type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
367
- declare module "alepha" {
368
- interface State {
369
- [bunSqliteOptions.key]: BunSqliteProviderOptions;
370
- }
371
- }
372
- /**
373
- * Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
374
- *
375
- * This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
376
- * which provides excellent performance on the Bun runtime.
377
- *
378
- * @example
379
- * ```ts
380
- * // Set DATABASE_URL environment variable
381
- * // DATABASE_URL=sqlite://./my-database.db
382
- *
383
- * // Or configure programmatically
384
- * alepha.with({
385
- * provide: DatabaseProvider,
386
- * use: BunSqliteProvider,
387
- * });
388
- *
389
- * // Or use options atom
390
- * alepha.store.mut(bunSqliteOptions, (old) => ({
391
- * ...old,
392
- * path: ":memory:",
393
- * }));
394
- * ```
395
- */
396
- //#endregion
397
- //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
398
- declare module "alepha" {
399
- interface Env extends Partial<Static<typeof envSchema>> {}
400
- }
401
- declare const envSchema: alepha624.TObject<{
402
- /**
403
- * Main configuration for database connection.
404
- * Accept a string in the format of a Postgres connection URL.
405
- * Example: postgres://user:password@localhost:5432/database
406
- * or
407
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
408
- */
409
- DATABASE_URL: alepha624.TOptional<alepha624.TString>;
410
- /**
411
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
412
- *
413
- * It will monkey patch drizzle tables.
414
- */
415
- POSTGRES_SCHEMA: alepha624.TOptional<alepha624.TString>;
416
- }>;
417
- //#endregion
418
- //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
419
- /**
420
- * Configuration options for the Node.js SQLite database provider.
421
- */
422
- declare const nodeSqliteOptions: alepha624.Atom<alepha624.TObject<{
423
- path: alepha624.TOptional<alepha624.TString>;
424
- }>, "alepha.postgres.node-sqlite.options">;
425
- type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
426
- declare module "alepha" {
427
- interface State {
428
- [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
429
- }
430
- }
431
- /**
432
- * Add a fake support for SQLite in Node.js based on Postgres interfaces.
433
- *
434
- * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
435
- * This is NOT recommended for production use.
436
- */
437
- //#endregion
438
- //#region ../../src/orm/index.d.ts
439
- declare module "alepha" {
440
- interface Hooks {
441
- /**
442
- * Fires before creating an entity in the repository.
443
- */
444
- "repository:create:before": {
445
- tableName: string;
446
- data: any;
447
- };
448
- /**
449
- * Fires after creating an entity in the repository.
450
- */
451
- "repository:create:after": {
452
- tableName: string;
453
- data: any;
454
- entity: any;
455
- };
456
- /**
457
- * Fires before updating entities in the repository.
458
- */
459
- "repository:update:before": {
460
- tableName: string;
461
- where: any;
462
- data: any;
463
- };
464
- /**
465
- * Fires after updating entities in the repository.
466
- */
467
- "repository:update:after": {
468
- tableName: string;
469
- where: any;
470
- data: any;
471
- entities: any[];
472
- };
473
- /**
474
- * Fires before deleting entities from the repository.
475
- */
476
- "repository:delete:before": {
477
- tableName: string;
478
- where: any;
479
- };
480
- /**
481
- * Fires after deleting entities from the repository.
482
- */
483
- "repository:delete:after": {
484
- tableName: string;
485
- where: any;
486
- ids: Array<string | number>;
487
- };
488
- /**
489
- * Fires before reading entities from the repository.
490
- */
491
- "repository:read:before": {
492
- tableName: string;
493
- query: any;
494
- };
495
- /**
496
- * Fires after reading entities from the repository.
497
- */
498
- "repository:read:after": {
499
- tableName: string;
500
- query: any;
501
- entities: any[];
502
- };
503
- }
504
- }
505
- //#endregion
506
315
  //#region ../../src/api/parameters/primitives/$config.d.ts
507
316
  /**
508
317
  * Creates a versioned configuration primitive for managing application settings.
@@ -550,21 +359,21 @@ declare module "alepha" {
550
359
  */
551
360
  interface ConfigPrimitiveOptions<T extends TObject> {
552
361
  /**
553
- * Configuration name using dot notation for tree hierarchy.
554
- * Examples: "app.features", "app.pricing.tiers", "system.limits"
555
- */
362
+ * Configuration name using dot notation for tree hierarchy.
363
+ * Examples: "app.features", "app.pricing.tiers", "system.limits"
364
+ */
556
365
  name?: string;
557
366
  /**
558
- * Human-readable description of the configuration.
559
- */
367
+ * Human-readable description of the configuration.
368
+ */
560
369
  description?: string;
561
370
  /**
562
- * TypeBox schema defining the configuration structure.
563
- */
371
+ * TypeBox schema defining the configuration structure.
372
+ */
564
373
  schema: T;
565
374
  /**
566
- * Default value used when no configuration exists in database.
567
- */
375
+ * Default value used when no configuration exists in database.
376
+ */
568
377
  default: Static<T>;
569
378
  }
570
379
  declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimitiveOptions<T>> {
@@ -579,45 +388,45 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
579
388
  /** Whether initial load has completed */
580
389
  protected loaded: boolean;
581
390
  /**
582
- * Configuration name (uses property key if not specified).
583
- */
391
+ * Configuration name (uses property key if not specified).
392
+ */
584
393
  get name(): string;
585
394
  /**
586
- * The TypeBox schema for this configuration.
587
- */
395
+ * The TypeBox schema for this configuration.
396
+ */
588
397
  get schema(): T;
589
398
  /**
590
- * Get the current configuration value.
591
- */
399
+ * Get the current configuration value.
400
+ */
592
401
  get current(): Static<T>;
593
402
  /**
594
- * Get a specific field from the current configuration.
595
- */
596
- get<Key$1 extends keyof Static<T>>(key: Key$1): Static<T>[Key$1];
403
+ * Get a specific field from the current configuration.
404
+ */
405
+ get<Key extends keyof Static<T>>(key: Key): Static<T>[Key];
597
406
  /**
598
- * Set a new configuration value.
599
- *
600
- * @param value - The new configuration value
601
- * @param options - Optional settings (activation date, creator info, etc.)
602
- */
407
+ * Set a new configuration value.
408
+ *
409
+ * @param value - The new configuration value
410
+ * @param options - Optional settings (activation date, creator info, etc.)
411
+ */
603
412
  set(value: Static<T>, options?: SetConfigOptions): Promise<void>;
604
413
  /**
605
- * Subscribe to configuration changes.
606
- */
414
+ * Subscribe to configuration changes.
415
+ */
607
416
  sub(fn: (curr: Static<T>) => void): () => void;
608
417
  /**
609
- * Reload configuration from database.
610
- * Called when scheduled config activates or sync message received.
611
- */
418
+ * Reload configuration from database.
419
+ * Called when scheduled config activates or sync message received.
420
+ */
612
421
  reload(): Promise<void>;
613
422
  /**
614
- * Update from sync message (called by ConfigStore).
615
- * Uses skipEvents to avoid infinite loops.
616
- */
423
+ * Update from sync message (called by ConfigStore).
424
+ * Uses skipEvents to avoid infinite loops.
425
+ */
617
426
  updateFromSync(content: unknown): Promise<void>;
618
427
  /**
619
- * Get version history for this configuration.
620
- */
428
+ * Get version history for this configuration.
429
+ */
621
430
  getHistory(): Promise<{
622
431
  expiredAt?: string | undefined;
623
432
  changeDescription?: string | undefined;
@@ -643,10 +452,11 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
643
452
  migrationLog: alepha624.TOptional<alepha624.TString>;
644
453
  }, string, alepha624.TAny> | undefined;
645
454
  migrationLog?: string | undefined;
455
+ name: string;
456
+ status: "expired" | "current" | "next" | "future";
646
457
  id: string;
647
458
  createdAt: string;
648
459
  updatedAt: string;
649
- name: string;
650
460
  content: typebox0.StaticRecord<[], "Decode", {}, {
651
461
  id: PgAttr<PgAttr<alepha624.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
652
462
  createdAt: PgAttr<PgAttr<alepha624.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
@@ -666,29 +476,28 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
666
476
  migrationLog: alepha624.TOptional<alepha624.TString>;
667
477
  }, string, alepha624.TAny>;
668
478
  schemaHash: string;
669
- status: "expired" | "current" | "next" | "future";
670
479
  activationDate: string;
671
480
  version: number;
672
481
  }[]>;
673
482
  /**
674
- * Rollback to a specific version.
675
- */
483
+ * Rollback to a specific version.
484
+ */
676
485
  rollback(version: number, options?: SetConfigOptions): Promise<void>;
677
486
  /**
678
- * Hook to load initial value from database on start.
679
- */
487
+ * Hook to load initial value from database on start.
488
+ */
680
489
  protected readonly onStart: alepha624.HookPrimitive<"start">;
681
490
  /**
682
- * Called after primitive creation to initialize.
683
- */
491
+ * Called after primitive creation to initialize.
492
+ */
684
493
  protected onInit(): void;
685
494
  /**
686
- * Load initial value from database.
687
- */
495
+ * Load initial value from database.
496
+ */
688
497
  protected loadInitial(): Promise<void>;
689
498
  /**
690
- * Calculate a hash of the schema for migration detection.
691
- */
499
+ * Calculate a hash of the schema for migration detection.
500
+ */
692
501
  protected calculateSchemaHash(): string;
693
502
  }
694
503
  declare const $config: {
@@ -697,21 +506,21 @@ declare const $config: {
697
506
  };
698
507
  interface SetConfigOptions {
699
508
  /**
700
- * User making the change (for audit trail).
701
- */
509
+ * User making the change (for audit trail).
510
+ */
702
511
  user?: Pick<UserAccount, "id" | "email" | "name">;
703
512
  /**
704
- * When this configuration should become active.
705
- * Default is immediate (now).
706
- */
513
+ * When this configuration should become active.
514
+ * Default is immediate (now).
515
+ */
707
516
  activationDate?: Date;
708
517
  /**
709
- * Description of the change.
710
- */
518
+ * Description of the change.
519
+ */
711
520
  changeDescription?: string;
712
521
  /**
713
- * Tags for filtering/categorization.
714
- */
522
+ * Tags for filtering/categorization.
523
+ */
715
524
  tags?: string[];
716
525
  }
717
526
  //#endregion
@@ -739,14 +548,14 @@ interface ConfigSyncPayload {
739
548
  declare class ConfigStore {
740
549
  protected readonly log: alepha_logger0.Logger;
741
550
  protected readonly dateTimeProvider: DateTimeProvider;
742
- protected readonly repo: alepha_orm14.Repository<TObject<{
743
- id: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_PRIMARY_KEY>, typeof alepha_orm14.PG_DEFAULT>;
744
- createdAt: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_CREATED_AT>, typeof alepha_orm14.PG_DEFAULT>;
745
- updatedAt: alepha_orm14.PgAttr<alepha_orm14.PgAttr<alepha624.TString, typeof alepha_orm14.PG_UPDATED_AT>, typeof alepha_orm14.PG_DEFAULT>;
551
+ protected readonly repo: alepha_orm0.Repository<TObject<{
552
+ id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
553
+ createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
554
+ updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
746
555
  name: alepha624.TString;
747
556
  content: alepha624.TRecord<string, alepha624.TAny>;
748
557
  schemaHash: alepha624.TString;
749
- status: alepha_orm14.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm14.PG_DEFAULT>;
558
+ status: alepha_orm0.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm0.PG_DEFAULT>;
750
559
  activationDate: alepha624.TString;
751
560
  expiredAt: alepha624.TOptional<alepha624.TString>;
752
561
  version: alepha624.TInteger;
@@ -772,50 +581,50 @@ declare class ConfigStore {
772
581
  }>;
773
582
  }>;
774
583
  /**
775
- * Register a config primitive with the store.
776
- */
584
+ * Register a config primitive with the store.
585
+ */
777
586
  register(config: ConfigPrimitive<any>): void;
778
587
  /**
779
- * Load the current config value from database.
780
- * Returns the current or next version if no current exists.
781
- */
588
+ * Load the current config value from database.
589
+ * Returns the current or next version if no current exists.
590
+ */
782
591
  load<T extends TObject>(name: string): Promise<Static<T> | null>;
783
592
  /**
784
- * Save a new config version.
785
- *
786
- * @param name - Config name (e.g., "app.features.flags")
787
- * @param content - New config content
788
- * @param schemaHash - Hash of the schema for migration detection
789
- * @param options - Additional options (activation date, creator info, etc.)
790
- */
593
+ * Save a new config version.
594
+ *
595
+ * @param name - Config name (e.g., "app.features.flags")
596
+ * @param content - New config content
597
+ * @param schemaHash - Hash of the schema for migration detection
598
+ * @param options - Additional options (activation date, creator info, etc.)
599
+ */
791
600
  save<T extends TObject>(name: string, content: Static<T>, schemaHash: string, options?: SaveConfigOptions): Promise<Parameter>;
792
601
  /**
793
- * Get all versions of a config.
794
- */
602
+ * Get all versions of a config.
603
+ */
795
604
  getHistory(name: string): Promise<Parameter[]>;
796
605
  /**
797
- * Get a specific version of a config.
798
- */
606
+ * Get a specific version of a config.
607
+ */
799
608
  getVersion(name: string, version: number): Promise<Parameter | null>;
800
609
  /**
801
- * Rollback to a previous version by creating a new version with old content.
802
- */
610
+ * Rollback to a previous version by creating a new version with old content.
611
+ */
803
612
  rollback(name: string, targetVersion: number, options?: SaveConfigOptions): Promise<Parameter>;
804
613
  /**
805
- * Get all configs by status.
806
- */
614
+ * Get all configs by status.
615
+ */
807
616
  getByStatus(status: ParameterStatus): Promise<Parameter[]>;
808
617
  /**
809
- * Get current config value with fallback to default from registered primitive.
810
- * Returns the in-memory current value which may be the default if never saved.
811
- */
618
+ * Get current config value with fallback to default from registered primitive.
619
+ * Returns the in-memory current value which may be the default if never saved.
620
+ */
812
621
  getCurrentValue(name: string): {
813
622
  content: unknown;
814
623
  isDefault: boolean;
815
624
  } | null;
816
625
  /**
817
- * Get config info including current value with default fallback.
818
- */
626
+ * Get config info including current value with default fallback.
627
+ */
819
628
  getCurrentWithDefault(name: string): Promise<{
820
629
  current: Parameter | null;
821
630
  next: Parameter | null;
@@ -824,38 +633,38 @@ declare class ConfigStore {
824
633
  schema: TObject | null;
825
634
  }>;
826
635
  /**
827
- * Get all unique config names (for tree view).
828
- */
636
+ * Get all unique config names (for tree view).
637
+ */
829
638
  getConfigNames(): Promise<string[]>;
830
639
  /**
831
- * Build a tree structure from config names for UI.
832
- * Includes both database configs and registered (but not yet saved) configs.
833
- */
640
+ * Build a tree structure from config names for UI.
641
+ * Includes both database configs and registered (but not yet saved) configs.
642
+ */
834
643
  getConfigTree(): Promise<ConfigTreeNode[]>;
835
644
  /**
836
- * Check and activate scheduled configs that are due.
837
- * Should be called periodically (e.g., via scheduler).
838
- */
645
+ * Check and activate scheduled configs that are due.
646
+ * Should be called periodically (e.g., via scheduler).
647
+ */
839
648
  activateScheduledConfigs(): Promise<void>;
840
649
  /**
841
- * Transition config statuses when a new current is activated.
842
- */
650
+ * Transition config statuses when a new current is activated.
651
+ */
843
652
  protected transitionStatuses(name: string, now: Date): Promise<void>;
844
653
  /**
845
- * Recalculate statuses based on activation dates.
846
- */
654
+ * Recalculate statuses based on activation dates.
655
+ */
847
656
  protected recalculateStatuses(name: string): Promise<void>;
848
657
  /**
849
- * Publish sync event to other instances.
850
- */
658
+ * Publish sync event to other instances.
659
+ */
851
660
  protected publishSync(name: string, version: number, content: unknown, status: ParameterStatus): Promise<void>;
852
661
  /**
853
- * Handle incoming sync message from other instances.
854
- */
662
+ * Handle incoming sync message from other instances.
663
+ */
855
664
  protected handleSyncMessage(payload: ConfigSyncPayload): Promise<void>;
856
665
  /**
857
- * Build tree structure from dot-notation names.
858
- */
666
+ * Build tree structure from dot-notation names.
667
+ */
859
668
  protected buildTree(names: string[]): ConfigTreeNode[];
860
669
  }
861
670
  interface SaveConfigOptions {
@@ -889,9 +698,9 @@ declare class AdminConfigController {
889
698
  protected readonly group = "admin:configs";
890
699
  protected readonly store: ConfigStore;
891
700
  /**
892
- * Get tree structure of all configuration names.
893
- * Useful for admin UI navigation.
894
- */
701
+ * Get tree structure of all configuration names.
702
+ * Useful for admin UI navigation.
703
+ */
895
704
  getConfigTree: alepha_server0.ActionPrimitiveFn<{
896
705
  response: alepha624.TArray<alepha624.TObject<{
897
706
  name: alepha624.TString;
@@ -901,16 +710,16 @@ declare class AdminConfigController {
901
710
  }>>;
902
711
  }>;
903
712
  /**
904
- * List all unique configuration names.
905
- */
713
+ * List all unique configuration names.
714
+ */
906
715
  listConfigNames: alepha_server0.ActionPrimitiveFn<{
907
716
  response: alepha624.TObject<{
908
717
  names: alepha624.TArray<alepha624.TString>;
909
718
  }>;
910
719
  }>;
911
720
  /**
912
- * Get configurations by status.
913
- */
721
+ * Get configurations by status.
722
+ */
914
723
  getByStatus: alepha_server0.ActionPrimitiveFn<{
915
724
  params: alepha624.TObject<{
916
725
  status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
@@ -937,8 +746,8 @@ declare class AdminConfigController {
937
746
  }>;
938
747
  }>;
939
748
  /**
940
- * Get version history for a specific configuration.
941
- */
749
+ * Get version history for a specific configuration.
750
+ */
942
751
  getHistory: alepha_server0.ActionPrimitiveFn<{
943
752
  params: alepha624.TObject<{
944
753
  name: alepha624.TString;
@@ -965,10 +774,10 @@ declare class AdminConfigController {
965
774
  }>;
966
775
  }>;
967
776
  /**
968
- * Get current and next values for a configuration.
969
- * Includes defaultValue and currentValue from the registered primitive
970
- * even if no versions exist in the database yet.
971
- */
777
+ * Get current and next values for a configuration.
778
+ * Includes defaultValue and currentValue from the registered primitive
779
+ * even if no versions exist in the database yet.
780
+ */
972
781
  getCurrent: alepha_server0.ActionPrimitiveFn<{
973
782
  params: alepha624.TObject<{
974
783
  name: alepha624.TString;
@@ -1016,8 +825,8 @@ declare class AdminConfigController {
1016
825
  }>;
1017
826
  }>;
1018
827
  /**
1019
- * Get a specific version of a configuration.
1020
- */
828
+ * Get a specific version of a configuration.
829
+ */
1021
830
  getVersion: alepha_server0.ActionPrimitiveFn<{
1022
831
  params: alepha624.TObject<{
1023
832
  name: alepha624.TString;
@@ -1045,8 +854,8 @@ declare class AdminConfigController {
1045
854
  }>;
1046
855
  }>;
1047
856
  /**
1048
- * Create a new configuration version.
1049
- */
857
+ * Create a new configuration version.
858
+ */
1050
859
  createVersion: alepha_server0.ActionPrimitiveFn<{
1051
860
  params: alepha624.TObject<{
1052
861
  name: alepha624.TString;
@@ -1080,8 +889,8 @@ declare class AdminConfigController {
1080
889
  }>;
1081
890
  }>;
1082
891
  /**
1083
- * Rollback to a previous version.
1084
- */
892
+ * Rollback to a previous version.
893
+ */
1085
894
  rollback: alepha_server0.ActionPrimitiveFn<{
1086
895
  params: alepha624.TObject<{
1087
896
  name: alepha624.TString;
@@ -1112,8 +921,8 @@ declare class AdminConfigController {
1112
921
  }>;
1113
922
  }>;
1114
923
  /**
1115
- * Activate a scheduled version immediately.
1116
- */
924
+ * Activate a scheduled version immediately.
925
+ */
1117
926
  activateNow: alepha_server0.ActionPrimitiveFn<{
1118
927
  params: alepha624.TObject<{
1119
928
  name: alepha624.TString;
@@ -1143,9 +952,9 @@ declare class AdminConfigController {
1143
952
  }>;
1144
953
  }>;
1145
954
  /**
1146
- * Trigger activation check for all scheduled configs.
1147
- * Normally called by a scheduler, but exposed for manual triggering.
1148
- */
955
+ * Trigger activation check for all scheduled configs.
956
+ * Normally called by a scheduler, but exposed for manual triggering.
957
+ */
1149
958
  checkScheduled: alepha_server0.ActionPrimitiveFn<{
1150
959
  response: alepha624.TObject<{
1151
960
  message: alepha624.TString;
@@ -1165,8 +974,8 @@ declare class ConfigActivationScheduler {
1165
974
  protected readonly log: alepha_logger0.Logger;
1166
975
  protected readonly store: ConfigStore;
1167
976
  /**
1168
- * Check for scheduled configurations every minute.
1169
- */
977
+ * Check for scheduled configurations every minute.
978
+ */
1170
979
  checkActivations: alepha_scheduler0.SchedulerPrimitive;
1171
980
  }
1172
981
  //#endregion