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,1121 +1,19 @@
1
- import * as _$alepha from "alepha";
2
- import { Alepha, Static, TSchema } from "alepha";
3
- import { AlephaCliUtils, AppEntry, AppEntryProvider, PackageManagerUtils, ViteBuildProvider } from "alepha/cli";
4
- import * as _$alepha_command0 from "alepha/command";
5
- import { Asker, EnvUtils, Runner, RunnerMethod } from "alepha/command";
6
- import * as _$alepha_logger0 from "alepha/logger";
1
+ import { AppEntry, AppEntryProvider, ViteBuildProvider } from "alepha/cli";
2
+ import { DetectedResources, GitHubSecretStore, NamingService, PlatformInspector, PlatformOptions, PlatformOrchestrator, ResolvedPlatformConfig, SecretFilterService, SecretStoreProvider } from "alepha/cli/platform-lib";
3
+ import { EnvUtils } from "alepha/command";
7
4
  import { ConsoleColorProvider } from "alepha/logger";
8
- import { FileSystemProvider, ShellProvider } from "alepha/system";
9
- import { DateTimeProvider } from "alepha/datetime";
10
- import * as _$typebox from "typebox";
11
5
 
12
- //#region ../../src/cli/platform/atoms/platformOptions.d.ts
13
- /**
14
- * Platform deployment configuration atom.
15
- *
16
- * Filled from the `platform` section of `alepha.config.ts`.
17
- * Read by `PlatformCommand` to resolve environments and adapters.
18
- */
19
- declare const platformOptions: _$alepha.Atom<_$typebox.TOptional<_$typebox.TObject<{
20
- /**
21
- * Project name override. Defaults to root package.json "name".
22
- */
23
- name: _$typebox.TOptional<_$typebox.TString>;
24
- /**
25
- * Default environment when --env is omitted.
26
- *
27
- * @default "production"
28
- */
29
- default: _$typebox.TOptional<_$typebox.TString>;
30
- /**
31
- * Secret store configuration for syncing .env secrets
32
- * to external providers (e.g. GitHub Actions environments).
33
- */
34
- secrets: _$typebox.TOptional<_$typebox.TObject<{
35
- /**
36
- * Secret store backend.
37
- */
38
- store: _$typebox.TUnsafe<"github">;
39
- /**
40
- * Pattern for resolving environment names in the store.
41
- * Placeholders: {project}, {env}.
42
- *
43
- * @default "{project}-{env}"
44
- */
45
- environmentPattern: _$typebox.TOptional<_$typebox.TString>;
46
- }>>;
47
- /**
48
- * Named environments with their adapter and configuration.
49
- */
50
- environments: _$typebox.TRecord<"^.*$", _$typebox.TObject<{
51
- adapter: _$typebox.TUnsafe<"cloudflare" | "vercel">;
52
- /**
53
- * Custom domain for the deployed worker (e.g. "api.example.com").
54
- *
55
- * On Cloudflare this is attached as a custom-domain route.
56
- * Omit to use the adapter's default `*.workers.dev` / preview URL.
57
- *
58
- * Wildcards are supported for multi-tenant SaaS apps:
59
- * `"*.club.alepha.dev"` routes every subdomain to the worker.
60
- * Wildcard patterns require `zone` to be set, and the wildcard DNS
61
- * record must already exist (proxied) in the Cloudflare zone.
62
- */
63
- domain: _$typebox.TOptional<_$typebox.TString>;
64
- /**
65
- * Cloudflare zone name (e.g. "alepha.dev") that owns `domain`.
66
- *
67
- * Required when `domain` contains a wildcard (`*`). Ignored for
68
- * plain custom domains, which Cloudflare resolves automatically.
69
- */
70
- zone: _$typebox.TOptional<_$typebox.TString>;
71
- /**
72
- * Cloudflare data jurisdiction for R2 buckets and D1 databases.
73
- * - "eu": data stays within the EU
74
- * - "fedramp": FedRAMP-authorized regions
75
- *
76
- * Omit for the default (global) jurisdiction.
77
- */
78
- jurisdiction: _$typebox.TOptional<_$typebox.TUnsafe<"eu" | "fedramp">>;
79
- /**
80
- * Cloudflare account ID to deploy into.
81
- *
82
- * Falls back to `CLOUDFLARE_ACCOUNT_ID` env var, then to the
83
- * token's account when the token is scoped to exactly one.
84
- * Required when the token has access to multiple accounts.
85
- */
86
- accountId: _$typebox.TOptional<_$typebox.TString>;
87
- }>>;
88
- }>>, "alepha.cli.platform.options">;
89
- /**
90
- * Type for platform options.
91
- */
92
- type PlatformOptions = Static<typeof platformOptions.schema>;
93
- /**
94
- * Configuration for a single named environment.
95
- */
96
- interface EnvironmentConfig {
97
- adapter: "cloudflare" | "vercel";
98
- domain?: string;
99
- zone?: string;
100
- vars?: Record<string, string>;
101
- jurisdiction?: "eu" | "fedramp";
102
- accountId?: string;
103
- }
104
- //#endregion
105
- //#region ../../src/cli/platform/providers/PlatformCacheProvider.d.ts
106
- interface PlatformCache {
107
- [adapter: string]: {
108
- lastLoginCheck: number;
109
- accountId?: string;
110
- };
111
- }
112
- /**
113
- * Caches cloud provider login state to avoid slow auth checks.
114
- *
115
- * Stored in node_modules/.alepha/platform.json (gitignored, project-scoped).
116
- * TTL: 4 hours.
117
- */
118
- declare class PlatformCacheProvider {
119
- protected static readonly TTL_MS: number;
120
- protected readonly fs: FileSystemProvider;
121
- protected readonly dateTime: DateTimeProvider;
122
- protected cachePath(root: string): string;
123
- isLoginFresh(root: string, adapter: string): Promise<boolean>;
124
- getAccountId(root: string, adapter: string): Promise<string | undefined>;
125
- recordLogin(root: string, adapter: string, accountId?: string): Promise<void>;
126
- protected readCache(root: string): Promise<PlatformCache>;
127
- protected writeCache(root: string, cache: PlatformCache): Promise<void>;
128
- }
129
- //#endregion
130
- //#region ../../src/cli/platform/schemas/cloudflare.d.ts
131
- declare const cloudflareAccountSchema: _$typebox.TObject<{
132
- id: _$typebox.TString;
133
- name: _$typebox.TString;
134
- }>;
135
- type CloudflareAccount = Static<typeof cloudflareAccountSchema>;
136
- declare const cloudflareD1Schema: _$typebox.TObject<{
137
- uuid: _$typebox.TString;
138
- name: _$typebox.TString;
139
- }>;
140
- type CloudflareD1 = Static<typeof cloudflareD1Schema>;
141
- declare const cloudflareKVSchema: _$typebox.TObject<{
142
- id: _$typebox.TString;
143
- title: _$typebox.TString;
144
- }>;
145
- type CloudflareKV = Static<typeof cloudflareKVSchema>;
146
- declare const cloudflareR2Schema: _$typebox.TObject<{
147
- name: _$typebox.TString;
148
- creation_date: _$typebox.TOptional<_$typebox.TString>;
149
- }>;
150
- type CloudflareR2 = Static<typeof cloudflareR2Schema>;
151
- declare const cloudflareR2ListSchema: _$typebox.TObject<{
152
- buckets: _$typebox.TArray<_$typebox.TObject<{
153
- name: _$typebox.TString;
154
- creation_date: _$typebox.TOptional<_$typebox.TString>;
155
- }>>;
156
- }>;
157
- declare const cloudflareQueueSchema: _$typebox.TObject<{
158
- queue_id: _$typebox.TString;
159
- queue_name: _$typebox.TString;
160
- }>;
161
- type CloudflareQueue = Static<typeof cloudflareQueueSchema>;
162
- declare const cloudflareQueueConsumerSchema: _$typebox.TObject<{
163
- consumer_id: _$typebox.TString;
164
- service: _$typebox.TString;
165
- environment: _$typebox.TOptional<_$typebox.TString>;
166
- }>;
167
- type CloudflareQueueConsumer = Static<typeof cloudflareQueueConsumerSchema>;
168
- declare const cloudflareHyperdriveOriginSchema: _$typebox.TObject<{
169
- host: _$typebox.TString;
170
- }>;
171
- declare const cloudflareHyperdriveSchema: _$typebox.TObject<{
172
- id: _$typebox.TString;
173
- name: _$typebox.TString;
174
- origin: _$typebox.TObject<{
175
- host: _$typebox.TString;
176
- }>;
177
- }>;
178
- type CloudflareHyperdrive = Static<typeof cloudflareHyperdriveSchema>;
179
- declare const cloudflareWorkerSchema: _$typebox.TObject<{
180
- id: _$typebox.TString;
181
- created_on: _$typebox.TString;
182
- modified_on: _$typebox.TString;
183
- }>;
184
- type CloudflareWorker = Static<typeof cloudflareWorkerSchema>;
185
- declare const cloudflareDeploymentVersionSchema: _$typebox.TObject<{
186
- version_id: _$typebox.TString;
187
- percentage: _$typebox.TNumber;
188
- }>;
189
- declare const cloudflareDeploymentSchema: _$typebox.TObject<{
190
- id: _$typebox.TString;
191
- versions: _$typebox.TArray<_$typebox.TObject<{
192
- version_id: _$typebox.TString;
193
- percentage: _$typebox.TNumber;
194
- }>>;
195
- created_on: _$typebox.TString;
196
- }>;
197
- type CloudflareDeployment = Static<typeof cloudflareDeploymentSchema>;
198
- declare const cloudflareDeploymentListSchema: _$typebox.TObject<{
199
- deployments: _$typebox.TArray<_$typebox.TObject<{
200
- id: _$typebox.TString;
201
- versions: _$typebox.TArray<_$typebox.TObject<{
202
- version_id: _$typebox.TString;
203
- percentage: _$typebox.TNumber;
204
- }>>;
205
- created_on: _$typebox.TString;
206
- }>>;
207
- }>;
208
- declare const cloudflareVersionSchema: _$typebox.TObject<{
209
- id: _$typebox.TString;
210
- metadata: _$typebox.TObject<{
211
- created_on: _$typebox.TString;
212
- }>;
213
- annotations: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TString>>;
214
- }>;
215
- type CloudflareVersion = Static<typeof cloudflareVersionSchema>;
216
- declare const cloudflareVersionListSchema: _$typebox.TObject<{
217
- items: _$typebox.TArray<_$typebox.TObject<{
218
- id: _$typebox.TString;
219
- metadata: _$typebox.TObject<{
220
- created_on: _$typebox.TString;
221
- }>;
222
- annotations: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TString>>;
223
- }>>;
224
- }>;
225
- declare const cloudflareSecretSchema: _$typebox.TObject<{
226
- name: _$typebox.TString;
227
- type: _$typebox.TString;
228
- }>;
229
- type CloudflareSecret = Static<typeof cloudflareSecretSchema>;
230
- declare const createD1BodySchema: _$typebox.TObject<{
231
- name: _$typebox.TString;
232
- primary_location_hint: _$typebox.TOptional<_$typebox.TString>;
233
- jurisdiction: _$typebox.TOptional<_$typebox.TString>;
234
- }>;
235
- declare const createKVBodySchema: _$typebox.TObject<{
236
- title: _$typebox.TString;
237
- }>;
238
- declare const createR2BodySchema: _$typebox.TObject<{
239
- name: _$typebox.TString;
240
- }>;
241
- declare const cloudflareR2TokenSchema: _$typebox.TObject<{
242
- id: _$typebox.TString;
243
- accessKeyId: _$typebox.TString;
244
- secretAccessKey: _$typebox.TString;
245
- }>;
246
- type CloudflareR2Token = Static<typeof cloudflareR2TokenSchema>;
247
- declare const createR2TokenBodySchema: _$typebox.TObject<{
248
- name: _$typebox.TString;
249
- policies: _$typebox.TArray<_$typebox.TObject<{
250
- effect: _$typebox.TString;
251
- permissions: _$typebox.TArray<_$typebox.TString>;
252
- buckets: _$typebox.TOptional<_$typebox.TArray<_$typebox.TString>>;
253
- }>>;
254
- }>;
255
- declare const createQueueBodySchema: _$typebox.TObject<{
256
- queue_name: _$typebox.TString;
257
- }>;
258
- declare const createHyperdriveOriginSchema: _$typebox.TObject<{
259
- scheme: _$typebox.TString;
260
- host: _$typebox.TString;
261
- port: _$typebox.TNumber;
262
- database: _$typebox.TString;
263
- user: _$typebox.TString;
264
- password: _$typebox.TString;
265
- }>;
266
- declare const createHyperdriveBodySchema: _$typebox.TObject<{
267
- name: _$typebox.TString;
268
- origin: _$typebox.TObject<{
269
- scheme: _$typebox.TString;
270
- host: _$typebox.TString;
271
- port: _$typebox.TNumber;
272
- database: _$typebox.TString;
273
- user: _$typebox.TString;
274
- password: _$typebox.TString;
275
- }>;
276
- }>;
277
- declare const putSecretBodySchema: _$typebox.TObject<{
278
- name: _$typebox.TString;
279
- text: _$typebox.TString;
280
- type: _$typebox.TString;
281
- }>;
282
- declare const cloudflareApiErrorSchema: _$typebox.TObject<{
283
- code: _$typebox.TNumber;
284
- message: _$typebox.TString;
285
- }>;
286
- type CloudflareApiError = Static<typeof cloudflareApiErrorSchema>;
287
- //#endregion
288
- //#region ../../src/cli/platform/services/WranglerApi.d.ts
289
- /**
290
- * Wraps wrangler CLI commands that are kept as shell-outs.
291
- *
292
- * Only used for operations where wrangler provides value
293
- * beyond a raw API call: OAuth login, worker deploy (bundling/upload),
294
- * D1 migrations, and secret bulk push.
295
- */
296
- declare class WranglerApi {
297
- protected readonly log: _$alepha_logger0.Logger;
298
- protected readonly shell: ShellProvider;
299
- protected readonly utils: AlephaCliUtils;
300
- protected readonly pm: PackageManagerUtils;
301
- protected readonly runner: Runner;
302
- protected runShell(command: string, options?: Parameters<ShellProvider["run"]>[1]): Promise<string>;
303
- /**
304
- * Ensure wrangler is installed in the project.
305
- */
306
- ensureInstalled(root: string, run: RunnerMethod): Promise<void>;
307
- /**
308
- * Check if the user is authenticated. Returns the whoami output.
309
- */
310
- whoami(): Promise<string>;
311
- /**
312
- * Open the browser-based OAuth login flow.
313
- */
314
- login(): Promise<void>;
315
- /**
316
- * Get the current auth token from wrangler (auto-refreshes if expired).
317
- */
318
- getAuthToken(): Promise<string>;
319
- /**
320
- * Deploy a worker via wrangler (handles bundling and upload).
321
- *
322
- * Returns the workers.dev URL if found in the output.
323
- */
324
- deploy(workerName: string, configPath: string): Promise<string | undefined>;
325
- /**
326
- * Apply D1 migrations remotely.
327
- */
328
- d1MigrationsApply(dbName: string, configPath: string): Promise<void>;
329
- }
330
- //#endregion
331
- //#region ../../src/cli/platform/services/CloudflareApi.d.ts
332
- /**
333
- * Thin wrapper over the Cloudflare REST API.
334
- *
335
- * Uses `wrangler auth token` to obtain credentials,
336
- * then calls `fetch()` directly for all CRUD operations.
337
- */
338
- declare class CloudflareApi {
339
- protected static readonly BASE = "https://api.cloudflare.com/client/v4";
340
- protected readonly log: _$alepha_logger0.Logger;
341
- protected readonly alepha: Alepha;
342
- protected readonly wrangler: WranglerApi;
343
- protected token?: string;
344
- protected accountId?: string;
345
- protected jurisdiction?: "eu" | "fedramp";
346
- /**
347
- * Set the Cloudflare data jurisdiction for R2 and D1 resources.
348
- *
349
- * R2 buckets and D1 databases created under a jurisdiction live in a
350
- * separate namespace — every R2 API call (list/create/delete) must include
351
- * the `cf-r2-jurisdiction` header, and D1 create must include the field
352
- * in the request body. Omit / pass `undefined` for the default (global).
353
- */
354
- setJurisdiction(jurisdiction?: "eu" | "fedramp"): void;
355
- /**
356
- * Override the Cloudflare account ID (from platform config).
357
- *
358
- * When unset, `resolveAccountId` falls back to `CLOUDFLARE_ACCOUNT_ID` env
359
- * var or the token's single account.
360
- */
361
- setAccountId(accountId?: string): void;
362
- /**
363
- * Obtain the current auth token from wrangler.
364
- */
365
- resolveToken(): Promise<string>;
366
- /**
367
- * Resolve the Cloudflare account ID.
368
- *
369
- * Calls /accounts and picks the first one. Cached after first call.
370
- */
371
- resolveAccountId(): Promise<string>;
372
- listD1(): Promise<CloudflareD1[]>;
373
- createD1(name: string, location?: string): Promise<CloudflareD1>;
374
- deleteD1(databaseId: string): Promise<void>;
375
- listKV(): Promise<CloudflareKV[]>;
376
- createKV(title: string): Promise<CloudflareKV>;
377
- deleteKV(namespaceId: string): Promise<void>;
378
- listR2(): Promise<CloudflareR2[]>;
379
- createR2(name: string): Promise<void>;
380
- deleteR2(name: string): Promise<void>;
381
- /**
382
- * Mint a bucket-scoped R2 API token (S3 access key + secret) using the
383
- * current bearer token. Used by teardown to wipe a bucket over the S3
384
- * protocol without requiring users to pre-create R2 access keys.
385
- *
386
- * The returned token should be revoked with `deleteR2Token` as soon as the
387
- * wipe is done.
388
- */
389
- createR2Token(name: string, bucket: string): Promise<CloudflareR2Token>;
390
- deleteR2Token(tokenId: string): Promise<void>;
391
- listQueues(): Promise<CloudflareQueue[]>;
392
- createQueue(name: string): Promise<CloudflareQueue>;
393
- deleteQueue(queueId: string): Promise<void>;
394
- listQueueConsumers(queueId: string): Promise<CloudflareQueueConsumer[]>;
395
- deleteQueueConsumer(queueId: string, consumerService: string): Promise<void>;
396
- listHyperdrive(): Promise<CloudflareHyperdrive[]>;
397
- createHyperdrive(name: string, connectionString: string): Promise<CloudflareHyperdrive>;
398
- deleteHyperdrive(configId: string): Promise<void>;
399
- getWorker(scriptName: string): Promise<CloudflareWorker | undefined>;
400
- deleteWorker(scriptName: string): Promise<void>;
401
- listDeployments(scriptName: string): Promise<CloudflareDeployment[]>;
402
- listVersions(scriptName: string): Promise<CloudflareVersion[]>;
403
- listSecrets(scriptName: string): Promise<CloudflareSecret[]>;
404
- putSecret(scriptName: string, name: string, value: string): Promise<void>;
405
- /**
406
- * Fetch the current worker bindings via the script-settings endpoint.
407
- * Used to merge new secrets into the existing binding set in one PATCH
408
- * (avoids the per-secret `putSecret` calls, each of which creates a
409
- * Cloudflare deployment — pushing 7 secrets meant 7 deployment rows).
410
- *
411
- * Secret bindings come back with `name` + `type` but no `text` (they're
412
- * write-only on Cloudflare's side); to preserve them across a PATCH we
413
- * forward each one as `{ type, name }` and Cloudflare keeps the stored
414
- * value.
415
- */
416
- getWorkerSettings(scriptName: string): Promise<{
417
- bindings: Array<{
418
- type: string;
419
- name: string;
420
- text?: string;
421
- }>;
422
- }>;
423
- /**
424
- * Replace the worker's binding set in one call (= one Cloudflare
425
- * deployment, regardless of how many secrets are being updated).
426
- *
427
- * The endpoint expects multipart FormData with a `settings` field whose
428
- * value is a JSON-encoded `{ bindings: [...] }` — the `fetch` helper
429
- * above is JSON-only, so this one bypasses it and calls `globalThis.fetch`
430
- * directly. Mirrors what `wrangler secret bulk` does internally.
431
- */
432
- patchWorkerBindings(scriptName: string, bindings: Array<{
433
- type: string;
434
- name: string;
435
- text?: string;
436
- }>): Promise<void>;
437
- protected fetch<T = unknown>(path: string, options?: {
438
- method?: string;
439
- body?: unknown;
440
- bodySchema?: TSchema;
441
- schema?: TSchema;
442
- query?: Record<string, string>;
443
- }): Promise<T>;
444
- /**
445
- * Paginate a page-based list endpoint (`result_info.total_pages`).
446
- *
447
- * Cloudflare defaults to `per_page=20`; we push it to 1000 (max on most
448
- * list endpoints) and loop if more pages exist. Each page is validated
449
- * against the item schema.
450
- */
451
- protected paginate<T>(path: string, itemSchema: TSchema, perPage?: number): Promise<T[]>;
452
- /**
453
- * Paginate a cursor-based list endpoint where `result` is an object
454
- * containing both the items array and a `cursor` field (R2 buckets,
455
- * Workers versions). Returns the flattened item array.
456
- */
457
- protected paginateCursor<T>(path: string, itemsKey: string, itemSchema: TSchema, perPage?: number): Promise<T[]>;
458
- /**
459
- * Parse a postgres:// connection string into Hyperdrive origin fields.
460
- */
461
- protected parseConnectionString(connectionString: string): {
462
- scheme: string;
463
- host: string;
464
- port: number;
465
- database: string;
466
- user: string;
467
- password: string;
468
- };
469
- }
470
- //#endregion
471
- //#region ../../src/cli/platform/services/NamingService.d.ts
472
- /**
473
- * Generates deterministic resource names for cloud deployments.
474
- *
475
- * Pattern: `<project>-<env>`.
476
- *
477
- * All segments are slugified (lowercase, alphanumeric + dashes, max 63
478
- * chars). One app per workspace — see `alepha platform`.
479
- */
480
- declare class NamingService {
481
- forContext(project: string, env: string): NamingContext;
482
- slugify(name: string): string;
483
- }
484
- declare class NamingContext {
485
- protected readonly prefix: string;
486
- constructor(prefix: string);
487
- worker(): string;
488
- d1(): string;
489
- hyperdrive(): string;
490
- r2(): string;
491
- kv(): string;
492
- queue(): string;
493
- }
494
- //#endregion
495
- //#region ../../src/cli/platform/adapters/PlatformAdapter.d.ts
496
- interface DetectedResources {
497
- hasDatabase: boolean;
498
- hasBucket: boolean;
499
- hasKV: boolean;
500
- hasQueue: boolean;
501
- hasCron: boolean;
502
- }
503
- interface AppDefinition {
504
- /**
505
- * Slugified app name (from package.json).
506
- */
507
- name: string;
508
- /**
509
- * Relative path from root (e.g., "apps/api").
510
- * Empty string for standalone apps.
511
- */
512
- path: string;
513
- /**
514
- * Resolved entry points for this app.
515
- */
516
- entry: AppEntry;
517
- /**
518
- * Cloud resources detected by introspecting the app.
519
- */
520
- resources: DetectedResources;
521
- }
522
- interface PlatformContext {
523
- /**
524
- * Slugified project name (from root package.json or config).
525
- */
526
- project: string;
527
- /**
528
- * Environment key (e.g., "production", "staging", "tmp-bug001").
529
- */
530
- env: string;
531
- /**
532
- * Environment configuration from alepha.config.ts.
533
- */
534
- envConfig: EnvironmentConfig;
535
- /**
536
- * All apps in the project.
537
- */
538
- apps: AppDefinition[];
539
- /**
540
- * Monorepo/project root path.
541
- */
542
- root: string;
543
- /**
544
- * Resource name generator bound to this project+env.
545
- */
546
- naming: NamingContext;
547
- /**
548
- * Pre-built mode. When true, the adapter's `build()` should skip the
549
- * Vite bundle steps and only regenerate the deploy config
550
- * (wrangler.jsonc, Dockerfile, etc.) so it reflects current bindings +
551
- * per-tenant overrides.
552
- */
553
- prebuilt?: boolean;
554
- }
555
- interface AppContext extends PlatformContext {
556
- /**
557
- * The specific app being operated on.
558
- */
559
- app: AppDefinition;
560
- }
561
- interface ResourceState {
562
- name: string;
563
- exists: boolean;
564
- id?: string;
565
- detail?: string;
566
- }
567
- interface WorkerState extends ResourceState {
568
- version?: string;
569
- tag?: string;
570
- createdAt?: string;
571
- }
572
- interface SecretState {
573
- name: string;
574
- deployed: boolean;
575
- }
576
- interface PlatformState {
577
- workers: WorkerState[];
578
- databases: ResourceState[];
579
- buckets: ResourceState[];
580
- kvNamespaces: ResourceState[];
581
- queues: ResourceState[];
582
- secrets: SecretState[];
583
- }
584
- /**
585
- * Abstract platform adapter.
586
- *
587
- * Each cloud provider (Cloudflare, AKS, docker-compose) implements this.
588
- * The PlatformOrchestrator calls these methods in the correct order.
589
- */
590
- declare abstract class PlatformAdapter {
591
- /**
592
- * Ensure the user is authenticated with the cloud provider.
593
- * May use cached credentials to avoid slow checks.
594
- */
595
- abstract authenticate(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
596
- /**
597
- * Build artifacts for a single app.
598
- */
599
- abstract build(ctx: AppContext, run: RunnerMethod): Promise<void>;
600
- /**
601
- * Deploy a single app (upload + activate atomically, e.g., wrangler deploy).
602
- * Returns the live URL if the platform provides one.
603
- */
604
- abstract deploy(ctx: AppContext, run: RunnerMethod): Promise<string | undefined>;
605
- /**
606
- * Create/ensure cloud resources exist (DB, buckets, queues).
607
- * Not all adapters provision -- AKS defers to Helm.
608
- */
609
- provision(_ctx: PlatformContext, _run: RunnerMethod): Promise<void>;
610
- /**
611
- * Run database migrations.
612
- */
613
- migrate(_ctx: PlatformContext, _run: RunnerMethod): Promise<void>;
614
- /**
615
- * Push runtime secrets to the deployed worker(s).
616
- *
617
- * Reads secrets from `.env.{env}` files (parsed, not from process.env),
618
- * filters out vars already handled by bindings (DATABASE_URL, R2, etc.),
619
- * and pushes the rest via the platform's secret management.
620
- */
621
- secrets(_ctx: PlatformContext, _run: RunnerMethod): Promise<void>;
622
- /**
623
- * Detect existing resources and their state.
624
- * Used by `plan` and `status` commands.
625
- */
626
- abstract inspect(ctx: PlatformContext, run: RunnerMethod): Promise<PlatformState>;
627
- /**
628
- * Tear down all resources for an environment.
629
- */
630
- abstract teardown(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
631
- }
632
- //#endregion
633
- //#region ../../src/cli/platform/adapters/CloudflareAdapter.d.ts
634
- /**
635
- * Cloudflare Workers adapter.
636
- *
637
- * Uses the Cloudflare REST API (via CloudflareApi) for resource provisioning
638
- * and teardown, and wrangler CLI (via WranglerApi) for login, deploy,
639
- * D1 migrations, and secret bulk push.
640
- */
641
- declare class CloudflareAdapter extends PlatformAdapter {
642
- protected readonly log: _$alepha_logger0.Logger;
643
- protected readonly fs: FileSystemProvider;
644
- protected readonly shell: ShellProvider;
645
- protected readonly cache: PlatformCacheProvider;
646
- protected readonly alepha: Alepha;
647
- protected readonly envUtils: EnvUtils;
648
- protected readonly api: CloudflareApi;
649
- protected readonly wrangler: WranglerApi;
650
- protected readonly runner: Runner;
651
- protected provisionedD1Id?: string;
652
- protected provisionedHyperdriveId?: string;
653
- protected provisionedKVIds: Map<string, string>;
654
- /**
655
- * Check if the user's DATABASE_URL points to an external Postgres database.
656
- * If so, we use Hyperdrive instead of D1.
657
- *
658
- * Reads from `.env.{env}` first, falls back to `process.env`.
659
- */
660
- protected isPostgres(ctx: PlatformContext): Promise<boolean>;
661
- /**
662
- * Propagate the environment's data-jurisdiction setting to the API client.
663
- *
664
- * Must be invoked at the top of every entry point (authenticate, build,
665
- * deploy, secrets, provision, migrate, inspect, teardown) because
666
- * CloudflareApi is a singleton reused across env invocations.
667
- */
668
- protected configureApi(ctx: PlatformContext): void;
669
- protected runShell(command: string, options?: Parameters<ShellProvider["run"]>[1]): Promise<string>;
670
- authenticate(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
671
- build(ctx: AppContext, run: RunnerMethod): Promise<void>;
672
- deploy(ctx: AppContext, run: RunnerMethod): Promise<string | undefined>;
673
- /**
674
- * Vars that are handled by wrangler bindings or build config.
675
- * These should not be pushed as secrets.
676
- */
677
- static readonly EXCLUDED_SECRET_KEYS: Set<string>;
678
- secrets(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
679
- /**
680
- * Plain-text binding used to fingerprint the deployed secret set so the
681
- * next `up` can skip the PATCH when nothing has changed.
682
- */
683
- static readonly SECRETS_HASH_BINDING = "ALEPHA_SECRETS_HASH";
684
- provision(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
685
- migrate(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
686
- protected migrateD1(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
687
- protected migratePostgres(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
688
- inspect(ctx: PlatformContext, run: RunnerMethod): Promise<PlatformState>;
689
- teardown(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
690
- protected ensureD1(name: string): Promise<string>;
691
- protected ensureHyperdrive(name: string, connectionString: string): Promise<string>;
692
- protected ensureR2(name: string): Promise<void>;
693
- /**
694
- * Empty an R2 bucket via the S3-compatible API.
695
- *
696
- * Cloudflare's REST `DELETE /r2/buckets/:name` rejects non-empty buckets
697
- * with `BucketNotEmpty`, and the REST API has no object-level endpoints —
698
- * objects must be listed and deleted over the S3 protocol. To avoid
699
- * making users pre-create R2 access keys, we mint a short-lived
700
- * bucket-scoped API token using the wrangler bearer token, wipe the
701
- * bucket with `s3mini`, then revoke the token.
702
- *
703
- * Also aborts any pending multipart uploads — those count as bucket
704
- * contents from R2's perspective and would otherwise block the delete.
705
- */
706
- protected wipeR2Bucket(bucketName: string, ctx: PlatformContext): Promise<void>;
707
- protected ensureKV(name: string): Promise<string>;
708
- protected ensureQueue(name: string): Promise<void>;
709
- /**
710
- * Get the currently active deployment for a worker.
711
- */
712
- protected getActiveDeployment(workerName: string): Promise<{
713
- versionId: string;
714
- tag?: string;
715
- createdAt?: string;
716
- } | undefined>;
717
- }
718
- //#endregion
719
- //#region ../../src/cli/platform/schemas/vercel.d.ts
720
- declare const vercelProjectSchema: _$typebox.TObject<{
721
- id: _$typebox.TString;
722
- name: _$typebox.TString;
723
- accountId: _$typebox.TString;
724
- }>;
725
- type VercelProject = Static<typeof vercelProjectSchema>;
726
- declare const createProjectBodySchema: _$typebox.TObject<{
727
- name: _$typebox.TString;
728
- framework: _$typebox.TOptional<_$typebox.TNull>;
729
- }>;
730
- declare const vercelDeploymentSchema: _$typebox.TObject<{
731
- uid: _$typebox.TString;
732
- name: _$typebox.TString;
733
- url: _$typebox.TString;
734
- state: _$typebox.TOptional<_$typebox.TString>;
735
- readyState: _$typebox.TOptional<_$typebox.TString>;
736
- created: _$typebox.TOptional<_$typebox.TNumber>;
737
- target: _$typebox.TOptional<_$typebox.TString>;
738
- alias: _$typebox.TOptional<_$typebox.TArray<_$typebox.TString>>;
739
- }>;
740
- type VercelDeployment = Static<typeof vercelDeploymentSchema>;
741
- declare const vercelEnvVarSchema: _$typebox.TObject<{
742
- id: _$typebox.TString;
743
- key: _$typebox.TString;
744
- value: _$typebox.TOptional<_$typebox.TString>;
745
- type: _$typebox.TString;
746
- target: _$typebox.TArray<_$typebox.TString>;
747
- }>;
748
- type VercelEnvVar = Static<typeof vercelEnvVarSchema>;
749
- declare const createEnvVarBodySchema: _$typebox.TObject<{
750
- key: _$typebox.TString;
751
- value: _$typebox.TString;
752
- type: _$typebox.TString;
753
- target: _$typebox.TArray<_$typebox.TString>;
754
- }>;
755
- //#endregion
756
- //#region ../../src/cli/platform/services/VercelCli.d.ts
757
- /**
758
- * Wraps Vercel CLI commands and token management.
759
- *
760
- * Used for operations where the Vercel CLI provides value:
761
- * OAuth login, prebuilt deploy, and auth token extraction.
762
- */
763
- declare class VercelCli {
764
- protected readonly log: _$alepha_logger0.Logger;
765
- protected readonly shell: ShellProvider;
766
- protected readonly fs: FileSystemProvider;
767
- protected readonly utils: AlephaCliUtils;
768
- protected readonly pm: PackageManagerUtils;
769
- protected readonly runner: Runner;
770
- protected runShell(command: string, options?: Parameters<ShellProvider["run"]>[1]): Promise<string>;
771
- /**
772
- * Ensure vercel CLI is installed in the project.
773
- */
774
- ensureInstalled(root: string, run: RunnerMethod): Promise<void>;
775
- /**
776
- * Get the Vercel auth token.
777
- *
778
- * Priority:
779
- * 1. VERCEL_TOKEN environment variable (CI/CD)
780
- * 2. Vercel CLI auth.json file (local dev)
781
- */
782
- getAuthToken(): Promise<string>;
783
- /**
784
- * Validate the current auth token.
785
- */
786
- whoami(): Promise<string>;
787
- /**
788
- * Open the browser-based login flow.
789
- */
790
- login(): Promise<void>;
791
- /**
792
- * Deploy a prebuilt .vercel/output/ directory.
793
- *
794
- * Returns the deployment URL.
795
- */
796
- deploy(distDir: string, options: {
797
- prod?: boolean;
798
- token?: string;
799
- }): Promise<string | undefined>;
800
- /**
801
- * Resolve the path to Vercel CLI auth.json.
802
- */
803
- protected getAuthFilePath(): string;
804
- }
805
- //#endregion
806
- //#region ../../src/cli/platform/services/VercelApi.d.ts
807
- /**
808
- * Thin wrapper over the Vercel REST API.
809
- *
810
- * Uses the auth token from VercelCli for all requests.
811
- */
812
- declare class VercelApi {
813
- protected static readonly BASE = "https://api.vercel.com";
814
- protected readonly log: _$alepha_logger0.Logger;
815
- protected readonly alepha: Alepha;
816
- protected readonly vercelCli: VercelCli;
817
- protected token?: string;
818
- /**
819
- * Obtain the current auth token from the Vercel CLI.
820
- */
821
- resolveToken(): Promise<string>;
822
- listProjects(): Promise<VercelProject[]>;
823
- getProject(nameOrId: string): Promise<VercelProject | undefined>;
824
- createProject(name: string): Promise<VercelProject>;
825
- updateProject(nameOrId: string, settings: {
826
- framework?: null;
827
- }): Promise<void>;
828
- deleteProject(nameOrId: string): Promise<void>;
829
- listDeployments(projectId: string, options?: {
830
- limit?: number;
831
- target?: string;
832
- }): Promise<VercelDeployment[]>;
833
- listEnvVars(projectId: string): Promise<VercelEnvVar[]>;
834
- upsertEnvVars(projectId: string, vars: Array<{
835
- key: string;
836
- value: string;
837
- target: string[];
838
- }>): Promise<void>;
839
- deleteEnvVar(projectId: string, envVarId: string): Promise<void>;
840
- protected fetch<T = unknown>(path: string, options?: {
841
- method?: string;
842
- body?: unknown;
843
- bodySchema?: TSchema;
844
- schema?: TSchema;
845
- query?: Record<string, string>;
846
- }): Promise<T>;
847
- }
848
- //#endregion
849
- //#region ../../src/cli/platform/adapters/VercelAdapter.d.ts
850
- /**
851
- * Vercel platform adapter.
852
- *
853
- * Uses the Vercel CLI for login and deploy (--prebuilt),
854
- * and the Vercel REST API for project management, env vars, and inspection.
855
- *
856
- * v1 scope: deploy pipeline only. No DB/storage/KV provisioning.
857
- */
858
- declare class VercelAdapter extends PlatformAdapter {
859
- protected readonly log: _$alepha_logger0.Logger;
860
- protected readonly fs: FileSystemProvider;
861
- protected readonly shell: ShellProvider;
862
- protected readonly utils: AlephaCliUtils;
863
- protected readonly cache: PlatformCacheProvider;
864
- protected readonly alepha: Alepha;
865
- protected readonly envUtils: EnvUtils;
866
- protected readonly api: VercelApi;
867
- protected readonly vercelCli: VercelCli;
868
- protected readonly runner: Runner;
869
- /**
870
- * Vars that should not be pushed as env vars.
871
- * These are either handled by the build or are internal.
872
- */
873
- static readonly EXCLUDED_SECRET_KEYS: Set<string>;
874
- protected runShell(command: string, options?: Parameters<ShellProvider["run"]>[1]): Promise<string>;
875
- authenticate(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
876
- build(ctx: AppContext, run: RunnerMethod): Promise<void>;
877
- deploy(ctx: AppContext, run: RunnerMethod): Promise<string | undefined>;
878
- secrets(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
879
- inspect(ctx: PlatformContext, run: RunnerMethod): Promise<PlatformState>;
880
- teardown(ctx: PlatformContext, run: RunnerMethod): Promise<void>;
881
- }
882
- //#endregion
883
- //#region ../../src/cli/platform/services/PlatformInspector.d.ts
884
- interface ResolvedPlatformConfig {
885
- project: string;
886
- defaultEnv: string;
887
- environments: Record<string, EnvironmentConfig>;
888
- }
889
- /**
890
- * Reads platform config and resolves project topology.
891
- *
892
- * Validates project name and environment configuration. Does NOT
893
- * introspect app code for resources — that happens at deploy time via
894
- * ViteBuildProvider.
895
- *
896
- * Each app self-declares its platform topology via its own
897
- * `alepha.config.ts`. Run `alepha platform <op>` from the app's
898
- * directory; no monorepo-root orchestration here.
899
- */
900
- declare class PlatformInspector {
901
- protected readonly log: _$alepha_logger0.Logger;
902
- protected readonly alepha: Alepha;
903
- protected readonly fs: FileSystemProvider;
904
- protected readonly asker: Asker;
905
- protected readonly options: Readonly<{
906
- name?: string | undefined;
907
- default?: string | undefined;
908
- secrets?: {
909
- environmentPattern?: string | undefined;
910
- store: "github";
911
- } | undefined;
912
- environments: Record<string, {
913
- domain?: string | undefined;
914
- zone?: string | undefined;
915
- jurisdiction?: "eu" | "fedramp" | undefined;
916
- accountId?: string | undefined;
917
- adapter: "cloudflare" | "vercel";
918
- }>;
919
- }>;
920
- protected readonly naming: NamingService;
921
- /**
922
- * Resolve and validate the full platform configuration.
923
- */
924
- resolveConfig(root: string): Promise<ResolvedPlatformConfig>;
925
- /**
926
- * Resolve a specific environment, validating it exists.
927
- */
928
- resolveEnvironment(root: string, envName: string): Promise<EnvironmentConfig>;
929
- protected resolveProjectName(root: string, configName?: string): Promise<string>;
930
- }
931
- //#endregion
932
- //#region ../../src/cli/platform/services/PlatformOrchestrator.d.ts
933
- /**
934
- * Orchestrates platform lifecycle operations.
935
- *
936
- * Coordinates adapter calls in the correct order for
937
- * up (build -> migrate -> deploy), down, plan, and status.
938
- */
939
- declare class PlatformOrchestrator {
940
- protected readonly log: _$alepha_logger0.Logger;
941
- protected readonly color: ConsoleColorProvider;
942
- protected readonly inspector: PlatformInspector;
943
- protected readonly naming: NamingService;
944
- protected readonly cloudflareAdapter: CloudflareAdapter;
945
- protected readonly vercelAdapter: VercelAdapter;
946
- protected readonly alepha: Alepha;
947
- resolveAdapter(adapterName: string): PlatformAdapter;
948
- up(options: {
949
- root: string;
950
- env: string;
951
- apps: AppDefinition[];
952
- run: RunnerMethod;
953
- /**
954
- * Pre-built mode — the artifact's `dist/` is already produced.
955
- *
956
- * Still runs auth → provision → build → migrate → deploy → secrets,
957
- * but the `build` step shells out to `alepha build --prebuilt` which
958
- * only regenerates the target-specific deploy config (e.g.
959
- * `wrangler.jsonc`) and skips the Vite client + server builds.
960
- * Used by external orchestrators (Rocket) that ship a pre-built
961
- * `dist/` and just need the wrangler config refreshed for
962
- * per-tenant overrides on every deploy.
963
- */
964
- prebuilt?: boolean;
965
- }): Promise<{
966
- urls: string[];
967
- domain?: string;
968
- }>;
969
- /**
970
- * Pretty-print the `up()` result to stdout. Matches the formatting the
971
- * orchestrator used to emit inline; split out so callers that want
972
- * JSON output can skip this branch.
973
- */
974
- printUpSummary(result: {
975
- urls: string[];
976
- domain?: string;
977
- }): void;
978
- down(options: {
979
- root: string;
980
- env: string;
981
- apps: AppDefinition[];
982
- run: RunnerMethod;
983
- confirm: (prompt: string) => Promise<string>;
984
- }): Promise<boolean>;
985
- plan(options: {
986
- root: string;
987
- env: string;
988
- apps: AppDefinition[];
989
- }): Promise<{
990
- config: ResolvedPlatformConfig;
991
- naming: NamingContext;
992
- apps: AppDefinition[];
993
- }>;
994
- status(options: {
995
- root: string;
996
- env: string;
997
- apps: AppDefinition[];
998
- run: RunnerMethod;
999
- }): Promise<{
1000
- config: ResolvedPlatformConfig;
1001
- state: PlatformState;
1002
- }>;
1003
- isTmpEnv(env: string): boolean;
1004
- }
1005
- //#endregion
1006
- //#region ../../src/cli/platform/providers/SecretStoreProvider.d.ts
1007
- /**
1008
- * A secret stored in a remote secret store.
1009
- */
1010
- interface RemoteSecret {
1011
- name: string;
1012
- updatedAt?: string;
1013
- }
1014
- /**
1015
- * Abstract provider for managing secrets in an external store.
1016
- *
1017
- * Implementations: GitHubSecretStore, MemorySecretStore
1018
- */
1019
- declare abstract class SecretStoreProvider {
1020
- /**
1021
- * Verify the backing store is reachable and authenticated.
1022
- */
1023
- abstract ensureAvailable(): Promise<void>;
1024
- /**
1025
- * Ensure the target environment exists in the store, creating it if needed.
1026
- */
1027
- abstract ensureEnvironment(environment: string): Promise<void>;
1028
- /**
1029
- * List all secrets in a given environment.
1030
- */
1031
- abstract list(environment: string): Promise<RemoteSecret[]>;
1032
- /**
1033
- * Set (create or update) a secret in a given environment.
1034
- */
1035
- abstract set(environment: string, key: string, value: string): Promise<void>;
1036
- /**
1037
- * Delete a secret from a given environment.
1038
- */
1039
- abstract delete(environment: string, key: string): Promise<void>;
1040
- }
1041
- //#endregion
1042
- //#region ../../src/cli/platform/providers/GitHubSecretStore.d.ts
1043
- /**
1044
- * GitHub Actions secret store backed by the `gh` CLI.
1045
- *
1046
- * Requires the GitHub CLI (`gh`) to be installed and authenticated.
1047
- * Pushes secrets into GitHub Actions environments.
1048
- */
1049
- declare class GitHubSecretStore implements SecretStoreProvider {
1050
- protected readonly log: _$alepha_logger0.Logger;
1051
- protected readonly shell: ShellProvider;
1052
- protected readonly fs: FileSystemProvider;
1053
- /**
1054
- * Verify that `gh` is installed and authenticated.
1055
- */
1056
- ensureAvailable(): Promise<void>;
1057
- /**
1058
- * Create the GitHub Actions environment if it doesn't exist.
1059
- */
1060
- ensureEnvironment(environment: string): Promise<void>;
1061
- /**
1062
- * List all secrets in a GitHub Actions environment.
1063
- */
1064
- list(environment: string): Promise<RemoteSecret[]>;
1065
- /**
1066
- * Set a secret in a GitHub Actions environment.
1067
- *
1068
- * Writes a dotenv-formatted file and uses `gh secret set --env-file` to
1069
- * avoid shell pipe issues with NodeShellProvider escaping the `|` character.
1070
- */
1071
- set(environment: string, key: string, value: string): Promise<void>;
1072
- /**
1073
- * Delete a secret from a GitHub Actions environment.
1074
- */
1075
- delete(environment: string, key: string): Promise<void>;
1076
- }
1077
- //#endregion
1078
- //#region ../../src/cli/platform/services/SecretFilterService.d.ts
1079
- /**
1080
- * Filters environment variables for secret store syncing.
1081
- *
1082
- * Excludes platform-managed vars (NODE_ENV), build-time vars (VITE_*),
1083
- * and empty values. Keeps everything else — including DATABASE_URL
1084
- * and POSTGRES_SCHEMA which GitHub Actions needs.
1085
- *
1086
- * Also handles renaming GITHUB_* keys since GitHub Actions rejects
1087
- * secret names starting with GITHUB_.
1088
- */
1089
- declare class SecretFilterService {
1090
- protected static readonly EXCLUDED_KEYS: Set<string>;
1091
- protected static readonly GITHUB_PREFIX = "GITHUB_";
1092
- protected static readonly REMOTE_PREFIX = "APP_GITHUB_";
1093
- /**
1094
- * Return only the entries that should be pushed to a secret store.
1095
- */
1096
- filter(envVars: Record<string, string>): Record<string, string>;
1097
- /**
1098
- * Convert a local env key to a remote secret name.
1099
- *
1100
- * GITHUB_* keys are prefixed with APP_ since GitHub Actions rejects
1101
- * secret names starting with GITHUB_.
1102
- */
1103
- toRemoteName(key: string): string;
1104
- /**
1105
- * Convert a remote secret name back to the local env key.
1106
- */
1107
- toLocalName(remoteName: string): string;
1108
- }
1109
- //#endregion
1110
6
  //#region ../../src/cli/platform/commands/SecretsCommand.d.ts
1111
7
  declare class SecretsCommand {
1112
- protected readonly log: _$alepha_logger0.Logger;
8
+ protected readonly log: import("alepha/logger").Logger;
1113
9
  protected readonly options: Readonly<{
1114
10
  name?: string | undefined;
1115
11
  default?: string | undefined;
12
+ tenancy?: "required" | "none" | "optional" | undefined;
1116
13
  secrets?: {
14
+ keys?: string[] | undefined;
15
+ store?: "github" | undefined;
1117
16
  environmentPattern?: string | undefined;
1118
- store: "github";
1119
17
  } | undefined;
1120
18
  environments: Record<string, {
1121
19
  domain?: string | undefined;
@@ -1131,34 +29,36 @@ declare class SecretsCommand {
1131
29
  protected readonly githubStore: GitHubSecretStore;
1132
30
  protected readonly filter: SecretFilterService;
1133
31
  protected readonly color: ConsoleColorProvider;
1134
- protected readonly envFlags: _$typebox.TObject<{
1135
- env: _$typebox.TOptional<_$typebox.TString>;
32
+ protected readonly envFlags: import("typebox").TObject<{
33
+ env: import("typebox").TOptional<import("typebox").TString>;
1136
34
  }>;
1137
- protected readonly list: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1138
- env: _$typebox.TOptional<_$typebox.TString>;
1139
- format: _$typebox.TOptional<_$typebox.TString>;
1140
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1141
- protected readonly diff: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1142
- env: _$typebox.TOptional<_$typebox.TString>;
1143
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1144
- protected readonly apply: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1145
- env: _$typebox.TOptional<_$typebox.TString>;
1146
- "dry-run": _$typebox.TOptional<_$typebox.TBoolean>;
1147
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1148
- readonly secrets: _$alepha_command0.CommandPrimitive<_$typebox.TObject<_$typebox.TProperties>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
35
+ protected readonly list: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
36
+ env: import("typebox").TOptional<import("typebox").TString>;
37
+ format: import("typebox").TOptional<import("typebox").TString>;
38
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
39
+ protected readonly diff: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
40
+ env: import("typebox").TOptional<import("typebox").TString>;
41
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
42
+ protected readonly apply: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
43
+ env: import("typebox").TOptional<import("typebox").TString>;
44
+ "dry-run": import("typebox").TOptional<import("typebox").TBoolean>;
45
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
46
+ readonly secrets: import("alepha/command").CommandPrimitive<import("typebox").TObject<import("typebox").TProperties>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
1149
47
  resolveStore(): SecretStoreProvider;
1150
48
  protected resolveEnvironmentName(project: string, env: string): string;
1151
49
  }
1152
50
  //#endregion
1153
51
  //#region ../../src/cli/platform/commands/platform.d.ts
1154
52
  declare class PlatformCommand {
1155
- protected readonly log: _$alepha_logger0.Logger;
53
+ protected readonly log: import("alepha/logger").Logger;
1156
54
  protected readonly options: Readonly<{
1157
55
  name?: string | undefined;
1158
56
  default?: string | undefined;
57
+ tenancy?: "required" | "none" | "optional" | undefined;
1159
58
  secrets?: {
59
+ keys?: string[] | undefined;
60
+ store?: "github" | undefined;
1160
61
  environmentPattern?: string | undefined;
1161
- store: "github";
1162
62
  } | undefined;
1163
63
  environments: Record<string, {
1164
64
  domain?: string | undefined;
@@ -1179,49 +79,71 @@ declare class PlatformCommand {
1179
79
  /**
1180
80
  * Common flags for env targeting.
1181
81
  */
1182
- protected readonly envFlags: _$typebox.TObject<{
1183
- env: _$typebox.TOptional<_$typebox.TString>;
1184
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1185
- json: _$typebox.TOptional<_$typebox.TBoolean>;
82
+ protected readonly envFlags: import("typebox").TObject<{
83
+ env: import("typebox").TOptional<import("typebox").TString>;
84
+ tenant: import("typebox").TOptional<import("typebox").TString>;
85
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
86
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
1186
87
  }>;
1187
- protected readonly plan: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1188
- env: _$typebox.TOptional<_$typebox.TString>;
1189
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1190
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1191
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1192
- protected readonly up: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1193
- prebuilt: _$typebox.TOptional<_$typebox.TBoolean>;
1194
- env: _$typebox.TOptional<_$typebox.TString>;
1195
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1196
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1197
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1198
- protected readonly down: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1199
- yes: _$typebox.TOptional<_$typebox.TBoolean>;
1200
- env: _$typebox.TOptional<_$typebox.TString>;
1201
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1202
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1203
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1204
- protected readonly status: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1205
- env: _$typebox.TOptional<_$typebox.TString>;
1206
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1207
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1208
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1209
- protected readonly build: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1210
- env: _$typebox.TOptional<_$typebox.TString>;
1211
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1212
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1213
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1214
- protected readonly deploy: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1215
- env: _$typebox.TOptional<_$typebox.TString>;
1216
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1217
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1218
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1219
- protected readonly migrate: _$alepha_command0.CommandPrimitive<_$typebox.TObject<{
1220
- env: _$typebox.TOptional<_$typebox.TString>;
1221
- verbose: _$typebox.TOptional<_$typebox.TBoolean>;
1222
- json: _$typebox.TOptional<_$typebox.TBoolean>;
1223
- }>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
1224
- readonly platform: _$alepha_command0.CommandPrimitive<_$typebox.TObject<_$typebox.TProperties>, _$typebox.TSchema, _$typebox.TObject<_$typebox.TProperties>>;
88
+ protected readonly plan: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
89
+ env: import("typebox").TOptional<import("typebox").TString>;
90
+ tenant: import("typebox").TOptional<import("typebox").TString>;
91
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
92
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
93
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
94
+ protected readonly up: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
95
+ prebuilt: import("typebox").TOptional<import("typebox").TBoolean>;
96
+ env: import("typebox").TOptional<import("typebox").TString>;
97
+ tenant: import("typebox").TOptional<import("typebox").TString>;
98
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
99
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
100
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
101
+ protected readonly down: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
102
+ yes: import("typebox").TOptional<import("typebox").TBoolean>;
103
+ env: import("typebox").TOptional<import("typebox").TString>;
104
+ tenant: import("typebox").TOptional<import("typebox").TString>;
105
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
106
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
107
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
108
+ protected readonly status: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
109
+ env: import("typebox").TOptional<import("typebox").TString>;
110
+ tenant: import("typebox").TOptional<import("typebox").TString>;
111
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
112
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
113
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
114
+ protected readonly build: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
115
+ env: import("typebox").TOptional<import("typebox").TString>;
116
+ tenant: import("typebox").TOptional<import("typebox").TString>;
117
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
118
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
119
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
120
+ protected readonly deploy: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
121
+ env: import("typebox").TOptional<import("typebox").TString>;
122
+ tenant: import("typebox").TOptional<import("typebox").TString>;
123
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
124
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
125
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
126
+ protected readonly migrate: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
127
+ env: import("typebox").TOptional<import("typebox").TString>;
128
+ tenant: import("typebox").TOptional<import("typebox").TString>;
129
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
130
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
131
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
132
+ protected readonly dbExport: import("alepha/command").CommandPrimitive<import("typebox").TObject<{
133
+ output: import("typebox").TOptional<import("typebox").TString>;
134
+ keepSql: import("typebox").TOptional<import("typebox").TBoolean>;
135
+ env: import("typebox").TOptional<import("typebox").TString>;
136
+ tenant: import("typebox").TOptional<import("typebox").TString>;
137
+ verbose: import("typebox").TOptional<import("typebox").TBoolean>;
138
+ json: import("typebox").TOptional<import("typebox").TBoolean>;
139
+ }>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
140
+ /**
141
+ * `db` subgroup — operations against the *deployed* database (export,
142
+ * migrate). They live under `platform` (not core `alepha db`) because
143
+ * they need the env config, tenancy, adapter, and resource naming.
144
+ */
145
+ protected readonly db: import("alepha/command").CommandPrimitive<import("typebox").TObject<import("typebox").TProperties>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
146
+ readonly platform: import("alepha/command").CommandPrimitive<import("typebox").TObject<import("typebox").TProperties>, import("typebox").TSchema, import("typebox").TObject<import("typebox").TProperties>>;
1225
147
  /**
1226
148
  * Resolve app definitions.
1227
149
  *
@@ -1232,186 +154,47 @@ declare class PlatformCommand {
1232
154
  * ViteBuildProvider.init() per app. This is expensive -- only done
1233
155
  * for up/down/status, not for plan.
1234
156
  */
1235
- protected resolveApps(root: string, config: ResolvedPlatformConfig, isServerless: boolean): Promise<AppDefinition[]>;
1236
- protected isServerless(adapter: string): boolean;
1237
- protected detectResources(alepha: any): DetectedResources;
1238
- }
1239
- //#endregion
1240
- //#region ../../src/cli/platform/providers/MemorySecretStore.d.ts
1241
- interface MemorySecretStoreCall {
1242
- method: "ensureAvailable" | "ensureEnvironment" | "list" | "set" | "delete";
1243
- environment?: string;
1244
- key?: string;
1245
- value?: string;
1246
- }
1247
- /**
1248
- * In-memory implementation of SecretStoreProvider for testing.
1249
- * Records all operations and stores secrets in a nested Map.
1250
- */
1251
- declare class MemorySecretStore implements SecretStoreProvider {
1252
- /**
1253
- * Secrets keyed by environment, then by key.
1254
- */
1255
- secrets: Map<string, Map<string, string>>;
1256
- /**
1257
- * All recorded operations.
1258
- */
1259
- calls: MemorySecretStoreCall[];
1260
- /**
1261
- * When set, ensureAvailable() will throw with this message.
1262
- */
1263
- availableError: string | null;
1264
- ensureAvailable(): Promise<void>;
1265
- ensureEnvironment(environment: string): Promise<void>;
1266
- list(environment: string): Promise<RemoteSecret[]>;
1267
- set(environment: string, key: string, value: string): Promise<void>;
1268
- delete(environment: string, key: string): Promise<void>;
1269
- /**
1270
- * Check if set() was called for a given environment and key.
1271
- */
1272
- wasSet(environment: string, key: string): boolean;
1273
- /**
1274
- * Check if delete() was called for a given environment and key.
1275
- */
1276
- wasDeleted(environment: string, key: string): boolean;
157
+ protected resolveApp(root: string, _config: ResolvedPlatformConfig, isServerless: boolean, options?: {
158
+ prebuilt?: boolean;
159
+ }): Promise<{
160
+ entry: AppEntry;
161
+ resources: DetectedResources;
162
+ }>;
1277
163
  /**
1278
- * Get all set() calls for a given environment.
164
+ * @deprecated single-app projects; use `resolveApp` directly.
165
+ * Kept temporarily so existing commands can be migrated one at a time.
1279
166
  */
1280
- getSetCalls(environment: string): Array<{
1281
- key: string;
1282
- value: string;
1283
- }>;
167
+ protected resolveApps(root: string, config: ResolvedPlatformConfig, isServerless: boolean, options?: {
168
+ prebuilt?: boolean;
169
+ }): Promise<Array<{
170
+ name: string;
171
+ path: string;
172
+ entry: AppEntry;
173
+ resources: DetectedResources;
174
+ }>>;
175
+ protected isServerless(adapter: string): boolean;
1284
176
  /**
1285
- * Reset all state.
177
+ * Read `dist/manifest.json` if present. Returns `null` when the file
178
+ * doesn't exist or isn't parseable — caller falls back to the
179
+ * Vite-introspection path.
1286
180
  */
1287
- reset(): void;
181
+ protected readManifest(root: string): Promise<{
182
+ version: number;
183
+ project: string;
184
+ resources: DetectedResources;
185
+ } | null>;
186
+ protected detectResources(alepha: any): DetectedResources;
1288
187
  }
1289
188
  //#endregion
1290
- //#region ../../src/cli/platform/schemas/platform.d.ts
1291
- declare const platformStatusWorkerSchema: _$typebox.TObject<{
1292
- name: _$typebox.TString;
1293
- exists: _$typebox.TBoolean;
1294
- id: _$typebox.TOptional<_$typebox.TString>;
1295
- detail: _$typebox.TOptional<_$typebox.TString>;
1296
- version: _$typebox.TOptional<_$typebox.TString>;
1297
- tag: _$typebox.TOptional<_$typebox.TString>;
1298
- createdAt: _$typebox.TOptional<_$typebox.TString>;
1299
- }>;
1300
- declare const platformStatusResourceSchema: _$typebox.TObject<{
1301
- name: _$typebox.TString;
1302
- exists: _$typebox.TBoolean;
1303
- id: _$typebox.TOptional<_$typebox.TString>;
1304
- detail: _$typebox.TOptional<_$typebox.TString>;
1305
- }>;
1306
- declare const platformStatusSecretSchema: _$typebox.TObject<{
1307
- name: _$typebox.TString;
1308
- deployed: _$typebox.TBoolean;
1309
- }>;
1310
- declare const platformStatusSchema: _$typebox.TObject<{
1311
- project: _$typebox.TString;
1312
- env: _$typebox.TString;
1313
- adapter: _$typebox.TString;
1314
- workers: _$typebox.TArray<_$typebox.TObject<{
1315
- name: _$typebox.TString;
1316
- exists: _$typebox.TBoolean;
1317
- id: _$typebox.TOptional<_$typebox.TString>;
1318
- detail: _$typebox.TOptional<_$typebox.TString>;
1319
- version: _$typebox.TOptional<_$typebox.TString>;
1320
- tag: _$typebox.TOptional<_$typebox.TString>;
1321
- createdAt: _$typebox.TOptional<_$typebox.TString>;
1322
- }>>;
1323
- databases: _$typebox.TArray<_$typebox.TObject<{
1324
- name: _$typebox.TString;
1325
- exists: _$typebox.TBoolean;
1326
- id: _$typebox.TOptional<_$typebox.TString>;
1327
- detail: _$typebox.TOptional<_$typebox.TString>;
1328
- }>>;
1329
- buckets: _$typebox.TArray<_$typebox.TObject<{
1330
- name: _$typebox.TString;
1331
- exists: _$typebox.TBoolean;
1332
- id: _$typebox.TOptional<_$typebox.TString>;
1333
- detail: _$typebox.TOptional<_$typebox.TString>;
1334
- }>>;
1335
- kvNamespaces: _$typebox.TArray<_$typebox.TObject<{
1336
- name: _$typebox.TString;
1337
- exists: _$typebox.TBoolean;
1338
- id: _$typebox.TOptional<_$typebox.TString>;
1339
- detail: _$typebox.TOptional<_$typebox.TString>;
1340
- }>>;
1341
- queues: _$typebox.TArray<_$typebox.TObject<{
1342
- name: _$typebox.TString;
1343
- exists: _$typebox.TBoolean;
1344
- id: _$typebox.TOptional<_$typebox.TString>;
1345
- detail: _$typebox.TOptional<_$typebox.TString>;
1346
- }>>;
1347
- secrets: _$typebox.TArray<_$typebox.TObject<{
1348
- name: _$typebox.TString;
1349
- deployed: _$typebox.TBoolean;
1350
- }>>;
1351
- }>;
1352
- type PlatformStatusOutput = Static<typeof platformStatusSchema>;
1353
- declare const platformPlanAppResourcesSchema: _$typebox.TObject<{
1354
- hasDatabase: _$typebox.TBoolean;
1355
- hasBucket: _$typebox.TBoolean;
1356
- hasKV: _$typebox.TBoolean;
1357
- hasQueue: _$typebox.TBoolean;
1358
- hasCron: _$typebox.TBoolean;
1359
- }>;
1360
- declare const platformPlanAppSchema: _$typebox.TObject<{
1361
- name: _$typebox.TString;
1362
- path: _$typebox.TString;
1363
- resources: _$typebox.TObject<{
1364
- hasDatabase: _$typebox.TBoolean;
1365
- hasBucket: _$typebox.TBoolean;
1366
- hasKV: _$typebox.TBoolean;
1367
- hasQueue: _$typebox.TBoolean;
1368
- hasCron: _$typebox.TBoolean;
1369
- }>;
1370
- }>;
1371
- declare const platformPlanEnvironmentSchema: _$typebox.TObject<{
1372
- adapter: _$typebox.TString;
1373
- domain: _$typebox.TOptional<_$typebox.TString>;
1374
- zone: _$typebox.TOptional<_$typebox.TString>;
1375
- }>;
1376
- declare const platformPlanResourceSchema: _$typebox.TObject<{
1377
- label: _$typebox.TString;
1378
- value: _$typebox.TString;
1379
- }>;
1380
- declare const platformPlanSchema: _$typebox.TObject<{
1381
- project: _$typebox.TString;
1382
- env: _$typebox.TString;
1383
- mode: _$typebox.TUnsafe<"monorepo" | "standalone">;
1384
- apps: _$typebox.TArray<_$typebox.TObject<{
1385
- name: _$typebox.TString;
1386
- path: _$typebox.TString;
1387
- resources: _$typebox.TObject<{
1388
- hasDatabase: _$typebox.TBoolean;
1389
- hasBucket: _$typebox.TBoolean;
1390
- hasKV: _$typebox.TBoolean;
1391
- hasQueue: _$typebox.TBoolean;
1392
- hasCron: _$typebox.TBoolean;
1393
- }>;
1394
- }>>;
1395
- environments: _$typebox.TRecord<"^.*$", _$typebox.TObject<{
1396
- adapter: _$typebox.TString;
1397
- domain: _$typebox.TOptional<_$typebox.TString>;
1398
- zone: _$typebox.TOptional<_$typebox.TString>;
1399
- }>>;
1400
- resources: _$typebox.TArray<_$typebox.TObject<{
1401
- label: _$typebox.TString;
1402
- value: _$typebox.TString;
1403
- }>>;
1404
- secretCount: _$typebox.TNumber;
1405
- }>;
1406
- type PlatformPlanOutput = Static<typeof platformPlanSchema>;
1407
- //#endregion
1408
189
  //#region ../../src/cli/platform/index.d.ts
1409
190
  /**
1410
191
  * CLI plugin for multi-cloud deployment orchestration.
1411
192
  *
1412
- * Manages the full lifecycle of deploying Alepha apps: provision
1413
- * resources, build, migrate databases, deploy, and sync secrets.
1414
- * Supports Cloudflare Workers and Vercel.
193
+ * Wraps `AlephaPlatformLibPlugin` (the framework-agnostic deploy
194
+ * services) with `$command` instances so the orchestration is
195
+ * reachable from `alepha platform …`. Non-CLI consumers (e.g. Alepha
196
+ * Rocket) should depend on `alepha/cli/platform-lib` directly instead
197
+ * of pulling in this command surface.
1415
198
  *
1416
199
  * Commands:
1417
200
  * - `alepha platform plan` — show project topology and resource names
@@ -1419,9 +202,10 @@ type PlatformPlanOutput = Static<typeof platformPlanSchema>;
1419
202
  * - `alepha platform down` — teardown an environment
1420
203
  * - `alepha platform status` — inspect deployed resources
1421
204
  * - `alepha platform build` — build apps locally
1422
- * - `alepha platform deploy` — deploy to cloud
1423
- * - `alepha platform migrate` — run database migrations
1424
- * - `alepha platform secrets` manage external secret stores
205
+ * - `alepha platform deploy` — deploy to cloud
206
+ * - `alepha platform db migrate` — run database migrations
207
+ * - `alepha platform db export` pull the deployed DB into a local snapshot
208
+ * - `alepha platform secrets` — manage external secret stores
1425
209
  *
1426
210
  * Configuration in `alepha.config.ts`:
1427
211
  *
@@ -1439,8 +223,8 @@ type PlatformPlanOutput = Static<typeof platformPlanSchema>;
1439
223
  * });
1440
224
  * ```
1441
225
  */
1442
- declare const AlephaCliPlatformPlugin: _$alepha.Service<_$alepha.Module>;
226
+ declare const AlephaCliPlatformPlugin: import("alepha").Service<import("alepha").Module>;
1443
227
  declare const platform: (options: PlatformOptions) => () => void;
1444
228
  //#endregion
1445
- export { AlephaCliPlatformPlugin, AppContext, AppDefinition, CloudflareAccount, CloudflareAdapter, CloudflareApi, CloudflareApiError, type CloudflareD1, type CloudflareDeployment, type CloudflareHyperdrive, type CloudflareKV, type CloudflareQueue, type CloudflareQueueConsumer, type CloudflareR2, type CloudflareR2Token, type CloudflareSecret, type CloudflareVersion, type CloudflareWorker, DetectedResources, EnvironmentConfig, GitHubSecretStore, MemorySecretStore, MemorySecretStoreCall, NamingContext, NamingService, PlatformAdapter, PlatformCacheProvider, PlatformCommand, PlatformContext, PlatformInspector, PlatformOptions, PlatformOrchestrator, PlatformPlanOutput, PlatformState, PlatformStatusOutput, RemoteSecret, ResolvedPlatformConfig, ResourceState, SecretFilterService, SecretState, SecretStoreProvider, SecretsCommand, VercelAdapter, VercelApi, VercelCli, VercelDeployment, VercelEnvVar, VercelProject, WorkerState, WranglerApi, cloudflareAccountSchema, cloudflareApiErrorSchema, cloudflareD1Schema, cloudflareDeploymentListSchema, cloudflareDeploymentSchema, cloudflareDeploymentVersionSchema, cloudflareHyperdriveOriginSchema, cloudflareHyperdriveSchema, cloudflareKVSchema, cloudflareQueueConsumerSchema, cloudflareQueueSchema, cloudflareR2ListSchema, cloudflareR2Schema, cloudflareR2TokenSchema, cloudflareSecretSchema, cloudflareVersionListSchema, cloudflareVersionSchema, cloudflareWorkerSchema, createD1BodySchema, createEnvVarBodySchema, createHyperdriveBodySchema, createHyperdriveOriginSchema, createKVBodySchema, createProjectBodySchema, createQueueBodySchema, createR2BodySchema, createR2TokenBodySchema, platform, platformOptions, platformPlanAppResourcesSchema, platformPlanAppSchema, platformPlanEnvironmentSchema, platformPlanResourceSchema, platformPlanSchema, platformStatusResourceSchema, platformStatusSchema, platformStatusSecretSchema, platformStatusWorkerSchema, putSecretBodySchema, vercelDeploymentSchema, vercelEnvVarSchema, vercelProjectSchema };
229
+ export { AlephaCliPlatformPlugin, PlatformCommand, SecretsCommand, platform };
1446
230
  //# sourceMappingURL=index.d.ts.map