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
@@ -42,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
42
42
  //#region ../../src/orm/primitives/$entity.d.ts
43
43
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
44
44
  /**
45
- * The database table name that will be created for this entity.
46
- * If not provided, name will be inferred from the $repository variable name.
47
- */
45
+ * The database table name that will be created for this entity.
46
+ * If not provided, name will be inferred from the $repository variable name.
47
+ */
48
48
  name: string;
49
49
  /**
50
- * TypeBox schema defining the table structure and column types.
51
- */
50
+ * TypeBox schema defining the table structure and column types.
51
+ */
52
52
  schema: T;
53
53
  /**
54
- * Database indexes to create for query optimization.
55
- */
54
+ * Database indexes to create for query optimization.
55
+ */
56
56
  indexes?: (Keys | {
57
57
  /**
58
- * Single column to index.
59
- */
58
+ * Single column to index.
59
+ */
60
60
  column: Keys;
61
61
  /**
62
- * Whether this should be a unique index (enforces uniqueness constraint).
63
- */
62
+ * Whether this should be a unique index (enforces uniqueness constraint).
63
+ */
64
64
  unique?: boolean;
65
65
  /**
66
- * Custom name for the index. If not provided, generates name automatically.
67
- */
66
+ * Custom name for the index. If not provided, generates name automatically.
67
+ */
68
68
  name?: string;
69
69
  } | {
70
70
  /**
71
- * Multiple columns for composite index (order matters for query optimization).
72
- */
71
+ * Multiple columns for composite index (order matters for query optimization).
72
+ */
73
73
  columns: Keys[];
74
74
  /**
75
- * Whether this should be a unique index (enforces uniqueness constraint).
76
- */
75
+ * Whether this should be a unique index (enforces uniqueness constraint).
76
+ */
77
77
  unique?: boolean;
78
78
  /**
79
- * Custom name for the index. If not provided, generates name automatically.
80
- */
79
+ * Custom name for the index. If not provided, generates name automatically.
80
+ */
81
81
  name?: string;
82
82
  })[];
83
83
  /**
84
- * Foreign key constraints to maintain referential integrity.
85
- */
84
+ * Foreign key constraints to maintain referential integrity.
85
+ */
86
86
  foreignKeys?: Array<{
87
87
  /**
88
- * Optional name for the foreign key constraint.
89
- */
88
+ * Optional name for the foreign key constraint.
89
+ */
90
90
  name?: string;
91
91
  /**
92
- * Local columns that reference the foreign table.
93
- */
92
+ * Local columns that reference the foreign table.
93
+ */
94
94
  columns: Array<keyof Static<T>>;
95
95
  /**
96
- * Referenced columns in the foreign table.
97
- * Must be EntityColumn references from other entities.
98
- */
96
+ * Referenced columns in the foreign table.
97
+ * Must be EntityColumn references from other entities.
98
+ */
99
99
  foreignColumns: Array<() => EntityColumn<any>>;
100
100
  }>;
101
101
  /**
102
- * Additional table constraints for data validation.
103
- *
104
- * Constraints enforce business rules at the database level, providing
105
- * an additional layer of data integrity beyond application validation.
106
- *
107
- * **Constraint Types**:
108
- * - **Unique constraints**: Prevent duplicate values across columns
109
- * - **Check constraints**: Enforce custom validation rules with SQL expressions
110
- *
111
- * @example
112
- * ```ts
113
- * constraints: [
114
- * {
115
- * name: "unique_user_email",
116
- * columns: ["email"],
117
- * unique: true
118
- * },
119
- * {
120
- * name: "valid_age_range",
121
- * columns: ["age"],
122
- * check: sql`age >= 0 AND age <= 150`
123
- * },
124
- * {
125
- * name: "unique_user_username_per_tenant",
126
- * columns: ["tenantId", "username"],
127
- * unique: true
128
- * }
129
- * ]
130
- * ```
131
- */
102
+ * Additional table constraints for data validation.
103
+ *
104
+ * Constraints enforce business rules at the database level, providing
105
+ * an additional layer of data integrity beyond application validation.
106
+ *
107
+ * **Constraint Types**:
108
+ * - **Unique constraints**: Prevent duplicate values across columns
109
+ * - **Check constraints**: Enforce custom validation rules with SQL expressions
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * constraints: [
114
+ * {
115
+ * name: "unique_user_email",
116
+ * columns: ["email"],
117
+ * unique: true
118
+ * },
119
+ * {
120
+ * name: "valid_age_range",
121
+ * columns: ["age"],
122
+ * check: sql`age >= 0 AND age <= 150`
123
+ * },
124
+ * {
125
+ * name: "unique_user_username_per_tenant",
126
+ * columns: ["tenantId", "username"],
127
+ * unique: true
128
+ * }
129
+ * ]
130
+ * ```
131
+ */
132
132
  constraints?: Array<{
133
133
  /**
134
- * Columns involved in this constraint.
135
- */
134
+ * Columns involved in this constraint.
135
+ */
136
136
  columns: Array<keyof Static<T>>;
137
137
  /**
138
- * Optional name for the constraint.
139
- */
138
+ * Optional name for the constraint.
139
+ */
140
140
  name?: string;
141
141
  /**
142
- * Whether this is a unique constraint.
143
- */
142
+ * Whether this is a unique constraint.
143
+ */
144
144
  unique?: boolean | {};
145
145
  /**
146
- * SQL expression for check constraint validation.
147
- */
146
+ * SQL expression for check constraint validation.
147
+ */
148
148
  check?: SQL;
149
149
  }>;
150
150
  /**
151
- * Advanced Drizzle ORM configuration for complex table setups.
152
- */
151
+ * Advanced Drizzle ORM configuration for complex table setups.
152
+ */
153
153
  config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
154
154
  }
155
155
  declare class EntityPrimitive<T extends TObject = TObject> {
@@ -197,8 +197,8 @@ type PgSymbols = {
197
197
  [PG_REF]: PgRefOptions;
198
198
  [PG_ENUM]: PgEnumOptions;
199
199
  /**
200
- * @deprecated Use `PG_IDENTITY` instead.
201
- */
200
+ * @deprecated Use `PG_IDENTITY` instead.
201
+ */
202
202
  [PG_SERIAL]: {};
203
203
  };
204
204
  type PgSymbolKeys = keyof PgSymbols;
@@ -247,207 +247,207 @@ declare const audits: alepha_orm12.EntityPrimitive<alepha381.TObject<{
247
247
  id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
248
248
  createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
249
249
  /**
250
- * Audit event type (e.g., "auth", "user", "payment", "system").
251
- * Used for categorizing and filtering audit events.
252
- */
250
+ * Audit event type (e.g., "auth", "user", "payment", "system").
251
+ * Used for categorizing and filtering audit events.
252
+ */
253
253
  type: alepha381.TString;
254
254
  /**
255
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
256
- */
255
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
256
+ */
257
257
  action: alepha381.TString;
258
258
  /**
259
- * Severity level of the event.
260
- */
259
+ * Severity level of the event.
260
+ */
261
261
  severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
262
262
  /**
263
- * User ID who performed the action (null for system events).
264
- */
263
+ * User ID who performed the action (null for system events).
264
+ */
265
265
  userId: alepha381.TOptional<alepha381.TString>;
266
266
  /**
267
- * User realm for multi-tenant support.
268
- */
267
+ * User realm for multi-tenant support.
268
+ */
269
269
  userRealm: alepha381.TOptional<alepha381.TString>;
270
270
  /**
271
- * User email at the time of the event (denormalized for history).
272
- */
271
+ * User email at the time of the event (denormalized for history).
272
+ */
273
273
  userEmail: alepha381.TOptional<alepha381.TString>;
274
274
  /**
275
- * Resource type affected (e.g., "user", "order", "file").
276
- */
275
+ * Resource type affected (e.g., "user", "order", "file").
276
+ */
277
277
  resourceType: alepha381.TOptional<alepha381.TString>;
278
278
  /**
279
- * Resource ID affected.
280
- */
279
+ * Resource ID affected.
280
+ */
281
281
  resourceId: alepha381.TOptional<alepha381.TString>;
282
282
  /**
283
- * Human-readable description of the event.
284
- */
283
+ * Human-readable description of the event.
284
+ */
285
285
  description: alepha381.TOptional<alepha381.TString>;
286
286
  /**
287
- * Additional metadata/context as JSON.
288
- */
287
+ * Additional metadata/context as JSON.
288
+ */
289
289
  metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
290
290
  /**
291
- * Client IP address.
292
- */
291
+ * Client IP address.
292
+ */
293
293
  ipAddress: alepha381.TOptional<alepha381.TString>;
294
294
  /**
295
- * Client user agent.
296
- */
295
+ * Client user agent.
296
+ */
297
297
  userAgent: alepha381.TOptional<alepha381.TString>;
298
298
  /**
299
- * Session ID if applicable.
300
- */
299
+ * Session ID if applicable.
300
+ */
301
301
  sessionId: alepha381.TOptional<alepha381.TString>;
302
302
  /**
303
- * Request ID for correlation.
304
- */
303
+ * Request ID for correlation.
304
+ */
305
305
  requestId: alepha381.TOptional<alepha381.TString>;
306
306
  /**
307
- * Whether the action was successful.
308
- */
307
+ * Whether the action was successful.
308
+ */
309
309
  success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
310
310
  /**
311
- * Error message if the action failed.
312
- */
311
+ * Error message if the action failed.
312
+ */
313
313
  errorMessage: alepha381.TOptional<alepha381.TString>;
314
314
  }>>;
315
315
  declare const auditEntitySchema: alepha381.TObject<{
316
316
  id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
317
317
  createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
318
318
  /**
319
- * Audit event type (e.g., "auth", "user", "payment", "system").
320
- * Used for categorizing and filtering audit events.
321
- */
319
+ * Audit event type (e.g., "auth", "user", "payment", "system").
320
+ * Used for categorizing and filtering audit events.
321
+ */
322
322
  type: alepha381.TString;
323
323
  /**
324
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
325
- */
324
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
325
+ */
326
326
  action: alepha381.TString;
327
327
  /**
328
- * Severity level of the event.
329
- */
328
+ * Severity level of the event.
329
+ */
330
330
  severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
331
331
  /**
332
- * User ID who performed the action (null for system events).
333
- */
332
+ * User ID who performed the action (null for system events).
333
+ */
334
334
  userId: alepha381.TOptional<alepha381.TString>;
335
335
  /**
336
- * User realm for multi-tenant support.
337
- */
336
+ * User realm for multi-tenant support.
337
+ */
338
338
  userRealm: alepha381.TOptional<alepha381.TString>;
339
339
  /**
340
- * User email at the time of the event (denormalized for history).
341
- */
340
+ * User email at the time of the event (denormalized for history).
341
+ */
342
342
  userEmail: alepha381.TOptional<alepha381.TString>;
343
343
  /**
344
- * Resource type affected (e.g., "user", "order", "file").
345
- */
344
+ * Resource type affected (e.g., "user", "order", "file").
345
+ */
346
346
  resourceType: alepha381.TOptional<alepha381.TString>;
347
347
  /**
348
- * Resource ID affected.
349
- */
348
+ * Resource ID affected.
349
+ */
350
350
  resourceId: alepha381.TOptional<alepha381.TString>;
351
351
  /**
352
- * Human-readable description of the event.
353
- */
352
+ * Human-readable description of the event.
353
+ */
354
354
  description: alepha381.TOptional<alepha381.TString>;
355
355
  /**
356
- * Additional metadata/context as JSON.
357
- */
356
+ * Additional metadata/context as JSON.
357
+ */
358
358
  metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
359
359
  /**
360
- * Client IP address.
361
- */
360
+ * Client IP address.
361
+ */
362
362
  ipAddress: alepha381.TOptional<alepha381.TString>;
363
363
  /**
364
- * Client user agent.
365
- */
364
+ * Client user agent.
365
+ */
366
366
  userAgent: alepha381.TOptional<alepha381.TString>;
367
367
  /**
368
- * Session ID if applicable.
369
- */
368
+ * Session ID if applicable.
369
+ */
370
370
  sessionId: alepha381.TOptional<alepha381.TString>;
371
371
  /**
372
- * Request ID for correlation.
373
- */
372
+ * Request ID for correlation.
373
+ */
374
374
  requestId: alepha381.TOptional<alepha381.TString>;
375
375
  /**
376
- * Whether the action was successful.
377
- */
376
+ * Whether the action was successful.
377
+ */
378
378
  success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
379
379
  /**
380
- * Error message if the action failed.
381
- */
380
+ * Error message if the action failed.
381
+ */
382
382
  errorMessage: alepha381.TOptional<alepha381.TString>;
383
383
  }>;
384
384
  declare const auditEntityInsertSchema: alepha_orm12.TObjectInsert<alepha381.TObject<{
385
385
  id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
386
386
  createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
387
387
  /**
388
- * Audit event type (e.g., "auth", "user", "payment", "system").
389
- * Used for categorizing and filtering audit events.
390
- */
388
+ * Audit event type (e.g., "auth", "user", "payment", "system").
389
+ * Used for categorizing and filtering audit events.
390
+ */
391
391
  type: alepha381.TString;
392
392
  /**
393
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
394
- */
393
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
394
+ */
395
395
  action: alepha381.TString;
396
396
  /**
397
- * Severity level of the event.
398
- */
397
+ * Severity level of the event.
398
+ */
399
399
  severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
400
400
  /**
401
- * User ID who performed the action (null for system events).
402
- */
401
+ * User ID who performed the action (null for system events).
402
+ */
403
403
  userId: alepha381.TOptional<alepha381.TString>;
404
404
  /**
405
- * User realm for multi-tenant support.
406
- */
405
+ * User realm for multi-tenant support.
406
+ */
407
407
  userRealm: alepha381.TOptional<alepha381.TString>;
408
408
  /**
409
- * User email at the time of the event (denormalized for history).
410
- */
409
+ * User email at the time of the event (denormalized for history).
410
+ */
411
411
  userEmail: alepha381.TOptional<alepha381.TString>;
412
412
  /**
413
- * Resource type affected (e.g., "user", "order", "file").
414
- */
413
+ * Resource type affected (e.g., "user", "order", "file").
414
+ */
415
415
  resourceType: alepha381.TOptional<alepha381.TString>;
416
416
  /**
417
- * Resource ID affected.
418
- */
417
+ * Resource ID affected.
418
+ */
419
419
  resourceId: alepha381.TOptional<alepha381.TString>;
420
420
  /**
421
- * Human-readable description of the event.
422
- */
421
+ * Human-readable description of the event.
422
+ */
423
423
  description: alepha381.TOptional<alepha381.TString>;
424
424
  /**
425
- * Additional metadata/context as JSON.
426
- */
425
+ * Additional metadata/context as JSON.
426
+ */
427
427
  metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
428
428
  /**
429
- * Client IP address.
430
- */
429
+ * Client IP address.
430
+ */
431
431
  ipAddress: alepha381.TOptional<alepha381.TString>;
432
432
  /**
433
- * Client user agent.
434
- */
433
+ * Client user agent.
434
+ */
435
435
  userAgent: alepha381.TOptional<alepha381.TString>;
436
436
  /**
437
- * Session ID if applicable.
438
- */
437
+ * Session ID if applicable.
438
+ */
439
439
  sessionId: alepha381.TOptional<alepha381.TString>;
440
440
  /**
441
- * Request ID for correlation.
442
- */
441
+ * Request ID for correlation.
442
+ */
443
443
  requestId: alepha381.TOptional<alepha381.TString>;
444
444
  /**
445
- * Whether the action was successful.
446
- */
445
+ * Whether the action was successful.
446
+ */
447
447
  success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
448
448
  /**
449
- * Error message if the action failed.
450
- */
449
+ * Error message if the action failed.
450
+ */
451
451
  errorMessage: alepha381.TOptional<alepha381.TString>;
452
452
  }>>;
453
453
  type AuditEntity = Static<typeof audits.schema>;
@@ -540,77 +540,77 @@ declare class AuditService {
540
540
  errorMessage: alepha381.TOptional<alepha381.TString>;
541
541
  }>>;
542
542
  /**
543
- * Registry of audit types and their allowed actions.
544
- */
543
+ * Registry of audit types and their allowed actions.
544
+ */
545
545
  protected readonly auditTypes: Map<string, AuditTypeDefinition>;
546
546
  /**
547
- * Register an audit type with its allowed actions.
548
- */
547
+ * Register an audit type with its allowed actions.
548
+ */
549
549
  registerType(definition: AuditTypeDefinition): void;
550
550
  /**
551
- * Get all registered audit types.
552
- */
551
+ * Get all registered audit types.
552
+ */
553
553
  getRegisteredTypes(): AuditTypeDefinition[];
554
554
  /**
555
- * Get current request context if available.
556
- */
555
+ * Get current request context if available.
556
+ */
557
557
  protected getRequestContext(): ServerRequest | undefined;
558
558
  /**
559
- * Create a new audit log entry.
560
- * Automatically populates ipAddress, userAgent, and requestId from the current request context.
561
- */
559
+ * Create a new audit log entry.
560
+ * Automatically populates ipAddress, userAgent, and requestId from the current request context.
561
+ */
562
562
  create(data: CreateAudit): Promise<AuditEntity>;
563
563
  /**
564
- * Record an audit event (convenience method).
565
- */
564
+ * Record an audit event (convenience method).
565
+ */
566
566
  record(type: string, action: string, options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
567
567
  /**
568
- * Record an authentication event.
569
- */
568
+ * Record an authentication event.
569
+ */
570
570
  recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh" | "mfa_setup" | "mfa_verify", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
571
571
  /**
572
- * Record a user management event.
573
- */
572
+ * Record a user management event.
573
+ */
574
574
  recordUser(action: "create" | "update" | "delete" | "enable" | "disable" | "role_change", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
575
575
  /**
576
- * Record a data access event.
577
- */
576
+ * Record a data access event.
577
+ */
578
578
  recordAccess(action: "view" | "export" | "download", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
579
579
  /**
580
- * Record a security event.
581
- */
580
+ * Record a security event.
581
+ */
582
582
  recordSecurity(action: "permission_denied" | "suspicious_activity" | "rate_limited" | "blocked", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
583
583
  /**
584
- * Record a system event.
585
- */
584
+ * Record a system event.
585
+ */
586
586
  recordSystem(action: "startup" | "shutdown" | "config_change" | "maintenance" | "error", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
587
587
  /**
588
- * Find audit entries with filtering and pagination.
589
- */
588
+ * Find audit entries with filtering and pagination.
589
+ */
590
590
  find(query?: AuditQuery): Promise<Page<AuditEntity>>;
591
591
  /**
592
- * Get audit entry by ID.
593
- */
592
+ * Get audit entry by ID.
593
+ */
594
594
  getById(id: string): Promise<AuditEntity>;
595
595
  /**
596
- * Get audit entries for a specific user.
597
- */
596
+ * Get audit entries for a specific user.
597
+ */
598
598
  findByUser(userId: string, query?: Omit<AuditQuery, "userId">): Promise<Page<AuditEntity>>;
599
599
  /**
600
- * Get audit entries for a specific resource.
601
- */
600
+ * Get audit entries for a specific resource.
601
+ */
602
602
  findByResource(resourceType: string, resourceId: string, query?: Omit<AuditQuery, "resourceType" | "resourceId">): Promise<Page<AuditEntity>>;
603
603
  /**
604
- * Get audit statistics for a time period.
605
- */
604
+ * Get audit statistics for a time period.
605
+ */
606
606
  getStats(options?: {
607
607
  from?: Date;
608
608
  to?: Date;
609
609
  userRealm?: string;
610
610
  }): Promise<AuditStats>;
611
611
  /**
612
- * Delete old audit entries (for retention policy).
613
- */
612
+ * Delete old audit entries (for retention policy).
613
+ */
614
614
  deleteOlderThan(date: Date): Promise<number>;
615
615
  }
616
616
  /**
@@ -639,8 +639,8 @@ declare class AdminAuditController {
639
639
  protected readonly group = "admin:audits";
640
640
  protected readonly auditService: AuditService;
641
641
  /**
642
- * Find audit entries with filtering and pagination.
643
- */
642
+ * Find audit entries with filtering and pagination.
643
+ */
644
644
  readonly findAudits: alepha_server0.ActionPrimitiveFn<{
645
645
  query: alepha381.TObject<{
646
646
  page: alepha381.TOptional<alepha381.TInteger>;
@@ -680,8 +680,8 @@ declare class AdminAuditController {
680
680
  }>>;
681
681
  }>;
682
682
  /**
683
- * Get a single audit entry by ID.
684
- */
683
+ * Get a single audit entry by ID.
684
+ */
685
685
  readonly getAudit: alepha_server0.ActionPrimitiveFn<{
686
686
  params: alepha381.TObject<{
687
687
  id: alepha381.TString;
@@ -708,8 +708,8 @@ declare class AdminAuditController {
708
708
  }>;
709
709
  }>;
710
710
  /**
711
- * Create a new audit entry.
712
- */
711
+ * Create a new audit entry.
712
+ */
713
713
  readonly createAudit: alepha_server0.ActionPrimitiveFn<{
714
714
  body: alepha381.TObject<{
715
715
  type: alepha381.TString;
@@ -751,8 +751,8 @@ declare class AdminAuditController {
751
751
  }>;
752
752
  }>;
753
753
  /**
754
- * Get audit entries for a specific user.
755
- */
754
+ * Get audit entries for a specific user.
755
+ */
756
756
  readonly findByUser: alepha_server0.ActionPrimitiveFn<{
757
757
  params: alepha381.TObject<{
758
758
  userId: alepha381.TString;
@@ -794,8 +794,8 @@ declare class AdminAuditController {
794
794
  }>>;
795
795
  }>;
796
796
  /**
797
- * Get audit entries for a specific resource.
798
- */
797
+ * Get audit entries for a specific resource.
798
+ */
799
799
  readonly findByResource: alepha_server0.ActionPrimitiveFn<{
800
800
  params: alepha381.TObject<{
801
801
  resourceType: alepha381.TString;
@@ -837,8 +837,8 @@ declare class AdminAuditController {
837
837
  }>>;
838
838
  }>;
839
839
  /**
840
- * Get audit statistics.
841
- */
840
+ * Get audit statistics.
841
+ */
842
842
  readonly getStats: alepha_server0.ActionPrimitiveFn<{
843
843
  query: alepha381.TObject<{
844
844
  from: alepha381.TOptional<alepha381.TString>;
@@ -877,8 +877,8 @@ declare class AdminAuditController {
877
877
  }>;
878
878
  }>;
879
879
  /**
880
- * Get registered audit types.
881
- */
880
+ * Get registered audit types.
881
+ */
882
882
  readonly getTypes: alepha_server0.ActionPrimitiveFn<{
883
883
  response: alepha381.TArray<alepha381.TObject<{
884
884
  type: alepha381.TString;
@@ -887,8 +887,8 @@ declare class AdminAuditController {
887
887
  }>>;
888
888
  }>;
889
889
  /**
890
- * Get distinct values for filters.
891
- */
890
+ * Get distinct values for filters.
891
+ */
892
892
  readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
893
893
  response: alepha381.TObject<{
894
894
  types: alepha381.TArray<alepha381.TString>;
@@ -905,16 +905,16 @@ declare class AdminAuditController {
905
905
  */
906
906
  interface AuditPrimitiveOptions {
907
907
  /**
908
- * Unique audit type identifier (e.g., "auth", "payment", "order").
909
- */
908
+ * Unique audit type identifier (e.g., "auth", "payment", "order").
909
+ */
910
910
  type: string;
911
911
  /**
912
- * Human-readable description of this audit type.
913
- */
912
+ * Human-readable description of this audit type.
913
+ */
914
914
  description?: string;
915
915
  /**
916
- * List of allowed actions for this audit type.
917
- */
916
+ * List of allowed actions for this audit type.
917
+ */
918
918
  actions: string[];
919
919
  }
920
920
  /**
@@ -946,32 +946,32 @@ interface AuditPrimitiveOptions {
946
946
  declare class AuditPrimitive extends Primitive<AuditPrimitiveOptions> {
947
947
  protected readonly auditService: AuditService;
948
948
  /**
949
- * The audit type identifier.
950
- */
949
+ * The audit type identifier.
950
+ */
951
951
  get type(): string;
952
952
  /**
953
- * The audit type description.
954
- */
953
+ * The audit type description.
954
+ */
955
955
  get description(): string | undefined;
956
956
  /**
957
- * The allowed actions for this audit type.
958
- */
957
+ * The allowed actions for this audit type.
958
+ */
959
959
  get actions(): string[];
960
960
  /**
961
- * Log an audit event for this type.
962
- */
961
+ * Log an audit event for this type.
962
+ */
963
963
  log(action: string, options?: AuditLogOptions): Promise<void>;
964
964
  /**
965
- * Log a successful audit event.
966
- */
965
+ * Log a successful audit event.
966
+ */
967
967
  logSuccess(action: string, options?: Omit<AuditLogOptions, "success">): Promise<void>;
968
968
  /**
969
- * Log a failed audit event.
970
- */
969
+ * Log a failed audit event.
970
+ */
971
971
  logFailure(action: string, errorMessage: string, options?: Omit<AuditLogOptions, "success" | "errorMessage">): Promise<void>;
972
972
  /**
973
- * Called during initialization to register this audit type.
974
- */
973
+ * Called during initialization to register this audit type.
974
+ */
975
975
  protected onInit(): void;
976
976
  }
977
977
  /**