@geekmidas/cli 10.0.0-alpha.183 → 10.0.0-alpha.185

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 (245) hide show
  1. package/dist/{LegacyStateStore-BFCqFyEq.cjs → LegacyStateStore-BtN83gfS.cjs} +2 -2
  2. package/dist/{LegacyStateStore-BFCqFyEq.cjs.map → LegacyStateStore-BtN83gfS.cjs.map} +1 -1
  3. package/dist/{LegacyStateStore-FOUMZXuF.mjs → LegacyStateStore-DKyEAWGI.mjs} +2 -2
  4. package/dist/{LegacyStateStore-FOUMZXuF.mjs.map → LegacyStateStore-DKyEAWGI.mjs.map} +1 -1
  5. package/dist/{LocalStateStore-B5DZh9J2.cjs → LocalStateStore-BFh6rPhX.cjs} +2 -2
  6. package/dist/{LocalStateStore-B5DZh9J2.cjs.map → LocalStateStore-BFh6rPhX.cjs.map} +1 -1
  7. package/dist/{LocalStateStore-B7qZNPNd.mjs → LocalStateStore-Dc3aGvQi.mjs} +2 -2
  8. package/dist/{LocalStateStore-B7qZNPNd.mjs.map → LocalStateStore-Dc3aGvQi.mjs.map} +1 -1
  9. package/dist/{S3StateStore-BSh1asHJ.cjs → S3StateStore-DZMpqbvD.cjs} +5 -5
  10. package/dist/{S3StateStore-BSh1asHJ.cjs.map → S3StateStore-DZMpqbvD.cjs.map} +1 -1
  11. package/dist/{S3StateStore-Dy9-O_Ix.mjs → S3StateStore-p6DyuAFZ.mjs} +4 -4
  12. package/dist/{S3StateStore-Dy9-O_Ix.mjs.map → S3StateStore-p6DyuAFZ.mjs.map} +1 -1
  13. package/dist/{SSMStateStore-DQw29x9F.mjs → SSMStateStore-BvH8XX4O.mjs} +2 -2
  14. package/dist/{SSMStateStore-DQw29x9F.mjs.map → SSMStateStore-BvH8XX4O.mjs.map} +1 -1
  15. package/dist/{SSMStateStore-Clw-dnjN.cjs → SSMStateStore-sbaLlCmj.cjs} +2 -2
  16. package/dist/{SSMStateStore-Clw-dnjN.cjs.map → SSMStateStore-sbaLlCmj.cjs.map} +1 -1
  17. package/dist/{add-BbAyKWsD.cjs → add-CdVGxiKW.cjs} +13 -14
  18. package/dist/{add-BbAyKWsD.cjs.map → add-CdVGxiKW.cjs.map} +1 -1
  19. package/dist/{add-BewI_NWg.mjs → add-dOvgsAU6.mjs} +4 -5
  20. package/dist/{add-BewI_NWg.mjs.map → add-dOvgsAU6.mjs.map} +1 -1
  21. package/dist/backups/runner.cjs +501 -13
  22. package/dist/backups/runner.cjs.map +1 -1
  23. package/dist/backups/runner.d.cts +87 -2
  24. package/dist/backups/runner.d.cts.map +1 -1
  25. package/dist/backups/runner.d.mts +87 -2
  26. package/dist/backups/runner.d.mts.map +1 -1
  27. package/dist/backups/runner.mjs +493 -15
  28. package/dist/backups/runner.mjs.map +1 -1
  29. package/dist/{bundler-CKKMaAnQ.cjs → bundler-B5ioF-1Q.cjs} +9 -9
  30. package/dist/{bundler-CKKMaAnQ.cjs.map → bundler-B5ioF-1Q.cjs.map} +1 -1
  31. package/dist/{bundler-FUhPSv3Y.mjs → bundler-Cvx6Bt3e.mjs} +6 -6
  32. package/dist/{bundler-FUhPSv3Y.mjs.map → bundler-Cvx6Bt3e.mjs.map} +1 -1
  33. package/dist/{cli-F4EvxZgK.mjs → cli-BjapgcXG.mjs} +4 -4
  34. package/dist/{cli-F4EvxZgK.mjs.map → cli-BjapgcXG.mjs.map} +1 -1
  35. package/dist/{cli-DBdR2Hqf.cjs → cli-PLhqvPOC.cjs} +6 -6
  36. package/dist/{cli-DBdR2Hqf.cjs.map → cli-PLhqvPOC.cjs.map} +1 -1
  37. package/dist/{clientTelemetry-BAwj6MOf.d.cts → clientTelemetry-Bzc4KXz5.d.mts} +2 -2
  38. package/dist/clientTelemetry-Bzc4KXz5.d.mts.map +1 -0
  39. package/dist/{clientTelemetry-CvamPJj_.d.mts → clientTelemetry-N8NAguGI.d.cts} +2 -2
  40. package/dist/clientTelemetry-N8NAguGI.d.cts.map +1 -0
  41. package/dist/{compose-BWqyiF3p.cjs → compose-BEVBxf4w.cjs} +87 -948
  42. package/dist/compose-BEVBxf4w.cjs.map +1 -0
  43. package/dist/{compose-FHcdMtju.mjs → compose-Dx_nSZYU.mjs} +23 -842
  44. package/dist/compose-Dx_nSZYU.mjs.map +1 -0
  45. package/dist/{config-C3U5HulX.d.cts → config-CTrfNKYd.d.mts} +3 -3
  46. package/dist/{config-BODxZemw.d.mts.map → config-CTrfNKYd.d.mts.map} +1 -1
  47. package/dist/{config-BODxZemw.d.mts → config-D9g_nYIu.d.cts} +3 -3
  48. package/dist/{config-C3U5HulX.d.cts.map → config-D9g_nYIu.d.cts.map} +1 -1
  49. package/dist/config.cjs +1 -1
  50. package/dist/config.d.cts +3 -3
  51. package/dist/config.d.mts +3 -3
  52. package/dist/config.mjs +1 -1
  53. package/dist/{compose-Dx1qWkqA.mjs → credentials-DW5MvS4A.mjs} +1148 -1261
  54. package/dist/credentials-DW5MvS4A.mjs.map +1 -0
  55. package/dist/{compose-uWAls-tD.cjs → credentials-Eyx2tM7B.cjs} +1175 -1288
  56. package/dist/credentials-Eyx2tM7B.cjs.map +1 -0
  57. package/dist/{dns-zWyF3BB0.cjs → credentials-n2abUWwJ.cjs} +6 -847
  58. package/dist/credentials-n2abUWwJ.cjs.map +1 -0
  59. package/dist/{dns-w28G3uDJ.mjs → credentials-ztezRtR4.mjs} +5 -708
  60. package/dist/credentials-ztezRtR4.mjs.map +1 -0
  61. package/dist/{dbTunnel-dzS96iTb.cjs → dbTunnel-DVohSZJQ.cjs} +8 -9
  62. package/dist/{dbTunnel-dzS96iTb.cjs.map → dbTunnel-DVohSZJQ.cjs.map} +1 -1
  63. package/dist/{dbTunnel-DVgW5GGr.mjs → dbTunnel-bV1CPWUv.mjs} +5 -6
  64. package/dist/{dbTunnel-DVgW5GGr.mjs.map → dbTunnel-bV1CPWUv.mjs.map} +1 -1
  65. package/dist/deploy/public.cjs +25 -26
  66. package/dist/deploy/public.cjs.map +1 -1
  67. package/dist/deploy/public.d.cts +5 -5
  68. package/dist/deploy/public.d.mts +5 -5
  69. package/dist/deploy/public.mjs +10 -11
  70. package/dist/deploy/public.mjs.map +1 -1
  71. package/dist/{deploy-B1n2hPbI.cjs → deploy-CDUWcl58.cjs} +72 -62
  72. package/dist/deploy-CDUWcl58.cjs.map +1 -0
  73. package/dist/{deploy-SsifvmBB.mjs → deploy-Cpz5sKbh.mjs} +25 -15
  74. package/dist/deploy-Cpz5sKbh.mjs.map +1 -0
  75. package/dist/{destroy-CHigTrDO.mjs → destroy-DRlcWJwm.mjs} +9 -9
  76. package/dist/{destroy-CHigTrDO.mjs.map → destroy-DRlcWJwm.mjs.map} +1 -1
  77. package/dist/{destroy-Bn6d47rP.cjs → destroy-DzeV0EdY.cjs} +21 -21
  78. package/dist/{destroy-Bn6d47rP.cjs.map → destroy-DzeV0EdY.cjs.map} +1 -1
  79. package/dist/{dokploy-CnnrFOBH.cjs → dokploy-BTNfj3Zt.cjs} +2 -2
  80. package/dist/{dokploy-CnnrFOBH.cjs.map → dokploy-BTNfj3Zt.cjs.map} +1 -1
  81. package/dist/{dokploy-BzfI7ZE0.mjs → dokploy-BveqiW2h.mjs} +2 -2
  82. package/dist/{dokploy-BzfI7ZE0.mjs.map → dokploy-BveqiW2h.mjs.map} +1 -1
  83. package/dist/{eas-CZ3ZuWTs.mjs → eas-BmYTfjY6.mjs} +3 -3
  84. package/dist/{eas-CZ3ZuWTs.mjs.map → eas-BmYTfjY6.mjs.map} +1 -1
  85. package/dist/{eas-BTOGceIO.cjs → eas-Dt_vRzb4.cjs} +3 -3
  86. package/dist/{eas-BTOGceIO.cjs.map → eas-Dt_vRzb4.cjs.map} +1 -1
  87. package/dist/{encryption-BHGCfu6X.cjs → encryption-BE2wxfyH.cjs} +6 -6
  88. package/dist/{encryption-BHGCfu6X.cjs.map → encryption-BE2wxfyH.cjs.map} +1 -1
  89. package/dist/{encryption-CocJ18w4.mjs → encryption-DqoQltP8.mjs} +3 -3
  90. package/dist/{encryption-CocJ18w4.mjs.map → encryption-DqoQltP8.mjs.map} +1 -1
  91. package/dist/{engine-B0AwceAI.mjs → engine-B72vyrO8.mjs} +7 -9
  92. package/dist/{engine-B0AwceAI.mjs.map → engine-B72vyrO8.mjs.map} +1 -1
  93. package/dist/{engine-3460tLKl.cjs → engine-BevpkNZe.cjs} +100 -102
  94. package/dist/{engine-3460tLKl.cjs.map → engine-BevpkNZe.cjs.map} +1 -1
  95. package/dist/{github-DMQSq0Jm.cjs → github-DoHdtsDX.cjs} +18 -18
  96. package/dist/{github-DMQSq0Jm.cjs.map → github-DoHdtsDX.cjs.map} +1 -1
  97. package/dist/{github-BqYhgU8Y.mjs → github-hxvid6J3.mjs} +7 -7
  98. package/dist/{github-BqYhgU8Y.mjs.map → github-hxvid6J3.mjs.map} +1 -1
  99. package/dist/{googlePlay-DTQ_epbl.cjs → googlePlay-CYney-Of.cjs} +5 -5
  100. package/dist/{googlePlay-DTQ_epbl.cjs.map → googlePlay-CYney-Of.cjs.map} +1 -1
  101. package/dist/{googlePlay-y4fWdG2Z.mjs → googlePlay-DsvZTWgP.mjs} +4 -4
  102. package/dist/{googlePlay-y4fWdG2Z.mjs.map → googlePlay-DsvZTWgP.mjs.map} +1 -1
  103. package/dist/{iam-BzFyFf7T.mjs → iam-DloEBLXZ.mjs} +2 -2
  104. package/dist/{iam-BzFyFf7T.mjs.map → iam-DloEBLXZ.mjs.map} +1 -1
  105. package/dist/{iam-WIoKnLBp.cjs → iam-SxPKYCI_.cjs} +2 -2
  106. package/dist/{iam-WIoKnLBp.cjs.map → iam-SxPKYCI_.cjs.map} +1 -1
  107. package/dist/{index-zPzigXh-.d.cts → index-BThTZV8T.d.mts} +2 -2
  108. package/dist/{index-BKgOlfK2.d.mts.map → index-BThTZV8T.d.mts.map} +1 -1
  109. package/dist/{index-BKgOlfK2.d.mts → index-Cgd-ouyI.d.cts} +2 -2
  110. package/dist/{index-zPzigXh-.d.cts.map → index-Cgd-ouyI.d.cts.map} +1 -1
  111. package/dist/index.cjs +590 -246
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.mjs +443 -99
  114. package/dist/index.mjs.map +1 -1
  115. package/dist/{local-CZbNAWuZ.cjs → local-BuR4fIW6.cjs} +3 -3
  116. package/dist/{local-CZbNAWuZ.cjs.map → local-BuR4fIW6.cjs.map} +1 -1
  117. package/dist/{local-DJuonm2r.mjs → local-Cmq75U_o.mjs} +2 -2
  118. package/dist/{local-DJuonm2r.mjs.map → local-Cmq75U_o.mjs.map} +1 -1
  119. package/dist/{migrate-DU4G7xbh.mjs → migrate-Bf-EG8Fj.mjs} +5 -5
  120. package/dist/{migrate-DU4G7xbh.mjs.map → migrate-Bf-EG8Fj.mjs.map} +1 -1
  121. package/dist/{migrate-CJNgQxYs.cjs → migrate-CDMdrniJ.cjs} +13 -13
  122. package/dist/{migrate-CJNgQxYs.cjs.map → migrate-CDMdrniJ.cjs.map} +1 -1
  123. package/dist/{migrate-DXLhzkls.cjs → migrate-CuTQha4s.cjs} +6 -6
  124. package/dist/{migrate-DXLhzkls.cjs.map → migrate-CuTQha4s.cjs.map} +1 -1
  125. package/dist/{migrate-D79KnjFu.mjs → migrate-DYJffHOm.mjs} +3 -3
  126. package/dist/{migrate-D79KnjFu.mjs.map → migrate-DYJffHOm.mjs.map} +1 -1
  127. package/dist/openapi.cjs +1 -1
  128. package/dist/openapi.d.cts +2 -2
  129. package/dist/openapi.d.mts +2 -2
  130. package/dist/openapi.mjs +1 -1
  131. package/dist/{projectBucket-rVF15Mu-.mjs → projectBucket-B5YkuSVr.mjs} +2 -2
  132. package/dist/{projectBucket-rVF15Mu-.mjs.map → projectBucket-B5YkuSVr.mjs.map} +1 -1
  133. package/dist/{projectBucket-BoH-BJPI.cjs → projectBucket-NcgqleyH.cjs} +2 -2
  134. package/dist/{projectBucket-BoH-BJPI.cjs.map → projectBucket-NcgqleyH.cjs.map} +1 -1
  135. package/dist/{publish-DBDdm5Dz.cjs → publish--EQ4Tw3F.cjs} +2 -2
  136. package/dist/{publish-DBDdm5Dz.cjs.map → publish--EQ4Tw3F.cjs.map} +1 -1
  137. package/dist/{publish-EaWW1vhe.mjs → publish-YL8WZHSo.mjs} +2 -2
  138. package/dist/{publish-EaWW1vhe.mjs.map → publish-YL8WZHSo.mjs.map} +1 -1
  139. package/dist/{ready--_hMxbUX.cjs → ready-DCvnFZnJ.cjs} +2 -2
  140. package/dist/{ready--_hMxbUX.cjs.map → ready-DCvnFZnJ.cjs.map} +1 -1
  141. package/dist/{ready-CjIqXFXe.mjs → ready-sSPuiZ7N.mjs} +2 -2
  142. package/dist/{ready-CjIqXFXe.mjs.map → ready-sSPuiZ7N.mjs.map} +1 -1
  143. package/dist/reconcile/public.d.cts +1 -1
  144. package/dist/reconcile/public.d.mts +1 -1
  145. package/dist/{resolve-De0Dw9wI.cjs → resolve-Ced8-gj4.cjs} +4 -4
  146. package/dist/{resolve-De0Dw9wI.cjs.map → resolve-Ced8-gj4.cjs.map} +1 -1
  147. package/dist/{resolve-DLUOV7Tt.mjs → resolve-DcG10_JV.mjs} +4 -4
  148. package/dist/{resolve-DLUOV7Tt.mjs.map → resolve-DcG10_JV.mjs.map} +1 -1
  149. package/dist/{rollback-bDh-dBGa.mjs → rollback-BxI2p53H.mjs} +7 -6
  150. package/dist/{rollback-bDh-dBGa.mjs.map → rollback-BxI2p53H.mjs.map} +1 -1
  151. package/dist/{rollback-61Be6ASD.cjs → rollback-C6bCANv7.cjs} +10 -9
  152. package/dist/{rollback-61Be6ASD.cjs.map → rollback-C6bCANv7.cjs.map} +1 -1
  153. package/dist/{runtime-CaejlcZt.d.mts → runtime-BtoiRP5G.d.cts} +2 -2
  154. package/dist/{runtime-CaejlcZt.d.mts.map → runtime-BtoiRP5G.d.cts.map} +1 -1
  155. package/dist/{runtime-D3jD4Dvn.d.cts → runtime-Ct41f0tN.d.mts} +2 -2
  156. package/dist/{runtime-D3jD4Dvn.d.cts.map → runtime-Ct41f0tN.d.mts.map} +1 -1
  157. package/dist/{s3-CRLJjozN.mjs → s3-BAI0ELtE.mjs} +3 -3
  158. package/dist/{s3-CRLJjozN.mjs.map → s3-BAI0ELtE.mjs.map} +1 -1
  159. package/dist/{s3-Bw-Cpb0k.cjs → s3-DucPHZAn.cjs} +3 -3
  160. package/dist/{s3-Bw-Cpb0k.cjs.map → s3-DucPHZAn.cjs.map} +1 -1
  161. package/dist/{serverSetup-DkKFG--v.cjs → serverSetup-D3-FE7Dj.cjs} +9 -8
  162. package/dist/{serverSetup-DkKFG--v.cjs.map → serverSetup-D3-FE7Dj.cjs.map} +1 -1
  163. package/dist/{serverSetup-9BMKflju.mjs → serverSetup-DS9tW50_.mjs} +7 -6
  164. package/dist/{serverSetup-9BMKflju.mjs.map → serverSetup-DS9tW50_.mjs.map} +1 -1
  165. package/dist/{sniffer-PDjJ-6ki.mjs → sniffer-CX8sI8Cu.mjs} +7 -7
  166. package/dist/{sniffer-PDjJ-6ki.mjs.map → sniffer-CX8sI8Cu.mjs.map} +1 -1
  167. package/dist/{sniffer-Dss2_3q7.cjs → sniffer-XlvJLrhZ.cjs} +7 -7
  168. package/dist/{sniffer-Dss2_3q7.cjs.map → sniffer-XlvJLrhZ.cjs.map} +1 -1
  169. package/dist/{snsSubscriptions-BA4UEQDb.cjs → snsSubscriptions-CJAOhWq9.cjs} +11 -12
  170. package/dist/{snsSubscriptions-BA4UEQDb.cjs.map → snsSubscriptions-CJAOhWq9.cjs.map} +1 -1
  171. package/dist/{snsSubscriptions-BwwRq60H.mjs → snsSubscriptions-DDrra9rN.mjs} +3 -4
  172. package/dist/{snsSubscriptions-BwwRq60H.mjs.map → snsSubscriptions-DDrra9rN.mjs.map} +1 -1
  173. package/dist/{sst-xWQPl_tB.mjs → sst-CdHflajE.mjs} +6 -6
  174. package/dist/{sst-xWQPl_tB.mjs.map → sst-CdHflajE.mjs.map} +1 -1
  175. package/dist/{sst-Dy-LThkf.cjs → sst-CsEjVFtz.cjs} +8 -8
  176. package/dist/{sst-Dy-LThkf.cjs.map → sst-CsEjVFtz.cjs.map} +1 -1
  177. package/dist/stack-BYhtz-bE.cjs +11449 -0
  178. package/dist/stack-BYhtz-bE.cjs.map +1 -0
  179. package/dist/stack-CLHY-_2m.mjs +10474 -0
  180. package/dist/stack-CLHY-_2m.mjs.map +1 -0
  181. package/dist/{stage-BsdW3fQh.cjs → stage-Bc_BtQeG.cjs} +11 -12
  182. package/dist/stage-Bc_BtQeG.cjs.map +1 -0
  183. package/dist/{stage-ZBO62mNs.mjs → stage-C7aYyDMr.mjs} +5 -6
  184. package/dist/stage-C7aYyDMr.mjs.map +1 -0
  185. package/dist/{stages-DjFKQv08.mjs → stages-DFvE7iEO.mjs} +2 -2
  186. package/dist/{stages-DjFKQv08.mjs.map → stages-DFvE7iEO.mjs.map} +1 -1
  187. package/dist/{stages-BeSQQQ4z.cjs → stages-Dk6Lv7DY.cjs} +2 -2
  188. package/dist/{stages-BeSQQQ4z.cjs.map → stages-Dk6Lv7DY.cjs.map} +1 -1
  189. package/dist/target/public.cjs +1 -1
  190. package/dist/target/public.d.cts +2 -2
  191. package/dist/target/public.d.mts +2 -2
  192. package/dist/target/public.mjs +1 -1
  193. package/dist/{terminal-DUQ0yaZQ.mjs → terminal-BZzK69T9.mjs} +2 -2
  194. package/dist/{terminal-DUQ0yaZQ.mjs.map → terminal-BZzK69T9.mjs.map} +1 -1
  195. package/dist/{terminal-DhPb_CKf.cjs → terminal-DXUXlqrO.cjs} +5 -5
  196. package/dist/{terminal-DhPb_CKf.cjs.map → terminal-DXUXlqrO.cjs.map} +1 -1
  197. package/dist/{types-CLxsw-QY.d.cts → types-BVDaaLas.d.cts} +26 -7
  198. package/dist/{types-CLxsw-QY.d.cts.map → types-BVDaaLas.d.cts.map} +1 -1
  199. package/dist/{types-wLlwkSib.d.mts → types-CJTKWLkK.d.mts} +26 -7
  200. package/dist/{types-wLlwkSib.d.mts.map → types-CJTKWLkK.d.mts.map} +1 -1
  201. package/dist/{utils-D_fxUqvU.mjs → utils-CdKxD8Lt.mjs} +2 -2
  202. package/dist/{utils-D_fxUqvU.mjs.map → utils-CdKxD8Lt.mjs.map} +1 -1
  203. package/dist/{utils-D2Nk1Nv2.cjs → utils-DBqXbB8P.cjs} +2 -2
  204. package/dist/{utils-D2Nk1Nv2.cjs.map → utils-DBqXbB8P.cjs.map} +1 -1
  205. package/dist/vitest.cjs +1 -1
  206. package/dist/vitest.mjs +1 -1
  207. package/dist/workspace/index.cjs +1 -1
  208. package/dist/workspace/index.d.cts +2 -2
  209. package/dist/workspace/index.d.mts +2 -2
  210. package/dist/workspace/index.mjs +1 -1
  211. package/dist/{workspace-wTLnc1Ef.cjs → workspace-CTspddnJ.cjs} +62 -22
  212. package/dist/workspace-CTspddnJ.cjs.map +1 -0
  213. package/dist/{workspace-DJjhfAGf.mjs → workspace-CdiCMRap.mjs} +62 -22
  214. package/dist/workspace-CdiCMRap.mjs.map +1 -0
  215. package/package.json +16 -16
  216. package/dist/apps-CQqhCjg4.mjs +0 -4650
  217. package/dist/apps-CQqhCjg4.mjs.map +0 -1
  218. package/dist/apps-DWq98qHY.cjs +0 -5174
  219. package/dist/apps-DWq98qHY.cjs.map +0 -1
  220. package/dist/clientTelemetry-BAwj6MOf.d.cts.map +0 -1
  221. package/dist/clientTelemetry-CvamPJj_.d.mts.map +0 -1
  222. package/dist/compose-BWqyiF3p.cjs.map +0 -1
  223. package/dist/compose-Dx1qWkqA.mjs.map +0 -1
  224. package/dist/compose-FHcdMtju.mjs.map +0 -1
  225. package/dist/compose-uWAls-tD.cjs.map +0 -1
  226. package/dist/deploy-B1n2hPbI.cjs.map +0 -1
  227. package/dist/deploy-SsifvmBB.mjs.map +0 -1
  228. package/dist/dns-w28G3uDJ.mjs.map +0 -1
  229. package/dist/dns-zWyF3BB0.cjs.map +0 -1
  230. package/dist/docker-DDiEfZox.mjs +0 -1649
  231. package/dist/docker-DDiEfZox.mjs.map +0 -1
  232. package/dist/docker-Dox4VZcA.cjs +0 -1798
  233. package/dist/docker-Dox4VZcA.cjs.map +0 -1
  234. package/dist/notes-CF_NOgxM.cjs +0 -510
  235. package/dist/notes-CF_NOgxM.cjs.map +0 -1
  236. package/dist/notes-Dwc9WLvg.mjs +0 -409
  237. package/dist/notes-Dwc9WLvg.mjs.map +0 -1
  238. package/dist/stack-BQKXw0dX.cjs +0 -1887
  239. package/dist/stack-BQKXw0dX.cjs.map +0 -1
  240. package/dist/stack-pftB9Sqp.mjs +0 -1777
  241. package/dist/stack-pftB9Sqp.mjs.map +0 -1
  242. package/dist/stage-BsdW3fQh.cjs.map +0 -1
  243. package/dist/stage-ZBO62mNs.mjs.map +0 -1
  244. package/dist/workspace-DJjhfAGf.mjs.map +0 -1
  245. package/dist/workspace-wTLnc1Ef.cjs.map +0 -1
@@ -1,409 +0,0 @@
1
- import { t as GkmError } from "./errors-C9uIyIDt.mjs";
2
- import { Ft as SERVER_IPV4_KEY, H as provisioningOf, It as SERVER_IPV6_KEY, U as stageProvider, dt as fileServerLabel, ot as appKey } from "./workspace-DJjhfAGf.mjs";
3
- import { l as workerEnvKeys, t as appEnvKeys } from "./apps-CQqhCjg4.mjs";
4
- import { providedKeyFor, publicEnvFor, senderAddress } from "@geekmidas/manifest";
5
- //#region src/deploy/devServices.ts
6
- /**
7
- * Mail and object storage on a deployed stage: real ones, or — only when
8
- * someone asked — the dev services the local stage runs.
9
- *
10
- * Locally a declared `Email` is Mailpit and a declared bucket is MinIO, and
11
- * nobody has to configure either. Deployed, the same two containers would be
12
- * a stage that silently delivers no mail and keeps its files on one
13
- * container's disk. So a deployed stage on a server target takes both from
14
- * its secrets — the mail server's URL and sending address, and each bucket's
15
- * URL — and a stage missing any of them fails before anything is built,
16
- * provisioned or written, naming every key at once.
17
- *
18
- * A bucket's credentials are not checked: they are optional, and come from
19
- * either of two places. The bucket's URL may carry a key of its own
20
- * (`s3://KEY:SECRET@uploads`), which wins; otherwise the S3 client's default
21
- * chain applies — the stage's shared `AWS_ACCESS_KEY_ID`/
22
- * `AWS_SECRET_ACCESS_KEY` when it set them, or a role.
23
- *
24
- * `--allow-dev-services` is the way out for a stage that is not production —
25
- * a preview, a demo: every construct the stage does not account for gets the
26
- * dev service the local stage runs for it — a bucket MinIO, mail Mailpit —
27
- * and the target derives the keys from it. What the stage does account for
28
- * still wins: a key set in its secrets, or a provider (`deploy.objects`)
29
- * that backs the kind. Every run that uses one says so, loudly.
30
- *
31
- * Pure: what each target runs is decided here from declarations and the
32
- * stage's values, and the targets do the running.
33
- */
34
- /**
35
- * The dev services a deployed stage can run — one per kind that has one on
36
- * every server target: a bucket's MinIO and mail's Mailpit. A cache or a
37
- * database is not here because a server stage runs its own anyway.
38
- */
39
- const DEV_SERVICES = ["minio", "mailpit"];
40
- /**
41
- * The S3 client's shared key pair. Optional: a bucket whose URL carries its own
42
- * key (`s3://KEY:SECRET@bucket`) signs with that, and one without signs with
43
- * this pair when the stage set it, or with whatever else the SDK's default
44
- * chain finds — a role.
45
- */
46
- const STORAGE_KEY_PAIR = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"];
47
- /** Dev services asked of a target that runs no containers. */
48
- var DevServicesNeedServerTarget = class extends GkmError {
49
- target;
50
- constructor(target) {
51
- super(`--allow-dev-services applies to server targets only, and '${target}' deploys to AWS, where a bucket is S3 and mail is the stage's own. Drop --allow-dev-services.`);
52
- this.target = target;
53
- this.name = "DevServicesNeedServerTarget";
54
- }
55
- };
56
- /**
57
- * `--allow-dev-services` given a value — the list it used to take. It is a
58
- * switch now: every construct the stage does not account for gets its dev
59
- * service.
60
- */
61
- var AllowDevServicesTakesNoValue = class extends GkmError {
62
- value;
63
- constructor(value) {
64
- super(`--allow-dev-services takes no value (it was given '${value}'). It runs the dev service for every bucket and mail the stage does not account for — no key in its secrets, no provider in deploy.<kind>.<stage> — so there is nothing to list. Pass --allow-dev-services on its own.`);
65
- this.value = value;
66
- this.name = "AllowDevServicesTakesNoValue";
67
- }
68
- };
69
- /**
70
- * Refuses `--allow-dev-services <value>` and `--allow-dev-services=<value>` on
71
- * a command line, with the reason, before the parser calls the value an
72
- * excess argument. `gkm deploy` and `gkm compose` take no positional
73
- * argument, so whatever follows the flag and is not a flag was meant for it.
74
- *
75
- * @throws {AllowDevServicesTakesNoValue}
76
- */
77
- function assertDevServicesFlag(argv) {
78
- for (let i = 0; i < argv.length; i++) {
79
- const arg = argv[i];
80
- if (arg.startsWith("--allow-dev-services=")) throw new AllowDevServicesTakesNoValue(arg.slice(arg.indexOf("=") + 1));
81
- const next = argv[i + 1];
82
- if (arg === "--allow-dev-services" && next && !next.startsWith("-")) throw new AllowDevServicesTakesNoValue(next);
83
- }
84
- }
85
- /**
86
- * A deployed stage with mail or object storage that its secrets do not
87
- * configure — every missing key, across every app, at once.
88
- */
89
- var ExternalServicesNotConfigured = class extends GkmError {
90
- stage;
91
- missing;
92
- constructor(stage, missing) {
93
- const standIns = missing.some((m) => m.service !== void 0);
94
- const lines = missing.map((m) => {
95
- const by = m.apps?.length ? `, read by ${m.apps.join(", ")}` : "";
96
- return ` gkm secrets:set ${m.key} '${m.example}' --stage ${stage}\n ${m.what}${by}` + (m.note ? `\n ${m.note}` : "") + (m.hint ? `\n ${m.hint}` : "");
97
- });
98
- super(`The stage '${stage}' is deployed, and a deployed stage's mail and object storage are real services: gkm runs no Mailpit or MinIO for it. Set ${missing.length === 1 ? "this key" : `these ${missing.length} keys`} in the stage's secrets:\n\n${lines.join("\n")}\n\n` + (standIns ? "For a stage that is not production — a preview, a demo — the dev services can run instead, with --allow-dev-services. Mailpit delivers no mail, and MinIO keeps every object on one container's disk.\n\n" : "") + `Or run: gkm secrets:add --stage ${stage}`);
99
- this.stage = stage;
100
- this.missing = missing;
101
- this.name = "ExternalServicesNotConfigured";
102
- }
103
- };
104
- /** The kinds a deployed stage takes from its secrets, or a dev service. */
105
- const SERVICE_KINDS = {
106
- email: "email",
107
- objects: "objects",
108
- "file-server": "file-server"
109
- };
110
- /**
111
- * Every mail and storage construct a manifest declares, each with the apps
112
- * and workers that read it — a process's environment, a site's build args. A
113
- * file server's reader reads its bucket too.
114
- *
115
- * The one list a deploy's readiness check refuses a stage by, every server
116
- * target decides its dev services from, and `gkm secrets:add` offers — so
117
- * none of them can disagree.
118
- */
119
- function stageServiceDeclarations(input) {
120
- const { manifest } = input;
121
- const owners = /* @__PURE__ */ new Map();
122
- for (const [id, declaration] of Object.entries(manifest)) {
123
- if (!SERVICE_KINDS[declaration.kind]) continue;
124
- owners.set(providedKeyFor(id, declaration.kind, declaration.kind === "objects" ? "connectionString" : "url"), id);
125
- if (declaration.kind === "email") owners.set(providedKeyFor(id, declaration.kind, "from"), id);
126
- if (declaration.kind === "objects") owners.set(providedKeyFor(id, declaration.kind, "signedOrigin"), id);
127
- }
128
- const readers = /* @__PURE__ */ new Map();
129
- const read = (process, keys) => {
130
- for (const key of keys) {
131
- const id = owners.get(key);
132
- if (!id) continue;
133
- const declaration = manifest[id];
134
- const of = declaration?.kind === "file-server" ? declaration.of : void 0;
135
- for (const owner of of ? [id, of] : [id]) {
136
- const set = readers.get(owner) ?? /* @__PURE__ */ new Set();
137
- set.add(process);
138
- readers.set(owner, set);
139
- }
140
- }
141
- };
142
- for (const [id, declaration] of Object.entries(manifest)) {
143
- const name = appKey(id);
144
- if (declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site" || declaration.kind === "mobile-app") read(name, appEnvKeys(manifest, name) ?? []);
145
- if (declaration.kind === "site") read(name, Object.values(publicEnvFor(declaration, manifest)));
146
- if (declaration.kind === "worker") read(name, workerEnvKeys(manifest, id) ?? []);
147
- }
148
- return Object.entries(manifest).flatMap(([id, declaration]) => {
149
- const kind = SERVICE_KINDS[declaration.kind];
150
- if (!kind) return [];
151
- const apps = [...readers.get(id) ?? []].sort();
152
- return [{
153
- id,
154
- kind,
155
- ...declaration.kind === "file-server" && declaration.of ? { of: declaration.of } : {},
156
- ...declaration.kind === "email" && declaration.from ? { from: declaration.from } : {},
157
- ...apps.length ? { apps } : {}
158
- }];
159
- });
160
- }
161
- /**
162
- * Every key a stage must be given rather than derive — the one list both a
163
- * deploy's checks and `gkm secrets:add` read, so what a deploy refuses and
164
- * what the builder offers cannot drift.
165
- *
166
- * - Deployed, mail is its URL and its sending address, a bucket its URL, and
167
- * a file server its public URL. Locally all of it is Mailpit and MinIO.
168
- * - On every stage, a third party's credentials: nobody but the third party
169
- * can issue them.
170
- *
171
- * Never a derived value: a database URL, a generated secret, the seed.
172
- */
173
- function requiredStageKeys(input) {
174
- const domain = input.domain ?? "example.com";
175
- const keys = [];
176
- const add = (entry) => {
177
- if (!keys.some((k) => k.key === entry.key)) keys.push(entry);
178
- };
179
- const byId = (list) => [...list ?? []].sort((a, b) => a.id.localeCompare(b.id));
180
- const apps = (d) => d.apps?.length ? { apps: [...d.apps].sort() } : {};
181
- if (!input.local) {
182
- const services = byId(input.services);
183
- const backing = (note, service) => note?.accounted ? note.hint ? { hint: note.hint } : {} : { service };
184
- const storage = backing(input.providers?.objects, "minio");
185
- const mail = backing(input.providers?.email, "mailpit");
186
- for (const d of services.filter((d) => d.kind === "email")) {
187
- add({
188
- key: providedKeyFor(d.id, "email", "url"),
189
- id: d.id,
190
- kind: "email",
191
- what: `where '${d.id}' sends mail — any SMTP server`,
192
- example: `smtp://user:password@smtp.${domain}:587`,
193
- ...mail,
194
- ...apps(d)
195
- });
196
- add({
197
- key: providedKeyFor(d.id, "email", "from"),
198
- id: d.id,
199
- kind: "email",
200
- what: `the address '${d.id}' sends from, on a domain the mail server has verified`,
201
- example: senderAddress(d, domain),
202
- ...mail,
203
- ...apps(d)
204
- });
205
- }
206
- for (const d of services.filter((d) => d.kind === "objects")) add({
207
- key: providedKeyFor(d.id, "objects", "connectionString"),
208
- id: d.id,
209
- kind: "bucket",
210
- what: `the bucket '${d.id}' — S3, R2, or any S3-compatible store (add &endpoint=… for one that is not S3)`,
211
- note: `credentials are optional: a key for this bucket alone in the URL (s3://KEY:SECRET@${appKey(d.id)}?…) wins; without one, the shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or a role signs`,
212
- example: `s3://${appKey(d.id)}?region=eu-west-1`,
213
- ...storage,
214
- ...apps(d)
215
- });
216
- for (const d of services.filter((d) => d.kind === "file-server")) add({
217
- key: providedKeyFor(d.id, "file-server", "url"),
218
- id: d.id,
219
- kind: "file-server",
220
- what: `the public address '${d.id}' serves its bucket on — a CDN or the bucket's own domain`,
221
- example: `https://${fileServerLabel(d.id)}.${domain}`,
222
- ...storage,
223
- ...d.of ? { of: d.of } : {},
224
- ...apps(d)
225
- });
226
- }
227
- if (!input.local && input.server) add({
228
- key: SERVER_IPV4_KEY,
229
- id: "server",
230
- kind: "server",
231
- what: "the public IPv4 address of the server the stage's stack runs on — its hosts' DNS records point at it, and every deploy checks they do",
232
- note: `${SERVER_IPV6_KEY} adds its IPv6 address (AAAA records); neither is ever handed to an app`,
233
- example: "203.0.113.10"
234
- });
235
- for (const d of byId(input.credentials)) add({
236
- key: providedKeyFor(d.id, d.kind, "credentials"),
237
- id: d.id,
238
- kind: d.kind,
239
- what: d.kind === "external-api" ? `the credentials '${d.id}' was issued for this stage, as its schema describes them` : `the credential '${d.id}', as its schema describes it`,
240
- example: "{\"apiKey\":\"…\"}",
241
- ...apps(d)
242
- });
243
- return keys;
244
- }
245
- /**
246
- * Whether only the stage's secrets can supply `key` to a construct of `kind`
247
- * — what nothing on the stage derives.
248
- *
249
- * A third party's credentials, always. Deployed, also each generated secret
250
- * and keyring: the stage generated each one once, and every run reads the
251
- * same value back.
252
- */
253
- function suppliedOnly(kind, id, key, local) {
254
- if (kind === "credential") return true;
255
- if (kind === "external-api") return key === providedKeyFor(id, "external-api", "credentials");
256
- if (local) return false;
257
- return kind === "secret" || kind === "encryption";
258
- }
259
- /**
260
- * Where a deployed stage's mail and storage come from, and what it lacks.
261
- *
262
- * - Mail is external once its URL is set, and then needs its sending
263
- * address too. Unset, it is Mailpit where allowed — the address derived
264
- * unless set — and missing otherwise.
265
- * - A bucket is external once its URL is set; its credentials, in the URL or
266
- * the shared pair, are optional. Unset, it is MinIO where allowed, and
267
- * missing otherwise.
268
- * - A file server's URL is derived where its bucket is MinIO, unless set;
269
- * over an external bucket the stage must set it.
270
- *
271
- * The keys themselves are {@link requiredStageKeys}'s.
272
- */
273
- function externalServices(input) {
274
- const { supplied, allow } = input;
275
- const has = (key) => supplied[key] !== void 0;
276
- const required = requiredStageKeys({
277
- local: false,
278
- services: input.declarations,
279
- ...input.domain ? { domain: input.domain } : {},
280
- ...input.providers ? { providers: input.providers } : {}
281
- });
282
- const standIn = (k) => allow && k.service !== void 0 && !has(k.key);
283
- const mailpit = required.filter((k) => k.kind === "email" && k.key === providedKeyFor(k.id, "email", "url")).filter(standIn).map((k) => k.id);
284
- const minio = required.filter((k) => k.kind === "bucket").filter(standIn).map((k) => k.id);
285
- const covered = (k) => k.kind === "email" && mailpit.includes(k.id) || k.kind === "bucket" && minio.includes(k.id) || k.kind === "file-server" && k.of !== void 0 && minio.includes(k.of);
286
- return {
287
- missing: required.filter((k) => !has(k.key) && !covered(k)).map(({ key, id, what, note, example, service, apps, hint }) => ({
288
- key,
289
- id,
290
- what,
291
- ...note ? { note } : {},
292
- example,
293
- ...service ? { service } : {},
294
- ...apps ? { apps } : {},
295
- ...hint ? { hint } : {}
296
- })),
297
- minio,
298
- mailpit
299
- };
300
- }
301
- /** The dev services a run uses, one entry per service it runs. */
302
- function devServicesUsed(services) {
303
- const used = [];
304
- if (services.mailpit.length > 0) used.push({
305
- service: "mailpit",
306
- ids: services.mailpit
307
- });
308
- if (services.minio.length > 0) used.push({
309
- service: "minio",
310
- ids: services.minio
311
- });
312
- return used;
313
- }
314
- /** The line a run prints for each dev service a deployed stage uses. */
315
- function devServiceWarning(stage, use) {
316
- return `⚠️ DEV SERVICE ON A DEPLOYED STAGE (${stage}): ${use.service === "mailpit" ? `Mailpit is catching mail for ${use.ids.join(", ")}. It delivers NO mail: nobody receives a sign-in link, a receipt or a reset` : `MinIO is storing ${use.ids.join(", ")}. Every object is on one container's disk, with no replication and no backup`}. It is not production-grade — set the stage's own keys in its secrets for that.`;
317
- }
318
- /**
319
- * Report each dev service a run uses: a loud line, and a `dev-service.used`
320
- * event a host can act on.
321
- */
322
- function reportDevServices(ctx, uses) {
323
- for (const use of uses) {
324
- ctx.logger.warn(`\n${devServiceWarning(ctx.stage, use)}`);
325
- ctx.emit({
326
- type: "dev-service.used",
327
- service: use.service,
328
- stage: ctx.stage,
329
- constructs: use.ids
330
- });
331
- }
332
- }
333
- //#endregion
334
- //#region src/providers/types.ts
335
- /** The manifest kinds a stage can name a provider for. */
336
- const PROVIDER_KINDS = [
337
- "objects",
338
- "inbox",
339
- "email"
340
- ];
341
- //#endregion
342
- //#region src/providers/notes.ts
343
- /** The constructs of a kind: `objects` is every bucket. */
344
- function constructsOf(manifest, kind) {
345
- return Object.entries(manifest).filter(([, d]) => d.kind === kind).map(([id]) => id).sort();
346
- }
347
- /** A stage that names `false` for a kind, and declares constructs of it. */
348
- var StageProviderDisabled = class extends GkmError {
349
- kind;
350
- stage;
351
- ids;
352
- constructor(kind, stage, ids) {
353
- super(`deploy.${kind}.${stage} is false — the stage has no ${kind} — and ${ids.join(", ")} ${ids.length === 1 ? "is" : "are"} declared. Name what backs ${ids.length === 1 ? "it" : "them"} on '${stage}' (deploy.${kind}.${stage}: 'external', or a provider), or remove the ${ids.length === 1 ? "construct" : "constructs"}.`);
354
- this.kind = kind;
355
- this.stage = stage;
356
- this.ids = ids;
357
- this.name = "StageProviderDisabled";
358
- }
359
- };
360
- /** The command a stage's providers are run with: every deploy runs them. */
361
- function provisionCommand(stage) {
362
- return `gkm deploy --stage ${stage}`;
363
- }
364
- /**
365
- * The line a stage missing a key a provider would write is given: what
366
- * creates it, and with which credentials. Undefined when no provider backs
367
- * the kind on the stage.
368
- */
369
- function provisionHint(workspace, kind, stage) {
370
- const choice = stageProvider(workspace, kind, stage);
371
- if (choice.mode !== "provider") return void 0;
372
- const provisioning = provisioningOf(kind, choice.name);
373
- if (!provisioning) return void 0;
374
- return `deploy.${kind}.${stage} is ${choice.name}: the deploy (${provisionCommand(stage)}) creates it and writes this key, with ${provisioning.describe}` + (provisioning.login ? `, or gkm login --provider ${provisioning.login}` : "");
375
- }
376
- /**
377
- * What a deploy's checks read off the stage's providers: whether each kind is
378
- * accounted for — a provider, or `false` — so no dev service stands in for
379
- * it, and what creates a missing key of it.
380
- */
381
- function stageProviderNotes(workspace, stage) {
382
- const notes = {};
383
- for (const kind of ["objects", "email"]) {
384
- if (stageProvider(workspace, kind, stage).mode === "external") continue;
385
- const hint = provisionHint(workspace, kind, stage);
386
- notes[kind] = {
387
- accounted: true,
388
- ...hint ? { hint } : {}
389
- };
390
- }
391
- return notes;
392
- }
393
- /**
394
- * A kind the stage set to `false`, declared anyway — refused before anything
395
- * else is checked. Pure: what a stack is composed from.
396
- *
397
- * @throws {StageProviderDisabled}
398
- */
399
- function assertStageProvidersEnabled(workspace, manifest, stage) {
400
- for (const kind of PROVIDER_KINDS) {
401
- const ids = constructsOf(manifest, kind);
402
- if (ids.length === 0) continue;
403
- if (stageProvider(workspace, kind, stage).mode === "none") throw new StageProviderDisabled(kind, stage, ids);
404
- }
405
- }
406
- //#endregion
407
- export { suppliedOnly as _, PROVIDER_KINDS as a, DevServicesNeedServerTarget as c, assertDevServicesFlag as d, devServicesUsed as f, stageServiceDeclarations as g, requiredStageKeys as h, stageProviderNotes as i, ExternalServicesNotConfigured as l, reportDevServices as m, assertStageProvidersEnabled as n, AllowDevServicesTakesNoValue as o, externalServices as p, provisionCommand as r, DEV_SERVICES as s, StageProviderDisabled as t, STORAGE_KEY_PAIR as u };
408
-
409
- //# sourceMappingURL=notes-Dwc9WLvg.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notes-Dwc9WLvg.mjs","names":[],"sources":["../src/deploy/devServices.ts","../src/providers/types.ts","../src/providers/notes.ts"],"sourcesContent":["/**\n * Mail and object storage on a deployed stage: real ones, or — only when\n * someone asked — the dev services the local stage runs.\n *\n * Locally a declared `Email` is Mailpit and a declared bucket is MinIO, and\n * nobody has to configure either. Deployed, the same two containers would be\n * a stage that silently delivers no mail and keeps its files on one\n * container's disk. So a deployed stage on a server target takes both from\n * its secrets — the mail server's URL and sending address, and each bucket's\n * URL — and a stage missing any of them fails before anything is built,\n * provisioned or written, naming every key at once.\n *\n * A bucket's credentials are not checked: they are optional, and come from\n * either of two places. The bucket's URL may carry a key of its own\n * (`s3://KEY:SECRET@uploads`), which wins; otherwise the S3 client's default\n * chain applies — the stage's shared `AWS_ACCESS_KEY_ID`/\n * `AWS_SECRET_ACCESS_KEY` when it set them, or a role.\n *\n * `--allow-dev-services` is the way out for a stage that is not production —\n * a preview, a demo: every construct the stage does not account for gets the\n * dev service the local stage runs for it — a bucket MinIO, mail Mailpit —\n * and the target derives the keys from it. What the stage does account for\n * still wins: a key set in its secrets, or a provider (`deploy.objects`)\n * that backs the kind. Every run that uses one says so, loudly.\n *\n * Pure: what each target runs is decided here from declarations and the\n * stage's values, and the targets do the running.\n */\n\nimport {\n\ttype ConstructManifest,\n\tprovidedKeyFor,\n\tpublicEnvFor,\n\tsenderAddress,\n} from '@geekmidas/manifest';\nimport { SERVER_IPV4_KEY, SERVER_IPV6_KEY } from '../compose/dnsConfig.js';\nimport { GkmError } from '../errors';\nimport { appEnvKeys, workerEnvKeys } from '../reconcile/apps.js';\nimport { appKey } from '../workspace/derive.js';\nimport { fileServerLabel } from '../workspace/fileServerLabel.js';\n\n/**\n * The dev services a deployed stage can run — one per kind that has one on\n * every server target: a bucket's MinIO and mail's Mailpit. A cache or a\n * database is not here because a server stage runs its own anyway.\n */\nexport const DEV_SERVICES = ['minio', 'mailpit'] as const;\n\nexport type DevService = (typeof DEV_SERVICES)[number];\n\n/**\n * The S3 client's shared key pair. Optional: a bucket whose URL carries its own\n * key (`s3://KEY:SECRET@bucket`) signs with that, and one without signs with\n * this pair when the stage set it, or with whatever else the SDK's default\n * chain finds — a role.\n */\nexport const STORAGE_KEY_PAIR = [\n\t'AWS_ACCESS_KEY_ID',\n\t'AWS_SECRET_ACCESS_KEY',\n] as const;\n\n/** Dev services asked of a target that runs no containers. */\nexport class DevServicesNeedServerTarget extends GkmError {\n\tconstructor(readonly target: string) {\n\t\tsuper(\n\t\t\t`--allow-dev-services applies to server targets only, and '${target}' ` +\n\t\t\t\t`deploys to AWS, where a bucket is S3 and mail is the stage's own. ` +\n\t\t\t\t'Drop --allow-dev-services.',\n\t\t);\n\t\tthis.name = 'DevServicesNeedServerTarget';\n\t}\n}\n\n/**\n * `--allow-dev-services` given a value — the list it used to take. It is a\n * switch now: every construct the stage does not account for gets its dev\n * service.\n */\nexport class AllowDevServicesTakesNoValue extends GkmError {\n\tconstructor(readonly value: string) {\n\t\tsuper(\n\t\t\t`--allow-dev-services takes no value (it was given '${value}'). It runs ` +\n\t\t\t\t'the dev service for every bucket and mail the stage does not account ' +\n\t\t\t\t'for — no key in its secrets, no provider in deploy.<kind>.<stage> — so ' +\n\t\t\t\t'there is nothing to list. Pass --allow-dev-services on its own.',\n\t\t);\n\t\tthis.name = 'AllowDevServicesTakesNoValue';\n\t}\n}\n\n/**\n * Refuses `--allow-dev-services <value>` and `--allow-dev-services=<value>` on\n * a command line, with the reason, before the parser calls the value an\n * excess argument. `gkm deploy` and `gkm compose` take no positional\n * argument, so whatever follows the flag and is not a flag was meant for it.\n *\n * @throws {AllowDevServicesTakesNoValue}\n */\nexport function assertDevServicesFlag(argv: readonly string[]): void {\n\tfor (let i = 0; i < argv.length; i++) {\n\t\tconst arg = argv[i]!;\n\t\tif (arg.startsWith('--allow-dev-services=')) {\n\t\t\tthrow new AllowDevServicesTakesNoValue(arg.slice(arg.indexOf('=') + 1));\n\t\t}\n\t\tconst next = argv[i + 1];\n\t\tif (arg === '--allow-dev-services' && next && !next.startsWith('-')) {\n\t\t\tthrow new AllowDevServicesTakesNoValue(next);\n\t\t}\n\t}\n}\n\n/** One key a deployed stage needs and its secrets do not hold. */\nexport interface MissingServiceKey {\n\tkey: string;\n\t/** The construct that reads it. */\n\tid: string;\n\t/** What it is, for the line that names it. */\n\twhat: string;\n\t/** A line after `what`, for what else there is to know about it. */\n\tnote?: string;\n\t/** A placeholder value to show in the `gkm secrets:set` line. */\n\texample: string;\n\t/** The dev service that would stand in for it, unless the stage accounts for it. */\n\tservice?: DevService;\n\t/** The apps that read it, where known. */\n\tapps?: readonly string[];\n\t/** What creates it, where a provider backs it on the stage. */\n\thint?: string;\n}\n\n/**\n * A deployed stage with mail or object storage that its secrets do not\n * configure — every missing key, across every app, at once.\n */\nexport class ExternalServicesNotConfigured extends GkmError {\n\tconstructor(\n\t\treadonly stage: string,\n\t\treadonly missing: readonly MissingServiceKey[],\n\t) {\n\t\tconst standIns = missing.some((m) => m.service !== undefined);\n\t\tconst lines = missing.map((m) => {\n\t\t\tconst by = m.apps?.length ? `, read by ${m.apps.join(', ')}` : '';\n\t\t\treturn (\n\t\t\t\t` gkm secrets:set ${m.key} '${m.example}' --stage ${stage}\\n` +\n\t\t\t\t` ${m.what}${by}` +\n\t\t\t\t(m.note ? `\\n ${m.note}` : '') +\n\t\t\t\t(m.hint ? `\\n ${m.hint}` : '')\n\t\t\t);\n\t\t});\n\t\tsuper(\n\t\t\t`The stage '${stage}' is deployed, and a deployed stage's mail and ` +\n\t\t\t\t`object storage are real services: gkm runs no Mailpit or MinIO for ` +\n\t\t\t\t`it. Set ${missing.length === 1 ? 'this key' : `these ${missing.length} keys`} in the stage's secrets:\\n\\n` +\n\t\t\t\t`${lines.join('\\n')}\\n\\n` +\n\t\t\t\t(standIns\n\t\t\t\t\t? `For a stage that is not production — a preview, a demo — the ` +\n\t\t\t\t\t\t`dev services can run instead, with --allow-dev-services. ` +\n\t\t\t\t\t\t`Mailpit delivers no mail, and MinIO keeps every object on one ` +\n\t\t\t\t\t\t`container's disk.\\n\\n`\n\t\t\t\t\t: '') +\n\t\t\t\t`Or run: gkm secrets:add --stage ${stage}`,\n\t\t);\n\t\tthis.name = 'ExternalServicesNotConfigured';\n\t}\n}\n\n/** A declaration that is mail or object storage. */\nexport interface ServiceDeclaration {\n\tid: string;\n\tkind: 'email' | 'objects' | 'file-server';\n\t/** A file server's bucket. */\n\tof?: string;\n\t/** Mail's local part — its declaration's `from`. */\n\tfrom?: string;\n\t/** The apps that read it, where known. */\n\tapps?: readonly string[];\n}\n\n/** The kinds a deployed stage takes from its secrets, or a dev service. */\nconst SERVICE_KINDS: Readonly<Record<string, ServiceDeclaration['kind']>> = {\n\temail: 'email',\n\tobjects: 'objects',\n\t'file-server': 'file-server',\n};\n\nexport interface StageServiceDeclarationsInput {\n\tmanifest: ConstructManifest;\n}\n\n/**\n * Every mail and storage construct a manifest declares, each with the apps\n * and workers that read it — a process's environment, a site's build args. A\n * file server's reader reads its bucket too.\n *\n * The one list a deploy's readiness check refuses a stage by, every server\n * target decides its dev services from, and `gkm secrets:add` offers — so\n * none of them can disagree.\n */\nexport function stageServiceDeclarations(\n\tinput: StageServiceDeclarationsInput,\n): ServiceDeclaration[] {\n\tconst { manifest } = input;\n\n\t// The construct each key belongs to.\n\tconst owners = new Map<string, string>();\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tif (!SERVICE_KINDS[declaration.kind]) continue;\n\t\towners.set(\n\t\t\tprovidedKeyFor(\n\t\t\t\tid,\n\t\t\t\tdeclaration.kind,\n\t\t\t\tdeclaration.kind === 'objects' ? 'connectionString' : 'url',\n\t\t\t),\n\t\t\tid,\n\t\t);\n\t\tif (declaration.kind === 'email')\n\t\t\towners.set(providedKeyFor(id, declaration.kind, 'from'), id);\n\t\t// Derived from the connection: a site that holds only where the\n\t\t// bucket signs its links still needs the bucket configured.\n\t\tif (declaration.kind === 'objects')\n\t\t\towners.set(providedKeyFor(id, declaration.kind, 'signedOrigin'), id);\n\t}\n\n\t// Who reads which construct.\n\tconst readers = new Map<string, Set<string>>();\n\tconst read = (process: string, keys: Iterable<string>) => {\n\t\tfor (const key of keys) {\n\t\t\tconst id = owners.get(key);\n\t\t\tif (!id) continue;\n\t\t\tconst declaration = manifest[id];\n\t\t\tconst of =\n\t\t\t\tdeclaration?.kind === 'file-server' ? declaration.of : undefined;\n\t\t\tfor (const owner of of ? [id, of] : [id]) {\n\t\t\t\tconst set = readers.get(owner) ?? new Set<string>();\n\t\t\t\tset.add(process);\n\t\t\t\treaders.set(owner, set);\n\t\t\t}\n\t\t}\n\t};\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tconst name = appKey(id);\n\t\tif (\n\t\t\tdeclaration.kind === 'rest-api' ||\n\t\t\tdeclaration.kind === 'websocket-api' ||\n\t\t\tdeclaration.kind === 'site' ||\n\t\t\tdeclaration.kind === 'mobile-app'\n\t\t) {\n\t\t\tread(name, appEnvKeys(manifest, name) ?? []);\n\t\t}\n\t\t// A site's build args, by the keys they rename.\n\t\tif (declaration.kind === 'site') {\n\t\t\tread(name, Object.values(publicEnvFor(declaration, manifest)));\n\t\t}\n\t\tif (declaration.kind === 'worker') {\n\t\t\tread(name, workerEnvKeys(manifest, id) ?? []);\n\t\t}\n\t}\n\n\treturn Object.entries(manifest).flatMap(\n\t\t([id, declaration]): ServiceDeclaration[] => {\n\t\t\tconst kind = SERVICE_KINDS[declaration.kind];\n\t\t\tif (!kind) return [];\n\t\t\tconst apps = [...(readers.get(id) ?? [])].sort();\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid,\n\t\t\t\t\tkind,\n\t\t\t\t\t...(declaration.kind === 'file-server' && declaration.of\n\t\t\t\t\t\t? { of: declaration.of }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(declaration.kind === 'email' && declaration.from\n\t\t\t\t\t\t? { from: declaration.from }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(apps.length ? { apps } : {}),\n\t\t\t\t},\n\t\t\t];\n\t\t},\n\t);\n}\n\nexport interface ExternalServicesInput {\n\tstage: string;\n\t/** Every mail and storage construct something on the stage reads. */\n\tdeclarations: readonly ServiceDeclaration[];\n\t/** The stage's values by key — what `gkm secrets:set` stored. */\n\tsupplied: Readonly<Record<string, string>>;\n\t/**\n\t * `--allow-dev-services`: every construct the stage does not account for\n\t * gets its dev service.\n\t */\n\tallow: boolean;\n\t/** The stage's base domain, for the examples. */\n\tdomain?: string;\n\t/**\n\t * What the stage's providers say, by kind: a kind one backs is accounted\n\t * for, so no dev service stands in for it, and a missing key of it names\n\t * what creates it.\n\t */\n\tproviders?: StageProviderNotes;\n}\n\n/** The stage's providers, as a deploy's checks read them. */\nexport interface StageProviderNotes {\n\tobjects?: StageProviderNote;\n\temail?: StageProviderNote;\n}\n\n/** What the stage's provider says of one kind. */\nexport interface StageProviderNote {\n\t/** A provider (or `false`) backs the kind: no dev service for it. */\n\taccounted: boolean;\n\t/** What creates a missing key of it. */\n\thint?: string;\n}\n\n/** Where a deployed stage's mail and storage come from. */\nexport interface ExternalServices {\n\t/** Keys the stage needs and has not set. Empty when it can deploy. */\n\tmissing: MissingServiceKey[];\n\t/** The buckets the target runs MinIO for. */\n\tminio: string[];\n\t/** The mail constructs the target runs Mailpit for. */\n\tmailpit: string[];\n}\n\n/** One dev service a run uses, and for which constructs. */\nexport interface DevServiceUse {\n\tservice: DevService;\n\tids: string[];\n}\n\n/** A third party's credentials a construct reads: an external API's, or a `Credential`. */\nexport interface CredentialDeclaration {\n\tid: string;\n\tkind: 'external-api' | 'credential';\n\t/** The apps that read it, where known. */\n\tapps?: readonly string[];\n}\n\n/** What a stage-supplied key belongs to. */\nexport type StageKeyKind =\n\t| 'bucket'\n\t| 'email'\n\t| 'file-server'\n\t| 'external-api'\n\t| 'credential'\n\t/** The server a compose stage's stack runs on: `GKM_SERVER_IPV4`. */\n\t| 'server';\n\n/**\n * One key only the stage's secrets can hold — nothing derives it — whether\n * or not it is set.\n */\nexport interface StageKey {\n\tkey: string;\n\t/** The construct that reads it. */\n\tid: string;\n\tkind: StageKeyKind;\n\t/** What it is, for the line that names it. */\n\twhat: string;\n\t/** A line after `what`, for what else there is to know about it. */\n\tnote?: string;\n\t/** A placeholder value to show in the `gkm secrets:set` line. */\n\texample: string;\n\t/** The dev service that would stand in for it, where one can. */\n\tservice?: DevService;\n\t/** What creates it, where a provider backs it on the stage. */\n\thint?: string;\n\t/** A file server's bucket. */\n\tof?: string;\n\t/** The apps that read it, where known. */\n\tapps?: readonly string[];\n}\n\nexport interface StageKeysInput {\n\t/** Whether the stage is the local one, which derives its mail and storage. */\n\tlocal: boolean;\n\t/** Every mail and storage construct something on the stage reads. */\n\tservices?: readonly ServiceDeclaration[];\n\t/** Every third party's credentials something on the stage reads. */\n\tcredentials?: readonly CredentialDeclaration[];\n\t/** The stage's base domain, for the examples. */\n\tdomain?: string;\n\t/** What the stage's providers say — see {@link StageProviderNotes}. */\n\tproviders?: StageProviderNotes;\n\t/**\n\t * The stage serves a domain from a server of its own — a compose stage —\n\t * so its secrets hold the server's address, `GKM_SERVER_IPV4`.\n\t */\n\tserver?: boolean;\n}\n\n/**\n * Every key a stage must be given rather than derive — the one list both a\n * deploy's checks and `gkm secrets:add` read, so what a deploy refuses and\n * what the builder offers cannot drift.\n *\n * - Deployed, mail is its URL and its sending address, a bucket its URL, and\n * a file server its public URL. Locally all of it is Mailpit and MinIO.\n * - On every stage, a third party's credentials: nobody but the third party\n * can issue them.\n *\n * Never a derived value: a database URL, a generated secret, the seed.\n */\nexport function requiredStageKeys(input: StageKeysInput): StageKey[] {\n\tconst domain = input.domain ?? 'example.com';\n\tconst keys: StageKey[] = [];\n\tconst add = (entry: StageKey) => {\n\t\tif (!keys.some((k) => k.key === entry.key)) keys.push(entry);\n\t};\n\tconst byId = <T extends { id: string }>(list: readonly T[] | undefined) =>\n\t\t[...(list ?? [])].sort((a, b) => a.id.localeCompare(b.id));\n\tconst apps = (d: { apps?: readonly string[] }) =>\n\t\td.apps?.length ? { apps: [...d.apps].sort() } : {};\n\n\tif (!input.local) {\n\t\tconst services = byId(input.services);\n\t\t// A kind a provider backs on the stage has no dev service, and a key of\n\t\t// it names what creates it.\n\t\tconst backing = (\n\t\t\tnote: StageProviderNote | undefined,\n\t\t\tservice: DevService,\n\t\t) =>\n\t\t\tnote?.accounted ? (note.hint ? { hint: note.hint } : {}) : { service };\n\t\tconst storage = backing(input.providers?.objects, 'minio');\n\t\tconst mail = backing(input.providers?.email, 'mailpit');\n\t\tfor (const d of services.filter((d) => d.kind === 'email')) {\n\t\t\tadd({\n\t\t\t\tkey: providedKeyFor(d.id, 'email', 'url'),\n\t\t\t\tid: d.id,\n\t\t\t\tkind: 'email',\n\t\t\t\twhat: `where '${d.id}' sends mail — any SMTP server`,\n\t\t\t\texample: `smtp://user:password@smtp.${domain}:587`,\n\t\t\t\t...mail,\n\t\t\t\t...apps(d),\n\t\t\t});\n\t\t\tadd({\n\t\t\t\tkey: providedKeyFor(d.id, 'email', 'from'),\n\t\t\t\tid: d.id,\n\t\t\t\tkind: 'email',\n\t\t\t\twhat: `the address '${d.id}' sends from, on a domain the mail server has verified`,\n\t\t\t\texample: senderAddress(d, domain),\n\t\t\t\t...mail,\n\t\t\t\t...apps(d),\n\t\t\t});\n\t\t}\n\t\tfor (const d of services.filter((d) => d.kind === 'objects')) {\n\t\t\tadd({\n\t\t\t\tkey: providedKeyFor(d.id, 'objects', 'connectionString'),\n\t\t\t\tid: d.id,\n\t\t\t\tkind: 'bucket',\n\t\t\t\twhat: `the bucket '${d.id}' — S3, R2, or any S3-compatible store (add &endpoint=… for one that is not S3)`,\n\t\t\t\tnote: `credentials are optional: a key for this bucket alone in the URL (s3://KEY:SECRET@${appKey(d.id)}?…) wins; without one, the shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or a role signs`,\n\t\t\t\texample: `s3://${appKey(d.id)}?region=eu-west-1`,\n\t\t\t\t...storage,\n\t\t\t\t...apps(d),\n\t\t\t});\n\t\t}\n\t\tfor (const d of services.filter((d) => d.kind === 'file-server')) {\n\t\t\tadd({\n\t\t\t\tkey: providedKeyFor(d.id, 'file-server', 'url'),\n\t\t\t\tid: d.id,\n\t\t\t\tkind: 'file-server',\n\t\t\t\twhat: `the public address '${d.id}' serves its bucket on — a CDN or the bucket's own domain`,\n\t\t\t\texample: `https://${fileServerLabel(d.id)}.${domain}`,\n\t\t\t\t...storage,\n\t\t\t\t...(d.of ? { of: d.of } : {}),\n\t\t\t\t...apps(d),\n\t\t\t});\n\t\t}\n\t}\n\n\tif (!input.local && input.server) {\n\t\tadd({\n\t\t\tkey: SERVER_IPV4_KEY,\n\t\t\tid: 'server',\n\t\t\tkind: 'server',\n\t\t\twhat: \"the public IPv4 address of the server the stage's stack runs on — its hosts' DNS records point at it, and every deploy checks they do\",\n\t\t\tnote: `${SERVER_IPV6_KEY} adds its IPv6 address (AAAA records); neither is ever handed to an app`,\n\t\t\texample: '203.0.113.10',\n\t\t});\n\t}\n\n\tfor (const d of byId(input.credentials)) {\n\t\tadd({\n\t\t\tkey: providedKeyFor(d.id, d.kind, 'credentials'),\n\t\t\tid: d.id,\n\t\t\tkind: d.kind,\n\t\t\twhat:\n\t\t\t\td.kind === 'external-api'\n\t\t\t\t\t? `the credentials '${d.id}' was issued for this stage, as its schema describes them`\n\t\t\t\t\t: `the credential '${d.id}', as its schema describes it`,\n\t\t\texample: '{\"apiKey\":\"…\"}',\n\t\t\t...apps(d),\n\t\t});\n\t}\n\n\treturn keys;\n}\n\n/**\n * Whether only the stage's secrets can supply `key` to a construct of `kind`\n * — what nothing on the stage derives.\n *\n * A third party's credentials, always. Deployed, also each generated secret\n * and keyring: the stage generated each one once, and every run reads the\n * same value back.\n */\nexport function suppliedOnly(\n\tkind: string,\n\tid: string,\n\tkey: string,\n\tlocal: boolean,\n): boolean {\n\tif (kind === 'credential') return true;\n\tif (kind === 'external-api')\n\t\treturn key === providedKeyFor(id, 'external-api', 'credentials');\n\tif (local) return false;\n\treturn kind === 'secret' || kind === 'encryption';\n}\n\n/**\n * Where a deployed stage's mail and storage come from, and what it lacks.\n *\n * - Mail is external once its URL is set, and then needs its sending\n * address too. Unset, it is Mailpit where allowed — the address derived\n * unless set — and missing otherwise.\n * - A bucket is external once its URL is set; its credentials, in the URL or\n * the shared pair, are optional. Unset, it is MinIO where allowed, and\n * missing otherwise.\n * - A file server's URL is derived where its bucket is MinIO, unless set;\n * over an external bucket the stage must set it.\n *\n * The keys themselves are {@link requiredStageKeys}'s.\n */\nexport function externalServices(\n\tinput: ExternalServicesInput,\n): ExternalServices {\n\tconst { supplied, allow } = input;\n\tconst has = (key: string) => supplied[key] !== undefined;\n\n\tconst required = requiredStageKeys({\n\t\tlocal: false,\n\t\tservices: input.declarations,\n\t\t...(input.domain ? { domain: input.domain } : {}),\n\t\t...(input.providers ? { providers: input.providers } : {}),\n\t});\n\n\t// A dev service stands in for each construct the stage does not account\n\t// for: no key in its secrets, and no provider backing its kind.\n\tconst standIn = (k: StageKey) =>\n\t\tallow && k.service !== undefined && !has(k.key);\n\tconst mailpit = required\n\t\t.filter(\n\t\t\t(k) =>\n\t\t\t\tk.kind === 'email' && k.key === providedKeyFor(k.id, 'email', 'url'),\n\t\t)\n\t\t.filter(standIn)\n\t\t.map((k) => k.id);\n\tconst minio = required\n\t\t.filter((k) => k.kind === 'bucket')\n\t\t.filter(standIn)\n\t\t.map((k) => k.id);\n\n\tconst covered = (k: StageKey) =>\n\t\t(k.kind === 'email' && mailpit.includes(k.id)) ||\n\t\t(k.kind === 'bucket' && minio.includes(k.id)) ||\n\t\t(k.kind === 'file-server' && k.of !== undefined && minio.includes(k.of));\n\n\tconst missing = required\n\t\t.filter((k) => !has(k.key) && !covered(k))\n\t\t.map(\n\t\t\t({\n\t\t\t\tkey,\n\t\t\t\tid,\n\t\t\t\twhat,\n\t\t\t\tnote,\n\t\t\t\texample,\n\t\t\t\tservice,\n\t\t\t\tapps,\n\t\t\t\thint,\n\t\t\t}): MissingServiceKey => ({\n\t\t\t\tkey,\n\t\t\t\tid,\n\t\t\t\twhat,\n\t\t\t\t...(note ? { note } : {}),\n\t\t\t\texample,\n\t\t\t\t...(service ? { service } : {}),\n\t\t\t\t...(apps ? { apps } : {}),\n\t\t\t\t...(hint ? { hint } : {}),\n\t\t\t}),\n\t\t);\n\n\treturn { missing, minio, mailpit };\n}\n\n/** The dev services a run uses, one entry per service it runs. */\nexport function devServicesUsed(services: ExternalServices): DevServiceUse[] {\n\tconst used: DevServiceUse[] = [];\n\tif (services.mailpit.length > 0) {\n\t\tused.push({ service: 'mailpit', ids: services.mailpit });\n\t}\n\tif (services.minio.length > 0) {\n\t\tused.push({ service: 'minio', ids: services.minio });\n\t}\n\treturn used;\n}\n\n/** The line a run prints for each dev service a deployed stage uses. */\nexport function devServiceWarning(stage: string, use: DevServiceUse): string {\n\tconst what =\n\t\tuse.service === 'mailpit'\n\t\t\t? `Mailpit is catching mail for ${use.ids.join(', ')}. It delivers NO mail: nobody receives a sign-in link, a receipt or a reset`\n\t\t\t: `MinIO is storing ${use.ids.join(', ')}. Every object is on one container's disk, with no replication and no backup`;\n\treturn (\n\t\t`⚠️ DEV SERVICE ON A DEPLOYED STAGE (${stage}): ${what}. It is not ` +\n\t\t`production-grade — set the stage's own keys in its secrets for that.`\n\t);\n}\n\n/**\n * Report each dev service a run uses: a loud line, and a `dev-service.used`\n * event a host can act on.\n */\nexport function reportDevServices(\n\tctx: {\n\t\tstage: string;\n\t\tlogger: { warn(message: string): void };\n\t\temit(event: {\n\t\t\ttype: 'dev-service.used';\n\t\t\tservice: DevService;\n\t\t\tstage: string;\n\t\t\tconstructs: string[];\n\t\t}): void;\n\t},\n\tuses: readonly DevServiceUse[],\n): void {\n\tfor (const use of uses) {\n\t\tctx.logger.warn(`\\n${devServiceWarning(ctx.stage, use)}`);\n\t\tctx.emit({\n\t\t\ttype: 'dev-service.used',\n\t\t\tservice: use.service,\n\t\t\tstage: ctx.stage,\n\t\t\tconstructs: use.ids,\n\t\t});\n\t}\n}\n","/**\n * Providers: what creates the thing a construct is backed by, on a stage.\n *\n * The manifest says a bucket exists (`ObjectStorage`); `deploy.<kind>.<stage>`\n * says what backs it there. A stage that names a provider has gkm *create*\n * the backing resource — when it holds the account's provisioning\n * credentials — and write the connection value into the stage's secrets,\n * where every deploy reads it as if it had been set by hand. A stage that\n * names none is `external`: the value is yours to set, as it always was.\n *\n * | Part | What it is |\n * | ------------------------ | ------------------------------------------------------- |\n * | provisioning credentials | What creates the resource. Never given to an app. |\n * | `ensure()` | Idempotent find-or-create. Records in state. Never deletes. |\n * | runtime credentials | The keys it writes into the stage's secrets. |\n * | `verify()` | The cheap check every deploy runs. |\n *\n * The key under `deploy` is the manifest kind — `objects`, which\n * `ObjectStorage` and `FileServer` produce, `inbox`, `email` — so a kind\n * such as `deploy.cache` slots in beside them with providers of its own.\n */\n\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport type { DeployIdentity } from '../deploy/identity.js';\nimport type { ResourceRecord } from '../deploy/StateStore.js';\nimport type { BoundSubscriber } from '../reconcile/discover.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\n\n/** The manifest kinds a stage can name a provider for. */\nexport const PROVIDER_KINDS = ['objects', 'inbox', 'email'] as const;\n\nexport type ProviderKind = (typeof PROVIDER_KINDS)[number];\n\n/** A provider's own entry: `{ provider: 's3', … }`. */\nexport interface ProviderConfig {\n\tprovider: string;\n}\n\n/**\n * One stage's entry under `deploy.<kind>`:\n *\n * - `'external'` — the default: the stage's secrets hold the key, set by you.\n * - `{ provider, … }` — that provider creates the resource and writes the key.\n * - `false` — the stage has none of this kind; a construct of it is refused.\n */\nexport type StageProviderEntry<C extends ProviderConfig = ProviderConfig> =\n\t| 'external'\n\t| C\n\t| false;\n\n/** One change `ensure()` makes, or — in a dry run — would make. */\nexport interface ProvisionAction {\n\t/** The construct it is for. */\n\tconstruct: string;\n\t/** What it acts on: `bucket acme-shop-prod-uploads`. */\n\tresource: string;\n\t/** What it does: `create`, `set CORS (2 origins)`. */\n\tchange: string;\n}\n\n/** The stage's provisioning record, as `ensure()` reads and writes it. */\nexport interface ProvisionState {\n\t/** A resource recorded by an earlier run. */\n\trecord(key: string): ResourceRecord | undefined;\n\t/** About to be created — written before the call that creates it. */\n\tpending(entry: StateEntry): Promise<void>;\n\t/** Exists, as `id`. */\n\tready(entry: StateEntry, id: string): Promise<void>;\n\t/** When the stage was last deployed, for a rotation to know it was. */\n\treadonly lastDeployedAt?: string;\n}\n\nexport interface StateEntry {\n\t/** `<type>:<name>`, unique within the stage. */\n\tkey: string;\n\ttype: string;\n\tdata?: Record<string, unknown>;\n}\n\n/** What `ensure()` is handed. */\nexport interface EnsureContext<C extends ProviderConfig, K> {\n\tworkspace: NormalizedWorkspace;\n\tmanifest: ConstructManifest;\n\t/**\n\t * Each Worker's subscribers, from discovery — by export and the key its\n\t * deliveries come from. What a provider subscribes on a worker's behalf.\n\t */\n\tsubscribers?: Readonly<Record<string, readonly BoundSubscriber[]>>;\n\tstage: string;\n\tidentity: DeployIdentity;\n\tconfig: C;\n\t/** The provisioning credentials {@link ResourceProvider.credentials} found. */\n\tcredential: K;\n\t/** The stage's secrets as they are now, by key. */\n\tsecrets: Readonly<Record<string, string>>;\n\tstate: ProvisionState;\n\tdryRun: boolean;\n\t/** `--rotate-keys`: issue each runtime key a successor. */\n\trotateKeys: boolean;\n\t/** `--retire-old-keys`: delete a rotated-out key without waiting for a deploy. */\n\tretireOldKeys: boolean;\n\t/**\n\t * Runs `apply` and records `action` — or, in a dry run, only records it.\n\t * Every write to the provider's account goes through here.\n\t */\n\tchange(action: ProvisionAction, apply: () => Promise<void>): Promise<void>;\n\t/**\n\t * Writes keys into the stage's secrets now — not at the end of the run, so\n\t * a secret the account shows only once is kept the moment it exists. A dry\n\t * run writes nothing.\n\t */\n\twriteSecrets(values: Record<string, string>): Promise<void>;\n\t/**\n\t * Writes DNS records through the stage's DNS providers (`dns`), as the\n\t * deploy's own DNS step does — what a certificate's validation record and\n\t * a CDN's name, a domain's inbound mail (MX) need. A dry run prints them\n\t * and writes nothing.\n\t */\n\twriteDns(records: readonly ProviderDnsRecord[]): Promise<ProviderDnsResult>;\n\tlog(line: string): void;\n}\n\n/** One record a provider asks the stage's DNS for. */\nexport type ProviderDnsRecord =\n\t| {\n\t\t\t/** The full name: `_abc.files.example.com`. */\n\t\t\thost: string;\n\t\t\ttype: 'CNAME';\n\t\t\tvalue: string;\n\t }\n\t| {\n\t\t\t/** The full name: `example.com`, `*.example.com`. */\n\t\t\thost: string;\n\t\t\ttype: 'MX';\n\t\t\t/** The mail server: `inbound-smtp.eu-west-1.amazonaws.com`. */\n\t\t\tvalue: string;\n\t\t\t/** Lower is preferred: `10`. */\n\t\t\tpriority: number;\n\t };\n\n/** What writing a provider's records came to. */\nexport interface ProviderDnsResult {\n\t/**\n\t * Hosts no DNS provider wrote — under no domain in `dns`, or a `manual`\n\t * one — printed for the person to create.\n\t */\n\tmanual: string[];\n}\n\n/** What `verify()` is handed. */\nexport interface VerifyContext<C extends ProviderConfig> {\n\tworkspace: NormalizedWorkspace;\n\tmanifest: ConstructManifest;\n\tstage: string;\n\tconfig: C;\n\t/** The stage's secrets, by key. */\n\tsecrets: Readonly<Record<string, string>>;\n\t/**\n\t * What the stage's state records, by key — how a provider knows a key it\n\t * checks was issued moments ago. Absent when nothing was read.\n\t */\n\tresources?: Readonly<Record<string, ResourceRecord>>;\n\t/** Progress worth printing: waiting on something. */\n\tlog?: (line: string) => void;\n}\n\n/** Where a provider's provisioning credentials are looked for. */\nexport interface CredentialLookup {\n\tstage: string;\n\t/** `--profile`, when given. */\n\tprofile?: string;\n\tenv: NodeJS.ProcessEnv;\n\t/** The CLI's home, for stored logins. */\n\thome?: string;\n}\n\n/**\n * A provider. `C` is its config entry, `K` its provisioning credential.\n *\n * Built-ins are registered in `providers/registry.ts`, the way a deploy\n * target's built-ins are.\n */\nexport interface ResourceProvider<\n\tC extends ProviderConfig = ProviderConfig,\n\tK = unknown,\n> {\n\treadonly kind: ProviderKind;\n\t/** What `provider:` names it. */\n\treadonly name: string;\n\t/**\n\t * Its config entry checked: returns it, or throws a named error saying\n\t * what is wrong — what the workspace schema runs.\n\t */\n\tcheck(stage: string, config: ProviderConfig): C;\n\t/** How its provisioning credentials are supplied, for messages. */\n\treadonly provisioning: {\n\t\t/** The environment variables it reads. */\n\t\tenv: readonly string[];\n\t\t/** A `gkm login --provider` name, where it has one. */\n\t\tlogin?: string;\n\t\t/** One line saying how to supply them. */\n\t\tdescribe: string;\n\t};\n\t/** Its provisioning credentials, or `undefined` when there are none. */\n\tcredentials(lookup: CredentialLookup): Promise<K | undefined>;\n\t/** The keys it writes into the stage's secrets for these constructs. */\n\truntimeKeys(manifest: ConstructManifest): string[];\n\tensure(ctx: EnsureContext<C, K>): Promise<void>;\n\tverify(ctx: VerifyContext<C>): Promise<void>;\n}\n","/**\n * What a deploy's checks read off `deploy.<kind>.<stage>`, without loading a\n * provider: which kinds the stage accounts for, what creates a missing key,\n * and a kind the stage has none of.\n */\n\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport type { StageProviderNotes } from '../deploy/devServices.js';\nimport { GkmError } from '../errors';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport { provisioningOf, stageProvider } from './config.js';\nimport { PROVIDER_KINDS, type ProviderKind } from './types.js';\n\n/** The constructs of a kind: `objects` is every bucket. */\nexport function constructsOf(manifest: ConstructManifest, kind: ProviderKind) {\n\treturn Object.entries(manifest)\n\t\t.filter(([, d]) => d.kind === kind)\n\t\t.map(([id]) => id)\n\t\t.sort();\n}\n\n/** A stage that names `false` for a kind, and declares constructs of it. */\nexport class StageProviderDisabled extends GkmError {\n\tconstructor(\n\t\treadonly kind: ProviderKind,\n\t\treadonly stage: string,\n\t\treadonly ids: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`deploy.${kind}.${stage} is false — the stage has no ${kind} — and ` +\n\t\t\t\t`${ids.join(', ')} ${ids.length === 1 ? 'is' : 'are'} declared. ` +\n\t\t\t\t`Name what backs ${ids.length === 1 ? 'it' : 'them'} on '${stage}' ` +\n\t\t\t\t`(deploy.${kind}.${stage}: 'external', or a provider), or remove ` +\n\t\t\t\t`the ${ids.length === 1 ? 'construct' : 'constructs'}.`,\n\t\t);\n\t\tthis.name = 'StageProviderDisabled';\n\t}\n}\n\n/** The command a stage's providers are run with: every deploy runs them. */\nexport function provisionCommand(stage: string): string {\n\treturn `gkm deploy --stage ${stage}`;\n}\n\n/**\n * The line a stage missing a key a provider would write is given: what\n * creates it, and with which credentials. Undefined when no provider backs\n * the kind on the stage.\n */\nexport function provisionHint(\n\tworkspace: Pick<NormalizedWorkspace, 'deploy' | 'stages'>,\n\tkind: ProviderKind,\n\tstage: string,\n): string | undefined {\n\tconst choice = stageProvider(workspace as never, kind, stage);\n\tif (choice.mode !== 'provider') return undefined;\n\tconst provisioning = provisioningOf(kind, choice.name);\n\tif (!provisioning) return undefined;\n\treturn (\n\t\t`deploy.${kind}.${stage} is ${choice.name}: the deploy ` +\n\t\t`(${provisionCommand(stage)}) creates it and writes this key, with ` +\n\t\t`${provisioning.describe}` +\n\t\t(provisioning.login\n\t\t\t? `, or gkm login --provider ${provisioning.login}`\n\t\t\t: '')\n\t);\n}\n\n/**\n * What a deploy's checks read off the stage's providers: whether each kind is\n * accounted for — a provider, or `false` — so no dev service stands in for\n * it, and what creates a missing key of it.\n */\nexport function stageProviderNotes(\n\tworkspace: Pick<NormalizedWorkspace, 'deploy' | 'stages'>,\n\tstage: string,\n): StageProviderNotes {\n\tconst notes: StageProviderNotes = {};\n\tfor (const kind of ['objects', 'email'] as const) {\n\t\tif (stageProvider(workspace as never, kind, stage).mode === 'external') {\n\t\t\tcontinue;\n\t\t}\n\t\tconst hint = provisionHint(workspace, kind, stage);\n\t\tnotes[kind] = { accounted: true, ...(hint ? { hint } : {}) };\n\t}\n\treturn notes;\n}\n\n/**\n * A kind the stage set to `false`, declared anyway — refused before anything\n * else is checked. Pure: what a stack is composed from.\n *\n * @throws {StageProviderDisabled}\n */\nexport function assertStageProvidersEnabled(\n\tworkspace: Pick<NormalizedWorkspace, 'deploy' | 'stages'>,\n\tmanifest: ConstructManifest,\n\tstage: string,\n): void {\n\tfor (const kind of PROVIDER_KINDS) {\n\t\tconst ids = constructsOf(manifest, kind);\n\t\tif (ids.length === 0) continue;\n\t\tif (stageProvider(workspace as never, kind, stage).mode === 'none') {\n\t\t\tthrow new StageProviderDisabled(kind, stage, ids);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,eAAe,CAAC,SAAS,SAAS;;;;;;;AAU/C,MAAa,mBAAmB,CAC/B,qBACA,uBACD;;AAGA,IAAa,8BAAb,cAAiD,SAAS;CACpC;CAArB,YAAY,QAAyB;EACpC,MACC,6DAA6D,OAAO,+FAGrE;EALoB,KAAA,SAAA;EAMpB,KAAK,OAAO;CACb;AACD;;;;;;AAOA,IAAa,+BAAb,cAAkD,SAAS;CACrC;CAArB,YAAY,OAAwB;EACnC,MACC,sDAAsD,MAAM,wNAI7D;EANoB,KAAA,QAAA;EAOpB,KAAK,OAAO;CACb;AACD;;;;;;;;;AAUA,SAAgB,sBAAsB,MAA+B;CACpE,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACrC,MAAM,MAAM,KAAK;EACjB,IAAI,IAAI,WAAW,uBAAuB,GACzC,MAAM,IAAI,6BAA6B,IAAI,MAAM,IAAI,QAAQ,GAAG,IAAI,CAAC,CAAC;EAEvE,MAAM,OAAO,KAAK,IAAI;EACtB,IAAI,QAAQ,0BAA0B,QAAQ,CAAC,KAAK,WAAW,GAAG,GACjE,MAAM,IAAI,6BAA6B,IAAI;CAE7C;AACD;;;;;AAyBA,IAAa,gCAAb,cAAmD,SAAS;CAEjD;CACA;CAFV,YACC,OACA,SACC;EACD,MAAM,WAAW,QAAQ,MAAM,MAAM,EAAE,YAAY,KAAA,CAAS;EAC5D,MAAM,QAAQ,QAAQ,KAAK,MAAM;GAChC,MAAM,KAAK,EAAE,MAAM,SAAS,aAAa,EAAE,KAAK,KAAK,IAAI,MAAM;GAC/D,OACC,qBAAqB,EAAE,IAAI,IAAI,EAAE,Q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