alepha 0.14.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/README.md +2 -5
  2. package/dist/api/audits/index.d.ts +620 -811
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/files/index.d.ts +185 -377
  5. package/dist/api/files/index.d.ts.map +1 -1
  6. package/dist/api/files/index.js +0 -1
  7. package/dist/api/files/index.js.map +1 -1
  8. package/dist/api/jobs/index.d.ts +245 -435
  9. package/dist/api/jobs/index.d.ts.map +1 -1
  10. package/dist/api/notifications/index.d.ts +238 -429
  11. package/dist/api/notifications/index.d.ts.map +1 -1
  12. package/dist/api/parameters/index.d.ts +236 -427
  13. package/dist/api/parameters/index.d.ts.map +1 -1
  14. package/dist/api/users/index.browser.js +1 -2
  15. package/dist/api/users/index.browser.js.map +1 -1
  16. package/dist/api/users/index.d.ts +1010 -1196
  17. package/dist/api/users/index.d.ts.map +1 -1
  18. package/dist/api/users/index.js +178 -151
  19. package/dist/api/users/index.js.map +1 -1
  20. package/dist/api/verifications/index.d.ts +17 -17
  21. package/dist/api/verifications/index.d.ts.map +1 -1
  22. package/dist/batch/index.d.ts +122 -122
  23. package/dist/batch/index.d.ts.map +1 -1
  24. package/dist/batch/index.js +1 -2
  25. package/dist/batch/index.js.map +1 -1
  26. package/dist/bucket/index.d.ts +163 -163
  27. package/dist/bucket/index.d.ts.map +1 -1
  28. package/dist/cache/core/index.d.ts +46 -46
  29. package/dist/cache/core/index.d.ts.map +1 -1
  30. package/dist/cache/redis/index.d.ts.map +1 -1
  31. package/dist/cli/index.d.ts +384 -285
  32. package/dist/cli/index.d.ts.map +1 -1
  33. package/dist/cli/index.js +1113 -623
  34. package/dist/cli/index.js.map +1 -1
  35. package/dist/command/index.d.ts +299 -300
  36. package/dist/command/index.d.ts.map +1 -1
  37. package/dist/command/index.js +13 -9
  38. package/dist/command/index.js.map +1 -1
  39. package/dist/core/index.browser.js +445 -103
  40. package/dist/core/index.browser.js.map +1 -1
  41. package/dist/core/index.d.ts +733 -625
  42. package/dist/core/index.d.ts.map +1 -1
  43. package/dist/core/index.js +446 -103
  44. package/dist/core/index.js.map +1 -1
  45. package/dist/core/index.native.js +445 -103
  46. package/dist/core/index.native.js.map +1 -1
  47. package/dist/datetime/index.d.ts +44 -44
  48. package/dist/datetime/index.d.ts.map +1 -1
  49. package/dist/datetime/index.js +4 -4
  50. package/dist/datetime/index.js.map +1 -1
  51. package/dist/email/index.d.ts +97 -50
  52. package/dist/email/index.d.ts.map +1 -1
  53. package/dist/email/index.js +129 -33
  54. package/dist/email/index.js.map +1 -1
  55. package/dist/fake/index.d.ts +7981 -14
  56. package/dist/fake/index.d.ts.map +1 -1
  57. package/dist/file/index.d.ts +523 -390
  58. package/dist/file/index.d.ts.map +1 -1
  59. package/dist/file/index.js +253 -1
  60. package/dist/file/index.js.map +1 -1
  61. package/dist/lock/core/index.d.ts +208 -208
  62. package/dist/lock/core/index.d.ts.map +1 -1
  63. package/dist/lock/redis/index.d.ts.map +1 -1
  64. package/dist/logger/index.d.ts +25 -26
  65. package/dist/logger/index.d.ts.map +1 -1
  66. package/dist/logger/index.js +12 -2
  67. package/dist/logger/index.js.map +1 -1
  68. package/dist/mcp/index.d.ts +197 -197
  69. package/dist/mcp/index.d.ts.map +1 -1
  70. package/dist/mcp/index.js +1 -1
  71. package/dist/mcp/index.js.map +1 -1
  72. package/dist/orm/chunk-DtkW-qnP.js +38 -0
  73. package/dist/orm/index.browser.js.map +1 -1
  74. package/dist/orm/index.bun.js +2814 -0
  75. package/dist/orm/index.bun.js.map +1 -0
  76. package/dist/orm/index.d.ts +1228 -1216
  77. package/dist/orm/index.d.ts.map +1 -1
  78. package/dist/orm/index.js +2041 -1967
  79. package/dist/orm/index.js.map +1 -1
  80. package/dist/queue/core/index.d.ts +248 -248
  81. package/dist/queue/core/index.d.ts.map +1 -1
  82. package/dist/queue/redis/index.d.ts.map +1 -1
  83. package/dist/redis/index.bun.js +285 -0
  84. package/dist/redis/index.bun.js.map +1 -0
  85. package/dist/redis/index.d.ts +118 -136
  86. package/dist/redis/index.d.ts.map +1 -1
  87. package/dist/redis/index.js +18 -38
  88. package/dist/redis/index.js.map +1 -1
  89. package/dist/retry/index.d.ts +69 -69
  90. package/dist/retry/index.d.ts.map +1 -1
  91. package/dist/router/index.d.ts +6 -6
  92. package/dist/router/index.d.ts.map +1 -1
  93. package/dist/scheduler/index.d.ts +25 -25
  94. package/dist/scheduler/index.d.ts.map +1 -1
  95. package/dist/security/index.browser.js +5 -1
  96. package/dist/security/index.browser.js.map +1 -1
  97. package/dist/security/index.d.ts +417 -254
  98. package/dist/security/index.d.ts.map +1 -1
  99. package/dist/security/index.js +386 -86
  100. package/dist/security/index.js.map +1 -1
  101. package/dist/server/auth/index.d.ts +110 -110
  102. package/dist/server/auth/index.d.ts.map +1 -1
  103. package/dist/server/auth/index.js +20 -20
  104. package/dist/server/auth/index.js.map +1 -1
  105. package/dist/server/cache/index.d.ts +62 -47
  106. package/dist/server/cache/index.d.ts.map +1 -1
  107. package/dist/server/cache/index.js +56 -3
  108. package/dist/server/cache/index.js.map +1 -1
  109. package/dist/server/compress/index.d.ts +6 -0
  110. package/dist/server/compress/index.d.ts.map +1 -1
  111. package/dist/server/compress/index.js +36 -1
  112. package/dist/server/compress/index.js.map +1 -1
  113. package/dist/server/cookies/index.d.ts +6 -6
  114. package/dist/server/cookies/index.d.ts.map +1 -1
  115. package/dist/server/cookies/index.js +3 -3
  116. package/dist/server/cookies/index.js.map +1 -1
  117. package/dist/server/core/index.browser.js +2 -2
  118. package/dist/server/core/index.browser.js.map +1 -1
  119. package/dist/server/core/index.d.ts +242 -150
  120. package/dist/server/core/index.d.ts.map +1 -1
  121. package/dist/server/core/index.js +294 -125
  122. package/dist/server/core/index.js.map +1 -1
  123. package/dist/server/cors/index.d.ts +11 -12
  124. package/dist/server/cors/index.d.ts.map +1 -1
  125. package/dist/server/health/index.d.ts +0 -1
  126. package/dist/server/health/index.d.ts.map +1 -1
  127. package/dist/server/helmet/index.d.ts +2 -2
  128. package/dist/server/helmet/index.d.ts.map +1 -1
  129. package/dist/server/links/index.browser.js.map +1 -1
  130. package/dist/server/links/index.d.ts +123 -124
  131. package/dist/server/links/index.d.ts.map +1 -1
  132. package/dist/server/links/index.js +1 -2
  133. package/dist/server/links/index.js.map +1 -1
  134. package/dist/server/metrics/index.d.ts.map +1 -1
  135. package/dist/server/multipart/index.d.ts +6 -6
  136. package/dist/server/multipart/index.d.ts.map +1 -1
  137. package/dist/server/proxy/index.d.ts +102 -103
  138. package/dist/server/proxy/index.d.ts.map +1 -1
  139. package/dist/server/rate-limit/index.d.ts +16 -16
  140. package/dist/server/rate-limit/index.d.ts.map +1 -1
  141. package/dist/server/static/index.d.ts +44 -44
  142. package/dist/server/static/index.d.ts.map +1 -1
  143. package/dist/server/static/index.js +4 -0
  144. package/dist/server/static/index.js.map +1 -1
  145. package/dist/server/swagger/index.d.ts +48 -49
  146. package/dist/server/swagger/index.d.ts.map +1 -1
  147. package/dist/server/swagger/index.js +3 -5
  148. package/dist/server/swagger/index.js.map +1 -1
  149. package/dist/sms/index.d.ts +13 -11
  150. package/dist/sms/index.d.ts.map +1 -1
  151. package/dist/sms/index.js +7 -7
  152. package/dist/sms/index.js.map +1 -1
  153. package/dist/thread/index.d.ts +71 -72
  154. package/dist/thread/index.d.ts.map +1 -1
  155. package/dist/topic/core/index.d.ts +318 -318
  156. package/dist/topic/core/index.d.ts.map +1 -1
  157. package/dist/topic/redis/index.d.ts +6 -6
  158. package/dist/topic/redis/index.d.ts.map +1 -1
  159. package/dist/vite/index.d.ts +5805 -249
  160. package/dist/vite/index.d.ts.map +1 -1
  161. package/dist/vite/index.js +599 -513
  162. package/dist/vite/index.js.map +1 -1
  163. package/dist/websocket/index.browser.js +6 -6
  164. package/dist/websocket/index.browser.js.map +1 -1
  165. package/dist/websocket/index.d.ts +247 -247
  166. package/dist/websocket/index.d.ts.map +1 -1
  167. package/dist/websocket/index.js +6 -6
  168. package/dist/websocket/index.js.map +1 -1
  169. package/package.json +9 -14
  170. package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
  171. package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
  172. package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
  173. package/src/api/users/entities/users.ts +1 -1
  174. package/src/api/users/index.ts +8 -8
  175. package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
  176. package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
  177. package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
  178. package/src/api/users/services/CredentialService.ts +7 -7
  179. package/src/api/users/services/IdentityService.ts +4 -4
  180. package/src/api/users/services/RegistrationService.spec.ts +25 -27
  181. package/src/api/users/services/RegistrationService.ts +38 -27
  182. package/src/api/users/services/SessionCrudService.ts +3 -3
  183. package/src/api/users/services/SessionService.spec.ts +3 -3
  184. package/src/api/users/services/SessionService.ts +28 -9
  185. package/src/api/users/services/UserService.ts +7 -7
  186. package/src/batch/providers/BatchProvider.ts +1 -2
  187. package/src/cli/apps/AlephaCli.ts +0 -2
  188. package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
  189. package/src/cli/assets/apiHelloControllerTs.ts +18 -0
  190. package/src/cli/assets/apiIndexTs.ts +16 -0
  191. package/src/cli/assets/claudeMd.ts +303 -0
  192. package/src/cli/assets/mainBrowserTs.ts +2 -2
  193. package/src/cli/assets/mainServerTs.ts +24 -0
  194. package/src/cli/assets/webAppRouterTs.ts +15 -0
  195. package/src/cli/assets/webHelloComponentTsx.ts +16 -0
  196. package/src/cli/assets/webIndexTs.ts +16 -0
  197. package/src/cli/atoms/buildOptions.ts +88 -0
  198. package/src/cli/commands/build.ts +70 -87
  199. package/src/cli/commands/db.ts +21 -22
  200. package/src/cli/commands/deploy.ts +17 -5
  201. package/src/cli/commands/dev.ts +22 -14
  202. package/src/cli/commands/format.ts +8 -2
  203. package/src/cli/commands/gen/env.ts +53 -0
  204. package/src/cli/commands/gen/openapi.ts +1 -1
  205. package/src/cli/commands/gen/resource.ts +15 -0
  206. package/src/cli/commands/gen.ts +7 -1
  207. package/src/cli/commands/init.ts +74 -30
  208. package/src/cli/commands/lint.ts +8 -2
  209. package/src/cli/commands/test.ts +8 -3
  210. package/src/cli/commands/typecheck.ts +5 -1
  211. package/src/cli/commands/verify.ts +5 -3
  212. package/src/cli/defineConfig.ts +49 -7
  213. package/src/cli/index.ts +0 -1
  214. package/src/cli/services/AlephaCliUtils.ts +39 -589
  215. package/src/cli/services/PackageManagerUtils.ts +301 -0
  216. package/src/cli/services/ProjectScaffolder.ts +306 -0
  217. package/src/command/helpers/Runner.spec.ts +2 -2
  218. package/src/command/helpers/Runner.ts +16 -4
  219. package/src/command/primitives/$command.ts +0 -6
  220. package/src/command/providers/CliProvider.ts +1 -3
  221. package/src/core/Alepha.ts +42 -0
  222. package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
  223. package/src/core/index.shared.ts +1 -0
  224. package/src/core/index.ts +2 -0
  225. package/src/core/primitives/$hook.ts +6 -2
  226. package/src/core/primitives/$module.spec.ts +4 -0
  227. package/src/core/providers/AlsProvider.ts +1 -1
  228. package/src/core/providers/CodecManager.spec.ts +12 -6
  229. package/src/core/providers/CodecManager.ts +26 -6
  230. package/src/core/providers/EventManager.ts +169 -13
  231. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
  232. package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
  233. package/src/core/providers/StateManager.spec.ts +27 -16
  234. package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
  235. package/src/email/providers/LocalEmailProvider.ts +52 -15
  236. package/src/email/providers/NodemailerEmailProvider.ts +167 -56
  237. package/src/file/errors/FileError.ts +7 -0
  238. package/src/file/index.ts +9 -1
  239. package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
  240. package/src/logger/index.ts +15 -3
  241. package/src/mcp/transports/StdioMcpTransport.ts +1 -1
  242. package/src/orm/index.browser.ts +1 -19
  243. package/src/orm/index.bun.ts +77 -0
  244. package/src/orm/index.shared-server.ts +22 -0
  245. package/src/orm/index.shared.ts +15 -0
  246. package/src/orm/index.ts +13 -39
  247. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
  248. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  249. package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
  250. package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
  251. package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
  252. package/src/orm/services/Repository.ts +8 -0
  253. package/src/queue/core/providers/WorkerProvider.spec.ts +48 -32
  254. package/src/redis/index.bun.ts +35 -0
  255. package/src/redis/providers/BunRedisProvider.ts +12 -43
  256. package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
  257. package/src/redis/providers/NodeRedisProvider.ts +16 -34
  258. package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
  259. package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
  260. package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
  261. package/src/security/index.browser.ts +5 -0
  262. package/src/security/index.ts +90 -7
  263. package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
  264. package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
  265. package/src/security/primitives/$role.ts +5 -5
  266. package/src/security/primitives/$serviceAccount.spec.ts +5 -5
  267. package/src/security/primitives/$serviceAccount.ts +3 -3
  268. package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
  269. package/src/server/auth/primitives/$auth.ts +10 -10
  270. package/src/server/auth/primitives/$authCredentials.ts +3 -3
  271. package/src/server/auth/primitives/$authGithub.ts +3 -3
  272. package/src/server/auth/primitives/$authGoogle.ts +3 -3
  273. package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
  274. package/src/server/cache/providers/ServerCacheProvider.spec.ts +183 -0
  275. package/src/server/cache/providers/ServerCacheProvider.ts +95 -10
  276. package/src/server/compress/providers/ServerCompressProvider.ts +61 -2
  277. package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
  278. package/src/server/core/helpers/ServerReply.ts +2 -2
  279. package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
  280. package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
  281. package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
  282. package/src/server/core/providers/ServerProvider.ts +155 -22
  283. package/src/server/core/providers/ServerRouterProvider.ts +259 -115
  284. package/src/server/core/providers/ServerTimingProvider.ts +2 -2
  285. package/src/server/links/index.ts +1 -1
  286. package/src/server/links/providers/LinkProvider.ts +1 -1
  287. package/src/server/static/providers/ServerStaticProvider.ts +10 -0
  288. package/src/server/swagger/index.ts +1 -1
  289. package/src/server/swagger/providers/ServerSwaggerProvider.ts +5 -8
  290. package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
  291. package/src/sms/providers/LocalSmsProvider.ts +8 -7
  292. package/src/vite/helpers/boot.ts +28 -17
  293. package/src/vite/helpers/importViteReact.ts +13 -0
  294. package/src/vite/index.ts +1 -21
  295. package/src/vite/plugins/viteAlephaDev.ts +16 -1
  296. package/src/vite/plugins/viteAlephaSsrPreload.ts +222 -0
  297. package/src/vite/tasks/buildClient.ts +11 -0
  298. package/src/vite/tasks/buildServer.ts +59 -4
  299. package/src/vite/tasks/devServer.ts +71 -0
  300. package/src/vite/tasks/generateCloudflare.ts +7 -0
  301. package/src/vite/tasks/index.ts +2 -1
  302. package/dist/server/security/index.browser.js +0 -13
  303. package/dist/server/security/index.browser.js.map +0 -1
  304. package/dist/server/security/index.d.ts +0 -173
  305. package/dist/server/security/index.d.ts.map +0 -1
  306. package/dist/server/security/index.js +0 -311
  307. package/dist/server/security/index.js.map +0 -1
  308. package/src/cli/assets/appRouterTs.ts +0 -9
  309. package/src/cli/assets/mainTs.ts +0 -13
  310. package/src/cli/assets/viteConfigTs.ts +0 -14
  311. package/src/cli/commands/run.ts +0 -24
  312. package/src/server/security/index.browser.ts +0 -10
  313. package/src/server/security/index.ts +0 -94
  314. package/src/vite/plugins/viteAlepha.ts +0 -37
  315. package/src/vite/plugins/viteAlephaBuild.ts +0 -281
  316. /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
  317. /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
@@ -1,22 +1,16 @@
1
- import * as alepha225 from "alepha";
1
+ import * as alepha151 from "alepha";
2
2
  import { Alepha, Async, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
3
  import * as alepha_server0 from "alepha/server";
4
- import * as alepha_orm33 from "alepha/orm";
4
+ import * as alepha_orm16 from "alepha/orm";
5
5
  import "alepha/logger";
6
6
  import { DateTime, DateTimeProvider } from "alepha/datetime";
7
7
  import { LockPrimitive } from "alepha/lock";
8
8
  import { CronProvider } from "alepha/scheduler";
9
- import "bun";
10
- import "bun:sqlite";
11
- import "drizzle-orm/bun-sql";
12
- import "drizzle-orm/bun-sqlite";
13
9
  import "drizzle-orm/d1";
14
10
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
15
11
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
16
12
  import "alepha/retry";
17
13
  import "drizzle-orm/sqlite-core";
18
- import "drizzle-orm/postgres-js";
19
- import "postgres";
20
14
 
21
15
  //#region ../../src/orm/schemas/insertSchema.d.ts
22
16
  /**
@@ -48,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
48
42
  //#region ../../src/orm/primitives/$entity.d.ts
49
43
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
50
44
  /**
51
- * The database table name that will be created for this entity.
52
- * If not provided, name will be inferred from the $repository variable name.
53
- */
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
+ */
54
48
  name: string;
55
49
  /**
56
- * TypeBox schema defining the table structure and column types.
57
- */
50
+ * TypeBox schema defining the table structure and column types.
51
+ */
58
52
  schema: T;
59
53
  /**
60
- * Database indexes to create for query optimization.
61
- */
54
+ * Database indexes to create for query optimization.
55
+ */
62
56
  indexes?: (Keys | {
63
57
  /**
64
- * Single column to index.
65
- */
58
+ * Single column to index.
59
+ */
66
60
  column: Keys;
67
61
  /**
68
- * Whether this should be a unique index (enforces uniqueness constraint).
69
- */
62
+ * Whether this should be a unique index (enforces uniqueness constraint).
63
+ */
70
64
  unique?: boolean;
71
65
  /**
72
- * Custom name for the index. If not provided, generates name automatically.
73
- */
66
+ * Custom name for the index. If not provided, generates name automatically.
67
+ */
74
68
  name?: string;
75
69
  } | {
76
70
  /**
77
- * Multiple columns for composite index (order matters for query optimization).
78
- */
71
+ * Multiple columns for composite index (order matters for query optimization).
72
+ */
79
73
  columns: Keys[];
80
74
  /**
81
- * Whether this should be a unique index (enforces uniqueness constraint).
82
- */
75
+ * Whether this should be a unique index (enforces uniqueness constraint).
76
+ */
83
77
  unique?: boolean;
84
78
  /**
85
- * Custom name for the index. If not provided, generates name automatically.
86
- */
79
+ * Custom name for the index. If not provided, generates name automatically.
80
+ */
87
81
  name?: string;
88
82
  })[];
89
83
  /**
90
- * Foreign key constraints to maintain referential integrity.
91
- */
84
+ * Foreign key constraints to maintain referential integrity.
85
+ */
92
86
  foreignKeys?: Array<{
93
87
  /**
94
- * Optional name for the foreign key constraint.
95
- */
88
+ * Optional name for the foreign key constraint.
89
+ */
96
90
  name?: string;
97
91
  /**
98
- * Local columns that reference the foreign table.
99
- */
92
+ * Local columns that reference the foreign table.
93
+ */
100
94
  columns: Array<keyof Static<T>>;
101
95
  /**
102
- * Referenced columns in the foreign table.
103
- * Must be EntityColumn references from other entities.
104
- */
96
+ * Referenced columns in the foreign table.
97
+ * Must be EntityColumn references from other entities.
98
+ */
105
99
  foreignColumns: Array<() => EntityColumn<any>>;
106
100
  }>;
107
101
  /**
108
- * Additional table constraints for data validation.
109
- *
110
- * Constraints enforce business rules at the database level, providing
111
- * an additional layer of data integrity beyond application validation.
112
- *
113
- * **Constraint Types**:
114
- * - **Unique constraints**: Prevent duplicate values across columns
115
- * - **Check constraints**: Enforce custom validation rules with SQL expressions
116
- *
117
- * @example
118
- * ```ts
119
- * constraints: [
120
- * {
121
- * name: "unique_user_email",
122
- * columns: ["email"],
123
- * unique: true
124
- * },
125
- * {
126
- * name: "valid_age_range",
127
- * columns: ["age"],
128
- * check: sql`age >= 0 AND age <= 150`
129
- * },
130
- * {
131
- * name: "unique_user_username_per_tenant",
132
- * columns: ["tenantId", "username"],
133
- * unique: true
134
- * }
135
- * ]
136
- * ```
137
- */
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
+ */
138
132
  constraints?: Array<{
139
133
  /**
140
- * Columns involved in this constraint.
141
- */
134
+ * Columns involved in this constraint.
135
+ */
142
136
  columns: Array<keyof Static<T>>;
143
137
  /**
144
- * Optional name for the constraint.
145
- */
138
+ * Optional name for the constraint.
139
+ */
146
140
  name?: string;
147
141
  /**
148
- * Whether this is a unique constraint.
149
- */
142
+ * Whether this is a unique constraint.
143
+ */
150
144
  unique?: boolean | {};
151
145
  /**
152
- * SQL expression for check constraint validation.
153
- */
146
+ * SQL expression for check constraint validation.
147
+ */
154
148
  check?: SQL;
155
149
  }>;
156
150
  /**
157
- * Advanced Drizzle ORM configuration for complex table setups.
158
- */
151
+ * Advanced Drizzle ORM configuration for complex table setups.
152
+ */
159
153
  config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
160
154
  }
161
155
  declare class EntityPrimitive<T extends TObject = TObject> {
@@ -203,8 +197,8 @@ type PgSymbols = {
203
197
  [PG_REF]: PgRefOptions;
204
198
  [PG_ENUM]: PgEnumOptions;
205
199
  /**
206
- * @deprecated Use `PG_IDENTITY` instead.
207
- */
200
+ * @deprecated Use `PG_IDENTITY` instead.
201
+ */
208
202
  [PG_SERIAL]: {};
209
203
  };
210
204
  type PgSymbolKeys = keyof PgSymbols;
@@ -234,261 +228,77 @@ interface PgRefOptions {
234
228
  */
235
229
  type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
236
230
  //#endregion
237
- //#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
238
- declare module "alepha" {
239
- interface Env extends Partial<Static<typeof envSchema$2>> {}
240
- }
241
- declare const envSchema$2: alepha225.TObject<{
242
- /**
243
- * Main configuration for database connection.
244
- * Accept a string in the format of a Postgres connection URL.
245
- * Example: postgres://user:password@localhost:5432/database
246
- * or
247
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
248
- */
249
- DATABASE_URL: alepha225.TOptional<alepha225.TString>;
250
- /**
251
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
252
- */
253
- POSTGRES_SCHEMA: alepha225.TOptional<alepha225.TString>;
254
- }>;
255
- /**
256
- * Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
257
- *
258
- * This provider uses Bun's built-in SQL class for PostgreSQL connections,
259
- * which provides excellent performance on the Bun runtime.
260
- *
261
- * @example
262
- * ```ts
263
- * // Set DATABASE_URL environment variable
264
- * // DATABASE_URL=postgres://user:password@localhost:5432/database
265
- *
266
- * // Or configure programmatically
267
- * alepha.with({
268
- * provide: DatabaseProvider,
269
- * use: BunPostgresProvider,
270
- * });
271
- * ```
272
- */
273
- //#endregion
274
- //#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
275
- /**
276
- * Configuration options for the Bun SQLite database provider.
277
- */
278
- declare const bunSqliteOptions: alepha225.Atom<alepha225.TObject<{
279
- path: alepha225.TOptional<alepha225.TString>;
280
- }>, "alepha.postgres.bun-sqlite.options">;
281
- type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
282
- declare module "alepha" {
283
- interface State {
284
- [bunSqliteOptions.key]: BunSqliteProviderOptions;
285
- }
286
- }
287
- /**
288
- * Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
289
- *
290
- * This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
291
- * which provides excellent performance on the Bun runtime.
292
- *
293
- * @example
294
- * ```ts
295
- * // Set DATABASE_URL environment variable
296
- * // DATABASE_URL=sqlite://./my-database.db
297
- *
298
- * // Or configure programmatically
299
- * alepha.with({
300
- * provide: DatabaseProvider,
301
- * use: BunSqliteProvider,
302
- * });
303
- *
304
- * // Or use options atom
305
- * alepha.store.mut(bunSqliteOptions, (old) => ({
306
- * ...old,
307
- * path: ":memory:",
308
- * }));
309
- * ```
310
- */
311
- //#endregion
312
- //#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
313
- declare module "alepha" {
314
- interface Env extends Partial<Static<typeof envSchema$1>> {}
315
- }
316
- declare const envSchema$1: alepha225.TObject<{
317
- /**
318
- * Main configuration for database connection.
319
- * Accept a string in the format of a Postgres connection URL.
320
- * Example: postgres://user:password@localhost:5432/database
321
- * or
322
- * Example: postgres://user:password@localhost:5432/database?sslmode=require
323
- */
324
- DATABASE_URL: alepha225.TOptional<alepha225.TString>;
325
- /**
326
- * In addition to the DATABASE_URL, you can specify the postgres schema name.
327
- *
328
- * It will monkey patch drizzle tables.
329
- */
330
- POSTGRES_SCHEMA: alepha225.TOptional<alepha225.TString>;
331
- }>;
332
- //#endregion
333
- //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
334
- /**
335
- * Configuration options for the Node.js SQLite database provider.
336
- */
337
- declare const nodeSqliteOptions: alepha225.Atom<alepha225.TObject<{
338
- path: alepha225.TOptional<alepha225.TString>;
339
- }>, "alepha.postgres.node-sqlite.options">;
340
- type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
341
- declare module "alepha" {
342
- interface State {
343
- [nodeSqliteOptions.key]: NodeSqliteProviderOptions;
344
- }
345
- }
346
- /**
347
- * Add a fake support for SQLite in Node.js based on Postgres interfaces.
348
- *
349
- * This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
350
- * This is NOT recommended for production use.
351
- */
352
- //#endregion
353
- //#region ../../src/orm/index.d.ts
354
- declare module "alepha" {
355
- interface Hooks {
356
- /**
357
- * Fires before creating an entity in the repository.
358
- */
359
- "repository:create:before": {
360
- tableName: string;
361
- data: any;
362
- };
363
- /**
364
- * Fires after creating an entity in the repository.
365
- */
366
- "repository:create:after": {
367
- tableName: string;
368
- data: any;
369
- entity: any;
370
- };
371
- /**
372
- * Fires before updating entities in the repository.
373
- */
374
- "repository:update:before": {
375
- tableName: string;
376
- where: any;
377
- data: any;
378
- };
379
- /**
380
- * Fires after updating entities in the repository.
381
- */
382
- "repository:update:after": {
383
- tableName: string;
384
- where: any;
385
- data: any;
386
- entities: any[];
387
- };
388
- /**
389
- * Fires before deleting entities from the repository.
390
- */
391
- "repository:delete:before": {
392
- tableName: string;
393
- where: any;
394
- };
395
- /**
396
- * Fires after deleting entities from the repository.
397
- */
398
- "repository:delete:after": {
399
- tableName: string;
400
- where: any;
401
- ids: Array<string | number>;
402
- };
403
- /**
404
- * Fires before reading entities from the repository.
405
- */
406
- "repository:read:before": {
407
- tableName: string;
408
- query: any;
409
- };
410
- /**
411
- * Fires after reading entities from the repository.
412
- */
413
- "repository:read:after": {
414
- tableName: string;
415
- query: any;
416
- entities: any[];
417
- };
418
- }
419
- }
420
- //#endregion
421
231
  //#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.d.ts
422
- declare const jobExecutionQuerySchema: alepha225.TObject<{
423
- page: alepha225.TOptional<alepha225.TInteger>;
424
- size: alepha225.TOptional<alepha225.TInteger>;
425
- sort: alepha225.TOptional<alepha225.TString>;
426
- status: alepha225.TOptional<alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
427
- job: alepha225.TOptional<alepha225.TString>;
232
+ declare const jobExecutionQuerySchema: alepha151.TObject<{
233
+ page: alepha151.TOptional<alepha151.TInteger>;
234
+ size: alepha151.TOptional<alepha151.TInteger>;
235
+ sort: alepha151.TOptional<alepha151.TString>;
236
+ status: alepha151.TOptional<alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
237
+ job: alepha151.TOptional<alepha151.TString>;
428
238
  }>;
429
239
  type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
430
240
  //#endregion
431
241
  //#region ../../src/api/jobs/services/JobService.d.ts
432
242
  declare class JobService {
433
243
  protected readonly alepha: Alepha;
434
- protected readonly executionRepository: alepha_orm33.Repository<alepha225.TObject<{
435
- id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
436
- version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
437
- createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
438
- updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
439
- finishedAt: alepha225.TOptional<alepha225.TString>;
440
- job: alepha225.TString;
441
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
442
- error: alepha225.TOptional<alepha225.TString>;
443
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
444
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
445
- message: alepha225.TString;
446
- service: alepha225.TString;
447
- module: alepha225.TString;
448
- context: alepha225.TOptional<alepha225.TString>;
449
- app: alepha225.TOptional<alepha225.TString>;
450
- data: alepha225.TOptional<alepha225.TAny>;
451
- timestamp: alepha225.TNumber;
244
+ protected readonly executionRepository: alepha_orm16.Repository<alepha151.TObject<{
245
+ id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
246
+ version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
247
+ createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
248
+ updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
249
+ finishedAt: alepha151.TOptional<alepha151.TString>;
250
+ job: alepha151.TString;
251
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
252
+ error: alepha151.TOptional<alepha151.TString>;
253
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
254
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
255
+ message: alepha151.TString;
256
+ service: alepha151.TString;
257
+ module: alepha151.TString;
258
+ context: alepha151.TOptional<alepha151.TString>;
259
+ app: alepha151.TOptional<alepha151.TString>;
260
+ data: alepha151.TOptional<alepha151.TAny>;
261
+ timestamp: alepha151.TNumber;
452
262
  }>>>;
453
263
  }>>;
454
264
  getJobs(): Promise<string[]>;
455
- getJobExecutions(query?: JobExecutionQuery): Promise<alepha225.Page<alepha_orm33.PgStatic<alepha225.TObject<{
456
- id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
457
- version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
458
- createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
459
- updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
460
- finishedAt: alepha225.TOptional<alepha225.TString>;
461
- job: alepha225.TString;
462
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
463
- error: alepha225.TOptional<alepha225.TString>;
464
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
465
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
466
- message: alepha225.TString;
467
- service: alepha225.TString;
468
- module: alepha225.TString;
469
- context: alepha225.TOptional<alepha225.TString>;
470
- app: alepha225.TOptional<alepha225.TString>;
471
- data: alepha225.TOptional<alepha225.TAny>;
472
- timestamp: alepha225.TNumber;
265
+ getJobExecutions(query?: JobExecutionQuery): Promise<alepha151.Page<alepha_orm16.PgStatic<alepha151.TObject<{
266
+ id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
267
+ version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
268
+ createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
269
+ updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
270
+ finishedAt: alepha151.TOptional<alepha151.TString>;
271
+ job: alepha151.TString;
272
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
273
+ error: alepha151.TOptional<alepha151.TString>;
274
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
275
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
276
+ message: alepha151.TString;
277
+ service: alepha151.TString;
278
+ module: alepha151.TString;
279
+ context: alepha151.TOptional<alepha151.TString>;
280
+ app: alepha151.TOptional<alepha151.TString>;
281
+ data: alepha151.TOptional<alepha151.TAny>;
282
+ timestamp: alepha151.TNumber;
473
283
  }>>>;
474
- }>, alepha_orm33.PgRelationMap<alepha225.TObject<{
475
- id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
476
- version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
477
- createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
478
- updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
479
- finishedAt: alepha225.TOptional<alepha225.TString>;
480
- job: alepha225.TString;
481
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
482
- error: alepha225.TOptional<alepha225.TString>;
483
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
484
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
485
- message: alepha225.TString;
486
- service: alepha225.TString;
487
- module: alepha225.TString;
488
- context: alepha225.TOptional<alepha225.TString>;
489
- app: alepha225.TOptional<alepha225.TString>;
490
- data: alepha225.TOptional<alepha225.TAny>;
491
- timestamp: alepha225.TNumber;
284
+ }>, alepha_orm16.PgRelationMap<alepha151.TObject<{
285
+ id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
286
+ version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
287
+ createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
288
+ updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
289
+ finishedAt: alepha151.TOptional<alepha151.TString>;
290
+ job: alepha151.TString;
291
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
292
+ error: alepha151.TOptional<alepha151.TString>;
293
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
294
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
295
+ message: alepha151.TString;
296
+ service: alepha151.TString;
297
+ module: alepha151.TString;
298
+ context: alepha151.TOptional<alepha151.TString>;
299
+ app: alepha151.TOptional<alepha151.TString>;
300
+ data: alepha151.TOptional<alepha151.TAny>;
301
+ timestamp: alepha151.TNumber;
492
302
  }>>>;
493
303
  }>>>>>;
494
304
  triggerJob(name: string): Promise<{
@@ -502,75 +312,75 @@ declare class AdminJobController {
502
312
  protected readonly group: string;
503
313
  protected readonly jobService: JobService;
504
314
  readonly getJobs: alepha_server0.ActionPrimitiveFn<{
505
- response: alepha225.TArray<alepha225.TString>;
315
+ response: alepha151.TArray<alepha151.TString>;
506
316
  }>;
507
317
  readonly getJobExecutions: alepha_server0.ActionPrimitiveFn<{
508
- query: alepha225.TObject<{
509
- page: alepha225.TOptional<alepha225.TInteger>;
510
- size: alepha225.TOptional<alepha225.TInteger>;
511
- sort: alepha225.TOptional<alepha225.TString>;
512
- status: alepha225.TOptional<alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
513
- job: alepha225.TOptional<alepha225.TString>;
318
+ query: alepha151.TObject<{
319
+ page: alepha151.TOptional<alepha151.TInteger>;
320
+ size: alepha151.TOptional<alepha151.TInteger>;
321
+ sort: alepha151.TOptional<alepha151.TString>;
322
+ status: alepha151.TOptional<alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
323
+ job: alepha151.TOptional<alepha151.TString>;
514
324
  }>;
515
- response: alepha225.TPage<alepha225.TObject<{
516
- id: PgAttr<PgAttr<alepha225.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
517
- version: PgAttr<PgAttr<alepha225.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
518
- createdAt: PgAttr<PgAttr<alepha225.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
519
- updatedAt: PgAttr<PgAttr<alepha225.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
520
- finishedAt: alepha225.TOptional<alepha225.TString>;
521
- job: alepha225.TString;
522
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
523
- error: alepha225.TOptional<alepha225.TString>;
524
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
525
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
526
- message: alepha225.TString;
527
- service: alepha225.TString;
528
- module: alepha225.TString;
529
- context: alepha225.TOptional<alepha225.TString>;
530
- app: alepha225.TOptional<alepha225.TString>;
531
- data: alepha225.TOptional<alepha225.TAny>;
532
- timestamp: alepha225.TNumber;
325
+ response: alepha151.TPage<alepha151.TObject<{
326
+ id: PgAttr<PgAttr<alepha151.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
327
+ version: PgAttr<PgAttr<alepha151.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
328
+ createdAt: PgAttr<PgAttr<alepha151.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
329
+ updatedAt: PgAttr<PgAttr<alepha151.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
330
+ finishedAt: alepha151.TOptional<alepha151.TString>;
331
+ job: alepha151.TString;
332
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
333
+ error: alepha151.TOptional<alepha151.TString>;
334
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
335
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
336
+ message: alepha151.TString;
337
+ service: alepha151.TString;
338
+ module: alepha151.TString;
339
+ context: alepha151.TOptional<alepha151.TString>;
340
+ app: alepha151.TOptional<alepha151.TString>;
341
+ data: alepha151.TOptional<alepha151.TAny>;
342
+ timestamp: alepha151.TNumber;
533
343
  }>>>;
534
344
  }>>;
535
345
  }>;
536
346
  readonly triggerJob: alepha_server0.ActionPrimitiveFn<{
537
- body: alepha225.TObject<{
538
- name: alepha225.TString;
347
+ body: alepha151.TObject<{
348
+ name: alepha151.TString;
539
349
  }>;
540
- response: alepha225.TObject<{
541
- ok: alepha225.TBoolean;
542
- id: alepha225.TOptional<alepha225.TUnion<[alepha225.TString, alepha225.TInteger]>>;
543
- count: alepha225.TOptional<alepha225.TNumber>;
350
+ response: alepha151.TObject<{
351
+ ok: alepha151.TBoolean;
352
+ id: alepha151.TOptional<alepha151.TUnion<[alepha151.TString, alepha151.TInteger]>>;
353
+ count: alepha151.TOptional<alepha151.TNumber>;
544
354
  }>;
545
355
  }>;
546
356
  }
547
357
  //#endregion
548
358
  //#region ../../src/api/jobs/entities/jobExecutions.d.ts
549
- declare const jobExecutions: alepha_orm33.EntityPrimitive<alepha225.TObject<{
550
- id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
551
- version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
552
- createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
553
- updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
554
- finishedAt: alepha225.TOptional<alepha225.TString>;
555
- job: alepha225.TString;
556
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
557
- error: alepha225.TOptional<alepha225.TString>;
558
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
559
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
560
- message: alepha225.TString;
561
- service: alepha225.TString;
562
- module: alepha225.TString;
563
- context: alepha225.TOptional<alepha225.TString>;
564
- app: alepha225.TOptional<alepha225.TString>;
565
- data: alepha225.TOptional<alepha225.TAny>;
566
- timestamp: alepha225.TNumber;
359
+ declare const jobExecutions: alepha_orm16.EntityPrimitive<alepha151.TObject<{
360
+ id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
361
+ version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
362
+ createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
363
+ updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
364
+ finishedAt: alepha151.TOptional<alepha151.TString>;
365
+ job: alepha151.TString;
366
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
367
+ error: alepha151.TOptional<alepha151.TString>;
368
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
369
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
370
+ message: alepha151.TString;
371
+ service: alepha151.TString;
372
+ module: alepha151.TString;
373
+ context: alepha151.TOptional<alepha151.TString>;
374
+ app: alepha151.TOptional<alepha151.TString>;
375
+ data: alepha151.TOptional<alepha151.TAny>;
376
+ timestamp: alepha151.TNumber;
567
377
  }>>>;
568
378
  }>>;
569
379
  type JobExecutionEntity = Static<typeof jobExecutions.schema>;
570
380
  //#endregion
571
381
  //#region ../../src/api/jobs/providers/JobProvider.d.ts
572
- declare const envSchema: alepha225.TObject<{
573
- JOB_PREFIX: alepha225.TOptional<alepha225.TString>;
382
+ declare const envSchema: alepha151.TObject<{
383
+ JOB_PREFIX: alepha151.TOptional<alepha151.TString>;
574
384
  }>;
575
385
  declare module "alepha" {
576
386
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -583,24 +393,24 @@ declare class JobProvider {
583
393
  protected readonly alepha: Alepha;
584
394
  protected readonly dateTimeProvider: DateTimeProvider;
585
395
  protected readonly cronProvider: CronProvider;
586
- protected readonly executionRepository: alepha_orm33.Repository<alepha225.TObject<{
587
- id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
588
- version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
589
- createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
590
- updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
591
- finishedAt: alepha225.TOptional<alepha225.TString>;
592
- job: alepha225.TString;
593
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
594
- error: alepha225.TOptional<alepha225.TString>;
595
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
596
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
597
- message: alepha225.TString;
598
- service: alepha225.TString;
599
- module: alepha225.TString;
600
- context: alepha225.TOptional<alepha225.TString>;
601
- app: alepha225.TOptional<alepha225.TString>;
602
- data: alepha225.TOptional<alepha225.TAny>;
603
- timestamp: alepha225.TNumber;
396
+ protected readonly executionRepository: alepha_orm16.Repository<alepha151.TObject<{
397
+ id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
398
+ version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
399
+ createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
400
+ updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
401
+ finishedAt: alepha151.TOptional<alepha151.TString>;
402
+ job: alepha151.TString;
403
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
404
+ error: alepha151.TOptional<alepha151.TString>;
405
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
406
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
407
+ message: alepha151.TString;
408
+ service: alepha151.TString;
409
+ module: alepha151.TString;
410
+ context: alepha151.TOptional<alepha151.TString>;
411
+ app: alepha151.TOptional<alepha151.TString>;
412
+ data: alepha151.TOptional<alepha151.TAny>;
413
+ timestamp: alepha151.TNumber;
604
414
  }>>>;
605
415
  }>>;
606
416
  protected readonly env: {
@@ -618,49 +428,49 @@ declare class JobProvider {
618
428
  }[]>;
619
429
  protected readonly jobs: Map<string, JobRegistration>;
620
430
  /**
621
- * Register and set up a job for execution (called during primitive initialization).
622
- */
431
+ * Register and set up a job for execution (called during primitive initialization).
432
+ */
623
433
  registerJob(options: Job): JobRegistration;
624
434
  /**
625
- * Trigger a job by name.
626
- */
435
+ * Trigger a job by name.
436
+ */
627
437
  triggerJob(jobName: string): Promise<void>;
628
438
  /**
629
- * Execute a job handler (called by the job primitive).
630
- */
439
+ * Execute a job handler (called by the job primitive).
440
+ */
631
441
  executeJob(jobName: string, handler: (args: {
632
442
  now: DateTime;
633
443
  }) => Async<void>): Promise<void>;
634
444
  }
635
445
  interface Job {
636
446
  /**
637
- * Name of the job.
638
- */
447
+ * Name of the job.
448
+ */
639
449
  name: string;
640
450
  /**
641
- * Optional description of the job.
642
- */
451
+ * Optional description of the job.
452
+ */
643
453
  description?: string;
644
454
  /**
645
- * Function to run on schedule.
646
- */
455
+ * Function to run on schedule.
456
+ */
647
457
  handler: (args: {
648
458
  now: DateTime;
649
459
  }) => Async<void>;
650
460
  /**
651
- * Cron expression to run the job.
652
- */
461
+ * Cron expression to run the job.
462
+ */
653
463
  cron?: string;
654
464
  /**
655
- * If true, the job will be locked and only one instance will run at a time.
656
- * You probably need to import {@link AlephaLockRedis} for distributed locking.
657
- *
658
- * @default true
659
- */
465
+ * If true, the job will be locked and only one instance will run at a time.
466
+ * You probably need to import {@link AlephaLockRedis} for distributed locking.
467
+ *
468
+ * @default true
469
+ */
660
470
  lock?: boolean;
661
471
  /**
662
- * Optional prefix for job lock keys.
663
- */
472
+ * Optional prefix for job lock keys.
473
+ */
664
474
  lockPrefix?: string;
665
475
  }
666
476
  interface JobRegistration {
@@ -679,8 +489,8 @@ declare const $job: {
679
489
  };
680
490
  type JobPrimitiveOptions = Omit<Job, "name"> & {
681
491
  /**
682
- * Name of the job. Defaults to the primitive property name.
683
- */
492
+ * Name of the job. Defaults to the primitive property name.
493
+ */
684
494
  name?: string;
685
495
  };
686
496
  declare class JobPrimitive extends Primitive<JobPrimitiveOptions> {
@@ -694,31 +504,31 @@ interface JobHandlerArguments {
694
504
  }
695
505
  //#endregion
696
506
  //#region ../../src/api/jobs/schemas/jobExecutionResourceSchema.d.ts
697
- declare const jobExecutionResourceSchema: alepha225.TObject<{
698
- id: PgAttr<PgAttr<alepha225.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
699
- version: PgAttr<PgAttr<alepha225.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
700
- createdAt: PgAttr<PgAttr<alepha225.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
701
- updatedAt: PgAttr<PgAttr<alepha225.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
702
- finishedAt: alepha225.TOptional<alepha225.TString>;
703
- job: alepha225.TString;
704
- status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
705
- error: alepha225.TOptional<alepha225.TString>;
706
- logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
707
- level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
708
- message: alepha225.TString;
709
- service: alepha225.TString;
710
- module: alepha225.TString;
711
- context: alepha225.TOptional<alepha225.TString>;
712
- app: alepha225.TOptional<alepha225.TString>;
713
- data: alepha225.TOptional<alepha225.TAny>;
714
- timestamp: alepha225.TNumber;
507
+ declare const jobExecutionResourceSchema: alepha151.TObject<{
508
+ id: PgAttr<PgAttr<alepha151.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
509
+ version: PgAttr<PgAttr<alepha151.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
510
+ createdAt: PgAttr<PgAttr<alepha151.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
511
+ updatedAt: PgAttr<PgAttr<alepha151.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
512
+ finishedAt: alepha151.TOptional<alepha151.TString>;
513
+ job: alepha151.TString;
514
+ status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
515
+ error: alepha151.TOptional<alepha151.TString>;
516
+ logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
517
+ level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
518
+ message: alepha151.TString;
519
+ service: alepha151.TString;
520
+ module: alepha151.TString;
521
+ context: alepha151.TOptional<alepha151.TString>;
522
+ app: alepha151.TOptional<alepha151.TString>;
523
+ data: alepha151.TOptional<alepha151.TAny>;
524
+ timestamp: alepha151.TNumber;
715
525
  }>>>;
716
526
  }>;
717
527
  type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
718
528
  //#endregion
719
529
  //#region ../../src/api/jobs/schemas/triggerJobSchema.d.ts
720
- declare const triggerJobSchema: alepha225.TObject<{
721
- name: alepha225.TString;
530
+ declare const triggerJobSchema: alepha151.TObject<{
531
+ name: alepha151.TString;
722
532
  }>;
723
533
  type TriggerJob = Static<typeof triggerJobSchema>;
724
534
  //#endregion
@@ -731,7 +541,7 @@ type TriggerJob = Static<typeof triggerJobSchema>;
731
541
  *
732
542
  * @module alepha.api.jobs
733
543
  */
734
- declare const AlephaApiJobs: alepha225.Service<alepha225.Module>;
544
+ declare const AlephaApiJobs: alepha151.Service<alepha151.Module>;
735
545
  //#endregion
736
546
  export { $job, AdminJobController, AlephaApiJobs, Job, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobPrimitive, JobPrimitiveOptions, JobProvider, JobRegistration, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
737
547
  //# sourceMappingURL=index.d.ts.map