alepha 0.22.0 → 0.24.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 (869) hide show
  1. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  2. package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
  3. package/dist/api/audits/index.browser.js +49 -52
  4. package/dist/api/audits/index.browser.js.map +1 -1
  5. package/dist/api/audits/index.d.ts +629 -565
  6. package/dist/api/audits/index.d.ts.map +1 -1
  7. package/dist/api/audits/index.js +206 -98
  8. package/dist/api/audits/index.js.map +1 -1
  9. package/dist/api/files/index.browser.js +44 -44
  10. package/dist/api/files/index.browser.js.map +1 -1
  11. package/dist/api/files/index.d.ts +292 -293
  12. package/dist/api/files/index.d.ts.map +1 -1
  13. package/dist/api/files/index.js +61 -64
  14. package/dist/api/files/index.js.map +1 -1
  15. package/dist/api/jobs/index.browser.js +61 -59
  16. package/dist/api/jobs/index.browser.js.map +1 -1
  17. package/dist/api/jobs/index.d.ts +546 -347
  18. package/dist/api/jobs/index.d.ts.map +1 -1
  19. package/dist/api/jobs/index.js +165 -86
  20. package/dist/api/jobs/index.js.map +1 -1
  21. package/dist/api/keys/index.d.ts +242 -230
  22. package/dist/api/keys/index.d.ts.map +1 -1
  23. package/dist/api/keys/index.js +63 -66
  24. package/dist/api/keys/index.js.map +1 -1
  25. package/dist/api/notifications/index.browser.js +40 -38
  26. package/dist/api/notifications/index.browser.js.map +1 -1
  27. package/dist/api/notifications/index.d.ts +339 -209
  28. package/dist/api/notifications/index.d.ts.map +1 -1
  29. package/dist/api/notifications/index.js +108 -60
  30. package/dist/api/notifications/index.js.map +1 -1
  31. package/dist/api/oauth/index.d.ts +190 -78
  32. package/dist/api/oauth/index.d.ts.map +1 -1
  33. package/dist/api/oauth/index.js +290 -68
  34. package/dist/api/oauth/index.js.map +1 -1
  35. package/dist/api/organizations/index.browser.js +14 -14
  36. package/dist/api/organizations/index.browser.js.map +1 -1
  37. package/dist/api/organizations/index.d.ts +158 -134
  38. package/dist/api/organizations/index.d.ts.map +1 -1
  39. package/dist/api/organizations/index.js +18 -18
  40. package/dist/api/organizations/index.js.map +1 -1
  41. package/dist/api/parameters/index.browser.js +74 -53
  42. package/dist/api/parameters/index.browser.js.map +1 -1
  43. package/dist/api/parameters/index.d.ts +607 -513
  44. package/dist/api/parameters/index.d.ts.map +1 -1
  45. package/dist/api/parameters/index.js +205 -127
  46. package/dist/api/parameters/index.js.map +1 -1
  47. package/dist/api/payments/index.d.ts +652 -449
  48. package/dist/api/payments/index.d.ts.map +1 -1
  49. package/dist/api/payments/index.js +159 -93
  50. package/dist/api/payments/index.js.map +1 -1
  51. package/dist/api/subscriptions/index.d.ts +1032 -762
  52. package/dist/api/subscriptions/index.d.ts.map +1 -1
  53. package/dist/api/subscriptions/index.js +166 -185
  54. package/dist/api/subscriptions/index.js.map +1 -1
  55. package/dist/api/users/index.browser.js +48 -71
  56. package/dist/api/users/index.browser.js.map +1 -1
  57. package/dist/api/users/index.d.ts +1297 -1109
  58. package/dist/api/users/index.d.ts.map +1 -1
  59. package/dist/api/users/index.js +454 -369
  60. package/dist/api/users/index.js.map +1 -1
  61. package/dist/api/verifications/index.browser.js +17 -17
  62. package/dist/api/verifications/index.browser.js.map +1 -1
  63. package/dist/api/verifications/index.d.ts +169 -157
  64. package/dist/api/verifications/index.d.ts.map +1 -1
  65. package/dist/api/verifications/index.js +47 -95
  66. package/dist/api/verifications/index.js.map +1 -1
  67. package/dist/background/index.d.ts +0 -1
  68. package/dist/background/index.d.ts.map +1 -1
  69. package/dist/background/index.js.map +1 -1
  70. package/dist/background/index.workerd.js.map +1 -1
  71. package/dist/batch/index.d.ts +0 -1
  72. package/dist/batch/index.d.ts.map +1 -1
  73. package/dist/batch/index.js.map +1 -1
  74. package/dist/bin/index.js +1 -1
  75. package/dist/bin/index.js.map +1 -1
  76. package/dist/bucket/index.d.ts +27 -32
  77. package/dist/bucket/index.d.ts.map +1 -1
  78. package/dist/bucket/index.js +56 -26
  79. package/dist/bucket/index.js.map +1 -1
  80. package/dist/bucket/index.workerd.js +52 -24
  81. package/dist/bucket/index.workerd.js.map +1 -1
  82. package/dist/cache/core/index.d.ts +4 -6
  83. package/dist/cache/core/index.d.ts.map +1 -1
  84. package/dist/cache/core/index.js +4 -10
  85. package/dist/cache/core/index.js.map +1 -1
  86. package/dist/cache/core/index.workerd.js +4 -10
  87. package/dist/cache/core/index.workerd.js.map +1 -1
  88. package/dist/cache/database/index.d.ts +22 -23
  89. package/dist/cache/database/index.d.ts.map +1 -1
  90. package/dist/cache/database/index.js +11 -20
  91. package/dist/cache/database/index.js.map +1 -1
  92. package/dist/cache/redis/index.d.ts +3 -4
  93. package/dist/cache/redis/index.d.ts.map +1 -1
  94. package/dist/cache/redis/index.js +2 -2
  95. package/dist/cache/redis/index.js.map +1 -1
  96. package/dist/captcha/index.d.ts.map +1 -1
  97. package/dist/captcha/index.js +4 -4
  98. package/dist/captcha/index.js.map +1 -1
  99. package/dist/cli/config/index.d.ts +0 -1
  100. package/dist/cli/config/index.d.ts.map +1 -1
  101. package/dist/cli/core/index.d.ts +244 -475
  102. package/dist/cli/core/index.d.ts.map +1 -1
  103. package/dist/cli/core/index.js +308 -383
  104. package/dist/cli/core/index.js.map +1 -1
  105. package/dist/cli/devtools/index.d.ts +3 -9
  106. package/dist/cli/devtools/index.d.ts.map +1 -1
  107. package/dist/cli/devtools/index.js +3 -3
  108. package/dist/cli/devtools/index.js.map +1 -1
  109. package/dist/cli/i18n/index.d.ts +20 -39
  110. package/dist/cli/i18n/index.d.ts.map +1 -1
  111. package/dist/cli/i18n/index.js +51 -17
  112. package/dist/cli/i18n/index.js.map +1 -1
  113. package/dist/cli/platform/index.d.ts +89 -82
  114. package/dist/cli/platform/index.d.ts.map +1 -1
  115. package/dist/cli/platform/index.js +27 -33
  116. package/dist/cli/platform/index.js.map +1 -1
  117. package/dist/cli/platform-lib/index.d.ts +383 -410
  118. package/dist/cli/platform-lib/index.d.ts.map +1 -1
  119. package/dist/cli/platform-lib/index.js +300 -258
  120. package/dist/cli/platform-lib/index.js.map +1 -1
  121. package/dist/cli/vendor/index.d.ts +17 -41
  122. package/dist/cli/vendor/index.d.ts.map +1 -1
  123. package/dist/cli/vendor/index.js +10 -13
  124. package/dist/cli/vendor/index.js.map +1 -1
  125. package/dist/command/index.d.ts +82 -194
  126. package/dist/command/index.d.ts.map +1 -1
  127. package/dist/command/index.js +160 -563
  128. package/dist/command/index.js.map +1 -1
  129. package/dist/core/index.browser.js +845 -859
  130. package/dist/core/index.browser.js.map +1 -1
  131. package/dist/core/index.d.ts +787 -527
  132. package/dist/core/index.d.ts.map +1 -1
  133. package/dist/core/index.js +845 -859
  134. package/dist/core/index.js.map +1 -1
  135. package/dist/core/index.native.js +845 -859
  136. package/dist/core/index.native.js.map +1 -1
  137. package/dist/core/index.workerd.js +845 -859
  138. package/dist/core/index.workerd.js.map +1 -1
  139. package/dist/crypto/index.browser.js +1 -1
  140. package/dist/crypto/index.browser.js.map +1 -1
  141. package/dist/crypto/index.d.ts +3 -4
  142. package/dist/crypto/index.d.ts.map +1 -1
  143. package/dist/crypto/index.js +6 -3
  144. package/dist/crypto/index.js.map +1 -1
  145. package/dist/datetime/index.d.ts +12 -2
  146. package/dist/datetime/index.d.ts.map +1 -1
  147. package/dist/datetime/index.js +6 -1
  148. package/dist/datetime/index.js.map +1 -1
  149. package/dist/email/brevo/index.d.ts +0 -1
  150. package/dist/email/brevo/index.d.ts.map +1 -1
  151. package/dist/email/brevo/index.js +4 -4
  152. package/dist/email/brevo/index.js.map +1 -1
  153. package/dist/email/cloudflare/index.d.ts +0 -1
  154. package/dist/email/cloudflare/index.d.ts.map +1 -1
  155. package/dist/email/cloudflare/index.js +2 -2
  156. package/dist/email/cloudflare/index.js.map +1 -1
  157. package/dist/email/core/index.d.ts +15 -7
  158. package/dist/email/core/index.d.ts.map +1 -1
  159. package/dist/email/core/index.js +14 -5
  160. package/dist/email/core/index.js.map +1 -1
  161. package/dist/email/core/index.workerd.js +5 -1
  162. package/dist/email/core/index.workerd.js.map +1 -1
  163. package/dist/email/smtp/index.d.ts +8 -9
  164. package/dist/email/smtp/index.d.ts.map +1 -1
  165. package/dist/email/smtp/index.js +702 -479
  166. package/dist/email/smtp/index.js.map +1 -1
  167. package/dist/fake/index.d.ts +1580 -1238
  168. package/dist/fake/index.d.ts.map +1 -1
  169. package/dist/fake/index.js +11728 -32131
  170. package/dist/fake/index.js.map +1 -1
  171. package/dist/lock/core/index.d.ts +13 -9
  172. package/dist/lock/core/index.d.ts.map +1 -1
  173. package/dist/lock/core/index.js +5 -5
  174. package/dist/lock/core/index.js.map +1 -1
  175. package/dist/lock/redis/index.d.ts +0 -1
  176. package/dist/lock/redis/index.d.ts.map +1 -1
  177. package/dist/lock/redis/index.js.map +1 -1
  178. package/dist/logger/index.d.ts +81 -69
  179. package/dist/logger/index.d.ts.map +1 -1
  180. package/dist/logger/index.js +123 -56
  181. package/dist/logger/index.js.map +1 -1
  182. package/dist/mcp/index.d.ts +36 -90
  183. package/dist/mcp/index.d.ts.map +1 -1
  184. package/dist/mcp/index.js +65 -70
  185. package/dist/mcp/index.js.map +1 -1
  186. package/dist/orm/core/index.browser.js +54 -40
  187. package/dist/orm/core/index.browser.js.map +1 -1
  188. package/dist/orm/core/index.bun.js +140 -106
  189. package/dist/orm/core/index.bun.js.map +1 -1
  190. package/dist/orm/core/index.d.ts +145 -150
  191. package/dist/orm/core/index.d.ts.map +1 -1
  192. package/dist/orm/core/index.js +144 -109
  193. package/dist/orm/core/index.js.map +1 -1
  194. package/dist/orm/postgres/index.bun.js +64 -54
  195. package/dist/orm/postgres/index.bun.js.map +1 -1
  196. package/dist/orm/postgres/index.d.ts +36 -76
  197. package/dist/orm/postgres/index.d.ts.map +1 -1
  198. package/dist/orm/postgres/index.js +67 -57
  199. package/dist/orm/postgres/index.js.map +1 -1
  200. package/dist/queue/core/index.d.ts +62 -75
  201. package/dist/queue/core/index.d.ts.map +1 -1
  202. package/dist/queue/core/index.js +48 -71
  203. package/dist/queue/core/index.js.map +1 -1
  204. package/dist/queue/core/index.workerd.js +48 -71
  205. package/dist/queue/core/index.workerd.js.map +1 -1
  206. package/dist/queue/redis/index.d.ts +3 -4
  207. package/dist/queue/redis/index.d.ts.map +1 -1
  208. package/dist/queue/redis/index.js +2 -2
  209. package/dist/queue/redis/index.js.map +1 -1
  210. package/dist/react/auth/index.browser.js.map +1 -1
  211. package/dist/react/auth/index.d.ts +7 -4
  212. package/dist/react/auth/index.d.ts.map +1 -1
  213. package/dist/react/auth/index.js.map +1 -1
  214. package/dist/react/core/index.d.ts +87 -5
  215. package/dist/react/core/index.d.ts.map +1 -1
  216. package/dist/react/core/index.js +170 -23
  217. package/dist/react/core/index.js.map +1 -1
  218. package/dist/react/form/index.d.ts +4 -6
  219. package/dist/react/form/index.d.ts.map +1 -1
  220. package/dist/react/form/index.js +107 -71
  221. package/dist/react/form/index.js.map +1 -1
  222. package/dist/react/head/index.browser.js.map +1 -1
  223. package/dist/react/head/index.d.ts +0 -1
  224. package/dist/react/head/index.d.ts.map +1 -1
  225. package/dist/react/head/index.js.map +1 -1
  226. package/dist/react/i18n/index.d.ts +47 -5
  227. package/dist/react/i18n/index.d.ts.map +1 -1
  228. package/dist/react/i18n/index.js +116 -12
  229. package/dist/react/i18n/index.js.map +1 -1
  230. package/dist/react/intro/index.d.ts +1 -4
  231. package/dist/react/intro/index.d.ts.map +1 -1
  232. package/dist/react/intro/index.js.map +1 -1
  233. package/dist/react/router/index.browser.js +188 -29
  234. package/dist/react/router/index.browser.js.map +1 -1
  235. package/dist/react/router/index.d.ts +480 -372
  236. package/dist/react/router/index.d.ts.map +1 -1
  237. package/dist/react/router/index.js +261 -47
  238. package/dist/react/router/index.js.map +1 -1
  239. package/dist/react/sitemap/index.browser.js +35 -0
  240. package/dist/react/sitemap/index.browser.js.map +1 -0
  241. package/dist/react/sitemap/index.d.ts +91 -0
  242. package/dist/react/sitemap/index.d.ts.map +1 -0
  243. package/dist/react/sitemap/index.js +131 -0
  244. package/dist/react/sitemap/index.js.map +1 -0
  245. package/dist/react/testing/index.d.ts +4 -5
  246. package/dist/react/testing/index.d.ts.map +1 -1
  247. package/dist/react/testing/index.js +41 -15
  248. package/dist/react/testing/index.js.map +1 -1
  249. package/dist/react/testing/{chunk-BpyX8vjI.js → rolldown-runtime-Bl3dcgcQ.js} +1 -1
  250. package/dist/react/ui/index.d.ts +35 -34
  251. package/dist/react/ui/index.d.ts.map +1 -1
  252. package/dist/react/ui/index.js +12 -17
  253. package/dist/react/ui/index.js.map +1 -1
  254. package/dist/redis/index.bun.js +5 -5
  255. package/dist/redis/index.bun.js.map +1 -1
  256. package/dist/redis/index.d.ts +6 -7
  257. package/dist/redis/index.d.ts.map +1 -1
  258. package/dist/redis/index.js +6 -6
  259. package/dist/redis/index.js.map +1 -1
  260. package/dist/retry/index.d.ts +0 -1
  261. package/dist/retry/index.d.ts.map +1 -1
  262. package/dist/retry/index.js.map +1 -1
  263. package/dist/router/index.d.ts.map +1 -1
  264. package/dist/router/index.js.map +1 -1
  265. package/dist/scheduler/index.d.ts +4 -12
  266. package/dist/scheduler/index.d.ts.map +1 -1
  267. package/dist/scheduler/index.js +9 -4
  268. package/dist/scheduler/index.js.map +1 -1
  269. package/dist/scheduler/index.workerd.js +9 -4
  270. package/dist/scheduler/index.workerd.js.map +1 -1
  271. package/dist/security/index.browser.js +30 -28
  272. package/dist/security/index.browser.js.map +1 -1
  273. package/dist/security/index.d.ts +113 -44
  274. package/dist/security/index.d.ts.map +1 -1
  275. package/dist/security/index.js +452 -37
  276. package/dist/security/index.js.map +1 -1
  277. package/dist/server/auth/index.browser.js +19 -19
  278. package/dist/server/auth/index.browser.js.map +1 -1
  279. package/dist/server/auth/index.d.ts +215 -187
  280. package/dist/server/auth/index.d.ts.map +1 -1
  281. package/dist/server/auth/index.js +1145 -86
  282. package/dist/server/auth/index.js.map +1 -1
  283. package/dist/server/cookies/index.browser.js +103 -5
  284. package/dist/server/cookies/index.browser.js.map +1 -1
  285. package/dist/server/cookies/index.d.ts +86 -4
  286. package/dist/server/cookies/index.d.ts.map +1 -1
  287. package/dist/server/cookies/index.js +121 -8
  288. package/dist/server/cookies/index.js.map +1 -1
  289. package/dist/server/core/index.browser.js +22 -27
  290. package/dist/server/core/index.browser.js.map +1 -1
  291. package/dist/server/core/index.d.ts +134 -85
  292. package/dist/server/core/index.d.ts.map +1 -1
  293. package/dist/server/core/index.js +130 -118
  294. package/dist/server/core/index.js.map +1 -1
  295. package/dist/server/cors/index.d.ts +9 -10
  296. package/dist/server/cors/index.d.ts.map +1 -1
  297. package/dist/server/cors/index.js +14 -26
  298. package/dist/server/cors/index.js.map +1 -1
  299. package/dist/server/etag/index.d.ts +2 -3
  300. package/dist/server/etag/index.d.ts.map +1 -1
  301. package/dist/server/etag/index.js.map +1 -1
  302. package/dist/server/health/index.d.ts +18 -19
  303. package/dist/server/health/index.d.ts.map +1 -1
  304. package/dist/server/health/index.js +6 -6
  305. package/dist/server/health/index.js.map +1 -1
  306. package/dist/server/links/index.browser.js +15 -18
  307. package/dist/server/links/index.browser.js.map +1 -1
  308. package/dist/server/links/index.d.ts +66 -67
  309. package/dist/server/links/index.d.ts.map +1 -1
  310. package/dist/server/links/index.js +29 -32
  311. package/dist/server/links/index.js.map +1 -1
  312. package/dist/server/metrics/index.d.ts +0 -1
  313. package/dist/server/metrics/index.d.ts.map +1 -1
  314. package/dist/server/metrics/index.js +10 -3
  315. package/dist/server/metrics/index.js.map +1 -1
  316. package/dist/server/proxy/index.d.ts +0 -1
  317. package/dist/server/proxy/index.d.ts.map +1 -1
  318. package/dist/server/proxy/index.js.map +1 -1
  319. package/dist/server/rate-limit/index.d.ts +8 -9
  320. package/dist/server/rate-limit/index.d.ts.map +1 -1
  321. package/dist/server/rate-limit/index.js +6 -12
  322. package/dist/server/rate-limit/index.js.map +1 -1
  323. package/dist/server/static/index.d.ts +0 -1
  324. package/dist/server/static/index.d.ts.map +1 -1
  325. package/dist/server/static/index.js.map +1 -1
  326. package/dist/server/swagger/index.d.ts +4 -4
  327. package/dist/server/swagger/index.d.ts.map +1 -1
  328. package/dist/server/swagger/index.js +37 -25
  329. package/dist/server/swagger/index.js.map +1 -1
  330. package/dist/sms/index.d.ts +0 -1
  331. package/dist/sms/index.d.ts.map +1 -1
  332. package/dist/sms/index.js.map +1 -1
  333. package/dist/system/index.browser.js.map +1 -1
  334. package/dist/system/index.d.ts +0 -1
  335. package/dist/system/index.d.ts.map +1 -1
  336. package/dist/system/index.js +2 -1
  337. package/dist/system/index.js.map +1 -1
  338. package/dist/system/index.workerd.js.map +1 -1
  339. package/dist/topic/core/index.d.ts +19 -20
  340. package/dist/topic/core/index.d.ts.map +1 -1
  341. package/dist/topic/core/index.js +8 -8
  342. package/dist/topic/core/index.js.map +1 -1
  343. package/dist/topic/redis/index.d.ts +3 -4
  344. package/dist/topic/redis/index.d.ts.map +1 -1
  345. package/dist/topic/redis/index.js +2 -2
  346. package/dist/topic/redis/index.js.map +1 -1
  347. package/package.json +36 -36
  348. package/src/api/audits/__tests__/AuditJobs.spec.ts +83 -0
  349. package/src/api/audits/__tests__/AuditService.spec.ts +139 -1
  350. package/src/api/audits/controllers/AdminAuditController.ts +41 -41
  351. package/src/api/audits/entities/audits.ts +22 -22
  352. package/src/api/audits/index.ts +6 -1
  353. package/src/api/audits/jobs/AuditJobs.ts +29 -0
  354. package/src/api/audits/parameters/AuditParameters.ts +51 -0
  355. package/src/api/audits/primitives/$audit.ts +24 -0
  356. package/src/api/audits/schemas/auditQuerySchema.ts +13 -13
  357. package/src/api/audits/schemas/createAuditSchema.ts +18 -18
  358. package/src/api/audits/services/AuditService.ts +79 -7
  359. package/src/api/files/__tests__/FileController.spec.ts +5 -5
  360. package/src/api/files/__tests__/FileJobs.spec.ts +6 -0
  361. package/src/api/files/controllers/FileController.ts +25 -25
  362. package/src/api/files/entities/files.ts +15 -15
  363. package/src/api/files/schemas/fileCreatorSummarySchema.ts +7 -7
  364. package/src/api/files/schemas/fileQuerySchema.ts +9 -9
  365. package/src/api/files/schemas/fileResourceSchema.ts +7 -9
  366. package/src/api/files/schemas/storageStatsSchema.ts +13 -13
  367. package/src/api/jobs/__tests__/$job-hardening.spec.ts +289 -0
  368. package/src/api/jobs/__tests__/$job.spec.ts +18 -18
  369. package/src/api/jobs/controllers/AdminJobController.ts +8 -8
  370. package/src/api/jobs/entities/jobExecutionEntity.ts +29 -19
  371. package/src/api/jobs/providers/JobProvider.ts +128 -12
  372. package/src/api/jobs/providers/JobQueueProvider.ts +2 -2
  373. package/src/api/jobs/schemas/jobConfigAtom.ts +22 -22
  374. package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +6 -6
  375. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -15
  376. package/src/api/jobs/schemas/jobRegistrationSchema.ts +20 -19
  377. package/src/api/jobs/schemas/triggerJobSchema.ts +3 -3
  378. package/src/api/jobs/services/JobService.ts +6 -6
  379. package/src/api/keys/__tests__/ApiKeyService.spec.ts +2 -2
  380. package/src/api/keys/controllers/AdminApiKeyController.ts +10 -10
  381. package/src/api/keys/entities/apiKeyEntity.ts +15 -15
  382. package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +4 -4
  383. package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +15 -15
  384. package/src/api/keys/schemas/createApiKeyBodySchema.ts +5 -5
  385. package/src/api/keys/schemas/createApiKeyResponseSchema.ts +9 -9
  386. package/src/api/keys/schemas/listApiKeyResponseSchema.ts +13 -13
  387. package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +3 -3
  388. package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +3 -3
  389. package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +2 -2
  390. package/src/api/notifications/controllers/AdminNotificationController.ts +38 -14
  391. package/src/api/notifications/jobs/NotificationJobs.ts +7 -6
  392. package/src/api/notifications/primitives/$notification.ts +43 -4
  393. package/src/api/notifications/schemas/notificationContactPreferencesSchema.ts +4 -4
  394. package/src/api/notifications/schemas/notificationContactSchema.ts +7 -7
  395. package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +9 -11
  396. package/src/api/notifications/schemas/notificationPayloadSchema.ts +11 -9
  397. package/src/api/notifications/schemas/notificationQuerySchema.ts +6 -6
  398. package/src/api/notifications/schemas/notificationResourceSchema.ts +14 -14
  399. package/src/api/notifications/services/NotificationSenderService.ts +38 -2
  400. package/src/api/oauth/__tests__/OAuthClientService.spec.ts +42 -0
  401. package/src/api/oauth/__tests__/OAuthController.spec.ts +128 -0
  402. package/src/api/oauth/controllers/OAuthController.ts +132 -12
  403. package/src/api/oauth/entities/oauthClientEntity.ts +29 -12
  404. package/src/api/oauth/helpers/oauthMetadata.ts +1 -0
  405. package/src/api/oauth/helpers/oidcMetadata.ts +19 -0
  406. package/src/api/oauth/index.ts +1 -0
  407. package/src/api/oauth/schemas/authorizeDecisionBodySchema.ts +12 -11
  408. package/src/api/oauth/schemas/authorizeQuerySchema.ts +12 -10
  409. package/src/api/oauth/schemas/registerClientBodySchema.ts +10 -11
  410. package/src/api/oauth/schemas/tokenRequestBodySchema.ts +9 -8
  411. package/src/api/oauth/services/OAuthClientService.ts +228 -15
  412. package/src/api/organizations/controllers/AdminOrganizationController.ts +8 -8
  413. package/src/api/organizations/entities/organizations.ts +6 -6
  414. package/src/api/organizations/schemas/createOrganizationSchema.ts +5 -5
  415. package/src/api/organizations/schemas/organizationQuerySchema.ts +4 -4
  416. package/src/api/organizations/schemas/updateOrganizationSchema.ts +1 -2
  417. package/src/api/parameters/__tests__/$parameter.spec.ts +229 -50
  418. package/src/api/parameters/controllers/AdminParameterController.ts +9 -12
  419. package/src/api/parameters/entities/parameters.ts +29 -16
  420. package/src/api/parameters/primitives/$parameter.ts +3 -3
  421. package/src/api/parameters/schemas/activateParameterBodySchema.ts +4 -4
  422. package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +15 -15
  423. package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +7 -7
  424. package/src/api/parameters/schemas/parameterCurrentResponseSchema.ts +7 -7
  425. package/src/api/parameters/schemas/parameterHistoryResponseSchema.ts +3 -3
  426. package/src/api/parameters/schemas/parameterNameParamSchema.ts +2 -3
  427. package/src/api/parameters/schemas/parameterNamesResponseSchema.ts +3 -3
  428. package/src/api/parameters/schemas/parameterResponseSchema.ts +3 -3
  429. package/src/api/parameters/schemas/parameterStatusSchema.ts +2 -2
  430. package/src/api/parameters/schemas/parameterTreeNodeSchema.ts +6 -6
  431. package/src/api/parameters/schemas/parameterVersionParamSchema.ts +5 -6
  432. package/src/api/parameters/schemas/parameterVersionResponseSchema.ts +3 -3
  433. package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +6 -9
  434. package/src/api/parameters/services/ParameterProvider.ts +152 -65
  435. package/src/api/payments/controllers/AdminPaymentController.ts +7 -7
  436. package/src/api/payments/controllers/MockCheckoutController.ts +79 -28
  437. package/src/api/payments/controllers/PaymentController.ts +4 -4
  438. package/src/api/payments/entities/paymentIntents.ts +11 -11
  439. package/src/api/payments/entities/paymentMethods.ts +11 -11
  440. package/src/api/payments/entities/refunds.ts +9 -9
  441. package/src/api/payments/providers/PaymentProvider.ts +18 -0
  442. package/src/api/payments/schemas/intentSchemas.ts +25 -25
  443. package/src/api/payments/schemas/paymentMethodSchemas.ts +3 -3
  444. package/src/api/payments/services/PaymentService.ts +60 -3
  445. package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +14 -0
  446. package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +11 -11
  447. package/src/api/subscriptions/controllers/SubscriptionController.ts +5 -4
  448. package/src/api/subscriptions/entities/subscriptionEvents.ts +15 -15
  449. package/src/api/subscriptions/entities/subscriptions.ts +22 -22
  450. package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +22 -22
  451. package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +4 -4
  452. package/src/api/subscriptions/schemas/changePlanSchema.ts +5 -5
  453. package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +14 -7
  454. package/src/api/subscriptions/schemas/entitlementsSchema.ts +10 -10
  455. package/src/api/subscriptions/schemas/mrrSchema.ts +9 -9
  456. package/src/api/subscriptions/schemas/planDefinitionSchema.ts +21 -21
  457. package/src/api/subscriptions/schemas/planResourceSchema.ts +19 -19
  458. package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +8 -8
  459. package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +7 -7
  460. package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +17 -17
  461. package/src/api/subscriptions/services/SubscriptionConfig.ts +2 -2
  462. package/src/api/users/__tests__/ApiKeys-integration.spec.ts +11 -11
  463. package/src/api/users/atoms/realmAuthSettingsAtom.ts +111 -119
  464. package/src/api/users/controllers/AdminIdentityController.ts +29 -19
  465. package/src/api/users/controllers/AdminSessionController.ts +37 -27
  466. package/src/api/users/controllers/AdminUserController.ts +75 -53
  467. package/src/api/users/controllers/MySessionController.ts +125 -0
  468. package/src/api/users/controllers/RealmController.ts +9 -9
  469. package/src/api/users/controllers/UserController.ts +55 -55
  470. package/src/api/users/entities/identities.ts +8 -8
  471. package/src/api/users/entities/sessions.ts +17 -17
  472. package/src/api/users/entities/users.ts +17 -17
  473. package/src/api/users/index.ts +3 -0
  474. package/src/api/users/notifications/UserNotifications.ts +76 -24
  475. package/src/api/users/primitives/$realm.ts +12 -0
  476. package/src/api/users/schemas/completePasswordResetRequestSchema.ts +8 -12
  477. package/src/api/users/schemas/completeRegistrationRequestSchema.ts +17 -20
  478. package/src/api/users/schemas/createUserSchema.ts +2 -2
  479. package/src/api/users/schemas/identityQuerySchema.ts +4 -4
  480. package/src/api/users/schemas/identityResourceSchema.ts +3 -2
  481. package/src/api/users/schemas/loginSchema.ts +4 -4
  482. package/src/api/users/schemas/passwordResetIntentResponseSchema.ts +6 -8
  483. package/src/api/users/schemas/realmConfigSchema.ts +10 -10
  484. package/src/api/users/schemas/registerQuerySchema.ts +6 -6
  485. package/src/api/users/schemas/registerRequestSchema.ts +21 -43
  486. package/src/api/users/schemas/registerResponseSchema.ts +2 -2
  487. package/src/api/users/schemas/registerSchema.ts +13 -31
  488. package/src/api/users/schemas/registrationIntentResponseSchema.ts +19 -23
  489. package/src/api/users/schemas/resetPasswordSchema.ts +10 -17
  490. package/src/api/users/schemas/sessionQuerySchema.ts +3 -3
  491. package/src/api/users/schemas/sessionResourceSchema.ts +25 -25
  492. package/src/api/users/schemas/updateUserSchema.ts +3 -4
  493. package/src/api/users/schemas/userQuerySchema.ts +7 -7
  494. package/src/api/users/services/RegistrationService.ts +25 -11
  495. package/src/api/users/services/UserService.ts +12 -6
  496. package/src/api/verifications/__tests__/CodeVerification.spec.ts +63 -101
  497. package/src/api/verifications/__tests__/LinkVerification.spec.ts +23 -92
  498. package/src/api/verifications/controllers/VerificationController.ts +13 -27
  499. package/src/api/verifications/entities/verifications.ts +13 -14
  500. package/src/api/verifications/schemas/requestVerificationCodeResponseSchema.ts +17 -14
  501. package/src/api/verifications/schemas/validateVerificationCodeResponseSchema.ts +9 -10
  502. package/src/api/verifications/schemas/verificationSettingsSchema.ts +65 -66
  503. package/src/api/verifications/schemas/verificationTypeEnumSchema.ts +2 -2
  504. package/src/api/verifications/services/VerificationService.ts +12 -0
  505. package/src/background/__tests__/BackgroundTaskProvider.spec.ts +36 -0
  506. package/src/batch/__tests__/$batch.spec.ts +22 -22
  507. package/src/batch/__tests__/startup-buffering.spec.ts +9 -9
  508. package/src/bin/index.ts +1 -1
  509. package/src/bucket/__tests__/TenantScopedBucket.spec.ts +60 -0
  510. package/src/bucket/providers/LocalFileStorageProvider.ts +14 -6
  511. package/src/bucket/providers/MemoryFileStorageProvider.ts +18 -7
  512. package/src/bucket/providers/R2FileStorageProvider.ts +14 -6
  513. package/src/bucket/providers/S3FileStorageProvider.ts +31 -15
  514. package/src/cache/core/primitives/$cache.ts +7 -10
  515. package/src/cache/database/entities/cacheEntries.ts +16 -27
  516. package/src/cache/database/providers/DatabaseCacheProvider.ts +15 -13
  517. package/src/cache/redis/providers/RedisCacheProvider.ts +6 -6
  518. package/src/captcha/providers/TurnstileCaptchaProvider.ts +4 -4
  519. package/src/cli/core/__tests__/BuildCloudflareTask.spec.ts +178 -0
  520. package/src/cli/core/__tests__/BuildDockerTask.spec.ts +0 -2
  521. package/src/cli/core/__tests__/DbCommand.spec.ts +108 -0
  522. package/src/cli/core/atoms/appEntryOptions.ts +5 -5
  523. package/src/cli/core/atoms/buildOptions.ts +76 -88
  524. package/src/cli/core/atoms/changelogOptions.ts +3 -3
  525. package/src/cli/core/atoms/devOptions.ts +3 -3
  526. package/src/cli/core/commands/build.ts +36 -49
  527. package/src/cli/core/commands/db.ts +171 -83
  528. package/src/cli/core/commands/dev.ts +8 -8
  529. package/src/cli/core/commands/gen/changelog.ts +12 -14
  530. package/src/cli/core/commands/gen/env.ts +6 -6
  531. package/src/cli/core/commands/gen/openapi.ts +6 -6
  532. package/src/cli/core/commands/init.ts +28 -33
  533. package/src/cli/core/commands/pack.ts +10 -10
  534. package/src/cli/core/commands/root.ts +7 -8
  535. package/src/cli/core/commands/test.ts +17 -20
  536. package/src/cli/core/index.ts +0 -3
  537. package/src/cli/core/tasks/BuildCloudflareTask.ts +138 -245
  538. package/src/cli/core/tasks/BuildPrerenderTask.ts +44 -7
  539. package/src/cli/core/templates/apiHelloResponseSchemaTs.ts +4 -4
  540. package/src/cli/devtools/atoms/devtoolsOptions.ts +6 -6
  541. package/src/cli/i18n/__tests__/I18nCheckService.spec.ts +48 -0
  542. package/src/cli/i18n/atoms/i18nOptions.ts +8 -8
  543. package/src/cli/i18n/services/I18nCheckService.ts +65 -11
  544. package/src/cli/platform/commands/SecretsCommand.ts +24 -25
  545. package/src/cli/platform/commands/platform.ts +40 -46
  546. package/src/cli/platform/index.ts +1 -1
  547. package/src/cli/platform-lib/__tests__/CloudflareAdapter.spec.ts +0 -4
  548. package/src/cli/platform-lib/__tests__/PlatformInspector.spec.ts +10 -3
  549. package/src/cli/platform-lib/__tests__/VercelAdapter.spec.ts +0 -2
  550. package/src/cli/platform-lib/adapters/CloudflareAdapter.ts +141 -50
  551. package/src/cli/platform-lib/adapters/VercelAdapter.ts +6 -11
  552. package/src/cli/platform-lib/atoms/platformOptions.ts +46 -25
  553. package/src/cli/platform-lib/schemas/cloudflare.ts +87 -87
  554. package/src/cli/platform-lib/schemas/platform.ts +51 -51
  555. package/src/cli/platform-lib/schemas/vercel.ts +28 -28
  556. package/src/cli/platform-lib/services/CloudflareApi.ts +5 -5
  557. package/src/cli/platform-lib/services/VercelApi.ts +4 -4
  558. package/src/cli/platform-lib/services/VercelCli.ts +6 -15
  559. package/src/cli/platform-lib/services/WranglerApi.ts +6 -15
  560. package/src/cli/vendor/atoms/vendorOptions.ts +9 -9
  561. package/src/cli/vendor/commands/VendorCommand.ts +11 -12
  562. package/src/command/__tests__/$command.spec.ts +82 -83
  563. package/src/command/__tests__/Asker.spec.ts +6 -13
  564. package/src/command/__tests__/CliProvider.spec.ts +136 -149
  565. package/src/command/__tests__/Runner.spec.ts +86 -110
  566. package/src/command/helpers/Asker.ts +23 -58
  567. package/src/command/helpers/Runner.ts +34 -110
  568. package/src/command/index.ts +4 -9
  569. package/src/command/primitives/$command.ts +10 -10
  570. package/src/command/providers/CliProvider.ts +183 -161
  571. package/src/core/Alepha.ts +62 -13
  572. package/src/core/__tests__/$atom.spec.ts +52 -3
  573. package/src/core/__tests__/$computed.spec.ts +129 -0
  574. package/src/core/__tests__/$env.spec.ts +13 -13
  575. package/src/core/__tests__/$inject.spec.ts +4 -4
  576. package/src/core/__tests__/$module.spec.ts +1 -1
  577. package/src/core/__tests__/Alepha-graph.spec.ts +1 -1
  578. package/src/core/__tests__/Alepha-parseEnv.spec.ts +32 -32
  579. package/src/core/__tests__/Alepha-start.spec.ts +3 -3
  580. package/src/core/__tests__/CodecManager.spec.ts +113 -94
  581. package/src/core/__tests__/KeylessJsonSchemaCodec.spec.ts +138 -138
  582. package/src/core/__tests__/SchemaValidator.spec.ts +43 -44
  583. package/src/core/__tests__/StateManager.persist.browser.spec.ts +87 -0
  584. package/src/core/__tests__/StateManager.spec.ts +423 -0
  585. package/src/core/__tests__/TypeBox-usecases.spec.ts +8 -8
  586. package/src/core/__tests__/TypeProvider.spec.ts +314 -309
  587. package/src/core/__tests__/dump.spec.ts +6 -6
  588. package/src/core/__tests__/pagination.spec.ts +4 -4
  589. package/src/core/__tests__/scoped-after-start.spec.ts +43 -0
  590. package/src/core/errors/TypeBoxError.ts +10 -4
  591. package/src/core/helpers/FileLike.ts +5 -5
  592. package/src/core/helpers/coerceStrings.ts +70 -0
  593. package/src/core/helpers/jsonSchemaToZod.ts +112 -0
  594. package/src/core/index.shared.ts +4 -1
  595. package/src/core/primitives/$atom.ts +95 -27
  596. package/src/core/primitives/$computed.ts +148 -0
  597. package/src/core/primitives/$env.ts +5 -5
  598. package/src/core/primitives/$state.ts +1 -1
  599. package/src/core/providers/AlsProvider.ts +26 -0
  600. package/src/core/providers/CodecManager.ts +1 -2
  601. package/src/core/providers/JsonSchemaCodec.ts +1 -2
  602. package/src/core/providers/KeylessJsonSchemaCodec.ts +82 -57
  603. package/src/core/providers/SchemaValidator.ts +48 -158
  604. package/src/core/providers/StateManager.ts +383 -9
  605. package/src/core/providers/TypeProvider.ts +80 -734
  606. package/src/core/providers/ZodProvider.ts +380 -0
  607. package/src/core/providers/zodAugment.ts +69 -0
  608. package/src/core/schemas/pageQuerySchema.ts +19 -21
  609. package/src/core/schemas/pageSchema.ts +47 -57
  610. package/src/crypto/__tests__/SecretProvider.spec.ts +31 -0
  611. package/src/crypto/providers/SecretProvider.ts +16 -10
  612. package/src/datetime/primitives/$throttle.ts +6 -1
  613. package/src/email/brevo/providers/BrevoEmailProvider.ts +4 -4
  614. package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +6 -6
  615. package/src/email/core/index.ts +7 -2
  616. package/src/email/core/primitives/$email.ts +5 -1
  617. package/src/email/core/providers/LocalEmailProvider.ts +5 -5
  618. package/src/email/smtp/providers/NodemailerEmailProvider.ts +41 -52
  619. package/src/fake/__tests__/FakeProvider.spec.ts +110 -110
  620. package/src/fake/__tests__/keyName.example.ts +21 -21
  621. package/src/fake/__tests__/keyName.spec.ts +41 -41
  622. package/src/fake/__tests__/module.example.ts +8 -8
  623. package/src/fake/providers/FakeProvider.ts +122 -121
  624. package/src/lock/core/__tests__/lock-mutual-exclusion.spec.ts +44 -0
  625. package/src/lock/core/index.ts +1 -0
  626. package/src/lock/core/primitives/$lock.ts +13 -6
  627. package/src/logger/__tests__/CliFormatterProvider.spec.ts +76 -0
  628. package/src/logger/__tests__/Logger.spec.ts +49 -0
  629. package/src/logger/index.ts +25 -18
  630. package/src/logger/providers/CliFormatterProvider.ts +75 -0
  631. package/src/logger/schemas/logEntrySchema.ts +10 -10
  632. package/src/logger/services/Logger.ts +18 -0
  633. package/src/mcp/__tests__/$prompt.spec.ts +21 -23
  634. package/src/mcp/__tests__/$tool.spec.ts +22 -22
  635. package/src/mcp/__tests__/McpServerProvider.spec.ts +82 -11
  636. package/src/mcp/__tests__/StreamableHttpMcpTransport.spec.ts +2 -2
  637. package/src/mcp/__tests__/integration.spec.ts +33 -33
  638. package/src/mcp/primitives/$prompt.ts +11 -9
  639. package/src/mcp/primitives/$tool.ts +27 -86
  640. package/src/mcp/providers/McpServerProvider.ts +55 -0
  641. package/src/mcp/transports/StreamableHttpMcpTransport.ts +7 -7
  642. package/src/orm/__tests__/$repository-tests.ts +133 -27
  643. package/src/orm/__tests__/$repository.spec.ts +23 -0
  644. package/src/orm/__tests__/$transactional-tests.ts +4 -4
  645. package/src/orm/__tests__/ModelBuilder-tests.ts +28 -28
  646. package/src/orm/__tests__/ModelBuilder.spec.ts +124 -106
  647. package/src/orm/__tests__/QueryManager.spec.ts +5 -5
  648. package/src/orm/__tests__/delete-returning-tests.ts +11 -11
  649. package/src/orm/__tests__/deletedAt-tests.ts +3 -3
  650. package/src/orm/__tests__/enums.spec.ts +29 -25
  651. package/src/orm/__tests__/execute-tests.ts +8 -8
  652. package/src/orm/__tests__/fixtures/bigEntitySchema.ts +48 -48
  653. package/src/orm/__tests__/fixtures/userEntitySchema.ts +6 -6
  654. package/src/orm/__tests__/joins-tests.ts +30 -30
  655. package/src/orm/__tests__/organization-tests.ts +105 -3
  656. package/src/orm/__tests__/organization.spec.ts +46 -0
  657. package/src/orm/__tests__/orm-errors.spec.ts +10 -10
  658. package/src/orm/__tests__/orm-next-tests.ts +29 -29
  659. package/src/orm/__tests__/orm-showcase-tests.ts +9 -9
  660. package/src/orm/__tests__/primaryKey.spec.ts +4 -4
  661. package/src/orm/__tests__/query-date-encoding-tests.ts +17 -17
  662. package/src/orm/__tests__/ref-auto-onDelete.spec.ts +14 -14
  663. package/src/orm/__tests__/references.spec.ts +7 -7
  664. package/src/orm/__tests__/security.spec.ts +17 -17
  665. package/src/orm/__tests__/string-operators-tests.ts +5 -5
  666. package/src/orm/__tests__/timestamps-tests.ts +14 -14
  667. package/src/orm/__tests__/validation-tests.ts +5 -5
  668. package/src/orm/core/__tests__/BunSqliteProvider.bun.spec.ts +8 -8
  669. package/src/orm/core/constants/PG_SYMBOLS.ts +13 -1
  670. package/src/orm/core/entities/alephaSequences.ts +8 -8
  671. package/src/orm/core/helpers/pgAttr.ts +4 -4
  672. package/src/orm/core/primitives/$entity.ts +10 -6
  673. package/src/orm/core/providers/DatabaseTypeProvider.ts +46 -53
  674. package/src/orm/core/providers/drivers/BunSqliteProvider.ts +8 -8
  675. package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +3 -5
  676. package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +8 -8
  677. package/src/orm/core/schemas/databaseEnvSchema.ts +4 -4
  678. package/src/orm/core/schemas/insertSchema.ts +14 -18
  679. package/src/orm/core/schemas/legacyIdSchema.ts +2 -2
  680. package/src/orm/core/schemas/updateSchema.ts +10 -16
  681. package/src/orm/core/services/PgRelationManager.ts +2 -2
  682. package/src/orm/core/services/QueryManager.ts +13 -2
  683. package/src/orm/core/services/Repository.ts +88 -33
  684. package/src/orm/core/services/SqliteModelBuilder.ts +38 -45
  685. package/src/orm/postgres/__tests__/BunPostgresProvider.bun.spec.ts +4 -4
  686. package/src/orm/postgres/providers/CloudflareHyperdriveProvider.ts +4 -6
  687. package/src/orm/postgres/schemas/postgresEnvSchema.ts +6 -6
  688. package/src/orm/postgres/services/PostgresModelBuilder.ts +127 -114
  689. package/src/queue/core/__tests__/$consumer.spec.ts +4 -4
  690. package/src/queue/core/__tests__/WorkerProvider.spec.ts +4 -4
  691. package/src/queue/core/__tests__/shared.ts +6 -6
  692. package/src/queue/core/primitives/$consumer.ts +5 -5
  693. package/src/queue/core/primitives/$queue.ts +44 -61
  694. package/src/queue/core/providers/CloudflareQueueProvider.ts +6 -0
  695. package/src/queue/core/providers/WorkerProvider.ts +17 -14
  696. package/src/queue/redis/providers/RedisQueueProvider.ts +3 -3
  697. package/src/react/core/__tests__/ErrorBoundary.browser.spec.tsx +92 -0
  698. package/src/react/core/__tests__/Router.spec.tsx +4 -4
  699. package/src/react/core/__tests__/useComputed.browser.spec.tsx +192 -0
  700. package/src/react/core/__tests__/useQuery.browser.spec.tsx +48 -0
  701. package/src/react/core/__tests__/useSelector.browser.spec.tsx +105 -0
  702. package/src/react/core/__tests__/useStore.browser.spec.tsx +113 -0
  703. package/src/react/core/components/ErrorBoundary.tsx +42 -0
  704. package/src/react/core/hooks/useAction.ts +56 -19
  705. package/src/react/core/hooks/useComputed.ts +91 -0
  706. package/src/react/core/hooks/useSelector.ts +67 -0
  707. package/src/react/core/hooks/useStore.ts +36 -17
  708. package/src/react/core/index.ts +3 -0
  709. package/src/react/core/utils/shallowEqual.ts +36 -0
  710. package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +71 -0
  711. package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +96 -0
  712. package/src/react/form/__tests__/useForm.browser.spec.tsx +54 -54
  713. package/src/react/form/errors/FormValidationError.ts +0 -2
  714. package/src/react/form/hooks/useForm.ts +19 -4
  715. package/src/react/form/hooks/useFormQuerySync.ts +0 -0
  716. package/src/react/form/services/FormModel.ts +124 -86
  717. package/src/react/form/services/parseField.ts +66 -27
  718. package/src/react/i18n/__tests__/I18nProvider.spec.ts +89 -0
  719. package/src/react/i18n/__tests__/Localize.spec.tsx +1 -1
  720. package/src/react/i18n/__tests__/locale-routing.spec.ts +107 -0
  721. package/src/react/i18n/providers/I18nProvider.ts +173 -14
  722. package/src/react/router/__tests__/$page.browser.spec.tsx +19 -19
  723. package/src/react/router/__tests__/$page.spec.tsx +21 -21
  724. package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +87 -1
  725. package/src/react/router/__tests__/RouterLocaleProvider.spec.ts +127 -0
  726. package/src/react/router/atoms/ssrManifestAtom.ts +16 -16
  727. package/src/react/router/components/NestedView.tsx +11 -3
  728. package/src/react/router/hooks/useQueryParams.ts +1 -1
  729. package/src/react/router/index.browser.ts +4 -0
  730. package/src/react/router/index.shared.ts +1 -0
  731. package/src/react/router/index.ts +9 -0
  732. package/src/react/router/primitives/$page.ts +2 -2
  733. package/src/react/router/providers/ReactBrowserProvider.ts +64 -13
  734. package/src/react/router/providers/ReactBrowserRouterProvider.ts +15 -1
  735. package/src/react/router/providers/ReactPageProvider.ts +38 -13
  736. package/src/react/router/providers/ReactServerProvider.ts +105 -16
  737. package/src/react/router/providers/RootComponentsProvider.ts +13 -0
  738. package/src/react/router/providers/RouterLocaleProvider.ts +125 -0
  739. package/src/react/router/providers/__tests__/RootComponentsProvider.spec.ts +15 -0
  740. package/src/react/router/providers/__tests__/rootComponents.ssr.browser.spec.tsx +67 -0
  741. package/src/react/sitemap/__tests__/$sitemap.spec.ts +131 -0
  742. package/src/react/sitemap/index.browser.ts +21 -0
  743. package/src/react/sitemap/index.ts +25 -0
  744. package/src/react/sitemap/primitives/$sitemap.browser.ts +26 -0
  745. package/src/react/sitemap/primitives/$sitemap.ts +196 -0
  746. package/src/react/ui/atoms/uiAtom.ts +6 -6
  747. package/src/react/ui/atoms/uiThemeListAtom.ts +7 -7
  748. package/src/react/ui/hooks/useColorMode.ts +11 -4
  749. package/src/react/ui/services/SchemaControl.ts +4 -4
  750. package/src/redis/providers/BunRedisProvider.ts +19 -11
  751. package/src/redis/providers/NodeRedisProvider.ts +3 -3
  752. package/src/scheduler/primitives/$scheduler.ts +21 -8
  753. package/src/security/__tests__/assertRealmScope.spec.ts +29 -0
  754. package/src/security/atoms/currentTenantAtom.ts +6 -6
  755. package/src/security/atoms/currentUserAtom.ts +2 -2
  756. package/src/security/primitives/$issuer.ts +24 -2
  757. package/src/security/providers/JwtProvider.ts +100 -0
  758. package/src/security/providers/SecurityProvider.ts +43 -2
  759. package/src/security/schemas/permissionSchema.ts +19 -19
  760. package/src/security/schemas/roleSchema.ts +22 -28
  761. package/src/security/schemas/userAccountInfoSchema.ts +47 -37
  762. package/src/server/auth/__tests__/appleClientSecret.spec.ts +34 -0
  763. package/src/server/auth/__tests__/federationRedirectReplay.spec.ts +44 -0
  764. package/src/server/auth/helpers/appleClientSecret.ts +24 -0
  765. package/src/server/auth/helpers/jtiReplayGuard.ts +41 -0
  766. package/src/server/auth/helpers/safeRedirectPath.ts +19 -0
  767. package/src/server/auth/index.ts +1 -0
  768. package/src/server/auth/primitives/$auth.ts +6 -6
  769. package/src/server/auth/primitives/$authApple.ts +10 -10
  770. package/src/server/auth/primitives/$authFacebook.ts +10 -10
  771. package/src/server/auth/primitives/$authFranceConnect.ts +10 -10
  772. package/src/server/auth/primitives/$authGithub.ts +10 -10
  773. package/src/server/auth/primitives/$authGoogle.ts +10 -10
  774. package/src/server/auth/primitives/$authMicrosoft.ts +14 -14
  775. package/src/server/auth/providers/ServerAuthProvider.ts +67 -52
  776. package/src/server/auth/schemas/authenticationProviderSchema.ts +9 -12
  777. package/src/server/auth/schemas/tokenResponseSchema.ts +2 -2
  778. package/src/server/auth/schemas/tokensSchema.ts +16 -16
  779. package/src/server/auth/schemas/userinfoResponseSchema.ts +3 -3
  780. package/src/server/cookies/__tests__/AtomCookieBinding.spec.ts +80 -0
  781. package/src/server/cookies/__tests__/AtomCookiePersistence.browser.spec.ts +169 -0
  782. package/src/server/cookies/__tests__/AtomCookiePersistence.spec.ts +294 -0
  783. package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +82 -12
  784. package/src/server/cookies/index.browser.ts +4 -1
  785. package/src/server/cookies/index.ts +8 -1
  786. package/src/server/cookies/primitives/$cookie.browser.ts +1 -1
  787. package/src/server/cookies/primitives/$cookie.ts +16 -0
  788. package/src/server/cookies/providers/AtomCookiePersistence.browser.ts +133 -0
  789. package/src/server/cookies/providers/AtomCookiePersistence.ts +148 -0
  790. package/src/server/cookies/providers/ServerCookiesProvider.ts +32 -4
  791. package/src/server/cookies/services/CookieParser.ts +6 -1
  792. package/src/server/core/__tests__/$action.spec.ts +13 -13
  793. package/src/server/core/__tests__/$middleware.spec.ts +10 -10
  794. package/src/server/core/__tests__/$route.spec.ts +9 -9
  795. package/src/server/core/__tests__/$sse.spec.ts +26 -26
  796. package/src/server/core/__tests__/BunHttpServerProvider.bun.spec.ts +6 -6
  797. package/src/server/core/__tests__/HttpClient.spec.ts +2 -2
  798. package/src/server/core/__tests__/NodeHttpServerProvider.spec.ts +15 -3
  799. package/src/server/core/__tests__/ServerBodyParserProvider.spec.ts +14 -14
  800. package/src/server/core/__tests__/ServerMultipartProvider.spec.ts +33 -33
  801. package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +5 -1
  802. package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +25 -25
  803. package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +9 -5
  804. package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +56 -24
  805. package/src/server/core/errors/ValidationError.ts +6 -3
  806. package/src/server/core/helpers/isMultipart.ts +2 -1
  807. package/src/server/core/index.ts +5 -2
  808. package/src/server/core/interfaces/ServerRequest.ts +14 -14
  809. package/src/server/core/primitives/$action.ts +26 -36
  810. package/src/server/core/primitives/$route.ts +27 -0
  811. package/src/server/core/primitives/$sse.ts +3 -3
  812. package/src/server/core/providers/BunHttpServerProvider.ts +8 -9
  813. package/src/server/core/providers/NodeHttpServerProvider.ts +8 -9
  814. package/src/server/core/providers/ServerBodyParserProvider.ts +20 -12
  815. package/src/server/core/providers/ServerCompressProvider.ts +9 -10
  816. package/src/server/core/providers/ServerHelmetProvider.ts +26 -27
  817. package/src/server/core/providers/ServerMultipartProvider.ts +19 -19
  818. package/src/server/core/providers/ServerRouterProvider.ts +44 -15
  819. package/src/server/core/schemas/errorSchema.ts +20 -25
  820. package/src/server/core/schemas/okSchema.ts +9 -14
  821. package/src/server/core/services/HttpClient.ts +13 -1
  822. package/src/server/core/services/ServerRequestParser.ts +6 -6
  823. package/src/server/cors/providers/ServerCorsProvider.ts +26 -28
  824. package/src/server/health/schemas/healthSchema.ts +6 -6
  825. package/src/server/links/__tests__/$remote.spec.ts +3 -3
  826. package/src/server/links/__tests__/BatchEndpoint.spec.ts +9 -9
  827. package/src/server/links/__tests__/LinkProvider.spec.ts +9 -9
  828. package/src/server/links/__tests__/ServerLinksProvider.spec.ts +23 -23
  829. package/src/server/links/__tests__/fixtures/CrudApp.ts +21 -21
  830. package/src/server/links/atoms/apiLinksAtom.ts +2 -2
  831. package/src/server/links/atoms/linkOptionsAtom.ts +6 -6
  832. package/src/server/links/primitives/$remote.ts +3 -3
  833. package/src/server/links/providers/LinkProvider.ts +3 -3
  834. package/src/server/links/providers/ServerLinksProvider.ts +20 -20
  835. package/src/server/links/schemas/apiLinksResponseSchema.ts +23 -23
  836. package/src/server/proxy/__tests__/$proxy.spec.ts +9 -9
  837. package/src/server/proxy/providers/ServerProxyProvider.ts +5 -0
  838. package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +18 -20
  839. package/src/server/swagger/__tests__/$swagger.spec.ts +91 -94
  840. package/src/server/swagger/__tests__/ui.spec.ts +3 -3
  841. package/src/server/swagger/providers/ServerSwaggerProvider.ts +66 -43
  842. package/src/system/__tests__/NodeShellProvider.spec.ts +46 -0
  843. package/src/system/providers/NodeShellProvider.ts +4 -1
  844. package/src/topic/core/__tests__/$subscriber.spec.ts +4 -4
  845. package/src/topic/core/__tests__/shared.ts +8 -8
  846. package/src/topic/core/primitives/$subscriber.ts +5 -5
  847. package/src/topic/core/primitives/$topic.ts +14 -14
  848. package/src/topic/redis/providers/RedisTopicProvider.ts +3 -3
  849. package/dist/container/core/index.d.ts +0 -236
  850. package/dist/container/core/index.d.ts.map +0 -1
  851. package/dist/container/core/index.js +0 -231
  852. package/dist/container/core/index.js.map +0 -1
  853. package/dist/container/core/index.workerd.js +0 -192
  854. package/dist/container/core/index.workerd.js.map +0 -1
  855. package/src/cli/core/tasks/BuildSitemapTask.ts +0 -130
  856. package/src/command/helpers/PrettyAsker.ts +0 -256
  857. package/src/command/helpers/PrettyPrint.ts +0 -332
  858. package/src/container/core/__tests__/$container.spec.ts +0 -83
  859. package/src/container/core/index.ts +0 -50
  860. package/src/container/core/index.workerd.ts +0 -53
  861. package/src/container/core/interfaces/ContainerOptions.ts +0 -69
  862. package/src/container/core/primitives/$container.ts +0 -100
  863. package/src/container/core/providers/CloudflareContainerProvider.ts +0 -70
  864. package/src/container/core/providers/ContainerProvider.ts +0 -92
  865. package/src/container/core/providers/MockContainerProvider.ts +0 -62
  866. package/src/container/core/providers/NodeContainerProvider.ts +0 -53
  867. package/src/core/__tests__/jsonSchemaToTypeBox.spec.ts +0 -771
  868. package/src/core/helpers/jsonSchemaToTypeBox.ts +0 -359
  869. /package/dist/orm/core/{chunk-B4FMCO8f.js → rolldown-runtime-B4FMCO8f.js} +0 -0
@@ -5,6 +5,12 @@ import { PaymentService } from "alepha/api/payments";
5
5
  import { CacheProvider } from "alepha/cache";
6
6
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
7
7
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
8
+ import "drizzle-orm/pg-core/foreign-keys";
9
+ import "drizzle-orm/pg-core/session";
10
+ import "alepha/crypto";
11
+ import "drizzle-kit/api";
12
+ import "drizzle-orm/d1";
13
+ import "drizzle-orm/sqlite-core";
8
14
  //#region ../../src/orm/core/schemas/insertSchema.d.ts
9
15
  /**
10
16
  * Transforms a TObject schema for insert operations.
@@ -15,15 +21,13 @@ import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, Update
15
21
  * Before: { name: string; age: number(default=0); fullName: generated }
16
22
  * After: { name: string; age?: number; }
17
23
  */
18
- type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
24
+ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["shape"] as T["shape"][K] extends {
19
25
  [PG_GENERATED]: any;
20
- } ? never : K]: T["properties"][K] extends {
26
+ } ? never : K]: T["shape"][K] extends {
21
27
  [PG_DEFAULT]: any;
22
28
  } | {
23
29
  [PG_ORGANIZATION]: any;
24
- } | {
25
- "~optional": true;
26
- } ? TOptional<T["properties"][K]> : T["properties"][K] }>;
30
+ } ? TOptional<Extract<T["shape"][K], TSchema>> : T["shape"][K]; }>;
27
31
  //#endregion
28
32
  //#region ../../src/orm/core/schemas/updateSchema.d.ts
29
33
  /**
@@ -35,9 +39,9 @@ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as
35
39
  * Before: { name?: string; age: number; fullName: generated }
36
40
  * After: { name?: string | null; age: number; }
37
41
  */
38
- type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
42
+ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["shape"] as T["shape"][K] extends {
39
43
  [PG_GENERATED]: any;
40
- } ? never : K]: T["properties"][K] extends TOptional<infer U> ? TOptional<TUnion<[U, TNull]>> : T["properties"][K] }>;
44
+ } ? never : K]: T["shape"][K] extends TOptional<infer U extends TSchema> ? TOptional<TUnion<[U, TNull]>> : T["shape"][K]; }>;
41
45
  //#endregion
42
46
  //#region ../../src/orm/core/primitives/$entity.d.ts
43
47
  interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
@@ -197,18 +201,20 @@ declare class EntityPrimitive<T extends TObject = TObject> {
197
201
  get cols(): EntityColumns<T>;
198
202
  get name(): string;
199
203
  get schema(): T;
204
+ protected _insertSchema?: TObjectInsert<T>;
200
205
  get insertSchema(): TObjectInsert<T>;
206
+ protected _updateSchema?: TObjectUpdate<T>;
201
207
  get updateSchema(): TObjectUpdate<T>;
202
208
  }
203
209
  /**
204
210
  * Convert a schema to columns.
205
211
  */
206
- type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
212
+ type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase; };
207
213
  type EntityColumn<T extends TObject> = {
208
214
  name: string;
209
215
  entity: EntityPrimitive<T>;
210
216
  };
211
- type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
217
+ type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T>; };
212
218
  //#endregion
213
219
  //#region ../../src/orm/core/constants/PG_SYMBOLS.d.ts
214
220
  declare const PG_DEFAULT: unique symbol;
@@ -237,13 +243,24 @@ type PgSymbols = {
237
243
  [PG_REF]: PgRefOptions;
238
244
  [PG_ENUM]: PgEnumOptions;
239
245
  [PG_GENERATED]: PgGeneratedOptions;
240
- [PG_ORGANIZATION]: {};
246
+ [PG_ORGANIZATION]: PgOrganizationOptions;
241
247
  /**
242
248
  * @deprecated Use `PG_IDENTITY` instead.
243
249
  */
244
250
  [PG_SERIAL]: {};
245
251
  };
246
252
  type PgSymbolKeys = keyof PgSymbols;
253
+ interface PgOrganizationOptions {
254
+ /**
255
+ * Fail-closed tenant scoping. When `true`, the repository (a) refuses any
256
+ * read/write with no resolved tenant instead of falling through to an
257
+ * unfiltered "see/write everything" query, and (b) drops the
258
+ * `OR organizationId IS NULL` "global row" escape — a scoped tenant never
259
+ * sees NULL/global rows. Use for security-sensitive tables. Defaults to
260
+ * `false` (the historic fail-open semantics).
261
+ */
262
+ strict?: boolean;
263
+ }
247
264
  type PgIdentityOptions = {
248
265
  mode: "always" | "byDefault";
249
266
  } & PgSequenceOptions & {
@@ -280,7 +297,7 @@ interface PgRefOptions {
280
297
  /**
281
298
  * Type representation.
282
299
  */
283
- type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
300
+ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K]; };
284
301
  //#endregion
285
302
  //#region ../../src/orm/core/schemas/databaseEnvSchema.d.ts
286
303
  /**
@@ -296,135 +313,82 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
296
313
  * - `d1://BINDING_NAME` — Cloudflare D1
297
314
  * - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
298
315
  */
299
- declare const databaseEnvSchema: import("typebox").TObject<{
300
- DATABASE_URL: import("typebox").TOptional<import("typebox").TString>;
301
- /**
302
- * Enable or disable push-based schema synchronization (drizzle-kit push).
303
- *
304
- * Defaults to `true` in development and test, `false` in production.
305
- * Set to `false` in development to skip automatic schema sync
306
- * (e.g. when managing migrations manually).
307
- */
308
- DATABASE_SYNC: import("typebox").TOptional<import("typebox").TBoolean>;
309
- }>;
316
+ declare const databaseEnvSchema: import("zod").ZodObject<{
317
+ DATABASE_URL: import("zod").ZodOptional<import("zod").ZodString>;
318
+ DATABASE_SYNC: import("zod").ZodOptional<import("zod").ZodBoolean>;
319
+ }, import("zod/v4/core").$strip>;
310
320
  declare module "alepha" {
311
321
  interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
312
- } //# sourceMappingURL=databaseEnvSchema.d.ts.map
322
+ }
313
323
  //#endregion
314
324
  //#region ../../src/api/subscriptions/schemas/planDefinitionSchema.d.ts
315
- declare const planDefinitionSchema: import("typebox").TObject<{
316
- /**
317
- * Unique plan identifier (e.g., "free", "starter", "pro", "enterprise").
318
- */
319
- id: import("typebox").TString;
320
- /**
321
- * Display name (e.g., "Pro Plan").
322
- */
323
- name: import("typebox").TString;
324
- /**
325
- * Optional description.
326
- */
327
- description: import("typebox").TOptional<import("typebox").TString>;
328
- /**
329
- * Whether this plan is available for new subscriptions.
330
- */
331
- available: import("typebox").TBoolean;
332
- /**
333
- * Pricing per billing interval.
334
- * Multiple entries for monthly/yearly.
335
- */
336
- pricing: import("typebox").TArray<import("typebox").TObject<{
337
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
338
- amount: import("typebox").TInteger;
339
- currency: import("typebox").TString;
340
- }>>;
341
- /**
342
- * Trial configuration for this plan.
343
- * Overrides global settings.trialDays if set.
344
- */
345
- trial: import("typebox").TOptional<import("typebox").TObject<{
346
- days: import("typebox").TInteger;
347
- requirePaymentMethod: import("typebox").TBoolean;
348
- }>>;
349
- /**
350
- * Feature entitlements. Boolean flags for feature access.
351
- * Checked via SubscriptionService.can("feature-name").
352
- */
353
- features: import("typebox").TArray<import("typebox").TString>;
354
- /**
355
- * Usage limits. Numeric caps on resources.
356
- * Checked via SubscriptionService.limit("resource-name").
357
- * -1 = unlimited.
358
- */
359
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
360
- /**
361
- * Sort order for display (lower = first).
362
- */
363
- order: import("typebox").TInteger;
364
- /**
365
- * Metadata for app-specific plan data.
366
- */
367
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
368
- }>;
325
+ declare const planDefinitionSchema: import("zod").ZodObject<{
326
+ id: import("zod").ZodString;
327
+ name: import("zod").ZodString;
328
+ description: import("zod").ZodOptional<import("zod").ZodString>;
329
+ available: import("zod").ZodDefault<import("zod").ZodBoolean>;
330
+ pricing: import("zod").ZodArray<import("zod").ZodObject<{
331
+ interval: import("zod").ZodEnum<{
332
+ monthly: "monthly";
333
+ yearly: "yearly";
334
+ }>;
335
+ amount: import("zod").ZodInt;
336
+ currency: import("zod").ZodString;
337
+ }, import("zod/v4/core").$strip>>;
338
+ trial: import("zod").ZodOptional<import("zod").ZodObject<{
339
+ days: import("zod").ZodInt;
340
+ requirePaymentMethod: import("zod").ZodDefault<import("zod").ZodBoolean>;
341
+ }, import("zod/v4/core").$strip>>;
342
+ features: import("zod").ZodArray<import("zod").ZodString>;
343
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
344
+ order: import("zod").ZodDefault<import("zod").ZodInt>;
345
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
346
+ }, import("zod/v4/core").$strip>;
369
347
  type PlanDefinition = Static<typeof planDefinitionSchema>;
370
348
  //#endregion
371
349
  //#region ../../src/api/subscriptions/schemas/subscriptionSettingsSchema.d.ts
372
- declare const subscriptionSettingsSchema: import("typebox").TObject<{
373
- /**
374
- * Default trial days (overridden per-plan if plan.trial.days is set).
375
- */
376
- trialDays: import("typebox").TInteger;
377
- /**
378
- * Days after payment failure before suspension.
379
- * During grace period, subscription remains active but flagged.
380
- */
381
- gracePeriodDays: import("typebox").TInteger;
382
- /**
383
- * Days after first payment failure to retry, relative to the failure date.
384
- * e.g., [1, 3, 5, 7] means retry on day 1, 3, 5, 7 after failure.
385
- */
386
- dunningSchedule: import("typebox").TArray<import("typebox").TInteger>;
387
- /**
388
- * When user cancels, wait until period end (true) or cancel immediately (false).
389
- */
390
- cancelAtPeriodEnd: import("typebox").TBoolean;
391
- /**
392
- * Prorate charges when changing plans mid-cycle.
393
- */
394
- prorateOnChange: import("typebox").TBoolean;
395
- }>;
350
+ declare const subscriptionSettingsSchema: import("zod").ZodObject<{
351
+ trialDays: import("zod").ZodDefault<import("zod").ZodInt>;
352
+ gracePeriodDays: import("zod").ZodDefault<import("zod").ZodInt>;
353
+ dunningSchedule: import("zod").ZodArray<import("zod").ZodInt>;
354
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
355
+ prorateOnChange: import("zod").ZodDefault<import("zod").ZodBoolean>;
356
+ }, import("zod/v4/core").$strip>;
396
357
  type SubscriptionSettings = Static<typeof subscriptionSettingsSchema>;
397
358
  //#endregion
398
359
  //#region ../../src/api/subscriptions/services/SubscriptionConfig.d.ts
399
360
  declare class SubscriptionConfig {
400
- protected readonly plans: import("alepha/api/parameters").ParameterPrimitive<import("typebox").TObject<{
401
- plans: import("typebox").TArray<import("typebox").TObject<{
402
- id: import("typebox").TString;
403
- name: import("typebox").TString;
404
- description: import("typebox").TOptional<import("typebox").TString>;
405
- available: import("typebox").TBoolean;
406
- pricing: import("typebox").TArray<import("typebox").TObject<{
407
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
408
- amount: import("typebox").TInteger;
409
- currency: import("typebox").TString;
410
- }>>;
411
- trial: import("typebox").TOptional<import("typebox").TObject<{
412
- days: import("typebox").TInteger;
413
- requirePaymentMethod: import("typebox").TBoolean;
414
- }>>;
415
- features: import("typebox").TArray<import("typebox").TString>;
416
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
417
- order: import("typebox").TInteger;
418
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
419
- }>>;
420
- }>>;
421
- protected readonly settings: import("alepha/api/parameters").ParameterPrimitive<import("typebox").TObject<{
422
- trialDays: import("typebox").TInteger;
423
- gracePeriodDays: import("typebox").TInteger;
424
- dunningSchedule: import("typebox").TArray<import("typebox").TInteger>;
425
- cancelAtPeriodEnd: import("typebox").TBoolean;
426
- prorateOnChange: import("typebox").TBoolean;
427
- }>>;
361
+ protected readonly plans: import("alepha/api/parameters").ParameterPrimitive<import("zod").ZodObject<{
362
+ plans: import("zod").ZodArray<import("zod").ZodObject<{
363
+ id: import("zod").ZodString;
364
+ name: import("zod").ZodString;
365
+ description: import("zod").ZodOptional<import("zod").ZodString>;
366
+ available: import("zod").ZodDefault<import("zod").ZodBoolean>;
367
+ pricing: import("zod").ZodArray<import("zod").ZodObject<{
368
+ interval: import("zod").ZodEnum<{
369
+ monthly: "monthly";
370
+ yearly: "yearly";
371
+ }>;
372
+ amount: import("zod").ZodInt;
373
+ currency: import("zod").ZodString;
374
+ }, import("zod/v4/core").$strip>>;
375
+ trial: import("zod").ZodOptional<import("zod").ZodObject<{
376
+ days: import("zod").ZodInt;
377
+ requirePaymentMethod: import("zod").ZodDefault<import("zod").ZodBoolean>;
378
+ }, import("zod/v4/core").$strip>>;
379
+ features: import("zod").ZodArray<import("zod").ZodString>;
380
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
381
+ order: import("zod").ZodDefault<import("zod").ZodInt>;
382
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
383
+ }, import("zod/v4/core").$strip>>;
384
+ }, import("zod/v4/core").$strip>>;
385
+ protected readonly settings: import("alepha/api/parameters").ParameterPrimitive<import("zod").ZodObject<{
386
+ trialDays: import("zod").ZodDefault<import("zod").ZodInt>;
387
+ gracePeriodDays: import("zod").ZodDefault<import("zod").ZodInt>;
388
+ dunningSchedule: import("zod").ZodArray<import("zod").ZodInt>;
389
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
390
+ prorateOnChange: import("zod").ZodDefault<import("zod").ZodBoolean>;
391
+ }, import("zod/v4/core").$strip>>;
428
392
  getPlans(): Promise<PlanDefinition[]>;
429
393
  getSettings(): Promise<SubscriptionSettings>;
430
394
  getPlan(planId: string): Promise<PlanDefinition>;
@@ -436,95 +400,138 @@ declare class SubscriptionConfig {
436
400
  }
437
401
  //#endregion
438
402
  //#region ../../src/api/subscriptions/entities/subscriptionEvents.d.ts
439
- declare const subscriptionEvents: import("alepha/orm").EntityPrimitive<import("typebox").TObject<{
440
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
441
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
442
- subscriptionId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_REF>;
443
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
444
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
445
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
446
- newStatus: import("typebox").TOptional<import("typebox").TString>;
447
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
448
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
449
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
450
- amount: import("typebox").TOptional<import("typebox").TInteger>;
451
- currency: import("typebox").TOptional<import("typebox").TString>;
452
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
453
- userId: import("typebox").TOptional<import("typebox").TString>;
454
- note: import("typebox").TOptional<import("typebox").TString>;
455
- }>>;
403
+ declare const subscriptionEvents: import("alepha/orm").EntityPrimitive<import("zod").ZodObject<{
404
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
405
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
406
+ subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
407
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
408
+ type: import("zod").ZodEnum<{
409
+ activated: "activated";
410
+ cancelled: "cancelled";
411
+ created: "created";
412
+ expired: "expired";
413
+ past_due: "past_due";
414
+ payment_failed: "payment_failed";
415
+ payment_retried: "payment_retried";
416
+ plan_change_scheduled: "plan_change_scheduled";
417
+ plan_changed: "plan_changed";
418
+ reactivated: "reactivated";
419
+ renewed: "renewed";
420
+ resumed: "resumed";
421
+ suspended: "suspended";
422
+ trial_ended: "trial_ended";
423
+ trial_started: "trial_started";
424
+ }>;
425
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
426
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
427
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
428
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
429
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
430
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
431
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
432
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
433
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
434
+ note: import("zod").ZodOptional<import("zod").ZodString>;
435
+ }, import("zod/v4/core").$strip>>;
456
436
  type SubscriptionEventEntity = Static<typeof subscriptionEvents.schema>;
457
437
  //#endregion
458
438
  //#region ../../src/api/subscriptions/entities/subscriptions.d.ts
459
- declare const subscriptions: import("alepha/orm").EntityPrimitive<import("typebox").TObject<{
460
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
461
- version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
462
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
463
- updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
464
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
465
- planId: import("typebox").TString;
466
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
467
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
468
- currentPeriodStart: import("typebox").TString;
469
- currentPeriodEnd: import("typebox").TString;
470
- trialStart: import("typebox").TOptional<import("typebox").TString>;
471
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
472
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
473
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
474
- cancelAtPeriodEnd: import("typebox").TBoolean;
475
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
476
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
477
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
478
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
479
- dunningAttempt: import("typebox").TInteger;
480
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
481
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
482
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
483
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
484
- }>>;
439
+ declare const subscriptions: import("alepha/orm").EntityPrimitive<import("zod").ZodObject<{
440
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
441
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
442
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
443
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
444
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
445
+ planId: import("zod").ZodString;
446
+ interval: import("zod").ZodEnum<{
447
+ monthly: "monthly";
448
+ yearly: "yearly";
449
+ }>;
450
+ status: import("zod").ZodEnum<{
451
+ active: "active";
452
+ cancelled: "cancelled";
453
+ expired: "expired";
454
+ past_due: "past_due";
455
+ suspended: "suspended";
456
+ trialing: "trialing";
457
+ }>;
458
+ currentPeriodStart: import("zod").ZodString;
459
+ currentPeriodEnd: import("zod").ZodString;
460
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
461
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
462
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
463
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
464
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
465
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
466
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
467
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
468
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
469
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
470
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
471
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
472
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
473
+ monthly: "monthly";
474
+ yearly: "yearly";
475
+ }>>;
476
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
477
+ }, import("zod/v4/core").$strip>>;
485
478
  type SubscriptionEntity = Static<typeof subscriptions.schema>;
486
479
  //#endregion
487
480
  //#region ../../src/api/subscriptions/schemas/entitlementsSchema.d.ts
488
- declare const entitlementsSchema: import("typebox").TObject<{
489
- planId: import("typebox").TString;
490
- planName: import("typebox").TString;
491
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
492
- features: import("typebox").TArray<import("typebox").TString>;
493
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
494
- trialEndsAt: import("typebox").TOptional<import("typebox").TString>;
495
- periodEndsAt: import("typebox").TString;
496
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
497
- }>;
481
+ declare const entitlementsSchema: import("zod").ZodObject<{
482
+ planId: import("zod").ZodString;
483
+ planName: import("zod").ZodString;
484
+ status: import("zod").ZodEnum<{
485
+ active: "active";
486
+ cancelled: "cancelled";
487
+ expired: "expired";
488
+ past_due: "past_due";
489
+ suspended: "suspended";
490
+ trialing: "trialing";
491
+ }>;
492
+ features: import("zod").ZodArray<import("zod").ZodString>;
493
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
494
+ trialEndsAt: import("zod").ZodOptional<import("zod").ZodString>;
495
+ periodEndsAt: import("zod").ZodString;
496
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
497
+ }, import("zod/v4/core").$strip>;
498
498
  type Entitlements = Static<typeof entitlementsSchema>;
499
499
  //#endregion
500
500
  //#region ../../src/api/subscriptions/schemas/subscriptionQuerySchema.d.ts
501
- declare const subscriptionQuerySchema: import("typebox").TObject<{
502
- page: import("typebox").TOptional<import("typebox").TInteger>;
503
- size: import("typebox").TOptional<import("typebox").TInteger>;
504
- sort: import("typebox").TOptional<import("typebox").TString>;
505
- status: import("typebox").TOptional<import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">>;
506
- planId: import("typebox").TOptional<import("typebox").TString>;
507
- organizationId: import("typebox").TOptional<import("typebox").TString>;
508
- }>;
501
+ declare const subscriptionQuerySchema: import("zod").ZodObject<{
502
+ page: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
503
+ size: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
504
+ sort: import("zod").ZodOptional<import("zod").ZodString>;
505
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
506
+ active: "active";
507
+ cancelled: "cancelled";
508
+ expired: "expired";
509
+ past_due: "past_due";
510
+ suspended: "suspended";
511
+ trialing: "trialing";
512
+ }>>;
513
+ planId: import("zod").ZodOptional<import("zod").ZodString>;
514
+ organizationId: import("zod").ZodOptional<import("zod").ZodString>;
515
+ }, import("zod/v4/core").$strip>;
509
516
  type SubscriptionQuery = Static<typeof subscriptionQuerySchema>;
510
517
  //#endregion
511
518
  //#region ../../src/api/subscriptions/schemas/subscriptionStatsSchema.d.ts
512
- declare const subscriptionStatsSchema: import("typebox").TObject<{
513
- total: import("typebox").TInteger;
514
- trialing: import("typebox").TInteger;
515
- active: import("typebox").TInteger;
516
- pastDue: import("typebox").TInteger;
517
- suspended: import("typebox").TInteger;
518
- cancelled: import("typebox").TInteger;
519
- expired: import("typebox").TInteger;
520
- trialConversionRate: import("typebox").TNumber;
521
- churnRate: import("typebox").TNumber;
522
- byPlan: import("typebox").TRecord<"^.*$", import("typebox").TObject<{
523
- active: import("typebox").TInteger;
524
- trialing: import("typebox").TInteger;
525
- total: import("typebox").TInteger;
526
- }>>;
527
- }>;
519
+ declare const subscriptionStatsSchema: import("zod").ZodObject<{
520
+ total: import("zod").ZodInt;
521
+ trialing: import("zod").ZodInt;
522
+ active: import("zod").ZodInt;
523
+ pastDue: import("zod").ZodInt;
524
+ suspended: import("zod").ZodInt;
525
+ cancelled: import("zod").ZodInt;
526
+ expired: import("zod").ZodInt;
527
+ trialConversionRate: import("zod").ZodNumber;
528
+ churnRate: import("zod").ZodNumber;
529
+ byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
530
+ active: import("zod").ZodInt;
531
+ trialing: import("zod").ZodInt;
532
+ total: import("zod").ZodInt;
533
+ }, import("zod/v4/core").$strip>>;
534
+ }, import("zod/v4/core").$strip>;
528
535
  type SubscriptionStats = Static<typeof subscriptionStatsSchema>;
529
536
  //#endregion
530
537
  //#region ../../src/api/subscriptions/services/SubscriptionService.d.ts
@@ -582,49 +589,78 @@ declare class SubscriptionService {
582
589
  protected readonly alepha: Alepha;
583
590
  protected readonly log: import("alepha/logger").Logger;
584
591
  protected readonly dateTime: DateTimeProvider;
585
- protected readonly subscriptionRepo: import("alepha/orm").Repository<import("typebox").TObject<{
586
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
587
- version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
588
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
589
- updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
590
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
591
- planId: import("typebox").TString;
592
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
593
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
594
- currentPeriodStart: import("typebox").TString;
595
- currentPeriodEnd: import("typebox").TString;
596
- trialStart: import("typebox").TOptional<import("typebox").TString>;
597
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
598
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
599
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
600
- cancelAtPeriodEnd: import("typebox").TBoolean;
601
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
602
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
603
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
604
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
605
- dunningAttempt: import("typebox").TInteger;
606
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
607
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
608
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
609
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
610
- }>>;
611
- protected readonly eventRepo: import("alepha/orm").Repository<import("typebox").TObject<{
612
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
613
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
614
- subscriptionId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_REF>;
615
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
616
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
617
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
618
- newStatus: import("typebox").TOptional<import("typebox").TString>;
619
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
620
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
621
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
622
- amount: import("typebox").TOptional<import("typebox").TInteger>;
623
- currency: import("typebox").TOptional<import("typebox").TString>;
624
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
625
- userId: import("typebox").TOptional<import("typebox").TString>;
626
- note: import("typebox").TOptional<import("typebox").TString>;
627
- }>>;
592
+ protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
593
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
594
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
595
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
596
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
597
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
598
+ planId: import("zod").ZodString;
599
+ interval: import("zod").ZodEnum<{
600
+ monthly: "monthly";
601
+ yearly: "yearly";
602
+ }>;
603
+ status: import("zod").ZodEnum<{
604
+ active: "active";
605
+ cancelled: "cancelled";
606
+ expired: "expired";
607
+ past_due: "past_due";
608
+ suspended: "suspended";
609
+ trialing: "trialing";
610
+ }>;
611
+ currentPeriodStart: import("zod").ZodString;
612
+ currentPeriodEnd: import("zod").ZodString;
613
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
614
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
615
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
616
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
617
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
618
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
619
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
620
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
621
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
622
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
623
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
624
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
625
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
626
+ monthly: "monthly";
627
+ yearly: "yearly";
628
+ }>>;
629
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
630
+ }, import("zod/v4/core").$strip>>;
631
+ protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
632
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
633
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
634
+ subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
635
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
636
+ type: import("zod").ZodEnum<{
637
+ activated: "activated";
638
+ cancelled: "cancelled";
639
+ created: "created";
640
+ expired: "expired";
641
+ past_due: "past_due";
642
+ payment_failed: "payment_failed";
643
+ payment_retried: "payment_retried";
644
+ plan_change_scheduled: "plan_change_scheduled";
645
+ plan_changed: "plan_changed";
646
+ reactivated: "reactivated";
647
+ renewed: "renewed";
648
+ resumed: "resumed";
649
+ suspended: "suspended";
650
+ trial_ended: "trial_ended";
651
+ trial_started: "trial_started";
652
+ }>;
653
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
654
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
655
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
656
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
657
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
658
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
659
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
660
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
661
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
662
+ note: import("zod").ZodOptional<import("zod").ZodString>;
663
+ }, import("zod/v4/core").$strip>>;
628
664
  protected readonly config: SubscriptionConfig;
629
665
  /**
630
666
  * Find a subscription by organization ID.
@@ -730,206 +766,268 @@ declare class AdminSubscriptionController {
730
766
  * Find subscriptions with pagination and filtering.
731
767
  */
732
768
  readonly findSubscriptions: import("alepha/server").ActionPrimitiveFn<{
733
- query: import("typebox").TObject<{
734
- page: import("typebox").TOptional<import("typebox").TInteger>;
735
- size: import("typebox").TOptional<import("typebox").TInteger>;
736
- sort: import("typebox").TOptional<import("typebox").TString>;
737
- status: import("typebox").TOptional<import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">>;
738
- planId: import("typebox").TOptional<import("typebox").TString>;
739
- organizationId: import("typebox").TOptional<import("typebox").TString>;
740
- }>;
741
- response: import("alepha").TPage<import("typebox").TObject<{
742
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
743
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
744
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
745
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
746
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
747
- planId: import("typebox").TString;
748
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
749
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
750
- currentPeriodStart: import("typebox").TString;
751
- currentPeriodEnd: import("typebox").TString;
752
- trialStart: import("typebox").TOptional<import("typebox").TString>;
753
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
754
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
755
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
756
- cancelAtPeriodEnd: import("typebox").TBoolean;
757
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
758
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
759
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
760
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
761
- dunningAttempt: import("typebox").TInteger;
762
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
763
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
764
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
765
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
766
- }>>;
769
+ query: import("zod").ZodObject<{
770
+ page: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
771
+ size: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
772
+ sort: import("zod").ZodOptional<import("zod").ZodString>;
773
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
774
+ active: "active";
775
+ cancelled: "cancelled";
776
+ expired: "expired";
777
+ past_due: "past_due";
778
+ suspended: "suspended";
779
+ trialing: "trialing";
780
+ }>>;
781
+ planId: import("zod").ZodOptional<import("zod").ZodString>;
782
+ organizationId: import("zod").ZodOptional<import("zod").ZodString>;
783
+ }, import("zod/v4/core").$strip>;
784
+ response: import("zod").ZodObject<{
785
+ content: import("zod").ZodArray<import("zod").ZodObject<{
786
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
787
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
788
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
789
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
790
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
791
+ planId: import("zod").ZodString;
792
+ interval: import("zod").ZodEnum<{
793
+ monthly: "monthly";
794
+ yearly: "yearly";
795
+ }>;
796
+ status: import("zod").ZodEnum<{
797
+ active: "active";
798
+ cancelled: "cancelled";
799
+ expired: "expired";
800
+ past_due: "past_due";
801
+ suspended: "suspended";
802
+ trialing: "trialing";
803
+ }>;
804
+ currentPeriodStart: import("zod").ZodString;
805
+ currentPeriodEnd: import("zod").ZodString;
806
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
807
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
808
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
809
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
810
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
811
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
812
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
813
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
814
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
815
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
816
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
817
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
818
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
819
+ monthly: "monthly";
820
+ yearly: "yearly";
821
+ }>>;
822
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
823
+ }, import("zod/v4/core").$strip>>;
824
+ page: import("zod").ZodObject<{
825
+ number: import("zod").ZodInt;
826
+ size: import("zod").ZodInt;
827
+ offset: import("zod").ZodInt;
828
+ numberOfElements: import("zod").ZodInt;
829
+ totalElements: import("zod").ZodOptional<import("zod").ZodInt>;
830
+ totalPages: import("zod").ZodOptional<import("zod").ZodInt>;
831
+ isEmpty: import("zod").ZodBoolean;
832
+ isFirst: import("zod").ZodBoolean;
833
+ isLast: import("zod").ZodBoolean;
834
+ }, import("zod/v4/core").$strip>;
835
+ }, import("zod/v4/core").$strip>;
767
836
  }>;
768
837
  /**
769
838
  * Get a subscription by ID.
770
839
  */
771
840
  readonly getSubscription: import("alepha/server").ActionPrimitiveFn<{
772
- params: import("typebox").TObject<{
773
- id: import("typebox").TString;
774
- }>;
775
- response: import("typebox").TObject<{
776
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
777
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
778
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
779
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
780
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
781
- planId: import("typebox").TString;
782
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
783
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
784
- currentPeriodStart: import("typebox").TString;
785
- currentPeriodEnd: import("typebox").TString;
786
- trialStart: import("typebox").TOptional<import("typebox").TString>;
787
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
788
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
789
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
790
- cancelAtPeriodEnd: import("typebox").TBoolean;
791
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
792
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
793
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
794
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
795
- dunningAttempt: import("typebox").TInteger;
796
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
797
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
798
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
799
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
800
- }>;
841
+ params: import("zod").ZodObject<{
842
+ id: import("zod").ZodString;
843
+ }, import("zod/v4/core").$strip>;
844
+ response: import("zod").ZodObject<{
845
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
846
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
847
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
848
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
849
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
850
+ planId: import("zod").ZodString;
851
+ interval: import("zod").ZodEnum<{
852
+ monthly: "monthly";
853
+ yearly: "yearly";
854
+ }>;
855
+ status: import("zod").ZodEnum<{
856
+ active: "active";
857
+ cancelled: "cancelled";
858
+ expired: "expired";
859
+ past_due: "past_due";
860
+ suspended: "suspended";
861
+ trialing: "trialing";
862
+ }>;
863
+ currentPeriodStart: import("zod").ZodString;
864
+ currentPeriodEnd: import("zod").ZodString;
865
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
866
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
867
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
868
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
869
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
870
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
871
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
872
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
873
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
874
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
875
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
876
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
877
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
878
+ monthly: "monthly";
879
+ yearly: "yearly";
880
+ }>>;
881
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
882
+ }, import("zod/v4/core").$strip>;
801
883
  }>;
802
884
  /**
803
885
  * Get aggregated subscription statistics.
804
886
  */
805
887
  readonly getStats: import("alepha/server").ActionPrimitiveFn<{
806
- response: import("typebox").TObject<{
807
- total: import("typebox").TInteger;
808
- trialing: import("typebox").TInteger;
809
- active: import("typebox").TInteger;
810
- pastDue: import("typebox").TInteger;
811
- suspended: import("typebox").TInteger;
812
- cancelled: import("typebox").TInteger;
813
- expired: import("typebox").TInteger;
814
- trialConversionRate: import("typebox").TNumber;
815
- churnRate: import("typebox").TNumber;
816
- byPlan: import("typebox").TRecord<"^.*$", import("typebox").TObject<{
817
- active: import("typebox").TInteger;
818
- trialing: import("typebox").TInteger;
819
- total: import("typebox").TInteger;
820
- }>>;
821
- }>;
888
+ response: import("zod").ZodObject<{
889
+ total: import("zod").ZodInt;
890
+ trialing: import("zod").ZodInt;
891
+ active: import("zod").ZodInt;
892
+ pastDue: import("zod").ZodInt;
893
+ suspended: import("zod").ZodInt;
894
+ cancelled: import("zod").ZodInt;
895
+ expired: import("zod").ZodInt;
896
+ trialConversionRate: import("zod").ZodNumber;
897
+ churnRate: import("zod").ZodNumber;
898
+ byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
899
+ active: import("zod").ZodInt;
900
+ trialing: import("zod").ZodInt;
901
+ total: import("zod").ZodInt;
902
+ }, import("zod/v4/core").$strip>>;
903
+ }, import("zod/v4/core").$strip>;
822
904
  }>;
823
905
  /**
824
906
  * Get revenue data from recent subscription events.
825
907
  */
826
908
  readonly getRevenue: import("alepha/server").ActionPrimitiveFn<{
827
- query: import("typebox").TObject<{
828
- days: import("typebox").TOptional<import("typebox").TInteger>;
829
- }>;
830
- response: import("typebox").TObject<{
831
- total: import("typebox").TInteger;
832
- count: import("typebox").TInteger;
833
- }>;
909
+ query: import("zod").ZodObject<{
910
+ days: import("zod").ZodOptional<import("zod").ZodInt>;
911
+ }, import("zod/v4/core").$strip>;
912
+ response: import("zod").ZodObject<{
913
+ total: import("zod").ZodInt;
914
+ count: import("zod").ZodInt;
915
+ }, import("zod/v4/core").$strip>;
834
916
  }>;
835
917
  /**
836
918
  * Get Monthly Recurring Revenue breakdown.
837
919
  */
838
920
  readonly getMrr: import("alepha/server").ActionPrimitiveFn<{
839
- response: import("typebox").TObject<{
840
- total: import("typebox").TInteger;
841
- byPlan: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
842
- growth: import("typebox").TInteger;
843
- newMrr: import("typebox").TInteger;
844
- expansionMrr: import("typebox").TInteger;
845
- contractionMrr: import("typebox").TInteger;
846
- churnMrr: import("typebox").TInteger;
847
- }>;
921
+ response: import("zod").ZodObject<{
922
+ total: import("zod").ZodInt;
923
+ byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
924
+ growth: import("zod").ZodInt;
925
+ newMrr: import("zod").ZodInt;
926
+ expansionMrr: import("zod").ZodInt;
927
+ contractionMrr: import("zod").ZodInt;
928
+ churnMrr: import("zod").ZodInt;
929
+ }, import("zod/v4/core").$strip>;
848
930
  }>;
849
931
  /**
850
932
  * Force a plan change for a subscription (admin action).
851
933
  */
852
934
  readonly adminChangePlan: import("alepha/server").ActionPrimitiveFn<{
853
- params: import("typebox").TObject<{
854
- id: import("typebox").TString;
855
- }>;
856
- body: import("typebox").TObject<{
857
- planId: import("typebox").TString;
858
- interval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
859
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
860
- }>;
861
- response: import("typebox").TObject<{
862
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
863
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
864
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
865
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
866
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
867
- planId: import("typebox").TString;
868
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
869
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
870
- currentPeriodStart: import("typebox").TString;
871
- currentPeriodEnd: import("typebox").TString;
872
- trialStart: import("typebox").TOptional<import("typebox").TString>;
873
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
874
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
875
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
876
- cancelAtPeriodEnd: import("typebox").TBoolean;
877
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
878
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
879
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
880
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
881
- dunningAttempt: import("typebox").TInteger;
882
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
883
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
884
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
885
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
886
- }>;
935
+ params: import("zod").ZodObject<{
936
+ id: import("zod").ZodString;
937
+ }, import("zod/v4/core").$strip>;
938
+ body: import("zod").ZodObject<{
939
+ planId: import("zod").ZodString;
940
+ interval: import("zod").ZodOptional<import("zod").ZodEnum<{
941
+ monthly: "monthly";
942
+ yearly: "yearly";
943
+ }>>;
944
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
945
+ }, import("zod/v4/core").$strip>;
946
+ response: import("zod").ZodObject<{
947
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
948
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
949
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
950
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
951
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
952
+ planId: import("zod").ZodString;
953
+ interval: import("zod").ZodEnum<{
954
+ monthly: "monthly";
955
+ yearly: "yearly";
956
+ }>;
957
+ status: import("zod").ZodEnum<{
958
+ active: "active";
959
+ cancelled: "cancelled";
960
+ expired: "expired";
961
+ past_due: "past_due";
962
+ suspended: "suspended";
963
+ trialing: "trialing";
964
+ }>;
965
+ currentPeriodStart: import("zod").ZodString;
966
+ currentPeriodEnd: import("zod").ZodString;
967
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
968
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
969
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
970
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
971
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
972
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
973
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
974
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
975
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
976
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
977
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
978
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
979
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
980
+ monthly: "monthly";
981
+ yearly: "yearly";
982
+ }>>;
983
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
984
+ }, import("zod/v4/core").$strip>;
887
985
  }>;
888
986
  /**
889
987
  * Force cancel a subscription (admin action).
890
988
  */
891
989
  readonly adminCancel: import("alepha/server").ActionPrimitiveFn<{
892
- params: import("typebox").TObject<{
893
- id: import("typebox").TString;
894
- }>;
895
- body: import("typebox").TObject<{
896
- reason: import("typebox").TOptional<import("typebox").TString>;
897
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
898
- }>;
899
- response: import("typebox").TObject<{
900
- ok: import("typebox").TBoolean;
901
- id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
902
- count: import("typebox").TOptional<import("typebox").TNumber>;
903
- }>;
990
+ params: import("zod").ZodObject<{
991
+ id: import("zod").ZodString;
992
+ }, import("zod/v4/core").$strip>;
993
+ body: import("zod").ZodObject<{
994
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
995
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
996
+ }, import("zod/v4/core").$strip>;
997
+ response: import("zod").ZodObject<{
998
+ ok: import("zod").ZodBoolean;
999
+ id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
1000
+ count: import("zod").ZodOptional<import("zod").ZodNumber>;
1001
+ }, import("zod/v4/core").$strip>;
904
1002
  }>;
905
1003
  /**
906
1004
  * Reactivate a suspended subscription (admin action).
907
1005
  */
908
1006
  readonly adminReactivate: import("alepha/server").ActionPrimitiveFn<{
909
- params: import("typebox").TObject<{
910
- id: import("typebox").TString;
911
- }>;
912
- response: import("typebox").TObject<{
913
- ok: import("typebox").TBoolean;
914
- id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
915
- count: import("typebox").TOptional<import("typebox").TNumber>;
916
- }>;
1007
+ params: import("zod").ZodObject<{
1008
+ id: import("zod").ZodString;
1009
+ }, import("zod/v4/core").$strip>;
1010
+ response: import("zod").ZodObject<{
1011
+ ok: import("zod").ZodBoolean;
1012
+ id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
1013
+ count: import("zod").ZodOptional<import("zod").ZodNumber>;
1014
+ }, import("zod/v4/core").$strip>;
917
1015
  }>;
918
1016
  /**
919
1017
  * Extend the trial period for a trialing subscription (admin action).
920
1018
  */
921
1019
  readonly adminExtendTrial: import("alepha/server").ActionPrimitiveFn<{
922
- params: import("typebox").TObject<{
923
- id: import("typebox").TString;
924
- }>;
925
- body: import("typebox").TObject<{
926
- days: import("typebox").TInteger;
927
- }>;
928
- response: import("typebox").TObject<{
929
- ok: import("typebox").TBoolean;
930
- id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
931
- count: import("typebox").TOptional<import("typebox").TNumber>;
932
- }>;
1020
+ params: import("zod").ZodObject<{
1021
+ id: import("zod").ZodString;
1022
+ }, import("zod/v4/core").$strip>;
1023
+ body: import("zod").ZodObject<{
1024
+ days: import("zod").ZodInt;
1025
+ }, import("zod/v4/core").$strip>;
1026
+ response: import("zod").ZodObject<{
1027
+ ok: import("zod").ZodBoolean;
1028
+ id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
1029
+ count: import("zod").ZodOptional<import("zod").ZodNumber>;
1030
+ }, import("zod/v4/core").$strip>;
933
1031
  }>;
934
1032
  }
935
1033
  //#endregion
@@ -943,189 +1041,258 @@ declare class SubscriptionController {
943
1041
  * List available subscription plans with pricing.
944
1042
  */
945
1043
  readonly getPlans: import("alepha/server").ActionPrimitiveFn<{
946
- response: import("typebox").TArray<import("typebox").TObject<{
947
- id: import("typebox").TString;
948
- name: import("typebox").TString;
949
- description: import("typebox").TOptional<import("typebox").TString>;
950
- pricing: import("typebox").TArray<import("typebox").TObject<{
951
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
952
- amount: import("typebox").TInteger;
953
- currency: import("typebox").TString;
954
- }>>;
955
- features: import("typebox").TArray<import("typebox").TString>;
956
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
957
- trial: import("typebox").TOptional<import("typebox").TObject<{
958
- days: import("typebox").TInteger;
959
- requirePaymentMethod: import("typebox").TBoolean;
960
- }>>;
961
- order: import("typebox").TInteger;
962
- }>>;
1044
+ response: import("zod").ZodArray<import("zod").ZodObject<{
1045
+ id: import("zod").ZodString;
1046
+ name: import("zod").ZodString;
1047
+ description: import("zod").ZodOptional<import("zod").ZodString>;
1048
+ pricing: import("zod").ZodArray<import("zod").ZodObject<{
1049
+ interval: import("zod").ZodEnum<{
1050
+ monthly: "monthly";
1051
+ yearly: "yearly";
1052
+ }>;
1053
+ amount: import("zod").ZodInt;
1054
+ currency: import("zod").ZodString;
1055
+ }, import("zod/v4/core").$strip>>;
1056
+ features: import("zod").ZodArray<import("zod").ZodString>;
1057
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
1058
+ trial: import("zod").ZodOptional<import("zod").ZodObject<{
1059
+ days: import("zod").ZodInt;
1060
+ requirePaymentMethod: import("zod").ZodBoolean;
1061
+ }, import("zod/v4/core").$strip>>;
1062
+ order: import("zod").ZodInt;
1063
+ }, import("zod/v4/core").$strip>>;
963
1064
  }>;
964
1065
  /**
965
1066
  * Get the current organization's subscription.
966
1067
  */
967
1068
  readonly getMySubscription: import("alepha/server").ActionPrimitiveFn<{
968
- response: import("typebox").TObject<{
969
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
970
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
971
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
972
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
973
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
974
- planId: import("typebox").TString;
975
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
976
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
977
- currentPeriodStart: import("typebox").TString;
978
- currentPeriodEnd: import("typebox").TString;
979
- trialStart: import("typebox").TOptional<import("typebox").TString>;
980
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
981
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
982
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
983
- cancelAtPeriodEnd: import("typebox").TBoolean;
984
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
985
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
986
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
987
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
988
- dunningAttempt: import("typebox").TInteger;
989
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
990
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
991
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
992
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
993
- }>;
1069
+ response: import("zod").ZodObject<{
1070
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1071
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
1072
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1073
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1074
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1075
+ planId: import("zod").ZodString;
1076
+ interval: import("zod").ZodEnum<{
1077
+ monthly: "monthly";
1078
+ yearly: "yearly";
1079
+ }>;
1080
+ status: import("zod").ZodEnum<{
1081
+ active: "active";
1082
+ cancelled: "cancelled";
1083
+ expired: "expired";
1084
+ past_due: "past_due";
1085
+ suspended: "suspended";
1086
+ trialing: "trialing";
1087
+ }>;
1088
+ currentPeriodStart: import("zod").ZodString;
1089
+ currentPeriodEnd: import("zod").ZodString;
1090
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1091
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1092
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1093
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1094
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1095
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1096
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1097
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1098
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1099
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1100
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1101
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1102
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1103
+ monthly: "monthly";
1104
+ yearly: "yearly";
1105
+ }>>;
1106
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1107
+ }, import("zod/v4/core").$strip>;
994
1108
  }>;
995
1109
  /**
996
1110
  * Create a new subscription for the current organization.
997
1111
  */
998
1112
  readonly subscribe: import("alepha/server").ActionPrimitiveFn<{
999
- body: import("typebox").TObject<{
1000
- planId: import("typebox").TString;
1001
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1002
- paymentMethodId: import("typebox").TOptional<import("typebox").TString>;
1003
- skipTrial: import("typebox").TOptional<import("typebox").TBoolean>;
1004
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1005
- }>;
1006
- response: import("typebox").TObject<{
1007
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1008
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1009
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1010
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1011
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
1012
- planId: import("typebox").TString;
1013
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1014
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1015
- currentPeriodStart: import("typebox").TString;
1016
- currentPeriodEnd: import("typebox").TString;
1017
- trialStart: import("typebox").TOptional<import("typebox").TString>;
1018
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
1019
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1020
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
1021
- cancelAtPeriodEnd: import("typebox").TBoolean;
1022
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1023
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
1024
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
1025
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
1026
- dunningAttempt: import("typebox").TInteger;
1027
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
1028
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
1029
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1030
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1031
- }>;
1113
+ body: import("zod").ZodObject<{
1114
+ planId: import("zod").ZodString;
1115
+ interval: import("zod").ZodEnum<{
1116
+ monthly: "monthly";
1117
+ yearly: "yearly";
1118
+ }>;
1119
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1120
+ }, import("zod/v4/core").$strip>;
1121
+ response: import("zod").ZodObject<{
1122
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1123
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
1124
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1125
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1126
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1127
+ planId: import("zod").ZodString;
1128
+ interval: import("zod").ZodEnum<{
1129
+ monthly: "monthly";
1130
+ yearly: "yearly";
1131
+ }>;
1132
+ status: import("zod").ZodEnum<{
1133
+ active: "active";
1134
+ cancelled: "cancelled";
1135
+ expired: "expired";
1136
+ past_due: "past_due";
1137
+ suspended: "suspended";
1138
+ trialing: "trialing";
1139
+ }>;
1140
+ currentPeriodStart: import("zod").ZodString;
1141
+ currentPeriodEnd: import("zod").ZodString;
1142
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1143
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1144
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1145
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1146
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1147
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1148
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1149
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1150
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1151
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1152
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1153
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1154
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1155
+ monthly: "monthly";
1156
+ yearly: "yearly";
1157
+ }>>;
1158
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1159
+ }, import("zod/v4/core").$strip>;
1032
1160
  }>;
1033
1161
  /**
1034
1162
  * Change the plan for the current organization's subscription.
1035
1163
  */
1036
1164
  readonly changePlan: import("alepha/server").ActionPrimitiveFn<{
1037
- body: import("typebox").TObject<{
1038
- planId: import("typebox").TString;
1039
- interval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1040
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
1041
- }>;
1042
- response: import("typebox").TObject<{
1043
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1044
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1045
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1046
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1047
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
1048
- planId: import("typebox").TString;
1049
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1050
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1051
- currentPeriodStart: import("typebox").TString;
1052
- currentPeriodEnd: import("typebox").TString;
1053
- trialStart: import("typebox").TOptional<import("typebox").TString>;
1054
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
1055
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1056
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
1057
- cancelAtPeriodEnd: import("typebox").TBoolean;
1058
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1059
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
1060
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
1061
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
1062
- dunningAttempt: import("typebox").TInteger;
1063
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
1064
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
1065
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1066
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1067
- }>;
1165
+ body: import("zod").ZodObject<{
1166
+ planId: import("zod").ZodString;
1167
+ interval: import("zod").ZodOptional<import("zod").ZodEnum<{
1168
+ monthly: "monthly";
1169
+ yearly: "yearly";
1170
+ }>>;
1171
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
1172
+ }, import("zod/v4/core").$strip>;
1173
+ response: import("zod").ZodObject<{
1174
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1175
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
1176
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1177
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1178
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1179
+ planId: import("zod").ZodString;
1180
+ interval: import("zod").ZodEnum<{
1181
+ monthly: "monthly";
1182
+ yearly: "yearly";
1183
+ }>;
1184
+ status: import("zod").ZodEnum<{
1185
+ active: "active";
1186
+ cancelled: "cancelled";
1187
+ expired: "expired";
1188
+ past_due: "past_due";
1189
+ suspended: "suspended";
1190
+ trialing: "trialing";
1191
+ }>;
1192
+ currentPeriodStart: import("zod").ZodString;
1193
+ currentPeriodEnd: import("zod").ZodString;
1194
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1195
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1196
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1197
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1198
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1199
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1200
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1201
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1202
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1203
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1204
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1205
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1206
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1207
+ monthly: "monthly";
1208
+ yearly: "yearly";
1209
+ }>>;
1210
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1211
+ }, import("zod/v4/core").$strip>;
1068
1212
  }>;
1069
1213
  /**
1070
1214
  * Cancel the current organization's subscription.
1071
1215
  */
1072
1216
  readonly cancel: import("alepha/server").ActionPrimitiveFn<{
1073
- body: import("typebox").TObject<{
1074
- reason: import("typebox").TOptional<import("typebox").TString>;
1075
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
1076
- }>;
1077
- response: import("typebox").TObject<{
1078
- ok: import("typebox").TBoolean;
1079
- id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
1080
- count: import("typebox").TOptional<import("typebox").TNumber>;
1081
- }>;
1217
+ body: import("zod").ZodObject<{
1218
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
1219
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
1220
+ }, import("zod/v4/core").$strip>;
1221
+ response: import("zod").ZodObject<{
1222
+ ok: import("zod").ZodBoolean;
1223
+ id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
1224
+ count: import("zod").ZodOptional<import("zod").ZodNumber>;
1225
+ }, import("zod/v4/core").$strip>;
1082
1226
  }>;
1083
1227
  /**
1084
1228
  * Resume a cancelled subscription before the period ends.
1085
1229
  */
1086
1230
  readonly resume: import("alepha/server").ActionPrimitiveFn<{
1087
- response: import("typebox").TObject<{
1088
- ok: import("typebox").TBoolean;
1089
- id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
1090
- count: import("typebox").TOptional<import("typebox").TNumber>;
1091
- }>;
1231
+ response: import("zod").ZodObject<{
1232
+ ok: import("zod").ZodBoolean;
1233
+ id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
1234
+ count: import("zod").ZodOptional<import("zod").ZodNumber>;
1235
+ }, import("zod/v4/core").$strip>;
1092
1236
  }>;
1093
1237
  /**
1094
1238
  * Get the billing event history for the current organization's subscription.
1095
1239
  */
1096
1240
  readonly getSubscriptionHistory: import("alepha/server").ActionPrimitiveFn<{
1097
- response: import("typebox").TArray<import("typebox").TObject<{
1098
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1099
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1100
- subscriptionId: PgAttr<import("typebox").TString, typeof PG_REF>;
1101
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
1102
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
1103
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
1104
- newStatus: import("typebox").TOptional<import("typebox").TString>;
1105
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
1106
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
1107
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1108
- amount: import("typebox").TOptional<import("typebox").TInteger>;
1109
- currency: import("typebox").TOptional<import("typebox").TString>;
1110
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
1111
- userId: import("typebox").TOptional<import("typebox").TString>;
1112
- note: import("typebox").TOptional<import("typebox").TString>;
1113
- }>>;
1241
+ response: import("zod").ZodArray<import("zod").ZodObject<{
1242
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1243
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1244
+ subscriptionId: PgAttr<import("zod").ZodString, typeof PG_REF>;
1245
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1246
+ type: import("zod").ZodEnum<{
1247
+ activated: "activated";
1248
+ cancelled: "cancelled";
1249
+ created: "created";
1250
+ expired: "expired";
1251
+ past_due: "past_due";
1252
+ payment_failed: "payment_failed";
1253
+ payment_retried: "payment_retried";
1254
+ plan_change_scheduled: "plan_change_scheduled";
1255
+ plan_changed: "plan_changed";
1256
+ reactivated: "reactivated";
1257
+ renewed: "renewed";
1258
+ resumed: "resumed";
1259
+ suspended: "suspended";
1260
+ trial_ended: "trial_ended";
1261
+ trial_started: "trial_started";
1262
+ }>;
1263
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
1264
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
1265
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1266
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1267
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1268
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
1269
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
1270
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
1271
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
1272
+ note: import("zod").ZodOptional<import("zod").ZodString>;
1273
+ }, import("zod/v4/core").$strip>>;
1114
1274
  }>;
1115
1275
  /**
1116
1276
  * Get the feature and usage limit entitlements for the current organization.
1117
1277
  */
1118
1278
  readonly getEntitlements: import("alepha/server").ActionPrimitiveFn<{
1119
- response: import("typebox").TObject<{
1120
- planId: import("typebox").TString;
1121
- planName: import("typebox").TString;
1122
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1123
- features: import("typebox").TArray<import("typebox").TString>;
1124
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
1125
- trialEndsAt: import("typebox").TOptional<import("typebox").TString>;
1126
- periodEndsAt: import("typebox").TString;
1127
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1128
- }>;
1279
+ response: import("zod").ZodObject<{
1280
+ planId: import("zod").ZodString;
1281
+ planName: import("zod").ZodString;
1282
+ status: import("zod").ZodEnum<{
1283
+ active: "active";
1284
+ cancelled: "cancelled";
1285
+ expired: "expired";
1286
+ past_due: "past_due";
1287
+ suspended: "suspended";
1288
+ trialing: "trialing";
1289
+ }>;
1290
+ features: import("zod").ZodArray<import("zod").ZodString>;
1291
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
1292
+ trialEndsAt: import("zod").ZodOptional<import("zod").ZodString>;
1293
+ periodEndsAt: import("zod").ZodString;
1294
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1295
+ }, import("zod/v4/core").$strip>;
1129
1296
  }>;
1130
1297
  }
1131
1298
  //#endregion
@@ -1144,49 +1311,78 @@ declare class SubscriptionJobs {
1144
1311
  protected readonly dateTime: DateTimeProvider;
1145
1312
  protected readonly paymentService: PaymentService;
1146
1313
  protected readonly config: SubscriptionConfig;
1147
- protected readonly subscriptionRepo: import("alepha/orm").Repository<import("typebox").TObject<{
1148
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1149
- version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
1150
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1151
- updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1152
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
1153
- planId: import("typebox").TString;
1154
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1155
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1156
- currentPeriodStart: import("typebox").TString;
1157
- currentPeriodEnd: import("typebox").TString;
1158
- trialStart: import("typebox").TOptional<import("typebox").TString>;
1159
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
1160
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1161
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
1162
- cancelAtPeriodEnd: import("typebox").TBoolean;
1163
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1164
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
1165
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
1166
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
1167
- dunningAttempt: import("typebox").TInteger;
1168
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
1169
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
1170
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1171
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1172
- }>>;
1173
- protected readonly eventRepo: import("alepha/orm").Repository<import("typebox").TObject<{
1174
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1175
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1176
- subscriptionId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_REF>;
1177
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
1178
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
1179
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
1180
- newStatus: import("typebox").TOptional<import("typebox").TString>;
1181
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
1182
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
1183
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1184
- amount: import("typebox").TOptional<import("typebox").TInteger>;
1185
- currency: import("typebox").TOptional<import("typebox").TString>;
1186
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
1187
- userId: import("typebox").TOptional<import("typebox").TString>;
1188
- note: import("typebox").TOptional<import("typebox").TString>;
1189
- }>>;
1314
+ protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
1315
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1316
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
1317
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1318
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1319
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
1320
+ planId: import("zod").ZodString;
1321
+ interval: import("zod").ZodEnum<{
1322
+ monthly: "monthly";
1323
+ yearly: "yearly";
1324
+ }>;
1325
+ status: import("zod").ZodEnum<{
1326
+ active: "active";
1327
+ cancelled: "cancelled";
1328
+ expired: "expired";
1329
+ past_due: "past_due";
1330
+ suspended: "suspended";
1331
+ trialing: "trialing";
1332
+ }>;
1333
+ currentPeriodStart: import("zod").ZodString;
1334
+ currentPeriodEnd: import("zod").ZodString;
1335
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1336
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1337
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1338
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1339
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1340
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1341
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1342
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1343
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1344
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1345
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1346
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1347
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1348
+ monthly: "monthly";
1349
+ yearly: "yearly";
1350
+ }>>;
1351
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1352
+ }, import("zod/v4/core").$strip>>;
1353
+ protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
1354
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1355
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1356
+ subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
1357
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
1358
+ type: import("zod").ZodEnum<{
1359
+ activated: "activated";
1360
+ cancelled: "cancelled";
1361
+ created: "created";
1362
+ expired: "expired";
1363
+ past_due: "past_due";
1364
+ payment_failed: "payment_failed";
1365
+ payment_retried: "payment_retried";
1366
+ plan_change_scheduled: "plan_change_scheduled";
1367
+ plan_changed: "plan_changed";
1368
+ reactivated: "reactivated";
1369
+ renewed: "renewed";
1370
+ resumed: "resumed";
1371
+ suspended: "suspended";
1372
+ trial_ended: "trial_ended";
1373
+ trial_started: "trial_started";
1374
+ }>;
1375
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
1376
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
1377
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1378
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1379
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1380
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
1381
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
1382
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
1383
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
1384
+ note: import("zod").ZodOptional<import("zod").ZodString>;
1385
+ }, import("zod/v4/core").$strip>>;
1190
1386
  /**
1191
1387
  * Record a subscription event in the event log.
1192
1388
  */
@@ -1195,32 +1391,32 @@ declare class SubscriptionJobs {
1195
1391
  * Creates payment intents for subscriptions due for renewal.
1196
1392
  * Runs hourly.
1197
1393
  */
1198
- readonly billingCycle: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1394
+ readonly billingCycle: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1199
1395
  /**
1200
1396
  * Retries failed payments on the dunning schedule.
1201
1397
  * Runs hourly.
1202
1398
  */
1203
- readonly dunningRetry: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1399
+ readonly dunningRetry: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1204
1400
  /**
1205
1401
  * Handles trial expirations.
1206
1402
  * Runs hourly.
1207
1403
  */
1208
- readonly trialExpiry: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1404
+ readonly trialExpiry: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1209
1405
  /**
1210
1406
  * Expires cancelled subscriptions that reached period end.
1211
1407
  * Runs hourly.
1212
1408
  */
1213
- readonly expirationSweep: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1409
+ readonly expirationSweep: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1214
1410
  /**
1215
1411
  * Suspends past_due subscriptions where grace period has elapsed.
1216
1412
  * Runs daily at 2 AM.
1217
1413
  */
1218
- readonly gracePeriodSweep: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1414
+ readonly gracePeriodSweep: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1219
1415
  /**
1220
1416
  * Purges old subscription events older than 365 days.
1221
1417
  * Runs daily at 3 AM.
1222
1418
  */
1223
- readonly purgeEvents: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1419
+ readonly purgeEvents: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
1224
1420
  }
1225
1421
  //#endregion
1226
1422
  //#region ../../src/api/subscriptions/middleware/$requireLimit.d.ts
@@ -1271,155 +1467,200 @@ declare class SubscriptionNotifications {
1271
1467
  /**
1272
1468
  * Sent when a trial is ending soon.
1273
1469
  */
1274
- protected readonly trialEnding: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1275
- planName: import("typebox").TString;
1276
- trialEndDate: import("typebox").TString;
1277
- amount: import("typebox").TString;
1278
- interval: import("typebox").TString;
1279
- }>>;
1470
+ protected readonly trialEnding: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1471
+ planName: import("zod").ZodString;
1472
+ trialEndDate: import("zod").ZodString;
1473
+ amount: import("zod").ZodString;
1474
+ interval: import("zod").ZodString;
1475
+ }, import("zod/v4/core").$strip>>;
1280
1476
  /**
1281
1477
  * Sent when a payment fails. Critical notification.
1282
1478
  */
1283
- protected readonly paymentFailed: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1284
- planName: import("typebox").TString;
1285
- amount: import("typebox").TString;
1286
- retryDate: import("typebox").TOptional<import("typebox").TString>;
1287
- }>>;
1479
+ protected readonly paymentFailed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1480
+ planName: import("zod").ZodString;
1481
+ amount: import("zod").ZodString;
1482
+ retryDate: import("zod").ZodOptional<import("zod").ZodString>;
1483
+ }, import("zod/v4/core").$strip>>;
1288
1484
  /**
1289
1485
  * Sent when a subscription is suspended due to failed payments. Critical notification.
1290
1486
  */
1291
- protected readonly subscriptionSuspended: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1292
- planName: import("typebox").TString;
1293
- }>>;
1487
+ protected readonly subscriptionSuspended: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1488
+ planName: import("zod").ZodString;
1489
+ }, import("zod/v4/core").$strip>>;
1294
1490
  /**
1295
1491
  * Sent when a subscription is successfully renewed.
1296
1492
  */
1297
- protected readonly subscriptionRenewed: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1298
- planName: import("typebox").TString;
1299
- amount: import("typebox").TString;
1300
- nextBillingDate: import("typebox").TString;
1301
- }>>;
1493
+ protected readonly subscriptionRenewed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1494
+ planName: import("zod").ZodString;
1495
+ amount: import("zod").ZodString;
1496
+ nextBillingDate: import("zod").ZodString;
1497
+ }, import("zod/v4/core").$strip>>;
1302
1498
  /**
1303
1499
  * Sent when a subscription plan is changed.
1304
1500
  */
1305
- protected readonly planChanged: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1306
- oldPlanName: import("typebox").TString;
1307
- newPlanName: import("typebox").TString;
1308
- effectiveDate: import("typebox").TString;
1309
- }>>;
1501
+ protected readonly planChanged: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1502
+ oldPlanName: import("zod").ZodString;
1503
+ newPlanName: import("zod").ZodString;
1504
+ effectiveDate: import("zod").ZodString;
1505
+ }, import("zod/v4/core").$strip>>;
1310
1506
  /**
1311
1507
  * Sent when a subscription is cancelled.
1312
1508
  */
1313
- protected readonly cancellationConfirmed: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1314
- planName: import("typebox").TString;
1315
- accessUntil: import("typebox").TOptional<import("typebox").TString>;
1316
- }>>;
1509
+ protected readonly cancellationConfirmed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
1510
+ planName: import("zod").ZodString;
1511
+ accessUntil: import("zod").ZodOptional<import("zod").ZodString>;
1512
+ }, import("zod/v4/core").$strip>>;
1317
1513
  }
1318
1514
  //#endregion
1319
1515
  //#region ../../src/api/subscriptions/schemas/cancelSubscriptionSchema.d.ts
1320
- declare const cancelSubscriptionSchema: import("typebox").TObject<{
1321
- reason: import("typebox").TOptional<import("typebox").TString>;
1322
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
1323
- }>;
1516
+ declare const cancelSubscriptionSchema: import("zod").ZodObject<{
1517
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
1518
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
1519
+ }, import("zod/v4/core").$strip>;
1324
1520
  type CancelSubscription = Static<typeof cancelSubscriptionSchema>;
1325
1521
  //#endregion
1326
1522
  //#region ../../src/api/subscriptions/schemas/changePlanSchema.d.ts
1327
- declare const changePlanSchema: import("typebox").TObject<{
1328
- planId: import("typebox").TString;
1329
- interval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1330
- immediate: import("typebox").TOptional<import("typebox").TBoolean>;
1331
- }>;
1523
+ declare const changePlanSchema: import("zod").ZodObject<{
1524
+ planId: import("zod").ZodString;
1525
+ interval: import("zod").ZodOptional<import("zod").ZodEnum<{
1526
+ monthly: "monthly";
1527
+ yearly: "yearly";
1528
+ }>>;
1529
+ immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
1530
+ }, import("zod/v4/core").$strip>;
1332
1531
  type ChangePlan = Static<typeof changePlanSchema>;
1333
1532
  //#endregion
1334
1533
  //#region ../../src/api/subscriptions/schemas/createSubscriptionSchema.d.ts
1335
- declare const createSubscriptionSchema: import("typebox").TObject<{
1336
- planId: import("typebox").TString;
1337
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1338
- paymentMethodId: import("typebox").TOptional<import("typebox").TString>;
1339
- skipTrial: import("typebox").TOptional<import("typebox").TBoolean>;
1340
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1341
- }>;
1534
+ /**
1535
+ * Public body for the self-service subscribe endpoint.
1536
+ *
1537
+ * Deliberately does NOT expose `skipTrial` (or a `paymentMethodId`): skipping
1538
+ * the trial goes straight to a paid `active` subscription with no captured
1539
+ * payment, so it must never be client-controlled. Trusted server-side callers
1540
+ * pass `skipTrial` through the `SubscriptionService.subscribe` options after a
1541
+ * payment is captured — it is not part of the public request.
1542
+ */
1543
+ declare const createSubscriptionSchema: import("zod").ZodObject<{
1544
+ planId: import("zod").ZodString;
1545
+ interval: import("zod").ZodEnum<{
1546
+ monthly: "monthly";
1547
+ yearly: "yearly";
1548
+ }>;
1549
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1550
+ }, import("zod/v4/core").$strip>;
1342
1551
  type CreateSubscription = Static<typeof createSubscriptionSchema>;
1343
1552
  //#endregion
1344
1553
  //#region ../../src/api/subscriptions/schemas/mrrSchema.d.ts
1345
- declare const mrrSchema: import("typebox").TObject<{
1346
- total: import("typebox").TInteger;
1347
- byPlan: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
1348
- growth: import("typebox").TInteger;
1349
- newMrr: import("typebox").TInteger;
1350
- expansionMrr: import("typebox").TInteger;
1351
- contractionMrr: import("typebox").TInteger;
1352
- churnMrr: import("typebox").TInteger;
1353
- }>;
1554
+ declare const mrrSchema: import("zod").ZodObject<{
1555
+ total: import("zod").ZodInt;
1556
+ byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
1557
+ growth: import("zod").ZodInt;
1558
+ newMrr: import("zod").ZodInt;
1559
+ expansionMrr: import("zod").ZodInt;
1560
+ contractionMrr: import("zod").ZodInt;
1561
+ churnMrr: import("zod").ZodInt;
1562
+ }, import("zod/v4/core").$strip>;
1354
1563
  type MrrData = Static<typeof mrrSchema>;
1355
1564
  //#endregion
1356
1565
  //#region ../../src/api/subscriptions/schemas/planResourceSchema.d.ts
1357
- declare const planResourceSchema: import("typebox").TObject<{
1358
- id: import("typebox").TString;
1359
- name: import("typebox").TString;
1360
- description: import("typebox").TOptional<import("typebox").TString>;
1361
- pricing: import("typebox").TArray<import("typebox").TObject<{
1362
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1363
- amount: import("typebox").TInteger;
1364
- currency: import("typebox").TString;
1365
- }>>;
1366
- features: import("typebox").TArray<import("typebox").TString>;
1367
- limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
1368
- trial: import("typebox").TOptional<import("typebox").TObject<{
1369
- days: import("typebox").TInteger;
1370
- requirePaymentMethod: import("typebox").TBoolean;
1371
- }>>;
1372
- order: import("typebox").TInteger;
1373
- }>;
1566
+ declare const planResourceSchema: import("zod").ZodObject<{
1567
+ id: import("zod").ZodString;
1568
+ name: import("zod").ZodString;
1569
+ description: import("zod").ZodOptional<import("zod").ZodString>;
1570
+ pricing: import("zod").ZodArray<import("zod").ZodObject<{
1571
+ interval: import("zod").ZodEnum<{
1572
+ monthly: "monthly";
1573
+ yearly: "yearly";
1574
+ }>;
1575
+ amount: import("zod").ZodInt;
1576
+ currency: import("zod").ZodString;
1577
+ }, import("zod/v4/core").$strip>>;
1578
+ features: import("zod").ZodArray<import("zod").ZodString>;
1579
+ limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
1580
+ trial: import("zod").ZodOptional<import("zod").ZodObject<{
1581
+ days: import("zod").ZodInt;
1582
+ requirePaymentMethod: import("zod").ZodBoolean;
1583
+ }, import("zod/v4/core").$strip>>;
1584
+ order: import("zod").ZodInt;
1585
+ }, import("zod/v4/core").$strip>;
1374
1586
  type PlanResource = Static<typeof planResourceSchema>;
1375
1587
  //#endregion
1376
1588
  //#region ../../src/api/subscriptions/schemas/subscriptionEventResourceSchema.d.ts
1377
- declare const subscriptionEventResourceSchema: import("typebox").TObject<{
1378
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1379
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1380
- subscriptionId: PgAttr<import("typebox").TString, typeof PG_REF>;
1381
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
1382
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
1383
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
1384
- newStatus: import("typebox").TOptional<import("typebox").TString>;
1385
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
1386
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
1387
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1388
- amount: import("typebox").TOptional<import("typebox").TInteger>;
1389
- currency: import("typebox").TOptional<import("typebox").TString>;
1390
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
1391
- userId: import("typebox").TOptional<import("typebox").TString>;
1392
- note: import("typebox").TOptional<import("typebox").TString>;
1393
- }>;
1589
+ declare const subscriptionEventResourceSchema: import("zod").ZodObject<{
1590
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1591
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1592
+ subscriptionId: PgAttr<import("zod").ZodString, typeof PG_REF>;
1593
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1594
+ type: import("zod").ZodEnum<{
1595
+ activated: "activated";
1596
+ cancelled: "cancelled";
1597
+ created: "created";
1598
+ expired: "expired";
1599
+ past_due: "past_due";
1600
+ payment_failed: "payment_failed";
1601
+ payment_retried: "payment_retried";
1602
+ plan_change_scheduled: "plan_change_scheduled";
1603
+ plan_changed: "plan_changed";
1604
+ reactivated: "reactivated";
1605
+ renewed: "renewed";
1606
+ resumed: "resumed";
1607
+ suspended: "suspended";
1608
+ trial_ended: "trial_ended";
1609
+ trial_started: "trial_started";
1610
+ }>;
1611
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
1612
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
1613
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1614
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1615
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1616
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
1617
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
1618
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
1619
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
1620
+ note: import("zod").ZodOptional<import("zod").ZodString>;
1621
+ }, import("zod/v4/core").$strip>;
1394
1622
  type SubscriptionEventResource = Static<typeof subscriptionEventResourceSchema>;
1395
1623
  //#endregion
1396
1624
  //#region ../../src/api/subscriptions/schemas/subscriptionResourceSchema.d.ts
1397
- declare const subscriptionResourceSchema: import("typebox").TObject<{
1398
- id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1399
- version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1400
- createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1401
- updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1402
- organizationId: PgAttr<import("typebox").TString, typeof PG_ORGANIZATION>;
1403
- planId: import("typebox").TString;
1404
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1405
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1406
- currentPeriodStart: import("typebox").TString;
1407
- currentPeriodEnd: import("typebox").TString;
1408
- trialStart: import("typebox").TOptional<import("typebox").TString>;
1409
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
1410
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1411
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
1412
- cancelAtPeriodEnd: import("typebox").TBoolean;
1413
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1414
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
1415
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
1416
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
1417
- dunningAttempt: import("typebox").TInteger;
1418
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
1419
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
1420
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1421
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1422
- }>;
1625
+ declare const subscriptionResourceSchema: import("zod").ZodObject<{
1626
+ id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1627
+ version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
1628
+ createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1629
+ updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1630
+ organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
1631
+ planId: import("zod").ZodString;
1632
+ interval: import("zod").ZodEnum<{
1633
+ monthly: "monthly";
1634
+ yearly: "yearly";
1635
+ }>;
1636
+ status: import("zod").ZodEnum<{
1637
+ active: "active";
1638
+ cancelled: "cancelled";
1639
+ expired: "expired";
1640
+ past_due: "past_due";
1641
+ suspended: "suspended";
1642
+ trialing: "trialing";
1643
+ }>;
1644
+ currentPeriodStart: import("zod").ZodString;
1645
+ currentPeriodEnd: import("zod").ZodString;
1646
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1647
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1648
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1649
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1650
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1651
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1652
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1653
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1654
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1655
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1656
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1657
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1658
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1659
+ monthly: "monthly";
1660
+ yearly: "yearly";
1661
+ }>>;
1662
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1663
+ }, import("zod/v4/core").$strip>;
1423
1664
  type SubscriptionResource = Static<typeof subscriptionResourceSchema>;
1424
1665
  //#endregion
1425
1666
  //#region ../../src/api/subscriptions/services/BillingService.d.ts
@@ -1445,49 +1686,78 @@ declare class BillingService {
1445
1686
  protected readonly alepha: Alepha;
1446
1687
  protected readonly log: import("alepha/logger").Logger;
1447
1688
  protected readonly dateTime: DateTimeProvider;
1448
- protected readonly subscriptionRepo: import("alepha/orm").Repository<import("typebox").TObject<{
1449
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1450
- version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
1451
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1452
- updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1453
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
1454
- planId: import("typebox").TString;
1455
- interval: import("typebox").TUnsafe<"monthly" | "yearly">;
1456
- status: import("typebox").TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1457
- currentPeriodStart: import("typebox").TString;
1458
- currentPeriodEnd: import("typebox").TString;
1459
- trialStart: import("typebox").TOptional<import("typebox").TString>;
1460
- trialEnd: import("typebox").TOptional<import("typebox").TString>;
1461
- cancelledAt: import("typebox").TOptional<import("typebox").TString>;
1462
- cancelReason: import("typebox").TOptional<import("typebox").TString>;
1463
- cancelAtPeriodEnd: import("typebox").TBoolean;
1464
- lastPaymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1465
- lastPaymentAt: import("typebox").TOptional<import("typebox").TString>;
1466
- nextBillingAt: import("typebox").TOptional<import("typebox").TString>;
1467
- dunningStartedAt: import("typebox").TOptional<import("typebox").TString>;
1468
- dunningAttempt: import("typebox").TInteger;
1469
- dunningNextRetryAt: import("typebox").TOptional<import("typebox").TString>;
1470
- pendingPlanId: import("typebox").TOptional<import("typebox").TString>;
1471
- pendingInterval: import("typebox").TOptional<import("typebox").TUnsafe<"monthly" | "yearly">>;
1472
- metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
1473
- }>>;
1474
- protected readonly eventRepo: import("alepha/orm").Repository<import("typebox").TObject<{
1475
- id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1476
- createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1477
- subscriptionId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_REF>;
1478
- organizationId: import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_ORGANIZATION>;
1479
- type: import("typebox").TUnsafe<"past_due" | "suspended" | "cancelled" | "expired" | "created" | "trial_started" | "trial_ended" | "activated" | "renewed" | "payment_failed" | "payment_retried" | "reactivated" | "plan_changed" | "plan_change_scheduled" | "resumed">;
1480
- previousStatus: import("typebox").TOptional<import("typebox").TString>;
1481
- newStatus: import("typebox").TOptional<import("typebox").TString>;
1482
- previousPlanId: import("typebox").TOptional<import("typebox").TString>;
1483
- newPlanId: import("typebox").TOptional<import("typebox").TString>;
1484
- paymentIntentId: import("typebox").TOptional<import("typebox").TString>;
1485
- amount: import("typebox").TOptional<import("typebox").TInteger>;
1486
- currency: import("typebox").TOptional<import("typebox").TString>;
1487
- triggeredBy: import("typebox").TOptional<import("typebox").TString>;
1488
- userId: import("typebox").TOptional<import("typebox").TString>;
1489
- note: import("typebox").TOptional<import("typebox").TString>;
1490
- }>>;
1689
+ protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
1690
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1691
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
1692
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1693
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1694
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
1695
+ planId: import("zod").ZodString;
1696
+ interval: import("zod").ZodEnum<{
1697
+ monthly: "monthly";
1698
+ yearly: "yearly";
1699
+ }>;
1700
+ status: import("zod").ZodEnum<{
1701
+ active: "active";
1702
+ cancelled: "cancelled";
1703
+ expired: "expired";
1704
+ past_due: "past_due";
1705
+ suspended: "suspended";
1706
+ trialing: "trialing";
1707
+ }>;
1708
+ currentPeriodStart: import("zod").ZodString;
1709
+ currentPeriodEnd: import("zod").ZodString;
1710
+ trialStart: import("zod").ZodOptional<import("zod").ZodString>;
1711
+ trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
1712
+ cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
1713
+ cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
1714
+ cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
1715
+ lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1716
+ lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
1717
+ nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
1718
+ dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
1719
+ dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
1720
+ dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
1721
+ pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1722
+ pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
1723
+ monthly: "monthly";
1724
+ yearly: "yearly";
1725
+ }>>;
1726
+ metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1727
+ }, import("zod/v4/core").$strip>>;
1728
+ protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
1729
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
1730
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
1731
+ subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
1732
+ organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
1733
+ type: import("zod").ZodEnum<{
1734
+ activated: "activated";
1735
+ cancelled: "cancelled";
1736
+ created: "created";
1737
+ expired: "expired";
1738
+ past_due: "past_due";
1739
+ payment_failed: "payment_failed";
1740
+ payment_retried: "payment_retried";
1741
+ plan_change_scheduled: "plan_change_scheduled";
1742
+ plan_changed: "plan_changed";
1743
+ reactivated: "reactivated";
1744
+ renewed: "renewed";
1745
+ resumed: "resumed";
1746
+ suspended: "suspended";
1747
+ trial_ended: "trial_ended";
1748
+ trial_started: "trial_started";
1749
+ }>;
1750
+ previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
1751
+ newStatus: import("zod").ZodOptional<import("zod").ZodString>;
1752
+ previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1753
+ newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
1754
+ paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
1755
+ amount: import("zod").ZodOptional<import("zod").ZodInt>;
1756
+ currency: import("zod").ZodOptional<import("zod").ZodString>;
1757
+ triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
1758
+ userId: import("zod").ZodOptional<import("zod").ZodString>;
1759
+ note: import("zod").ZodOptional<import("zod").ZodString>;
1760
+ }, import("zod/v4/core").$strip>>;
1491
1761
  protected readonly paymentService: PaymentService;
1492
1762
  protected readonly config: SubscriptionConfig;
1493
1763
  /**