@geekmidas/cli 10.0.0-alpha.160 → 10.0.0-alpha.161

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 (219) hide show
  1. package/dist/{GoDaddyProvider-DkUMcMYy.cjs → GoDaddyProvider-CBqsvbER.cjs} +2 -2
  2. package/dist/{GoDaddyProvider-DkUMcMYy.cjs.map → GoDaddyProvider-CBqsvbER.cjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-C9dDlH9I.mjs → GoDaddyProvider-CwqdLM1E.mjs} +2 -2
  4. package/dist/{GoDaddyProvider-C9dDlH9I.mjs.map → GoDaddyProvider-CwqdLM1E.mjs.map} +1 -1
  5. package/dist/{HostingerProvider-9faYOQnQ.cjs → HostingerProvider-DtOtsFkM.cjs} +2 -2
  6. package/dist/{HostingerProvider-9faYOQnQ.cjs.map → HostingerProvider-DtOtsFkM.cjs.map} +1 -1
  7. package/dist/{HostingerProvider-BEuKG2gz.mjs → HostingerProvider-gD4uqzMN.mjs} +2 -2
  8. package/dist/{HostingerProvider-BEuKG2gz.mjs.map → HostingerProvider-gD4uqzMN.mjs.map} +1 -1
  9. package/dist/{LegacyStateStore-DPKhjUR6.mjs → LegacyStateStore-6xsGADme.mjs} +3 -3
  10. package/dist/{LegacyStateStore-DPKhjUR6.mjs.map → LegacyStateStore-6xsGADme.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-C44jUnMH.cjs → LegacyStateStore-C0rm5slD.cjs} +3 -3
  12. package/dist/{LegacyStateStore-C44jUnMH.cjs.map → LegacyStateStore-C0rm5slD.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-BU3fWkcT.mjs → LocalStateStore-G0JHXOVW.mjs} +2 -2
  14. package/dist/{LocalStateStore-BU3fWkcT.mjs.map → LocalStateStore-G0JHXOVW.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-B95WE99i.cjs → LocalStateStore-NBMF3zCb.cjs} +2 -2
  16. package/dist/{LocalStateStore-B95WE99i.cjs.map → LocalStateStore-NBMF3zCb.cjs.map} +1 -1
  17. package/dist/{S3StateStore-zU5kClhd.cjs → S3StateStore-7n6gIYEJ.cjs} +4 -4
  18. package/dist/{S3StateStore-zU5kClhd.cjs.map → S3StateStore-7n6gIYEJ.cjs.map} +1 -1
  19. package/dist/{S3StateStore-Cpbeijr5.mjs → S3StateStore-B7IPTvu0.mjs} +4 -4
  20. package/dist/{S3StateStore-Cpbeijr5.mjs.map → S3StateStore-B7IPTvu0.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-BxkKMBi_.mjs → SSMStateStore-CWEShHLS.mjs} +2 -2
  22. package/dist/{SSMStateStore-BxkKMBi_.mjs.map → SSMStateStore-CWEShHLS.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-D9uviQ3T.cjs → SSMStateStore-O12NeGEg.cjs} +2 -2
  24. package/dist/{SSMStateStore-D9uviQ3T.cjs.map → SSMStateStore-O12NeGEg.cjs.map} +1 -1
  25. package/dist/{add-Dj-gtqTO.mjs → add-C-nlqQgN.mjs} +4 -4
  26. package/dist/{add-Dj-gtqTO.mjs.map → add-C-nlqQgN.mjs.map} +1 -1
  27. package/dist/{add-Bb2IL3Yq.cjs → add-ktNZmJb-.cjs} +4 -4
  28. package/dist/{add-Bb2IL3Yq.cjs.map → add-ktNZmJb-.cjs.map} +1 -1
  29. package/dist/{apps-FRNlECwi.mjs → apps-C7SujLV-.mjs} +3 -3
  30. package/dist/{apps-FRNlECwi.mjs.map → apps-C7SujLV-.mjs.map} +1 -1
  31. package/dist/{apps-0vc4Oz9_.cjs → apps-CtjYJS9e.cjs} +3 -3
  32. package/dist/{apps-0vc4Oz9_.cjs.map → apps-CtjYJS9e.cjs.map} +1 -1
  33. package/dist/{aws-8QQ8n-t6.mjs → aws-C5LAU_Ii.mjs} +10 -2
  34. package/dist/aws-C5LAU_Ii.mjs.map +1 -0
  35. package/dist/{aws-DY9NqQIT.cjs → aws-DKC2m3sT.cjs} +9 -1
  36. package/dist/aws-DKC2m3sT.cjs.map +1 -0
  37. package/dist/{bundler-Bg2eEFEh.cjs → bundler-DGwgZmim.cjs} +6 -6
  38. package/dist/{bundler-Bg2eEFEh.cjs.map → bundler-DGwgZmim.cjs.map} +1 -1
  39. package/dist/{bundler-9EM4ZHcu.mjs → bundler-DnHKVaZz.mjs} +6 -6
  40. package/dist/{bundler-9EM4ZHcu.mjs.map → bundler-DnHKVaZz.mjs.map} +1 -1
  41. package/dist/{cli-CmoSOzNq.mjs → cli-CI9v138l.mjs} +4 -4
  42. package/dist/{cli-CmoSOzNq.mjs.map → cli-CI9v138l.mjs.map} +1 -1
  43. package/dist/{cli-YtLjcAZT.cjs → cli-k2G7rG15.cjs} +4 -4
  44. package/dist/{cli-YtLjcAZT.cjs.map → cli-k2G7rG15.cjs.map} +1 -1
  45. package/dist/{compose-CW1DGfYc.cjs → compose-BD2rwRfn.cjs} +4 -4
  46. package/dist/{compose-CW1DGfYc.cjs.map → compose-BD2rwRfn.cjs.map} +1 -1
  47. package/dist/{compose-3AtZF7ul.mjs → compose-Co-Dt-a4.mjs} +4 -4
  48. package/dist/{compose-3AtZF7ul.mjs.map → compose-Co-Dt-a4.mjs.map} +1 -1
  49. package/dist/{compose-D7gOSspy.cjs → compose-nGgRylPu.cjs} +16 -10
  50. package/dist/compose-nGgRylPu.cjs.map +1 -0
  51. package/dist/{compose-CnXZAYNM.mjs → compose-reJW9x-G.mjs} +16 -10
  52. package/dist/compose-reJW9x-G.mjs.map +1 -0
  53. package/dist/{config-CkuiD9Jv.d.cts → config-C60T2h98.d.cts} +3 -3
  54. package/dist/{config-BNmLn0dw.d.mts.map → config-C60T2h98.d.cts.map} +1 -1
  55. package/dist/{config-BNmLn0dw.d.mts → config-CfI2g_Ho.d.mts} +3 -3
  56. package/dist/{config-CkuiD9Jv.d.cts.map → config-CfI2g_Ho.d.mts.map} +1 -1
  57. package/dist/config.d.cts +3 -3
  58. package/dist/config.d.mts +3 -3
  59. package/dist/{credentials-CjFtNBVH.mjs → credentials-BG1KOq9I.mjs} +11 -7
  60. package/dist/credentials-BG1KOq9I.mjs.map +1 -0
  61. package/dist/{credentials-DwIRfeBL.cjs → credentials-UlL1n_Rd.cjs} +11 -7
  62. package/dist/credentials-UlL1n_Rd.cjs.map +1 -0
  63. package/dist/deploy/public.cjs +11 -11
  64. package/dist/deploy/public.d.cts +4 -4
  65. package/dist/deploy/public.d.mts +4 -4
  66. package/dist/deploy/public.mjs +11 -11
  67. package/dist/{deploy-3bsiWJxj.cjs → deploy-CqIULk0k.cjs} +57 -557
  68. package/dist/deploy-CqIULk0k.cjs.map +1 -0
  69. package/dist/{deploy-BI3fHnyb.mjs → deploy-DRkCNV7f.mjs} +16 -516
  70. package/dist/deploy-DRkCNV7f.mjs.map +1 -0
  71. package/dist/destroy-CMldkiX-.cjs +789 -0
  72. package/dist/destroy-CMldkiX-.cjs.map +1 -0
  73. package/dist/destroy-DXIAL8nF.mjs +788 -0
  74. package/dist/destroy-DXIAL8nF.mjs.map +1 -0
  75. package/dist/{docker-DPdn7tYJ.mjs → docker-DFFzQe2f.mjs} +4 -4
  76. package/dist/{docker-DPdn7tYJ.mjs.map → docker-DFFzQe2f.mjs.map} +1 -1
  77. package/dist/{docker-CwayjAF2.cjs → docker-LwJW3dx_.cjs} +4 -4
  78. package/dist/{docker-CwayjAF2.cjs.map → docker-LwJW3dx_.cjs.map} +1 -1
  79. package/dist/{dokploy-tmnH0Du_.mjs → dokploy-DYm0D6Tp.mjs} +2 -2
  80. package/dist/{dokploy-tmnH0Du_.mjs.map → dokploy-DYm0D6Tp.mjs.map} +1 -1
  81. package/dist/{dokploy-BMBL-_Xu.cjs → dokploy-wTsJqG-N.cjs} +2 -2
  82. package/dist/{dokploy-BMBL-_Xu.cjs.map → dokploy-wTsJqG-N.cjs.map} +1 -1
  83. package/dist/{eas-BVGQAUDc.mjs → eas-BJ_Zlvm8.mjs} +2 -2
  84. package/dist/{eas-BVGQAUDc.mjs.map → eas-BJ_Zlvm8.mjs.map} +1 -1
  85. package/dist/{eas-meN1xady.cjs → eas-C4EkjTGJ.cjs} +2 -2
  86. package/dist/{eas-meN1xady.cjs.map → eas-C4EkjTGJ.cjs.map} +1 -1
  87. package/dist/{encryption-DvFVZdGz.cjs → encryption-BQEqqrGq.cjs} +2 -2
  88. package/dist/{encryption-DvFVZdGz.cjs.map → encryption-BQEqqrGq.cjs.map} +1 -1
  89. package/dist/{encryption-C8AMbomA.mjs → encryption-Cu5YTs9V.mjs} +2 -2
  90. package/dist/{encryption-C8AMbomA.mjs.map → encryption-Cu5YTs9V.mjs.map} +1 -1
  91. package/dist/{engine-BmiIUVWa.cjs → engine-DdRauUQC.cjs} +9 -9
  92. package/dist/{engine-BmiIUVWa.cjs.map → engine-DdRauUQC.cjs.map} +1 -1
  93. package/dist/{engine-BbWj0w3F.mjs → engine-q8aCVbLH.mjs} +9 -9
  94. package/dist/{engine-BbWj0w3F.mjs.map → engine-q8aCVbLH.mjs.map} +1 -1
  95. package/dist/{github-Dc1daUbH.mjs → github-CoXirRes.mjs} +9 -8
  96. package/dist/{github-Dc1daUbH.mjs.map → github-CoXirRes.mjs.map} +1 -1
  97. package/dist/{github-BWqQr8q6.cjs → github-OVZF2k0L.cjs} +13 -12
  98. package/dist/{github-BWqQr8q6.cjs.map → github-OVZF2k0L.cjs.map} +1 -1
  99. package/dist/{googlePlay-CdVCdfU8.cjs → googlePlay-CUeTUT7s.cjs} +4 -4
  100. package/dist/{googlePlay-CdVCdfU8.cjs.map → googlePlay-CUeTUT7s.cjs.map} +1 -1
  101. package/dist/{googlePlay-ByaFUly7.mjs → googlePlay-HXRRVq0l.mjs} +4 -4
  102. package/dist/{googlePlay-ByaFUly7.mjs.map → googlePlay-HXRRVq0l.mjs.map} +1 -1
  103. package/dist/iam-6LH6wptf.cjs +618 -0
  104. package/dist/iam-6LH6wptf.cjs.map +1 -0
  105. package/dist/iam-c0e8m04X.mjs +509 -0
  106. package/dist/iam-c0e8m04X.mjs.map +1 -0
  107. package/dist/{index-Dv1Zj86i.d.mts → index-DDY0cZCo.d.cts} +2 -2
  108. package/dist/{index-B35vTdAW.d.cts.map → index-DDY0cZCo.d.cts.map} +1 -1
  109. package/dist/{index-B35vTdAW.d.cts → index-DWNwkcy7.d.mts} +2 -2
  110. package/dist/{index-Dv1Zj86i.d.mts.map → index-DWNwkcy7.d.mts.map} +1 -1
  111. package/dist/index.cjs +98 -77
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.mjs +98 -77
  114. package/dist/index.mjs.map +1 -1
  115. package/dist/{local-CnVFHJjS.mjs → local-CCJ-T37d.mjs} +2 -2
  116. package/dist/{local-CnVFHJjS.mjs.map → local-CCJ-T37d.mjs.map} +1 -1
  117. package/dist/{local-qevrV6dZ.cjs → local-Dx0o6vfp.cjs} +2 -2
  118. package/dist/{local-qevrV6dZ.cjs.map → local-Dx0o6vfp.cjs.map} +1 -1
  119. package/dist/{migrate-DgfKZB41.mjs → migrate-BkwSXhxv.mjs} +4 -4
  120. package/dist/{migrate-DgfKZB41.mjs.map → migrate-BkwSXhxv.mjs.map} +1 -1
  121. package/dist/{migrate-CU8_ZWP1.cjs → migrate-CJoKOCGY.cjs} +4 -4
  122. package/dist/{migrate-CU8_ZWP1.cjs.map → migrate-CJoKOCGY.cjs.map} +1 -1
  123. package/dist/{migrate-CRRps1i6.cjs → migrate-DEsYfgzn.cjs} +4 -4
  124. package/dist/{migrate-CRRps1i6.cjs.map → migrate-DEsYfgzn.cjs.map} +1 -1
  125. package/dist/{migrate-BEuCcCwN.mjs → migrate-Dr0BeWsY.mjs} +4 -4
  126. package/dist/{migrate-BEuCcCwN.mjs.map → migrate-Dr0BeWsY.mjs.map} +1 -1
  127. package/dist/{notes-CIzrdBKE.mjs → notes-BOyzuPqr.mjs} +2 -2
  128. package/dist/{notes-CIzrdBKE.mjs.map → notes-BOyzuPqr.mjs.map} +1 -1
  129. package/dist/{notes-BrBnyZz5.cjs → notes-VFPa51Pd.cjs} +2 -2
  130. package/dist/{notes-BrBnyZz5.cjs.map → notes-VFPa51Pd.cjs.map} +1 -1
  131. package/dist/openapi.d.cts +1 -1
  132. package/dist/openapi.d.mts +1 -1
  133. package/dist/{projectBucket-CDJd3prK.mjs → projectBucket-B26ucBRI.mjs} +2 -2
  134. package/dist/{projectBucket-CDJd3prK.mjs.map → projectBucket-B26ucBRI.mjs.map} +1 -1
  135. package/dist/{projectBucket-CKr_zObJ.cjs → projectBucket-CWpY3Vxv.cjs} +2 -2
  136. package/dist/{projectBucket-CKr_zObJ.cjs.map → projectBucket-CWpY3Vxv.cjs.map} +1 -1
  137. package/dist/{publish-Bq96_QnK.mjs → publish-Bg4iffje.mjs} +2 -2
  138. package/dist/{publish-Bq96_QnK.mjs.map → publish-Bg4iffje.mjs.map} +1 -1
  139. package/dist/{publish-DMKXh1Tb.cjs → publish-IjcRoorJ.cjs} +2 -2
  140. package/dist/{publish-DMKXh1Tb.cjs.map → publish-IjcRoorJ.cjs.map} +1 -1
  141. package/dist/reconcile/public.d.cts +1 -1
  142. package/dist/reconcile/public.d.mts +1 -1
  143. package/dist/{resolve-DF9GrosZ.cjs → resolve-CgVDhWW8.cjs} +4 -4
  144. package/dist/{resolve-DF9GrosZ.cjs.map → resolve-CgVDhWW8.cjs.map} +1 -1
  145. package/dist/{resolve-CSsE7frp.mjs → resolve-rw7mLp5E.mjs} +4 -4
  146. package/dist/{resolve-CSsE7frp.mjs.map → resolve-rw7mLp5E.mjs.map} +1 -1
  147. package/dist/{rollback-CZthwqus.mjs → rollback-Cv02Cnky.mjs} +6 -6
  148. package/dist/{rollback-CZthwqus.mjs.map → rollback-Cv02Cnky.mjs.map} +1 -1
  149. package/dist/{rollback-BBFGGmMa.cjs → rollback-vdkPi_Rm.cjs} +6 -6
  150. package/dist/{rollback-BBFGGmMa.cjs.map → rollback-vdkPi_Rm.cjs.map} +1 -1
  151. package/dist/{runtime-CFvcLEJW.d.cts → runtime-D-rOcRoq.d.cts} +2 -2
  152. package/dist/{runtime-CFvcLEJW.d.cts.map → runtime-D-rOcRoq.d.cts.map} +1 -1
  153. package/dist/{runtime-dwsH6ddo.d.mts → runtime-DG1mNh_5.d.mts} +2 -2
  154. package/dist/{runtime-dwsH6ddo.d.mts.map → runtime-DG1mNh_5.d.mts.map} +1 -1
  155. package/dist/{s3-CI2QYgXH.cjs → s3-DIvAtJwk.cjs} +27 -2
  156. package/dist/s3-DIvAtJwk.cjs.map +1 -0
  157. package/dist/{s3-BBRkezf7.mjs → s3-DmsM_V2R.mjs} +28 -3
  158. package/dist/s3-DmsM_V2R.mjs.map +1 -0
  159. package/dist/{secretsManager-CQORubp9.mjs → secretsManager-CJyxFcBH.mjs} +18 -2
  160. package/dist/secretsManager-CJyxFcBH.mjs.map +1 -0
  161. package/dist/{secretsManager-RAGcEDX1.cjs → secretsManager-D8on44WI.cjs} +17 -1
  162. package/dist/secretsManager-D8on44WI.cjs.map +1 -0
  163. package/dist/{seeds-B3xvUAQf.cjs → seeds-D7q1zKCJ.cjs} +7 -1
  164. package/dist/{seeds-B3xvUAQf.cjs.map → seeds-D7q1zKCJ.cjs.map} +1 -1
  165. package/dist/{seeds-BCC8vAXR.mjs → seeds-y1rzXlAc.mjs} +2 -2
  166. package/dist/{seeds-BCC8vAXR.mjs.map → seeds-y1rzXlAc.mjs.map} +1 -1
  167. package/dist/{serverSetup-C4iAABtI.mjs → serverSetup-CvcN4zJQ.mjs} +6 -6
  168. package/dist/{serverSetup-C4iAABtI.mjs.map → serverSetup-CvcN4zJQ.mjs.map} +1 -1
  169. package/dist/{serverSetup-Dt2DTlwa.cjs → serverSetup-qXIRRhgw.cjs} +6 -6
  170. package/dist/{serverSetup-Dt2DTlwa.cjs.map → serverSetup-qXIRRhgw.cjs.map} +1 -1
  171. package/dist/{sniffer-bTrGuu9z.cjs → sniffer-CGfL25Bc.cjs} +7 -7
  172. package/dist/{sniffer-bTrGuu9z.cjs.map → sniffer-CGfL25Bc.cjs.map} +1 -1
  173. package/dist/{sniffer-C2Ot1IbK.mjs → sniffer-DuKVVAs_.mjs} +7 -7
  174. package/dist/{sniffer-C2Ot1IbK.mjs.map → sniffer-DuKVVAs_.mjs.map} +1 -1
  175. package/dist/{snsSubscriptions-CFKb7fv0.cjs → snsSubscriptions-DPfGjpuB.cjs} +8 -2
  176. package/dist/{snsSubscriptions-CFKb7fv0.cjs.map → snsSubscriptions-DPfGjpuB.cjs.map} +1 -1
  177. package/dist/{snsSubscriptions-QDDDn9Qi.mjs → snsSubscriptions-nnSUW2Eh.mjs} +3 -3
  178. package/dist/{snsSubscriptions-QDDDn9Qi.mjs.map → snsSubscriptions-nnSUW2Eh.mjs.map} +1 -1
  179. package/dist/{sst-DDRWlXdv.mjs → sst-Bw7686br.mjs} +4 -4
  180. package/dist/{sst-DDRWlXdv.mjs.map → sst-Bw7686br.mjs.map} +1 -1
  181. package/dist/{sst-iRdMlGKd.cjs → sst-Md7c1UC_.cjs} +4 -4
  182. package/dist/{sst-iRdMlGKd.cjs.map → sst-Md7c1UC_.cjs.map} +1 -1
  183. package/dist/{stack-CIOY44aC.mjs → stack-D2cLLaO-.mjs} +6 -6
  184. package/dist/{stack-CIOY44aC.mjs.map → stack-D2cLLaO-.mjs.map} +1 -1
  185. package/dist/{stack-B9iDYMrq.cjs → stack-DTcnynGb.cjs} +6 -6
  186. package/dist/{stack-B9iDYMrq.cjs.map → stack-DTcnynGb.cjs.map} +1 -1
  187. package/dist/{stage-DA74aD_V.mjs → stage-Bw3bJ7Au.mjs} +5 -5
  188. package/dist/{stage-DA74aD_V.mjs.map → stage-Bw3bJ7Au.mjs.map} +1 -1
  189. package/dist/{stage-ycFS9mVn.cjs → stage-RLOenlHV.cjs} +5 -5
  190. package/dist/{stage-ycFS9mVn.cjs.map → stage-RLOenlHV.cjs.map} +1 -1
  191. package/dist/target/public.cjs +1 -1
  192. package/dist/target/public.d.cts +2 -2
  193. package/dist/target/public.d.mts +2 -2
  194. package/dist/target/public.mjs +1 -1
  195. package/dist/{terminal-RxfbNUwl.cjs → terminal-C-_cMKTY.cjs} +2 -2
  196. package/dist/{terminal-RxfbNUwl.cjs.map → terminal-C-_cMKTY.cjs.map} +1 -1
  197. package/dist/{terminal-DX22WLvT.mjs → terminal-Dq29bK3u.mjs} +2 -2
  198. package/dist/{terminal-DX22WLvT.mjs.map → terminal-Dq29bK3u.mjs.map} +1 -1
  199. package/dist/{types-Dk--xVOT.d.cts → types-CvucX3yD.d.mts} +7 -2
  200. package/dist/types-CvucX3yD.d.mts.map +1 -0
  201. package/dist/{types-DwQYpd_0.d.mts → types-D1C8pUyh.d.cts} +8 -1
  202. package/dist/types-D1C8pUyh.d.cts.map +1 -0
  203. package/dist/workspace/index.d.cts +2 -2
  204. package/dist/workspace/index.d.mts +2 -2
  205. package/package.json +15 -15
  206. package/dist/aws-8QQ8n-t6.mjs.map +0 -1
  207. package/dist/aws-DY9NqQIT.cjs.map +0 -1
  208. package/dist/compose-CnXZAYNM.mjs.map +0 -1
  209. package/dist/compose-D7gOSspy.cjs.map +0 -1
  210. package/dist/credentials-CjFtNBVH.mjs.map +0 -1
  211. package/dist/credentials-DwIRfeBL.cjs.map +0 -1
  212. package/dist/deploy-3bsiWJxj.cjs.map +0 -1
  213. package/dist/deploy-BI3fHnyb.mjs.map +0 -1
  214. package/dist/s3-BBRkezf7.mjs.map +0 -1
  215. package/dist/s3-CI2QYgXH.cjs.map +0 -1
  216. package/dist/secretsManager-CQORubp9.mjs.map +0 -1
  217. package/dist/secretsManager-RAGcEDX1.cjs.map +0 -1
  218. package/dist/types-Dk--xVOT.d.cts.map +0 -1
  219. package/dist/types-DwQYpd_0.d.mts.map +0 -1
@@ -1,24 +1,24 @@
1
1
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
- import { M as initStageSecrets, X as deployIdentity, Y as applicationName, a as findRootDomain, bt as gkmHome, d as mxValue, h as createEmptyState, i as extractSubdomain, k as secretsStoreFor, m as createComposeState, o as normalizeDnsConfig, r as storedCredentials } from "./credentials-CjFtNBVH.mjs";
3
- import { $ as BucketOwnedByAnotherProject, G as checkSesConfig, J as S3_PROVISIONING, K as InboxNotProvisioned, L as resolveStageTelemetry, N as assertDeployedStage, Q as BucketNameUnavailable, U as stageProvider, W as SES_PROVISIONING, X as AccessKeyLimit, Y as checkS3Config, Z as BucketKeySetElsewhere, at as RecordedBucketUnreachable, et as BucketProbeFailed, it as ProvisionedBucketUnreachable, nt as BucketRegionUnknown, ot as RotationInProgress, q as SesReceivingUnsupported, rt as IamUserNotOwned, st as S3RegionRequired, tt as BucketRegionMismatch, u as getAppBuildOrder, yt as isReservedStageKey } from "./workspace-DFGsrjGD.mjs";
4
- import { A as originSecretKey, D as ORIGIN_VERIFY_HEADER, Et as mergeLifecycle, Gt as backupExpiries, Xt as deploysWithCompose, Yt as stageBackups, dt as BACKUPS_URL_KEY, f as constructGlobs, j as processorOriginHost, k as newOriginSecret, qt as backupsPrefix, t as appEnvKeys, ut as BACKUPS_SERVICE, zt as usesTelemetry } from "./apps-FRNlECwi.mjs";
2
+ import { M as initStageSecrets, X as deployIdentity, Y as applicationName, a as findRootDomain, bt as gkmHome, d as mxValue, h as createEmptyState, i as extractSubdomain, k as secretsStoreFor, m as createComposeState, o as normalizeDnsConfig, r as storedCredentials } from "./credentials-BG1KOq9I.mjs";
3
+ import { $ as BucketOwnedByAnotherProject, G as checkSesConfig, J as S3_PROVISIONING, K as InboxNotProvisioned, L as resolveStageTelemetry, N as assertDeployedStage, Q as BucketNameUnavailable, U as stageProvider, W as SES_PROVISIONING, Y as checkS3Config, at as RecordedBucketUnreachable, et as BucketProbeFailed, it as ProvisionedBucketUnreachable, nt as BucketRegionUnknown, q as SesReceivingUnsupported, st as S3RegionRequired, tt as BucketRegionMismatch, u as getAppBuildOrder, yt as isReservedStageKey } from "./workspace-DFGsrjGD.mjs";
4
+ import { A as originSecretKey, D as ORIGIN_VERIFY_HEADER, Et as mergeLifecycle, Gt as backupExpiries, Xt as deploysWithCompose, Yt as stageBackups, dt as BACKUPS_URL_KEY, f as constructGlobs, j as processorOriginHost, k as newOriginSecret, qt as backupsPrefix, t as appEnvKeys, ut as BACKUPS_SERVICE, zt as usesTelemetry } from "./apps-C7SujLV-.mjs";
5
5
  import { o as builtinTarget } from "./define-6poNqm5O.mjs";
6
- import { at as resolveHost, it as isMainFrontendApp, nt as NoDomainForStage } from "./compose-3AtZF7ul.mjs";
6
+ import { at as resolveHost, it as isMainFrontendApp, nt as NoDomainForStage } from "./compose-Co-Dt-a4.mjs";
7
7
  import { s as subscriberRoute } from "./SubscriberGenerator-BybB6uez.mjs";
8
8
  import { _ as withLoadedConfig, l as findWorkspaceRoot, m as loadWorkspaceConfig, v as appKey, y as derivedApps } from "./config-DWTUVGRE.mjs";
9
9
  import { _ as withSandbox, b as withOutput, i as discover } from "./discover-DbDrCQ8h.mjs";
10
- import { a as parseTargetOptions, o as resolveTarget } from "./resolve-CSsE7frp.mjs";
11
- import { a as PROVIDER_KINDS, c as DevServicesNeedServerTarget, f as devServicesUsed, g as stageServiceDeclarations, i as stageProviderNotes, l as ExternalServicesNotConfigured, m as reportDevServices, n as assertStageProvidersEnabled, p as externalServices } from "./notes-CIzrdBKE.mjs";
12
- import { w as assertSitePasswords } from "./stack-CIOY44aC.mjs";
13
- import { _ as stageDnsDomains, a as subscriptionKey, b as awsEndpoint, d as recordTtl, l as dnsCredentials, m as settleStackDns, o as subscriptionResource, x as awsProvisioningCredentials, y as awsClientConfig } from "./snsSubscriptions-QDDDn9Qi.mjs";
14
- import { t as LocalSandbox } from "./local-CnVFHJjS.mjs";
15
- import { E as eventError, S as createStateStore, v as assertStateOutlivesRun, y as assertStateRoom } from "./sniffer-C2Ot1IbK.mjs";
16
- import { a as findProjectBucket, i as ensureProjectBucket, o as projectBucketName, r as callerAccountId, s as reconcileProjectBucketLifecycle } from "./projectBucket-CDJd3prK.mjs";
17
- import { d as DeployJournal } from "./seeds-BCC8vAXR.mjs";
10
+ import { a as parseTargetOptions, o as resolveTarget } from "./resolve-rw7mLp5E.mjs";
11
+ import { a as PROVIDER_KINDS, c as DevServicesNeedServerTarget, f as devServicesUsed, g as stageServiceDeclarations, i as stageProviderNotes, l as ExternalServicesNotConfigured, m as reportDevServices, n as assertStageProvidersEnabled, p as externalServices } from "./notes-BOyzuPqr.mjs";
12
+ import { w as assertSitePasswords } from "./stack-D2cLLaO-.mjs";
13
+ import { S as awsProvisioningCredentials, a as subscriptionKey, b as awsClientConfig, f as recordTtl, h as settleStackDns, l as dnsCredentials, o as subscriptionResource, v as stageDnsDomains, x as awsEndpoint } from "./snsSubscriptions-nnSUW2Eh.mjs";
14
+ import { t as LocalSandbox } from "./local-CCJ-T37d.mjs";
15
+ import { E as eventError, S as createStateStore, v as assertStateOutlivesRun, y as assertStateRoom } from "./sniffer-DuKVVAs_.mjs";
16
+ import { _ as randomSuffix, a as identityTags, c as bucketPolicy, d as publicAccessBlock, f as userPolicy, g as iamUserName, h as bucketName, i as ensureIamUser, l as canonicalPolicy, o as issuedJustNow, p as IAM_POLICY_NAME, r as ensureAccessKey, s as whileKeyIsNew, t as TAG_PROJECT, u as corsRule, v as suffixedBucketName } from "./iam-c0e8m04X.mjs";
17
+ import { a as findProjectBucket, i as ensureProjectBucket, o as projectBucketName, r as callerAccountId, s as reconcileProjectBucketLifecycle } from "./projectBucket-B26ucBRI.mjs";
18
+ import { f as DeployJournal } from "./seeds-y1rzXlAc.mjs";
18
19
  import { n as assertStageCredentials } from "./credentialSchemas-mz9QZTYh.mjs";
19
20
  import { resolve } from "node:path";
20
- import { randomInt } from "node:crypto";
21
- import { INBOX_MESSAGES_PREFIX, bucketExpiry, dependentsOf, kebabCase, provideKey, providedKeyFor, receiptRecipients } from "@geekmidas/manifest";
21
+ import { INBOX_MESSAGES_PREFIX, bucketExpiry, dependentsOf, provideKey, providedKeyFor, receiptRecipients } from "@geekmidas/manifest";
22
22
  import * as s3Url from "@geekmidas/storage/s3-url";
23
23
  //#region src/target/secrets.ts
24
24
  /**
@@ -79,506 +79,6 @@ async function deploySecrets(workspace, stage, redactor, options = {}) {
79
79
  mask: (value) => redactor.add(value)
80
80
  };
81
81
  }
82
- const SUFFIX_ALPHABET = "abcdefghijklmnopqrstuvwxyz0123456789";
83
- /** A name that S3 would refuse — what the name builder never returns. */
84
- var InvalidBucketName = class extends GkmError {
85
- bucket;
86
- reason;
87
- constructor(bucket, reason) {
88
- super(`'${bucket}' is not a valid S3 bucket name: ${reason}. Rename the construct or set deploy.namespace in gkm.config.ts to something that leaves room for it.`);
89
- this.bucket = bucket;
90
- this.reason = reason;
91
- this.name = "InvalidBucketName";
92
- }
93
- };
94
- /** Lowercase `[a-z0-9-]`, runs of anything else one `-`, no edge dashes. */
95
- function part(value) {
96
- return kebabCase(value).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
97
- }
98
- /**
99
- * `parts` joined by `-`, shortened to `max` characters by trimming the longest
100
- * part one character at a time — so a long construct id gives way before a
101
- * short stage name does, and every part keeps its start.
102
- */
103
- function fitParts(parts, max) {
104
- const kept = parts.map(part).filter(Boolean);
105
- const length = () => kept.reduce((sum, p) => sum + p.length, 0) + kept.length - 1;
106
- while (length() > max) {
107
- let longest = 0;
108
- for (let i = 1; i < kept.length; i++) if (kept[i].length > kept[longest].length) longest = i;
109
- if (kept[longest].length <= 1) break;
110
- kept[longest] = kept[longest].slice(0, -1).replace(/-+$/, "");
111
- }
112
- return kept.join("-");
113
- }
114
- /** Why `name` is not a valid bucket name, or undefined when it is. */
115
- function bucketNameProblem(name) {
116
- if (name.length < 3 || name.length > 63) return `it is ${name.length} characters, and S3 takes 3 to 63`;
117
- if (!/^[a-z0-9-]+$/.test(name)) return "it may hold only lowercase letters, digits and -";
118
- if (!/^[a-z0-9].*[a-z0-9]$/.test(name)) return "it must start and end with a letter or a digit";
119
- if (name.startsWith("xn--") || name.startsWith("sthree-")) return "it starts with a prefix S3 reserves ('xn--', 'sthree-')";
120
- if (name.endsWith("-s3alias") || name.endsWith("--ol-s3")) return "it ends with a suffix S3 reserves ('-s3alias', '--ol-s3')";
121
- }
122
- /**
123
- * The good name: `<namespace>-<project>-<stage>-<bucket id>`, lowercased, no
124
- * dots, shortened to leave room for a clash's suffix.
125
- *
126
- * @throws {InvalidBucketName} when nothing usable is left
127
- */
128
- function bucketName(input) {
129
- const name = fitParts([
130
- input.scope,
131
- input.stage,
132
- input.id
133
- ], 56);
134
- const problem = bucketNameProblem(name);
135
- if (problem) throw new InvalidBucketName(name, problem);
136
- return name;
137
- }
138
- /** Six random `[a-z0-9]` characters. */
139
- function randomSuffix(random = randomInt) {
140
- let suffix = "";
141
- for (let i = 0; i < 6; i++) suffix += SUFFIX_ALPHABET[random(36)];
142
- return suffix;
143
- }
144
- /** The good name with a clash's suffix. */
145
- function suffixedBucketName(good, suffix) {
146
- return `${good}-${suffix}`;
147
- }
148
- /**
149
- * The IAM user a bucket is reached with on a stage:
150
- * `gkm-<project>-<stage>-<bucket id>`, at most 64 characters.
151
- */
152
- function iamUserName(input) {
153
- return fitParts([
154
- "gkm",
155
- input.scope,
156
- input.stage,
157
- input.id
158
- ], 64);
159
- }
160
- /** The path every user gkm creates is under, so it finds its own. */
161
- const IAM_USER_PATH = "/gkm/";
162
- /** The inline policy each user is given. */
163
- const IAM_POLICY_NAME = "gkm-bucket";
164
- //#endregion
165
- //#region src/providers/s3/policy.ts
166
- const bucketArn = (bucket) => `arn:aws:s3:::${bucket}`;
167
- /**
168
- * What the app's key may do: objects in this bucket, and listing it — and
169
- * nothing else in the account.
170
- *
171
- * Multipart uploads are in it because a presigned upload of a large file is
172
- * one, and an abandoned one is cleaned up by the app. Reading old versions is
173
- * added only when the bucket keeps them.
174
- */
175
- function userPolicy(bucket, options = {}) {
176
- return {
177
- Version: "2012-10-17",
178
- Statement: [
179
- {
180
- Sid: "GkmObjects",
181
- Effect: "Allow",
182
- Action: [
183
- "s3:GetObject",
184
- "s3:PutObject",
185
- "s3:DeleteObject",
186
- "s3:AbortMultipartUpload",
187
- "s3:ListMultipartUploadParts",
188
- ...options.versioning ? ["s3:GetObjectVersion"] : []
189
- ],
190
- Resource: `${bucketArn(bucket)}/*`
191
- },
192
- {
193
- Sid: "GkmBucket",
194
- Effect: "Allow",
195
- Action: [
196
- "s3:ListBucket",
197
- "s3:GetBucketLocation",
198
- "s3:ListBucketMultipartUploads"
199
- ],
200
- Resource: bucketArn(bucket)
201
- },
202
- ...options.eventsTopicArn ? [{
203
- Sid: "GkmEvents",
204
- Effect: "Allow",
205
- Action: "sns:ConfirmSubscription",
206
- Resource: options.eventsTopicArn
207
- }] : []
208
- ]
209
- };
210
- }
211
- /**
212
- * One open pattern as the resource it is public on. A `**` is S3's `*`; a
213
- * single `*` is too, which crosses `/` where the construct's own check does
214
- * not — the construct is the stricter of the two (see `bucketPolicy` in
215
- * reconcile, which the local MinIO is given the same way).
216
- */
217
- function openResource(bucket, pattern) {
218
- const path = pattern.replace(/^\/+/, "").replace(/\*\*/g, "*");
219
- return `${bucketArn(bucket)}/${path}`;
220
- }
221
- /**
222
- * The bucket's own policy: every request refused unless it came over TLS,
223
- * and — only when a file server opens paths on it — `s3:GetObject` on
224
- * exactly those prefixes: to anyone, or, when a CDN serves them, to
225
- * CloudFront alone, for exactly the stage's distributions. Behind a CDN the
226
- * bucket is never public: a key outside the open prefixes is refused to
227
- * CloudFront too, so the edge answers it 403.
228
- */
229
- function bucketPolicy(bucket, open = [], options = {}) {
230
- const statements = [{
231
- Sid: "GkmDenyInsecureTransport",
232
- Effect: "Deny",
233
- Principal: "*",
234
- Action: "s3:*",
235
- Resource: [bucketArn(bucket), `${bucketArn(bucket)}/*`],
236
- Condition: { Bool: { "aws:SecureTransport": "false" } }
237
- }];
238
- const resources = [...new Set(open.map((p) => openResource(bucket, p)))].sort();
239
- if (open.length > 0 && options.cdn) statements.push({
240
- Sid: "GkmCdnRead",
241
- Effect: "Allow",
242
- Principal: { Service: "cloudfront.amazonaws.com" },
243
- Action: "s3:GetObject",
244
- Resource: resources,
245
- Condition: { StringEquals: { "AWS:SourceArn": [...new Set(options.cdn.distributionArns)].sort() } }
246
- });
247
- else if (open.length > 0) statements.push({
248
- Sid: "GkmOpenPaths",
249
- Effect: "Allow",
250
- Principal: "*",
251
- Action: "s3:GetObject",
252
- Resource: resources
253
- });
254
- if (options.sesWrite) statements.push({
255
- Sid: "GkmSesWritesMail",
256
- Effect: "Allow",
257
- Principal: { Service: "ses.amazonaws.com" },
258
- Action: "s3:PutObject",
259
- Resource: `${bucketArn(bucket)}/${options.sesWrite.prefix}*`,
260
- Condition: { StringEquals: { "aws:SourceAccount": options.sesWrite.account } }
261
- });
262
- return {
263
- Version: "2012-10-17",
264
- Statement: statements
265
- };
266
- }
267
- /**
268
- * Block Public Access. All four flags on, unless the bucket has open paths:
269
- * then a *policy* may make it public (`BlockPublicPolicy`,
270
- * `RestrictPublicBuckets` off), and ACLs still may not.
271
- */
272
- function publicAccessBlock(open) {
273
- return {
274
- BlockPublicAcls: true,
275
- IgnorePublicAcls: true,
276
- BlockPublicPolicy: !open,
277
- RestrictPublicBuckets: !open
278
- };
279
- }
280
- function corsRule(origins) {
281
- return {
282
- AllowedMethods: [
283
- "GET",
284
- "HEAD",
285
- "POST",
286
- "PUT"
287
- ],
288
- AllowedOrigins: [...new Set(origins)].sort(),
289
- AllowedHeaders: ["*"],
290
- ExposeHeaders: ["ETag"],
291
- MaxAgeSeconds: 3e3
292
- };
293
- }
294
- /**
295
- * A policy document in one canonical form — keys sorted, a lone string a
296
- * one-element list, lists sorted — so one AWS reformatted reads as the same
297
- * document rather than as drift.
298
- */
299
- function canonicalPolicy(value) {
300
- return JSON.stringify(canonical(value));
301
- }
302
- function canonical(value, key) {
303
- if (Array.isArray(value)) {
304
- const items = value.map((v) => canonical(v));
305
- return key === "Statement" ? items : items.map((v) => JSON.stringify(v)).sort();
306
- }
307
- if (value && typeof value === "object") return Object.fromEntries(Object.keys(value).sort().map((k) => {
308
- const v = value[k];
309
- return [k, canonical(k === "Action" || k === "Resource" || k === "AWS" || k === "AWS:SourceArn" ? Array.isArray(v) ? v : [v] : v, k)];
310
- }));
311
- return value;
312
- }
313
- //#endregion
314
- //#region src/providers/iam.ts
315
- /**
316
- * An IAM user gkm creates for one thing on a stage, its inline policy, and
317
- * the access key written into the stage's secrets as an `s3://` URL — what
318
- * the `s3` provider gives each bucket, and the deploy gives a stage's
319
- * backups.
320
- *
321
- * - **The user** is under `/gkm/`, tagged with the deploy identity, the stage
322
- * and what it is for. One that exists without those tags is someone
323
- * else's, and is refused rather than taken over.
324
- * - **Its policy** is read on every run and put back when it drifted.
325
- * - **Its key**: one, written into the stage's secrets the moment IAM shows
326
- * its secret. `--rotate-keys` issues a successor and keeps the old one
327
- * active until the stage has deployed with the new one; the next run after
328
- * that — or `--retire-old-keys` — deletes it.
329
- * - **A new key** takes IAM seconds to become usable: the state records when
330
- * it was issued, and a check made with it waits that out
331
- * ({@link whileKeyIsNew}).
332
- */
333
- /** The tags gkm finds its own buckets and users by. */
334
- const TAG_PROJECT = "gkm:project";
335
- const TAG_STAGE = "gkm:stage";
336
- const TAG_CONSTRUCT = "gkm:construct";
337
- /** The keys gkm tags a bucket and a user with. */
338
- function identityTags(ctx, id) {
339
- return [
340
- {
341
- Key: TAG_PROJECT,
342
- Value: ctx.identity.key
343
- },
344
- {
345
- Key: TAG_STAGE,
346
- Value: ctx.stage
347
- },
348
- {
349
- Key: TAG_CONSTRUCT,
350
- Value: id
351
- }
352
- ];
353
- }
354
- /** A read whose "there is none" answer is one of `missing`. */
355
- async function readOr$3(read, missing) {
356
- try {
357
- return await read();
358
- } catch (error) {
359
- const e = error;
360
- if (missing.includes(e?.Code ?? e?.name ?? "")) return void 0;
361
- throw error;
362
- }
363
- }
364
- /** IAM returns a policy document URL-encoded; an emulator may not. */
365
- function decodePolicy(document) {
366
- try {
367
- return decodeURIComponent(document);
368
- } catch {
369
- return document;
370
- }
371
- }
372
- /**
373
- * The user and its inline policy: found — and refused when it is not this
374
- * stage's — or created, and the policy put back when it drifted.
375
- *
376
- * @throws {IamUserNotOwned}
377
- */
378
- async function ensureIamUser(ctx, clients, input) {
379
- const { IAM, iam } = clients;
380
- const { id, user, policy } = input;
381
- const entry = {
382
- key: `iam-user:${id}`,
383
- type: "iam-user"
384
- };
385
- const found = await readOr$3(() => iam.send(new IAM.GetUserCommand({ UserName: user })), ["NoSuchEntity", "NoSuchEntityException"]);
386
- if (found?.User) {
387
- const tags = await iam.send(new IAM.ListUserTagsCommand({ UserName: user }));
388
- const tag = (key) => tags.Tags?.find((t) => t.Key === key)?.Value;
389
- if (found.User.Path !== "/gkm/" || tag("gkm:project") !== ctx.identity.key || tag("gkm:stage") !== ctx.stage) throw new IamUserNotOwned(user, ctx.identity.key, ctx.stage);
390
- await ctx.state.ready(entry, user);
391
- } else await ctx.change({
392
- construct: id,
393
- resource: `IAM user ${user}`,
394
- change: `create under ${IAM_USER_PATH}`
395
- }, async () => {
396
- await ctx.state.pending(entry);
397
- await iam.send(new IAM.CreateUserCommand({
398
- UserName: user,
399
- Path: IAM_USER_PATH,
400
- Tags: identityTags(ctx, id)
401
- }));
402
- await ctx.state.ready(entry, user);
403
- });
404
- const exists = Boolean(found?.User) || !ctx.dryRun;
405
- const current = exists ? await readOr$3(() => iam.send(new IAM.GetUserPolicyCommand({
406
- UserName: user,
407
- PolicyName: input.policyName
408
- })), ["NoSuchEntity", "NoSuchEntityException"]) : void 0;
409
- const document = current?.PolicyDocument ? JSON.parse(decodePolicy(current.PolicyDocument)) : void 0;
410
- if (!document || canonicalPolicy(document) !== canonicalPolicy(policy)) await ctx.change({
411
- construct: id,
412
- resource: `IAM user ${user}`,
413
- change: `policy ${input.policyName}: ${input.describe}`
414
- }, async () => {
415
- await iam.send(new IAM.PutUserPolicyCommand({
416
- UserName: user,
417
- PolicyName: input.policyName,
418
- PolicyDocument: JSON.stringify(policy)
419
- }));
420
- });
421
- return {
422
- user,
423
- exists
424
- };
425
- }
426
- /**
427
- * The user's access key, in the stage's secrets as the bucket's URL.
428
- *
429
- * - First run: one key, written into the stage's secrets.
430
- * - `--rotate-keys`: a second key, written in place of the first; the first
431
- * stays active until the stage has deployed with the second, and the next
432
- * run after that deploy — or `--retire-old-keys` — deletes it.
433
- * - A key the secrets no longer hold (a store emptied by hand): replaced the
434
- * same way, since its secret cannot be read back.
435
- *
436
- * @throws {BucketKeySetElsewhere} when the secret names another bucket
437
- * @throws {RotationInProgress} on `--rotate-keys` with the last rotation's old key still active
438
- * @throws {AccessKeyLimit} when the user has two keys gkm did not record
439
- */
440
- async function ensureAccessKey(ctx, clients, input) {
441
- const { IAM, iam } = clients;
442
- const { id, bucket, user, urlKey } = input;
443
- const entryKey = `iam-access-key:${id}`;
444
- const record = ctx.state.record(entryKey);
445
- const given = ctx.secrets[urlKey];
446
- let inUrl;
447
- let parsed;
448
- if (given !== void 0) {
449
- try {
450
- parsed = s3Url.parse(given);
451
- } catch {
452
- parsed = void 0;
453
- }
454
- if (parsed?.bucket !== bucket) throw new BucketKeySetElsewhere(urlKey, bucket, parsed?.bucket ?? given.replace(/\/\/[^@]*@/, "//"), ctx.stage);
455
- inUrl = parsed.accessKeyId;
456
- }
457
- const listed = input.exists ? (await iam.send(new IAM.ListAccessKeysCommand({ UserName: user }))).AccessKeyMetadata?.map((k) => k.AccessKeyId) ?? [] : [];
458
- let current = record?.status === "ready" ? record.id : void 0;
459
- let previous = typeof record?.data?.previous === "string" ? record.data.previous : void 0;
460
- const rotatedAt = typeof record?.data?.rotatedAt === "string" ? record.data.rotatedAt : void 0;
461
- const entry = (data = {}) => ({
462
- key: entryKey,
463
- type: "iam-access-key",
464
- data: {
465
- user,
466
- ...data
467
- }
468
- });
469
- if (previous && current) {
470
- const deployed = rotatedAt !== void 0 && ctx.state.lastDeployedAt !== void 0 && ctx.state.lastDeployedAt > rotatedAt;
471
- if (ctx.retireOldKeys || deployed) {
472
- const old = previous;
473
- const keep = current;
474
- await ctx.change({
475
- construct: id,
476
- resource: `IAM user ${user}`,
477
- change: `delete the rotated-out access key ${old}`
478
- }, async () => {
479
- if (listed.includes(old)) await iam.send(new IAM.DeleteAccessKeyCommand({
480
- UserName: user,
481
- AccessKeyId: old
482
- }));
483
- await ctx.state.ready(entry(), keep);
484
- });
485
- previous = void 0;
486
- } else ctx.log(` ${id}: the old access key ${previous} stays active until '${ctx.stage}' is deployed with the new one; the next deploy after that deletes it (or pass --retire-old-keys)`);
487
- }
488
- if (!current && inUrl && listed.includes(inUrl)) {
489
- await ctx.state.ready(entry(), inUrl);
490
- current = inUrl;
491
- }
492
- if (current !== void 0 && listed.includes(current) && inUrl === current && !ctx.rotateKeys) {
493
- if (parsed && parsed.region !== clients.region) {
494
- const address = parsed;
495
- await ctx.change({
496
- construct: id,
497
- resource: urlKey,
498
- change: `name ${clients.region}, the bucket's region (it said ${address.region ?? "none"})`
499
- }, () => ctx.writeSecrets({ [urlKey]: s3Url.build({
500
- ...address,
501
- region: clients.region
502
- }) }));
503
- }
504
- return;
505
- }
506
- if (ctx.rotateKeys && previous) throw new RotationInProgress(id, previous, ctx.stage);
507
- const outgoing = current && listed.includes(current) ? current : void 0;
508
- if (listed.length >= 2) throw new AccessKeyLimit(user, listed);
509
- const why = !current ? "create an access key" : ctx.rotateKeys ? "rotate: issue a new access key" : "issue a new access key (the secrets no longer hold the recorded one)";
510
- await ctx.change({
511
- construct: id,
512
- resource: `IAM user ${user}`,
513
- change: why
514
- }, async () => {
515
- await ctx.state.pending(entry(outgoing ? { previous: outgoing } : {}));
516
- const key = (await iam.send(new IAM.CreateAccessKeyCommand({ UserName: user }))).AccessKey;
517
- await ctx.writeSecrets({ [urlKey]: s3Url.build({
518
- bucket,
519
- region: clients.region,
520
- ...clients.endpoint ? {
521
- endpoint: clients.endpoint,
522
- forcePathStyle: true
523
- } : {},
524
- accessKeyId: key.AccessKeyId,
525
- secretAccessKey: key.SecretAccessKey
526
- }) });
527
- const issuedAt = (/* @__PURE__ */ new Date()).toISOString();
528
- await ctx.state.ready(entry(outgoing ? {
529
- previous: outgoing,
530
- rotatedAt: issuedAt,
531
- issuedAt
532
- } : { issuedAt }), key.AccessKeyId);
533
- });
534
- if (outgoing) ctx.log(` ${urlKey} holds the new key. This deploy moves '${ctx.stage}' onto it; the next deploy after it deletes the old key ${outgoing}`);
535
- }
536
- /** How long a key issued this recently counts as new to IAM. */
537
- const NEW_KEY_WINDOW_MS = 6e5;
538
- /** The waits between asks while a new key becomes usable: about a minute. */
539
- let newKeyWaits = [
540
- 2e3,
541
- 4e3,
542
- 8e3,
543
- 15e3,
544
- 15e3,
545
- 15e3
546
- ];
547
- /**
548
- * When the key in a URL was issued, if the stage's state says it was just
549
- * now — the record of `id`'s key naming that very key.
550
- */
551
- function issuedJustNow(resources, id, accessKeyId) {
552
- const record = resources?.[`iam-access-key:${id}`];
553
- const issuedAt = record?.data?.issuedAt;
554
- if (record?.id !== accessKeyId || typeof issuedAt !== "string") return;
555
- const age = Date.now() - Date.parse(issuedAt);
556
- return age >= 0 && age < NEW_KEY_WINDOW_MS ? issuedAt : void 0;
557
- }
558
- /**
559
- * `ask` again, for about a minute, while it is `refused` and the key was
560
- * issued just now — IAM refuses a key for seconds after making it. Returns
561
- * the last answer and how long was waited.
562
- */
563
- async function whileKeyIsNew(first, options) {
564
- let answer = first;
565
- let waited = 0;
566
- if (!options.issuedAt || !options.refused(answer)) return {
567
- answer,
568
- waited
569
- };
570
- options.onWait?.();
571
- for (const wait of newKeyWaits) {
572
- await new Promise((resolve) => setTimeout(resolve, wait));
573
- waited += wait;
574
- answer = await options.ask();
575
- if (!options.refused(answer)) break;
576
- }
577
- return {
578
- answer,
579
- waited
580
- };
581
- }
582
82
  //#endregion
583
83
  //#region src/backups/provision.ts
584
84
  /** What the backups user and its key are recorded and tagged as. */
@@ -3864,6 +3364,6 @@ async function load(input, sandbox) {
3864
3364
  return workspace;
3865
3365
  }
3866
3366
  //#endregion
3867
- export { UnknownDeployApps as a, bucketName as c, TargetBuildsNothing as i, iamUserName as l, NoDeployableApps as n, backupsUserName as o, RollbackFailed as r, IAM_USER_PATH as s, deploy as t };
3367
+ export { UnknownDeployApps as a, defaultCdnClients as c, TargetBuildsNothing as i, backupsUserName as l, NoDeployableApps as n, defaultClients as o, RollbackFailed as r, cdnName as s, deploy as t };
3868
3368
 
3869
- //# sourceMappingURL=deploy-BI3fHnyb.mjs.map
3369
+ //# sourceMappingURL=deploy-DRkCNV7f.mjs.map