alepha 0.15.0 → 0.15.1

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 (222) hide show
  1. package/README.md +43 -98
  2. package/dist/api/audits/index.d.ts +240 -240
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/audits/index.js +2 -2
  5. package/dist/api/audits/index.js.map +1 -1
  6. package/dist/api/files/index.d.ts +185 -185
  7. package/dist/api/files/index.d.ts.map +1 -1
  8. package/dist/api/files/index.js +2 -2
  9. package/dist/api/files/index.js.map +1 -1
  10. package/dist/api/jobs/index.d.ts +245 -245
  11. package/dist/api/jobs/index.d.ts.map +1 -1
  12. package/dist/api/notifications/index.browser.js +4 -4
  13. package/dist/api/notifications/index.browser.js.map +1 -1
  14. package/dist/api/notifications/index.d.ts +74 -74
  15. package/dist/api/notifications/index.d.ts.map +1 -1
  16. package/dist/api/notifications/index.js +4 -4
  17. package/dist/api/notifications/index.js.map +1 -1
  18. package/dist/api/parameters/index.d.ts +221 -221
  19. package/dist/api/parameters/index.d.ts.map +1 -1
  20. package/dist/api/users/index.d.ts +1632 -1631
  21. package/dist/api/users/index.d.ts.map +1 -1
  22. package/dist/api/users/index.js +26 -34
  23. package/dist/api/users/index.js.map +1 -1
  24. package/dist/api/verifications/index.d.ts +132 -132
  25. package/dist/api/verifications/index.d.ts.map +1 -1
  26. package/dist/batch/index.d.ts +122 -122
  27. package/dist/batch/index.d.ts.map +1 -1
  28. package/dist/bucket/index.d.ts +163 -163
  29. package/dist/bucket/index.d.ts.map +1 -1
  30. package/dist/cache/core/index.d.ts +46 -46
  31. package/dist/cache/core/index.d.ts.map +1 -1
  32. package/dist/cache/redis/index.d.ts.map +1 -1
  33. package/dist/cache/redis/index.js +2 -2
  34. package/dist/cache/redis/index.js.map +1 -1
  35. package/dist/cli/index.d.ts +5933 -201
  36. package/dist/cli/index.d.ts.map +1 -1
  37. package/dist/cli/index.js +609 -169
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/command/index.d.ts +296 -296
  40. package/dist/command/index.d.ts.map +1 -1
  41. package/dist/command/index.js +19 -19
  42. package/dist/command/index.js.map +1 -1
  43. package/dist/core/index.browser.js +268 -79
  44. package/dist/core/index.browser.js.map +1 -1
  45. package/dist/core/index.d.ts +768 -694
  46. package/dist/core/index.d.ts.map +1 -1
  47. package/dist/core/index.js +268 -79
  48. package/dist/core/index.js.map +1 -1
  49. package/dist/core/index.native.js +268 -79
  50. package/dist/core/index.native.js.map +1 -1
  51. package/dist/datetime/index.d.ts +44 -44
  52. package/dist/datetime/index.d.ts.map +1 -1
  53. package/dist/email/index.d.ts +25 -25
  54. package/dist/email/index.d.ts.map +1 -1
  55. package/dist/fake/index.d.ts +5409 -5409
  56. package/dist/fake/index.d.ts.map +1 -1
  57. package/dist/fake/index.js +22 -22
  58. package/dist/fake/index.js.map +1 -1
  59. package/dist/file/index.d.ts +435 -435
  60. package/dist/file/index.d.ts.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 +24 -24
  65. package/dist/logger/index.d.ts.map +1 -1
  66. package/dist/logger/index.js +1 -5
  67. package/dist/logger/index.js.map +1 -1
  68. package/dist/mcp/index.d.ts +216 -198
  69. package/dist/mcp/index.d.ts.map +1 -1
  70. package/dist/mcp/index.js +28 -4
  71. package/dist/mcp/index.js.map +1 -1
  72. package/dist/orm/index.browser.js +9 -9
  73. package/dist/orm/index.browser.js.map +1 -1
  74. package/dist/orm/index.bun.js +83 -76
  75. package/dist/orm/index.bun.js.map +1 -1
  76. package/dist/orm/index.d.ts +961 -960
  77. package/dist/orm/index.d.ts.map +1 -1
  78. package/dist/orm/index.js +88 -81
  79. package/dist/orm/index.js.map +1 -1
  80. package/dist/queue/core/index.d.ts +244 -244
  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.d.ts +105 -105
  84. package/dist/redis/index.d.ts.map +1 -1
  85. package/dist/retry/index.d.ts +69 -69
  86. package/dist/retry/index.d.ts.map +1 -1
  87. package/dist/router/index.d.ts +6 -6
  88. package/dist/router/index.d.ts.map +1 -1
  89. package/dist/scheduler/index.d.ts +108 -26
  90. package/dist/scheduler/index.d.ts.map +1 -1
  91. package/dist/scheduler/index.js +393 -1
  92. package/dist/scheduler/index.js.map +1 -1
  93. package/dist/security/index.d.ts +532 -209
  94. package/dist/security/index.d.ts.map +1 -1
  95. package/dist/security/index.js +1422 -11
  96. package/dist/security/index.js.map +1 -1
  97. package/dist/server/auth/index.d.ts +1296 -271
  98. package/dist/server/auth/index.d.ts.map +1 -1
  99. package/dist/server/auth/index.js +1249 -18
  100. package/dist/server/auth/index.js.map +1 -1
  101. package/dist/server/cache/index.d.ts +56 -56
  102. package/dist/server/cache/index.d.ts.map +1 -1
  103. package/dist/server/compress/index.d.ts +3 -3
  104. package/dist/server/compress/index.d.ts.map +1 -1
  105. package/dist/server/cookies/index.d.ts +6 -6
  106. package/dist/server/cookies/index.d.ts.map +1 -1
  107. package/dist/server/core/index.d.ts +196 -186
  108. package/dist/server/core/index.d.ts.map +1 -1
  109. package/dist/server/core/index.js +43 -27
  110. package/dist/server/core/index.js.map +1 -1
  111. package/dist/server/cors/index.d.ts +11 -11
  112. package/dist/server/cors/index.d.ts.map +1 -1
  113. package/dist/server/health/index.d.ts.map +1 -1
  114. package/dist/server/helmet/index.d.ts +2 -2
  115. package/dist/server/helmet/index.d.ts.map +1 -1
  116. package/dist/server/links/index.browser.js +9 -1
  117. package/dist/server/links/index.browser.js.map +1 -1
  118. package/dist/server/links/index.d.ts +83 -83
  119. package/dist/server/links/index.d.ts.map +1 -1
  120. package/dist/server/links/index.js +13 -5
  121. package/dist/server/links/index.js.map +1 -1
  122. package/dist/server/metrics/index.d.ts +514 -1
  123. package/dist/server/metrics/index.d.ts.map +1 -1
  124. package/dist/server/metrics/index.js +4462 -4
  125. package/dist/server/metrics/index.js.map +1 -1
  126. package/dist/server/multipart/index.d.ts +6 -6
  127. package/dist/server/multipart/index.d.ts.map +1 -1
  128. package/dist/server/proxy/index.d.ts +102 -102
  129. package/dist/server/proxy/index.d.ts.map +1 -1
  130. package/dist/server/rate-limit/index.d.ts +16 -16
  131. package/dist/server/rate-limit/index.d.ts.map +1 -1
  132. package/dist/server/static/index.d.ts +44 -44
  133. package/dist/server/static/index.d.ts.map +1 -1
  134. package/dist/server/swagger/index.d.ts +47 -47
  135. package/dist/server/swagger/index.d.ts.map +1 -1
  136. package/dist/sms/index.d.ts +11 -11
  137. package/dist/sms/index.d.ts.map +1 -1
  138. package/dist/sms/index.js +3 -3
  139. package/dist/sms/index.js.map +1 -1
  140. package/dist/thread/index.d.ts +71 -71
  141. package/dist/thread/index.d.ts.map +1 -1
  142. package/dist/thread/index.js +2 -2
  143. package/dist/thread/index.js.map +1 -1
  144. package/dist/topic/core/index.d.ts +318 -318
  145. package/dist/topic/core/index.d.ts.map +1 -1
  146. package/dist/topic/redis/index.d.ts +6 -6
  147. package/dist/topic/redis/index.d.ts.map +1 -1
  148. package/dist/vite/index.d.ts +2324 -1719
  149. package/dist/vite/index.d.ts.map +1 -1
  150. package/dist/vite/index.js +123 -475
  151. package/dist/vite/index.js.map +1 -1
  152. package/dist/websocket/index.browser.js +3 -3
  153. package/dist/websocket/index.browser.js.map +1 -1
  154. package/dist/websocket/index.d.ts +275 -275
  155. package/dist/websocket/index.d.ts.map +1 -1
  156. package/dist/websocket/index.js +3 -3
  157. package/dist/websocket/index.js.map +1 -1
  158. package/package.json +9 -9
  159. package/src/api/users/services/SessionService.ts +0 -10
  160. package/src/cli/apps/AlephaCli.ts +2 -2
  161. package/src/cli/apps/AlephaPackageBuilderCli.ts +9 -1
  162. package/src/cli/assets/apiHelloControllerTs.ts +2 -1
  163. package/src/cli/assets/biomeJson.ts +2 -1
  164. package/src/cli/assets/claudeMd.ts +9 -4
  165. package/src/cli/assets/dummySpecTs.ts +2 -1
  166. package/src/cli/assets/editorconfig.ts +2 -1
  167. package/src/cli/assets/mainBrowserTs.ts +2 -1
  168. package/src/cli/assets/mainCss.ts +24 -0
  169. package/src/cli/assets/tsconfigJson.ts +2 -1
  170. package/src/cli/assets/webAppRouterTs.ts +2 -1
  171. package/src/cli/assets/webHelloComponentTsx.ts +6 -2
  172. package/src/cli/atoms/appEntryOptions.ts +13 -0
  173. package/src/cli/atoms/buildOptions.ts +1 -1
  174. package/src/cli/atoms/changelogOptions.ts +1 -1
  175. package/src/cli/commands/build.ts +63 -47
  176. package/src/cli/commands/dev.ts +16 -33
  177. package/src/cli/commands/gen/env.ts +1 -1
  178. package/src/cli/commands/init.ts +17 -8
  179. package/src/cli/commands/lint.ts +1 -1
  180. package/src/cli/defineConfig.ts +9 -0
  181. package/src/cli/index.ts +2 -1
  182. package/src/cli/providers/AppEntryProvider.ts +131 -0
  183. package/src/cli/providers/ViteBuildProvider.ts +82 -0
  184. package/src/cli/providers/ViteDevServerProvider.ts +350 -0
  185. package/src/cli/providers/ViteTemplateProvider.ts +27 -0
  186. package/src/cli/services/AlephaCliUtils.ts +33 -2
  187. package/src/cli/services/PackageManagerUtils.ts +13 -6
  188. package/src/cli/services/ProjectScaffolder.ts +72 -49
  189. package/src/core/Alepha.ts +2 -8
  190. package/src/core/primitives/$module.ts +12 -0
  191. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +257 -0
  192. package/src/core/providers/KeylessJsonSchemaCodec.ts +396 -14
  193. package/src/core/providers/SchemaValidator.spec.ts +236 -0
  194. package/src/logger/providers/PrettyFormatterProvider.ts +0 -9
  195. package/src/mcp/errors/McpError.ts +30 -0
  196. package/src/mcp/index.ts +3 -0
  197. package/src/mcp/transports/SseMcpTransport.ts +16 -6
  198. package/src/orm/providers/DrizzleKitProvider.ts +3 -5
  199. package/src/orm/services/Repository.ts +11 -0
  200. package/src/server/core/index.ts +1 -1
  201. package/src/server/core/providers/BunHttpServerProvider.ts +1 -1
  202. package/src/server/core/providers/NodeHttpServerProvider.spec.ts +125 -0
  203. package/src/server/core/providers/NodeHttpServerProvider.ts +71 -22
  204. package/src/server/core/providers/ServerLoggerProvider.ts +2 -2
  205. package/src/server/core/providers/ServerProvider.ts +9 -12
  206. package/src/server/links/atoms/apiLinksAtom.ts +7 -0
  207. package/src/server/links/index.browser.ts +2 -0
  208. package/src/server/links/index.ts +2 -0
  209. package/src/vite/index.ts +3 -2
  210. package/src/vite/tasks/buildClient.ts +0 -1
  211. package/src/vite/tasks/buildServer.ts +68 -21
  212. package/src/vite/tasks/copyAssets.ts +5 -4
  213. package/src/vite/tasks/generateSitemap.ts +64 -23
  214. package/src/vite/tasks/index.ts +0 -2
  215. package/src/vite/tasks/prerenderPages.ts +49 -24
  216. package/src/cli/assets/indexHtml.ts +0 -15
  217. package/src/cli/commands/format.ts +0 -23
  218. package/src/vite/helpers/boot.ts +0 -117
  219. package/src/vite/plugins/viteAlephaDev.ts +0 -177
  220. package/src/vite/tasks/devServer.ts +0 -71
  221. package/src/vite/tasks/runAlepha.ts +0 -270
  222. /package/dist/orm/{chunk-DtkW-qnP.js → chunk-DH6iiROE.js} +0 -0
@@ -36,61 +36,61 @@ declare const parameters: alepha_orm0.EntityPrimitive<alepha624.TObject<{
36
36
  createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
37
37
  updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
38
38
  /**
39
- * Configuration name using dot notation for tree hierarchy.
40
- * Examples: "app.features", "app.pricing.tiers", "system.limits"
41
- */
39
+ * Configuration name using dot notation for tree hierarchy.
40
+ * Examples: "app.features", "app.pricing.tiers", "system.limits"
41
+ */
42
42
  name: alepha624.TString;
43
43
  /**
44
- * The configuration content as JSON.
45
- */
44
+ * The configuration content as JSON.
45
+ */
46
46
  content: alepha624.TRecord<string, alepha624.TAny>;
47
47
  /**
48
- * Schema version hash for detecting schema changes.
49
- * Used for auto-migration when schema evolves.
50
- */
48
+ * Schema version hash for detecting schema changes.
49
+ * Used for auto-migration when schema evolves.
50
+ */
51
51
  schemaHash: alepha624.TString;
52
52
  /**
53
- * Current status of this parameter version.
54
- */
53
+ * Current status of this parameter version.
54
+ */
55
55
  status: alepha_orm0.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm0.PG_DEFAULT>;
56
56
  /**
57
- * When this version should become active.
58
- * Default is immediate (now).
59
- */
57
+ * When this version should become active.
58
+ * Default is immediate (now).
59
+ */
60
60
  activationDate: alepha624.TString;
61
61
  /**
62
- * When this version was deactivated (became expired).
63
- * Null if still active or scheduled.
64
- */
62
+ * When this version was deactivated (became expired).
63
+ * Null if still active or scheduled.
64
+ */
65
65
  expiredAt: alepha624.TOptional<alepha624.TString>;
66
66
  /**
67
- * Version number for this configuration.
68
- * Auto-incremented per config name.
69
- */
67
+ * Version number for this configuration.
68
+ * Auto-incremented per config name.
69
+ */
70
70
  version: alepha624.TInteger;
71
71
  /**
72
- * Optional description of changes in this version.
73
- */
72
+ * Optional description of changes in this version.
73
+ */
74
74
  changeDescription: alepha624.TOptional<alepha624.TString>;
75
75
  /**
76
- * Optional tags for filtering/categorization.
77
- */
76
+ * Optional tags for filtering/categorization.
77
+ */
78
78
  tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
79
79
  /**
80
- * Creator user ID (if available).
81
- */
80
+ * Creator user ID (if available).
81
+ */
82
82
  creatorId: alepha624.TOptional<alepha624.TString>;
83
83
  /**
84
- * Creator display name for audit trail.
85
- */
84
+ * Creator display name for audit trail.
85
+ */
86
86
  creatorName: alepha624.TOptional<alepha624.TString>;
87
87
  /**
88
- * Previous content before this change (for rollback reference).
89
- */
88
+ * Previous content before this change (for rollback reference).
89
+ */
90
90
  previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
91
91
  /**
92
- * Migration log if schema changed.
93
- */
92
+ * Migration log if schema changed.
93
+ */
94
94
  migrationLog: alepha624.TOptional<alepha624.TString>;
95
95
  }>>;
96
96
  type Parameter = Static<typeof parameters.schema>;
@@ -126,114 +126,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
126
126
  //#region ../../src/orm/primitives/$entity.d.ts
127
127
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
128
128
  /**
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
- */
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
+ */
132
132
  name: string;
133
133
  /**
134
- * TypeBox schema defining the table structure and column types.
135
- */
134
+ * TypeBox schema defining the table structure and column types.
135
+ */
136
136
  schema: T;
137
137
  /**
138
- * Database indexes to create for query optimization.
139
- */
138
+ * Database indexes to create for query optimization.
139
+ */
140
140
  indexes?: (Keys | {
141
141
  /**
142
- * Single column to index.
143
- */
142
+ * Single column to index.
143
+ */
144
144
  column: Keys;
145
145
  /**
146
- * Whether this should be a unique index (enforces uniqueness constraint).
147
- */
146
+ * Whether this should be a unique index (enforces uniqueness constraint).
147
+ */
148
148
  unique?: boolean;
149
149
  /**
150
- * Custom name for the index. If not provided, generates name automatically.
151
- */
150
+ * Custom name for the index. If not provided, generates name automatically.
151
+ */
152
152
  name?: string;
153
153
  } | {
154
154
  /**
155
- * Multiple columns for composite index (order matters for query optimization).
156
- */
155
+ * Multiple columns for composite index (order matters for query optimization).
156
+ */
157
157
  columns: Keys[];
158
158
  /**
159
- * Whether this should be a unique index (enforces uniqueness constraint).
160
- */
159
+ * Whether this should be a unique index (enforces uniqueness constraint).
160
+ */
161
161
  unique?: boolean;
162
162
  /**
163
- * Custom name for the index. If not provided, generates name automatically.
164
- */
163
+ * Custom name for the index. If not provided, generates name automatically.
164
+ */
165
165
  name?: string;
166
166
  })[];
167
167
  /**
168
- * Foreign key constraints to maintain referential integrity.
169
- */
168
+ * Foreign key constraints to maintain referential integrity.
169
+ */
170
170
  foreignKeys?: Array<{
171
171
  /**
172
- * Optional name for the foreign key constraint.
173
- */
172
+ * Optional name for the foreign key constraint.
173
+ */
174
174
  name?: string;
175
175
  /**
176
- * Local columns that reference the foreign table.
177
- */
176
+ * Local columns that reference the foreign table.
177
+ */
178
178
  columns: Array<keyof Static<T>>;
179
179
  /**
180
- * Referenced columns in the foreign table.
181
- * Must be EntityColumn references from other entities.
182
- */
180
+ * Referenced columns in the foreign table.
181
+ * Must be EntityColumn references from other entities.
182
+ */
183
183
  foreignColumns: Array<() => EntityColumn<any>>;
184
184
  }>;
185
185
  /**
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
- */
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
+ */
216
216
  constraints?: Array<{
217
217
  /**
218
- * Columns involved in this constraint.
219
- */
218
+ * Columns involved in this constraint.
219
+ */
220
220
  columns: Array<keyof Static<T>>;
221
221
  /**
222
- * Optional name for the constraint.
223
- */
222
+ * Optional name for the constraint.
223
+ */
224
224
  name?: string;
225
225
  /**
226
- * Whether this is a unique constraint.
227
- */
226
+ * Whether this is a unique constraint.
227
+ */
228
228
  unique?: boolean | {};
229
229
  /**
230
- * SQL expression for check constraint validation.
231
- */
230
+ * SQL expression for check constraint validation.
231
+ */
232
232
  check?: SQL;
233
233
  }>;
234
234
  /**
235
- * Advanced Drizzle ORM configuration for complex table setups.
236
- */
235
+ * Advanced Drizzle ORM configuration for complex table setups.
236
+ */
237
237
  config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
238
238
  }
239
239
  declare class EntityPrimitive<T extends TObject = TObject> {
@@ -281,8 +281,8 @@ type PgSymbols = {
281
281
  [PG_REF]: PgRefOptions;
282
282
  [PG_ENUM]: PgEnumOptions;
283
283
  /**
284
- * @deprecated Use `PG_IDENTITY` instead.
285
- */
284
+ * @deprecated Use `PG_IDENTITY` instead.
285
+ */
286
286
  [PG_SERIAL]: {};
287
287
  };
288
288
  type PgSymbolKeys = keyof PgSymbols;
@@ -359,21 +359,21 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
359
359
  */
360
360
  interface ConfigPrimitiveOptions<T extends TObject> {
361
361
  /**
362
- * Configuration name using dot notation for tree hierarchy.
363
- * Examples: "app.features", "app.pricing.tiers", "system.limits"
364
- */
362
+ * Configuration name using dot notation for tree hierarchy.
363
+ * Examples: "app.features", "app.pricing.tiers", "system.limits"
364
+ */
365
365
  name?: string;
366
366
  /**
367
- * Human-readable description of the configuration.
368
- */
367
+ * Human-readable description of the configuration.
368
+ */
369
369
  description?: string;
370
370
  /**
371
- * TypeBox schema defining the configuration structure.
372
- */
371
+ * TypeBox schema defining the configuration structure.
372
+ */
373
373
  schema: T;
374
374
  /**
375
- * Default value used when no configuration exists in database.
376
- */
375
+ * Default value used when no configuration exists in database.
376
+ */
377
377
  default: Static<T>;
378
378
  }
379
379
  declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimitiveOptions<T>> {
@@ -388,45 +388,45 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
388
388
  /** Whether initial load has completed */
389
389
  protected loaded: boolean;
390
390
  /**
391
- * Configuration name (uses property key if not specified).
392
- */
391
+ * Configuration name (uses property key if not specified).
392
+ */
393
393
  get name(): string;
394
394
  /**
395
- * The TypeBox schema for this configuration.
396
- */
395
+ * The TypeBox schema for this configuration.
396
+ */
397
397
  get schema(): T;
398
398
  /**
399
- * Get the current configuration value.
400
- */
399
+ * Get the current configuration value.
400
+ */
401
401
  get current(): Static<T>;
402
402
  /**
403
- * Get a specific field from the current configuration.
404
- */
403
+ * Get a specific field from the current configuration.
404
+ */
405
405
  get<Key extends keyof Static<T>>(key: Key): Static<T>[Key];
406
406
  /**
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
- */
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
+ */
412
412
  set(value: Static<T>, options?: SetConfigOptions): Promise<void>;
413
413
  /**
414
- * Subscribe to configuration changes.
415
- */
414
+ * Subscribe to configuration changes.
415
+ */
416
416
  sub(fn: (curr: Static<T>) => void): () => void;
417
417
  /**
418
- * Reload configuration from database.
419
- * Called when scheduled config activates or sync message received.
420
- */
418
+ * Reload configuration from database.
419
+ * Called when scheduled config activates or sync message received.
420
+ */
421
421
  reload(): Promise<void>;
422
422
  /**
423
- * Update from sync message (called by ConfigStore).
424
- * Uses skipEvents to avoid infinite loops.
425
- */
423
+ * Update from sync message (called by ConfigStore).
424
+ * Uses skipEvents to avoid infinite loops.
425
+ */
426
426
  updateFromSync(content: unknown): Promise<void>;
427
427
  /**
428
- * Get version history for this configuration.
429
- */
428
+ * Get version history for this configuration.
429
+ */
430
430
  getHistory(): Promise<{
431
431
  expiredAt?: string | undefined;
432
432
  changeDescription?: string | undefined;
@@ -480,24 +480,24 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
480
480
  version: number;
481
481
  }[]>;
482
482
  /**
483
- * Rollback to a specific version.
484
- */
483
+ * Rollback to a specific version.
484
+ */
485
485
  rollback(version: number, options?: SetConfigOptions): Promise<void>;
486
486
  /**
487
- * Hook to load initial value from database on start.
488
- */
487
+ * Hook to load initial value from database on start.
488
+ */
489
489
  protected readonly onStart: alepha624.HookPrimitive<"start">;
490
490
  /**
491
- * Called after primitive creation to initialize.
492
- */
491
+ * Called after primitive creation to initialize.
492
+ */
493
493
  protected onInit(): void;
494
494
  /**
495
- * Load initial value from database.
496
- */
495
+ * Load initial value from database.
496
+ */
497
497
  protected loadInitial(): Promise<void>;
498
498
  /**
499
- * Calculate a hash of the schema for migration detection.
500
- */
499
+ * Calculate a hash of the schema for migration detection.
500
+ */
501
501
  protected calculateSchemaHash(): string;
502
502
  }
503
503
  declare const $config: {
@@ -506,21 +506,21 @@ declare const $config: {
506
506
  };
507
507
  interface SetConfigOptions {
508
508
  /**
509
- * User making the change (for audit trail).
510
- */
509
+ * User making the change (for audit trail).
510
+ */
511
511
  user?: Pick<UserAccount, "id" | "email" | "name">;
512
512
  /**
513
- * When this configuration should become active.
514
- * Default is immediate (now).
515
- */
513
+ * When this configuration should become active.
514
+ * Default is immediate (now).
515
+ */
516
516
  activationDate?: Date;
517
517
  /**
518
- * Description of the change.
519
- */
518
+ * Description of the change.
519
+ */
520
520
  changeDescription?: string;
521
521
  /**
522
- * Tags for filtering/categorization.
523
- */
522
+ * Tags for filtering/categorization.
523
+ */
524
524
  tags?: string[];
525
525
  }
526
526
  //#endregion
@@ -581,50 +581,50 @@ declare class ConfigStore {
581
581
  }>;
582
582
  }>;
583
583
  /**
584
- * Register a config primitive with the store.
585
- */
584
+ * Register a config primitive with the store.
585
+ */
586
586
  register(config: ConfigPrimitive<any>): void;
587
587
  /**
588
- * Load the current config value from database.
589
- * Returns the current or next version if no current exists.
590
- */
588
+ * Load the current config value from database.
589
+ * Returns the current or next version if no current exists.
590
+ */
591
591
  load<T extends TObject>(name: string): Promise<Static<T> | null>;
592
592
  /**
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
- */
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
+ */
600
600
  save<T extends TObject>(name: string, content: Static<T>, schemaHash: string, options?: SaveConfigOptions): Promise<Parameter>;
601
601
  /**
602
- * Get all versions of a config.
603
- */
602
+ * Get all versions of a config.
603
+ */
604
604
  getHistory(name: string): Promise<Parameter[]>;
605
605
  /**
606
- * Get a specific version of a config.
607
- */
606
+ * Get a specific version of a config.
607
+ */
608
608
  getVersion(name: string, version: number): Promise<Parameter | null>;
609
609
  /**
610
- * Rollback to a previous version by creating a new version with old content.
611
- */
610
+ * Rollback to a previous version by creating a new version with old content.
611
+ */
612
612
  rollback(name: string, targetVersion: number, options?: SaveConfigOptions): Promise<Parameter>;
613
613
  /**
614
- * Get all configs by status.
615
- */
614
+ * Get all configs by status.
615
+ */
616
616
  getByStatus(status: ParameterStatus): Promise<Parameter[]>;
617
617
  /**
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
- */
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
+ */
621
621
  getCurrentValue(name: string): {
622
622
  content: unknown;
623
623
  isDefault: boolean;
624
624
  } | null;
625
625
  /**
626
- * Get config info including current value with default fallback.
627
- */
626
+ * Get config info including current value with default fallback.
627
+ */
628
628
  getCurrentWithDefault(name: string): Promise<{
629
629
  current: Parameter | null;
630
630
  next: Parameter | null;
@@ -633,38 +633,38 @@ declare class ConfigStore {
633
633
  schema: TObject | null;
634
634
  }>;
635
635
  /**
636
- * Get all unique config names (for tree view).
637
- */
636
+ * Get all unique config names (for tree view).
637
+ */
638
638
  getConfigNames(): Promise<string[]>;
639
639
  /**
640
- * Build a tree structure from config names for UI.
641
- * Includes both database configs and registered (but not yet saved) configs.
642
- */
640
+ * Build a tree structure from config names for UI.
641
+ * Includes both database configs and registered (but not yet saved) configs.
642
+ */
643
643
  getConfigTree(): Promise<ConfigTreeNode[]>;
644
644
  /**
645
- * Check and activate scheduled configs that are due.
646
- * Should be called periodically (e.g., via scheduler).
647
- */
645
+ * Check and activate scheduled configs that are due.
646
+ * Should be called periodically (e.g., via scheduler).
647
+ */
648
648
  activateScheduledConfigs(): Promise<void>;
649
649
  /**
650
- * Transition config statuses when a new current is activated.
651
- */
650
+ * Transition config statuses when a new current is activated.
651
+ */
652
652
  protected transitionStatuses(name: string, now: Date): Promise<void>;
653
653
  /**
654
- * Recalculate statuses based on activation dates.
655
- */
654
+ * Recalculate statuses based on activation dates.
655
+ */
656
656
  protected recalculateStatuses(name: string): Promise<void>;
657
657
  /**
658
- * Publish sync event to other instances.
659
- */
658
+ * Publish sync event to other instances.
659
+ */
660
660
  protected publishSync(name: string, version: number, content: unknown, status: ParameterStatus): Promise<void>;
661
661
  /**
662
- * Handle incoming sync message from other instances.
663
- */
662
+ * Handle incoming sync message from other instances.
663
+ */
664
664
  protected handleSyncMessage(payload: ConfigSyncPayload): Promise<void>;
665
665
  /**
666
- * Build tree structure from dot-notation names.
667
- */
666
+ * Build tree structure from dot-notation names.
667
+ */
668
668
  protected buildTree(names: string[]): ConfigTreeNode[];
669
669
  }
670
670
  interface SaveConfigOptions {
@@ -698,9 +698,9 @@ declare class AdminConfigController {
698
698
  protected readonly group = "admin:configs";
699
699
  protected readonly store: ConfigStore;
700
700
  /**
701
- * Get tree structure of all configuration names.
702
- * Useful for admin UI navigation.
703
- */
701
+ * Get tree structure of all configuration names.
702
+ * Useful for admin UI navigation.
703
+ */
704
704
  getConfigTree: alepha_server0.ActionPrimitiveFn<{
705
705
  response: alepha624.TArray<alepha624.TObject<{
706
706
  name: alepha624.TString;
@@ -710,16 +710,16 @@ declare class AdminConfigController {
710
710
  }>>;
711
711
  }>;
712
712
  /**
713
- * List all unique configuration names.
714
- */
713
+ * List all unique configuration names.
714
+ */
715
715
  listConfigNames: alepha_server0.ActionPrimitiveFn<{
716
716
  response: alepha624.TObject<{
717
717
  names: alepha624.TArray<alepha624.TString>;
718
718
  }>;
719
719
  }>;
720
720
  /**
721
- * Get configurations by status.
722
- */
721
+ * Get configurations by status.
722
+ */
723
723
  getByStatus: alepha_server0.ActionPrimitiveFn<{
724
724
  params: alepha624.TObject<{
725
725
  status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
@@ -746,8 +746,8 @@ declare class AdminConfigController {
746
746
  }>;
747
747
  }>;
748
748
  /**
749
- * Get version history for a specific configuration.
750
- */
749
+ * Get version history for a specific configuration.
750
+ */
751
751
  getHistory: alepha_server0.ActionPrimitiveFn<{
752
752
  params: alepha624.TObject<{
753
753
  name: alepha624.TString;
@@ -774,10 +774,10 @@ declare class AdminConfigController {
774
774
  }>;
775
775
  }>;
776
776
  /**
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
- */
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
+ */
781
781
  getCurrent: alepha_server0.ActionPrimitiveFn<{
782
782
  params: alepha624.TObject<{
783
783
  name: alepha624.TString;
@@ -825,8 +825,8 @@ declare class AdminConfigController {
825
825
  }>;
826
826
  }>;
827
827
  /**
828
- * Get a specific version of a configuration.
829
- */
828
+ * Get a specific version of a configuration.
829
+ */
830
830
  getVersion: alepha_server0.ActionPrimitiveFn<{
831
831
  params: alepha624.TObject<{
832
832
  name: alepha624.TString;
@@ -854,8 +854,8 @@ declare class AdminConfigController {
854
854
  }>;
855
855
  }>;
856
856
  /**
857
- * Create a new configuration version.
858
- */
857
+ * Create a new configuration version.
858
+ */
859
859
  createVersion: alepha_server0.ActionPrimitiveFn<{
860
860
  params: alepha624.TObject<{
861
861
  name: alepha624.TString;
@@ -889,8 +889,8 @@ declare class AdminConfigController {
889
889
  }>;
890
890
  }>;
891
891
  /**
892
- * Rollback to a previous version.
893
- */
892
+ * Rollback to a previous version.
893
+ */
894
894
  rollback: alepha_server0.ActionPrimitiveFn<{
895
895
  params: alepha624.TObject<{
896
896
  name: alepha624.TString;
@@ -921,8 +921,8 @@ declare class AdminConfigController {
921
921
  }>;
922
922
  }>;
923
923
  /**
924
- * Activate a scheduled version immediately.
925
- */
924
+ * Activate a scheduled version immediately.
925
+ */
926
926
  activateNow: alepha_server0.ActionPrimitiveFn<{
927
927
  params: alepha624.TObject<{
928
928
  name: alepha624.TString;
@@ -952,9 +952,9 @@ declare class AdminConfigController {
952
952
  }>;
953
953
  }>;
954
954
  /**
955
- * Trigger activation check for all scheduled configs.
956
- * Normally called by a scheduler, but exposed for manual triggering.
957
- */
955
+ * Trigger activation check for all scheduled configs.
956
+ * Normally called by a scheduler, but exposed for manual triggering.
957
+ */
958
958
  checkScheduled: alepha_server0.ActionPrimitiveFn<{
959
959
  response: alepha624.TObject<{
960
960
  message: alepha624.TString;
@@ -974,8 +974,8 @@ declare class ConfigActivationScheduler {
974
974
  protected readonly log: alepha_logger0.Logger;
975
975
  protected readonly store: ConfigStore;
976
976
  /**
977
- * Check for scheduled configurations every minute.
978
- */
977
+ * Check for scheduled configurations every minute.
978
+ */
979
979
  checkActivations: alepha_scheduler0.SchedulerPrimitive;
980
980
  }
981
981
  //#endregion