alepha 0.14.4 → 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 (277) hide show
  1. package/README.md +1 -4
  2. package/dist/api/audits/index.d.ts +619 -731
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/files/index.d.ts +185 -298
  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 -356
  9. package/dist/api/jobs/index.d.ts.map +1 -1
  10. package/dist/api/notifications/index.d.ts +238 -350
  11. package/dist/api/notifications/index.d.ts.map +1 -1
  12. package/dist/api/parameters/index.d.ts +499 -611
  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 +1697 -1804
  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 +132 -132
  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 +302 -299
  32. package/dist/cli/index.d.ts.map +1 -1
  33. package/dist/cli/index.js +966 -564
  34. package/dist/cli/index.js.map +1 -1
  35. package/dist/command/index.d.ts +303 -299
  36. package/dist/command/index.d.ts.map +1 -1
  37. package/dist/command/index.js +11 -7
  38. package/dist/command/index.js.map +1 -1
  39. package/dist/core/index.browser.js +419 -99
  40. package/dist/core/index.browser.js.map +1 -1
  41. package/dist/core/index.d.ts +718 -625
  42. package/dist/core/index.d.ts.map +1 -1
  43. package/dist/core/index.js +420 -99
  44. package/dist/core/index.js.map +1 -1
  45. package/dist/core/index.native.js +419 -99
  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/mcp/index.d.ts +197 -197
  67. package/dist/mcp/index.d.ts.map +1 -1
  68. package/dist/orm/chunk-DtkW-qnP.js +38 -0
  69. package/dist/orm/index.browser.js.map +1 -1
  70. package/dist/orm/index.bun.js +2814 -0
  71. package/dist/orm/index.bun.js.map +1 -0
  72. package/dist/orm/index.d.ts +1205 -1057
  73. package/dist/orm/index.d.ts.map +1 -1
  74. package/dist/orm/index.js +2056 -1753
  75. package/dist/orm/index.js.map +1 -1
  76. package/dist/queue/core/index.d.ts +248 -248
  77. package/dist/queue/core/index.d.ts.map +1 -1
  78. package/dist/queue/redis/index.d.ts.map +1 -1
  79. package/dist/redis/index.bun.js +285 -0
  80. package/dist/redis/index.bun.js.map +1 -0
  81. package/dist/redis/index.d.ts +118 -136
  82. package/dist/redis/index.d.ts.map +1 -1
  83. package/dist/redis/index.js +18 -38
  84. package/dist/redis/index.js.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 +25 -25
  90. package/dist/scheduler/index.d.ts.map +1 -1
  91. package/dist/security/index.browser.js +5 -1
  92. package/dist/security/index.browser.js.map +1 -1
  93. package/dist/security/index.d.ts +417 -254
  94. package/dist/security/index.d.ts.map +1 -1
  95. package/dist/security/index.js +386 -86
  96. package/dist/security/index.js.map +1 -1
  97. package/dist/server/auth/index.d.ts +277 -277
  98. package/dist/server/auth/index.d.ts.map +1 -1
  99. package/dist/server/auth/index.js +20 -20
  100. package/dist/server/auth/index.js.map +1 -1
  101. package/dist/server/cache/index.d.ts +60 -57
  102. package/dist/server/cache/index.d.ts.map +1 -1
  103. package/dist/server/cache/index.js +1 -1
  104. package/dist/server/cache/index.js.map +1 -1
  105. package/dist/server/compress/index.d.ts +3 -3
  106. package/dist/server/compress/index.d.ts.map +1 -1
  107. package/dist/server/cookies/index.d.ts +6 -6
  108. package/dist/server/cookies/index.d.ts.map +1 -1
  109. package/dist/server/cookies/index.js +3 -3
  110. package/dist/server/cookies/index.js.map +1 -1
  111. package/dist/server/core/index.d.ts +242 -150
  112. package/dist/server/core/index.d.ts.map +1 -1
  113. package/dist/server/core/index.js +288 -122
  114. package/dist/server/core/index.js.map +1 -1
  115. package/dist/server/cors/index.d.ts +11 -12
  116. package/dist/server/cors/index.d.ts.map +1 -1
  117. package/dist/server/health/index.d.ts +0 -1
  118. package/dist/server/health/index.d.ts.map +1 -1
  119. package/dist/server/helmet/index.d.ts +2 -2
  120. package/dist/server/helmet/index.d.ts.map +1 -1
  121. package/dist/server/links/index.browser.js.map +1 -1
  122. package/dist/server/links/index.d.ts +84 -85
  123. package/dist/server/links/index.d.ts.map +1 -1
  124. package/dist/server/links/index.js +1 -2
  125. package/dist/server/links/index.js.map +1 -1
  126. package/dist/server/metrics/index.d.ts.map +1 -1
  127. package/dist/server/multipart/index.d.ts +6 -6
  128. package/dist/server/multipart/index.d.ts.map +1 -1
  129. package/dist/server/proxy/index.d.ts +102 -103
  130. package/dist/server/proxy/index.d.ts.map +1 -1
  131. package/dist/server/rate-limit/index.d.ts +16 -16
  132. package/dist/server/rate-limit/index.d.ts.map +1 -1
  133. package/dist/server/static/index.d.ts +44 -44
  134. package/dist/server/static/index.d.ts.map +1 -1
  135. package/dist/server/swagger/index.d.ts +48 -49
  136. package/dist/server/swagger/index.d.ts.map +1 -1
  137. package/dist/server/swagger/index.js +1 -2
  138. package/dist/server/swagger/index.js.map +1 -1
  139. package/dist/sms/index.d.ts +13 -11
  140. package/dist/sms/index.d.ts.map +1 -1
  141. package/dist/sms/index.js +7 -7
  142. package/dist/sms/index.js.map +1 -1
  143. package/dist/thread/index.d.ts +71 -72
  144. package/dist/thread/index.d.ts.map +1 -1
  145. package/dist/topic/core/index.d.ts +318 -318
  146. package/dist/topic/core/index.d.ts.map +1 -1
  147. package/dist/topic/redis/index.d.ts +6 -6
  148. package/dist/topic/redis/index.d.ts.map +1 -1
  149. package/dist/vite/index.d.ts +5720 -159
  150. package/dist/vite/index.d.ts.map +1 -1
  151. package/dist/vite/index.js +41 -18
  152. package/dist/vite/index.js.map +1 -1
  153. package/dist/websocket/index.browser.js +6 -6
  154. package/dist/websocket/index.browser.js.map +1 -1
  155. package/dist/websocket/index.d.ts +247 -247
  156. package/dist/websocket/index.d.ts.map +1 -1
  157. package/dist/websocket/index.js +6 -6
  158. package/dist/websocket/index.js.map +1 -1
  159. package/package.json +9 -14
  160. package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
  161. package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
  162. package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
  163. package/src/api/users/entities/users.ts +1 -1
  164. package/src/api/users/index.ts +8 -8
  165. package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
  166. package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
  167. package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
  168. package/src/api/users/services/CredentialService.ts +7 -7
  169. package/src/api/users/services/IdentityService.ts +4 -4
  170. package/src/api/users/services/RegistrationService.spec.ts +25 -27
  171. package/src/api/users/services/RegistrationService.ts +38 -27
  172. package/src/api/users/services/SessionCrudService.ts +3 -3
  173. package/src/api/users/services/SessionService.spec.ts +3 -3
  174. package/src/api/users/services/SessionService.ts +28 -9
  175. package/src/api/users/services/UserService.ts +7 -7
  176. package/src/batch/providers/BatchProvider.ts +1 -2
  177. package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
  178. package/src/cli/assets/apiHelloControllerTs.ts +18 -0
  179. package/src/cli/assets/apiIndexTs.ts +16 -0
  180. package/src/cli/assets/claudeMd.ts +303 -0
  181. package/src/cli/assets/mainBrowserTs.ts +2 -2
  182. package/src/cli/assets/mainServerTs.ts +24 -0
  183. package/src/cli/assets/webAppRouterTs.ts +15 -0
  184. package/src/cli/assets/webHelloComponentTsx.ts +16 -0
  185. package/src/cli/assets/webIndexTs.ts +16 -0
  186. package/src/cli/commands/build.ts +41 -21
  187. package/src/cli/commands/db.ts +21 -18
  188. package/src/cli/commands/deploy.ts +17 -5
  189. package/src/cli/commands/dev.ts +13 -17
  190. package/src/cli/commands/format.ts +8 -2
  191. package/src/cli/commands/init.ts +74 -29
  192. package/src/cli/commands/lint.ts +8 -2
  193. package/src/cli/commands/test.ts +8 -2
  194. package/src/cli/commands/typecheck.ts +5 -1
  195. package/src/cli/commands/verify.ts +4 -2
  196. package/src/cli/services/AlephaCliUtils.ts +39 -600
  197. package/src/cli/services/PackageManagerUtils.ts +301 -0
  198. package/src/cli/services/ProjectScaffolder.ts +306 -0
  199. package/src/command/helpers/Runner.ts +15 -3
  200. package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
  201. package/src/core/index.shared.ts +1 -0
  202. package/src/core/index.ts +2 -0
  203. package/src/core/primitives/$hook.ts +6 -2
  204. package/src/core/primitives/$module.spec.ts +4 -0
  205. package/src/core/providers/AlsProvider.ts +1 -1
  206. package/src/core/providers/CodecManager.spec.ts +12 -6
  207. package/src/core/providers/CodecManager.ts +26 -6
  208. package/src/core/providers/EventManager.ts +169 -13
  209. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
  210. package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
  211. package/src/core/providers/StateManager.spec.ts +27 -16
  212. package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
  213. package/src/email/providers/LocalEmailProvider.ts +52 -15
  214. package/src/email/providers/NodemailerEmailProvider.ts +167 -56
  215. package/src/file/errors/FileError.ts +7 -0
  216. package/src/file/index.ts +9 -1
  217. package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
  218. package/src/orm/index.browser.ts +1 -19
  219. package/src/orm/index.bun.ts +77 -0
  220. package/src/orm/index.shared-server.ts +22 -0
  221. package/src/orm/index.shared.ts +15 -0
  222. package/src/orm/index.ts +19 -39
  223. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
  224. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  225. package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
  226. package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
  227. package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
  228. package/src/orm/services/Repository.ts +8 -0
  229. package/src/redis/index.bun.ts +35 -0
  230. package/src/redis/providers/BunRedisProvider.ts +12 -43
  231. package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
  232. package/src/redis/providers/NodeRedisProvider.ts +16 -34
  233. package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
  234. package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
  235. package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
  236. package/src/security/index.browser.ts +5 -0
  237. package/src/security/index.ts +90 -7
  238. package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
  239. package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
  240. package/src/security/primitives/$role.ts +5 -5
  241. package/src/security/primitives/$serviceAccount.spec.ts +5 -5
  242. package/src/security/primitives/$serviceAccount.ts +3 -3
  243. package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
  244. package/src/server/auth/primitives/$auth.ts +10 -10
  245. package/src/server/auth/primitives/$authCredentials.ts +3 -3
  246. package/src/server/auth/primitives/$authGithub.ts +3 -3
  247. package/src/server/auth/primitives/$authGoogle.ts +3 -3
  248. package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
  249. package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
  250. package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
  251. package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
  252. package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
  253. package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
  254. package/src/server/core/providers/ServerProvider.ts +144 -21
  255. package/src/server/core/providers/ServerRouterProvider.ts +259 -115
  256. package/src/server/core/providers/ServerTimingProvider.ts +2 -2
  257. package/src/server/links/index.ts +1 -1
  258. package/src/server/links/providers/LinkProvider.ts +1 -1
  259. package/src/server/swagger/index.ts +1 -1
  260. package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
  261. package/src/sms/providers/LocalSmsProvider.ts +8 -7
  262. package/src/vite/helpers/boot.ts +28 -17
  263. package/src/vite/tasks/buildServer.ts +12 -1
  264. package/src/vite/tasks/devServer.ts +3 -1
  265. package/src/vite/tasks/generateCloudflare.ts +7 -0
  266. package/dist/server/security/index.browser.js +0 -13
  267. package/dist/server/security/index.browser.js.map +0 -1
  268. package/dist/server/security/index.d.ts +0 -173
  269. package/dist/server/security/index.d.ts.map +0 -1
  270. package/dist/server/security/index.js +0 -311
  271. package/dist/server/security/index.js.map +0 -1
  272. package/src/cli/assets/appRouterTs.ts +0 -9
  273. package/src/cli/assets/mainTs.ts +0 -13
  274. package/src/server/security/index.browser.ts +0 -10
  275. package/src/server/security/index.ts +0 -94
  276. /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
  277. /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
@@ -1,4 +1,4 @@
1
- import * as alepha587 from "alepha";
1
+ import * as alepha381 from "alepha";
2
2
  import { Alepha, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
3
  import * as alepha_server0 from "alepha/server";
4
4
  import { ServerRequest } from "alepha/server";
@@ -11,9 +11,6 @@ import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, Update
11
11
  import "alepha/datetime";
12
12
  import "alepha/retry";
13
13
  import "drizzle-orm/sqlite-core";
14
- import "alepha/lock";
15
- import "drizzle-orm/postgres-js";
16
- import "postgres";
17
14
 
18
15
  //#region ../../src/orm/schemas/insertSchema.d.ts
19
16
  /**
@@ -45,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
45
42
  //#region ../../src/orm/primitives/$entity.d.ts
46
43
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
47
44
  /**
48
- * The database table name that will be created for this entity.
49
- * If not provided, name will be inferred from the $repository variable name.
50
- */
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
+ */
51
48
  name: string;
52
49
  /**
53
- * TypeBox schema defining the table structure and column types.
54
- */
50
+ * TypeBox schema defining the table structure and column types.
51
+ */
55
52
  schema: T;
56
53
  /**
57
- * Database indexes to create for query optimization.
58
- */
54
+ * Database indexes to create for query optimization.
55
+ */
59
56
  indexes?: (Keys | {
60
57
  /**
61
- * Single column to index.
62
- */
58
+ * Single column to index.
59
+ */
63
60
  column: Keys;
64
61
  /**
65
- * Whether this should be a unique index (enforces uniqueness constraint).
66
- */
62
+ * Whether this should be a unique index (enforces uniqueness constraint).
63
+ */
67
64
  unique?: boolean;
68
65
  /**
69
- * Custom name for the index. If not provided, generates name automatically.
70
- */
66
+ * Custom name for the index. If not provided, generates name automatically.
67
+ */
71
68
  name?: string;
72
69
  } | {
73
70
  /**
74
- * Multiple columns for composite index (order matters for query optimization).
75
- */
71
+ * Multiple columns for composite index (order matters for query optimization).
72
+ */
76
73
  columns: Keys[];
77
74
  /**
78
- * Whether this should be a unique index (enforces uniqueness constraint).
79
- */
75
+ * Whether this should be a unique index (enforces uniqueness constraint).
76
+ */
80
77
  unique?: boolean;
81
78
  /**
82
- * Custom name for the index. If not provided, generates name automatically.
83
- */
79
+ * Custom name for the index. If not provided, generates name automatically.
80
+ */
84
81
  name?: string;
85
82
  })[];
86
83
  /**
87
- * Foreign key constraints to maintain referential integrity.
88
- */
84
+ * Foreign key constraints to maintain referential integrity.
85
+ */
89
86
  foreignKeys?: Array<{
90
87
  /**
91
- * Optional name for the foreign key constraint.
92
- */
88
+ * Optional name for the foreign key constraint.
89
+ */
93
90
  name?: string;
94
91
  /**
95
- * Local columns that reference the foreign table.
96
- */
92
+ * Local columns that reference the foreign table.
93
+ */
97
94
  columns: Array<keyof Static<T>>;
98
95
  /**
99
- * Referenced columns in the foreign table.
100
- * Must be EntityColumn references from other entities.
101
- */
96
+ * Referenced columns in the foreign table.
97
+ * Must be EntityColumn references from other entities.
98
+ */
102
99
  foreignColumns: Array<() => EntityColumn<any>>;
103
100
  }>;
104
101
  /**
105
- * Additional table constraints for data validation.
106
- *
107
- * Constraints enforce business rules at the database level, providing
108
- * an additional layer of data integrity beyond application validation.
109
- *
110
- * **Constraint Types**:
111
- * - **Unique constraints**: Prevent duplicate values across columns
112
- * - **Check constraints**: Enforce custom validation rules with SQL expressions
113
- *
114
- * @example
115
- * ```ts
116
- * constraints: [
117
- * {
118
- * name: "unique_user_email",
119
- * columns: ["email"],
120
- * unique: true
121
- * },
122
- * {
123
- * name: "valid_age_range",
124
- * columns: ["age"],
125
- * check: sql`age >= 0 AND age <= 150`
126
- * },
127
- * {
128
- * name: "unique_user_username_per_tenant",
129
- * columns: ["tenantId", "username"],
130
- * unique: true
131
- * }
132
- * ]
133
- * ```
134
- */
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
+ */
135
132
  constraints?: Array<{
136
133
  /**
137
- * Columns involved in this constraint.
138
- */
134
+ * Columns involved in this constraint.
135
+ */
139
136
  columns: Array<keyof Static<T>>;
140
137
  /**
141
- * Optional name for the constraint.
142
- */
138
+ * Optional name for the constraint.
139
+ */
143
140
  name?: string;
144
141
  /**
145
- * Whether this is a unique constraint.
146
- */
142
+ * Whether this is a unique constraint.
143
+ */
147
144
  unique?: boolean | {};
148
145
  /**
149
- * SQL expression for check constraint validation.
150
- */
146
+ * SQL expression for check constraint validation.
147
+ */
151
148
  check?: SQL;
152
149
  }>;
153
150
  /**
154
- * Advanced Drizzle ORM configuration for complex table setups.
155
- */
151
+ * Advanced Drizzle ORM configuration for complex table setups.
152
+ */
156
153
  config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
157
154
  }
158
155
  declare class EntityPrimitive<T extends TObject = TObject> {
@@ -200,8 +197,8 @@ type PgSymbols = {
200
197
  [PG_REF]: PgRefOptions;
201
198
  [PG_ENUM]: PgEnumOptions;
202
199
  /**
203
- * @deprecated Use `PG_IDENTITY` instead.
204
- */
200
+ * @deprecated Use `PG_IDENTITY` instead.
201
+ */
205
202
  [PG_SERIAL]: {};
206
203
  };
207
204
  type PgSymbolKeys = keyof PgSymbols;
@@ -231,120 +228,11 @@ interface PgRefOptions {
231
228
  */
232
229
  type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
233
230
  //#endregion
234
- //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
235
- declare module "alepha" {
236
- interface Env extends Partial<Static<typeof envSchema>> {}
237
- }
238
- declare const envSchema: alepha587.TObject<{
239
- /**
240
- * Main configuration for database connection.
241
- * Accept a string in the format of a Postgres connection URL.
242
- * Example: postgres://user:password@localhost:5432/database
243
- * or
244
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
245
- */
246
- DATABASE_URL: alepha587.TOptional<alepha587.TString>;
247
- /**
248
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
249
- *
250
- * It will monkey patch drizzle tables.
251
- */
252
- POSTGRES_SCHEMA: alepha587.TOptional<alepha587.TString>;
253
- }>;
254
- //#endregion
255
- //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
256
- /**
257
- * Configuration options for the Node.js SQLite database provider.
258
- */
259
- declare const nodeSqliteOptions: alepha587.Atom<alepha587.TObject<{
260
- path: alepha587.TOptional<alepha587.TString>;
261
- }>, "alepha.postgres.node-sqlite.options">;
262
- type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
263
- declare module "alepha" {
264
- interface State {
265
- [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
266
- }
267
- }
268
- /**
269
- * Add a fake support for SQLite in Node.js based on Postgres interfaces.
270
- *
271
- * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
272
- * This is NOT recommended for production use.
273
- */
274
- //#endregion
275
- //#region ../../src/orm/index.d.ts
276
- declare module "alepha" {
277
- interface Hooks {
278
- /**
279
- * Fires before creating an entity in the repository.
280
- */
281
- "repository:create:before": {
282
- tableName: string;
283
- data: any;
284
- };
285
- /**
286
- * Fires after creating an entity in the repository.
287
- */
288
- "repository:create:after": {
289
- tableName: string;
290
- data: any;
291
- entity: any;
292
- };
293
- /**
294
- * Fires before updating entities in the repository.
295
- */
296
- "repository:update:before": {
297
- tableName: string;
298
- where: any;
299
- data: any;
300
- };
301
- /**
302
- * Fires after updating entities in the repository.
303
- */
304
- "repository:update:after": {
305
- tableName: string;
306
- where: any;
307
- data: any;
308
- entities: any[];
309
- };
310
- /**
311
- * Fires before deleting entities from the repository.
312
- */
313
- "repository:delete:before": {
314
- tableName: string;
315
- where: any;
316
- };
317
- /**
318
- * Fires after deleting entities from the repository.
319
- */
320
- "repository:delete:after": {
321
- tableName: string;
322
- where: any;
323
- ids: Array<string | number>;
324
- };
325
- /**
326
- * Fires before reading entities from the repository.
327
- */
328
- "repository:read:before": {
329
- tableName: string;
330
- query: any;
331
- };
332
- /**
333
- * Fires after reading entities from the repository.
334
- */
335
- "repository:read:after": {
336
- tableName: string;
337
- query: any;
338
- entities: any[];
339
- };
340
- }
341
- }
342
- //#endregion
343
231
  //#region ../../src/api/audits/entities/audits.d.ts
344
232
  /**
345
233
  * Audit severity levels for categorizing events.
346
234
  */
347
- declare const auditSeveritySchema: alepha587.TUnsafe<"info" | "warning" | "critical">;
235
+ declare const auditSeveritySchema: alepha381.TUnsafe<"info" | "warning" | "critical">;
348
236
  type AuditSeverity = Static<typeof auditSeveritySchema>;
349
237
  /**
350
238
  * Audit log entity for tracking important system events.
@@ -355,212 +243,212 @@ type AuditSeverity = Static<typeof auditSeveritySchema>;
355
243
  * - When it happened (createdAt)
356
244
  * - Context and details (metadata, ipAddress, userAgent)
357
245
  */
358
- declare const audits: alepha_orm12.EntityPrimitive<alepha587.TObject<{
359
- id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
360
- createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
361
- /**
362
- * Audit event type (e.g., "auth", "user", "payment", "system").
363
- * Used for categorizing and filtering audit events.
364
- */
365
- type: alepha587.TString;
366
- /**
367
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
368
- */
369
- action: alepha587.TString;
370
- /**
371
- * Severity level of the event.
372
- */
373
- severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
374
- /**
375
- * User ID who performed the action (null for system events).
376
- */
377
- userId: alepha587.TOptional<alepha587.TString>;
378
- /**
379
- * User realm for multi-tenant support.
380
- */
381
- userRealm: alepha587.TOptional<alepha587.TString>;
382
- /**
383
- * User email at the time of the event (denormalized for history).
384
- */
385
- userEmail: alepha587.TOptional<alepha587.TString>;
386
- /**
387
- * Resource type affected (e.g., "user", "order", "file").
388
- */
389
- resourceType: alepha587.TOptional<alepha587.TString>;
390
- /**
391
- * Resource ID affected.
392
- */
393
- resourceId: alepha587.TOptional<alepha587.TString>;
394
- /**
395
- * Human-readable description of the event.
396
- */
397
- description: alepha587.TOptional<alepha587.TString>;
398
- /**
399
- * Additional metadata/context as JSON.
400
- */
401
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
402
- /**
403
- * Client IP address.
404
- */
405
- ipAddress: alepha587.TOptional<alepha587.TString>;
406
- /**
407
- * Client user agent.
408
- */
409
- userAgent: alepha587.TOptional<alepha587.TString>;
410
- /**
411
- * Session ID if applicable.
412
- */
413
- sessionId: alepha587.TOptional<alepha587.TString>;
414
- /**
415
- * Request ID for correlation.
416
- */
417
- requestId: alepha587.TOptional<alepha587.TString>;
418
- /**
419
- * Whether the action was successful.
420
- */
421
- success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
422
- /**
423
- * Error message if the action failed.
424
- */
425
- errorMessage: alepha587.TOptional<alepha587.TString>;
246
+ declare const audits: alepha_orm12.EntityPrimitive<alepha381.TObject<{
247
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
248
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
249
+ /**
250
+ * Audit event type (e.g., "auth", "user", "payment", "system").
251
+ * Used for categorizing and filtering audit events.
252
+ */
253
+ type: alepha381.TString;
254
+ /**
255
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
256
+ */
257
+ action: alepha381.TString;
258
+ /**
259
+ * Severity level of the event.
260
+ */
261
+ severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
262
+ /**
263
+ * User ID who performed the action (null for system events).
264
+ */
265
+ userId: alepha381.TOptional<alepha381.TString>;
266
+ /**
267
+ * User realm for multi-tenant support.
268
+ */
269
+ userRealm: alepha381.TOptional<alepha381.TString>;
270
+ /**
271
+ * User email at the time of the event (denormalized for history).
272
+ */
273
+ userEmail: alepha381.TOptional<alepha381.TString>;
274
+ /**
275
+ * Resource type affected (e.g., "user", "order", "file").
276
+ */
277
+ resourceType: alepha381.TOptional<alepha381.TString>;
278
+ /**
279
+ * Resource ID affected.
280
+ */
281
+ resourceId: alepha381.TOptional<alepha381.TString>;
282
+ /**
283
+ * Human-readable description of the event.
284
+ */
285
+ description: alepha381.TOptional<alepha381.TString>;
286
+ /**
287
+ * Additional metadata/context as JSON.
288
+ */
289
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
290
+ /**
291
+ * Client IP address.
292
+ */
293
+ ipAddress: alepha381.TOptional<alepha381.TString>;
294
+ /**
295
+ * Client user agent.
296
+ */
297
+ userAgent: alepha381.TOptional<alepha381.TString>;
298
+ /**
299
+ * Session ID if applicable.
300
+ */
301
+ sessionId: alepha381.TOptional<alepha381.TString>;
302
+ /**
303
+ * Request ID for correlation.
304
+ */
305
+ requestId: alepha381.TOptional<alepha381.TString>;
306
+ /**
307
+ * Whether the action was successful.
308
+ */
309
+ success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
310
+ /**
311
+ * Error message if the action failed.
312
+ */
313
+ errorMessage: alepha381.TOptional<alepha381.TString>;
426
314
  }>>;
427
- declare const auditEntitySchema: alepha587.TObject<{
428
- id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
429
- createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
430
- /**
431
- * Audit event type (e.g., "auth", "user", "payment", "system").
432
- * Used for categorizing and filtering audit events.
433
- */
434
- type: alepha587.TString;
435
- /**
436
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
437
- */
438
- action: alepha587.TString;
439
- /**
440
- * Severity level of the event.
441
- */
442
- severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
443
- /**
444
- * User ID who performed the action (null for system events).
445
- */
446
- userId: alepha587.TOptional<alepha587.TString>;
447
- /**
448
- * User realm for multi-tenant support.
449
- */
450
- userRealm: alepha587.TOptional<alepha587.TString>;
451
- /**
452
- * User email at the time of the event (denormalized for history).
453
- */
454
- userEmail: alepha587.TOptional<alepha587.TString>;
455
- /**
456
- * Resource type affected (e.g., "user", "order", "file").
457
- */
458
- resourceType: alepha587.TOptional<alepha587.TString>;
459
- /**
460
- * Resource ID affected.
461
- */
462
- resourceId: alepha587.TOptional<alepha587.TString>;
463
- /**
464
- * Human-readable description of the event.
465
- */
466
- description: alepha587.TOptional<alepha587.TString>;
467
- /**
468
- * Additional metadata/context as JSON.
469
- */
470
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
471
- /**
472
- * Client IP address.
473
- */
474
- ipAddress: alepha587.TOptional<alepha587.TString>;
475
- /**
476
- * Client user agent.
477
- */
478
- userAgent: alepha587.TOptional<alepha587.TString>;
479
- /**
480
- * Session ID if applicable.
481
- */
482
- sessionId: alepha587.TOptional<alepha587.TString>;
483
- /**
484
- * Request ID for correlation.
485
- */
486
- requestId: alepha587.TOptional<alepha587.TString>;
487
- /**
488
- * Whether the action was successful.
489
- */
490
- success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
491
- /**
492
- * Error message if the action failed.
493
- */
494
- errorMessage: alepha587.TOptional<alepha587.TString>;
315
+ declare const auditEntitySchema: alepha381.TObject<{
316
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
317
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
318
+ /**
319
+ * Audit event type (e.g., "auth", "user", "payment", "system").
320
+ * Used for categorizing and filtering audit events.
321
+ */
322
+ type: alepha381.TString;
323
+ /**
324
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
325
+ */
326
+ action: alepha381.TString;
327
+ /**
328
+ * Severity level of the event.
329
+ */
330
+ severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
331
+ /**
332
+ * User ID who performed the action (null for system events).
333
+ */
334
+ userId: alepha381.TOptional<alepha381.TString>;
335
+ /**
336
+ * User realm for multi-tenant support.
337
+ */
338
+ userRealm: alepha381.TOptional<alepha381.TString>;
339
+ /**
340
+ * User email at the time of the event (denormalized for history).
341
+ */
342
+ userEmail: alepha381.TOptional<alepha381.TString>;
343
+ /**
344
+ * Resource type affected (e.g., "user", "order", "file").
345
+ */
346
+ resourceType: alepha381.TOptional<alepha381.TString>;
347
+ /**
348
+ * Resource ID affected.
349
+ */
350
+ resourceId: alepha381.TOptional<alepha381.TString>;
351
+ /**
352
+ * Human-readable description of the event.
353
+ */
354
+ description: alepha381.TOptional<alepha381.TString>;
355
+ /**
356
+ * Additional metadata/context as JSON.
357
+ */
358
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
359
+ /**
360
+ * Client IP address.
361
+ */
362
+ ipAddress: alepha381.TOptional<alepha381.TString>;
363
+ /**
364
+ * Client user agent.
365
+ */
366
+ userAgent: alepha381.TOptional<alepha381.TString>;
367
+ /**
368
+ * Session ID if applicable.
369
+ */
370
+ sessionId: alepha381.TOptional<alepha381.TString>;
371
+ /**
372
+ * Request ID for correlation.
373
+ */
374
+ requestId: alepha381.TOptional<alepha381.TString>;
375
+ /**
376
+ * Whether the action was successful.
377
+ */
378
+ success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
379
+ /**
380
+ * Error message if the action failed.
381
+ */
382
+ errorMessage: alepha381.TOptional<alepha381.TString>;
495
383
  }>;
496
- declare const auditEntityInsertSchema: alepha_orm12.TObjectInsert<alepha587.TObject<{
497
- id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
498
- createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
499
- /**
500
- * Audit event type (e.g., "auth", "user", "payment", "system").
501
- * Used for categorizing and filtering audit events.
502
- */
503
- type: alepha587.TString;
504
- /**
505
- * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
506
- */
507
- action: alepha587.TString;
508
- /**
509
- * Severity level of the event.
510
- */
511
- severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
512
- /**
513
- * User ID who performed the action (null for system events).
514
- */
515
- userId: alepha587.TOptional<alepha587.TString>;
516
- /**
517
- * User realm for multi-tenant support.
518
- */
519
- userRealm: alepha587.TOptional<alepha587.TString>;
520
- /**
521
- * User email at the time of the event (denormalized for history).
522
- */
523
- userEmail: alepha587.TOptional<alepha587.TString>;
524
- /**
525
- * Resource type affected (e.g., "user", "order", "file").
526
- */
527
- resourceType: alepha587.TOptional<alepha587.TString>;
528
- /**
529
- * Resource ID affected.
530
- */
531
- resourceId: alepha587.TOptional<alepha587.TString>;
532
- /**
533
- * Human-readable description of the event.
534
- */
535
- description: alepha587.TOptional<alepha587.TString>;
536
- /**
537
- * Additional metadata/context as JSON.
538
- */
539
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
540
- /**
541
- * Client IP address.
542
- */
543
- ipAddress: alepha587.TOptional<alepha587.TString>;
544
- /**
545
- * Client user agent.
546
- */
547
- userAgent: alepha587.TOptional<alepha587.TString>;
548
- /**
549
- * Session ID if applicable.
550
- */
551
- sessionId: alepha587.TOptional<alepha587.TString>;
552
- /**
553
- * Request ID for correlation.
554
- */
555
- requestId: alepha587.TOptional<alepha587.TString>;
556
- /**
557
- * Whether the action was successful.
558
- */
559
- success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
560
- /**
561
- * Error message if the action failed.
562
- */
563
- errorMessage: alepha587.TOptional<alepha587.TString>;
384
+ declare const auditEntityInsertSchema: alepha_orm12.TObjectInsert<alepha381.TObject<{
385
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
386
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
387
+ /**
388
+ * Audit event type (e.g., "auth", "user", "payment", "system").
389
+ * Used for categorizing and filtering audit events.
390
+ */
391
+ type: alepha381.TString;
392
+ /**
393
+ * Specific action performed (e.g., "login", "logout", "create", "update", "delete").
394
+ */
395
+ action: alepha381.TString;
396
+ /**
397
+ * Severity level of the event.
398
+ */
399
+ severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
400
+ /**
401
+ * User ID who performed the action (null for system events).
402
+ */
403
+ userId: alepha381.TOptional<alepha381.TString>;
404
+ /**
405
+ * User realm for multi-tenant support.
406
+ */
407
+ userRealm: alepha381.TOptional<alepha381.TString>;
408
+ /**
409
+ * User email at the time of the event (denormalized for history).
410
+ */
411
+ userEmail: alepha381.TOptional<alepha381.TString>;
412
+ /**
413
+ * Resource type affected (e.g., "user", "order", "file").
414
+ */
415
+ resourceType: alepha381.TOptional<alepha381.TString>;
416
+ /**
417
+ * Resource ID affected.
418
+ */
419
+ resourceId: alepha381.TOptional<alepha381.TString>;
420
+ /**
421
+ * Human-readable description of the event.
422
+ */
423
+ description: alepha381.TOptional<alepha381.TString>;
424
+ /**
425
+ * Additional metadata/context as JSON.
426
+ */
427
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
428
+ /**
429
+ * Client IP address.
430
+ */
431
+ ipAddress: alepha381.TOptional<alepha381.TString>;
432
+ /**
433
+ * Client user agent.
434
+ */
435
+ userAgent: alepha381.TOptional<alepha381.TString>;
436
+ /**
437
+ * Session ID if applicable.
438
+ */
439
+ sessionId: alepha381.TOptional<alepha381.TString>;
440
+ /**
441
+ * Request ID for correlation.
442
+ */
443
+ requestId: alepha381.TOptional<alepha381.TString>;
444
+ /**
445
+ * Whether the action was successful.
446
+ */
447
+ success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
448
+ /**
449
+ * Error message if the action failed.
450
+ */
451
+ errorMessage: alepha381.TOptional<alepha381.TString>;
564
452
  }>>;
565
453
  type AuditEntity = Static<typeof audits.schema>;
566
454
  //#endregion
@@ -568,21 +456,21 @@ type AuditEntity = Static<typeof audits.schema>;
568
456
  /**
569
457
  * Query schema for searching and filtering audit logs.
570
458
  */
571
- declare const auditQuerySchema: alepha587.TObject<{
572
- page: alepha587.TOptional<alepha587.TInteger>;
573
- size: alepha587.TOptional<alepha587.TInteger>;
574
- sort: alepha587.TOptional<alepha587.TString>;
575
- type: alepha587.TOptional<alepha587.TString>;
576
- action: alepha587.TOptional<alepha587.TString>;
577
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
578
- userId: alepha587.TOptional<alepha587.TString>;
579
- userRealm: alepha587.TOptional<alepha587.TString>;
580
- resourceType: alepha587.TOptional<alepha587.TString>;
581
- resourceId: alepha587.TOptional<alepha587.TString>;
582
- success: alepha587.TOptional<alepha587.TBoolean>;
583
- from: alepha587.TOptional<alepha587.TString>;
584
- to: alepha587.TOptional<alepha587.TString>;
585
- search: alepha587.TOptional<alepha587.TString>;
459
+ declare const auditQuerySchema: alepha381.TObject<{
460
+ page: alepha381.TOptional<alepha381.TInteger>;
461
+ size: alepha381.TOptional<alepha381.TInteger>;
462
+ sort: alepha381.TOptional<alepha381.TString>;
463
+ type: alepha381.TOptional<alepha381.TString>;
464
+ action: alepha381.TOptional<alepha381.TString>;
465
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
466
+ userId: alepha381.TOptional<alepha381.TString>;
467
+ userRealm: alepha381.TOptional<alepha381.TString>;
468
+ resourceType: alepha381.TOptional<alepha381.TString>;
469
+ resourceId: alepha381.TOptional<alepha381.TString>;
470
+ success: alepha381.TOptional<alepha381.TBoolean>;
471
+ from: alepha381.TOptional<alepha381.TString>;
472
+ to: alepha381.TOptional<alepha381.TString>;
473
+ search: alepha381.TOptional<alepha381.TString>;
586
474
  }>;
587
475
  type AuditQuery = Static<typeof auditQuerySchema>;
588
476
  //#endregion
@@ -590,23 +478,23 @@ type AuditQuery = Static<typeof auditQuerySchema>;
590
478
  /**
591
479
  * Schema for creating a new audit log entry.
592
480
  */
593
- declare const createAuditSchema: alepha587.TObject<{
594
- type: alepha587.TString;
595
- action: alepha587.TString;
596
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
597
- userId: alepha587.TOptional<alepha587.TString>;
598
- userRealm: alepha587.TOptional<alepha587.TString>;
599
- userEmail: alepha587.TOptional<alepha587.TString>;
600
- resourceType: alepha587.TOptional<alepha587.TString>;
601
- resourceId: alepha587.TOptional<alepha587.TString>;
602
- description: alepha587.TOptional<alepha587.TString>;
603
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
604
- ipAddress: alepha587.TOptional<alepha587.TString>;
605
- userAgent: alepha587.TOptional<alepha587.TString>;
606
- sessionId: alepha587.TOptional<alepha587.TString>;
607
- requestId: alepha587.TOptional<alepha587.TString>;
608
- success: alepha587.TOptional<alepha587.TBoolean>;
609
- errorMessage: alepha587.TOptional<alepha587.TString>;
481
+ declare const createAuditSchema: alepha381.TObject<{
482
+ type: alepha381.TString;
483
+ action: alepha381.TString;
484
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
485
+ userId: alepha381.TOptional<alepha381.TString>;
486
+ userRealm: alepha381.TOptional<alepha381.TString>;
487
+ userEmail: alepha381.TOptional<alepha381.TString>;
488
+ resourceType: alepha381.TOptional<alepha381.TString>;
489
+ resourceId: alepha381.TOptional<alepha381.TString>;
490
+ description: alepha381.TOptional<alepha381.TString>;
491
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
492
+ ipAddress: alepha381.TOptional<alepha381.TString>;
493
+ userAgent: alepha381.TOptional<alepha381.TString>;
494
+ sessionId: alepha381.TOptional<alepha381.TString>;
495
+ requestId: alepha381.TOptional<alepha381.TString>;
496
+ success: alepha381.TOptional<alepha381.TBoolean>;
497
+ errorMessage: alepha381.TOptional<alepha381.TString>;
610
498
  }>;
611
499
  type CreateAudit = Static<typeof createAuditSchema>;
612
500
  //#endregion
@@ -631,98 +519,98 @@ interface AuditTypeDefinition {
631
519
  declare class AuditService {
632
520
  protected readonly alepha: Alepha;
633
521
  protected readonly log: alepha_logger0.Logger;
634
- protected readonly repo: alepha_orm12.Repository<alepha587.TObject<{
635
- id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
636
- createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha587.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
637
- type: alepha587.TString;
638
- action: alepha587.TString;
639
- severity: alepha_orm12.PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
640
- userId: alepha587.TOptional<alepha587.TString>;
641
- userRealm: alepha587.TOptional<alepha587.TString>;
642
- userEmail: alepha587.TOptional<alepha587.TString>;
643
- resourceType: alepha587.TOptional<alepha587.TString>;
644
- resourceId: alepha587.TOptional<alepha587.TString>;
645
- description: alepha587.TOptional<alepha587.TString>;
646
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
647
- ipAddress: alepha587.TOptional<alepha587.TString>;
648
- userAgent: alepha587.TOptional<alepha587.TString>;
649
- sessionId: alepha587.TOptional<alepha587.TString>;
650
- requestId: alepha587.TOptional<alepha587.TString>;
651
- success: alepha_orm12.PgAttr<alepha587.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
652
- errorMessage: alepha587.TOptional<alepha587.TString>;
522
+ protected readonly repo: alepha_orm12.Repository<alepha381.TObject<{
523
+ id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
524
+ createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
525
+ type: alepha381.TString;
526
+ action: alepha381.TString;
527
+ severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
528
+ userId: alepha381.TOptional<alepha381.TString>;
529
+ userRealm: alepha381.TOptional<alepha381.TString>;
530
+ userEmail: alepha381.TOptional<alepha381.TString>;
531
+ resourceType: alepha381.TOptional<alepha381.TString>;
532
+ resourceId: alepha381.TOptional<alepha381.TString>;
533
+ description: alepha381.TOptional<alepha381.TString>;
534
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
535
+ ipAddress: alepha381.TOptional<alepha381.TString>;
536
+ userAgent: alepha381.TOptional<alepha381.TString>;
537
+ sessionId: alepha381.TOptional<alepha381.TString>;
538
+ requestId: alepha381.TOptional<alepha381.TString>;
539
+ success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
540
+ errorMessage: alepha381.TOptional<alepha381.TString>;
653
541
  }>>;
654
542
  /**
655
- * Registry of audit types and their allowed actions.
656
- */
543
+ * Registry of audit types and their allowed actions.
544
+ */
657
545
  protected readonly auditTypes: Map<string, AuditTypeDefinition>;
658
546
  /**
659
- * Register an audit type with its allowed actions.
660
- */
547
+ * Register an audit type with its allowed actions.
548
+ */
661
549
  registerType(definition: AuditTypeDefinition): void;
662
550
  /**
663
- * Get all registered audit types.
664
- */
551
+ * Get all registered audit types.
552
+ */
665
553
  getRegisteredTypes(): AuditTypeDefinition[];
666
554
  /**
667
- * Get current request context if available.
668
- */
555
+ * Get current request context if available.
556
+ */
669
557
  protected getRequestContext(): ServerRequest | undefined;
670
558
  /**
671
- * Create a new audit log entry.
672
- * Automatically populates ipAddress, userAgent, and requestId from the current request context.
673
- */
559
+ * Create a new audit log entry.
560
+ * Automatically populates ipAddress, userAgent, and requestId from the current request context.
561
+ */
674
562
  create(data: CreateAudit): Promise<AuditEntity>;
675
563
  /**
676
- * Record an audit event (convenience method).
677
- */
564
+ * Record an audit event (convenience method).
565
+ */
678
566
  record(type: string, action: string, options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
679
567
  /**
680
- * Record an authentication event.
681
- */
568
+ * Record an authentication event.
569
+ */
682
570
  recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh" | "mfa_setup" | "mfa_verify", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
683
571
  /**
684
- * Record a user management event.
685
- */
572
+ * Record a user management event.
573
+ */
686
574
  recordUser(action: "create" | "update" | "delete" | "enable" | "disable" | "role_change", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
687
575
  /**
688
- * Record a data access event.
689
- */
576
+ * Record a data access event.
577
+ */
690
578
  recordAccess(action: "view" | "export" | "download", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
691
579
  /**
692
- * Record a security event.
693
- */
580
+ * Record a security event.
581
+ */
694
582
  recordSecurity(action: "permission_denied" | "suspicious_activity" | "rate_limited" | "blocked", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
695
583
  /**
696
- * Record a system event.
697
- */
584
+ * Record a system event.
585
+ */
698
586
  recordSystem(action: "startup" | "shutdown" | "config_change" | "maintenance" | "error", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
699
587
  /**
700
- * Find audit entries with filtering and pagination.
701
- */
588
+ * Find audit entries with filtering and pagination.
589
+ */
702
590
  find(query?: AuditQuery): Promise<Page<AuditEntity>>;
703
591
  /**
704
- * Get audit entry by ID.
705
- */
592
+ * Get audit entry by ID.
593
+ */
706
594
  getById(id: string): Promise<AuditEntity>;
707
595
  /**
708
- * Get audit entries for a specific user.
709
- */
596
+ * Get audit entries for a specific user.
597
+ */
710
598
  findByUser(userId: string, query?: Omit<AuditQuery, "userId">): Promise<Page<AuditEntity>>;
711
599
  /**
712
- * Get audit entries for a specific resource.
713
- */
600
+ * Get audit entries for a specific resource.
601
+ */
714
602
  findByResource(resourceType: string, resourceId: string, query?: Omit<AuditQuery, "resourceType" | "resourceId">): Promise<Page<AuditEntity>>;
715
603
  /**
716
- * Get audit statistics for a time period.
717
- */
604
+ * Get audit statistics for a time period.
605
+ */
718
606
  getStats(options?: {
719
607
  from?: Date;
720
608
  to?: Date;
721
609
  userRealm?: string;
722
610
  }): Promise<AuditStats>;
723
611
  /**
724
- * Delete old audit entries (for retention policy).
725
- */
612
+ * Delete old audit entries (for retention policy).
613
+ */
726
614
  deleteOlderThan(date: Date): Promise<number>;
727
615
  }
728
616
  /**
@@ -751,262 +639,262 @@ declare class AdminAuditController {
751
639
  protected readonly group = "admin:audits";
752
640
  protected readonly auditService: AuditService;
753
641
  /**
754
- * Find audit entries with filtering and pagination.
755
- */
642
+ * Find audit entries with filtering and pagination.
643
+ */
756
644
  readonly findAudits: alepha_server0.ActionPrimitiveFn<{
757
- query: alepha587.TObject<{
758
- page: alepha587.TOptional<alepha587.TInteger>;
759
- size: alepha587.TOptional<alepha587.TInteger>;
760
- sort: alepha587.TOptional<alepha587.TString>;
761
- type: alepha587.TOptional<alepha587.TString>;
762
- action: alepha587.TOptional<alepha587.TString>;
763
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
764
- userId: alepha587.TOptional<alepha587.TString>;
765
- userRealm: alepha587.TOptional<alepha587.TString>;
766
- resourceType: alepha587.TOptional<alepha587.TString>;
767
- resourceId: alepha587.TOptional<alepha587.TString>;
768
- success: alepha587.TOptional<alepha587.TBoolean>;
769
- from: alepha587.TOptional<alepha587.TString>;
770
- to: alepha587.TOptional<alepha587.TString>;
771
- search: alepha587.TOptional<alepha587.TString>;
645
+ query: alepha381.TObject<{
646
+ page: alepha381.TOptional<alepha381.TInteger>;
647
+ size: alepha381.TOptional<alepha381.TInteger>;
648
+ sort: alepha381.TOptional<alepha381.TString>;
649
+ type: alepha381.TOptional<alepha381.TString>;
650
+ action: alepha381.TOptional<alepha381.TString>;
651
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
652
+ userId: alepha381.TOptional<alepha381.TString>;
653
+ userRealm: alepha381.TOptional<alepha381.TString>;
654
+ resourceType: alepha381.TOptional<alepha381.TString>;
655
+ resourceId: alepha381.TOptional<alepha381.TString>;
656
+ success: alepha381.TOptional<alepha381.TBoolean>;
657
+ from: alepha381.TOptional<alepha381.TString>;
658
+ to: alepha381.TOptional<alepha381.TString>;
659
+ search: alepha381.TOptional<alepha381.TString>;
772
660
  }>;
773
- response: alepha587.TPage<alepha587.TObject<{
774
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
775
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
776
- type: alepha587.TString;
777
- action: alepha587.TString;
778
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
779
- userId: alepha587.TOptional<alepha587.TString>;
780
- userRealm: alepha587.TOptional<alepha587.TString>;
781
- userEmail: alepha587.TOptional<alepha587.TString>;
782
- resourceType: alepha587.TOptional<alepha587.TString>;
783
- resourceId: alepha587.TOptional<alepha587.TString>;
784
- description: alepha587.TOptional<alepha587.TString>;
785
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
786
- ipAddress: alepha587.TOptional<alepha587.TString>;
787
- userAgent: alepha587.TOptional<alepha587.TString>;
788
- sessionId: alepha587.TOptional<alepha587.TString>;
789
- requestId: alepha587.TOptional<alepha587.TString>;
790
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
791
- errorMessage: alepha587.TOptional<alepha587.TString>;
661
+ response: alepha381.TPage<alepha381.TObject<{
662
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
663
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
664
+ type: alepha381.TString;
665
+ action: alepha381.TString;
666
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
667
+ userId: alepha381.TOptional<alepha381.TString>;
668
+ userRealm: alepha381.TOptional<alepha381.TString>;
669
+ userEmail: alepha381.TOptional<alepha381.TString>;
670
+ resourceType: alepha381.TOptional<alepha381.TString>;
671
+ resourceId: alepha381.TOptional<alepha381.TString>;
672
+ description: alepha381.TOptional<alepha381.TString>;
673
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
674
+ ipAddress: alepha381.TOptional<alepha381.TString>;
675
+ userAgent: alepha381.TOptional<alepha381.TString>;
676
+ sessionId: alepha381.TOptional<alepha381.TString>;
677
+ requestId: alepha381.TOptional<alepha381.TString>;
678
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
679
+ errorMessage: alepha381.TOptional<alepha381.TString>;
792
680
  }>>;
793
681
  }>;
794
682
  /**
795
- * Get a single audit entry by ID.
796
- */
683
+ * Get a single audit entry by ID.
684
+ */
797
685
  readonly getAudit: alepha_server0.ActionPrimitiveFn<{
798
- params: alepha587.TObject<{
799
- id: alepha587.TString;
686
+ params: alepha381.TObject<{
687
+ id: alepha381.TString;
800
688
  }>;
801
- response: alepha587.TObject<{
802
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
803
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
804
- type: alepha587.TString;
805
- action: alepha587.TString;
806
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
807
- userId: alepha587.TOptional<alepha587.TString>;
808
- userRealm: alepha587.TOptional<alepha587.TString>;
809
- userEmail: alepha587.TOptional<alepha587.TString>;
810
- resourceType: alepha587.TOptional<alepha587.TString>;
811
- resourceId: alepha587.TOptional<alepha587.TString>;
812
- description: alepha587.TOptional<alepha587.TString>;
813
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
814
- ipAddress: alepha587.TOptional<alepha587.TString>;
815
- userAgent: alepha587.TOptional<alepha587.TString>;
816
- sessionId: alepha587.TOptional<alepha587.TString>;
817
- requestId: alepha587.TOptional<alepha587.TString>;
818
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
819
- errorMessage: alepha587.TOptional<alepha587.TString>;
689
+ response: alepha381.TObject<{
690
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
691
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
692
+ type: alepha381.TString;
693
+ action: alepha381.TString;
694
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
695
+ userId: alepha381.TOptional<alepha381.TString>;
696
+ userRealm: alepha381.TOptional<alepha381.TString>;
697
+ userEmail: alepha381.TOptional<alepha381.TString>;
698
+ resourceType: alepha381.TOptional<alepha381.TString>;
699
+ resourceId: alepha381.TOptional<alepha381.TString>;
700
+ description: alepha381.TOptional<alepha381.TString>;
701
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
702
+ ipAddress: alepha381.TOptional<alepha381.TString>;
703
+ userAgent: alepha381.TOptional<alepha381.TString>;
704
+ sessionId: alepha381.TOptional<alepha381.TString>;
705
+ requestId: alepha381.TOptional<alepha381.TString>;
706
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
707
+ errorMessage: alepha381.TOptional<alepha381.TString>;
820
708
  }>;
821
709
  }>;
822
710
  /**
823
- * Create a new audit entry.
824
- */
711
+ * Create a new audit entry.
712
+ */
825
713
  readonly createAudit: alepha_server0.ActionPrimitiveFn<{
826
- body: alepha587.TObject<{
827
- type: alepha587.TString;
828
- action: alepha587.TString;
829
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
830
- userId: alepha587.TOptional<alepha587.TString>;
831
- userRealm: alepha587.TOptional<alepha587.TString>;
832
- userEmail: alepha587.TOptional<alepha587.TString>;
833
- resourceType: alepha587.TOptional<alepha587.TString>;
834
- resourceId: alepha587.TOptional<alepha587.TString>;
835
- description: alepha587.TOptional<alepha587.TString>;
836
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
837
- ipAddress: alepha587.TOptional<alepha587.TString>;
838
- userAgent: alepha587.TOptional<alepha587.TString>;
839
- sessionId: alepha587.TOptional<alepha587.TString>;
840
- requestId: alepha587.TOptional<alepha587.TString>;
841
- success: alepha587.TOptional<alepha587.TBoolean>;
842
- errorMessage: alepha587.TOptional<alepha587.TString>;
714
+ body: alepha381.TObject<{
715
+ type: alepha381.TString;
716
+ action: alepha381.TString;
717
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
718
+ userId: alepha381.TOptional<alepha381.TString>;
719
+ userRealm: alepha381.TOptional<alepha381.TString>;
720
+ userEmail: alepha381.TOptional<alepha381.TString>;
721
+ resourceType: alepha381.TOptional<alepha381.TString>;
722
+ resourceId: alepha381.TOptional<alepha381.TString>;
723
+ description: alepha381.TOptional<alepha381.TString>;
724
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
725
+ ipAddress: alepha381.TOptional<alepha381.TString>;
726
+ userAgent: alepha381.TOptional<alepha381.TString>;
727
+ sessionId: alepha381.TOptional<alepha381.TString>;
728
+ requestId: alepha381.TOptional<alepha381.TString>;
729
+ success: alepha381.TOptional<alepha381.TBoolean>;
730
+ errorMessage: alepha381.TOptional<alepha381.TString>;
843
731
  }>;
844
- response: alepha587.TObject<{
845
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
846
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
847
- type: alepha587.TString;
848
- action: alepha587.TString;
849
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
850
- userId: alepha587.TOptional<alepha587.TString>;
851
- userRealm: alepha587.TOptional<alepha587.TString>;
852
- userEmail: alepha587.TOptional<alepha587.TString>;
853
- resourceType: alepha587.TOptional<alepha587.TString>;
854
- resourceId: alepha587.TOptional<alepha587.TString>;
855
- description: alepha587.TOptional<alepha587.TString>;
856
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
857
- ipAddress: alepha587.TOptional<alepha587.TString>;
858
- userAgent: alepha587.TOptional<alepha587.TString>;
859
- sessionId: alepha587.TOptional<alepha587.TString>;
860
- requestId: alepha587.TOptional<alepha587.TString>;
861
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
862
- errorMessage: alepha587.TOptional<alepha587.TString>;
732
+ response: alepha381.TObject<{
733
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
734
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
735
+ type: alepha381.TString;
736
+ action: alepha381.TString;
737
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
738
+ userId: alepha381.TOptional<alepha381.TString>;
739
+ userRealm: alepha381.TOptional<alepha381.TString>;
740
+ userEmail: alepha381.TOptional<alepha381.TString>;
741
+ resourceType: alepha381.TOptional<alepha381.TString>;
742
+ resourceId: alepha381.TOptional<alepha381.TString>;
743
+ description: alepha381.TOptional<alepha381.TString>;
744
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
745
+ ipAddress: alepha381.TOptional<alepha381.TString>;
746
+ userAgent: alepha381.TOptional<alepha381.TString>;
747
+ sessionId: alepha381.TOptional<alepha381.TString>;
748
+ requestId: alepha381.TOptional<alepha381.TString>;
749
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
750
+ errorMessage: alepha381.TOptional<alepha381.TString>;
863
751
  }>;
864
752
  }>;
865
753
  /**
866
- * Get audit entries for a specific user.
867
- */
754
+ * Get audit entries for a specific user.
755
+ */
868
756
  readonly findByUser: alepha_server0.ActionPrimitiveFn<{
869
- params: alepha587.TObject<{
870
- userId: alepha587.TString;
757
+ params: alepha381.TObject<{
758
+ userId: alepha381.TString;
871
759
  }>;
872
- query: alepha587.TObject<{
873
- type: alepha587.TOptional<alepha587.TString>;
874
- search: alepha587.TOptional<alepha587.TString>;
875
- action: alepha587.TOptional<alepha587.TString>;
876
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
877
- sort: alepha587.TOptional<alepha587.TString>;
878
- userRealm: alepha587.TOptional<alepha587.TString>;
879
- resourceType: alepha587.TOptional<alepha587.TString>;
880
- resourceId: alepha587.TOptional<alepha587.TString>;
881
- success: alepha587.TOptional<alepha587.TBoolean>;
882
- page: alepha587.TOptional<alepha587.TInteger>;
883
- size: alepha587.TOptional<alepha587.TInteger>;
884
- from: alepha587.TOptional<alepha587.TString>;
885
- to: alepha587.TOptional<alepha587.TString>;
760
+ query: alepha381.TObject<{
761
+ type: alepha381.TOptional<alepha381.TString>;
762
+ search: alepha381.TOptional<alepha381.TString>;
763
+ action: alepha381.TOptional<alepha381.TString>;
764
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
765
+ sort: alepha381.TOptional<alepha381.TString>;
766
+ userRealm: alepha381.TOptional<alepha381.TString>;
767
+ resourceType: alepha381.TOptional<alepha381.TString>;
768
+ resourceId: alepha381.TOptional<alepha381.TString>;
769
+ success: alepha381.TOptional<alepha381.TBoolean>;
770
+ page: alepha381.TOptional<alepha381.TInteger>;
771
+ size: alepha381.TOptional<alepha381.TInteger>;
772
+ from: alepha381.TOptional<alepha381.TString>;
773
+ to: alepha381.TOptional<alepha381.TString>;
886
774
  }>;
887
- response: alepha587.TPage<alepha587.TObject<{
888
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
889
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
890
- type: alepha587.TString;
891
- action: alepha587.TString;
892
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
893
- userId: alepha587.TOptional<alepha587.TString>;
894
- userRealm: alepha587.TOptional<alepha587.TString>;
895
- userEmail: alepha587.TOptional<alepha587.TString>;
896
- resourceType: alepha587.TOptional<alepha587.TString>;
897
- resourceId: alepha587.TOptional<alepha587.TString>;
898
- description: alepha587.TOptional<alepha587.TString>;
899
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
900
- ipAddress: alepha587.TOptional<alepha587.TString>;
901
- userAgent: alepha587.TOptional<alepha587.TString>;
902
- sessionId: alepha587.TOptional<alepha587.TString>;
903
- requestId: alepha587.TOptional<alepha587.TString>;
904
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
905
- errorMessage: alepha587.TOptional<alepha587.TString>;
775
+ response: alepha381.TPage<alepha381.TObject<{
776
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
777
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
778
+ type: alepha381.TString;
779
+ action: alepha381.TString;
780
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
781
+ userId: alepha381.TOptional<alepha381.TString>;
782
+ userRealm: alepha381.TOptional<alepha381.TString>;
783
+ userEmail: alepha381.TOptional<alepha381.TString>;
784
+ resourceType: alepha381.TOptional<alepha381.TString>;
785
+ resourceId: alepha381.TOptional<alepha381.TString>;
786
+ description: alepha381.TOptional<alepha381.TString>;
787
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
788
+ ipAddress: alepha381.TOptional<alepha381.TString>;
789
+ userAgent: alepha381.TOptional<alepha381.TString>;
790
+ sessionId: alepha381.TOptional<alepha381.TString>;
791
+ requestId: alepha381.TOptional<alepha381.TString>;
792
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
793
+ errorMessage: alepha381.TOptional<alepha381.TString>;
906
794
  }>>;
907
795
  }>;
908
796
  /**
909
- * Get audit entries for a specific resource.
910
- */
797
+ * Get audit entries for a specific resource.
798
+ */
911
799
  readonly findByResource: alepha_server0.ActionPrimitiveFn<{
912
- params: alepha587.TObject<{
913
- resourceType: alepha587.TString;
914
- resourceId: alepha587.TString;
800
+ params: alepha381.TObject<{
801
+ resourceType: alepha381.TString;
802
+ resourceId: alepha381.TString;
915
803
  }>;
916
- query: alepha587.TObject<{
917
- type: alepha587.TOptional<alepha587.TString>;
918
- search: alepha587.TOptional<alepha587.TString>;
919
- action: alepha587.TOptional<alepha587.TString>;
920
- severity: alepha587.TOptional<alepha587.TUnsafe<"info" | "warning" | "critical">>;
921
- sort: alepha587.TOptional<alepha587.TString>;
922
- userId: alepha587.TOptional<alepha587.TString>;
923
- userRealm: alepha587.TOptional<alepha587.TString>;
924
- success: alepha587.TOptional<alepha587.TBoolean>;
925
- page: alepha587.TOptional<alepha587.TInteger>;
926
- size: alepha587.TOptional<alepha587.TInteger>;
927
- from: alepha587.TOptional<alepha587.TString>;
928
- to: alepha587.TOptional<alepha587.TString>;
804
+ query: alepha381.TObject<{
805
+ type: alepha381.TOptional<alepha381.TString>;
806
+ search: alepha381.TOptional<alepha381.TString>;
807
+ action: alepha381.TOptional<alepha381.TString>;
808
+ severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
809
+ sort: alepha381.TOptional<alepha381.TString>;
810
+ userId: alepha381.TOptional<alepha381.TString>;
811
+ userRealm: alepha381.TOptional<alepha381.TString>;
812
+ success: alepha381.TOptional<alepha381.TBoolean>;
813
+ page: alepha381.TOptional<alepha381.TInteger>;
814
+ size: alepha381.TOptional<alepha381.TInteger>;
815
+ from: alepha381.TOptional<alepha381.TString>;
816
+ to: alepha381.TOptional<alepha381.TString>;
929
817
  }>;
930
- response: alepha587.TPage<alepha587.TObject<{
931
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
932
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
933
- type: alepha587.TString;
934
- action: alepha587.TString;
935
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
936
- userId: alepha587.TOptional<alepha587.TString>;
937
- userRealm: alepha587.TOptional<alepha587.TString>;
938
- userEmail: alepha587.TOptional<alepha587.TString>;
939
- resourceType: alepha587.TOptional<alepha587.TString>;
940
- resourceId: alepha587.TOptional<alepha587.TString>;
941
- description: alepha587.TOptional<alepha587.TString>;
942
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
943
- ipAddress: alepha587.TOptional<alepha587.TString>;
944
- userAgent: alepha587.TOptional<alepha587.TString>;
945
- sessionId: alepha587.TOptional<alepha587.TString>;
946
- requestId: alepha587.TOptional<alepha587.TString>;
947
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
948
- errorMessage: alepha587.TOptional<alepha587.TString>;
818
+ response: alepha381.TPage<alepha381.TObject<{
819
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
820
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
821
+ type: alepha381.TString;
822
+ action: alepha381.TString;
823
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
824
+ userId: alepha381.TOptional<alepha381.TString>;
825
+ userRealm: alepha381.TOptional<alepha381.TString>;
826
+ userEmail: alepha381.TOptional<alepha381.TString>;
827
+ resourceType: alepha381.TOptional<alepha381.TString>;
828
+ resourceId: alepha381.TOptional<alepha381.TString>;
829
+ description: alepha381.TOptional<alepha381.TString>;
830
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
831
+ ipAddress: alepha381.TOptional<alepha381.TString>;
832
+ userAgent: alepha381.TOptional<alepha381.TString>;
833
+ sessionId: alepha381.TOptional<alepha381.TString>;
834
+ requestId: alepha381.TOptional<alepha381.TString>;
835
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
836
+ errorMessage: alepha381.TOptional<alepha381.TString>;
949
837
  }>>;
950
838
  }>;
951
839
  /**
952
- * Get audit statistics.
953
- */
840
+ * Get audit statistics.
841
+ */
954
842
  readonly getStats: alepha_server0.ActionPrimitiveFn<{
955
- query: alepha587.TObject<{
956
- from: alepha587.TOptional<alepha587.TString>;
957
- to: alepha587.TOptional<alepha587.TString>;
958
- userRealm: alepha587.TOptional<alepha587.TString>;
843
+ query: alepha381.TObject<{
844
+ from: alepha381.TOptional<alepha381.TString>;
845
+ to: alepha381.TOptional<alepha381.TString>;
846
+ userRealm: alepha381.TOptional<alepha381.TString>;
959
847
  }>;
960
- response: alepha587.TObject<{
961
- total: alepha587.TInteger;
962
- byType: alepha587.TRecord<"^.*$", alepha587.TInteger>;
963
- bySeverity: alepha587.TObject<{
964
- info: alepha587.TInteger;
965
- warning: alepha587.TInteger;
966
- critical: alepha587.TInteger;
848
+ response: alepha381.TObject<{
849
+ total: alepha381.TInteger;
850
+ byType: alepha381.TRecord<"^.*$", alepha381.TInteger>;
851
+ bySeverity: alepha381.TObject<{
852
+ info: alepha381.TInteger;
853
+ warning: alepha381.TInteger;
854
+ critical: alepha381.TInteger;
967
855
  }>;
968
- successRate: alepha587.TNumber;
969
- recentFailures: alepha587.TArray<alepha587.TObject<{
970
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
971
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
972
- type: alepha587.TString;
973
- action: alepha587.TString;
974
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
975
- userId: alepha587.TOptional<alepha587.TString>;
976
- userRealm: alepha587.TOptional<alepha587.TString>;
977
- userEmail: alepha587.TOptional<alepha587.TString>;
978
- resourceType: alepha587.TOptional<alepha587.TString>;
979
- resourceId: alepha587.TOptional<alepha587.TString>;
980
- description: alepha587.TOptional<alepha587.TString>;
981
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
982
- ipAddress: alepha587.TOptional<alepha587.TString>;
983
- userAgent: alepha587.TOptional<alepha587.TString>;
984
- sessionId: alepha587.TOptional<alepha587.TString>;
985
- requestId: alepha587.TOptional<alepha587.TString>;
986
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
987
- errorMessage: alepha587.TOptional<alepha587.TString>;
856
+ successRate: alepha381.TNumber;
857
+ recentFailures: alepha381.TArray<alepha381.TObject<{
858
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
859
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
860
+ type: alepha381.TString;
861
+ action: alepha381.TString;
862
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
863
+ userId: alepha381.TOptional<alepha381.TString>;
864
+ userRealm: alepha381.TOptional<alepha381.TString>;
865
+ userEmail: alepha381.TOptional<alepha381.TString>;
866
+ resourceType: alepha381.TOptional<alepha381.TString>;
867
+ resourceId: alepha381.TOptional<alepha381.TString>;
868
+ description: alepha381.TOptional<alepha381.TString>;
869
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
870
+ ipAddress: alepha381.TOptional<alepha381.TString>;
871
+ userAgent: alepha381.TOptional<alepha381.TString>;
872
+ sessionId: alepha381.TOptional<alepha381.TString>;
873
+ requestId: alepha381.TOptional<alepha381.TString>;
874
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
875
+ errorMessage: alepha381.TOptional<alepha381.TString>;
988
876
  }>>;
989
877
  }>;
990
878
  }>;
991
879
  /**
992
- * Get registered audit types.
993
- */
880
+ * Get registered audit types.
881
+ */
994
882
  readonly getTypes: alepha_server0.ActionPrimitiveFn<{
995
- response: alepha587.TArray<alepha587.TObject<{
996
- type: alepha587.TString;
997
- description: alepha587.TOptional<alepha587.TString>;
998
- actions: alepha587.TArray<alepha587.TString>;
883
+ response: alepha381.TArray<alepha381.TObject<{
884
+ type: alepha381.TString;
885
+ description: alepha381.TOptional<alepha381.TString>;
886
+ actions: alepha381.TArray<alepha381.TString>;
999
887
  }>>;
1000
888
  }>;
1001
889
  /**
1002
- * Get distinct values for filters.
1003
- */
890
+ * Get distinct values for filters.
891
+ */
1004
892
  readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
1005
- response: alepha587.TObject<{
1006
- types: alepha587.TArray<alepha587.TString>;
1007
- actions: alepha587.TArray<alepha587.TString>;
1008
- resourceTypes: alepha587.TArray<alepha587.TString>;
1009
- userRealms: alepha587.TArray<alepha587.TString>;
893
+ response: alepha381.TObject<{
894
+ types: alepha381.TArray<alepha381.TString>;
895
+ actions: alepha381.TArray<alepha381.TString>;
896
+ resourceTypes: alepha381.TArray<alepha381.TString>;
897
+ userRealms: alepha381.TArray<alepha381.TString>;
1010
898
  }>;
1011
899
  }>;
1012
900
  }
@@ -1017,16 +905,16 @@ declare class AdminAuditController {
1017
905
  */
1018
906
  interface AuditPrimitiveOptions {
1019
907
  /**
1020
- * Unique audit type identifier (e.g., "auth", "payment", "order").
1021
- */
908
+ * Unique audit type identifier (e.g., "auth", "payment", "order").
909
+ */
1022
910
  type: string;
1023
911
  /**
1024
- * Human-readable description of this audit type.
1025
- */
912
+ * Human-readable description of this audit type.
913
+ */
1026
914
  description?: string;
1027
915
  /**
1028
- * List of allowed actions for this audit type.
1029
- */
916
+ * List of allowed actions for this audit type.
917
+ */
1030
918
  actions: string[];
1031
919
  }
1032
920
  /**
@@ -1058,32 +946,32 @@ interface AuditPrimitiveOptions {
1058
946
  declare class AuditPrimitive extends Primitive<AuditPrimitiveOptions> {
1059
947
  protected readonly auditService: AuditService;
1060
948
  /**
1061
- * The audit type identifier.
1062
- */
949
+ * The audit type identifier.
950
+ */
1063
951
  get type(): string;
1064
952
  /**
1065
- * The audit type description.
1066
- */
953
+ * The audit type description.
954
+ */
1067
955
  get description(): string | undefined;
1068
956
  /**
1069
- * The allowed actions for this audit type.
1070
- */
957
+ * The allowed actions for this audit type.
958
+ */
1071
959
  get actions(): string[];
1072
960
  /**
1073
- * Log an audit event for this type.
1074
- */
961
+ * Log an audit event for this type.
962
+ */
1075
963
  log(action: string, options?: AuditLogOptions): Promise<void>;
1076
964
  /**
1077
- * Log a successful audit event.
1078
- */
965
+ * Log a successful audit event.
966
+ */
1079
967
  logSuccess(action: string, options?: Omit<AuditLogOptions, "success">): Promise<void>;
1080
968
  /**
1081
- * Log a failed audit event.
1082
- */
969
+ * Log a failed audit event.
970
+ */
1083
971
  logFailure(action: string, errorMessage: string, options?: Omit<AuditLogOptions, "success" | "errorMessage">): Promise<void>;
1084
972
  /**
1085
- * Called during initialization to register this audit type.
1086
- */
973
+ * Called during initialization to register this audit type.
974
+ */
1087
975
  protected onInit(): void;
1088
976
  }
1089
977
  /**
@@ -1128,25 +1016,25 @@ declare const $audit: {
1128
1016
  /**
1129
1017
  * Resource schema for audit log responses.
1130
1018
  */
1131
- declare const auditResourceSchema: alepha587.TObject<{
1132
- id: PgAttr<PgAttr<alepha587.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1133
- createdAt: PgAttr<PgAttr<alepha587.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1134
- type: alepha587.TString;
1135
- action: alepha587.TString;
1136
- severity: PgAttr<alepha587.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
1137
- userId: alepha587.TOptional<alepha587.TString>;
1138
- userRealm: alepha587.TOptional<alepha587.TString>;
1139
- userEmail: alepha587.TOptional<alepha587.TString>;
1140
- resourceType: alepha587.TOptional<alepha587.TString>;
1141
- resourceId: alepha587.TOptional<alepha587.TString>;
1142
- description: alepha587.TOptional<alepha587.TString>;
1143
- metadata: alepha587.TOptional<alepha587.TRecord<string, alepha587.TAny>>;
1144
- ipAddress: alepha587.TOptional<alepha587.TString>;
1145
- userAgent: alepha587.TOptional<alepha587.TString>;
1146
- sessionId: alepha587.TOptional<alepha587.TString>;
1147
- requestId: alepha587.TOptional<alepha587.TString>;
1148
- success: PgAttr<alepha587.TBoolean, typeof PG_DEFAULT>;
1149
- errorMessage: alepha587.TOptional<alepha587.TString>;
1019
+ declare const auditResourceSchema: alepha381.TObject<{
1020
+ id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1021
+ createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1022
+ type: alepha381.TString;
1023
+ action: alepha381.TString;
1024
+ severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
1025
+ userId: alepha381.TOptional<alepha381.TString>;
1026
+ userRealm: alepha381.TOptional<alepha381.TString>;
1027
+ userEmail: alepha381.TOptional<alepha381.TString>;
1028
+ resourceType: alepha381.TOptional<alepha381.TString>;
1029
+ resourceId: alepha381.TOptional<alepha381.TString>;
1030
+ description: alepha381.TOptional<alepha381.TString>;
1031
+ metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
1032
+ ipAddress: alepha381.TOptional<alepha381.TString>;
1033
+ userAgent: alepha381.TOptional<alepha381.TString>;
1034
+ sessionId: alepha381.TOptional<alepha381.TString>;
1035
+ requestId: alepha381.TOptional<alepha381.TString>;
1036
+ success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
1037
+ errorMessage: alepha381.TOptional<alepha381.TString>;
1150
1038
  }>;
1151
1039
  type AuditResource = Static<typeof auditResourceSchema>;
1152
1040
  //#endregion
@@ -1189,7 +1077,7 @@ type AuditResource = Static<typeof auditResourceSchema>;
1189
1077
  * }
1190
1078
  * ```
1191
1079
  */
1192
- declare const AlephaApiAudits: alepha587.Service<alepha587.Module>;
1080
+ declare const AlephaApiAudits: alepha381.Service<alepha381.Module>;
1193
1081
  //#endregion
1194
1082
  export { $audit, AdminAuditController, AlephaApiAudits, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
1195
1083
  //# sourceMappingURL=index.d.ts.map