alepha 0.21.2 → 0.22.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 (463) hide show
  1. package/README.md +0 -1
  2. package/dist/api/audits/index.browser.js.map +1 -1
  3. package/dist/api/audits/index.d.ts +393 -403
  4. package/dist/api/audits/index.d.ts.map +1 -1
  5. package/dist/api/audits/index.js +25 -56
  6. package/dist/api/audits/index.js.map +1 -1
  7. package/dist/api/files/index.browser.js +31 -1
  8. package/dist/api/files/index.browser.js.map +1 -1
  9. package/dist/api/files/index.d.ts +313 -208
  10. package/dist/api/files/index.d.ts.map +1 -1
  11. package/dist/api/files/index.js +152 -42
  12. package/dist/api/files/index.js.map +1 -1
  13. package/dist/api/jobs/index.browser.js +2 -2
  14. package/dist/api/jobs/index.browser.js.map +1 -1
  15. package/dist/api/jobs/index.d.ts +289 -292
  16. package/dist/api/jobs/index.d.ts.map +1 -1
  17. package/dist/api/jobs/index.js +39 -33
  18. package/dist/api/jobs/index.js.map +1 -1
  19. package/dist/api/keys/index.d.ts +211 -216
  20. package/dist/api/keys/index.d.ts.map +1 -1
  21. package/dist/api/keys/index.js.map +1 -1
  22. package/dist/api/notifications/index.browser.js.map +1 -1
  23. package/dist/api/notifications/index.d.ts +188 -195
  24. package/dist/api/notifications/index.d.ts.map +1 -1
  25. package/dist/api/notifications/index.js.map +1 -1
  26. package/dist/api/oauth/index.d.ts +71 -76
  27. package/dist/api/oauth/index.d.ts.map +1 -1
  28. package/dist/api/oauth/index.js.map +1 -1
  29. package/dist/api/organizations/index.browser.js.map +1 -1
  30. package/dist/api/organizations/index.d.ts +104 -109
  31. package/dist/api/organizations/index.d.ts.map +1 -1
  32. package/dist/api/organizations/index.js.map +1 -1
  33. package/dist/api/parameters/index.browser.js +43 -16
  34. package/dist/api/parameters/index.browser.js.map +1 -1
  35. package/dist/api/parameters/index.d.ts +488 -344
  36. package/dist/api/parameters/index.d.ts.map +1 -1
  37. package/dist/api/parameters/index.js +175 -35
  38. package/dist/api/parameters/index.js.map +1 -1
  39. package/dist/api/payments/index.d.ts +396 -402
  40. package/dist/api/payments/index.d.ts.map +1 -1
  41. package/dist/api/payments/index.js.map +1 -1
  42. package/dist/api/subscriptions/index.d.ts +644 -652
  43. package/dist/api/subscriptions/index.d.ts.map +1 -1
  44. package/dist/api/subscriptions/index.js +1 -1
  45. package/dist/api/subscriptions/index.js.map +1 -1
  46. package/dist/api/users/index.browser.js +7 -0
  47. package/dist/api/users/index.browser.js.map +1 -1
  48. package/dist/api/users/index.d.ts +1073 -1006
  49. package/dist/api/users/index.d.ts.map +1 -1
  50. package/dist/api/users/index.js +283 -61
  51. package/dist/api/users/index.js.map +1 -1
  52. package/dist/api/verifications/index.browser.js.map +1 -1
  53. package/dist/api/verifications/index.d.ts +134 -140
  54. package/dist/api/verifications/index.d.ts.map +1 -1
  55. package/dist/api/verifications/index.js.map +1 -1
  56. package/dist/background/index.d.ts +95 -0
  57. package/dist/background/index.d.ts.map +1 -0
  58. package/dist/background/index.js +121 -0
  59. package/dist/background/index.js.map +1 -0
  60. package/dist/background/index.workerd.js +110 -0
  61. package/dist/background/index.workerd.js.map +1 -0
  62. package/dist/batch/index.d.ts +5 -7
  63. package/dist/batch/index.d.ts.map +1 -1
  64. package/dist/batch/index.js.map +1 -1
  65. package/dist/bin/index.js.map +1 -1
  66. package/dist/bucket/index.d.ts +76 -54
  67. package/dist/bucket/index.d.ts.map +1 -1
  68. package/dist/bucket/index.js +58 -11
  69. package/dist/bucket/index.js.map +1 -1
  70. package/dist/bucket/index.workerd.js +200 -5
  71. package/dist/bucket/index.workerd.js.map +1 -1
  72. package/dist/cache/core/index.d.ts +7 -10
  73. package/dist/cache/core/index.d.ts.map +1 -1
  74. package/dist/cache/core/index.js.map +1 -1
  75. package/dist/cache/core/index.workerd.js.map +1 -1
  76. package/dist/cache/database/index.d.ts +22 -26
  77. package/dist/cache/database/index.d.ts.map +1 -1
  78. package/dist/cache/database/index.js.map +1 -1
  79. package/dist/cache/redis/index.d.ts +4 -7
  80. package/dist/cache/redis/index.d.ts.map +1 -1
  81. package/dist/cache/redis/index.js.map +1 -1
  82. package/dist/captcha/index.d.ts +3 -6
  83. package/dist/captcha/index.d.ts.map +1 -1
  84. package/dist/captcha/index.js.map +1 -1
  85. package/dist/cli/config/index.d.ts.map +1 -1
  86. package/dist/cli/config/index.js.map +1 -1
  87. package/dist/cli/core/index.d.ts +417 -214
  88. package/dist/cli/core/index.d.ts.map +1 -1
  89. package/dist/cli/core/index.js +325 -563
  90. package/dist/cli/core/index.js.map +1 -1
  91. package/dist/cli/devtools/index.d.ts +3 -5
  92. package/dist/cli/devtools/index.d.ts.map +1 -1
  93. package/dist/cli/devtools/index.js.map +1 -1
  94. package/dist/cli/i18n/index.d.ts +8 -12
  95. package/dist/cli/i18n/index.d.ts.map +1 -1
  96. package/dist/cli/i18n/index.js.map +1 -1
  97. package/dist/cli/platform/index.d.ts +126 -1342
  98. package/dist/cli/platform/index.d.ts.map +1 -1
  99. package/dist/cli/platform/index.js +136 -2374
  100. package/dist/cli/platform/index.js.map +1 -1
  101. package/dist/cli/platform-lib/index.d.ts +1446 -0
  102. package/dist/cli/platform-lib/index.d.ts.map +1 -0
  103. package/dist/cli/platform-lib/index.js +2597 -0
  104. package/dist/cli/platform-lib/index.js.map +1 -0
  105. package/dist/cli/vendor/index.d.ts +17 -21
  106. package/dist/cli/vendor/index.d.ts.map +1 -1
  107. package/dist/cli/vendor/index.js.map +1 -1
  108. package/dist/command/index.d.ts +21 -20
  109. package/dist/command/index.d.ts.map +1 -1
  110. package/dist/command/index.js +39 -10
  111. package/dist/command/index.js.map +1 -1
  112. package/dist/{containers → container}/core/index.d.ts +13 -15
  113. package/dist/container/core/index.d.ts.map +1 -0
  114. package/dist/{containers → container}/core/index.js +23 -14
  115. package/dist/container/core/index.js.map +1 -0
  116. package/dist/{containers → container}/core/index.workerd.js +37 -22
  117. package/dist/container/core/index.workerd.js.map +1 -0
  118. package/dist/core/index.browser.js +27 -1
  119. package/dist/core/index.browser.js.map +1 -1
  120. package/dist/core/index.d.ts +48 -24
  121. package/dist/core/index.d.ts.map +1 -1
  122. package/dist/core/index.js +27 -1
  123. package/dist/core/index.js.map +1 -1
  124. package/dist/core/index.native.js +27 -1
  125. package/dist/core/index.native.js.map +1 -1
  126. package/dist/core/index.workerd.js +27 -1
  127. package/dist/core/index.workerd.js.map +1 -1
  128. package/dist/crypto/index.browser.js.map +1 -1
  129. package/dist/crypto/index.d.ts +5 -8
  130. package/dist/crypto/index.d.ts.map +1 -1
  131. package/dist/crypto/index.js.map +1 -1
  132. package/dist/datetime/index.d.ts +3 -4
  133. package/dist/datetime/index.d.ts.map +1 -1
  134. package/dist/datetime/index.js.map +1 -1
  135. package/dist/email/brevo/index.d.ts +2 -4
  136. package/dist/email/brevo/index.d.ts.map +1 -1
  137. package/dist/email/brevo/index.js.map +1 -1
  138. package/dist/email/cloudflare/index.d.ts +20 -7
  139. package/dist/email/cloudflare/index.d.ts.map +1 -1
  140. package/dist/email/cloudflare/index.js +46 -9
  141. package/dist/email/cloudflare/index.js.map +1 -1
  142. package/dist/email/core/index.d.ts +6 -9
  143. package/dist/email/core/index.d.ts.map +1 -1
  144. package/dist/email/core/index.js.map +1 -1
  145. package/dist/email/core/index.workerd.js.map +1 -1
  146. package/dist/email/smtp/index.d.ts +10 -13
  147. package/dist/email/smtp/index.d.ts.map +1 -1
  148. package/dist/email/smtp/index.js +107 -32
  149. package/dist/email/smtp/index.js.map +1 -1
  150. package/dist/fake/index.d.ts +1 -2
  151. package/dist/fake/index.d.ts.map +1 -1
  152. package/dist/fake/index.js.map +1 -1
  153. package/dist/lock/core/index.d.ts +9 -14
  154. package/dist/lock/core/index.d.ts.map +1 -1
  155. package/dist/lock/core/index.js.map +1 -1
  156. package/dist/lock/redis/index.d.ts +2 -4
  157. package/dist/lock/redis/index.d.ts.map +1 -1
  158. package/dist/lock/redis/index.js.map +1 -1
  159. package/dist/logger/index.d.ts +105 -76
  160. package/dist/logger/index.d.ts.map +1 -1
  161. package/dist/logger/index.js +196 -174
  162. package/dist/logger/index.js.map +1 -1
  163. package/dist/mcp/index.d.ts +16 -20
  164. package/dist/mcp/index.d.ts.map +1 -1
  165. package/dist/mcp/index.js.map +1 -1
  166. package/dist/orm/core/index.browser.js.map +1 -1
  167. package/dist/orm/core/index.bun.js +19 -1
  168. package/dist/orm/core/index.bun.js.map +1 -1
  169. package/dist/orm/core/index.d.ts +76 -62
  170. package/dist/orm/core/index.d.ts.map +1 -1
  171. package/dist/orm/core/index.js +20 -2
  172. package/dist/orm/core/index.js.map +1 -1
  173. package/dist/orm/postgres/index.bun.js.map +1 -1
  174. package/dist/orm/postgres/index.d.ts +28 -20
  175. package/dist/orm/postgres/index.d.ts.map +1 -1
  176. package/dist/orm/postgres/index.js.map +1 -1
  177. package/dist/queue/core/index.d.ts +12 -15
  178. package/dist/queue/core/index.d.ts.map +1 -1
  179. package/dist/queue/core/index.js.map +1 -1
  180. package/dist/queue/core/index.workerd.js.map +1 -1
  181. package/dist/queue/redis/index.d.ts +3 -5
  182. package/dist/queue/redis/index.d.ts.map +1 -1
  183. package/dist/queue/redis/index.js.map +1 -1
  184. package/dist/react/auth/index.browser.js +9 -2
  185. package/dist/react/auth/index.browser.js.map +1 -1
  186. package/dist/react/auth/index.d.ts +14 -9
  187. package/dist/react/auth/index.d.ts.map +1 -1
  188. package/dist/react/auth/index.js +9 -2
  189. package/dist/react/auth/index.js.map +1 -1
  190. package/dist/react/core/index.d.ts +7 -8
  191. package/dist/react/core/index.d.ts.map +1 -1
  192. package/dist/react/core/index.js +6 -3
  193. package/dist/react/core/index.js.map +1 -1
  194. package/dist/react/form/index.d.ts +2 -4
  195. package/dist/react/form/index.d.ts.map +1 -1
  196. package/dist/react/form/index.js.map +1 -1
  197. package/dist/react/head/index.browser.js.map +1 -1
  198. package/dist/react/head/index.d.ts +2 -4
  199. package/dist/react/head/index.d.ts.map +1 -1
  200. package/dist/react/head/index.js.map +1 -1
  201. package/dist/react/i18n/index.d.ts +47 -11
  202. package/dist/react/i18n/index.d.ts.map +1 -1
  203. package/dist/react/i18n/index.js +33 -1
  204. package/dist/react/i18n/index.js.map +1 -1
  205. package/dist/react/intro/index.d.ts +1 -2
  206. package/dist/react/intro/index.d.ts.map +1 -1
  207. package/dist/react/intro/index.js +2 -2
  208. package/dist/react/intro/index.js.map +1 -1
  209. package/dist/react/router/index.browser.js +65 -19
  210. package/dist/react/router/index.browser.js.map +1 -1
  211. package/dist/react/router/index.d.ts +327 -222
  212. package/dist/react/router/index.d.ts.map +1 -1
  213. package/dist/react/router/index.js +65 -29
  214. package/dist/react/router/index.js.map +1 -1
  215. package/dist/react/testing/index.d.ts +1 -2
  216. package/dist/react/testing/index.d.ts.map +1 -1
  217. package/dist/react/testing/index.js +16 -17
  218. package/dist/react/testing/index.js.map +1 -1
  219. package/dist/react/ui/index.d.ts +20 -25
  220. package/dist/react/ui/index.d.ts.map +1 -1
  221. package/dist/react/ui/index.js.map +1 -1
  222. package/dist/redis/index.bun.js.map +1 -1
  223. package/dist/redis/index.d.ts +17 -19
  224. package/dist/redis/index.d.ts.map +1 -1
  225. package/dist/redis/index.js.map +1 -1
  226. package/dist/retry/index.d.ts +2 -4
  227. package/dist/retry/index.d.ts.map +1 -1
  228. package/dist/retry/index.js.map +1 -1
  229. package/dist/router/index.d.ts.map +1 -1
  230. package/dist/router/index.js.map +1 -1
  231. package/dist/scheduler/index.d.ts +10 -13
  232. package/dist/scheduler/index.d.ts.map +1 -1
  233. package/dist/scheduler/index.js.map +1 -1
  234. package/dist/scheduler/index.workerd.js.map +1 -1
  235. package/dist/security/index.browser.js.map +1 -1
  236. package/dist/security/index.d.ts +45 -48
  237. package/dist/security/index.d.ts.map +1 -1
  238. package/dist/security/index.js.map +1 -1
  239. package/dist/server/auth/index.browser.js.map +1 -1
  240. package/dist/server/auth/index.d.ts +167 -172
  241. package/dist/server/auth/index.d.ts.map +1 -1
  242. package/dist/server/auth/index.js +4 -8
  243. package/dist/server/auth/index.js.map +1 -1
  244. package/dist/server/cookies/index.browser.js.map +1 -1
  245. package/dist/server/cookies/index.d.ts +5 -7
  246. package/dist/server/cookies/index.d.ts.map +1 -1
  247. package/dist/server/cookies/index.js.map +1 -1
  248. package/dist/server/core/index.browser.js.map +1 -1
  249. package/dist/server/core/index.d.ts +88 -73
  250. package/dist/server/core/index.d.ts.map +1 -1
  251. package/dist/server/core/index.js +19 -0
  252. package/dist/server/core/index.js.map +1 -1
  253. package/dist/server/cors/index.d.ts +11 -14
  254. package/dist/server/cors/index.d.ts.map +1 -1
  255. package/dist/server/cors/index.js.map +1 -1
  256. package/dist/server/etag/index.d.ts +6 -9
  257. package/dist/server/etag/index.d.ts.map +1 -1
  258. package/dist/server/etag/index.js.map +1 -1
  259. package/dist/server/health/index.d.ts +18 -21
  260. package/dist/server/health/index.d.ts.map +1 -1
  261. package/dist/server/health/index.js.map +1 -1
  262. package/dist/server/links/index.browser.js +2 -0
  263. package/dist/server/links/index.browser.js.map +1 -1
  264. package/dist/server/links/index.d.ts +63 -67
  265. package/dist/server/links/index.d.ts.map +1 -1
  266. package/dist/server/links/index.js +2 -0
  267. package/dist/server/links/index.js.map +1 -1
  268. package/dist/server/metrics/index.d.ts +5 -7
  269. package/dist/server/metrics/index.d.ts.map +1 -1
  270. package/dist/server/metrics/index.js.map +1 -1
  271. package/dist/server/proxy/index.d.ts +3 -5
  272. package/dist/server/proxy/index.d.ts.map +1 -1
  273. package/dist/server/proxy/index.js.map +1 -1
  274. package/dist/server/rate-limit/index.d.ts +10 -13
  275. package/dist/server/rate-limit/index.d.ts.map +1 -1
  276. package/dist/server/rate-limit/index.js.map +1 -1
  277. package/dist/server/static/index.d.ts +3 -5
  278. package/dist/server/static/index.d.ts.map +1 -1
  279. package/dist/server/static/index.js.map +1 -1
  280. package/dist/server/swagger/index.d.ts +5 -8
  281. package/dist/server/swagger/index.d.ts.map +1 -1
  282. package/dist/server/swagger/index.js.map +1 -1
  283. package/dist/sms/index.d.ts +3 -5
  284. package/dist/sms/index.d.ts.map +1 -1
  285. package/dist/sms/index.js.map +1 -1
  286. package/dist/system/index.browser.js.map +1 -1
  287. package/dist/system/index.d.ts +2 -4
  288. package/dist/system/index.d.ts.map +1 -1
  289. package/dist/system/index.js.map +1 -1
  290. package/dist/system/index.workerd.js.map +1 -1
  291. package/dist/topic/core/index.d.ts +4 -6
  292. package/dist/topic/core/index.d.ts.map +1 -1
  293. package/dist/topic/core/index.js.map +1 -1
  294. package/dist/topic/redis/index.d.ts +5 -8
  295. package/dist/topic/redis/index.d.ts.map +1 -1
  296. package/dist/topic/redis/index.js.map +1 -1
  297. package/package.json +45 -22
  298. package/src/api/audits/__tests__/AuditService.spec.ts +18 -110
  299. package/src/api/audits/controllers/AdminAuditController.ts +14 -0
  300. package/src/api/audits/services/AuditService.ts +21 -88
  301. package/src/api/files/__tests__/FileService.spec.ts +207 -2
  302. package/src/api/files/index.ts +3 -0
  303. package/src/api/files/schemas/fileCreatorSummarySchema.ts +22 -0
  304. package/src/api/files/schemas/fileResourceSchema.ts +10 -1
  305. package/src/api/files/services/FileService.ts +170 -72
  306. package/src/api/jobs/__tests__/$job.spec.ts +24 -1
  307. package/src/api/jobs/index.ts +4 -3
  308. package/src/api/jobs/primitives/$job.ts +7 -3
  309. package/src/api/jobs/providers/DirectJobDispatcher.ts +17 -36
  310. package/src/api/jobs/providers/JobProvider.ts +53 -24
  311. package/src/api/jobs/schemas/jobConfigAtom.ts +1 -1
  312. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +4 -1
  313. package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +3 -1
  314. package/src/api/parameters/__tests__/$parameter.spec.ts +19 -2
  315. package/src/api/parameters/audits/ParameterAudits.ts +17 -0
  316. package/src/api/parameters/controllers/AdminParameterController.ts +95 -19
  317. package/src/api/parameters/index.ts +3 -0
  318. package/src/api/parameters/schemas/activateParameterBodySchema.ts +3 -3
  319. package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +3 -2
  320. package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +25 -0
  321. package/src/api/parameters/schemas/parameterResponseSchema.ts +5 -0
  322. package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +4 -2
  323. package/src/api/parameters/services/ParameterProvider.ts +69 -6
  324. package/src/api/subscriptions/jobs/SubscriptionJobs.ts +1 -1
  325. package/src/api/users/__tests__/AdminSessionController.spec.ts +37 -0
  326. package/src/api/users/audits/SessionAudits.ts +33 -0
  327. package/src/api/users/audits/UserAudits.ts +19 -43
  328. package/src/api/users/controllers/AdminUserController.ts +66 -1
  329. package/src/api/users/entities/sessions.ts +6 -0
  330. package/src/api/users/entities/users.ts +2 -0
  331. package/src/api/users/index.ts +9 -1
  332. package/src/api/users/primitives/$realm.ts +3 -0
  333. package/src/api/users/schemas/sessionResourceSchema.ts +16 -0
  334. package/src/api/users/schemas/updateUserSchema.ts +1 -8
  335. package/src/api/users/schemas/userQuerySchema.ts +7 -0
  336. package/src/api/users/services/CredentialService.ts +15 -6
  337. package/src/api/users/services/IdentityService.ts +2 -1
  338. package/src/api/users/services/RegistrationService.ts +2 -1
  339. package/src/api/users/services/SessionCrudService.ts +19 -2
  340. package/src/api/users/services/SessionService.ts +39 -19
  341. package/src/api/users/services/UserService.ts +106 -8
  342. package/src/background/__tests__/BackgroundTaskProvider.spec.ts +96 -0
  343. package/src/background/index.ts +37 -0
  344. package/src/background/index.workerd.ts +28 -0
  345. package/src/background/providers/BackgroundTaskProvider.ts +70 -0
  346. package/src/background/providers/WorkerdBackgroundTaskProvider.ts +43 -0
  347. package/src/bucket/__tests__/$bucket.spec.ts +18 -0
  348. package/src/bucket/__tests__/LocalFileStorageProvider.spec.ts +5 -0
  349. package/src/bucket/__tests__/MemoryFileStorageProvider.spec.ts +5 -0
  350. package/src/bucket/__tests__/NodeS3BucketProvider.spec.ts +23 -4
  351. package/src/bucket/__tests__/shared.ts +30 -0
  352. package/src/bucket/index.ts +5 -5
  353. package/src/bucket/index.workerd.ts +11 -4
  354. package/src/bucket/primitives/$bucket.ts +27 -0
  355. package/src/bucket/providers/FileStorageProvider.ts +13 -0
  356. package/src/bucket/providers/LocalFileStorageProvider.ts +17 -1
  357. package/src/bucket/providers/MemoryFileStorageProvider.ts +7 -0
  358. package/src/bucket/providers/{CloudflareR2Provider.ts → R2FileStorageProvider.ts} +10 -1
  359. package/src/bucket/providers/{NodeS3BucketProvider.ts → S3FileStorageProvider.ts} +27 -5
  360. package/src/cli/core/__tests__/BuildDockerTask.spec.ts +25 -1
  361. package/src/cli/core/__tests__/init.spec.ts +0 -219
  362. package/src/cli/core/commands/__tests__/BuildCommand.spec.ts +43 -0
  363. package/src/cli/core/commands/build.ts +108 -30
  364. package/src/cli/core/commands/init.ts +0 -12
  365. package/src/cli/core/commands/pack.ts +133 -0
  366. package/src/cli/core/index.ts +3 -0
  367. package/src/cli/core/providers/ViteDevServerProvider.ts +40 -16
  368. package/src/cli/core/services/PackageManagerUtils.ts +0 -16
  369. package/src/cli/core/services/ProjectScaffolder.ts +29 -291
  370. package/src/cli/core/tasks/BuildCloudflareTask.ts +353 -47
  371. package/src/cli/core/tasks/BuildDockerTask.ts +33 -3
  372. package/src/cli/core/tasks/BuildTask.ts +34 -0
  373. package/src/cli/core/templates/apiIndexTs.ts +1 -22
  374. package/src/cli/core/templates/mainCss.ts +0 -1
  375. package/src/cli/core/templates/webAppRouterTs.ts +0 -99
  376. package/src/cli/core/templates/webIndexTs.ts +1 -22
  377. package/src/cli/platform/__tests__/SecretsCommand.spec.ts +5 -3
  378. package/src/cli/platform/commands/SecretsCommand.ts +8 -6
  379. package/src/cli/platform/commands/platform.ts +192 -46
  380. package/src/cli/platform/index.ts +12 -52
  381. package/src/cli/{platform → platform-lib}/__tests__/CloudflareAdapter.spec.ts +426 -169
  382. package/src/cli/{platform → platform-lib}/__tests__/NamingService.spec.ts +91 -4
  383. package/src/cli/{platform → platform-lib}/__tests__/VercelAdapter.spec.ts +56 -85
  384. package/src/cli/{platform → platform-lib}/adapters/CloudflareAdapter.ts +402 -165
  385. package/src/cli/{platform → platform-lib}/adapters/PlatformAdapter.ts +62 -35
  386. package/src/cli/{platform → platform-lib}/adapters/VercelAdapter.ts +6 -10
  387. package/src/cli/{platform → platform-lib}/atoms/platformOptions.ts +34 -1
  388. package/src/cli/platform-lib/index.ts +67 -0
  389. package/src/cli/platform-lib/services/NamingService.ts +136 -0
  390. package/src/cli/{platform → platform-lib}/services/PlatformInspector.ts +60 -13
  391. package/src/cli/{platform → platform-lib}/services/PlatformOrchestrator.ts +54 -43
  392. package/src/cli/{platform → platform-lib}/services/WranglerApi.ts +4 -2
  393. package/src/command/__tests__/Runner.spec.ts +20 -0
  394. package/src/command/helpers/EnvUtils.ts +19 -3
  395. package/src/command/helpers/Runner.ts +12 -2
  396. package/src/command/providers/CliProvider.ts +34 -1
  397. package/src/{containers → container}/core/__tests__/$container.spec.ts +5 -5
  398. package/src/{containers → container}/core/index.ts +4 -4
  399. package/src/{containers → container}/core/index.workerd.ts +19 -3
  400. package/src/{containers → container}/core/primitives/$container.ts +1 -1
  401. package/src/{containers → container}/core/providers/CloudflareContainerProvider.ts +17 -19
  402. package/src/{containers → container}/core/providers/ContainerProvider.ts +16 -2
  403. package/src/{containers → container}/core/providers/MockContainerProvider.ts +1 -1
  404. package/src/core/Alepha.ts +49 -1
  405. package/src/core/__tests__/$env.spec.ts +42 -0
  406. package/src/core/__tests__/dump.spec.ts +47 -0
  407. package/src/email/cloudflare/__tests__/CloudflareEmailProvider.spec.ts +42 -10
  408. package/src/email/cloudflare/index.ts +14 -5
  409. package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +54 -9
  410. package/src/logger/__tests__/Logger.spec.ts +55 -0
  411. package/src/logger/index.ts +13 -0
  412. package/src/logger/services/Logger.ts +31 -1
  413. package/src/orm/__tests__/orm-showcase-tests.ts +27 -0
  414. package/src/orm/__tests__/orm-showcase.spec.ts +12 -0
  415. package/src/orm/core/interfaces/PgQuery.ts +4 -1
  416. package/src/orm/core/services/Repository.ts +27 -11
  417. package/src/react/auth/hooks/useAuth.ts +10 -5
  418. package/src/react/core/__tests__/useQuery.browser.spec.tsx +25 -0
  419. package/src/react/core/hooks/useAction.ts +14 -3
  420. package/src/react/core/hooks/useQuery.ts +24 -4
  421. package/src/react/i18n/components/Translate.tsx +47 -0
  422. package/src/react/i18n/index.ts +2 -0
  423. package/src/react/intro/components/GettingStartedAdminSlide.tsx +2 -2
  424. package/src/react/router/__tests__/$page.spec.tsx +3 -2
  425. package/src/react/router/__tests__/page-can.spec.ts +18 -13
  426. package/src/react/router/hooks/useQueryParams.ts +114 -14
  427. package/src/react/router/primitives/$page.ts +85 -4
  428. package/src/react/router/providers/ReactBrowserRouterProvider.ts +3 -7
  429. package/src/react/router/providers/ReactServerProvider.ts +4 -13
  430. package/src/react/ui/services/SchemaControl.ts +3 -4
  431. package/src/server/core/providers/ServerMultipartProvider.ts +19 -0
  432. package/src/server/links/providers/LinkProvider.ts +10 -0
  433. package/dist/containers/core/index.d.ts.map +0 -1
  434. package/dist/containers/core/index.js.map +0 -1
  435. package/dist/containers/core/index.workerd.js.map +0 -1
  436. package/src/cli/core/templates/componentsJsonTs.ts +0 -39
  437. package/src/cli/core/templates/saasAdminLayoutTsx.ts +0 -77
  438. package/src/cli/core/templates/saasAdminPagesTsx.ts +0 -26
  439. package/src/cli/core/templates/saasAuthLayoutTsx.ts +0 -22
  440. package/src/cli/core/templates/saasAuthPagesTsx.ts +0 -62
  441. package/src/cli/core/templates/saasRealmProviderTs.ts +0 -52
  442. package/src/cli/platform/services/NamingService.ts +0 -54
  443. /package/dist/orm/core/{chunk-o8xxKEmq.js → chunk-B4FMCO8f.js} +0 -0
  444. /package/dist/react/testing/{chunk-6Ep1yQYe.js → chunk-BpyX8vjI.js} +0 -0
  445. /package/src/cli/{platform → platform-lib}/__tests__/GitHubSecretStore.spec.ts +0 -0
  446. /package/src/cli/{platform → platform-lib}/__tests__/PlatformCacheProvider.spec.ts +0 -0
  447. /package/src/cli/{platform → platform-lib}/__tests__/PlatformInspector.spec.ts +0 -0
  448. /package/src/cli/{platform → platform-lib}/__tests__/PlatformOrchestrator.spec.ts +0 -0
  449. /package/src/cli/{platform → platform-lib}/__tests__/SecretFilterService.spec.ts +0 -0
  450. /package/src/cli/{platform → platform-lib}/__tests__/detectResources.spec.ts +0 -0
  451. /package/src/cli/{platform → platform-lib}/providers/GitHubSecretStore.ts +0 -0
  452. /package/src/cli/{platform → platform-lib}/providers/MemorySecretStore.ts +0 -0
  453. /package/src/cli/{platform → platform-lib}/providers/PlatformCacheProvider.ts +0 -0
  454. /package/src/cli/{platform → platform-lib}/providers/SecretStoreProvider.ts +0 -0
  455. /package/src/cli/{platform → platform-lib}/schemas/cloudflare.ts +0 -0
  456. /package/src/cli/{platform → platform-lib}/schemas/platform.ts +0 -0
  457. /package/src/cli/{platform → platform-lib}/schemas/vercel.ts +0 -0
  458. /package/src/cli/{platform → platform-lib}/services/CloudflareApi.ts +0 -0
  459. /package/src/cli/{platform → platform-lib}/services/SecretFilterService.ts +0 -0
  460. /package/src/cli/{platform → platform-lib}/services/VercelApi.ts +0 -0
  461. /package/src/cli/{platform → platform-lib}/services/VercelCli.ts +0 -0
  462. /package/src/{containers → container}/core/interfaces/ContainerOptions.ts +0 -0
  463. /package/src/{containers → container}/core/providers/NodeContainerProvider.ts +0 -0
@@ -1,16 +1,8 @@
1
- import * as _$alepha from "alepha";
2
1
  import { Alepha, Middleware, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
- import * as _$alepha_server0 from "alepha/server";
4
- import * as _$alepha_orm0 from "alepha/orm";
5
2
  import { Page } from "alepha/orm";
6
- import * as _$alepha_api_parameters0 from "alepha/api/parameters";
7
3
  import { DateTimeProvider } from "alepha/datetime";
8
- import * as _$alepha_logger0 from "alepha/logger";
9
- import * as _$alepha_api_jobs0 from "alepha/api/jobs";
10
4
  import { PaymentService } from "alepha/api/payments";
11
- import * as _$alepha_api_notifications0 from "alepha/api/notifications";
12
5
  import { CacheProvider } from "alepha/cache";
13
- import * as _$typebox from "typebox";
14
6
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
15
7
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
16
8
  //#region ../../src/orm/core/schemas/insertSchema.d.ts
@@ -304,8 +296,8 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
304
296
  * - `d1://BINDING_NAME` — Cloudflare D1
305
297
  * - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
306
298
  */
307
- declare const databaseEnvSchema: _$typebox.TObject<{
308
- DATABASE_URL: _$typebox.TOptional<_$typebox.TString>;
299
+ declare const databaseEnvSchema: import("typebox").TObject<{
300
+ DATABASE_URL: import("typebox").TOptional<import("typebox").TString>;
309
301
  /**
310
302
  * Enable or disable push-based schema synchronization (drizzle-kit push).
311
303
  *
@@ -313,125 +305,125 @@ declare const databaseEnvSchema: _$typebox.TObject<{
313
305
  * Set to `false` in development to skip automatic schema sync
314
306
  * (e.g. when managing migrations manually).
315
307
  */
316
- DATABASE_SYNC: _$typebox.TOptional<_$typebox.TBoolean>;
308
+ DATABASE_SYNC: import("typebox").TOptional<import("typebox").TBoolean>;
317
309
  }>;
318
310
  declare module "alepha" {
319
311
  interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
320
312
  } //# sourceMappingURL=databaseEnvSchema.d.ts.map
321
313
  //#endregion
322
314
  //#region ../../src/api/subscriptions/schemas/planDefinitionSchema.d.ts
323
- declare const planDefinitionSchema: _$typebox.TObject<{
315
+ declare const planDefinitionSchema: import("typebox").TObject<{
324
316
  /**
325
317
  * Unique plan identifier (e.g., "free", "starter", "pro", "enterprise").
326
318
  */
327
- id: _$typebox.TString;
319
+ id: import("typebox").TString;
328
320
  /**
329
321
  * Display name (e.g., "Pro Plan").
330
322
  */
331
- name: _$typebox.TString;
323
+ name: import("typebox").TString;
332
324
  /**
333
325
  * Optional description.
334
326
  */
335
- description: _$typebox.TOptional<_$typebox.TString>;
327
+ description: import("typebox").TOptional<import("typebox").TString>;
336
328
  /**
337
329
  * Whether this plan is available for new subscriptions.
338
330
  */
339
- available: _$typebox.TBoolean;
331
+ available: import("typebox").TBoolean;
340
332
  /**
341
333
  * Pricing per billing interval.
342
334
  * Multiple entries for monthly/yearly.
343
335
  */
344
- pricing: _$typebox.TArray<_$typebox.TObject<{
345
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
346
- amount: _$typebox.TInteger;
347
- currency: _$typebox.TString;
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;
348
340
  }>>;
349
341
  /**
350
342
  * Trial configuration for this plan.
351
343
  * Overrides global settings.trialDays if set.
352
344
  */
353
- trial: _$typebox.TOptional<_$typebox.TObject<{
354
- days: _$typebox.TInteger;
355
- requirePaymentMethod: _$typebox.TBoolean;
345
+ trial: import("typebox").TOptional<import("typebox").TObject<{
346
+ days: import("typebox").TInteger;
347
+ requirePaymentMethod: import("typebox").TBoolean;
356
348
  }>>;
357
349
  /**
358
350
  * Feature entitlements. Boolean flags for feature access.
359
351
  * Checked via SubscriptionService.can("feature-name").
360
352
  */
361
- features: _$typebox.TArray<_$typebox.TString>;
353
+ features: import("typebox").TArray<import("typebox").TString>;
362
354
  /**
363
355
  * Usage limits. Numeric caps on resources.
364
356
  * Checked via SubscriptionService.limit("resource-name").
365
357
  * -1 = unlimited.
366
358
  */
367
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
359
+ limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
368
360
  /**
369
361
  * Sort order for display (lower = first).
370
362
  */
371
- order: _$typebox.TInteger;
363
+ order: import("typebox").TInteger;
372
364
  /**
373
365
  * Metadata for app-specific plan data.
374
366
  */
375
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
367
+ metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
376
368
  }>;
377
369
  type PlanDefinition = Static<typeof planDefinitionSchema>;
378
370
  //#endregion
379
371
  //#region ../../src/api/subscriptions/schemas/subscriptionSettingsSchema.d.ts
380
- declare const subscriptionSettingsSchema: _$typebox.TObject<{
372
+ declare const subscriptionSettingsSchema: import("typebox").TObject<{
381
373
  /**
382
374
  * Default trial days (overridden per-plan if plan.trial.days is set).
383
375
  */
384
- trialDays: _$typebox.TInteger;
376
+ trialDays: import("typebox").TInteger;
385
377
  /**
386
378
  * Days after payment failure before suspension.
387
379
  * During grace period, subscription remains active but flagged.
388
380
  */
389
- gracePeriodDays: _$typebox.TInteger;
381
+ gracePeriodDays: import("typebox").TInteger;
390
382
  /**
391
383
  * Days after first payment failure to retry, relative to the failure date.
392
384
  * e.g., [1, 3, 5, 7] means retry on day 1, 3, 5, 7 after failure.
393
385
  */
394
- dunningSchedule: _$typebox.TArray<_$typebox.TInteger>;
386
+ dunningSchedule: import("typebox").TArray<import("typebox").TInteger>;
395
387
  /**
396
388
  * When user cancels, wait until period end (true) or cancel immediately (false).
397
389
  */
398
- cancelAtPeriodEnd: _$typebox.TBoolean;
390
+ cancelAtPeriodEnd: import("typebox").TBoolean;
399
391
  /**
400
392
  * Prorate charges when changing plans mid-cycle.
401
393
  */
402
- prorateOnChange: _$typebox.TBoolean;
394
+ prorateOnChange: import("typebox").TBoolean;
403
395
  }>;
404
396
  type SubscriptionSettings = Static<typeof subscriptionSettingsSchema>;
405
397
  //#endregion
406
398
  //#region ../../src/api/subscriptions/services/SubscriptionConfig.d.ts
407
399
  declare class SubscriptionConfig {
408
- protected readonly plans: _$alepha_api_parameters0.ParameterPrimitive<_$typebox.TObject<{
409
- plans: _$typebox.TArray<_$typebox.TObject<{
410
- id: _$typebox.TString;
411
- name: _$typebox.TString;
412
- description: _$typebox.TOptional<_$typebox.TString>;
413
- available: _$typebox.TBoolean;
414
- pricing: _$typebox.TArray<_$typebox.TObject<{
415
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
416
- amount: _$typebox.TInteger;
417
- currency: _$typebox.TString;
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;
418
410
  }>>;
419
- trial: _$typebox.TOptional<_$typebox.TObject<{
420
- days: _$typebox.TInteger;
421
- requirePaymentMethod: _$typebox.TBoolean;
411
+ trial: import("typebox").TOptional<import("typebox").TObject<{
412
+ days: import("typebox").TInteger;
413
+ requirePaymentMethod: import("typebox").TBoolean;
422
414
  }>>;
423
- features: _$typebox.TArray<_$typebox.TString>;
424
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
425
- order: _$typebox.TInteger;
426
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
427
419
  }>>;
428
420
  }>>;
429
- protected readonly settings: _$alepha_api_parameters0.ParameterPrimitive<_$typebox.TObject<{
430
- trialDays: _$typebox.TInteger;
431
- gracePeriodDays: _$typebox.TInteger;
432
- dunningSchedule: _$typebox.TArray<_$typebox.TInteger>;
433
- cancelAtPeriodEnd: _$typebox.TBoolean;
434
- prorateOnChange: _$typebox.TBoolean;
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;
435
427
  }>>;
436
428
  getPlans(): Promise<PlanDefinition[]>;
437
429
  getSettings(): Promise<SubscriptionSettings>;
@@ -444,93 +436,93 @@ declare class SubscriptionConfig {
444
436
  }
445
437
  //#endregion
446
438
  //#region ../../src/api/subscriptions/entities/subscriptionEvents.d.ts
447
- declare const subscriptionEvents: _$alepha_orm0.EntityPrimitive<_$typebox.TObject<{
448
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
449
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
450
- subscriptionId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_REF>;
451
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
452
- type: _$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">;
453
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
454
- newStatus: _$typebox.TOptional<_$typebox.TString>;
455
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
456
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
457
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
458
- amount: _$typebox.TOptional<_$typebox.TInteger>;
459
- currency: _$typebox.TOptional<_$typebox.TString>;
460
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
461
- userId: _$typebox.TOptional<_$typebox.TString>;
462
- note: _$typebox.TOptional<_$typebox.TString>;
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>;
463
455
  }>>;
464
456
  type SubscriptionEventEntity = Static<typeof subscriptionEvents.schema>;
465
457
  //#endregion
466
458
  //#region ../../src/api/subscriptions/entities/subscriptions.d.ts
467
- declare const subscriptions: _$alepha_orm0.EntityPrimitive<_$typebox.TObject<{
468
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
469
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
470
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
471
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
472
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
473
- planId: _$typebox.TString;
474
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
475
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
476
- currentPeriodStart: _$typebox.TString;
477
- currentPeriodEnd: _$typebox.TString;
478
- trialStart: _$typebox.TOptional<_$typebox.TString>;
479
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
480
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
481
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
482
- cancelAtPeriodEnd: _$typebox.TBoolean;
483
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
484
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
485
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
486
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
487
- dunningAttempt: _$typebox.TInteger;
488
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
489
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
490
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
491
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
492
484
  }>>;
493
485
  type SubscriptionEntity = Static<typeof subscriptions.schema>;
494
486
  //#endregion
495
487
  //#region ../../src/api/subscriptions/schemas/entitlementsSchema.d.ts
496
- declare const entitlementsSchema: _$typebox.TObject<{
497
- planId: _$typebox.TString;
498
- planName: _$typebox.TString;
499
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
500
- features: _$typebox.TArray<_$typebox.TString>;
501
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
502
- trialEndsAt: _$typebox.TOptional<_$typebox.TString>;
503
- periodEndsAt: _$typebox.TString;
504
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
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>;
505
497
  }>;
506
498
  type Entitlements = Static<typeof entitlementsSchema>;
507
499
  //#endregion
508
500
  //#region ../../src/api/subscriptions/schemas/subscriptionQuerySchema.d.ts
509
- declare const subscriptionQuerySchema: _$typebox.TObject<{
510
- page: _$typebox.TOptional<_$typebox.TInteger>;
511
- size: _$typebox.TOptional<_$typebox.TInteger>;
512
- sort: _$typebox.TOptional<_$typebox.TString>;
513
- status: _$typebox.TOptional<_$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">>;
514
- planId: _$typebox.TOptional<_$typebox.TString>;
515
- organizationId: _$typebox.TOptional<_$typebox.TString>;
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>;
516
508
  }>;
517
509
  type SubscriptionQuery = Static<typeof subscriptionQuerySchema>;
518
510
  //#endregion
519
511
  //#region ../../src/api/subscriptions/schemas/subscriptionStatsSchema.d.ts
520
- declare const subscriptionStatsSchema: _$typebox.TObject<{
521
- total: _$typebox.TInteger;
522
- trialing: _$typebox.TInteger;
523
- active: _$typebox.TInteger;
524
- pastDue: _$typebox.TInteger;
525
- suspended: _$typebox.TInteger;
526
- cancelled: _$typebox.TInteger;
527
- expired: _$typebox.TInteger;
528
- trialConversionRate: _$typebox.TNumber;
529
- churnRate: _$typebox.TNumber;
530
- byPlan: _$typebox.TRecord<"^.*$", _$typebox.TObject<{
531
- active: _$typebox.TInteger;
532
- trialing: _$typebox.TInteger;
533
- total: _$typebox.TInteger;
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;
534
526
  }>>;
535
527
  }>;
536
528
  type SubscriptionStats = Static<typeof subscriptionStatsSchema>;
@@ -588,50 +580,50 @@ interface EventContext$2 {
588
580
  }
589
581
  declare class SubscriptionService {
590
582
  protected readonly alepha: Alepha;
591
- protected readonly log: _$alepha_logger0.Logger;
583
+ protected readonly log: import("alepha/logger").Logger;
592
584
  protected readonly dateTime: DateTimeProvider;
593
- protected readonly subscriptionRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
594
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
595
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
596
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
597
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
598
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
599
- planId: _$typebox.TString;
600
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
601
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
602
- currentPeriodStart: _$typebox.TString;
603
- currentPeriodEnd: _$typebox.TString;
604
- trialStart: _$typebox.TOptional<_$typebox.TString>;
605
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
606
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
607
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
608
- cancelAtPeriodEnd: _$typebox.TBoolean;
609
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
610
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
611
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
612
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
613
- dunningAttempt: _$typebox.TInteger;
614
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
615
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
616
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
617
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
618
610
  }>>;
619
- protected readonly eventRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
620
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
621
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
622
- subscriptionId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_REF>;
623
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
624
- type: _$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">;
625
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
626
- newStatus: _$typebox.TOptional<_$typebox.TString>;
627
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
628
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
629
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
630
- amount: _$typebox.TOptional<_$typebox.TInteger>;
631
- currency: _$typebox.TOptional<_$typebox.TString>;
632
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
633
- userId: _$typebox.TOptional<_$typebox.TString>;
634
- note: _$typebox.TOptional<_$typebox.TString>;
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>;
635
627
  }>>;
636
628
  protected readonly config: SubscriptionConfig;
637
629
  /**
@@ -737,206 +729,206 @@ declare class AdminSubscriptionController {
737
729
  /**
738
730
  * Find subscriptions with pagination and filtering.
739
731
  */
740
- readonly findSubscriptions: _$alepha_server0.ActionPrimitiveFn<{
741
- query: _$typebox.TObject<{
742
- page: _$typebox.TOptional<_$typebox.TInteger>;
743
- size: _$typebox.TOptional<_$typebox.TInteger>;
744
- sort: _$typebox.TOptional<_$typebox.TString>;
745
- status: _$typebox.TOptional<_$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">>;
746
- planId: _$typebox.TOptional<_$typebox.TString>;
747
- organizationId: _$typebox.TOptional<_$typebox.TString>;
732
+ 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>;
748
740
  }>;
749
- response: _$alepha.TPage<_$typebox.TObject<{
750
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
751
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
752
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
753
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
754
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
755
- planId: _$typebox.TString;
756
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
757
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
758
- currentPeriodStart: _$typebox.TString;
759
- currentPeriodEnd: _$typebox.TString;
760
- trialStart: _$typebox.TOptional<_$typebox.TString>;
761
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
762
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
763
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
764
- cancelAtPeriodEnd: _$typebox.TBoolean;
765
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
766
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
767
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
768
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
769
- dunningAttempt: _$typebox.TInteger;
770
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
771
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
772
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
773
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
774
766
  }>>;
775
767
  }>;
776
768
  /**
777
769
  * Get a subscription by ID.
778
770
  */
779
- readonly getSubscription: _$alepha_server0.ActionPrimitiveFn<{
780
- params: _$typebox.TObject<{
781
- id: _$typebox.TString;
771
+ readonly getSubscription: import("alepha/server").ActionPrimitiveFn<{
772
+ params: import("typebox").TObject<{
773
+ id: import("typebox").TString;
782
774
  }>;
783
- response: _$typebox.TObject<{
784
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
785
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
786
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
787
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
788
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
789
- planId: _$typebox.TString;
790
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
791
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
792
- currentPeriodStart: _$typebox.TString;
793
- currentPeriodEnd: _$typebox.TString;
794
- trialStart: _$typebox.TOptional<_$typebox.TString>;
795
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
796
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
797
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
798
- cancelAtPeriodEnd: _$typebox.TBoolean;
799
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
800
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
801
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
802
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
803
- dunningAttempt: _$typebox.TInteger;
804
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
805
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
806
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
807
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
808
800
  }>;
809
801
  }>;
810
802
  /**
811
803
  * Get aggregated subscription statistics.
812
804
  */
813
- readonly getStats: _$alepha_server0.ActionPrimitiveFn<{
814
- response: _$typebox.TObject<{
815
- total: _$typebox.TInteger;
816
- trialing: _$typebox.TInteger;
817
- active: _$typebox.TInteger;
818
- pastDue: _$typebox.TInteger;
819
- suspended: _$typebox.TInteger;
820
- cancelled: _$typebox.TInteger;
821
- expired: _$typebox.TInteger;
822
- trialConversionRate: _$typebox.TNumber;
823
- churnRate: _$typebox.TNumber;
824
- byPlan: _$typebox.TRecord<"^.*$", _$typebox.TObject<{
825
- active: _$typebox.TInteger;
826
- trialing: _$typebox.TInteger;
827
- total: _$typebox.TInteger;
805
+ 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;
828
820
  }>>;
829
821
  }>;
830
822
  }>;
831
823
  /**
832
824
  * Get revenue data from recent subscription events.
833
825
  */
834
- readonly getRevenue: _$alepha_server0.ActionPrimitiveFn<{
835
- query: _$typebox.TObject<{
836
- days: _$typebox.TOptional<_$typebox.TInteger>;
826
+ readonly getRevenue: import("alepha/server").ActionPrimitiveFn<{
827
+ query: import("typebox").TObject<{
828
+ days: import("typebox").TOptional<import("typebox").TInteger>;
837
829
  }>;
838
- response: _$typebox.TObject<{
839
- total: _$typebox.TInteger;
840
- count: _$typebox.TInteger;
830
+ response: import("typebox").TObject<{
831
+ total: import("typebox").TInteger;
832
+ count: import("typebox").TInteger;
841
833
  }>;
842
834
  }>;
843
835
  /**
844
836
  * Get Monthly Recurring Revenue breakdown.
845
837
  */
846
- readonly getMrr: _$alepha_server0.ActionPrimitiveFn<{
847
- response: _$typebox.TObject<{
848
- total: _$typebox.TInteger;
849
- byPlan: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
850
- growth: _$typebox.TInteger;
851
- newMrr: _$typebox.TInteger;
852
- expansionMrr: _$typebox.TInteger;
853
- contractionMrr: _$typebox.TInteger;
854
- churnMrr: _$typebox.TInteger;
838
+ 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;
855
847
  }>;
856
848
  }>;
857
849
  /**
858
850
  * Force a plan change for a subscription (admin action).
859
851
  */
860
- readonly adminChangePlan: _$alepha_server0.ActionPrimitiveFn<{
861
- params: _$typebox.TObject<{
862
- id: _$typebox.TString;
852
+ readonly adminChangePlan: import("alepha/server").ActionPrimitiveFn<{
853
+ params: import("typebox").TObject<{
854
+ id: import("typebox").TString;
863
855
  }>;
864
- body: _$typebox.TObject<{
865
- planId: _$typebox.TString;
866
- interval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
867
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
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>;
868
860
  }>;
869
- response: _$typebox.TObject<{
870
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
871
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
872
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
873
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
874
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
875
- planId: _$typebox.TString;
876
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
877
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
878
- currentPeriodStart: _$typebox.TString;
879
- currentPeriodEnd: _$typebox.TString;
880
- trialStart: _$typebox.TOptional<_$typebox.TString>;
881
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
882
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
883
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
884
- cancelAtPeriodEnd: _$typebox.TBoolean;
885
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
886
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
887
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
888
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
889
- dunningAttempt: _$typebox.TInteger;
890
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
891
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
892
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
893
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
894
886
  }>;
895
887
  }>;
896
888
  /**
897
889
  * Force cancel a subscription (admin action).
898
890
  */
899
- readonly adminCancel: _$alepha_server0.ActionPrimitiveFn<{
900
- params: _$typebox.TObject<{
901
- id: _$typebox.TString;
891
+ readonly adminCancel: import("alepha/server").ActionPrimitiveFn<{
892
+ params: import("typebox").TObject<{
893
+ id: import("typebox").TString;
902
894
  }>;
903
- body: _$typebox.TObject<{
904
- reason: _$typebox.TOptional<_$typebox.TString>;
905
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
895
+ body: import("typebox").TObject<{
896
+ reason: import("typebox").TOptional<import("typebox").TString>;
897
+ immediate: import("typebox").TOptional<import("typebox").TBoolean>;
906
898
  }>;
907
- response: _$typebox.TObject<{
908
- ok: _$typebox.TBoolean;
909
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
910
- count: _$typebox.TOptional<_$typebox.TNumber>;
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>;
911
903
  }>;
912
904
  }>;
913
905
  /**
914
906
  * Reactivate a suspended subscription (admin action).
915
907
  */
916
- readonly adminReactivate: _$alepha_server0.ActionPrimitiveFn<{
917
- params: _$typebox.TObject<{
918
- id: _$typebox.TString;
908
+ readonly adminReactivate: import("alepha/server").ActionPrimitiveFn<{
909
+ params: import("typebox").TObject<{
910
+ id: import("typebox").TString;
919
911
  }>;
920
- response: _$typebox.TObject<{
921
- ok: _$typebox.TBoolean;
922
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
923
- count: _$typebox.TOptional<_$typebox.TNumber>;
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>;
924
916
  }>;
925
917
  }>;
926
918
  /**
927
919
  * Extend the trial period for a trialing subscription (admin action).
928
920
  */
929
- readonly adminExtendTrial: _$alepha_server0.ActionPrimitiveFn<{
930
- params: _$typebox.TObject<{
931
- id: _$typebox.TString;
921
+ readonly adminExtendTrial: import("alepha/server").ActionPrimitiveFn<{
922
+ params: import("typebox").TObject<{
923
+ id: import("typebox").TString;
932
924
  }>;
933
- body: _$typebox.TObject<{
934
- days: _$typebox.TInteger;
925
+ body: import("typebox").TObject<{
926
+ days: import("typebox").TInteger;
935
927
  }>;
936
- response: _$typebox.TObject<{
937
- ok: _$typebox.TBoolean;
938
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
939
- count: _$typebox.TOptional<_$typebox.TNumber>;
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>;
940
932
  }>;
941
933
  }>;
942
934
  }
@@ -950,189 +942,189 @@ declare class SubscriptionController {
950
942
  /**
951
943
  * List available subscription plans with pricing.
952
944
  */
953
- readonly getPlans: _$alepha_server0.ActionPrimitiveFn<{
954
- response: _$typebox.TArray<_$typebox.TObject<{
955
- id: _$typebox.TString;
956
- name: _$typebox.TString;
957
- description: _$typebox.TOptional<_$typebox.TString>;
958
- pricing: _$typebox.TArray<_$typebox.TObject<{
959
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
960
- amount: _$typebox.TInteger;
961
- currency: _$typebox.TString;
945
+ 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;
962
954
  }>>;
963
- features: _$typebox.TArray<_$typebox.TString>;
964
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
965
- trial: _$typebox.TOptional<_$typebox.TObject<{
966
- days: _$typebox.TInteger;
967
- requirePaymentMethod: _$typebox.TBoolean;
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;
968
960
  }>>;
969
- order: _$typebox.TInteger;
961
+ order: import("typebox").TInteger;
970
962
  }>>;
971
963
  }>;
972
964
  /**
973
965
  * Get the current organization's subscription.
974
966
  */
975
- readonly getMySubscription: _$alepha_server0.ActionPrimitiveFn<{
976
- response: _$typebox.TObject<{
977
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
978
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
979
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
980
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
981
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
982
- planId: _$typebox.TString;
983
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
984
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
985
- currentPeriodStart: _$typebox.TString;
986
- currentPeriodEnd: _$typebox.TString;
987
- trialStart: _$typebox.TOptional<_$typebox.TString>;
988
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
989
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
990
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
991
- cancelAtPeriodEnd: _$typebox.TBoolean;
992
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
993
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
994
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
995
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
996
- dunningAttempt: _$typebox.TInteger;
997
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
998
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
999
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1000
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
967
+ 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>>;
1001
993
  }>;
1002
994
  }>;
1003
995
  /**
1004
996
  * Create a new subscription for the current organization.
1005
997
  */
1006
- readonly subscribe: _$alepha_server0.ActionPrimitiveFn<{
1007
- body: _$typebox.TObject<{
1008
- planId: _$typebox.TString;
1009
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1010
- paymentMethodId: _$typebox.TOptional<_$typebox.TString>;
1011
- skipTrial: _$typebox.TOptional<_$typebox.TBoolean>;
1012
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
998
+ 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>>;
1013
1005
  }>;
1014
- response: _$typebox.TObject<{
1015
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1016
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1017
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1018
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1019
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
1020
- planId: _$typebox.TString;
1021
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1022
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1023
- currentPeriodStart: _$typebox.TString;
1024
- currentPeriodEnd: _$typebox.TString;
1025
- trialStart: _$typebox.TOptional<_$typebox.TString>;
1026
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
1027
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1028
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
1029
- cancelAtPeriodEnd: _$typebox.TBoolean;
1030
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1031
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
1032
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
1033
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
1034
- dunningAttempt: _$typebox.TInteger;
1035
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
1036
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
1037
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1038
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1039
1031
  }>;
1040
1032
  }>;
1041
1033
  /**
1042
1034
  * Change the plan for the current organization's subscription.
1043
1035
  */
1044
- readonly changePlan: _$alepha_server0.ActionPrimitiveFn<{
1045
- body: _$typebox.TObject<{
1046
- planId: _$typebox.TString;
1047
- interval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1048
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
1036
+ 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>;
1049
1041
  }>;
1050
- response: _$typebox.TObject<{
1051
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1052
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1053
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1054
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1055
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
1056
- planId: _$typebox.TString;
1057
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1058
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1059
- currentPeriodStart: _$typebox.TString;
1060
- currentPeriodEnd: _$typebox.TString;
1061
- trialStart: _$typebox.TOptional<_$typebox.TString>;
1062
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
1063
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1064
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
1065
- cancelAtPeriodEnd: _$typebox.TBoolean;
1066
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1067
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
1068
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
1069
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
1070
- dunningAttempt: _$typebox.TInteger;
1071
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
1072
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
1073
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1074
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1075
1067
  }>;
1076
1068
  }>;
1077
1069
  /**
1078
1070
  * Cancel the current organization's subscription.
1079
1071
  */
1080
- readonly cancel: _$alepha_server0.ActionPrimitiveFn<{
1081
- body: _$typebox.TObject<{
1082
- reason: _$typebox.TOptional<_$typebox.TString>;
1083
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
1072
+ 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>;
1084
1076
  }>;
1085
- response: _$typebox.TObject<{
1086
- ok: _$typebox.TBoolean;
1087
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
1088
- count: _$typebox.TOptional<_$typebox.TNumber>;
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>;
1089
1081
  }>;
1090
1082
  }>;
1091
1083
  /**
1092
1084
  * Resume a cancelled subscription before the period ends.
1093
1085
  */
1094
- readonly resume: _$alepha_server0.ActionPrimitiveFn<{
1095
- response: _$typebox.TObject<{
1096
- ok: _$typebox.TBoolean;
1097
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
1098
- count: _$typebox.TOptional<_$typebox.TNumber>;
1086
+ 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>;
1099
1091
  }>;
1100
1092
  }>;
1101
1093
  /**
1102
1094
  * Get the billing event history for the current organization's subscription.
1103
1095
  */
1104
- readonly getSubscriptionHistory: _$alepha_server0.ActionPrimitiveFn<{
1105
- response: _$typebox.TArray<_$typebox.TObject<{
1106
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1107
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1108
- subscriptionId: PgAttr<_$typebox.TString, typeof PG_REF>;
1109
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
1110
- type: _$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">;
1111
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
1112
- newStatus: _$typebox.TOptional<_$typebox.TString>;
1113
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
1114
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
1115
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1116
- amount: _$typebox.TOptional<_$typebox.TInteger>;
1117
- currency: _$typebox.TOptional<_$typebox.TString>;
1118
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
1119
- userId: _$typebox.TOptional<_$typebox.TString>;
1120
- note: _$typebox.TOptional<_$typebox.TString>;
1096
+ 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>;
1121
1113
  }>>;
1122
1114
  }>;
1123
1115
  /**
1124
1116
  * Get the feature and usage limit entitlements for the current organization.
1125
1117
  */
1126
- readonly getEntitlements: _$alepha_server0.ActionPrimitiveFn<{
1127
- response: _$typebox.TObject<{
1128
- planId: _$typebox.TString;
1129
- planName: _$typebox.TString;
1130
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1131
- features: _$typebox.TArray<_$typebox.TString>;
1132
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
1133
- trialEndsAt: _$typebox.TOptional<_$typebox.TString>;
1134
- periodEndsAt: _$typebox.TString;
1135
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1118
+ 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>;
1136
1128
  }>;
1137
1129
  }>;
1138
1130
  }
@@ -1148,52 +1140,52 @@ interface EventContext$1 {
1148
1140
  note?: string;
1149
1141
  }
1150
1142
  declare class SubscriptionJobs {
1151
- protected readonly log: _$alepha_logger0.Logger;
1143
+ protected readonly log: import("alepha/logger").Logger;
1152
1144
  protected readonly dateTime: DateTimeProvider;
1153
1145
  protected readonly paymentService: PaymentService;
1154
1146
  protected readonly config: SubscriptionConfig;
1155
- protected readonly subscriptionRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
1156
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
1157
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
1158
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1159
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1160
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
1161
- planId: _$typebox.TString;
1162
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1163
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1164
- currentPeriodStart: _$typebox.TString;
1165
- currentPeriodEnd: _$typebox.TString;
1166
- trialStart: _$typebox.TOptional<_$typebox.TString>;
1167
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
1168
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1169
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
1170
- cancelAtPeriodEnd: _$typebox.TBoolean;
1171
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1172
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
1173
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
1174
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
1175
- dunningAttempt: _$typebox.TInteger;
1176
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
1177
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
1178
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1179
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1180
1172
  }>>;
1181
- protected readonly eventRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
1182
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
1183
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1184
- subscriptionId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_REF>;
1185
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
1186
- type: _$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">;
1187
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
1188
- newStatus: _$typebox.TOptional<_$typebox.TString>;
1189
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
1190
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
1191
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1192
- amount: _$typebox.TOptional<_$typebox.TInteger>;
1193
- currency: _$typebox.TOptional<_$typebox.TString>;
1194
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
1195
- userId: _$typebox.TOptional<_$typebox.TString>;
1196
- note: _$typebox.TOptional<_$typebox.TString>;
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>;
1197
1189
  }>>;
1198
1190
  /**
1199
1191
  * Record a subscription event in the event log.
@@ -1203,32 +1195,32 @@ declare class SubscriptionJobs {
1203
1195
  * Creates payment intents for subscriptions due for renewal.
1204
1196
  * Runs hourly.
1205
1197
  */
1206
- readonly billingCycle: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1198
+ readonly billingCycle: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1207
1199
  /**
1208
1200
  * Retries failed payments on the dunning schedule.
1209
1201
  * Runs hourly.
1210
1202
  */
1211
- readonly dunningRetry: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1203
+ readonly dunningRetry: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1212
1204
  /**
1213
1205
  * Handles trial expirations.
1214
1206
  * Runs hourly.
1215
1207
  */
1216
- readonly trialExpiry: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1208
+ readonly trialExpiry: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1217
1209
  /**
1218
1210
  * Expires cancelled subscriptions that reached period end.
1219
1211
  * Runs hourly.
1220
1212
  */
1221
- readonly expirationSweep: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1213
+ readonly expirationSweep: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1222
1214
  /**
1223
1215
  * Suspends past_due subscriptions where grace period has elapsed.
1224
1216
  * Runs daily at 2 AM.
1225
1217
  */
1226
- readonly gracePeriodSweep: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1218
+ readonly gracePeriodSweep: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1227
1219
  /**
1228
1220
  * Purges old subscription events older than 365 days.
1229
1221
  * Runs daily at 3 AM.
1230
1222
  */
1231
- readonly purgeEvents: _$alepha_api_jobs0.JobPrimitive<_$typebox.TSchema>;
1223
+ readonly purgeEvents: import("alepha/api/jobs").JobPrimitive<import("typebox").TSchema>;
1232
1224
  }
1233
1225
  //#endregion
1234
1226
  //#region ../../src/api/subscriptions/middleware/$requireLimit.d.ts
@@ -1279,154 +1271,154 @@ declare class SubscriptionNotifications {
1279
1271
  /**
1280
1272
  * Sent when a trial is ending soon.
1281
1273
  */
1282
- protected readonly trialEnding: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1283
- planName: _$typebox.TString;
1284
- trialEndDate: _$typebox.TString;
1285
- amount: _$typebox.TString;
1286
- interval: _$typebox.TString;
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;
1287
1279
  }>>;
1288
1280
  /**
1289
1281
  * Sent when a payment fails. Critical notification.
1290
1282
  */
1291
- protected readonly paymentFailed: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1292
- planName: _$typebox.TString;
1293
- amount: _$typebox.TString;
1294
- retryDate: _$typebox.TOptional<_$typebox.TString>;
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>;
1295
1287
  }>>;
1296
1288
  /**
1297
1289
  * Sent when a subscription is suspended due to failed payments. Critical notification.
1298
1290
  */
1299
- protected readonly subscriptionSuspended: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1300
- planName: _$typebox.TString;
1291
+ protected readonly subscriptionSuspended: import("alepha/api/notifications").NotificationPrimitive<import("typebox").TObject<{
1292
+ planName: import("typebox").TString;
1301
1293
  }>>;
1302
1294
  /**
1303
1295
  * Sent when a subscription is successfully renewed.
1304
1296
  */
1305
- protected readonly subscriptionRenewed: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1306
- planName: _$typebox.TString;
1307
- amount: _$typebox.TString;
1308
- nextBillingDate: _$typebox.TString;
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;
1309
1301
  }>>;
1310
1302
  /**
1311
1303
  * Sent when a subscription plan is changed.
1312
1304
  */
1313
- protected readonly planChanged: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1314
- oldPlanName: _$typebox.TString;
1315
- newPlanName: _$typebox.TString;
1316
- effectiveDate: _$typebox.TString;
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;
1317
1309
  }>>;
1318
1310
  /**
1319
1311
  * Sent when a subscription is cancelled.
1320
1312
  */
1321
- protected readonly cancellationConfirmed: _$alepha_api_notifications0.NotificationPrimitive<_$typebox.TObject<{
1322
- planName: _$typebox.TString;
1323
- accessUntil: _$typebox.TOptional<_$typebox.TString>;
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>;
1324
1316
  }>>;
1325
1317
  }
1326
1318
  //#endregion
1327
1319
  //#region ../../src/api/subscriptions/schemas/cancelSubscriptionSchema.d.ts
1328
- declare const cancelSubscriptionSchema: _$typebox.TObject<{
1329
- reason: _$typebox.TOptional<_$typebox.TString>;
1330
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
1320
+ declare const cancelSubscriptionSchema: import("typebox").TObject<{
1321
+ reason: import("typebox").TOptional<import("typebox").TString>;
1322
+ immediate: import("typebox").TOptional<import("typebox").TBoolean>;
1331
1323
  }>;
1332
1324
  type CancelSubscription = Static<typeof cancelSubscriptionSchema>;
1333
1325
  //#endregion
1334
1326
  //#region ../../src/api/subscriptions/schemas/changePlanSchema.d.ts
1335
- declare const changePlanSchema: _$typebox.TObject<{
1336
- planId: _$typebox.TString;
1337
- interval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1338
- immediate: _$typebox.TOptional<_$typebox.TBoolean>;
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>;
1339
1331
  }>;
1340
1332
  type ChangePlan = Static<typeof changePlanSchema>;
1341
1333
  //#endregion
1342
1334
  //#region ../../src/api/subscriptions/schemas/createSubscriptionSchema.d.ts
1343
- declare const createSubscriptionSchema: _$typebox.TObject<{
1344
- planId: _$typebox.TString;
1345
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1346
- paymentMethodId: _$typebox.TOptional<_$typebox.TString>;
1347
- skipTrial: _$typebox.TOptional<_$typebox.TBoolean>;
1348
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1349
1341
  }>;
1350
1342
  type CreateSubscription = Static<typeof createSubscriptionSchema>;
1351
1343
  //#endregion
1352
1344
  //#region ../../src/api/subscriptions/schemas/mrrSchema.d.ts
1353
- declare const mrrSchema: _$typebox.TObject<{
1354
- total: _$typebox.TInteger;
1355
- byPlan: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
1356
- growth: _$typebox.TInteger;
1357
- newMrr: _$typebox.TInteger;
1358
- expansionMrr: _$typebox.TInteger;
1359
- contractionMrr: _$typebox.TInteger;
1360
- churnMrr: _$typebox.TInteger;
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;
1361
1353
  }>;
1362
1354
  type MrrData = Static<typeof mrrSchema>;
1363
1355
  //#endregion
1364
1356
  //#region ../../src/api/subscriptions/schemas/planResourceSchema.d.ts
1365
- declare const planResourceSchema: _$typebox.TObject<{
1366
- id: _$typebox.TString;
1367
- name: _$typebox.TString;
1368
- description: _$typebox.TOptional<_$typebox.TString>;
1369
- pricing: _$typebox.TArray<_$typebox.TObject<{
1370
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1371
- amount: _$typebox.TInteger;
1372
- currency: _$typebox.TString;
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;
1373
1365
  }>>;
1374
- features: _$typebox.TArray<_$typebox.TString>;
1375
- limits: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
1376
- trial: _$typebox.TOptional<_$typebox.TObject<{
1377
- days: _$typebox.TInteger;
1378
- requirePaymentMethod: _$typebox.TBoolean;
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;
1379
1371
  }>>;
1380
- order: _$typebox.TInteger;
1372
+ order: import("typebox").TInteger;
1381
1373
  }>;
1382
1374
  type PlanResource = Static<typeof planResourceSchema>;
1383
1375
  //#endregion
1384
1376
  //#region ../../src/api/subscriptions/schemas/subscriptionEventResourceSchema.d.ts
1385
- declare const subscriptionEventResourceSchema: _$typebox.TObject<{
1386
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1387
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1388
- subscriptionId: PgAttr<_$typebox.TString, typeof PG_REF>;
1389
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
1390
- type: _$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">;
1391
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
1392
- newStatus: _$typebox.TOptional<_$typebox.TString>;
1393
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
1394
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
1395
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1396
- amount: _$typebox.TOptional<_$typebox.TInteger>;
1397
- currency: _$typebox.TOptional<_$typebox.TString>;
1398
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
1399
- userId: _$typebox.TOptional<_$typebox.TString>;
1400
- note: _$typebox.TOptional<_$typebox.TString>;
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>;
1401
1393
  }>;
1402
1394
  type SubscriptionEventResource = Static<typeof subscriptionEventResourceSchema>;
1403
1395
  //#endregion
1404
1396
  //#region ../../src/api/subscriptions/schemas/subscriptionResourceSchema.d.ts
1405
- declare const subscriptionResourceSchema: _$typebox.TObject<{
1406
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
1407
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
1408
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
1409
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1410
- organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
1411
- planId: _$typebox.TString;
1412
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1413
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1414
- currentPeriodStart: _$typebox.TString;
1415
- currentPeriodEnd: _$typebox.TString;
1416
- trialStart: _$typebox.TOptional<_$typebox.TString>;
1417
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
1418
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1419
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
1420
- cancelAtPeriodEnd: _$typebox.TBoolean;
1421
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1422
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
1423
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
1424
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
1425
- dunningAttempt: _$typebox.TInteger;
1426
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
1427
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
1428
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1429
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1430
1422
  }>;
1431
1423
  type SubscriptionResource = Static<typeof subscriptionResourceSchema>;
1432
1424
  //#endregion
@@ -1451,50 +1443,50 @@ interface EventContext {
1451
1443
  }
1452
1444
  declare class BillingService {
1453
1445
  protected readonly alepha: Alepha;
1454
- protected readonly log: _$alepha_logger0.Logger;
1446
+ protected readonly log: import("alepha/logger").Logger;
1455
1447
  protected readonly dateTime: DateTimeProvider;
1456
- protected readonly subscriptionRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
1457
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
1458
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
1459
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1460
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1461
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
1462
- planId: _$typebox.TString;
1463
- interval: _$typebox.TUnsafe<"monthly" | "yearly">;
1464
- status: _$typebox.TUnsafe<"trialing" | "active" | "past_due" | "suspended" | "cancelled" | "expired">;
1465
- currentPeriodStart: _$typebox.TString;
1466
- currentPeriodEnd: _$typebox.TString;
1467
- trialStart: _$typebox.TOptional<_$typebox.TString>;
1468
- trialEnd: _$typebox.TOptional<_$typebox.TString>;
1469
- cancelledAt: _$typebox.TOptional<_$typebox.TString>;
1470
- cancelReason: _$typebox.TOptional<_$typebox.TString>;
1471
- cancelAtPeriodEnd: _$typebox.TBoolean;
1472
- lastPaymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1473
- lastPaymentAt: _$typebox.TOptional<_$typebox.TString>;
1474
- nextBillingAt: _$typebox.TOptional<_$typebox.TString>;
1475
- dunningStartedAt: _$typebox.TOptional<_$typebox.TString>;
1476
- dunningAttempt: _$typebox.TInteger;
1477
- dunningNextRetryAt: _$typebox.TOptional<_$typebox.TString>;
1478
- pendingPlanId: _$typebox.TOptional<_$typebox.TString>;
1479
- pendingInterval: _$typebox.TOptional<_$typebox.TUnsafe<"monthly" | "yearly">>;
1480
- metadata: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
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>>;
1481
1473
  }>>;
1482
- protected readonly eventRepo: _$alepha_orm0.Repository<_$typebox.TObject<{
1483
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
1484
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
1485
- subscriptionId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_REF>;
1486
- organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
1487
- type: _$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">;
1488
- previousStatus: _$typebox.TOptional<_$typebox.TString>;
1489
- newStatus: _$typebox.TOptional<_$typebox.TString>;
1490
- previousPlanId: _$typebox.TOptional<_$typebox.TString>;
1491
- newPlanId: _$typebox.TOptional<_$typebox.TString>;
1492
- paymentIntentId: _$typebox.TOptional<_$typebox.TString>;
1493
- amount: _$typebox.TOptional<_$typebox.TInteger>;
1494
- currency: _$typebox.TOptional<_$typebox.TString>;
1495
- triggeredBy: _$typebox.TOptional<_$typebox.TString>;
1496
- userId: _$typebox.TOptional<_$typebox.TString>;
1497
- note: _$typebox.TOptional<_$typebox.TString>;
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>;
1498
1490
  }>>;
1499
1491
  protected readonly paymentService: PaymentService;
1500
1492
  protected readonly config: SubscriptionConfig;
@@ -1502,12 +1494,12 @@ declare class BillingService {
1502
1494
  * React to successful payment capture.
1503
1495
  * Routes to the appropriate handler based on subscription status.
1504
1496
  */
1505
- protected readonly onPaymentCaptured: _$alepha.HookPrimitive<"payments:captured">;
1497
+ protected readonly onPaymentCaptured: import("alepha").HookPrimitive<"payments:captured">;
1506
1498
  /**
1507
1499
  * React to failed payment.
1508
1500
  * Starts or advances the dunning flow.
1509
1501
  */
1510
- protected readonly onPaymentFailed: _$alepha.HookPrimitive<"payments:failed">;
1502
+ protected readonly onPaymentFailed: import("alepha").HookPrimitive<"payments:failed">;
1511
1503
  /**
1512
1504
  * Find a subscription by its last payment intent ID.
1513
1505
  * Returns null if no subscription matches.
@@ -1689,7 +1681,7 @@ declare module "alepha" {
1689
1681
  *
1690
1682
  * @module alepha.api.subscriptions
1691
1683
  */
1692
- declare const AlephaApiSubscriptions: _$alepha.Service<_$alepha.Module>;
1684
+ declare const AlephaApiSubscriptions: import("alepha").Service<import("alepha").Module>;
1693
1685
  //#endregion
1694
1686
  export { $requireLimit, $requirePlan, AdminSubscriptionController, AlephaApiSubscriptions, BillingService, CancelSubscription, ChangePlan, CreateSubscription, Entitlements, MrrData, PlanDefinition, PlanResource, SubscriptionConfig, SubscriptionController, SubscriptionEntity, SubscriptionEventEntity, SubscriptionEventResource, SubscriptionJobs, SubscriptionNotifications, SubscriptionQuery, SubscriptionResource, SubscriptionService, SubscriptionSettings, SubscriptionStats, UsageResult, UsageService, cancelSubscriptionSchema, changePlanSchema, createSubscriptionSchema, entitlementsSchema, mrrSchema, planDefinitionSchema, planResourceSchema, subscriptionEventResourceSchema, subscriptionEvents, subscriptionQuerySchema, subscriptionResourceSchema, subscriptionSettingsSchema, subscriptionStatsSchema, subscriptions };
1695
1687
  //# sourceMappingURL=index.d.ts.map