alepha 0.13.7 → 0.14.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 (512) hide show
  1. package/README.md +5 -2
  2. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  3. package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
  4. package/assets/swagger-ui/swagger-ui.css +1 -1
  5. package/dist/{api-audits → api/audits}/index.browser.js +4 -4
  6. package/dist/api/audits/index.browser.js.map +1 -0
  7. package/dist/{api-audits → api/audits}/index.d.ts +10 -9
  8. package/dist/api/audits/index.d.ts.map +1 -0
  9. package/dist/{api-audits → api/audits}/index.js +8 -8
  10. package/dist/api/audits/index.js.map +1 -0
  11. package/dist/{api-files → api/files}/index.browser.js +5 -5
  12. package/dist/api/files/index.browser.js.map +1 -0
  13. package/dist/{api-files → api/files}/index.d.ts +18 -10
  14. package/dist/api/files/index.d.ts.map +1 -0
  15. package/dist/{api-files → api/files}/index.js +10 -10
  16. package/dist/api/files/index.js.map +1 -0
  17. package/dist/{api-jobs → api/jobs}/index.browser.js +5 -5
  18. package/dist/api/jobs/index.browser.js.map +1 -0
  19. package/dist/{api-jobs → api/jobs}/index.d.ts +168 -167
  20. package/dist/api/jobs/index.d.ts.map +1 -0
  21. package/dist/{api-jobs → api/jobs}/index.js +9 -9
  22. package/dist/api/jobs/index.js.map +1 -0
  23. package/dist/{api-notifications → api/notifications}/index.browser.js +11 -11
  24. package/dist/api/notifications/index.browser.js.map +1 -0
  25. package/dist/api/notifications/index.d.ts +327 -0
  26. package/dist/api/notifications/index.d.ts.map +1 -0
  27. package/dist/{api-notifications → api/notifications}/index.js +11 -11
  28. package/dist/api/notifications/index.js.map +1 -0
  29. package/dist/{api-parameters → api/parameters}/index.browser.js +2 -2
  30. package/dist/api/parameters/index.browser.js.map +1 -0
  31. package/dist/{api-parameters → api/parameters}/index.d.ts +11 -11
  32. package/dist/api/parameters/index.d.ts.map +1 -0
  33. package/dist/{api-parameters → api/parameters}/index.js +7 -7
  34. package/dist/api/parameters/index.js.map +1 -0
  35. package/dist/{api-users → api/users}/index.browser.js +6 -6
  36. package/dist/api/users/index.browser.js.map +1 -0
  37. package/dist/{api-users → api/users}/index.d.ts +836 -836
  38. package/dist/api/users/index.d.ts.map +1 -0
  39. package/dist/{api-users → api/users}/index.js +99 -766
  40. package/dist/api/users/index.js.map +1 -0
  41. package/dist/{api-verifications → api/verifications}/index.browser.js +5 -5
  42. package/dist/api/verifications/index.browser.js.map +1 -0
  43. package/dist/api/verifications/index.d.ts +248 -0
  44. package/dist/api/verifications/index.d.ts.map +1 -0
  45. package/dist/{api-verifications → api/verifications}/index.js +11 -11
  46. package/dist/api/verifications/index.js.map +1 -0
  47. package/dist/batch/index.d.ts.map +1 -0
  48. package/dist/bucket/index.d.ts.map +1 -0
  49. package/dist/cache/{index.d.ts → core/index.d.ts} +4 -4
  50. package/dist/cache/core/index.d.ts.map +1 -0
  51. package/dist/cache/{index.js → core/index.js} +5 -5
  52. package/dist/cache/core/index.js.map +1 -0
  53. package/dist/{cache-redis → cache/redis}/index.d.ts +2 -2
  54. package/dist/cache/redis/index.d.ts.map +1 -0
  55. package/dist/{cache-redis → cache/redis}/index.js +2 -2
  56. package/dist/cache/redis/index.js.map +1 -0
  57. package/dist/cli/index.d.ts +78 -58
  58. package/dist/cli/index.d.ts.map +1 -0
  59. package/dist/cli/index.js +454 -154
  60. package/dist/cli/index.js.map +1 -1
  61. package/dist/command/index.d.ts +15 -5
  62. package/dist/command/index.d.ts.map +1 -0
  63. package/dist/command/index.js +45 -6
  64. package/dist/command/index.js.map +1 -1
  65. package/dist/core/index.browser.js +1334 -1318
  66. package/dist/core/index.browser.js.map +1 -1
  67. package/dist/core/index.d.ts +75 -71
  68. package/dist/core/index.d.ts.map +1 -0
  69. package/dist/core/index.js +1337 -1321
  70. package/dist/core/index.js.map +1 -1
  71. package/dist/core/index.native.js +1337 -1321
  72. package/dist/core/index.native.js.map +1 -1
  73. package/dist/datetime/index.d.ts.map +1 -0
  74. package/dist/email/index.d.ts.map +1 -0
  75. package/dist/fake/index.d.ts.map +1 -0
  76. package/dist/file/index.d.ts.map +1 -0
  77. package/dist/lock/{index.d.ts → core/index.d.ts} +5 -5
  78. package/dist/lock/core/index.d.ts.map +1 -0
  79. package/dist/lock/{index.js → core/index.js} +5 -5
  80. package/dist/lock/core/index.js.map +1 -0
  81. package/dist/{lock-redis → lock/redis}/index.d.ts +2 -2
  82. package/dist/lock/redis/index.d.ts.map +1 -0
  83. package/dist/{lock-redis → lock/redis}/index.js +2 -2
  84. package/dist/lock/redis/index.js.map +1 -0
  85. package/dist/logger/index.d.ts +1 -0
  86. package/dist/logger/index.d.ts.map +1 -0
  87. package/dist/mcp/index.d.ts +820 -0
  88. package/dist/mcp/index.d.ts.map +1 -0
  89. package/dist/mcp/index.js +978 -0
  90. package/dist/mcp/index.js.map +1 -0
  91. package/dist/orm/index.d.ts +180 -107
  92. package/dist/orm/index.d.ts.map +1 -0
  93. package/dist/orm/index.js +260 -174
  94. package/dist/orm/index.js.map +1 -1
  95. package/dist/queue/core/index.d.ts +548 -0
  96. package/dist/queue/core/index.d.ts.map +1 -0
  97. package/dist/queue/core/index.js +391 -0
  98. package/dist/queue/core/index.js.map +1 -0
  99. package/dist/queue/redis/index.d.ts +28 -0
  100. package/dist/queue/redis/index.d.ts.map +1 -0
  101. package/dist/queue/redis/index.js +43 -0
  102. package/dist/queue/redis/index.js.map +1 -0
  103. package/dist/redis/index.d.ts.map +1 -0
  104. package/dist/retry/index.d.ts.map +1 -0
  105. package/dist/router/index.d.ts.map +1 -0
  106. package/dist/scheduler/index.d.ts +1 -1
  107. package/dist/scheduler/index.d.ts.map +1 -0
  108. package/dist/scheduler/index.js +1 -393
  109. package/dist/scheduler/index.js.map +1 -1
  110. package/dist/security/index.d.ts +1 -1
  111. package/dist/security/index.d.ts.map +1 -0
  112. package/dist/security/index.js +2 -1413
  113. package/dist/security/index.js.map +1 -1
  114. package/dist/{server-auth → server/auth}/index.browser.js +6 -6
  115. package/dist/server/auth/index.browser.js.map +1 -0
  116. package/dist/{server-auth → server/auth}/index.d.ts +167 -167
  117. package/dist/server/auth/index.d.ts.map +1 -0
  118. package/dist/server/auth/index.js +742 -0
  119. package/dist/server/auth/index.js.map +1 -0
  120. package/dist/{server-cache → server/cache}/index.d.ts +2 -2
  121. package/dist/server/cache/index.d.ts.map +1 -0
  122. package/dist/{server-cache → server/cache}/index.js +2 -2
  123. package/dist/server/cache/index.js.map +1 -0
  124. package/dist/{server-compress → server/compress}/index.d.ts +2 -2
  125. package/dist/server/compress/index.d.ts.map +1 -0
  126. package/dist/{server-compress → server/compress}/index.js +2 -2
  127. package/dist/server/compress/index.js.map +1 -0
  128. package/dist/{server-cookies → server/cookies}/index.browser.js +3 -3
  129. package/dist/server/cookies/index.browser.js.map +1 -0
  130. package/dist/{server-cookies → server/cookies}/index.d.ts +4 -4
  131. package/dist/server/cookies/index.d.ts.map +1 -0
  132. package/dist/{server-cookies → server/cookies}/index.js +4 -4
  133. package/dist/server/cookies/index.js.map +1 -0
  134. package/dist/server/{index.browser.js → core/index.browser.js} +14 -14
  135. package/dist/server/core/index.browser.js.map +1 -0
  136. package/dist/server/{index.d.ts → core/index.d.ts} +36 -36
  137. package/dist/server/core/index.d.ts.map +1 -0
  138. package/dist/server/{index.js → core/index.js} +27 -27
  139. package/dist/server/core/index.js.map +1 -0
  140. package/dist/{server-cors → server/cors}/index.d.ts +3 -3
  141. package/dist/server/cors/index.d.ts.map +1 -0
  142. package/dist/{server-cors → server/cors}/index.js +3 -3
  143. package/dist/server/cors/index.js.map +1 -0
  144. package/dist/{server-health → server/health}/index.d.ts +3 -3
  145. package/dist/server/health/index.d.ts.map +1 -0
  146. package/dist/{server-health → server/health}/index.js +3 -3
  147. package/dist/server/health/index.js.map +1 -0
  148. package/dist/{server-helmet → server/helmet}/index.d.ts +2 -2
  149. package/dist/server/helmet/index.d.ts.map +1 -0
  150. package/dist/{server-helmet → server/helmet}/index.js +2 -2
  151. package/dist/server/helmet/index.js.map +1 -0
  152. package/dist/{server-links → server/links}/index.browser.js +5 -5
  153. package/dist/server/links/index.browser.js.map +1 -0
  154. package/dist/{server-links → server/links}/index.d.ts +40 -40
  155. package/dist/server/links/index.d.ts.map +1 -0
  156. package/dist/{server-links → server/links}/index.js +7 -7
  157. package/dist/server/links/index.js.map +1 -0
  158. package/dist/{server-metrics → server/metrics}/index.d.ts +2 -2
  159. package/dist/server/metrics/index.d.ts.map +1 -0
  160. package/dist/server/metrics/index.js +74 -0
  161. package/dist/server/metrics/index.js.map +1 -0
  162. package/dist/{server-multipart → server/multipart}/index.d.ts +2 -2
  163. package/dist/server/multipart/index.d.ts.map +1 -0
  164. package/dist/{server-multipart → server/multipart}/index.js +2 -2
  165. package/dist/server/multipart/index.js.map +1 -0
  166. package/dist/{server-proxy → server/proxy}/index.d.ts +3 -3
  167. package/dist/server/proxy/index.d.ts.map +1 -0
  168. package/dist/{server-proxy → server/proxy}/index.js +3 -3
  169. package/dist/server/proxy/index.js.map +1 -0
  170. package/dist/{server-rate-limit → server/rate-limit}/index.d.ts +4 -4
  171. package/dist/server/rate-limit/index.d.ts.map +1 -0
  172. package/dist/{server-rate-limit → server/rate-limit}/index.js +4 -4
  173. package/dist/server/rate-limit/index.js.map +1 -0
  174. package/dist/{server-security → server/security}/index.browser.js +1 -1
  175. package/dist/server/security/index.browser.js.map +1 -0
  176. package/dist/{server-security → server/security}/index.d.ts +4 -4
  177. package/dist/server/security/index.d.ts.map +1 -0
  178. package/dist/{server-security → server/security}/index.js +4 -4
  179. package/dist/server/security/index.js.map +1 -0
  180. package/dist/{server-static → server/static}/index.d.ts +3 -3
  181. package/dist/server/static/index.d.ts.map +1 -0
  182. package/dist/{server-static → server/static}/index.js +3 -3
  183. package/dist/server/static/index.js.map +1 -0
  184. package/dist/{server-swagger → server/swagger}/index.d.ts +3 -3
  185. package/dist/server/swagger/index.d.ts.map +1 -0
  186. package/dist/{server-swagger → server/swagger}/index.js +4 -4
  187. package/dist/server/swagger/index.js.map +1 -0
  188. package/dist/sms/index.d.ts.map +1 -0
  189. package/dist/thread/index.d.ts.map +1 -0
  190. package/dist/topic/{index.d.ts → core/index.d.ts} +6 -6
  191. package/dist/topic/core/index.d.ts.map +1 -0
  192. package/dist/topic/{index.js → core/index.js} +6 -6
  193. package/dist/topic/core/index.js.map +1 -0
  194. package/dist/{topic-redis → topic/redis}/index.d.ts +2 -2
  195. package/dist/topic/redis/index.d.ts.map +1 -0
  196. package/dist/{topic-redis → topic/redis}/index.js +2 -2
  197. package/dist/topic/redis/index.js.map +1 -0
  198. package/dist/vite/index.d.ts +21 -2
  199. package/dist/vite/index.d.ts.map +1 -0
  200. package/dist/vite/index.js +48 -19
  201. package/dist/vite/index.js.map +1 -1
  202. package/dist/websocket/index.d.ts.map +1 -0
  203. package/package.json +162 -158
  204. package/src/{api-files → api/files}/index.ts +1 -0
  205. package/src/{api-parameters → api/parameters}/index.ts +1 -1
  206. package/src/{api-users → api/users}/primitives/$userRealm.ts +1 -1
  207. package/src/{api-users → api/users}/providers/UserRealmProvider.ts +6 -7
  208. package/src/{api-verifications → api/verifications}/index.ts +2 -0
  209. package/src/cli/apps/AlephaCli.ts +2 -0
  210. package/src/cli/apps/AlephaPackageBuilderCli.ts +83 -54
  211. package/src/cli/assets/appRouterTs.ts +1 -1
  212. package/src/cli/assets/biomeJson.ts +1 -1
  213. package/src/cli/assets/indexHtml.ts +1 -1
  214. package/src/cli/assets/mainBrowserTs.ts +1 -1
  215. package/src/cli/assets/mainTs.ts +9 -10
  216. package/src/cli/assets/viteConfigTs.ts +1 -1
  217. package/src/cli/commands/ChangelogCommands.ts +389 -0
  218. package/src/cli/commands/CoreCommands.ts +10 -6
  219. package/src/cli/commands/DrizzleCommands.ts +204 -4
  220. package/src/cli/commands/VerifyCommands.ts +4 -1
  221. package/src/cli/commands/ViteCommands.ts +46 -25
  222. package/src/cli/services/AlephaCliUtils.ts +52 -164
  223. package/src/command/providers/CliProvider.ts +76 -5
  224. package/src/core/providers/SchemaValidator.ts +24 -2
  225. package/src/mcp/errors/McpError.ts +72 -0
  226. package/src/mcp/helpers/jsonrpc.ts +163 -0
  227. package/src/mcp/index.ts +132 -0
  228. package/src/mcp/interfaces/McpTypes.ts +248 -0
  229. package/src/mcp/primitives/$prompt.ts +188 -0
  230. package/src/mcp/primitives/$resource.ts +171 -0
  231. package/src/mcp/primitives/$tool.ts +285 -0
  232. package/src/mcp/providers/McpServerProvider.ts +382 -0
  233. package/src/mcp/transports/SseMcpTransport.ts +172 -0
  234. package/src/mcp/transports/StdioMcpTransport.ts +126 -0
  235. package/src/orm/index.ts +12 -0
  236. package/src/orm/providers/drivers/CloudflareD1Provider.ts +164 -0
  237. package/src/orm/providers/drivers/NodeSqliteProvider.ts +3 -1
  238. package/src/queue/{index.ts → core/index.ts} +2 -3
  239. package/src/queue/{primitives → core/primitives}/$queue.ts +17 -162
  240. package/src/queue/core/providers/MemoryQueueProvider.ts +19 -0
  241. package/src/queue/core/providers/QueueProvider.ts +23 -0
  242. package/src/queue/core/providers/WorkerProvider.ts +244 -0
  243. package/src/queue/redis/providers/RedisQueueProvider.ts +31 -0
  244. package/src/server/{index.ts → core/index.ts} +1 -0
  245. package/src/{server-rate-limit → server/rate-limit}/index.ts +1 -1
  246. package/src/{server-swagger → server/swagger}/providers/ServerSwaggerProvider.ts +1 -0
  247. package/src/vite/plugins/viteAlephaBuild.ts +8 -2
  248. package/src/vite/plugins/viteAlephaDev.ts +6 -2
  249. package/src/vite/tasks/buildServer.ts +1 -1
  250. package/src/vite/tasks/copyAssets.ts +32 -8
  251. package/src/vite/tasks/generateCloudflare.ts +43 -15
  252. package/src/vite/tasks/runAlepha.ts +1 -0
  253. package/dist/api-audits/index.browser.js.map +0 -1
  254. package/dist/api-audits/index.js.map +0 -1
  255. package/dist/api-files/index.browser.js.map +0 -1
  256. package/dist/api-files/index.js.map +0 -1
  257. package/dist/api-jobs/index.browser.js.map +0 -1
  258. package/dist/api-jobs/index.js.map +0 -1
  259. package/dist/api-notifications/index.browser.js.map +0 -1
  260. package/dist/api-notifications/index.d.ts +0 -327
  261. package/dist/api-notifications/index.js.map +0 -1
  262. package/dist/api-parameters/index.browser.js.map +0 -1
  263. package/dist/api-parameters/index.js.map +0 -1
  264. package/dist/api-users/index.browser.js.map +0 -1
  265. package/dist/api-users/index.js.map +0 -1
  266. package/dist/api-verifications/index.browser.js.map +0 -1
  267. package/dist/api-verifications/index.d.ts +0 -229
  268. package/dist/api-verifications/index.js.map +0 -1
  269. package/dist/cache/index.js.map +0 -1
  270. package/dist/cache-redis/index.js.map +0 -1
  271. package/dist/lock/index.js.map +0 -1
  272. package/dist/lock-redis/index.js.map +0 -1
  273. package/dist/queue/index.d.ts +0 -1265
  274. package/dist/queue/index.js +0 -1037
  275. package/dist/queue/index.js.map +0 -1
  276. package/dist/queue-redis/index.d.ts +0 -82
  277. package/dist/queue-redis/index.js +0 -872
  278. package/dist/queue-redis/index.js.map +0 -1
  279. package/dist/server/index.browser.js.map +0 -1
  280. package/dist/server/index.js.map +0 -1
  281. package/dist/server-auth/index.browser.js.map +0 -1
  282. package/dist/server-auth/index.js +0 -1973
  283. package/dist/server-auth/index.js.map +0 -1
  284. package/dist/server-cache/index.js.map +0 -1
  285. package/dist/server-compress/index.js.map +0 -1
  286. package/dist/server-cookies/index.browser.js.map +0 -1
  287. package/dist/server-cookies/index.js.map +0 -1
  288. package/dist/server-cors/index.js.map +0 -1
  289. package/dist/server-health/index.js.map +0 -1
  290. package/dist/server-helmet/index.js.map +0 -1
  291. package/dist/server-links/index.browser.js.map +0 -1
  292. package/dist/server-links/index.js.map +0 -1
  293. package/dist/server-metrics/index.js +0 -4532
  294. package/dist/server-metrics/index.js.map +0 -1
  295. package/dist/server-multipart/index.js.map +0 -1
  296. package/dist/server-proxy/index.js.map +0 -1
  297. package/dist/server-rate-limit/index.js.map +0 -1
  298. package/dist/server-security/index.browser.js.map +0 -1
  299. package/dist/server-security/index.js.map +0 -1
  300. package/dist/server-static/index.js.map +0 -1
  301. package/dist/server-swagger/index.js.map +0 -1
  302. package/dist/topic/index.js.map +0 -1
  303. package/dist/topic-redis/index.js.map +0 -1
  304. package/src/queue/interfaces/QueueJob.ts +0 -459
  305. package/src/queue/providers/MemoryQueueProvider.ts +0 -850
  306. package/src/queue/providers/QueueProvider.ts +0 -319
  307. package/src/queue/providers/WorkerProvider.ts +0 -344
  308. package/src/queue-redis/providers/RedisQueueProvider.ts +0 -1209
  309. /package/src/{api-audits → api/audits}/controllers/AuditController.ts +0 -0
  310. /package/src/{api-audits → api/audits}/entities/audits.ts +0 -0
  311. /package/src/{api-audits → api/audits}/index.browser.ts +0 -0
  312. /package/src/{api-audits → api/audits}/index.ts +0 -0
  313. /package/src/{api-audits → api/audits}/primitives/$audit.ts +0 -0
  314. /package/src/{api-audits → api/audits}/schemas/auditQuerySchema.ts +0 -0
  315. /package/src/{api-audits → api/audits}/schemas/auditResourceSchema.ts +0 -0
  316. /package/src/{api-audits → api/audits}/schemas/createAuditSchema.ts +0 -0
  317. /package/src/{api-audits → api/audits}/services/AuditService.ts +0 -0
  318. /package/src/{api-files → api/files}/controllers/FileController.ts +0 -0
  319. /package/src/{api-files → api/files}/controllers/StorageStatsController.ts +0 -0
  320. /package/src/{api-files → api/files}/entities/files.ts +0 -0
  321. /package/src/{api-files → api/files}/index.browser.ts +0 -0
  322. /package/src/{api-files → api/files}/jobs/FileJobs.ts +0 -0
  323. /package/src/{api-files → api/files}/schemas/fileQuerySchema.ts +0 -0
  324. /package/src/{api-files → api/files}/schemas/fileResourceSchema.ts +0 -0
  325. /package/src/{api-files → api/files}/schemas/storageStatsSchema.ts +0 -0
  326. /package/src/{api-files → api/files}/services/FileService.ts +0 -0
  327. /package/src/{api-jobs → api/jobs}/controllers/JobController.ts +0 -0
  328. /package/src/{api-jobs → api/jobs}/entities/jobExecutions.ts +0 -0
  329. /package/src/{api-jobs → api/jobs}/index.browser.ts +0 -0
  330. /package/src/{api-jobs → api/jobs}/index.ts +0 -0
  331. /package/src/{api-jobs → api/jobs}/primitives/$job.ts +0 -0
  332. /package/src/{api-jobs → api/jobs}/providers/JobProvider.ts +0 -0
  333. /package/src/{api-jobs → api/jobs}/schemas/jobExecutionQuerySchema.ts +0 -0
  334. /package/src/{api-jobs → api/jobs}/schemas/jobExecutionResourceSchema.ts +0 -0
  335. /package/src/{api-jobs → api/jobs}/schemas/triggerJobSchema.ts +0 -0
  336. /package/src/{api-jobs → api/jobs}/services/JobService.ts +0 -0
  337. /package/src/{api-notifications → api/notifications}/controllers/NotificationController.ts +0 -0
  338. /package/src/{api-notifications → api/notifications}/entities/notifications.ts +0 -0
  339. /package/src/{api-notifications → api/notifications}/index.browser.ts +0 -0
  340. /package/src/{api-notifications → api/notifications}/index.ts +0 -0
  341. /package/src/{api-notifications → api/notifications}/jobs/NotificationJobs.ts +0 -0
  342. /package/src/{api-notifications → api/notifications}/primitives/$notification.ts +0 -0
  343. /package/src/{api-notifications → api/notifications}/queues/NotificationQueues.ts +0 -0
  344. /package/src/{api-notifications → api/notifications}/schemas/notificationContactPreferencesSchema.ts +0 -0
  345. /package/src/{api-notifications → api/notifications}/schemas/notificationContactSchema.ts +0 -0
  346. /package/src/{api-notifications → api/notifications}/schemas/notificationCreateSchema.ts +0 -0
  347. /package/src/{api-notifications → api/notifications}/schemas/notificationQuerySchema.ts +0 -0
  348. /package/src/{api-notifications → api/notifications}/services/NotificationSenderService.ts +0 -0
  349. /package/src/{api-notifications → api/notifications}/services/NotificationService.ts +0 -0
  350. /package/src/{api-parameters → api/parameters}/controllers/ConfigController.ts +0 -0
  351. /package/src/{api-parameters → api/parameters}/entities/parameters.ts +0 -0
  352. /package/src/{api-parameters → api/parameters}/index.browser.ts +0 -0
  353. /package/src/{api-parameters → api/parameters}/primitives/$config.ts +0 -0
  354. /package/src/{api-parameters → api/parameters}/schedulers/ConfigActivationScheduler.ts +0 -0
  355. /package/src/{api-parameters → api/parameters}/services/ConfigStore.ts +0 -0
  356. /package/src/{api-users → api/users}/atoms/realmAuthSettingsAtom.ts +0 -0
  357. /package/src/{api-users → api/users}/controllers/IdentityController.ts +0 -0
  358. /package/src/{api-users → api/users}/controllers/SessionController.ts +0 -0
  359. /package/src/{api-users → api/users}/controllers/UserController.ts +0 -0
  360. /package/src/{api-users → api/users}/controllers/UserRealmController.ts +0 -0
  361. /package/src/{api-users → api/users}/entities/identities.ts +0 -0
  362. /package/src/{api-users → api/users}/entities/sessions.ts +0 -0
  363. /package/src/{api-users → api/users}/entities/users.ts +0 -0
  364. /package/src/{api-users → api/users}/index.browser.ts +0 -0
  365. /package/src/{api-users → api/users}/index.ts +0 -0
  366. /package/src/{api-users → api/users}/notifications/UserNotifications.ts +0 -0
  367. /package/src/{api-users → api/users}/schemas/completePasswordResetRequestSchema.ts +0 -0
  368. /package/src/{api-users → api/users}/schemas/completeRegistrationRequestSchema.ts +0 -0
  369. /package/src/{api-users → api/users}/schemas/createUserSchema.ts +0 -0
  370. /package/src/{api-users → api/users}/schemas/identityQuerySchema.ts +0 -0
  371. /package/src/{api-users → api/users}/schemas/identityResourceSchema.ts +0 -0
  372. /package/src/{api-users → api/users}/schemas/loginSchema.ts +0 -0
  373. /package/src/{api-users → api/users}/schemas/passwordResetIntentResponseSchema.ts +0 -0
  374. /package/src/{api-users → api/users}/schemas/registerQuerySchema.ts +0 -0
  375. /package/src/{api-users → api/users}/schemas/registerRequestSchema.ts +0 -0
  376. /package/src/{api-users → api/users}/schemas/registerResponseSchema.ts +0 -0
  377. /package/src/{api-users → api/users}/schemas/registerSchema.ts +0 -0
  378. /package/src/{api-users → api/users}/schemas/registrationIntentResponseSchema.ts +0 -0
  379. /package/src/{api-users → api/users}/schemas/resetPasswordSchema.ts +0 -0
  380. /package/src/{api-users → api/users}/schemas/sessionQuerySchema.ts +0 -0
  381. /package/src/{api-users → api/users}/schemas/sessionResourceSchema.ts +0 -0
  382. /package/src/{api-users → api/users}/schemas/updateUserSchema.ts +0 -0
  383. /package/src/{api-users → api/users}/schemas/userQuerySchema.ts +0 -0
  384. /package/src/{api-users → api/users}/schemas/userRealmConfigSchema.ts +0 -0
  385. /package/src/{api-users → api/users}/schemas/userResourceSchema.ts +0 -0
  386. /package/src/{api-users → api/users}/services/CredentialService.ts +0 -0
  387. /package/src/{api-users → api/users}/services/IdentityService.ts +0 -0
  388. /package/src/{api-users → api/users}/services/RegistrationService.ts +0 -0
  389. /package/src/{api-users → api/users}/services/SessionCrudService.ts +0 -0
  390. /package/src/{api-users → api/users}/services/SessionService.ts +0 -0
  391. /package/src/{api-users → api/users}/services/UserService.ts +0 -0
  392. /package/src/{api-verifications → api/verifications}/controllers/VerificationController.ts +0 -0
  393. /package/src/{api-verifications → api/verifications}/entities/verifications.ts +0 -0
  394. /package/src/{api-verifications → api/verifications}/index.browser.ts +0 -0
  395. /package/src/{api-verifications → api/verifications}/jobs/VerificationJobs.ts +0 -0
  396. /package/src/{api-verifications → api/verifications}/parameters/VerificationParameters.ts +0 -0
  397. /package/src/{api-verifications → api/verifications}/schemas/requestVerificationCodeResponseSchema.ts +0 -0
  398. /package/src/{api-verifications → api/verifications}/schemas/validateVerificationCodeResponseSchema.ts +0 -0
  399. /package/src/{api-verifications → api/verifications}/schemas/verificationSettingsSchema.ts +0 -0
  400. /package/src/{api-verifications → api/verifications}/schemas/verificationTypeEnumSchema.ts +0 -0
  401. /package/src/{api-verifications → api/verifications}/services/VerificationService.ts +0 -0
  402. /package/src/cache/{errors → core/errors}/CacheError.ts +0 -0
  403. /package/src/cache/{index.ts → core/index.ts} +0 -0
  404. /package/src/cache/{primitives → core/primitives}/$cache.ts +0 -0
  405. /package/src/cache/{providers → core/providers}/CacheProvider.ts +0 -0
  406. /package/src/cache/{providers → core/providers}/MemoryCacheProvider.ts +0 -0
  407. /package/src/{cache-redis → cache/redis}/index.ts +0 -0
  408. /package/src/{cache-redis → cache/redis}/providers/RedisCacheProvider.ts +0 -0
  409. /package/src/lock/{index.ts → core/index.ts} +0 -0
  410. /package/src/lock/{primitives → core/primitives}/$lock.ts +0 -0
  411. /package/src/lock/{providers → core/providers}/LockProvider.ts +0 -0
  412. /package/src/lock/{providers → core/providers}/LockTopicProvider.ts +0 -0
  413. /package/src/lock/{providers → core/providers}/MemoryLockProvider.ts +0 -0
  414. /package/src/{lock-redis → lock/redis}/index.ts +0 -0
  415. /package/src/{lock-redis → lock/redis}/providers/RedisLockProvider.ts +0 -0
  416. /package/src/queue/{primitives → core/primitives}/$consumer.ts +0 -0
  417. /package/src/{queue-redis → queue/redis}/index.ts +0 -0
  418. /package/src/{server-auth → server/auth}/constants/routes.ts +0 -0
  419. /package/src/{server-auth → server/auth}/index.browser.ts +0 -0
  420. /package/src/{server-auth → server/auth}/index.shared.ts +0 -0
  421. /package/src/{server-auth → server/auth}/index.ts +0 -0
  422. /package/src/{server-auth → server/auth}/primitives/$auth.ts +0 -0
  423. /package/src/{server-auth → server/auth}/primitives/$authApple.ts +0 -0
  424. /package/src/{server-auth → server/auth}/primitives/$authCredentials.ts +0 -0
  425. /package/src/{server-auth → server/auth}/primitives/$authGithub.ts +0 -0
  426. /package/src/{server-auth → server/auth}/primitives/$authGoogle.ts +0 -0
  427. /package/src/{server-auth → server/auth}/providers/ServerAuthProvider.ts +0 -0
  428. /package/src/{server-auth → server/auth}/schemas/authenticationProviderSchema.ts +0 -0
  429. /package/src/{server-auth → server/auth}/schemas/tokenResponseSchema.ts +0 -0
  430. /package/src/{server-auth → server/auth}/schemas/tokensSchema.ts +0 -0
  431. /package/src/{server-auth → server/auth}/schemas/userinfoResponseSchema.ts +0 -0
  432. /package/src/{server-cache → server/cache}/index.ts +0 -0
  433. /package/src/{server-cache → server/cache}/providers/ServerCacheProvider.ts +0 -0
  434. /package/src/{server-compress → server/compress}/index.ts +0 -0
  435. /package/src/{server-compress → server/compress}/providers/ServerCompressProvider.ts +0 -0
  436. /package/src/{server-cookies → server/cookies}/index.browser.ts +0 -0
  437. /package/src/{server-cookies → server/cookies}/index.ts +0 -0
  438. /package/src/{server-cookies → server/cookies}/primitives/$cookie.browser.ts +0 -0
  439. /package/src/{server-cookies → server/cookies}/primitives/$cookie.ts +0 -0
  440. /package/src/{server-cookies → server/cookies}/providers/ServerCookiesProvider.ts +0 -0
  441. /package/src/{server-cookies → server/cookies}/services/CookieParser.ts +0 -0
  442. /package/src/server/{constants → core/constants}/routeMethods.ts +0 -0
  443. /package/src/server/{errors → core/errors}/BadRequestError.ts +0 -0
  444. /package/src/server/{errors → core/errors}/ConflictError.ts +0 -0
  445. /package/src/server/{errors → core/errors}/ForbiddenError.ts +0 -0
  446. /package/src/server/{errors → core/errors}/HttpError.ts +0 -0
  447. /package/src/server/{errors → core/errors}/NotFoundError.ts +0 -0
  448. /package/src/server/{errors → core/errors}/UnauthorizedError.ts +0 -0
  449. /package/src/server/{errors → core/errors}/ValidationError.ts +0 -0
  450. /package/src/server/{helpers → core/helpers}/ServerReply.ts +0 -0
  451. /package/src/server/{helpers → core/helpers}/isMultipart.ts +0 -0
  452. /package/src/server/{index.browser.ts → core/index.browser.ts} +0 -0
  453. /package/src/server/{index.shared.ts → core/index.shared.ts} +0 -0
  454. /package/src/server/{interfaces → core/interfaces}/ServerRequest.ts +0 -0
  455. /package/src/server/{primitives → core/primitives}/$action.ts +0 -0
  456. /package/src/server/{primitives → core/primitives}/$route.ts +0 -0
  457. /package/src/server/{providers → core/providers}/BunHttpServerProvider.ts +0 -0
  458. /package/src/server/{providers → core/providers}/NodeHttpServerProvider.ts +0 -0
  459. /package/src/server/{providers → core/providers}/ServerBodyParserProvider.ts +0 -0
  460. /package/src/server/{providers → core/providers}/ServerLoggerProvider.ts +0 -0
  461. /package/src/server/{providers → core/providers}/ServerNotReadyProvider.ts +0 -0
  462. /package/src/server/{providers → core/providers}/ServerProvider.ts +0 -0
  463. /package/src/server/{providers → core/providers}/ServerRouterProvider.ts +0 -0
  464. /package/src/server/{providers → core/providers}/ServerTimingProvider.ts +0 -0
  465. /package/src/server/{schemas → core/schemas}/errorSchema.ts +0 -0
  466. /package/src/server/{schemas → core/schemas}/okSchema.ts +0 -0
  467. /package/src/server/{services → core/services}/HttpClient.ts +0 -0
  468. /package/src/server/{services → core/services}/ServerRequestParser.ts +0 -0
  469. /package/src/server/{services → core/services}/UserAgentParser.ts +0 -0
  470. /package/src/{server-cors → server/cors}/index.ts +0 -0
  471. /package/src/{server-cors → server/cors}/primitives/$cors.ts +0 -0
  472. /package/src/{server-cors → server/cors}/providers/ServerCorsProvider.ts +0 -0
  473. /package/src/{server-health → server/health}/index.ts +0 -0
  474. /package/src/{server-health → server/health}/providers/ServerHealthProvider.ts +0 -0
  475. /package/src/{server-health → server/health}/schemas/healthSchema.ts +0 -0
  476. /package/src/{server-helmet → server/helmet}/index.ts +0 -0
  477. /package/src/{server-helmet → server/helmet}/providers/ServerHelmetProvider.ts +0 -0
  478. /package/src/{server-links → server/links}/index.browser.ts +0 -0
  479. /package/src/{server-links → server/links}/index.ts +0 -0
  480. /package/src/{server-links → server/links}/primitives/$client.ts +0 -0
  481. /package/src/{server-links → server/links}/primitives/$remote.ts +0 -0
  482. /package/src/{server-links → server/links}/providers/LinkProvider.ts +0 -0
  483. /package/src/{server-links → server/links}/providers/RemotePrimitiveProvider.ts +0 -0
  484. /package/src/{server-links → server/links}/providers/ServerLinksProvider.ts +0 -0
  485. /package/src/{server-links → server/links}/schemas/apiLinksResponseSchema.ts +0 -0
  486. /package/src/{server-metrics → server/metrics}/index.ts +0 -0
  487. /package/src/{server-metrics → server/metrics}/providers/ServerMetricsProvider.ts +0 -0
  488. /package/src/{server-multipart → server/multipart}/index.ts +0 -0
  489. /package/src/{server-multipart → server/multipart}/providers/ServerMultipartProvider.ts +0 -0
  490. /package/src/{server-proxy → server/proxy}/index.ts +0 -0
  491. /package/src/{server-proxy → server/proxy}/primitives/$proxy.ts +0 -0
  492. /package/src/{server-proxy → server/proxy}/providers/ServerProxyProvider.ts +0 -0
  493. /package/src/{server-rate-limit → server/rate-limit}/primitives/$rateLimit.ts +0 -0
  494. /package/src/{server-rate-limit → server/rate-limit}/providers/ServerRateLimitProvider.ts +0 -0
  495. /package/src/{server-security → server/security}/index.browser.ts +0 -0
  496. /package/src/{server-security → server/security}/index.ts +0 -0
  497. /package/src/{server-security → server/security}/primitives/$basicAuth.ts +0 -0
  498. /package/src/{server-security → server/security}/providers/ServerBasicAuthProvider.ts +0 -0
  499. /package/src/{server-security → server/security}/providers/ServerSecurityProvider.ts +0 -0
  500. /package/src/{server-static → server/static}/index.ts +0 -0
  501. /package/src/{server-static → server/static}/primitives/$serve.ts +0 -0
  502. /package/src/{server-static → server/static}/providers/ServerStaticProvider.ts +0 -0
  503. /package/src/{server-swagger → server/swagger}/index.ts +0 -0
  504. /package/src/{server-swagger → server/swagger}/primitives/$swagger.ts +0 -0
  505. /package/src/topic/{errors → core/errors}/TopicTimeoutError.ts +0 -0
  506. /package/src/topic/{index.ts → core/index.ts} +0 -0
  507. /package/src/topic/{primitives → core/primitives}/$subscriber.ts +0 -0
  508. /package/src/topic/{primitives → core/primitives}/$topic.ts +0 -0
  509. /package/src/topic/{providers → core/providers}/MemoryTopicProvider.ts +0 -0
  510. /package/src/topic/{providers → core/providers}/TopicProvider.ts +0 -0
  511. /package/src/{topic-redis → topic/redis}/index.ts +0 -0
  512. /package/src/{topic-redis → topic/redis}/providers/RedisTopicProvider.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["expirationDate: string | undefined","updateData: Partial<FileEntity>","files"],"sources":["../../../src/api/files/schemas/fileQuerySchema.ts","../../../src/api/files/entities/files.ts","../../../src/api/files/schemas/fileResourceSchema.ts","../../../src/api/files/services/FileService.ts","../../../src/api/files/controllers/FileController.ts","../../../src/api/files/schemas/storageStatsSchema.ts","../../../src/api/files/controllers/StorageStatsController.ts","../../../src/api/files/jobs/FileJobs.ts","../../../src/api/files/index.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const fileQuerySchema = t.extend(pageQuerySchema, {\n bucket: t.optional(t.string()),\n tags: t.optional(t.array(t.string())),\n name: t.optional(t.string()),\n mimeType: t.optional(t.string()),\n creator: t.optional(t.uuid()),\n createdAfter: t.optional(t.datetime()),\n createdBefore: t.optional(t.datetime()),\n});\n\nexport type FileQuery = Static<typeof fileQuerySchema>;\n","import { type Static, t } from \"alepha\";\nimport { $entity, pg } from \"alepha/orm\";\n\nexport const files = $entity({\n name: \"files\",\n schema: t.object({\n id: pg.primaryKey(t.uuid()),\n version: pg.version(),\n createdAt: pg.createdAt(),\n updatedAt: pg.updatedAt(),\n blobId: t.text(),\n creator: t.optional(t.uuid()),\n creatorRealm: t.optional(t.string()),\n creatorName: t.optional(t.string()),\n bucket: t.text(),\n expirationDate: t.optional(t.datetime()),\n name: t.text(),\n size: t.number(),\n mimeType: t.string(),\n tags: t.optional(t.array(t.text())),\n checksum: t.optional(t.string()),\n }),\n indexes: [\n \"expirationDate\",\n \"bucket\",\n \"creator\",\n \"createdAt\",\n \"mimeType\",\n {\n columns: [\"bucket\", \"createdAt\"],\n },\n ],\n});\n\nexport type FileEntity = Static<typeof files.schema>;\n","import { type Static, t } from \"alepha\";\nimport { files } from \"../entities/files.ts\";\n\nexport const fileResourceSchema = t.extend(\n files.schema,\n {},\n {\n title: \"FileResource\",\n description: \"A file resource representing a file stored in the system.\",\n },\n);\n\nexport type FileResource = Static<typeof fileResourceSchema>;\n","import { createHash } from \"node:crypto\";\nimport { $hook, $inject, Alepha, type FileLike } from \"alepha\";\nimport {\n $bucket,\n type BucketPrimitive,\n FileNotFoundError,\n} from \"alepha/bucket\";\nimport {\n type DateTime,\n DateTimeProvider,\n type DurationLike,\n} from \"alepha/datetime\";\nimport { $logger } from \"alepha/logger\";\nimport { $repository, type Page } from \"alepha/orm\";\nimport type { UserAccountToken } from \"alepha/security\";\nimport type { Ok } from \"alepha/server\";\nimport { NotFoundError } from \"alepha/server\";\nimport { type FileEntity, files } from \"../entities/files.ts\";\nimport type { FileQuery } from \"../schemas/fileQuerySchema.ts\";\nimport type { FileResource } from \"../schemas/fileResourceSchema.ts\";\nimport type { StorageStats } from \"../schemas/storageStatsSchema.ts\";\n\nexport class FileService {\n protected readonly alepha = $inject(Alepha);\n protected readonly log = $logger();\n protected readonly fileRepository = $repository(files);\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly defaultBucket = $bucket({ name: \"default\" });\n\n protected onUploadFile = $hook({\n on: \"bucket:file:uploaded\",\n handler: async ({ file, bucket, options, id }) => {\n if (options.persist === false) {\n return;\n }\n\n const checksum = await this.calculateChecksum(file);\n\n await this.fileRepository.create({\n blobId: id,\n mimeType: file.type,\n name: file.name,\n size: file.size,\n creator: options.user?.id,\n creatorRealm: options.user?.realm,\n expirationDate: this.getExpirationDate(options.ttl),\n bucket: bucket.name,\n checksum,\n });\n },\n });\n\n protected onDeleteBucketFile = $hook({\n on: \"bucket:file:deleted\",\n handler: async ({ bucket, id }) => {\n await this.fileRepository.deleteMany({\n blobId: { eq: id },\n bucket: { eq: bucket.name },\n });\n },\n });\n\n // -------------------------------------------------------------------------------------------------------------------\n\n /**\n * Calculates SHA-256 checksum of a file.\n *\n * @param file - The file to calculate checksum for\n * @returns Hexadecimal string representation of the SHA-256 hash\n * @protected\n */\n protected async calculateChecksum(file: FileLike): Promise<string> {\n const buffer = await file.arrayBuffer();\n const hash = createHash(\"sha256\");\n hash.update(Buffer.from(buffer));\n return hash.digest(\"hex\");\n }\n\n /**\n * Gets a bucket primitive by name.\n *\n * @param bucketName - The name of the bucket to retrieve (defaults to \"default\")\n * @returns The bucket primitive\n * @throws {NotFoundError} If the bucket is not found\n */\n public bucket(bucketName: string = this.defaultBucket.name): BucketPrimitive {\n const bucket = this.alepha\n .primitives($bucket)\n .find((it) => it.name === bucketName);\n\n if (!bucket) {\n throw new NotFoundError(`Bucket '${bucketName}' not found.`);\n }\n\n return bucket;\n }\n\n // -------------------------------------------------------------------------------------------------------------------\n\n /**\n * Finds files matching the given query criteria with pagination support.\n * Supports filtering by bucket, tags, name, mimeType, creator, and date range.\n *\n * @param q - Query parameters including bucket, tags, name, mimeType, creator, date range, pagination, and sorting\n * @returns Paginated list of file entities\n */\n public async findFiles(q: FileQuery = {}): Promise<Page<FileEntity>> {\n q.sort ??= \"-createdAt\";\n\n const where = this.fileRepository.createQueryWhere();\n\n if (q.bucket) {\n where.bucket = { eq: q.bucket };\n }\n\n if (q.tags) {\n where.tags = { arrayContains: q.tags };\n }\n\n if (q.name) {\n where.name = { ilike: `%${q.name}%` };\n }\n\n if (q.mimeType) {\n where.mimeType = { eq: q.mimeType };\n }\n\n if (q.creator) {\n where.creator = { eq: q.creator };\n }\n\n if (q.createdAfter && q.createdBefore) {\n where.createdAt = {\n gte: q.createdAfter,\n lte: q.createdBefore,\n };\n } else if (q.createdAfter) {\n where.createdAt = { gte: q.createdAfter };\n } else if (q.createdBefore) {\n where.createdAt = { lte: q.createdBefore };\n }\n\n return await this.fileRepository\n .paginate(q, { where }, { count: true })\n .then((page) => {\n return {\n ...page,\n content: page.content.map((it) => this.entityToResource(it)),\n };\n });\n }\n\n /**\n * Finds files that have expired based on their expiration date.\n * Limited to 1000 files per call to prevent memory issues.\n *\n * @returns Array of expired file entities\n */\n public async findExpiredFiles(): Promise<FileEntity[]> {\n return await this.fileRepository.findMany({\n limit: 1000,\n where: {\n expirationDate: { lte: this.dateTimeProvider.nowISOString() },\n },\n });\n }\n\n /**\n * Calculates an expiration date based on a TTL (time to live) duration.\n *\n * @param ttl - Duration like \"1 day\", \"2 hours\", etc.\n * @returns DateTime representation of the expiration date, or undefined if no TTL provided\n * @protected\n */\n protected getExpirationDate(ttl?: DurationLike): string | undefined {\n return ttl\n ? this.dateTimeProvider\n .now()\n .add(this.dateTimeProvider.duration(ttl))\n .toISOString()\n : undefined;\n }\n\n /**\n * Uploads a file to a bucket and creates a database record with metadata.\n * Automatically calculates and stores the file checksum (SHA-256).\n *\n * @param file - The file to upload\n * @param options - Upload options including bucket, expiration, user, and tags\n * @param options.bucket - Target bucket name (defaults to \"default\")\n * @param options.expirationDate - When the file should expire\n * @param options.user - User performing the upload (for audit trail)\n * @param options.tags - Tags to associate with the file\n * @returns The created file entity with all metadata\n * @throws {NotFoundError} If the specified bucket doesn't exist\n */\n public async uploadFile(\n file: FileLike,\n options: {\n expirationDate?: string | DateTime;\n bucket?: string;\n user?: UserAccountToken;\n tags?: string[];\n } = {},\n ): Promise<FileEntity> {\n const bucket = this.bucket(options.bucket);\n\n const checksum = await this.calculateChecksum(file);\n const blobId = await bucket.upload(file, { persist: false });\n\n let expirationDate: string | undefined;\n if (options.expirationDate) {\n expirationDate = this.dateTimeProvider\n .of(options.expirationDate)\n .toISOString();\n } else if (bucket.options.ttl) {\n expirationDate = this.getExpirationDate(bucket.options.ttl);\n }\n\n return await this.fileRepository.create({\n blobId: blobId,\n mimeType: file.type,\n name: file.name,\n size: file.size,\n creator: options.user?.id,\n creatorRealm: options.user?.realm,\n creatorName: options.user?.name,\n expirationDate,\n bucket: bucket.name,\n tags: options.tags,\n checksum,\n });\n }\n\n /**\n * Streams a file from storage by its database ID.\n *\n * @param id - The database ID (UUID) of the file to stream\n * @returns The file object ready for streaming/downloading\n * @throws {NotFoundError} If the file doesn't exist in the database\n * @throws {FileNotFoundError} If the file exists in database but not in storage\n */\n public async streamFile(id: string): Promise<FileLike> {\n const entity = await this.getFileById(id);\n const bucket = this.bucket(entity.bucket);\n\n return await bucket.download(entity.blobId);\n }\n\n /**\n * Updates file metadata (name, tags, expiration date).\n * Does not modify the actual file content in storage.\n *\n * @param id - The database ID (UUID) of the file to update\n * @param data - Partial file data to update\n * @param data.name - New file name\n * @param data.tags - New tags array\n * @param data.expirationDate - New expiration date\n * @returns The updated file entity\n * @throws {NotFoundError} If the file doesn't exist in the database\n */\n public async updateFile(\n id: string,\n data: {\n name?: string;\n tags?: string[];\n expirationDate?: DateTime | string;\n },\n ): Promise<FileEntity> {\n const file = await this.getFileById(id);\n\n const updateData: Partial<FileEntity> = {};\n\n if (data.name !== undefined) {\n updateData.name = data.name;\n }\n\n if (data.tags !== undefined) {\n updateData.tags = data.tags;\n }\n\n if (data.expirationDate !== undefined) {\n updateData.expirationDate = this.dateTimeProvider\n .of(data.expirationDate)\n .toISOString();\n }\n\n return await this.fileRepository.updateById(file.id, updateData);\n }\n\n /**\n * Deletes a file from both storage and database.\n * Handles cases where file is already deleted from storage gracefully.\n * Always ensures database record is removed even if storage deletion fails.\n *\n * @param id - The database ID (UUID) of the file to delete\n * @returns Success response with the deleted file ID\n * @throws {NotFoundError} If the file doesn't exist in the database\n */\n public async deleteFile(id: string): Promise<Ok> {\n const file = await this.getFileById(id);\n const bucket = this.bucket(file.bucket);\n\n // Always delete the database record\n await this.fileRepository.deleteById(file.id);\n\n try {\n await bucket.delete(file.blobId, true);\n } catch (e) {\n if (e instanceof FileNotFoundError) {\n // File is already deleted in the bucket, this is okay\n this.log.debug(\n `File ${file.blobId} not found in bucket ${bucket.name}, cleaning up database record`,\n );\n } else {\n // Other errors (permission, network, etc.) - log but continue to clean up database\n this.log.warn(\n `Failed to delete file ${file.blobId} from bucket ${bucket.name}`,\n e,\n );\n }\n }\n\n return { ok: true, id: String(file.id) };\n }\n\n /**\n * Retrieves a file entity by its ID.\n * If already an entity object, returns it as-is (convenience method).\n *\n * @param id - Either a UUID string or an existing FileEntity object\n * @returns The file entity\n * @throws {NotFoundError} If the file doesn't exist in the database\n */\n public async getFileById(id: string | FileEntity): Promise<FileEntity> {\n if (typeof id === \"object\") {\n return id;\n }\n\n return await this.fileRepository.findById(id);\n }\n\n /**\n * Gets storage statistics including total size, file count, and breakdowns by bucket and MIME type.\n *\n * @returns Storage statistics with aggregated data\n */\n public async getStorageStats(): Promise<StorageStats> {\n const allFiles = await this.fileRepository.findMany({});\n\n const totalSize = allFiles.reduce((sum, file) => sum + file.size, 0);\n const totalFiles = allFiles.length;\n\n // Group by bucket\n const bucketMap = new Map<\n string,\n { totalSize: number; fileCount: number }\n >();\n for (const file of allFiles) {\n const existing = bucketMap.get(file.bucket) || {\n totalSize: 0,\n fileCount: 0,\n };\n existing.totalSize += file.size;\n existing.fileCount += 1;\n bucketMap.set(file.bucket, existing);\n }\n\n // Group by MIME type\n const mimeTypeMap = new Map<string, number>();\n for (const file of allFiles) {\n const existing = mimeTypeMap.get(file.mimeType) || 0;\n mimeTypeMap.set(file.mimeType, existing + 1);\n }\n\n return {\n totalSize,\n totalFiles,\n byBucket: Array.from(bucketMap.entries()).map(([bucket, stats]) => ({\n bucket,\n totalSize: stats.totalSize,\n fileCount: stats.fileCount,\n })),\n byMimeType: Array.from(mimeTypeMap.entries()).map(\n ([mimeType, fileCount]) => ({\n mimeType,\n fileCount,\n }),\n ),\n };\n }\n\n /**\n * Converts a file entity to a file resource (API response format).\n * Currently a pass-through, but allows for future transformation logic.\n *\n * @param entity - The file entity to convert\n * @returns The file resource for API responses\n */\n public entityToResource(entity: FileEntity): FileResource {\n return entity;\n }\n}\n","import { $inject, t } from \"alepha\";\nimport { pg } from \"alepha/orm\";\nimport { $action, okSchema } from \"alepha/server\";\nimport { fileQuerySchema } from \"../schemas/fileQuerySchema.ts\";\nimport { fileResourceSchema } from \"../schemas/fileResourceSchema.ts\";\nimport { FileService } from \"../services/FileService.ts\";\n\n/**\n * REST API controller for file management operations.\n * Provides endpoints for uploading, downloading, listing, and deleting files.\n */\nexport class FileController {\n protected readonly url = \"/files\";\n protected readonly group = \"files\";\n protected readonly fileService = $inject(FileService);\n\n /**\n * GET /files - Lists files with optional filtering and pagination.\n * Supports filtering by bucket and tags.\n */\n public readonly findFiles = $action({\n path: this.url,\n group: this.group,\n description: \"List files with filtering and pagination\",\n schema: {\n query: fileQuerySchema,\n response: pg.page(fileResourceSchema),\n },\n handler: ({ query }) => this.fileService.findFiles(query),\n });\n\n /**\n * DELETE /files/:id - Deletes a file from both storage and database.\n * Removes the file from the bucket and cleans up the database record.\n */\n public readonly deleteFile = $action({\n method: \"DELETE\",\n path: `${this.url}/:id`,\n group: this.group,\n description: \"Delete a file\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: okSchema,\n },\n handler: ({ params }) => this.fileService.deleteFile(params.id),\n });\n\n /**\n * POST /files - Uploads a new file to storage.\n * Creates a database record with metadata and calculates checksum.\n * Optionally specify bucket and expiration date.\n */\n public readonly uploadFile = $action({\n path: this.url,\n group: this.group,\n description: \"Upload a new file\",\n schema: {\n body: t.object({\n file: t.file(),\n }),\n query: t.object({\n expirationDate: t.optional(t.datetime()),\n bucket: t.optional(t.string()),\n }),\n response: fileResourceSchema,\n },\n handler: async ({ body, user, query }) =>\n this.fileService.uploadFile(body.file, {\n user,\n ...query,\n }),\n });\n\n /**\n * PATCH /files/:id - Updates file metadata.\n * Allows updating name, tags, and expiration date without modifying file content.\n */\n public readonly updateFile = $action({\n method: \"PATCH\",\n path: `${this.url}/:id`,\n group: this.group,\n description: \"Update file metadata\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n body: t.object({\n name: t.optional(t.string()),\n tags: t.optional(t.array(t.string())),\n expirationDate: t.optional(t.datetime()),\n }),\n response: fileResourceSchema,\n },\n handler: ({ params, body }) => this.fileService.updateFile(params.id, body),\n });\n\n /**\n * GET /files/:id - Streams/downloads a file by its ID.\n * Returns the file content with appropriate Content-Type header.\n * Cached with ETag support for 1 year (immutable).\n */\n public readonly streamFile = $action({\n path: `${this.url}/:id`,\n group: this.group,\n description: \"Download a file\",\n cache: {\n etag: true,\n control: {\n public: true,\n maxAge: [1, \"year\"],\n immutable: true,\n },\n },\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: t.file(),\n },\n handler: async ({ params }) => {\n return await this.fileService.streamFile(params.id);\n },\n });\n}\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const bucketStatsSchema = t.object({\n bucket: t.string(),\n totalSize: t.number(),\n fileCount: t.number(),\n});\n\nexport const mimeTypeStatsSchema = t.object({\n mimeType: t.string(),\n fileCount: t.number(),\n});\n\nexport const storageStatsSchema = t.object({\n totalSize: t.number(),\n totalFiles: t.number(),\n byBucket: t.array(bucketStatsSchema),\n byMimeType: t.array(mimeTypeStatsSchema),\n});\n\nexport type BucketStats = Static<typeof bucketStatsSchema>;\nexport type MimeTypeStats = Static<typeof mimeTypeStatsSchema>;\nexport type StorageStats = Static<typeof storageStatsSchema>;\n","import \"alepha/server/security\";\nimport { $inject } from \"alepha\";\nimport { $action } from \"alepha/server\";\nimport { storageStatsSchema } from \"../schemas/storageStatsSchema.ts\";\nimport { FileService } from \"../services/FileService.ts\";\n\n/**\n * REST API controller for storage analytics and statistics.\n * Provides endpoints for viewing storage usage metrics.\n */\nexport class StorageStatsController {\n protected readonly url = \"/files/stats\";\n protected readonly group = \"files\";\n protected readonly fileService = $inject(FileService);\n\n /**\n * GET /files/stats - Gets storage statistics.\n * Returns aggregated data including total size, file count,\n * and breakdowns by bucket and MIME type.\n */\n public readonly getStats = $action({\n path: this.url,\n group: this.group,\n description: \"Get storage statistics\",\n schema: {\n response: storageStatsSchema,\n },\n handler: () => this.fileService.getStorageStats(),\n });\n}\n","import { $inject } from \"alepha\";\nimport { $scheduler } from \"alepha/scheduler\";\nimport { FileService } from \"../services/FileService.ts\";\n\nexport class FileJobs {\n protected readonly fileService = $inject(FileService);\n\n public readonly purgeFiles = $scheduler({\n description: \"Purge files that are marked for deletion\",\n cron: \"*/15 * * * *\", // Every 15 minutes\n handler: async () => {\n const files = await this.fileService.findExpiredFiles();\n\n await Promise.all(\n files.map((file) => this.fileService.deleteFile(file.id)),\n );\n },\n });\n}\n","import { $module } from \"alepha\";\nimport { AlephaBucket } from \"alepha/bucket\";\nimport type { DurationLike } from \"alepha/datetime\";\nimport type { UserAccountToken } from \"alepha/security\";\nimport { AlephaServerCache } from \"alepha/server/cache\";\nimport { AlephaServerMultipart } from \"alepha/server/multipart\";\nimport { FileController } from \"./controllers/FileController.ts\";\nimport { StorageStatsController } from \"./controllers/StorageStatsController.ts\";\nimport { FileJobs } from \"./jobs/FileJobs.ts\";\nimport { FileService } from \"./services/FileService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./controllers/FileController.ts\";\nexport * from \"./controllers/StorageStatsController.ts\";\nexport * from \"./entities/files.ts\";\nexport * from \"./jobs/FileJobs.ts\";\nexport * from \"./schemas/storageStatsSchema.ts\";\nexport * from \"./services/FileService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\ndeclare module \"alepha/bucket\" {\n interface BucketFileOptions {\n /**\n * Time to live for the files in the bucket.\n */\n ttl?: DurationLike;\n\n /**\n * Tags for the bucket.\n */\n tags?: string[];\n\n /**\n * User performing the operation.\n */\n user?: UserAccountToken;\n\n /**\n * Whether to persist the file metadata in the database.\n *\n * @default true\n */\n persist?: boolean;\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Provides file management API endpoints for Alepha applications.\n *\n * This module includes file upload, download, storage management,\n * and file metadata operations.\n *\n * @module alepha.api.files\n */\nexport const AlephaApiFiles = $module({\n name: \"alepha.api.files\",\n services: [FileController, StorageStatsController, FileJobs, FileService],\n register: (alepha) => {\n alepha\n .with(AlephaBucket)\n .with(AlephaServerCache)\n .with(AlephaServerMultipart)\n .with(FileController)\n .with(StorageStatsController)\n .with(FileJobs);\n },\n});\n"],"mappings":";;;;;;;;;;;;;AAIA,MAAa,kBAAkB,EAAE,OAAO,iBAAiB;CACvD,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC9B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;CACrC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC5B,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC;CAChC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC;CAC7B,cAAc,EAAE,SAAS,EAAE,UAAU,CAAC;CACtC,eAAe,EAAE,SAAS,EAAE,UAAU,CAAC;CACxC,CAAC;;;;ACTF,MAAa,QAAQ,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  import { logEntrySchema } from "alepha/logger";
3
3
  import { $entity, pageQuerySchema, pg } from "alepha/orm";
4
4
 
5
- //#region ../../src/api-jobs/entities/jobExecutions.ts
5
+ //#region ../../src/api/jobs/entities/jobExecutions.ts
6
6
  const jobExecutions = $entity({
7
7
  name: "job_executions",
8
8
  schema: t.object({
@@ -23,7 +23,7 @@ const jobExecutions = $entity({
23
23
  });
24
24
 
25
25
  //#endregion
26
- //#region ../../src/api-jobs/schemas/jobExecutionQuerySchema.ts
26
+ //#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.ts
27
27
  const jobExecutionQuerySchema = t.extend(pageQuerySchema, {
28
28
  status: t.optional(t.enum([
29
29
  "STARTED",
@@ -34,18 +34,18 @@ const jobExecutionQuerySchema = t.extend(pageQuerySchema, {
34
34
  });
35
35
 
36
36
  //#endregion
37
- //#region ../../src/api-jobs/schemas/jobExecutionResourceSchema.ts
37
+ //#region ../../src/api/jobs/schemas/jobExecutionResourceSchema.ts
38
38
  const jobExecutionResourceSchema = t.extend(jobExecutions.schema, {}, {
39
39
  title: "JobExecutionResource",
40
40
  description: "A job execution resource representing the execution details of a job."
41
41
  });
42
42
 
43
43
  //#endregion
44
- //#region ../../src/api-jobs/schemas/triggerJobSchema.ts
44
+ //#region ../../src/api/jobs/schemas/triggerJobSchema.ts
45
45
  const triggerJobSchema = t.object({ name: t.string() });
46
46
 
47
47
  //#endregion
48
- //#region ../../src/api-jobs/index.browser.ts
48
+ //#region ../../src/api/jobs/index.browser.ts
49
49
  const AlephaApiJobs = $module({
50
50
  name: "alepha.api.jobs",
51
51
  services: []
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","names":[],"sources":["../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/index.browser.ts"],"sourcesContent":["import { type Static, t } from \"alepha\";\nimport { logEntrySchema } from \"alepha/logger\";\nimport { $entity, pg } from \"alepha/orm\";\n\nexport const jobExecutions = $entity({\n name: \"job_executions\",\n schema: t.object({\n id: pg.primaryKey(t.uuid()),\n version: pg.version(),\n createdAt: pg.createdAt(),\n updatedAt: pg.updatedAt(),\n finishedAt: t.optional(t.datetime()),\n job: t.string(),\n status: t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"]),\n error: t.optional(t.string()),\n logs: t.optional(t.array(logEntrySchema)),\n }),\n});\n\nexport type JobExecutionEntity = Static<typeof jobExecutions.schema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const jobExecutionQuerySchema = t.extend(pageQuerySchema, {\n status: t.optional(t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"])),\n job: t.optional(\n t.text({\n description: \"Filter by job name\",\n }),\n ),\n});\n\nexport type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;\n","import { type Static, t } from \"alepha\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\n\nexport const jobExecutionResourceSchema = t.extend(\n jobExecutions.schema,\n {},\n {\n title: \"JobExecutionResource\",\n description:\n \"A job execution resource representing the execution details of a job.\",\n },\n);\n\nexport type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const triggerJobSchema = t.object({\n name: t.string(),\n});\n\nexport type TriggerJob = Static<typeof triggerJobSchema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./entities/jobExecutions.ts\";\nexport * from \"./schemas/jobExecutionQuerySchema.ts\";\nexport * from \"./schemas/jobExecutionResourceSchema.ts\";\nexport * from \"./schemas/triggerJobSchema.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const AlephaApiJobs = $module({\n name: \"alepha.api.jobs\",\n services: [],\n});\n"],"mappings":";;;;;AAIA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,MAAM,CAAC;EAC3B,SAAS,GAAG,SAAS;EACrB,WAAW,GAAG,WAAW;EACzB,WAAW,GAAG,WAAW;EACzB,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC;EACpC,KAAK,EAAE,QAAQ;EACf,QAAQ,EAAE,KAAK;GAAC;GAAW;GAAU;GAAY,CAAC;EAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;EAC1C,CAAC;CACH,CAAC;;;;ACbF,MAAa,0BAA0B,EAAE,OAAO,iBAAiB;CAC/D,QAAQ,EAAE,SAAS,EAAE,KAAK;EAAC;EAAW;EAAU;EAAY,CAAC,CAAC;CAC9D,KAAK,EAAE,SACL,EAAE,KAAK,EACL,aAAa,sBACd,CAAC,CACH;CACF,CAAC;;;;ACRF,MAAa,6BAA6B,EAAE,OAC1C,cAAc,QACd,EAAE,EACF;CACE,OAAO;CACP,aACE;CACH,CACF;;;;ACRD,MAAa,mBAAmB,EAAE,OAAO,EACvC,MAAM,EAAE,QAAQ,EACjB,CAAC;;;;ACMF,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,UAAU,EAAE;CACb,CAAC"}
@@ -1,17 +1,18 @@
1
- import * as alepha224 from "alepha";
1
+ import * as alepha225 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_orm0 from "alepha/orm";
4
+ import * as alepha_orm33 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 "drizzle-orm/d1";
9
10
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
10
11
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
11
12
  import "alepha/retry";
13
+ import "drizzle-orm/sqlite-core";
12
14
  import "drizzle-orm/postgres-js";
13
15
  import "postgres";
14
- import "drizzle-orm/sqlite-core";
15
16
 
16
17
  //#region ../../src/orm/schemas/insertSchema.d.ts
17
18
  /**
@@ -233,7 +234,7 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
233
234
  declare module "alepha" {
234
235
  interface Env extends Partial<Static<typeof envSchema$1>> {}
235
236
  }
236
- declare const envSchema$1: alepha224.TObject<{
237
+ declare const envSchema$1: alepha225.TObject<{
237
238
  /**
238
239
  * Main configuration for database connection.
239
240
  * Accept a string in the format of a Postgres connection URL.
@@ -241,21 +242,21 @@ declare const envSchema$1: alepha224.TObject<{
241
242
  * or
242
243
  * Example: postgres://user:password@localhost:5432/database?sslmode=require
243
244
  */
244
- DATABASE_URL: alepha224.TOptional<alepha224.TString>;
245
+ DATABASE_URL: alepha225.TOptional<alepha225.TString>;
245
246
  /**
246
247
  * In addition to the DATABASE_URL, you can specify the postgres schema name.
247
248
  *
248
249
  * It will monkey patch drizzle tables.
249
250
  */
250
- POSTGRES_SCHEMA: alepha224.TOptional<alepha224.TString>;
251
+ POSTGRES_SCHEMA: alepha225.TOptional<alepha225.TString>;
251
252
  }>;
252
253
  //#endregion
253
254
  //#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
254
255
  /**
255
256
  * Configuration options for the Node.js SQLite database provider.
256
257
  */
257
- declare const nodeSqliteOptions: alepha224.Atom<alepha224.TObject<{
258
- path: alepha224.TOptional<alepha224.TString>;
258
+ declare const nodeSqliteOptions: alepha225.Atom<alepha225.TObject<{
259
+ path: alepha225.TOptional<alepha225.TString>;
259
260
  }>, "alepha.postgres.node-sqlite.options">;
260
261
  type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
261
262
  declare module "alepha" {
@@ -338,77 +339,77 @@ declare module "alepha" {
338
339
  }
339
340
  }
340
341
  //#endregion
341
- //#region ../../src/api-jobs/schemas/jobExecutionQuerySchema.d.ts
342
- declare const jobExecutionQuerySchema: alepha224.TObject<{
343
- page: alepha224.TOptional<alepha224.TInteger>;
344
- size: alepha224.TOptional<alepha224.TInteger>;
345
- sort: alepha224.TOptional<alepha224.TString>;
346
- status: alepha224.TOptional<alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
347
- job: alepha224.TOptional<alepha224.TString>;
342
+ //#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.d.ts
343
+ declare const jobExecutionQuerySchema: alepha225.TObject<{
344
+ page: alepha225.TOptional<alepha225.TInteger>;
345
+ size: alepha225.TOptional<alepha225.TInteger>;
346
+ sort: alepha225.TOptional<alepha225.TString>;
347
+ status: alepha225.TOptional<alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
348
+ job: alepha225.TOptional<alepha225.TString>;
348
349
  }>;
349
350
  type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
350
351
  //#endregion
351
- //#region ../../src/api-jobs/services/JobService.d.ts
352
+ //#region ../../src/api/jobs/services/JobService.d.ts
352
353
  declare class JobService {
353
354
  protected readonly alepha: Alepha;
354
- protected readonly executionRepository: alepha_orm0.Repository<alepha224.TObject<{
355
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
356
- version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
357
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
358
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
359
- finishedAt: alepha224.TOptional<alepha224.TString>;
360
- job: alepha224.TString;
361
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
362
- error: alepha224.TOptional<alepha224.TString>;
363
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
364
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
365
- message: alepha224.TString;
366
- service: alepha224.TString;
367
- module: alepha224.TString;
368
- context: alepha224.TOptional<alepha224.TString>;
369
- app: alepha224.TOptional<alepha224.TString>;
370
- data: alepha224.TOptional<alepha224.TAny>;
371
- timestamp: alepha224.TNumber;
355
+ protected readonly executionRepository: alepha_orm33.Repository<alepha225.TObject<{
356
+ id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
357
+ version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
358
+ createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
359
+ updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
360
+ finishedAt: alepha225.TOptional<alepha225.TString>;
361
+ job: alepha225.TString;
362
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
363
+ error: alepha225.TOptional<alepha225.TString>;
364
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
365
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
366
+ message: alepha225.TString;
367
+ service: alepha225.TString;
368
+ module: alepha225.TString;
369
+ context: alepha225.TOptional<alepha225.TString>;
370
+ app: alepha225.TOptional<alepha225.TString>;
371
+ data: alepha225.TOptional<alepha225.TAny>;
372
+ timestamp: alepha225.TNumber;
372
373
  }>>>;
373
374
  }>>;
374
375
  getJobs(): Promise<string[]>;
375
- getJobExecutions(query?: JobExecutionQuery): Promise<alepha224.Page<alepha_orm0.PgStatic<alepha224.TObject<{
376
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
377
- version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
378
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
379
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
380
- finishedAt: alepha224.TOptional<alepha224.TString>;
381
- job: alepha224.TString;
382
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
383
- error: alepha224.TOptional<alepha224.TString>;
384
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
385
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
386
- message: alepha224.TString;
387
- service: alepha224.TString;
388
- module: alepha224.TString;
389
- context: alepha224.TOptional<alepha224.TString>;
390
- app: alepha224.TOptional<alepha224.TString>;
391
- data: alepha224.TOptional<alepha224.TAny>;
392
- timestamp: alepha224.TNumber;
376
+ getJobExecutions(query?: JobExecutionQuery): Promise<alepha225.Page<alepha_orm33.PgStatic<alepha225.TObject<{
377
+ id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
378
+ version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
379
+ createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
380
+ updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
381
+ finishedAt: alepha225.TOptional<alepha225.TString>;
382
+ job: alepha225.TString;
383
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
384
+ error: alepha225.TOptional<alepha225.TString>;
385
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
386
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
387
+ message: alepha225.TString;
388
+ service: alepha225.TString;
389
+ module: alepha225.TString;
390
+ context: alepha225.TOptional<alepha225.TString>;
391
+ app: alepha225.TOptional<alepha225.TString>;
392
+ data: alepha225.TOptional<alepha225.TAny>;
393
+ timestamp: alepha225.TNumber;
393
394
  }>>>;
394
- }>, alepha_orm0.PgRelationMap<alepha224.TObject<{
395
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
396
- version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
397
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
398
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
399
- finishedAt: alepha224.TOptional<alepha224.TString>;
400
- job: alepha224.TString;
401
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
402
- error: alepha224.TOptional<alepha224.TString>;
403
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
404
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
405
- message: alepha224.TString;
406
- service: alepha224.TString;
407
- module: alepha224.TString;
408
- context: alepha224.TOptional<alepha224.TString>;
409
- app: alepha224.TOptional<alepha224.TString>;
410
- data: alepha224.TOptional<alepha224.TAny>;
411
- timestamp: alepha224.TNumber;
395
+ }>, alepha_orm33.PgRelationMap<alepha225.TObject<{
396
+ id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
397
+ version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
398
+ createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
399
+ updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
400
+ finishedAt: alepha225.TOptional<alepha225.TString>;
401
+ job: alepha225.TString;
402
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
403
+ error: alepha225.TOptional<alepha225.TString>;
404
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
405
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
406
+ message: alepha225.TString;
407
+ service: alepha225.TString;
408
+ module: alepha225.TString;
409
+ context: alepha225.TOptional<alepha225.TString>;
410
+ app: alepha225.TOptional<alepha225.TString>;
411
+ data: alepha225.TOptional<alepha225.TAny>;
412
+ timestamp: alepha225.TNumber;
412
413
  }>>>;
413
414
  }>>>>>;
414
415
  triggerJob(name: string): Promise<{
@@ -416,81 +417,81 @@ declare class JobService {
416
417
  }>;
417
418
  }
418
419
  //#endregion
419
- //#region ../../src/api-jobs/controllers/JobController.d.ts
420
+ //#region ../../src/api/jobs/controllers/JobController.d.ts
420
421
  declare class JobController {
421
422
  protected readonly url: string;
422
423
  protected readonly group: string;
423
424
  protected readonly jobService: JobService;
424
425
  readonly getJobs: alepha_server0.ActionPrimitiveFn<{
425
- response: alepha224.TArray<alepha224.TString>;
426
+ response: alepha225.TArray<alepha225.TString>;
426
427
  }>;
427
428
  readonly getJobExecutions: alepha_server0.ActionPrimitiveFn<{
428
- query: alepha224.TObject<{
429
- page: alepha224.TOptional<alepha224.TInteger>;
430
- size: alepha224.TOptional<alepha224.TInteger>;
431
- sort: alepha224.TOptional<alepha224.TString>;
432
- status: alepha224.TOptional<alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
433
- job: alepha224.TOptional<alepha224.TString>;
429
+ query: alepha225.TObject<{
430
+ page: alepha225.TOptional<alepha225.TInteger>;
431
+ size: alepha225.TOptional<alepha225.TInteger>;
432
+ sort: alepha225.TOptional<alepha225.TString>;
433
+ status: alepha225.TOptional<alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
434
+ job: alepha225.TOptional<alepha225.TString>;
434
435
  }>;
435
- response: alepha224.TPage<alepha224.TObject<{
436
- id: PgAttr<PgAttr<alepha224.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
437
- version: PgAttr<PgAttr<alepha224.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
438
- createdAt: PgAttr<PgAttr<alepha224.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
439
- updatedAt: PgAttr<PgAttr<alepha224.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
440
- finishedAt: alepha224.TOptional<alepha224.TString>;
441
- job: alepha224.TString;
442
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
443
- error: alepha224.TOptional<alepha224.TString>;
444
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
445
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
446
- message: alepha224.TString;
447
- service: alepha224.TString;
448
- module: alepha224.TString;
449
- context: alepha224.TOptional<alepha224.TString>;
450
- app: alepha224.TOptional<alepha224.TString>;
451
- data: alepha224.TOptional<alepha224.TAny>;
452
- timestamp: alepha224.TNumber;
436
+ response: alepha225.TPage<alepha225.TObject<{
437
+ id: PgAttr<PgAttr<alepha225.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
438
+ version: PgAttr<PgAttr<alepha225.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
439
+ createdAt: PgAttr<PgAttr<alepha225.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
440
+ updatedAt: PgAttr<PgAttr<alepha225.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
441
+ finishedAt: alepha225.TOptional<alepha225.TString>;
442
+ job: alepha225.TString;
443
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
444
+ error: alepha225.TOptional<alepha225.TString>;
445
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
446
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
447
+ message: alepha225.TString;
448
+ service: alepha225.TString;
449
+ module: alepha225.TString;
450
+ context: alepha225.TOptional<alepha225.TString>;
451
+ app: alepha225.TOptional<alepha225.TString>;
452
+ data: alepha225.TOptional<alepha225.TAny>;
453
+ timestamp: alepha225.TNumber;
453
454
  }>>>;
454
455
  }>>;
455
456
  }>;
456
457
  readonly triggerJob: alepha_server0.ActionPrimitiveFn<{
457
- body: alepha224.TObject<{
458
- name: alepha224.TString;
458
+ body: alepha225.TObject<{
459
+ name: alepha225.TString;
459
460
  }>;
460
- response: alepha224.TObject<{
461
- ok: alepha224.TBoolean;
462
- id: alepha224.TOptional<alepha224.TUnion<[alepha224.TString, alepha224.TInteger]>>;
463
- count: alepha224.TOptional<alepha224.TNumber>;
461
+ response: alepha225.TObject<{
462
+ ok: alepha225.TBoolean;
463
+ id: alepha225.TOptional<alepha225.TUnion<[alepha225.TString, alepha225.TInteger]>>;
464
+ count: alepha225.TOptional<alepha225.TNumber>;
464
465
  }>;
465
466
  }>;
466
467
  }
467
468
  //#endregion
468
- //#region ../../src/api-jobs/entities/jobExecutions.d.ts
469
- declare const jobExecutions: alepha_orm0.EntityPrimitive<alepha224.TObject<{
470
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
471
- version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
472
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
473
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
474
- finishedAt: alepha224.TOptional<alepha224.TString>;
475
- job: alepha224.TString;
476
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
477
- error: alepha224.TOptional<alepha224.TString>;
478
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
479
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
480
- message: alepha224.TString;
481
- service: alepha224.TString;
482
- module: alepha224.TString;
483
- context: alepha224.TOptional<alepha224.TString>;
484
- app: alepha224.TOptional<alepha224.TString>;
485
- data: alepha224.TOptional<alepha224.TAny>;
486
- timestamp: alepha224.TNumber;
469
+ //#region ../../src/api/jobs/entities/jobExecutions.d.ts
470
+ declare const jobExecutions: alepha_orm33.EntityPrimitive<alepha225.TObject<{
471
+ id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
472
+ version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
473
+ createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
474
+ updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
475
+ finishedAt: alepha225.TOptional<alepha225.TString>;
476
+ job: alepha225.TString;
477
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
478
+ error: alepha225.TOptional<alepha225.TString>;
479
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
480
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
481
+ message: alepha225.TString;
482
+ service: alepha225.TString;
483
+ module: alepha225.TString;
484
+ context: alepha225.TOptional<alepha225.TString>;
485
+ app: alepha225.TOptional<alepha225.TString>;
486
+ data: alepha225.TOptional<alepha225.TAny>;
487
+ timestamp: alepha225.TNumber;
487
488
  }>>>;
488
489
  }>>;
489
490
  type JobExecutionEntity = Static<typeof jobExecutions.schema>;
490
491
  //#endregion
491
- //#region ../../src/api-jobs/providers/JobProvider.d.ts
492
- declare const envSchema: alepha224.TObject<{
493
- JOB_PREFIX: alepha224.TOptional<alepha224.TString>;
492
+ //#region ../../src/api/jobs/providers/JobProvider.d.ts
493
+ declare const envSchema: alepha225.TObject<{
494
+ JOB_PREFIX: alepha225.TOptional<alepha225.TString>;
494
495
  }>;
495
496
  declare module "alepha" {
496
497
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -503,24 +504,24 @@ declare class JobProvider {
503
504
  protected readonly alepha: Alepha;
504
505
  protected readonly dateTimeProvider: DateTimeProvider;
505
506
  protected readonly cronProvider: CronProvider;
506
- protected readonly executionRepository: alepha_orm0.Repository<alepha224.TObject<{
507
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
508
- version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
509
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
510
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha224.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
511
- finishedAt: alepha224.TOptional<alepha224.TString>;
512
- job: alepha224.TString;
513
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
514
- error: alepha224.TOptional<alepha224.TString>;
515
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
516
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
517
- message: alepha224.TString;
518
- service: alepha224.TString;
519
- module: alepha224.TString;
520
- context: alepha224.TOptional<alepha224.TString>;
521
- app: alepha224.TOptional<alepha224.TString>;
522
- data: alepha224.TOptional<alepha224.TAny>;
523
- timestamp: alepha224.TNumber;
507
+ protected readonly executionRepository: alepha_orm33.Repository<alepha225.TObject<{
508
+ id: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_PRIMARY_KEY>, typeof alepha_orm33.PG_DEFAULT>;
509
+ version: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TInteger, typeof alepha_orm33.PG_VERSION>, typeof alepha_orm33.PG_DEFAULT>;
510
+ createdAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_CREATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
511
+ updatedAt: alepha_orm33.PgAttr<alepha_orm33.PgAttr<alepha225.TString, typeof alepha_orm33.PG_UPDATED_AT>, typeof alepha_orm33.PG_DEFAULT>;
512
+ finishedAt: alepha225.TOptional<alepha225.TString>;
513
+ job: alepha225.TString;
514
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
515
+ error: alepha225.TOptional<alepha225.TString>;
516
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
517
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
518
+ message: alepha225.TString;
519
+ service: alepha225.TString;
520
+ module: alepha225.TString;
521
+ context: alepha225.TOptional<alepha225.TString>;
522
+ app: alepha225.TOptional<alepha225.TString>;
523
+ data: alepha225.TOptional<alepha225.TAny>;
524
+ timestamp: alepha225.TNumber;
524
525
  }>>>;
525
526
  }>>;
526
527
  protected readonly env: {
@@ -589,7 +590,7 @@ interface JobRegistration {
589
590
  lockPrimitive: LockPrimitive<() => Promise<void>> | null;
590
591
  }
591
592
  //#endregion
592
- //#region ../../src/api-jobs/primitives/$job.d.ts
593
+ //#region ../../src/api/jobs/primitives/$job.d.ts
593
594
  /**
594
595
  * Job primitive - a drop-in replacement for $scheduler with built-in execution tracking.
595
596
  */
@@ -613,36 +614,36 @@ interface JobHandlerArguments {
613
614
  now: DateTime;
614
615
  }
615
616
  //#endregion
616
- //#region ../../src/api-jobs/schemas/jobExecutionResourceSchema.d.ts
617
- declare const jobExecutionResourceSchema: alepha224.TObject<{
618
- id: PgAttr<PgAttr<alepha224.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
619
- version: PgAttr<PgAttr<alepha224.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
620
- createdAt: PgAttr<PgAttr<alepha224.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
621
- updatedAt: PgAttr<PgAttr<alepha224.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
622
- finishedAt: alepha224.TOptional<alepha224.TString>;
623
- job: alepha224.TString;
624
- status: alepha224.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
625
- error: alepha224.TOptional<alepha224.TString>;
626
- logs: alepha224.TOptional<alepha224.TArray<alepha224.TObject<{
627
- level: alepha224.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
628
- message: alepha224.TString;
629
- service: alepha224.TString;
630
- module: alepha224.TString;
631
- context: alepha224.TOptional<alepha224.TString>;
632
- app: alepha224.TOptional<alepha224.TString>;
633
- data: alepha224.TOptional<alepha224.TAny>;
634
- timestamp: alepha224.TNumber;
617
+ //#region ../../src/api/jobs/schemas/jobExecutionResourceSchema.d.ts
618
+ declare const jobExecutionResourceSchema: alepha225.TObject<{
619
+ id: PgAttr<PgAttr<alepha225.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
620
+ version: PgAttr<PgAttr<alepha225.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
621
+ createdAt: PgAttr<PgAttr<alepha225.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
622
+ updatedAt: PgAttr<PgAttr<alepha225.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
623
+ finishedAt: alepha225.TOptional<alepha225.TString>;
624
+ job: alepha225.TString;
625
+ status: alepha225.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
626
+ error: alepha225.TOptional<alepha225.TString>;
627
+ logs: alepha225.TOptional<alepha225.TArray<alepha225.TObject<{
628
+ level: alepha225.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
629
+ message: alepha225.TString;
630
+ service: alepha225.TString;
631
+ module: alepha225.TString;
632
+ context: alepha225.TOptional<alepha225.TString>;
633
+ app: alepha225.TOptional<alepha225.TString>;
634
+ data: alepha225.TOptional<alepha225.TAny>;
635
+ timestamp: alepha225.TNumber;
635
636
  }>>>;
636
637
  }>;
637
638
  type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
638
639
  //#endregion
639
- //#region ../../src/api-jobs/schemas/triggerJobSchema.d.ts
640
- declare const triggerJobSchema: alepha224.TObject<{
641
- name: alepha224.TString;
640
+ //#region ../../src/api/jobs/schemas/triggerJobSchema.d.ts
641
+ declare const triggerJobSchema: alepha225.TObject<{
642
+ name: alepha225.TString;
642
643
  }>;
643
644
  type TriggerJob = Static<typeof triggerJobSchema>;
644
645
  //#endregion
645
- //#region ../../src/api-jobs/index.d.ts
646
+ //#region ../../src/api/jobs/index.d.ts
646
647
  /**
647
648
  * Provides job management API endpoints for Alepha applications.
648
649
  *
@@ -651,7 +652,7 @@ type TriggerJob = Static<typeof triggerJobSchema>;
651
652
  *
652
653
  * @module alepha.api.jobs
653
654
  */
654
- declare const AlephaApiJobs: alepha224.Service<alepha224.Module>;
655
+ declare const AlephaApiJobs: alepha225.Service<alepha225.Module>;
655
656
  //#endregion
656
657
  export { $job, AlephaApiJobs, Job, JobController, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobPrimitive, JobPrimitiveOptions, JobProvider, JobRegistration, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
657
658
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/orm/schemas/insertSchema.ts","../../../src/orm/schemas/updateSchema.ts","../../../src/orm/primitives/$entity.ts","../../../src/orm/constants/PG_SYMBOLS.ts","../../../src/orm/helpers/pgAttr.ts","../../../src/orm/providers/drivers/NodePostgresProvider.ts","../../../src/orm/providers/drivers/NodeSqliteProvider.ts","../../../src/orm/index.ts","../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/services/JobService.ts","../../../src/api/jobs/controllers/JobController.ts","../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/providers/JobProvider.ts","../../../src/api/jobs/primitives/$job.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;KAaY,wBAAwB,WAAW,sBACjC,kBAAkB,gBAAgB;GACvC,UAAA;;;IAEH,UAAU,gBAAgB,MAC1B,gBAAgB;;;;;;;;;;;;KCDV,wBAAwB,WAAW,sBACjC,kBAAkB,gBAAgB,WAAW,qBACrD,UAAU,QAAQ,GAAG,WACrB,gBAAgB;;;ADFA,UEkBL,sBFlBK,CAAA,UEmBV,OFnBU,EAAA,OAAA,MEoBP,MFpBO,CEoBA,CFpBA,CAAA,CAAA,CAAA;EALyB;;;;;ECInC;;;EACoB,MAAA,EC+BtB,CD/BsB;EAAgB;;;EACrB,OAAA,CAAA,EAAA,CCoCrB,IDpCqB,GAAA;IAAX;;;IACM,MAAA,ECwCN,IDxCM;IAHyB;;;;;ACmB/C;;IAEsB,IAAA,CAAA,EAAA,MAAA;EAAP,CAAA,GAAA;IAWL;;;IAyBO,OAAA,EAAA,IAAA,EAAA;IAuBe;;;IAKA,MAAA,CAAA,EAAA,OAAA;IAAZ;;;IAsCK,IAAA,CAAA,EAAA,MAAA;EAAZ,CAAA,CAAA,EAAA;EAYD;;;EAO8B,WAAA,CAAA,EAtE1B,KAsE0B,CAAA;IAAhC;;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